Browse Source

Editor building without TS errors or warnings

Josh Engebretson 10 years ago
parent
commit
81f0fc6756

+ 1 - 1
Script/AtomicEditor/assets/AssetImport.ts

@@ -11,7 +11,7 @@ class AssetImport extends Atomic.ScriptObject {
 
   handleDropFile(data):void {
 
-    print("Dropped: ", data.fileName);
+    Atomic.print("Dropped: ", data.fileName);
 
   }
 

+ 33 - 20
Script/AtomicEditor/editor/Editor.ts

@@ -3,6 +3,8 @@ import MainFrame = require("../ui/MainFrame");
 import UIEvents = require("../ui/UIEvents");
 import AssetImport = require("../assets/AssetImport");
 
+import EditorEvents = require("./EditorEvents");
+
 class Editor extends Atomic.ScriptObject {
 
     project: ToolCore.Project;
@@ -12,6 +14,33 @@ class Editor extends Atomic.ScriptObject {
 
     static instance: Editor;
 
+    constructor() {
+
+        super();
+
+        Editor.instance = this;
+
+        Atomic.getResourceCache().autoReloadResources = true;
+
+        this.assetImport = new AssetImport();
+
+        var graphics = Atomic.getGraphics();
+
+        this.view = new Atomic.UIView();
+
+        this.mainframe = new MainFrame();
+
+        this.view.addChild(this.mainframe);
+
+        // set initial size
+        this.mainframe.setSize(graphics.width, graphics.height);
+
+        this.parseArguments();
+
+        this.subscribeToEvent(EditorEvents.Quit, (data) => this.handleEditorEventQuit(data));
+
+    }
+
     loadProject(projectPath: string): boolean {
 
         var system = ToolCore.getToolSystem();
@@ -49,31 +78,15 @@ class Editor extends Atomic.ScriptObject {
 
     }
 
-    constructor() {
-
-        super();
-
-        Editor.instance = this;
-
-        Atomic.getResourceCache().autoReloadResources = true;
-
-        this.assetImport = new AssetImport();
-
-        var graphics = Atomic.getGraphics();
-
-        this.view = new Atomic.UIView();
-
-        this.mainframe = new MainFrame();
-
-        this.view.addChild(this.mainframe);
+    // event handling
 
-        // set initial size
-        this.mainframe.setSize(graphics.width, graphics.height);
+    handleEditorEventQuit(data) {
 
-        this.parseArguments();
+      Atomic.getEngine().exit();
 
     }
 
+
 }
 
 export = Editor;

+ 12 - 0
Script/AtomicEditor/editor/EditorEvents.ts

@@ -0,0 +1,12 @@
+
+export const Quit = "EditorEventQuit";
+
+export const EditResource = "EditEditResource";
+
+// data
+export interface EditorResourceEvent {
+
+  // The full path to the resource to edit
+  path: string;
+
+}

+ 1 - 0
Script/AtomicEditor/tsconfig.json

@@ -13,6 +13,7 @@
     "files": [
         "./assets/AssetImport.ts",
         "./editor/Editor.ts",
+        "./editor/EditorEvents.ts",
         "./main.ts",
         "./ui/EditorStrings.ts",
         "./ui/HierarchyFrame.ts",

+ 10 - 45
Script/AtomicEditor/ui/MainFrame.ts

@@ -1,4 +1,4 @@
-import menubar = require("./MainFrameMenu");
+import MainFrameMenu = require("./MainFrameMenu");
 import ProjectFrame = require("./ProjectFrame");
 import ResourceFrame = require("./ResourceFrame");
 import InspectorFrame = require("./inspector/InspectorFrame");
@@ -10,8 +10,6 @@ import UIEvents = require("./UIEvents");
 
 import ScriptWidget = require("./ScriptWidget");
 
-var UI = Atomic.UI;
-
 class MainFrame extends ScriptWidget {
 
     projectframe: ProjectFrame;
@@ -20,6 +18,7 @@ class MainFrame extends ScriptWidget {
     hierarchyFrame: HierarchyFrame;
     inspectorlayout: Atomic.UILayout;
     mainToolbar: MainToolbar;
+    menu: MainFrameMenu;
 
     private messagemodal: MessageModal.MessageModal = new MessageModal.MessageModal();
 
@@ -43,6 +42,8 @@ class MainFrame extends ScriptWidget {
 
         this.mainToolbar = new MainToolbar(this.getWidget("maintoolbarcontainer"));
 
+        this.menu = new MainFrameMenu();
+
         this.showInspectorFrame(true);
 
         this.subscribeToEvent(UIEvents.ResourceEditorChanged, (data) => this.handleResourceEditorChanged(data));
@@ -55,13 +56,13 @@ class MainFrame extends ScriptWidget {
 
         if (show) {
 
-            this.inspectorlayout.visibility = UI.VISIBILITY_VISIBLE;
-            this.inspectorframe.visibility = UI.VISIBILITY_VISIBLE;
+            this.inspectorlayout.visibility = Atomic.UI_WIDGET_VISIBILITY_VISIBLE;
+            this.inspectorframe.visibility = Atomic.UI_WIDGET_VISIBILITY_VISIBLE;
 
         } else {
 
-            this.inspectorframe.visibility = UI.VISIBILITY_GONE;
-            this.inspectorlayout.visibility = UI.VISIBILITY_GONE;
+            this.inspectorframe.visibility = Atomic.UI_WIDGET_VISIBILITY_GONE;
+            this.inspectorlayout.visibility = Atomic.UI_WIDGET_VISIBILITY_GONE;
 
         }
 
@@ -70,10 +71,10 @@ class MainFrame extends ScriptWidget {
 
     onEventClick(target: Atomic.UIWidget, refid: string): boolean {
 
-        if (this.handlePopupMenu(target, refid))
+        if (this.menu.handlePopupMenu(target, refid))
             return true;
 
-        var src = menubar.getMenuItemSource(target.id);
+        var src = this.menu.getMenuItemSource(target.id);
 
         if (src) {
 
@@ -87,42 +88,6 @@ class MainFrame extends ScriptWidget {
 
     }
 
-
-    handlePopupMenu(target: Atomic.UIWidget, refid: string): boolean {
-
-        if (target.id == "menu atomic editor popup") {
-
-            if (refid == "quit")
-                Atomic.getEngine().exit();
-
-        } else if (target.id == "menu edit popup") {
-
-            if (refid == "edit play") {
-
-                new ToolCore.PlayCmd().run();
-                return true;
-
-            }
-
-            return false;
-
-        } else if (target.id == "menu file popup") {
-
-            if (refid == "file save file") {
-
-               //TODO: this is horrible
-                if (this.resourceframe.currentResourceEditor)
-                  this.resourceframe.currentResourceEditor.save();
-
-                return true;
-
-            }
-
-            return false;
-        }
-
-    }
-
     handleResourceEditorChanged(data): void {
 
         var editor = <Editor.ResourceEditor> data.editor;

+ 103 - 47
Script/AtomicEditor/ui/MainFrameMenu.ts

@@ -1,11 +1,114 @@
 
 import strings = require("./EditorStrings");
+import EditorEvents = require("../editor/EditorEvents");
 
 var UIMenuItemSource = Atomic.UIMenuItemSource;
 var UIMenuItem = Atomic.UIMenuItem;
 
 var StringID = strings.StringID;
 
+class MainFrameMenu extends Atomic.ScriptObject {
+
+  constructor() {
+
+    super();
+
+    this.srcLookup["menu atomic editor"] = this.createMenuItemSource(editorItems);
+    this.srcLookup["menu edit"] = this.createMenuItemSource(editItems);
+    this.srcLookup["menu file"] = this.createMenuItemSource(fileItems);
+
+  }
+
+  handlePopupMenu(target: Atomic.UIWidget, refid: string): boolean {
+
+      if (target.id == "menu atomic editor popup") {
+
+          if (refid == "quit") {
+
+            this.sendEvent(EditorEvents.Quit);
+            return true;
+
+          }
+
+      } else if (target.id == "menu edit popup") {
+
+          if (refid == "edit play") {
+
+              new ToolCore.PlayCmd().run();
+              return true;
+
+          }
+
+          return false;
+
+      } else if (target.id == "menu file popup") {
+
+          if (refid == "file save file") {
+
+             //TODO: this is horrible
+              //if (this.resourceframe.currentResourceEditor)
+              //    this.resourceframe.currentResourceEditor.save();
+
+              return true;
+
+          }
+
+          return false;
+      }
+
+  }
+
+  getMenuItemSource(id: string): Atomic.UIMenuItemSource {
+
+      return this.srcLookup[id];
+
+  }
+
+  createMenuItemSource(items: any): Atomic.UIMenuItemSource {
+
+      var src = new UIMenuItemSource();
+
+      for (var key in items) {
+
+          if (items.hasOwnProperty(key)) {
+
+              var value = items[key];
+
+              if (typeof value === 'string') {
+
+                  src.addItem(new UIMenuItem(key, value));
+
+              } else if (value == null) {
+
+                  src.addItem(new UIMenuItem(key));
+
+              }
+              else if (typeof value === 'object' && value.length == 1) {
+
+                  src.addItem(new UIMenuItem(key, value[0]));
+
+              } else if (typeof value === 'object' && value.length == 2) {
+
+                  src.addItem(new UIMenuItem(key, value[0], strings.EditorString.GetString(value[1])));
+
+              }
+
+          }
+
+      }
+
+      return src;
+
+  }
+
+  srcLookup = {};
+
+}
+
+export = MainFrameMenu;
+
+// initialization
+
 var editorItems = {
     "About Atomic Editor": "about atomic editor",
     "-1": null,
@@ -47,50 +150,3 @@ var fileItems = {
   "Save File": ["file save file"],
   "Close File": ["file close file"]
 }
-
-var srcLookup = {};
-
-srcLookup["menu atomic editor"] = createMenuItemSource(editorItems);
-srcLookup["menu edit"] = createMenuItemSource(editItems);
-srcLookup["menu file"] = createMenuItemSource(fileItems);
-
-export function getMenuItemSource(id: string): Atomic.UIMenuItemSource {
-    return srcLookup[id];
-}
-
-function createMenuItemSource(items: any): Atomic.UIMenuItemSource {
-
-    var src = new UIMenuItemSource();
-
-    for (var key in items) {
-
-        if (items.hasOwnProperty(key)) {
-
-            var value = items[key];
-
-            if (typeof value === 'string') {
-
-                src.addItem(new UIMenuItem(key, value));
-
-            } else if (value == null) {
-
-                src.addItem(new UIMenuItem(key));
-
-            }
-            else if (typeof value === 'object' && value.length == 1) {
-
-                src.addItem(new UIMenuItem(key, value[0]));
-
-            } else if (typeof value === 'object' && value.length == 2) {
-
-                src.addItem(new UIMenuItem(key, value[0], strings.EditorString.GetString(value[1])));
-
-            }
-
-        }
-
-    }
-
-    return src;
-
-}

+ 4 - 6
Script/AtomicEditor/ui/ProjectFrame.ts

@@ -3,8 +3,6 @@
 import ScriptWidget = require("./ScriptWidget");
 import Editor = require("../editor/Editor");
 
-var UI = Atomic.UI;
-
 class ProjectFrame extends ScriptWidget {
 
     folderList: Atomic.UIListView;
@@ -15,7 +13,7 @@ class ProjectFrame extends ScriptWidget {
 
         this.load("AtomicEditor/editor/ui/projectframe.tb.txt");
 
-        this.gravity = UI.GRAVITY_TOP_BOTTOM;
+        this.gravity = Atomic.UI_GRAVITY_TOP_BOTTOM;
 
         var projectviewcontainer = parent.getWidget("projectviewcontainer");
 
@@ -258,7 +256,7 @@ class ProjectFrame extends ScriptWidget {
 
         var blayout = new Atomic.UILayout();
 
-        blayout.gravity = UI.GRAVITY_LEFT;
+        blayout.gravity = Atomic.UI_GRAVITY_LEFT;
 
         var spacer = new Atomic.UIWidget();
         spacer.rect = [0, 0, 8, 8];
@@ -276,11 +274,11 @@ class ProjectFrame extends ScriptWidget {
         fd.id = "Vera";
         fd.size = 11;
 
-        button.gravity = UI.GRAVITY_LEFT;
+        button.gravity = Atomic.UI_GRAVITY_LEFT;
 
         var image = new Atomic.UISkinImage(bitmapID);
         image.rect = [0, 0, 12, 12];
-        image.gravity = UI.GRAVITY_RIGHT;
+        image.gravity = Atomic.UI_GRAVITY_RIGHT;
         blayout.addChild(image);
 
         button.id = asset.guid;

+ 6 - 8
Script/AtomicEditor/ui/ProjectFrameOld.ts

@@ -3,8 +3,6 @@
 import ScriptWidget = require("./ScriptWidget");
 import Editor = require("../editor/Editor");
 
-var UI = Atomic.UI;
-
 class ProjectFrame extends ScriptWidget {
 
     folderList: Atomic.UIListView;
@@ -15,7 +13,7 @@ class ProjectFrame extends ScriptWidget {
 
         this.load("AtomicEditor/editor/ui/projectframe.tb.txt");
 
-        this.gravity = UI.GRAVITY_TOP_BOTTOM;
+        this.gravity = Atomic.UI_GRAVITY_TOP_BOTTOM;
 
         var projectviewcontainer = parent.getWidget("projectviewcontainer");
 
@@ -43,7 +41,7 @@ class ProjectFrame extends ScriptWidget {
 
     handleWidgetEvent(data): boolean {
 
-        if (data.type == Atomic.UI.EVENT_TYPE_CLICK) {
+        if (data.type == Atomic.UI_EVENT_TYPE_CLICK) {
 
             var fs = Atomic.getFileSystem();
 
@@ -124,7 +122,7 @@ class ProjectFrame extends ScriptWidget {
             fd.size = 11;
 
             var button = new Atomic.UIButton();
-            button.gravity = UI.GRAVITY_LEFT;
+            button.gravity = Atomic.UI_GRAVITY_LEFT;
             button.text = "..                     ";
             button.id = "..";
             button.skinBg = "TBButton.flat";
@@ -275,7 +273,7 @@ class ProjectFrame extends ScriptWidget {
 
         var blayout = new Atomic.UILayout();
 
-        blayout.gravity = UI.GRAVITY_LEFT;
+        blayout.gravity = Atomic.UI_GRAVITY_LEFT;
 
         var spacer = new Atomic.UIWidget();
         spacer.rect = [0, 0, 8, 8];
@@ -290,11 +288,11 @@ class ProjectFrame extends ScriptWidget {
         fd.id = "Vera";
         fd.size = 11;
 
-        button.gravity = UI.GRAVITY_LEFT;
+        button.gravity = Atomic.UI_GRAVITY_LEFT;
 
         var image = new Atomic.UISkinImage(bitmapID);
         image.rect = [0, 0, 12, 12];
-        image.gravity = UI.GRAVITY_RIGHT;
+        image.gravity = Atomic.UI_GRAVITY_RIGHT;
         blayout.addChild(image);
 
         button.id = fullpath;

+ 1 - 1
Script/AtomicEditor/ui/ScriptWidget.ts

@@ -22,7 +22,7 @@ class ScriptWidget extends Atomic.UIWidget {
 
     handleWidgetEvent(ev: Atomic.UIWidgetEvent): void {
 
-        if (ev.type == Atomic.UI.EVENT_TYPE_CLICK) {
+        if (ev.type == Atomic.UI_EVENT_TYPE_CLICK) {
 
             this.onEventClick(ev.target, ev.refid);
             return;

+ 2 - 2
Script/AtomicEditor/ui/inspector/DataBinding.ts

@@ -93,7 +93,7 @@ class DataBinding {
             var lp = new Atomic.UILayoutParams();
             lp.width = 100;
 
-            for (var i = 0; i < 3; i++) {
+            for (var i:any = 0; i < 3; i++) {
                 var select = new Atomic.UIInlineSelect();
                 select.id = String(i + 1);
                 select.fontDescription = fd;
@@ -114,7 +114,7 @@ class DataBinding {
             var lp = new Atomic.UILayoutParams();
             lp.width = 70;
 
-            for (var i = 0; i < 4; i++) {
+            for (var i:any = 0; i < 4; i++) {
 
                 var select = new Atomic.UIInlineSelect();
                 select.id = String(i + 1);

+ 3 - 3
Script/AtomicEditor/ui/inspector/InspectorFrame.ts

@@ -47,7 +47,7 @@ class InspectorFrame extends ScriptWidget {
         var node = <Atomic.Node> data.node;
 
         if (!node) {
-          
+
             return;
         }
 
@@ -83,10 +83,10 @@ class InspectorFrame extends ScriptWidget {
           var container = this.getWidget("inspectorcontainer");
           container.deleteAllChildren();
 
-          var inspector = new MaterialInspector();
+          var materialInspector = new MaterialInspector();
           container.addChild(inspector);
 
-          inspector.inspect(asset, material);
+          materialInspector.inspect(asset, material);
 
         }
 

+ 0 - 3
Script/AtomicEditor/ui/inspector/InspectorUtils.ts

@@ -7,9 +7,6 @@ class InspectorUtils {
     fd.id = "Vera";
     fd.size = 11;
 
-    // must not be void dor static initializer
-    return null;
-
   })();
 
   static createSeparator(parent:Atomic.UIWidget):Atomic.UISeparator {

+ 1 - 1
Script/AtomicEditor/ui/inspector/InspectorWidget.ts

@@ -29,7 +29,7 @@ class InspectorWidget extends ScriptWidget {
     }
 
     onApply() {
-      print("Apply Pressed!");
+      console.log("Apply Pressed!");
     }
 
     createAttrName(name:string):Atomic.UITextField {

+ 1 - 1
Script/AtomicEditor/ui/modal/MessageModal.ts

@@ -7,7 +7,7 @@ export class MessageModal extends Atomic.ScriptObject
 
   showErrorWindow(title:string, message:string):void {
 
-    var mainframe = Editor.getEditor().mainframe;
+    var mainframe = Editor.instance.mainframe;
 
     new Atomic.UIMessageWindow(mainframe, "modal_error").show(title, message, 640, 360);
 

+ 5 - 8
Script/TypeScript/Atomic.d.ts

@@ -1856,8 +1856,6 @@ declare module Atomic {
       unregisterAllVars(): void;
       // Return node from the whole scene by ID, or null if not found.
       getNode(id: number): Node;
-      // Return component from the whole scene by ID, or null if not found.
-      getComponent(id: number): Component;
       // Return whether updates are enabled.
       isUpdateEnabled(): boolean;
       // Return whether an asynchronous loading operation is in progress.
@@ -1910,8 +1908,6 @@ declare module Atomic {
       getVarNamesAttr(): string;
       // Prepare network update by comparing attributes and marking replication states dirty as necessary.
       prepareNetworkUpdate(): void;
-      // Mark a node dirty in scene replication states. The node does not need to have own replication state yet.
-      markReplicationDirty(node: Node): void;
 
    }
 
@@ -2482,7 +2478,7 @@ declare module Atomic {
       // Return a divisor value based on intensity for calculating the sort value.
       getIntensityDivisor(attenuation?: number): number;
       getShadowCascade():Number[];
-      setShadowCascade(Number[] args);
+      setShadowCascade(args:Number[]);
       setShadowCascadeParameter(index:number, value:number);
 
    }
@@ -2566,6 +2562,7 @@ declare module Atomic {
       // Return name for texture unit.
       getTextureUnitName(unit: TextureUnit): string;
       static getTextureUnitName(unit:TextureUnit):string;
+      getShaderParameters():ShaderParameter[];
 
    }
 
@@ -5315,7 +5312,7 @@ declare module Atomic {
 
       setPhysicsWorld(physicsWorld: PhysicsWorld2D): void;
       getPhysicsWorld(): PhysicsWorld2D;
-      addLight(light: Light2D): void;
+      addLight2D(light: Light2D): void;
       setDirty(): void;
       setAmbientColor(color: Color): void;
       getAmbientColor(): Color;
@@ -7821,11 +7818,11 @@ declare module Atomic {
       // Run a program using the command interpreter, block until it exits and return the exit code. Will fail if any allowed paths are defined.
       systemCommand(commandLine: string, redirectStdOutToLog?: boolean): number;
       // Run a specific program, block until it exits and return the exit code. Will fail if any allowed paths are defined.
-      systemRun(fileName: string, arguments: string[]): number;
+      systemRun(fileName: string, args: string[]): number;
       // Run a program using the command interpreter asynchronously. Return a request ID or M_MAX_UNSIGNED if failed. The exit code will be posted together with the request ID in an AsyncExecFinished event. Will fail if any allowed paths are defined.
       systemCommandAsync(commandLine: string): number;
       // Run a specific program asynchronously. Return a request ID or M_MAX_UNSIGNED if failed. The exit code will be posted together with the request ID in an AsyncExecFinished event. Will fail if any allowed paths are defined.
-      systemRunAsync(fileName: string, arguments: string[]): number;
+      systemRunAsync(fileName: string, args: string[]): number;
       // Open a file in an external program, with mode such as "edit" optionally specified. Will fail if any allowed paths are defined.
       systemOpen(fileName: string, mode?: string): boolean;
       // Copy a file. Return true if successful.

+ 14 - 0
Script/TypeScript/AtomicWork.d.ts

@@ -2,8 +2,12 @@
 /// <reference path="ToolCore.d.ts" />
 /// <reference path="Editor.d.ts" />
 
+
 declare module Atomic {
 
+    export function print(...args:any[]);
+
+
     export interface PathInfo {
 
       pathName: string;
@@ -60,6 +64,16 @@ declare module Atomic {
 
     }
 
+    export interface ShaderParameter {
+
+      name:string;
+      value:any;
+      valueString:string;
+      typeName:string;
+      type:VariantType;
+
+    }
+
     export function getArguments(): Array<string>;
     export function getEngine(): Engine;
     export function getInput(): Input;

+ 13 - 11
Script/TypeScript/Editor.d.ts

@@ -1,6 +1,8 @@
 //Atomic TypeScript Definitions
 
 
+/// <reference path="Atomic.d.ts" />
+
 declare module Editor {
 
 
@@ -36,7 +38,7 @@ declare module Editor {
 
    export class JSResourceEditor extends ResourceEditor {
 
-      constructor(fullpath: string, container: UITabContainer);
+      constructor(fullpath: string, container: Atomic.UITabContainer);
 
       findText(findText: string, flags: number): boolean;
       findTextClose(): void;
@@ -49,13 +51,13 @@ declare module Editor {
 
    export class ResourceEditor extends Atomic.AObject {
 
-      button: UIButton;
+      button: Atomic.UIButton;
       fullPath: string;
-      rootContentWidget: UIWidget;
+      rootContentWidget: Atomic.UIWidget;
 
-      constructor(fullpath: string, container: UITabContainer);
+      constructor(fullpath: string, container: Atomic.UITabContainer);
 
-      getButton(): UIButton;
+      getButton(): Atomic.UIButton;
       hasUnsavedModifications(): boolean;
       setFocus(): void;
       close(navigateToAvailableResource?: boolean): void;
@@ -64,18 +66,18 @@ declare module Editor {
       requiresInspector(): boolean;
       getFullPath(): string;
       save(): boolean;
-      getRootContentWidget(): UIWidget;
+      getRootContentWidget(): Atomic.UIWidget;
 
    }
 
    export class SceneEditor3D extends ResourceEditor {
 
-      scene: Scene;
+      scene: Atomic.Scene;
 
-      constructor(fullpath: string, container: UITabContainer);
+      constructor(fullpath: string, container: Atomic.UITabContainer);
 
-      selectNode(node: Node): void;
-      getScene(): Scene;
+      selectNode(node: Atomic.Node): void;
+      getScene(): Atomic.Scene;
       setFocus(): void;
       requiresInspector(): boolean;
       save(): boolean;
@@ -89,7 +91,7 @@ declare module Editor {
 
       constructor(sceneEditor: SceneEditor3D);
 
-      selectNode(node: Node): void;
+      selectNode(node: Atomic.Node): void;
       setPitch(pitch: number): void;
       setYaw(yaw: number): void;
       enable(): void;

+ 4 - 2
Script/TypeScript/ToolCore.d.ts

@@ -1,6 +1,8 @@
 //Atomic TypeScript Definitions
 
 
+/// <reference path="Atomic.d.ts" />
+
 declare module ToolCore {
 
 
@@ -205,7 +207,7 @@ declare module ToolCore {
 
    export class OpenAssetImporter extends Atomic.AObject {
 
-      importNode: Node;
+      importNode: Atomic.Node;
       startTime: number;
       endTime: number;
       scale: number;
@@ -216,7 +218,7 @@ declare module ToolCore {
 
       load(assetPath: string): boolean;
       exportModel(outName: string, animName?: string, animationOnly?: boolean): void;
-      setImportNode(node: Node): void;
+      setImportNode(node: Atomic.Node): void;
       setStartTime(startTime: number): void;
       setEndTime(endTime: number): void;
       setScale(scale: number): void;

+ 1 - 1
Source/Atomic/Atomic2D/Light2D.cpp

@@ -566,7 +566,7 @@ void Light2DGroup::UpdateSourceBatches()
 
 }
 
-void Light2DGroup::AddLight(Light2D* light)
+void Light2DGroup::AddLight2D(Light2D* light)
 {
     for (Vector<WeakPtr<Light2D> >::ConstIterator itr = lights_.Begin(); itr != lights_.End(); itr++)
         if (*itr == light)

+ 1 - 1
Source/Atomic/Atomic2D/Light2D.h

@@ -171,7 +171,7 @@ public:
     void SetPhysicsWorld(PhysicsWorld2D* physicsWorld);
     PhysicsWorld2D* GetPhysicsWorld() { return physicsWorld_; }
 
-    void AddLight(Light2D* light);
+    void AddLight2D(Light2D* light);
     Vector<WeakPtr<Light2D> >& GetLights() { return lights_; }
 
     void SetDirty() { /*verticesDirty_ = true;*/ }

+ 13 - 0
Source/AtomicJS/Javascript/JSAtomic.cpp

@@ -275,6 +275,15 @@ void jsapi_init_atomic(JSVM* vm)
 
     // globals
     duk_push_global_object(ctx);
+
+    // console.log
+    duk_push_object(ctx);
+    duk_dup(ctx, -1);
+    duk_put_prop_string(ctx, -3, "console");
+    duk_push_c_function(ctx, js_print, DUK_VARARGS);
+    duk_put_prop_string(ctx, -1, "log");
+    duk_pop(ctx);
+
     duk_push_c_function(ctx, js_print, DUK_VARARGS);
     duk_put_prop_string(ctx, -2, "print");
     duk_push_c_function(ctx, js_assert, 1);
@@ -286,6 +295,10 @@ void jsapi_init_atomic(JSVM* vm)
     // Atomic
     duk_get_global_string(ctx, "Atomic");
 
+    // Atomic.print
+    duk_push_c_function(ctx, js_print, DUK_VARARGS);
+    duk_put_prop_string(ctx, -2, "print");
+
     String platform = GetPlatform();
     if (platform == "Mac OS X")
         platform = "MacOSX";

+ 3 - 2
Source/AtomicJS/Packages/Atomic/Graphics.json

@@ -21,11 +21,12 @@
 	"typescript_decl" : {
 
 		"Material" : [
-			"static getTextureUnitName(unit:TextureUnit):string;"
+			"static getTextureUnitName(unit:TextureUnit):string;",
+			"getShaderParameters():ShaderParameter[];"
 		],
 		"Light" : [
 			"getShadowCascade():Number[];",
-			"setShadowCascade(Number[] args);",
+			"setShadowCascade(args:Number[]);",
 			"setShadowCascadeParameter(index:number, value:number);"
 		]
 

+ 7 - 0
Source/AtomicJS/Packages/Atomic/Scene.json

@@ -5,7 +5,14 @@
 	"classes" : ["Animatable", "Node", "Scene", "Component", "Serializable",
 				 "ObjectAnimation", "SmoothedTransform", "SplinePath",
 				 "ValueAnimation", "ValueAnimationInfo", "PrefabComponent"],
+	"excludes" : {
+		"Scene" : {
+			"GetComponent" : ["unsigned"],
+			"MarkReplicationDirty" : ["Node"]
+		}
+	},
 	"overloads" : {
+
 		"Node" : {
 			"CreateChild" : ["String", "CreateMode", "unsigned"],
 			"GetChild" : ["String", "bool"],

+ 28 - 4
Source/ToolCore/JSBind/JSBTypeScript.cpp

@@ -16,7 +16,7 @@
 namespace ToolCore
 {
 
-static String GetScriptType(JSBFunctionType* ftype)
+String JSBTypeScript::GetScriptType(JSBFunctionType* ftype)
 {
     String scriptType = "number";
 
@@ -38,7 +38,19 @@ static String GetScriptType(JSBFunctionType* ftype)
         scriptType = ftype->type_->asEnumType()->enum_->GetName();
 
     if (ftype->type_->asClassType())
-        scriptType = ftype->type_->asClassType()->class_->GetName();
+    {
+        JSBClass* klass = ftype->type_->asClassType()->class_;
+
+        scriptType = klass->GetName();
+
+        if (klass->GetPackage()->GetName() != package_->GetName())
+        {
+
+            scriptType = klass->GetPackage()->GetName() + "." + klass->GetName();
+
+        }
+
+    }
 
     if (ftype->type_->asVectorType())
     {
@@ -52,6 +64,12 @@ static String GetScriptType(JSBFunctionType* ftype)
 void JSBTypeScript::Begin()
 {
     source_ += "//Atomic TypeScript Definitions\n\n\n";
+
+    if (package_->GetName() != "Atomic")
+    {
+        source_ += "/// <reference path=\"Atomic.d.ts\" />\n\n";
+    }
+
     source_ += "declare module "+ package_->GetName() + " {\n\n";
 }
 
@@ -88,10 +106,16 @@ void JSBTypeScript::ExportFunction(JSBFunction* function)
 
         String scriptType = GetScriptType(ftype);
 
-        if (scriptType == "Context")
+        if (scriptType == "Context" || scriptType == "Atomic.Context")
             continue;
 
-        source_ += ftype->name_;
+        String name = ftype->name_;
+
+        // TS doesn't like arguments named arguments
+        if (name == "arguments")
+            name = "args";
+
+        source_ += name;
 
         if (ftype->initializer_.Length())
             source_ += "?";

+ 5 - 0
Source/ToolCore/JSBind/JSBTypeScript.h

@@ -15,8 +15,11 @@ class JSBModule;
 namespace ToolCore
 {
 
+class JSBFunctionType;
+
 class JSBTypeScript
 {
+
 public:
 
     void Emit(JSBPackage* package, const String& path);
@@ -31,6 +34,8 @@ private:
 
     void ExportFunction(JSBFunction* function);
 
+    String GetScriptType(JSBFunctionType* ftype);
+
     void ExportModuleEnums(JSBModule* moduleName);
     void ExportModuleConstants(JSBModule*  moduleName);
     void ExportModuleClasses(JSBModule*  moduleName);