Browse Source

Project Manager Startup Screen

This adds a T2D startup screen that let's the user pick which "project" they want to load. Initially, the sandbox is the only project, but the user can make a new project using the startup screen. Projects are loosely defined as a folder off of the root that has an AppCore module in it. The startup screen uses the existing modules in the library folder to build the new project. There was a lot of work done around allowing a project to redefine named Gui Profiles since the editor needs these to be defined, but the projects will also need to define their own (to run without the editors).
Peter Robinson 3 years ago
parent
commit
0e71a48f56
48 changed files with 2387 additions and 333 deletions
  1. 3 0
      editor/AssetAdmin/NewAnimationAssetDialog.cs
  2. 16 0
      editor/AssetAdmin/NewAssetButton.cs
  3. 3 0
      editor/AssetAdmin/NewAudioAssetDialog.cs
  4. 3 0
      editor/AssetAdmin/NewFontAssetDialog.cs
  5. 3 0
      editor/AssetAdmin/NewImageAssetDialog.cs
  6. 3 0
      editor/AssetAdmin/NewParticleAssetDialog.cs
  7. 5 0
      editor/EditorConsole/EditorConsole.cs
  8. 113 4
      editor/EditorCore/EditorCore.cs
  9. 152 2
      editor/EditorCore/Themes/BaseTheme/BaseTheme.cs
  10. BIN
      editor/EditorCore/Themes/BaseTheme/images/cursors/defaultCursor.png
  11. BIN
      editor/EditorCore/Themes/BaseTheme/images/cursors/ibeam.png
  12. 9 0
      editor/EditorCore/Themes/BaseTheme/images/displayBox.asset.taml
  13. BIN
      editor/EditorCore/Themes/BaseTheme/images/displayBox.png
  14. 4 0
      editor/EditorCore/Themes/BaseTheme/images/editorBG.asset.taml
  15. BIN
      editor/EditorCore/Themes/BaseTheme/images/editorBG.png
  16. 4 0
      editor/EditorCore/Themes/BaseTheme/images/fixedHeader200x20.asset.taml
  17. BIN
      editor/EditorCore/Themes/BaseTheme/images/fixedHeader200x20.png
  18. 4 0
      editor/EditorCore/Themes/ForestRobe/ForestRobeTheme.cs
  19. 4 0
      editor/EditorCore/Themes/LabCoat/LabCoatTheme.cs
  20. 48 0
      editor/EditorCore/Themes/ThemeManager.cs
  21. 45 0
      editor/EditorCore/Themes/TorqueSuit/TorqueSuitTheme.cs
  22. 547 0
      editor/EditorCore/gui/guiProfiles.cs
  23. BIN
      editor/EditorCore/gui/images/treeView.png
  24. BIN
      editor/EditorCore/images/headerGlow.png
  25. BIN
      editor/EditorCore/images/newProject.png
  26. 4 0
      editor/EditorCore/images/projectTileShadow.asset.taml
  27. BIN
      editor/EditorCore/images/projectTileShadow.png
  28. BIN
      editor/EditorCore/images/t2d_logo.png
  29. BIN
      editor/EditorCore/images/t2d_logo_med.png
  30. BIN
      editor/EditorCore/images/t2d_rocket_splash.png
  31. BIN
      editor/EditorCore/images/torque_logo.png
  32. 15 0
      editor/EditorCore/scripts/EditorCoreSplash.cs
  33. 124 0
      editor/EditorCore/scripts/EditorProjectCard.cs
  34. 217 0
      editor/EditorCore/scripts/EditorProjectSelector.cs
  35. 160 0
      editor/EditorCore/scripts/NewProjectDialog.cs
  36. 126 0
      editor/EditorCore/scripts/canvas.cs
  37. 51 0
      editor/EditorCore/scripts/constants.cs
  38. 59 0
      editor/EditorCore/scripts/defaultPreferences.cs
  39. 7 1
      editor/main.cs
  40. 308 140
      library/AppCore/gui/guiProfiles.cs
  41. 4 1
      library/AppCore/module.taml
  42. BIN
      library/AppCore/projectIcon.png
  43. 1 1
      library/AppCore/scripts/canvas.cs
  44. 14 7
      main.cs
  45. 4 1
      toybox/AppCore/1/module.taml
  46. BIN
      toybox/AppCore/1/projectIcon.png
  47. 1 1
      toybox/AppCore/1/scripts/canvas.cs
  48. 326 175
      toybox/Sandbox/1/gui/guiProfiles.cs

+ 3 - 0
editor/AssetAdmin/NewAnimationAssetDialog.cs

@@ -40,6 +40,8 @@ function NewAnimationAssetDialog::init(%this, %width, %height)
 		Position = "12 220";
 		Position = "12 220";
 		Extent = (%width - 24) SPC 80;
 		Extent = (%width - 24) SPC 80;
 		text = "Select an Image Asset to get started!";
 		text = "Select an Image Asset to get started!";
+		textWrap = true;
+		textExtend = true;
 	};
 	};
 	ThemeManager.setProfile(%this.feedback, "infoProfile");
 	ThemeManager.setProfile(%this.feedback, "infoProfile");
 
 
@@ -141,6 +143,7 @@ function NewAnimationAssetDialog::Validate(%this)
 function NewAnimationAssetDialog::onClose(%this)
 function NewAnimationAssetDialog::onClose(%this)
 {
 {
 	Canvas.popDialog(%this);
 	Canvas.popDialog(%this);
+	%this.postEvent("DialogClosed", %this);
 }
 }
 
 
 function NewAnimationAssetDialog::onCreate(%this)
 function NewAnimationAssetDialog::onCreate(%this)

+ 16 - 0
editor/AssetAdmin/NewAssetButton.cs

@@ -18,6 +18,7 @@ function NewAssetButton::onNewImageAsset(%this)
 		dialogText = "New Image Asset";
 		dialogText = "New Image Asset";
 	};
 	};
 	%dialog.init(%width, %height);
 	%dialog.init(%width, %height);
+	%this.startListening(%dialog);
 
 
 	Canvas.pushDialog(%dialog);
 	Canvas.pushDialog(%dialog);
 }
 }
@@ -35,6 +36,7 @@ function NewAssetButton::onNewAnimationAsset(%this)
 		dialogText = "New Animation Asset";
 		dialogText = "New Animation Asset";
 	};
 	};
 	%dialog.init(%width, %height);
 	%dialog.init(%width, %height);
+	%this.startListening(%dialog);
 
 
 	Canvas.pushDialog(%dialog);
 	Canvas.pushDialog(%dialog);
 }
 }
@@ -52,6 +54,7 @@ function NewAssetButton::onNewParticleAsset(%this)
 		dialogText = "New Particle Asset";
 		dialogText = "New Particle Asset";
 	};
 	};
 	%dialog.init(%width, %height);
 	%dialog.init(%width, %height);
+	%this.startListening(%dialog);
 
 
 	Canvas.pushDialog(%dialog);
 	Canvas.pushDialog(%dialog);
 }
 }
@@ -69,6 +72,7 @@ function NewAssetButton::onNewFontAsset(%this)
 		dialogText = "New Bitmap Font Asset";
 		dialogText = "New Bitmap Font Asset";
 	};
 	};
 	%dialog.init(%width, %height);
 	%dialog.init(%width, %height);
+	%this.startListening(%dialog);
 
 
 	Canvas.pushDialog(%dialog);
 	Canvas.pushDialog(%dialog);
 }
 }
@@ -86,6 +90,18 @@ function NewAssetButton::onNewAudioAsset(%this)
 		dialogText = "New Audio Asset";
 		dialogText = "New Audio Asset";
 	};
 	};
 	%dialog.init(%width, %height);
 	%dialog.init(%width, %height);
+	%this.startListening(%dialog);
 
 
 	Canvas.pushDialog(%dialog);
 	Canvas.pushDialog(%dialog);
 }
 }
+
+function NewAssetButton::onDialogClosed(%this, %dialog)
+{
+	%this.dialog = %dialog;
+	%this.schedule(100, "deleteDialog");
+}
+
+function NewAssetButton::deleteDialog(%this)
+{
+	%this.dialog.delete();
+}

+ 3 - 0
editor/AssetAdmin/NewAudioAssetDialog.cs

@@ -36,6 +36,8 @@ function NewAudioAssetDialog::init(%this, %width, %height)
 		Position = "12 170";
 		Position = "12 170";
 		Extent = (%width - 24) SPC 80;
 		Extent = (%width - 24) SPC 80;
 		text = "Select an Audio File to get started!";
 		text = "Select an Audio File to get started!";
+		textWrap = true;
+		textExtend = true;
 	};
 	};
 	ThemeManager.setProfile(%this.feedback, "infoProfile");
 	ThemeManager.setProfile(%this.feedback, "infoProfile");
 
 
@@ -133,6 +135,7 @@ function NewAudioAssetDialog::Validate(%this)
 function NewAudioAssetDialog::onClose(%this)
 function NewAudioAssetDialog::onClose(%this)
 {
 {
 	Canvas.popDialog(%this);
 	Canvas.popDialog(%this);
+	%this.postEvent("DialogClosed", %this);
 }
 }
 
 
 function NewAudioAssetDialog::onCreate(%this)
 function NewAudioAssetDialog::onCreate(%this)

+ 3 - 0
editor/AssetAdmin/NewFontAssetDialog.cs

@@ -36,6 +36,8 @@ function NewFontAssetDialog::init(%this, %width, %height)
 		Position = "12 170";
 		Position = "12 170";
 		Extent = (%width - 24) SPC 80;
 		Extent = (%width - 24) SPC 80;
 		text = "Select a Bimap Font File to get started!";
 		text = "Select a Bimap Font File to get started!";
+		textWrap = true;
+		textExtend = true;
 	};
 	};
 	ThemeManager.setProfile(%this.feedback, "infoProfile");
 	ThemeManager.setProfile(%this.feedback, "infoProfile");
 
 
@@ -133,6 +135,7 @@ function NewFontAssetDialog::Validate(%this)
 function NewFontAssetDialog::onClose(%this)
 function NewFontAssetDialog::onClose(%this)
 {
 {
 	Canvas.popDialog(%this);
 	Canvas.popDialog(%this);
+	%this.postEvent("DialogClosed", %this);
 }
 }
 
 
 function NewFontAssetDialog::onCreate(%this)
 function NewFontAssetDialog::onCreate(%this)

+ 3 - 0
editor/AssetAdmin/NewImageAssetDialog.cs

@@ -36,6 +36,8 @@ function NewImageAssetDialog::init(%this, %width, %height)
 		Position = "12 170";
 		Position = "12 170";
 		Extent = (%width - 24) SPC 80;
 		Extent = (%width - 24) SPC 80;
 		text = "Select an Image File to get started!";
 		text = "Select an Image File to get started!";
+		textWrap = true;
+		textExtend = true;
 	};
 	};
 	ThemeManager.setProfile(%this.feedback, "infoProfile");
 	ThemeManager.setProfile(%this.feedback, "infoProfile");
 
 
@@ -140,6 +142,7 @@ function NewImageAssetDialog::Validate(%this)
 function NewImageAssetDialog::onClose(%this)
 function NewImageAssetDialog::onClose(%this)
 {
 {
 	Canvas.popDialog(%this);
 	Canvas.popDialog(%this);
+	%this.postEvent("DialogClosed", %this);
 }
 }
 
 
 function NewImageAssetDialog::onCreate(%this)
 function NewImageAssetDialog::onCreate(%this)

+ 3 - 0
editor/AssetAdmin/NewParticleAssetDialog.cs

@@ -44,6 +44,8 @@ function NewParticleAssetDialog::init(%this, %width, %height)
 		Position = "12 270";
 		Position = "12 270";
 		Extent = (%width - 24) SPC 80;
 		Extent = (%width - 24) SPC 80;
 		text = "Select an Image Asset or Animation Assset to get started!";
 		text = "Select an Image Asset or Animation Assset to get started!";
+		textWrap = true;
+		textExtend = true;
 	};
 	};
 	ThemeManager.setProfile(%this.feedback, "infoProfile");
 	ThemeManager.setProfile(%this.feedback, "infoProfile");
 
 
@@ -152,6 +154,7 @@ function NewParticleAssetDialog::Validate(%this)
 function NewParticleAssetDialog::onClose(%this)
 function NewParticleAssetDialog::onClose(%this)
 {
 {
 	Canvas.popDialog(%this);
 	Canvas.popDialog(%this);
+	%this.postEvent("DialogClosed", %this);
 }
 }
 
 
 function NewParticleAssetDialog::onCreate(%this)
 function NewParticleAssetDialog::onCreate(%this)

+ 5 - 0
editor/EditorConsole/EditorConsole.cs

@@ -90,6 +90,11 @@ function EditorConsole::eval(%this)
 {
 {
 	%text = trim(%this.consoleEntry.getValue());
 	%text = trim(%this.consoleEntry.getValue());
 
 
+	if(%text $= "")
+	{
+		return;
+	}
+
     if(strpos(%text, "(") == -1 && strpos(%text, "=") == -1 && strpos(%text, " ") == -1 && strpos(%text, "{") == -1 && strpos(%text, "}") == -1)
     if(strpos(%text, "(") == -1 && strpos(%text, "=") == -1 && strpos(%text, " ") == -1 && strpos(%text, "{") == -1 && strpos(%text, "}") == -1)
     {
     {
         %text = %text @ "()";
         %text = %text @ "()";

+ 113 - 4
editor/EditorCore/EditorCore.cs

@@ -22,6 +22,26 @@
 
 
 function EditorCore::create( %this )
 function EditorCore::create( %this )
 {
 {
+	%this.editorKeyMap = new ActionMap();
+	if(!isObject(AppCore))
+	{
+		exec("./scripts/constants.cs");
+		exec("./scripts/defaultPreferences.cs");
+		exec("./gui/guiProfiles.cs");
+		%this.createGuiProfiles();
+
+		exec("./scripts/canvas.cs");
+		exec("./scripts/EditorCoreSplash.cs");
+		exec("./scripts/EditorProjectSelector.cs");
+		exec("./scripts/EditorProjectCard.cs");
+		exec("./scripts/NewProjectDialog.cs");
+
+		%this.initializeCanvas("Torque2D: Rocket Edition");
+	}
+	else
+	{
+		%this.editorKeyMap.bindCmd( "keyboard", "ctrl tilde", "EditorCore.toggleEditor();", "");
+	}
 	exec("./Themes/ThemeManager.cs");
 	exec("./Themes/ThemeManager.cs");
 	exec("./EditorDialog.cs");
 	exec("./EditorDialog.cs");
 	exec("./EditorForm.cs");
 	exec("./EditorForm.cs");
@@ -31,9 +51,6 @@ function EditorCore::create( %this )
 	new ScriptObject(ThemeManager);
 	new ScriptObject(ThemeManager);
 
 
 	%this.initGui();
 	%this.initGui();
-
-	%this.editorKeyMap = new ActionMap();
-    %this.editorKeyMap.bindCmd( "keyboard", "ctrl tilde", "EditorCore.toggleEditor();", "");
 	%this.editorKeyMap.push();
 	%this.editorKeyMap.push();
 }
 }
 
 
@@ -57,12 +74,22 @@ function EditorCore::initGui(%this)
 	%this.menuBar = new GuiMenuBarCtrl()
 	%this.menuBar = new GuiMenuBarCtrl()
 	{
 	{
 		new GuiMenuItemCtrl() {
 		new GuiMenuItemCtrl() {
-			Text = "Tools";
+			Text = "Torque2D";
 
 
 			new GuiMenuItemCtrl() {
 			new GuiMenuItemCtrl() {
 				Text = "Close Tools";
 				Text = "Close Tools";
 				Command = "EditorCore.close();";
 				Command = "EditorCore.close();";
 			};
 			};
+
+			new GuiMenuItemCtrl() {
+				Text = "Close Project";
+				Command = "restartInstance();";
+			};
+
+			new GuiMenuItemCtrl() {
+				Text = "Exit";
+				Command = "quit();";
+			};
 		};
 		};
 		new GuiMenuItemCtrl() {
 		new GuiMenuItemCtrl() {
 			Text = "Theme";
 			Text = "Theme";
@@ -121,6 +148,54 @@ function EditorCore::initGui(%this)
 	ThemeManager.setProfile(%this.tabBook, "tabProfileTop", "TabProfile");
 	ThemeManager.setProfile(%this.tabBook, "tabProfileTop", "TabProfile");
 
 
 	%this.baseGui.add(%this.tabBook);
 	%this.baseGui.add(%this.tabBook);
+
+	%this.torqueBackground = new GuiSpriteCtrl()
+	{
+		HorizSizing = width;
+		VertSizing = height;
+		Position = "0 0";
+		Extent = "1024 768";
+		SingleFrameBitmap = "1";
+		ConstrainProportions = "0";
+		FullSize = "1";
+		ImageColor = "255 255 255 255";
+		PositionOffset = "0 0";
+		Visible = false;
+	};
+	ThemeManager.setProfile(%this.torqueBackground, "spriteProfile");
+	ThemeManager.setImage(%this.torqueBackground, "editorBG");
+	%this.baseGui.add(%this.torqueBackground);
+
+	%this.projectSelector = new GuiControl()
+	{
+		Class = EditorProjectSelector;
+		HorizSizing = width;
+		VertSizing = height;
+		Position = "0 0";
+		Extent = "1024 768";
+		Visible = false;
+	};
+	ThemeManager.setProfile(%this.projectSelector, "emptyProfile");
+	%this.baseGui.add(%this.projectSelector);
+
+	%this.splash = new GuiSpriteCtrl()
+	{
+		Class = EditorCoreSplash;
+		HorizSizing = width;
+		VertSizing = height;
+		Position = "0 0";
+		Extent = "1024 768";
+		Bitmap = "./images/t2d_rocket_splash.png";
+		SingleFrameBitmap = "1";
+		constrainProportions = "1";
+		FullSize = "0";
+		ImageSize = "672 480";
+		ImageColor = "255 255 255 0";
+		PositionOffset = "0 20";
+		Visible = false;
+	};
+	ThemeManager.setProfile(%this.splash, "spriteProfile");
+	%this.baseGui.add(%this.splash);
 }
 }
 
 
 function EditorCore::toggleEditor(%this)
 function EditorCore::toggleEditor(%this)
@@ -145,6 +220,7 @@ function EditorCore::open(%this)
     Canvas.pushDialog(%this.baseGui);
     Canvas.pushDialog(%this.baseGui);
 
 
 	%this.tabBook.selectPage(0);
 	%this.tabBook.selectPage(0);
+	Canvas.setCursor(ThemeManager.activeTheme.defaultCursor);
 }
 }
 
 
 function EditorCore::close(%this)
 function EditorCore::close(%this)
@@ -152,6 +228,11 @@ function EditorCore::close(%this)
 	if ( $enableDirectInput )
 	if ( $enableDirectInput )
 		activateKeyboard();
 		activateKeyboard();
 	Canvas.popDialog(%this.baseGui);
 	Canvas.popDialog(%this.baseGui);
+
+	if(isObject(defaultCursor))
+	{
+		Canvas.setCursor(defaultCursor);
+	}
 }
 }
 
 
 function EditorCore::RegisterEditor(%this, %name, %editor)
 function EditorCore::RegisterEditor(%this, %name, %editor)
@@ -233,3 +314,31 @@ function EditorCore::flattenPath(%this, %path)
 
 
 	return %result;
 	return %result;
 }
 }
+
+function EditorCore::showProjectSelector(%this)
+{
+	%this.menuBar.setVisible(false);
+	%this.tabBook.setVisible(false);
+	%this.projectSelector.setVisible(true);
+	%this.splash.show();
+	%this.torqueBackground.setVisible(true);
+	%this.projectSelector.schedule(2800, "show");
+	%this.startListening(%this.projectSelector);
+}
+
+function EditorCore::onProjectSelected(%this)
+{
+	%this.close();
+	%this.menuBar.setVisible(true);
+	%this.tabBook.setVisible(true);
+	%this.projectSelector.setVisible(false);
+	%this.torqueBackground.setVisible(false);
+	%this.stopListening(%this.projectSelector);
+	%this.schedule(500, "finishProjectSelection");
+}
+
+function EditorCore::finishProjectSelection(%this)
+{
+	ModuleDatabase.LoadExplicit("AppCore", 1);
+	%this.editorKeyMap.bindCmd( "keyboard", "ctrl tilde", "EditorCore.toggleEditor();", "");
+}

+ 152 - 2
editor/EditorCore/Themes/BaseTheme/BaseTheme.cs

@@ -45,6 +45,7 @@ function BaseTheme::onAdd(%this)
 		borderDefault = %this.emptyBorder;
 		borderDefault = %this.emptyBorder;
 	};
 	};
 
 
+	%this.makeCursors();
 	%this.makeTipProfile();
 	%this.makeTipProfile();
 	%this.makeGeneralProfiles();
 	%this.makeGeneralProfiles();
 	%this.makePanelProfile();
 	%this.makePanelProfile();
@@ -63,6 +64,7 @@ function BaseTheme::onAdd(%this)
 	%this.makeWindowProfile();
 	%this.makeWindowProfile();
 	%this.makeListBoxProfile();
 	%this.makeListBoxProfile();
 	%this.makeGraphProfile();
 	%this.makeGraphProfile();
+	%this.makeTextDisplayProfile();
 }
 }
 
 
 function BaseTheme::init(%this)
 function BaseTheme::init(%this)
@@ -83,6 +85,27 @@ function BaseTheme::init(%this)
 	%this.color5 = "255 133 0 255";//Flavor color that mostly is used on objects during interaction
 	%this.color5 = "255 133 0 255";//Flavor color that mostly is used on objects during interaction
 
 
 	%this.borderSize = 3;
 	%this.borderSize = 3;
+
+	%this.editorBG = "EditorCore:editorBG_BaseTheme";
+	%this.fixedHeader200x20 = "EditorCore:fixedHeader200x20_BaseTheme";
+	%this.displayBox = "EditorCore:displayBox_BaseTheme";
+}
+
+function BaseTheme::makeCursors(%this)
+{
+	%this.defaultCursor = new GuiCursor()
+	{
+	    hotSpot = "1 1";
+	    renderOffset = "0 0";
+	    bitmapName = "^EditorCore/Themes/BaseTheme/images/cursors/defaultCursor.png";
+	};
+
+	%this.editCursor = new GuiCursor()
+	{
+	   hotSpot = "0 0";
+	   renderOffset = "0.5 0.5";
+	   bitmapName = "^EditorCore/Themes/BaseTheme/images/cursors/ibeam.png";
+	};
 }
 }
 
 
 function BaseTheme::makeTipProfile(%this)
 function BaseTheme::makeTipProfile(%this)
@@ -190,7 +213,29 @@ function BaseTheme::makeGeneralProfiles(%this)
 		vAlign = middle;
 		vAlign = middle;
 
 
 		borderDefault = %this.emptyBorder;
 		borderDefault = %this.emptyBorder;
-		useInput = false;
+	};
+
+	%displayBorder = new GuiBorderProfile()
+	{
+		margin = 1;
+		marginHL = 0;
+		marginSL = 0;
+		marginNA = 1;
+
+		padding = 4;
+		paddingHL = 5;
+		paddingSL = 5;
+		paddingNA = 4;
+	};
+	//A nice container box with all four states
+	%this.displayBoxProfile = new GuiControlProfile()
+	{
+		ImageAsset = "EditorCore:displayBox_BaseTheme";
+		fillColor = "0 0 0 0";
+		align = center;
+		vAlign = middle;
+
+		borderDefault = %displayBorder;
 	};
 	};
 }
 }
 
 
@@ -1068,7 +1113,6 @@ function BaseTheme::makeTextEditProfile(%this)
 		tab = true;
 		tab = true;
 		canKeyFocus = true;
 		canKeyFocus = true;
 		returnTab = true;
 		returnTab = true;
-		useInput = true;
 	};
 	};
 }
 }
 
 
@@ -1174,6 +1218,47 @@ function BaseTheme::makeScrollProfile(%this)
 
 
 		borderDefault = %mainBorder;
 		borderDefault = %mainBorder;
 	};
 	};
+
+	//Tiny scroll profile - for uses when you have little space
+	%this.tinyTrackProfile = new GuiControlProfile()
+	{
+			fillColor = %this.setAlpha(%this.color2, 150);
+			fillColorHL = %this.setAlpha(%this.color2, 150);
+			fillColorSL = %this.setAlpha(%this.adjustValue(%this.color2, 10), 150);
+			fillColorNA = %this.setAlpha(%this.color2, 50);
+			borderDefault = %this.emptyBorder;
+	};
+
+	%this.tinyThumbProfile = new GuiControlProfile()
+	{
+		fillColor = %this.color3;
+		fillColorHL = %this.adjustValue(%this.color3, 10);
+		fillColorSL = %this.color5;
+		fillColorNA = %this.setAlpha(%this.color3, 80);
+		borderDefault = %this.emptyBorder;
+	};
+
+	//probably best to avoid the arrow buttons for very small scroll bars
+	%this.tinyScrollArrowProfile = new GuiControlProfile()
+	{
+		fillColor = %this.color3;
+		fillColorHL = %this.adjustValue(%this.color3, 10);
+		fillColorSL = %this.color5;
+		fillColorNA = %this.setAlpha(%this.color3, 80);
+
+		fontType = %this.font[1];
+		fontDirectory = %this.fontDirectory;
+		fontColor = %this.color2;
+		fontColorHL = %this.color2;
+		fontColorSL = %this.color4;
+		fontColorNA = %this.setAlpha(%this.color2, 80);
+		borderDefault = %this.emptyBorder;
+	};
+	%this.scrollProfile = new GuiControlProfile()
+	{
+	    fillColor = %this.setAlpha(%this.color2, 180);
+		borderDefault = %this.emptyBorder;
+	};
 }
 }
 
 
 function BaseTheme::makeConsoleProfile(%this)
 function BaseTheme::makeConsoleProfile(%this)
@@ -1700,6 +1785,71 @@ function BaseTheme::makeGraphProfile(%this)
 	};
 	};
 }
 }
 
 
+function BaseTheme::makeTextDisplayProfile(%this)
+{
+	%border = new GuiBorderProfile()
+	{
+		padding = 5;
+	};
+
+	%this.titleProfile = new GuiControlProfile()
+	{
+		fillColor = "0 0 0 0";
+		fillColorHL = "0 0 0 0";
+		fillColorSL = "0 0 0 0";
+		fillColorNA = "0 0 0 0";
+
+		fontType = %this.font[2];
+		fontDirectory = %this.fontDirectory;
+		fontSize = 28;
+		fontColor = %this.adjustValue(%this.color4, 10);
+		align = "left";
+		vAlign = "top";
+
+		borderDefault = %border;
+		borderTop = %this.emptyBorder;
+		borderBottom = %this.emptyBorder;
+	};
+
+	%this.codeProfile = new GuiControlProfile()
+	{
+		fillColor = "0 0 0 0";
+		fillColorHL = "0 0 0 0";
+		fillColorSL = "0 0 0 0";
+		fillColorNA = "0 0 0 0";
+
+		fontType = %this.font[3];
+		fontDirectory = %this.fontDirectory;
+		fontSize = 18;
+		fontColor = %this.adjustValue(%this.color2, 10);
+		align = "left";
+		vAlign = "top";
+
+		borderDefault = %border;
+		borderTop = %this.emptyBorder;
+		borderBottom = %this.emptyBorder;
+	};
+
+	%this.normalTextProfile = new GuiControlProfile()
+	{
+		fillColor = "0 0 0 0";
+		fillColorHL = "0 0 0 0";
+		fillColorSL = "0 0 0 0";
+		fillColorNA = "0 0 0 0";
+
+		fontType = %this.font[1];
+		fontDirectory = %this.fontDirectory;
+		fontSize = 20;
+		fontColor = %this.adjustValue(%this.color3, 10);
+		align = "left";
+		vAlign = "top";
+
+		borderDefault = %border;
+		borderTop = %this.emptyBorder;
+		borderBottom = %this.emptyBorder;
+	};
+}
+
 //Positive values are brighter, negative are darker
 //Positive values are brighter, negative are darker
 function BaseTheme::adjustValue(%this, %color, %percent)
 function BaseTheme::adjustValue(%this, %color, %percent)
 {
 {

BIN
editor/EditorCore/Themes/BaseTheme/images/cursors/defaultCursor.png


BIN
editor/EditorCore/Themes/BaseTheme/images/cursors/ibeam.png


+ 9 - 0
editor/EditorCore/Themes/BaseTheme/images/displayBox.asset.taml

@@ -0,0 +1,9 @@
+<ImageAsset
+    AssetName="displayBox_BaseTheme"
+    ImageFile="displayBox.png"
+    CellCountX="9"
+    CellCountY="4"
+    CellWidth="5"
+    CellHeight="5"
+	FilterMode="Nearest"
+	AssetInternal="1" />

BIN
editor/EditorCore/Themes/BaseTheme/images/displayBox.png


+ 4 - 0
editor/EditorCore/Themes/BaseTheme/images/editorBG.asset.taml

@@ -0,0 +1,4 @@
+<ImageAsset
+    AssetName="editorBG_BaseTheme"
+    ImageFile="editorBG.png"
+	AssetInternal="1" />

BIN
editor/EditorCore/Themes/BaseTheme/images/editorBG.png


+ 4 - 0
editor/EditorCore/Themes/BaseTheme/images/fixedHeader200x20.asset.taml

@@ -0,0 +1,4 @@
+<ImageAsset
+    AssetName="fixedHeader200x20_BaseTheme"
+    ImageFile="fixedHeader200x20.png"
+	AssetInternal="1" />

BIN
editor/EditorCore/Themes/BaseTheme/images/fixedHeader200x20.png


+ 4 - 0
editor/EditorCore/Themes/ForestRobe/ForestRobeTheme.cs

@@ -16,4 +16,8 @@ function ForestRobeTheme::init(%this)
 	%this.color5 = "216 114 107 255";
 	%this.color5 = "216 114 107 255";
 
 
 	%this.borderSize = 3;
 	%this.borderSize = 3;
+
+	%this.editorBG = "EditorCore:editorBG_BaseTheme";
+	%this.fixedHeader200x20 = "EditorCore:fixedHeader200x20_BaseTheme";
+	%this.displayBox = "EditorCore:displayBox_BaseTheme";
 }
 }

+ 4 - 0
editor/EditorCore/Themes/LabCoat/LabCoatTheme.cs

@@ -16,6 +16,10 @@ function LabCoatTheme::init(%this)
 	%this.color5 = "16 162 235 255";
 	%this.color5 = "16 162 235 255";
 
 
 	%this.borderSize = 2;
 	%this.borderSize = 2;
+
+	%this.editorBG = "EditorCore:editorBG_BaseTheme";
+	%this.fixedHeader200x20 = "EditorCore:fixedHeader200x20_BaseTheme";
+	%this.displayBox = "EditorCore:displayBox_BaseTheme";
 }
 }
 
 
 function LabCoatTheme::makePanelProfile(%this)
 function LabCoatTheme::makePanelProfile(%this)

+ 48 - 0
editor/EditorCore/Themes/ThemeManager.cs

@@ -29,6 +29,7 @@ function ThemeManager::onAdd(%this)
 
 
 	%this.themeList = new SimSet();
 	%this.themeList = new SimSet();
 	%this.controlList = new SimSet();
 	%this.controlList = new SimSet();
+	%this.spriteList = new SimSet();
 
 
 	%constructionVest = new ScriptObject()
 	%constructionVest = new ScriptObject()
 	{
 	{
@@ -67,6 +68,7 @@ function ThemeManager::setTheme(%this, %i)
 	%theme = %this.themeList.getObject(%i);
 	%theme = %this.themeList.getObject(%i);
 	%this.activeTheme = %theme;
 	%this.activeTheme = %theme;
 	%this.refreshProfiles();
 	%this.refreshProfiles();
+	%this.refreshSprites();
 	%this.postEvent("ThemeChange", %theme);
 	%this.postEvent("ThemeChange", %theme);
 }
 }
 
 
@@ -99,6 +101,30 @@ function ThemeManager::refreshProfiles(%this)
 			}
 			}
 
 
 			%obj.gui.setEditFieldValue(%obj.profileTag, %this.activeTheme.getFieldValue(%obj.profileName));
 			%obj.gui.setEditFieldValue(%obj.profileTag, %this.activeTheme.getFieldValue(%obj.profileName));
+
+			if(%obj.profileName $= "textEditProfile")
+			{
+				%obj.gui.editCursor = %this.activeTheme.editCursor;
+			}
+		}
+		else
+		{
+			//let's remove this corpse
+			%this.controlList.remove(%obj);
+			%this.i--;
+		}
+	}
+}
+
+function ThemeManager::refreshSprites(%this)
+{
+	for (%i = 0; %i < %this.spriteList.getCount(); %i++)
+	{
+		%obj = %this.spriteList.getObject(%i);
+
+		if(isObject(%obj.sprite))
+		{
+			%obj.sprite.setImage(%this.activeTheme.getFieldValue(%obj.imageName), %obj.frame);
 		}
 		}
 		else
 		else
 		{
 		{
@@ -130,6 +156,28 @@ function ThemeManager::setProfile(%this, %gui, %profileName, %profileTag)
 			profileName = %profileName;
 			profileName = %profileName;
 		}
 		}
 	);
 	);
+
+	if(%profileName $= "textEditProfile")
+	{
+		%gui.editCursor = %this.activeTheme.editCursor;
+	}
+}
+
+function ThemeManager::setImage(%this, %sprite, %imageName, %frame)
+{
+	if(%frame $= "")
+	{
+		%frame = 0;
+	}
+	%sprite.setImage(%this.activeTheme.getFieldValue(%imageName), %frame);
+	%this.spriteList.add(
+		new ScriptObject()
+		{
+			sprite = %sprite;
+			frame = %frame;
+			imageName = %imageName;
+		}
+	);
 }
 }
 
 
 function ThemeManager::createProfile(%this, %profileName, %parentName, %settings)
 function ThemeManager::createProfile(%this, %profileName, %parentName, %settings)

+ 45 - 0
editor/EditorCore/Themes/TorqueSuit/TorqueSuitTheme.cs

@@ -16,6 +16,10 @@ function TorqueSuitTheme::init(%this)
 	%this.color5 = "33 191 132 255";
 	%this.color5 = "33 191 132 255";
 
 
 	%this.borderSize = 4;
 	%this.borderSize = 4;
+
+	%this.editorBG = "EditorCore:editorBG_BaseTheme";
+	%this.fixedHeader200x20 = "EditorCore:fixedHeader200x20_BaseTheme";
+	%this.displayBox = "EditorCore:displayBox_BaseTheme";
 }
 }
 
 
 function TorqueSuitTheme::makeButtonProfile(%this)
 function TorqueSuitTheme::makeButtonProfile(%this)
@@ -449,6 +453,47 @@ function TorqueSuitTheme::makeScrollProfile(%this)
 
 
 		borderDefault = %mainBorder;
 		borderDefault = %mainBorder;
 	};
 	};
+
+	//Tiny scroll profile - for uses when you have little space
+	%this.tinyTrackProfile = new GuiControlProfile()
+	{
+			fillColor = %this.setAlpha(%this.color2, 150);
+			fillColorHL = %this.setAlpha(%this.color2, 150);
+			fillColorSL = %this.setAlpha(%this.adjustValue(%this.color2, 10), 150);
+			fillColorNA = %this.setAlpha(%this.color2, 50);
+			borderDefault = %this.emptyBorder;
+	};
+
+	%this.tinyThumbProfile = new GuiControlProfile()
+	{
+		fillColor = %this.color3;
+		fillColorHL = %this.adjustValue(%this.color3, 10);
+		fillColorSL = %this.color5;
+		fillColorNA = %this.setAlpha(%this.color3, 80);
+		borderDefault = %this.emptyBorder;
+	};
+
+	//probably best to avoid the arrow buttons for very small scroll bars
+	%this.tinyScrollArrowProfile = new GuiControlProfile()
+	{
+		fillColor = %this.color3;
+		fillColorHL = %this.adjustValue(%this.color3, 10);
+		fillColorSL = %this.color5;
+		fillColorNA = %this.setAlpha(%this.color3, 80);
+
+		fontType = %this.font[1];
+		fontDirectory = %this.fontDirectory;
+		fontColor = %this.color2;
+		fontColorHL = %this.color2;
+		fontColorSL = %this.color4;
+		fontColorNA = %this.setAlpha(%this.color2, 80);
+		borderDefault = %this.emptyBorder;
+	};
+	%this.scrollProfile = new GuiControlProfile()
+	{
+	    fillColor = %this.setAlpha(%this.color2, 180);
+		borderDefault = %this.emptyBorder;
+	};
 }
 }
 
 
 function TorqueSuitTheme::makeConsoleProfile(%this)
 function TorqueSuitTheme::makeConsoleProfile(%this)

+ 547 - 0
editor/EditorCore/gui/guiProfiles.cs

@@ -0,0 +1,547 @@
+//-----------------------------------------------------------------------------
+// Copyright (c) 2013 GarageGames, LLC
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+
+function EditorCore::SetProfileColors(%this)
+{
+	%this.color[1] = "43 43 43 255";
+	%this.color[2] = "81 92 102 255";
+	%this.color[3] = "224 224 224 255";
+	%this.color[4] = "54 135 196 255";
+	%this.color[5] = "245 210 50 255";
+	%this.color[6] = "196 54 71 255";
+}
+
+function EditorCore::SetProfileFont(%this)
+{
+	if (%this.platform $= "windows")
+		%this.platformFontType = "share tech mono";
+	else if (%this.platform $= "Android")
+		%this.platformFontType = "Droid";
+	else
+		%this.platformFontType = "monaco";
+	if (%this.platform $= "ios")
+		%this.platformFontSize = 18;
+	else if (%this.platform $= "Android")
+		%this.platformFontSize = 14;
+	else
+		%this.platformFontSize = 12;
+}
+
+function EditorCore::AdjustColorValue(%this, %color, %percent)
+{
+	%red = getWord(%color, 0);
+	%green = getWord(%color, 1);
+	%blue = getWord(%color, 2);
+	%alpha = getWord(%color, 3);
+
+	%largest = mGetMax(%red, mGetMax(%blue, %green));
+	%currentValue = %largest / 255;
+	%fullRed = %red / %currentValue;
+	%fullGreen = %green / %currentValue;
+	%fullBlue = %blue / %currentValue;
+
+	%newValue = %currentValue += (%percent/100);
+	%newValue = mClamp(%newValue, 0, 100);
+	%newColor = mRound(mClamp((%fullRed * %newValue), 0, 255)) SPC
+		mRound(mClamp((%fullGreen * %newValue), 0, 255)) SPC
+		mRound(mClamp((%fullBlue * %newValue), 0, 255)) SPC %alpha;
+
+	return %newColor;
+}
+
+function EditorCore::SetColorAlpha(%this, %color, %newAlpha)
+{
+	%red = getWord(%color, 0);
+	%green = getWord(%color, 1);
+	%blue = getWord(%color, 2);
+	return %red SPC %green SPC %blue SPC mRound(mClamp(%newAlpha, 0, 255));
+}
+
+function EditorCore::SafeCreateNamedObject(%this, %name, %object)
+{
+	if(isObject(%name))
+	{
+		%originalObject = nameToID(%name);
+		if(%orginalObject.getClassName() !$= %object.getClassName())
+		{
+			warn("Attempted to change the class of the named object " @ %name @ "!");
+			warn("Original Class: " @ %originalObject.getClassName());
+			warn("New Class: " @ %object.getClassName());
+			return;
+		}
+		%originalObject.assignFieldsFrom(%object);
+		%object.delete();
+	}
+	else
+	{
+		%object.setName(%name);
+	}
+}
+
+function EditorCore::createGuiProfiles(%this)
+{
+	%this.SetProfileColors();
+	%this.SetProfileFont();
+
+	//Changing the default gui profile and border profile might cause engine instability! Consider making a new child profile instead.
+	%this.SafeCreateNamedObject("GuiDefaultBorderProfile", new GuiBorderProfile()
+	{
+		// Default margin
+		margin = 0;
+		marginHL = 0;
+		marginSL = 0;
+		marginNA = 0;
+		//Default Border
+		border = 0;
+		borderHL = 0;
+		borderSL = 0;
+		borderNA = 0;
+		//Default border color
+		borderColor   = %this.color1;
+	    borderColorHL = %this.AdjustColorValue(%this.color1, 10);
+	    borderColorSL = %this.AdjustColorValue(%this.color1, 10);
+	    borderColorNA = %this.SetColorAlpha(%this.color1, 100);
+		//Default Padding
+		padding = 0;
+		paddingHL = 0;
+		paddingSL = 0;
+		paddingNA = 0;
+		//Default underfill
+		underfill = true;
+	});
+
+	//See the warning above! You should avoid changing this.
+	%this.SafeCreateNamedObject("GuiDefaultProfile", new GuiControlProfile()
+	{
+	    // fill color
+	    fillColor = "0 0 0 0";
+
+	    // font
+	    fontType = %this.platformFontType;
+		fontDirectory = "^EditorCore/gui/fonts";
+	    fontSize = %this.platformFontSize;
+	    fontColor = "255 255 255 255";
+		align = center;
+		vAlign = middle;
+
+		cursorColor = "0 0 0 255";
+
+		borderDefault = GuiDefaultBorderProfile;
+		category = "default";
+	});
+
+	%this.SafeCreateNamedObject("GuiBrightBorderProfile", new GuiBorderProfile()
+	{
+		border = 2;
+		borderHL = 2;
+		borderSL = 2;
+		borderNA = 2;
+
+		borderColor = "255 255 255 50";
+		borderColorHL = "255 255 255 50";
+		borderColorSL = "255 255 255 50";
+		borderColorNA = "255 255 255 50";
+
+		underfill = true;
+	});
+
+	%this.SafeCreateNamedObject("GuiDarkBorderProfile", new GuiBorderProfile()
+	{
+		border = 2;
+		borderHL = 2;
+		borderSL = 2;
+		borderNA = 2;
+
+		borderColor = "0 0 0 50";
+		borderColorHL = "0 0 0 50";
+		borderColorSL = "0 0 0 50";
+		borderColorNA = "0 0 0 50";
+
+		underfill = true;
+	});
+
+	%this.SafeCreateNamedObject("GuiPanelProfile", new GuiControlProfile()
+	{
+		fillColor = %this.color1;
+	    fillColorHL = %this.AdjustColorValue(%this.color1, 10);
+	    fillColorSL = %this.AdjustColorValue(%this.color1, 15);
+	    fillColorNA = %this.SetColorAlpha(%this.color1, 100);
+		borderDefault = GuiBrightBorderProfile;
+		category = "defaultPanel";
+	});
+
+	%listBorderProfile = new GuiBorderProfile()
+	{
+		margin = 1;
+		marginHL = 1;
+		marginSL = 1;
+		marginNA = 1;
+
+		padding = 4;
+		paddingHL = 4;
+		paddingSL = 4;
+		paddingNA = 4;
+	};
+
+	%this.SafeCreateNamedObject("GuiListBoxProfile", new GuiControlProfile()
+	{
+	    // fill color
+	    fillColor = %this.color1;
+	    fillColorHL = %this.AdjustColorValue(%this.color1, 10);
+	    fillColorSL = %this.color4;
+	    fillColorNA = %this.SetColorAlpha(%this.color1, 100);
+		align = left;
+
+		tab = false;
+		canKeyFocus = true;
+		category = "defaultListBox";
+
+		fontColor = %this.color3;
+		fontColorHL = %this.AdjustColorValue(%this.color3, 20);
+		fontColorSL = %this.AdjustColorValue(%this.color3, 20);
+		fontColorNA = %this.AdjustColorValue(%this.color3, -30);
+
+		borderDefault = %listBorderProfile;
+	});
+
+	%windowBorderProfile = new GuiBorderProfile()
+	{
+		padding = 10;
+		paddingHL = 10;
+		paddingSL = 10;
+		paddingNA = 4;
+	};
+
+	%this.SafeCreateNamedObject("GuiWindowProfile", new GuiControlProfile()
+	{
+	   fillColor = %this.AdjustColorValue(%this.color1, 10);
+	   fillColorHL = %this.AdjustColorValue(%this.color1, 12);
+	   fillColorSL = %this.color4;
+	   fillColorNA = %this.color1;
+	   category = "defaultWindow";
+	   align = "Left";
+
+	   fontColorSL = %this.color5;
+
+	   borderLeft = %windowBorderProfile;
+	});
+
+	%windowContentProfile = new GuiBorderProfile()
+	{
+		borderColor = %this.AdjustColorValue(%this.color1, 10);
+		borderColorSL = %this.AdjustColorValue(%this.color4, -10);
+
+		border = 3;
+		borderSL = 3;
+	};
+
+	%this.SafeCreateNamedObject("GuiWindowContentProfile", new GuiControlProfile()
+	{
+		fillColor = %this.AdjustColorValue(%this.color1, -10);
+		fillColorSL = %this.AdjustColorValue(%this.color1, -10);
+
+		borderDefault = %windowContentProfile;
+		borderTop = GuiDefaultBorderProfile;
+	});
+
+	%windowButtonBorderProfile = new GuiBorderProfile()
+	{
+		margin = 1;
+		marginHL = 1;
+		marginSL = 1;
+		marginNA = 1;
+
+		padding = 3;
+		paddingHL = 3;
+		paddingSL = 3;
+		paddingNA = 3;
+	};
+
+	%this.SafeCreateNamedObject("GuiWindowCloseButtonProfile", new GuiControlProfile()
+	{
+		fillColor = %this.SetColorAlpha(%this.color1, 150);
+		fillColorHL = %this.SetColorAlpha(%this.color6, 150);
+		fillColorSL = %this.AdjustColorValue(%this.color6, 10);
+		fillColorNA = %this.color1;
+
+		fontColor = %this.SetColorAlpha(%this.color3, 150);
+		fontColorHL = %this.SetColorAlpha(%this.color3, 170);
+		fontColorSL = %this.color5;
+		fontColorNA = %this.SetColorAlpha(%this.color3, 150);
+
+		borderDefault = %windowButtonBorderProfile;
+	});
+
+	%this.SafeCreateNamedObject("GuiWindowMinButtonProfile", new GuiControlProfile()
+	{
+		fillColor = %this.SetColorAlpha(%this.color1, 150);
+		fillColorHL = %this.SetColorAlpha(%this.color4, 150);
+		fillColorSL = %this.AdjustColorValue(%this.color4, 10);
+		fillColorNA = %this.color1;
+
+		fontColor = %this.SetColorAlpha(%this.color3, 150);
+		fontColorHL = %this.SetColorAlpha(%this.color3, 170);
+		fontColorSL = %this.color5;
+		fontColorNA = %this.SetColorAlpha(%this.color3, 150);
+
+		borderDefault = %windowButtonBorderProfile;
+	});
+
+	%this.SafeCreateNamedObject("GuiWindowMaxButtonProfile", new GuiControlProfile()
+	{
+		fillColor = %this.SetColorAlpha(%this.color1, 150);
+		fillColorHL = %this.SetColorAlpha(%this.color4, 150);
+		fillColorSL = %this.AdjustColorValue(%this.color4, 10);
+		fillColorNA = %this.color1;
+
+		fontColor = %this.SetColorAlpha(%this.color3, 150);
+		fontColorHL = %this.SetColorAlpha(%this.color3, 170);
+		fontColorSL = %this.color5;
+		fontColorNA = %this.SetColorAlpha(%this.color3, 150);
+
+		borderDefault = %windowButtonBorderProfile;
+	});
+
+	%this.SafeCreateNamedObject("GuiTabProfile", new GuiControlProfile()
+	{
+		fontColor = "255 255 255 255";
+	    fontColorHL = "232 240 248 255";
+	    fontColorSL= "255 255 255 255";
+	    fontColorNA = "0 0 0 255";
+		fillColor = %this.color1;
+		fillColorHL = %this.AdjustColorValue(%this.color1, 10);
+		fillColorSL = %this.AdjustColorValue(%this.color1, 15);
+		fillColorNA = %this.SetColorAlpha(%this.color1, 100);
+		borderDefault = GuiBrightBorderProfile;
+		align = Center;
+		category = "defaultTab";
+	});
+
+	%this.SafeCreateNamedObject("GuiTabPageProfile", new GuiControlProfile()
+	{
+		fillColor = %this.color1;
+		fillColorHL = %this.AdjustColorValue(%this.color1, 10);
+		fillColorSL = %this.AdjustColorValue(%this.color1, 15);
+		fillColorNA = %this.SetColorAlpha(%this.color1, 100);
+		category = "defaultTabPage";
+	});
+
+	%this.SafeCreateNamedObject("GuiToolTipProfile", new GuiControlProfile()
+	{
+		// fill color
+	    fillColor = %this.SetColorAlpha(%this.color1, 220);
+	    fillColorHL = %this.AdjustColorValue(%this.color1, 10);
+	    fillColorSL = %this.AdjustColorValue(%this.color1, 15);
+	    fillColorNA = %this.SetColorAlpha(%this.color1, 100);
+
+		fontColor = %this.color5;
+
+		borderDefault = GuiBrightBorderProfile;
+	});
+
+	%this.SafeCreateNamedObject("GuiScrollTrackProfile", new GuiControlProfile()
+	{
+		fillColor = %this.color1;
+	    fillColorHL = %this.color1;
+	    fillColorSL = %this.color1;
+	    fillColorNA = %this.color1;
+	});
+
+	%this.SafeCreateNamedObject("GuiScrollThumbProfile", new GuiControlProfile()
+	{
+		fillColor = %this.color3;
+	    fillColorHL = %this.AdjustColorValue(%this.color3, 10);
+	    fillColorSL = %this.color4;
+	    fillColorNA = %this.SetColorAlpha(%this.color3, 100);
+
+		borderDefault = GuiBrightBorderProfile;
+		borderRight = GuiDarkBorderProfile;
+		borderBottom = GuiDarkBorderProfile;
+	});
+
+	%this.SafeCreateNamedObject("GuiScrollArrowProfile", new GuiControlProfile()
+	{
+		fontColor = "0 0 0 100";
+	    fontColorHL = "0 0 0 150";
+	    fontColorSL = %this.color5;
+	    fontColorNA = "0 0 0 50";
+
+		borderDefault = GuiBrightBorderProfile;
+		borderRight = GuiDarkBorderProfile;
+		borderBottom = GuiDarkBorderProfile;
+	});
+
+	%this.SafeCreateNamedObject("GuiScrollProfile", new GuiControlProfile()
+	{
+	    fillColor = %this.color2;
+	    borderDefault = GuiDefaultBorderProfile;
+	});
+
+	%this.SafeCreateNamedObject("GuiProgressProfile", new GuiControlProfile()
+	{
+	   fillColor = %this.color1;
+	   fillColorHL = %this.color4;
+	   fillColorSL = %this.AdjustColorValue(%this.color4, 10);
+
+	   fontColorHL = %this.color3;
+	   fontColorSL = %this.color5;
+
+	   borderDefault = GuiBrightBorderProfile;
+	   borderBottom = GuiDarkBorderProfile;
+	   borderRight = GuiDarkBorderProfile;
+	});
+
+	%this.SafeCreateNamedObject("GuiDropDownProfile", new GuiControlProfile()
+	{
+	    // fill color
+	    fillColor = %this.AdjustColorValue(%this.color3, -15);
+		fillColorHL = %this.AdjustColorValue(%this.color3, -8);
+		fillColorSL = %this.color4;
+		fillColorNA = %this.SetColorAlpha(%this.color3, 100);
+
+	    fontColor = %this.color1;
+		fontColorHL = %this.color1;
+		fontColorSL = %this.color3;
+		fontColorNA = %this.SetColorAlpha(%this.color1, 100);
+		align = "left";
+
+		tab = true;
+		canKeyFocus = true;
+
+		borderDefault = GuiBrightBorderProfile;
+		borderRight = GuiDarkBorderProfile;
+		borderBottom = GuiDarkBorderProfile;
+		category = "dropDown";
+	});
+
+	%this.SafeCreateNamedObject("GuiMenuBarProfile", new GuiControlProfile()
+	{
+		fillColor = %this.AdjustColorValue(%this.color1, -7);
+		canKeyFocus = true;
+		category = "defaultMenuBar";
+	});
+
+	%this.SafeCreateNamedObject("GuiMenuProfile", new GuiControlProfile()
+	{
+		fillColor = "0 0 0 0";
+		fillColorHL = "255 255 255 10";
+		fillColorSL = %this.AdjustColorValue(%this.color4, -15);
+		fillColorNA = "0 0 0 0";
+
+		borderDefault = GuiDarkBorderProfile;
+		category = "defaultMenuBar";
+
+		fontColor = %this.color3;
+		fontColorHL = %this.AdjustColorValue(%this.color3, 10);
+		fontColorSL = %this.color3;
+		fontColorNA = %this.SetColorAlpha(%this.color3, 100);
+	});
+
+	%this.SafeCreateNamedObject("GuiMenuContentProfile", new GuiControlProfile()
+	{
+		fillColor = %this.AdjustColorValue(%this.color1, -5);
+
+		borderDefault = GuiDefaultBorderProfile;
+	});
+
+	%this.SafeCreateNamedObject("GuiMenuItemProfile", new GuiControlProfile()
+	{
+		fillColor = %this.AdjustColorValue(%this.color1, -5);
+		fillColorHL = %this.AdjustColorValue(%this.color4, -15);
+		fillColorNA = %this.color1;
+		align = left;
+
+		fontColor = %this.color3;
+		fontColorHL = %this.AdjustColorValue(%this.color3, 10);
+		fontColorNA = %this.SetColorAlpha(%this.color3, 150);
+
+		borderDefault = GuiDefaultBorderProfile;
+	});
+
+	%this.SafeCreateNamedObject("GuiTextEditProfile", new GuiControlProfile()
+	{
+		fillColor = %this.color4;
+		fillColorHL = %this.AdjustColorValue(%this.color4, 10);
+		fillColorSL = %this.color4;
+		fillColorNA = %this.AdjustColorValue(%this.color4, 80);
+		fillColorTextSL = %this.color5;
+
+		fontColor = %this.SetColorAlpha(%this.color1, 220);
+		fontColorHL = %this.AdjustColorValue(%this.color1, 10);
+		fontColorSL = %this.color1;
+		fontColorNA = %this.SetColorAlpha(%this.color1, 100);
+		fontColorTextSL = %this.color1;
+		align = left;
+		vAlign = middle;
+		cursorColor = %this.color2;
+
+		tab = true;
+		canKeyFocus = true;
+		returnTab = true;
+	});
+
+	%this.SafeCreateNamedObject("GuiButtonProfile", new GuiControlProfile()
+	{
+		fillColor = %this.color4;
+		fillColorHL = %this.AdjustColorValue(%this.color4, 10);
+		fillColorSL = %this.color5;
+		fillColorNA = %this.SetColorAlpha(%this.color4, 80);
+
+		fontColor = %this.color1;
+		fontColorHL = %this.AdjustColorValue(%this.color1, 10);
+		fontColorSL = %this.color1;
+		fontColorNA = %this.SetColorAlpha(%this.color1, 100);
+		align = center;
+		vAlign = middle;
+
+		borderLeft = GuiBrightBorderProfile;
+		borderRight = GuiDarkBorderProfile;
+		borderTop = GuiBrightBorderProfile;
+		borderBottom = GuiDarkBorderProfile;
+
+		canKeyFocus = true;
+		tab = true;
+	});
+
+	%this.SafeCreateNamedObject("GuiCheckboxProfile", new GuiControlProfile()
+	{
+		fillColor = %this.color4;
+		fillColorHL = %this.AdjustColorValue(%this.color4, 10);
+		fillColorSL = %this.color5;
+		fillColorNA = %this.SetColorAlpha(%this.color4, 80);
+
+		fontColor = %this.color1;
+		fontColorHL = %this.AdjustColorValue(%this.color1, 10);
+		fontColorSL = %this.color1;
+		fontColorNA = %this.SetColorAlpha(%this.color1, 100);
+		align = center;
+		vAlign = middle;
+
+		borderLeft = GuiBrightBorderProfile;
+		borderRight = GuiDarkBorderProfile;
+		borderTop = GuiBrightBorderProfile;
+		borderBottom = GuiDarkBorderProfile;
+
+		canKeyFocus = true;
+		tab = true;
+	});
+}

BIN
editor/EditorCore/gui/images/treeView.png


BIN
editor/EditorCore/images/headerGlow.png


BIN
editor/EditorCore/images/newProject.png


+ 4 - 0
editor/EditorCore/images/projectTileShadow.asset.taml

@@ -0,0 +1,4 @@
+<ImageAsset
+    AssetName="projectTileShadow"
+    ImageFile="projectTileShadow.png"
+	AssetInternal="1" />

BIN
editor/EditorCore/images/projectTileShadow.png


BIN
editor/EditorCore/images/t2d_logo.png


BIN
editor/EditorCore/images/t2d_logo_med.png


BIN
editor/EditorCore/images/t2d_rocket_splash.png


BIN
editor/EditorCore/images/torque_logo.png


+ 15 - 0
editor/EditorCore/scripts/EditorCoreSplash.cs

@@ -0,0 +1,15 @@
+
+function EditorCoreSplash::show(%this)
+{
+	%this.setVisible(true);
+	%this.fadeTo("255 255 255 255", 1000, "easeInOut");
+	%this.moveTo("0 0", 1000, "easeInOut");
+	%this.schedule(2000, "hide");
+}
+
+function EditorCoreSplash::hide(%this)
+{
+	%this.fadeTo("255 255 255 0", 1000, "easeInOut");
+	%this.moveTo("0 -20", 1000, "easeInOut");
+	%this.schedule(1000, "setVisible", false);
+}

+ 124 - 0
editor/EditorCore/scripts/EditorProjectCard.cs

@@ -0,0 +1,124 @@
+function EditorProjectCard::onAdd(%this)
+{
+	%this.header = new GuiSpriteCtrl()
+	{
+		HorizSizing = width;
+		VertSizing = height;
+		Position = "0 0";
+		Extent = "200 20";
+		SingleFrameBitmap = "1";
+		ConstrainProportions = "0";
+		FullSize = "1";
+		ImageColor = "255 255 255 255";
+		PositionOffset = "0 0";
+		UseInput = false;
+	};
+	ThemeManager.setProfile(%this.header, "spriteProfile");
+	ThemeManager.setImage(%this.header, "fixedHeader200x20");
+	%this.add(%this.header);
+
+	%this.projectIcon = new GuiSpriteCtrl()
+	{
+		Bitmap = %this.bitmap;
+		Extent = "200 160";
+		Position = "0 20";
+		SingleFrameBitmap = "1";
+		constrainProportions = "1";
+		FullSize = "1";
+		ImagePosition = "0 0";
+		UseInput = false;
+	};
+	ThemeManager.setProfile(%this.projectIcon, "spriteProfile");
+	%this.add(%this.projectIcon);
+
+	%this.projectIconShadow = new GuiSpriteCtrl()
+	{
+		Image = "EditorCore:projectTileShadow";
+		Extent = "200 160";
+		Position = "0 20";
+		SingleFrameBitmap = "1";
+		constrainProportions = "1";
+		FullSize = "1";
+		ImagePosition = "0 0";
+		UseInput = false;
+	};
+	ThemeManager.setProfile(%this.projectIconShadow, "spriteProfile");
+	%this.add(%this.projectIconShadow);
+
+	%this.scroller = new GuiScrollCtrl()
+	{
+		class = EditorProjectCardScroller;
+		Position="0 180";
+		Extent="200 120";
+		hScrollBar="alwaysOff";
+		vScrollBar="alwaysOn";
+		constantThumbHeight="0";
+		showArrowButtons="0";
+		scrollBarThickness="6";
+	};
+	ThemeManager.setProfile(%this.scroller, "emptyProfile");
+	ThemeManager.setProfile(%this.scroller, "tinyThumbProfile", "ThumbProfile");
+	ThemeManager.setProfile(%this.scroller, "tinyTrackProfile", "TrackProfile");
+	%this.add(%this.scroller);
+	%this.startListening(%this.scroller);
+
+	%this.chain = new GuiChainCtrl()
+	{
+		Position="0 0";
+		Extent = "194 120";
+		IsVertical = "1";
+		ChildSpacing = -4;
+	};
+	ThemeManager.setProfile(%this.chain, "emptyProfile");
+	%this.scroller.add(%this.chain);
+
+	%this.titleText = new GuiControl()
+	{
+		Position = "0 13";
+		Extent = "200 38";
+		Text = %this.title;
+		TextWrap = 1;
+		TextExtend = 1;
+	};
+	ThemeManager.setProfile(%this.titleText, "titleProfile");
+	%this.chain.add(%this.titleText);
+
+	%this.directoryText = new GuiControl()
+	{
+		Position = "0 77";
+		Extent = "200 128";
+		Text = "\\" @ %this.directory @ "\\";
+		TextWrap = 1;
+		TextExtend = 1;
+	};
+	ThemeManager.setProfile(%this.directoryText, "codeProfile");
+	%this.chain.add(%this.directoryText);
+
+	if(%this.isNew)
+	{
+		%this.directoryText.text = %this.directory;
+	}
+
+	%this.descriptionText = new GuiControl()
+	{
+		Position = "0 43";
+		Extent = "200 70";
+		Text = %this.description;
+		TextWrap = 1;
+		TextExtend = 1;
+	};
+	ThemeManager.setProfile(%this.descriptionText, "normalTextProfile");
+	%this.chain.add(%this.descriptionText);
+}
+
+function EditorProjectCard::onClick(%this)
+{
+	if(!%this.isNew)
+	{
+		%this.postEvent("ProjectSelected", %this.directory);
+	}
+	else
+	{
+		%this.postEvent("NewProject");
+	}
+}

+ 217 - 0
editor/EditorCore/scripts/EditorProjectSelector.cs

@@ -0,0 +1,217 @@
+
+function EditorProjectSelector::onAdd(%this)
+{
+	%this.header = new GuiControl()
+	{
+		HorizSizing="width";
+		VertSizing="bottom";
+		Position="0 0";
+		Extent="1024 84";
+		Visible = false;
+	};
+	ThemeManager.setProfile(%this.header, "panelProfile");
+	%this.add(%this.header);
+
+	%this.headerGlow = new GuiSpriteCtrl()
+	{
+		HorizSizing="width";
+		VertSizing="bottom";
+		Position="0 0";
+		Extent="1024 84";
+		Bitmap = "^EditorCore/images/headerGlow.png";
+		SingleFrameBitmap = "1";
+		ConstrainProportions = "1";
+		FullSize = "0";
+		ImageSize = "532 84";
+		ImageColor = "255 255 255 255";
+		PositionOffset = "0 0";
+		Visible = false;
+	};
+	ThemeManager.setProfile(%this.headerGlow, "spriteProfile");
+	%this.add(%this.headerGlow);
+
+	%this.torque2d = new GuiSpriteCtrl()
+	{
+		HorizSizing="right";
+		VertSizing="bottom";
+		Position="0 0";
+		Extent="512 84";
+		Bitmap = "^EditorCore/images/t2d_logo_med.png";
+		SingleFrameBitmap = "1";
+		ConstrainProportions = "1";
+		FullSize = "0";
+		ImageSize = "438 65";
+		ImageColor = "255 255 255 255";
+		PositionOffset = "-20 0";
+		Visible = false;
+	};
+	ThemeManager.setProfile(%this.torque2d, "spriteProfile");
+	%this.add(%this.torque2d);
+
+	%this.versionText = new GuiControl()
+	{
+		HorizSizing="left";
+		VertSizing="bottom";
+		Position = "924 64";
+		Extent = "100 20";
+		Text = getEngineVersion();
+		Visible = false;
+	};
+	ThemeManager.setProfile(%this.versionText, "codeProfile");
+	%this.add(%this.versionText);
+
+	%this.scroller = new GuiScrollCtrl()
+	{
+		HorizSizing="width";
+		VertSizing="height";
+		Position="0 84";
+		Extent="1024 684";
+		hScrollBar="alwaysOff";
+		vScrollBar="dynamic";
+		constantThumbHeight="0";
+		showArrowButtons="1";
+		scrollBarThickness="14";
+	};
+	ThemeManager.setProfile(%this.scroller, "emptyProfile");
+	ThemeManager.setProfile(%this.scroller, "scrollingPanelThumbProfile", ThumbProfile);
+	ThemeManager.setProfile(%this.scroller, "scrollingPanelTrackProfile", TrackProfile);
+	ThemeManager.setProfile(%this.scroller, "scrollingPanelArrowProfile", ArrowProfile);
+	%this.add(%this.scroller);
+
+	%this.grid = new GuiGridCtrl()
+	{
+		HorizSizing="width";
+		VertSizing="height";
+		Position="20 20";
+		Extent = "984 684";
+		CellSizeX = 210;
+		CellSizeY = 310;
+		CellModeX = "fixed";
+		CellSpacingX = 20;
+		CellSpacingY = 20;
+		OrderMode = "LRTB";
+	};
+	ThemeManager.setProfile(%this.grid, "emptyProfile");
+	%this.scroller.add(%this.grid);
+
+	%this.scroller.computeSizes();
+
+	%this.torqueCurtain = new GuiSpriteCtrl()
+	{
+		HorizSizing = width;
+		VertSizing = height;
+		Position = "0 0";
+		Extent = "1024 768";
+		SingleFrameBitmap = "1";
+		ConstrainProportions = "0";
+		FullSize = "1";
+		ImageColor = "255 255 255 255";
+		PositionOffset = "0 0";
+		Visible = false;
+		UseInput = false;
+	};
+	ThemeManager.setProfile(%this.torqueCurtain, "spriteProfile");
+	ThemeManager.setImage(%this.torqueCurtain, "editorBG");
+	%this.add(%this.torqueCurtain);
+}
+
+function EditorProjectSelector::show(%this)
+{
+	%this.torqueCurtain.setVisible(true);
+	%this.header.setVisible(true);
+	%this.versionText.setVisible(true);
+	%this.headerGlow.setVisible(true);
+	%this.torque2d.setVisible(true);
+
+	%folderList = getDirectoryList(getMainDotCsDir());
+	for(%i = 0; %i < getFieldCount(%folderList); %i++)
+	{
+		%folder = getField(%folderList, %i);
+		if(%folder !$= "library" && %folder !$= "editor" && %folder !$= "engine" && getSubStr(%folder, 0, 1) !$= ".")
+		{
+			%this.scanFolder(%folder);
+		}
+	}
+
+	%this.showProject("New Project", pathConcat(getMainDotCsDir(), "editor/EditorCore/images/newProject.png"), "Blast off!", "Time to launch something new?", true);
+
+	%this.torqueCurtain.fadeTo("255 255 255 0", 500, "easeInOut");
+}
+
+function EditorProjectSelector::hide(%this)
+{
+	%this.torqueCurtain.fadeTo("255 255 255 255", 500, "easeOut");
+	%this.schedule(500, "postEvent", "ProjectSelected");
+}
+
+function EditorProjectSelector::scanFolder(%this, %folder)
+{
+	//echo("scanning folder " @ %folder);
+	ModuleDatabase.ScanModules(%folder);
+	%appCore = ModuleDatabase.findModule("AppCore", 1);
+	if(isObject(%appCore))
+	{
+		%this.showProject(%appCore.project, pathConcat(%appCore.getModulePath(), %appCore.icon), %folder, %appCore.projectDescription, false);
+	}
+
+	//Awesome, now unscan everything we just scanned.
+	ModuleDatabase.clearDatabase();
+}
+
+function EditorProjectSelector::showProject(%this, %title, %bitmap, %directory, %description, %isNew)
+{
+	%container = new GuiButtonCtrl()
+	{
+		Class = EditorProjectCard;
+		Extent = "210 310";
+		title = %title;
+		bitmap = %bitmap;
+		directory = %directory;
+		description = %description;
+		isNew = %isNew;
+	};
+	ThemeManager.setProfile(%container, "displayBoxProfile");
+	%this.grid.add(%container);
+
+	%container.addListener(%this);
+}
+
+function EditorProjectSelector::onProjectSelected(%this, %folder)
+{
+	ModuleDatabase.ScanModules(%folder);
+	%this.hide();
+}
+
+function EditorProjectSelector::onNewProject(%this)
+{
+	%width = 700;
+	%height = 340;
+	%dialog = new GuiControl()
+	{
+		class = "NewProjectDialog";
+		superclass = "EditorDialog";
+		dialogSize = (%width + 8) SPC (%height + 8);
+		dialogCanClose = true;
+		dialogText = "New Project";
+	};
+	%dialog.init(%width, %height);
+	%this.startListening(%dialog);
+
+	Canvas.pushDialog(%dialog);
+}
+
+function EditorProjectSelector::onDialogClosed(%this, %dialog)
+{
+	%this.dialog = %dialog;
+	%this.schedule(100, "deleteDialog");
+}
+
+function EditorProjectSelector::deleteDialog(%this)
+{
+	%this.dialog.delete();
+}
+
+function EditorProjectSelector::onProjectCreated(%this, %folder)
+{
+	%this.scanFolder(%folder);
+}

+ 160 - 0
editor/EditorCore/scripts/NewProjectDialog.cs

@@ -0,0 +1,160 @@
+
+function NewProjectDialog::init(%this, %width, %height)
+{
+	//Get the dialog contents
+	%window = %this.getObject(0);
+	%content = %window.getObject(0);
+
+	//Create the file text box
+	%form = new GuiGridCtrl()
+	{
+		class = "EditorForm";
+		extent = %width SPC %height;
+		cellSizeX = %width;
+		cellSizeY = 50;
+	};
+	%form.addListener(%this);
+
+	%item = %form.addFormItem("Title", %width SPC 30);
+	%this.titleBox = %form.createTextEditItem(%item);
+	%this.titleBox.Command = %this.getId() @ ".Validate();";
+
+	%item = %form.addFormItem("Directory", %width SPC 30);
+	%this.dirBox = %form.createTextEditItem(%item);
+	%this.dirBox.Command = %this.getId() @ ".Validate();";
+
+	%item = %form.addFormItem("Description", %width SPC 130);
+	%this.descBox = %form.createTextEditItem(%item);
+	%this.descBox.Command = %this.getId() @ ".Validate();";
+
+	%content.add(%form);
+
+	%this.feedback = new GuiControl()
+	{
+		HorizSizing = "right";
+		VertSizing = "bottom";
+		Position = "12 170";
+		Extent = (%width - 24) SPC 80;
+		text = "";
+		textWrap = true;
+		textExtend = true;
+	};
+	ThemeManager.setProfile(%this.feedback, "infoProfile");
+
+	%this.cancelButton = new GuiButtonCtrl()
+	{
+		HorizSizing = "right";
+		VertSizing = "bottom";
+		Position = "478 270";
+		Extent = "100 30";
+		Text = "Cancel";
+		Command = %this.getID() @ ".onClose();";
+	};
+	ThemeManager.setProfile(%this.cancelButton, "buttonProfile");
+
+	%this.createButton = new GuiButtonCtrl()
+	{
+		HorizSizing = "right";
+		VertSizing = "bottom";
+		Position = "588 268";
+		Extent = "100 34";
+		Text = "Create";
+		Command = %this.getID() @ ".onCreate();";
+	};
+	ThemeManager.setProfile(%this.createButton, "primaryButtonProfile");
+
+	%content.add(%this.feedback);
+	%content.add(%this.cancelButton);
+	%content.add(%this.createButton);
+
+	%this.validate();
+}
+
+function NewProjectDialog::Validate(%this)
+{
+	%this.createButton.active = false;
+
+	%title = %this.titleBox.getText();
+	%directory = %this.dirBox.getText();
+	%description = %this.descBox.getText();
+
+	if(%title $= "")
+	{
+		%this.feedback.setText("Please enter a title for your project.");
+		return false;
+	}
+
+	if(%directory $= "")
+	{
+		%this.feedback.setText("Please select a name for the directory that your project will launch from.");
+		return false;
+	}
+	else
+	{
+		%path = makeFullPath(%directory, getMainDotCsDir());
+		if(isDirectory(%path))
+		{
+			%fileList = getFileList(%path);
+			%dirList = getDirectoryList(%path);
+			if(getWordCount(%fileList) > 0 || getWordCount(%dirList) > 0)
+			{
+				%this.feedback.setText("The directory should be an empty directory or a non-existing directory in the main T2d directory.");
+				return false;
+			}
+		}
+	}
+
+	if(%description $= "")
+	{
+		%this.feedback.setText("Please add a short, meaningful description for your project.");
+		return false;
+	}
+
+	%this.createButton.active = true;
+	%this.feedback.setText("Press the Create button to create your new project!");
+	return true;
+}
+
+function NewProjectDialog::onClose(%this)
+{
+	Canvas.popDialog(%this);
+	%this.postEvent("DialogClosed", %this);
+}
+
+function NewProjectDialog::onCreate(%this)
+{
+	if(%this.validate())
+	{
+		%title = %this.titleBox.getText();
+		%directory = %this.dirBox.getText();
+		%description = %this.descBox.getText();
+
+		%path = makeFullPath(%directory, getMainDotCsDir());
+		if(getSubStr(%path, strlen(%path) - 1, 1) !$= "\\")
+		{
+			%path = %path @ "\\";
+		}
+		createPath(%path);
+
+		ModuleDatabase.scanModules(pathConcat(getMainDotCsDir(), "library"));
+		ModuleDatabase.CopyModule("AppCore", 1, "AppCore", pathConcat(%path, "AppCore"), false);
+		ModuleDatabase.CopyModule("Audio", 1, "Audio", pathConcat(%path, "Audio"), false);
+		ModuleDatabase.clearDatabase();
+
+		%file = TamlRead(pathConcat(%path, "AppCore\\module.taml"));
+		%file.Project = %title;
+		%file.ProjectDescription = %description;
+		TamlWrite(%file, pathConcat(%path, "AppCore\\module.taml"));
+
+		%data = new ScriptObject()
+		{
+			title = %title;
+			directory = %directory;
+			description = %description;
+			icon = pathConcat(%path, "AppCore", %file.Icon);
+		};
+
+		%this.postEvent("ProjectCreated", %directory);
+		%this.onClose();
+	}
+}

+ 126 - 0
editor/EditorCore/scripts/canvas.cs

@@ -0,0 +1,126 @@
+//-----------------------------------------------------------------------------
+// Copyright (c) 2013 GarageGames, LLC
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+
+//------------------------------------------------------------------------------
+// initializeCanvas
+// Constructs and initializes the default canvas window.
+//------------------------------------------------------------------------------
+function EditorCore::initializeCanvas(%this, %windowName)
+{
+    // Don't duplicate the canvas.
+    if(!isObject(Canvas))
+    {
+	    videoSetGammaCorrection($pref::OpenGL::gammaCorrection);
+
+	    if ( !createCanvas(%windowName) )
+	    {
+	        error("Canvas creation failed. Shutting down.");
+	        quit();
+	    }
+
+	    if ($platform $= "iOS")
+	    {
+	        %resolution = $pref::iOS::Width SPC $pref::iOS::Height SPC $pref::iOS::ScreenDepth;
+	    }
+	    else if ($platform $= "Android")
+	    {
+	    	%resolution = GetAndroidResolution();
+	    }
+	    else
+	    {
+	        if ( $pref::Video::windowedRes !$= "" )
+	            %resolution = $pref::Video::windowedRes;
+	        else
+	            %resolution = $pref::Video::defaultResolution;
+	    }
+
+	    if ($platform $= "windows" || $platform $= "macos")
+	    {
+	        setScreenMode( %resolution._0, %resolution._1, %resolution._2, $pref::Video::fullScreen );
+	    }
+	    else
+	    {
+	        setScreenMode( %resolution._0, %resolution._1, %resolution._2, false );
+	    }
+	}
+	else
+	{
+		setCanvasTitle(%windowName);
+		Canvas.repaint();
+	}
+    Canvas.UseBackgroundColor = true;
+    Canvas.BackgroundColor = "Black";
+}
+
+//------------------------------------------------------------------------------
+// iOSResolutionFromSetting
+// Helper function that grabs resolution strings based on device type
+//------------------------------------------------------------------------------
+function EditorCore::iOSResolutionFromSetting( %this, %deviceType, %deviceScreenOrientation )
+{
+    // A helper function to get a string based resolution from the settings given.
+    %x = 0;
+    %y = 0;
+
+    %scaleFactor = $pref::iOS::RetinaEnabled ? 2 : 1;
+
+    switch(%deviceType)
+    {
+        case $iOS::constant::iPhone:
+            if(%deviceScreenOrientation == $iOS::constant::Landscape)
+            {
+                %x =  $iOS::constant::iPhoneWidth * %scaleFactor;
+                %y =  $iOS::constant::iPhoneHeight * %scaleFactor;
+            }
+            else
+            {
+                %x =  $iOS::constant::iPhoneHeight * %scaleFactor;
+                %y =  $iOS::constant::iPhoneWidth * %scaleFactor;
+            }
+
+        case $iOS::constant::iPad:
+            if(%deviceScreenOrientation == $iOS::constant::Landscape)
+            {
+                %x =  $iOS::constant::iPadWidth * %scaleFactor;
+                %y =  $iOS::constant::iPadHeight * %scaleFactor;
+            }
+            else
+            {
+                %x =  $iOS::constant::iPadHeight * %scaleFactor;
+                %y =  $iOS::constant::iPadWidth * %scaleFactor;
+            }
+
+        case $iOS::constant::iPhone5:
+            if(%deviceScreenOrientation == $iOS::constant::Landscape)
+            {
+                %x =  $iOS::constant::iPhone5Width;
+                %y =  $iOS::constant::iPhone5Height;
+            }
+            else
+            {
+                %x =  $iOS::constant::iPhone5Height;
+                %y =  $iOS::constant::iPhone5Width;
+            }
+    }
+
+    return %x @ " " @ %y;
+}

+ 51 - 0
editor/EditorCore/scripts/constants.cs

@@ -0,0 +1,51 @@
+//-----------------------------------------------------------------------------
+// Copyright (c) 2013 GarageGames, LLC
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+
+$iOS::constant::iPhone = 0;
+$iOS::constant::iPad = 1;
+$iOS::constant::iPhone5 = 2;
+
+$iOS::constant::Landscape = 0;
+$iOS::constant::Portrait = 1;
+$iOS::constant::ResolutionFull = 0;
+$iOS::constant::ResolutionSmall = 1;
+
+$iOS::constant::iPhoneWidth = 480;
+$iOS::constant::iPhoneHeight = 320;
+
+$iOS::constant::iPhone4Width = 960;
+$iOS::constant::iPhone4Height = 640;
+
+$iOS::constant::iPadWidth = 1024;
+$iOS::constant::iPadHeight = 768;
+
+$iOS::constant::NewiPadWidth = 2048;
+$iOS::constant::NewiPadHeight = 1536;
+
+$iOS::constant::iPhone5Width = 1136;
+$iOS::constant::iPhone5Height = 640;
+
+$iOS::constant::OrientationUnknown = 0;
+$iOS::constant::OrientationLandscapeLeft = 1;
+$iOS::constant::OrientationLandscapeRight = 2;
+$iOS::constant::OrientationPortrait = 3;
+$iOS::constant::OrientationPortraitUpsideDown = 4;

+ 59 - 0
editor/EditorCore/scripts/defaultPreferences.cs

@@ -0,0 +1,59 @@
+//-----------------------------------------------------------------------------
+// Copyright (c) 2013 GarageGames, LLC
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+
+/// Game
+$Game::CompanyName              = "Torque Game Engines";
+$Game::ProductName              = "Torque2D";
+
+/// iOS
+$pref::iOS::ScreenOrientation   = $iOS::constant::Landscape;
+$pref::iOS::ScreenDepth		    = 32;
+$pref::iOS::UseGameKit          = 0;
+$pref::iOS::UseMusic            = 0;
+$pref::iOS::UseMoviePlayer      = 0;
+$pref::iOS::UseAutoRotate       = 1;
+$pref::iOS::EnableOrientationRotation = 1;
+$pref::iOS::EnableOtherOrientationRotation = 1;
+$pref::iOS::StatusBarType       = 0;
+
+/// T2D
+$pref::T2D::ParticlePlayerEmissionRateScale = 1.0;
+$pref::T2D::ParticlePlayerSizeScale = 1.0;
+$pref::T2D::ParticlePlayerForceScale = 1.0;
+$pref::T2D::ParticlePlayerTimeScale = 1.0;
+$pref::T2D::warnFileDeprecated = 1;
+$pref::T2D::warnSceneOccupancy = 1;
+$pref::T2D::imageAssetGlobalFilterMode = Bilinear;
+$pref::T2D::TAMLSchema="";
+$pref::T2D::JSONStrict = 1;
+
+/// Video
+$pref::Video::appliedPref = 0;
+$pref::Video::displayDevice = "OpenGL";
+$pref::Video::preferOpenGL = 1;
+$pref::Video::fullScreen = 0;
+$pref::Video::defaultResolution = "1024 768";
+$pref::Video::windowedRes = "1024 768 32";
+$pref::OpenGL::gammaCorrection = 0.5;
+
+/// Fonts.
+$Gui::fontCacheDirectory = expandPath( "^EditorCore/gui/fonts" );

+ 7 - 1
editor/main.cs

@@ -29,5 +29,11 @@ EditorManager.scanModules( "./" );
 
 
 // Load various editors
 // Load various editors
 EditorManager.LoadExplicit("EditorConsole");
 EditorManager.LoadExplicit("EditorConsole");
-//Editormanager.LoadExplicit("ProjectManager");//Someday...
+//Editormanager.LoadExplicit("ProjectManager");//Someday soon...
 EditorManager.LoadExplicit("AssetAdmin");
 EditorManager.LoadExplicit("AssetAdmin");
+
+if(!isObject(AppCore))
+{
+	EditorCore.open();
+	EditorCore.showProjectSelector();
+}

+ 308 - 140
library/AppCore/gui/guiProfiles.cs

@@ -70,59 +70,81 @@ function SetColorAlpha(%color, %newAlpha)
 	return %red SPC %green SPC %blue SPC mRound(mClamp(%newAlpha, 0, 255));
 	return %red SPC %green SPC %blue SPC mRound(mClamp(%newAlpha, 0, 255));
 }
 }
 
 
+function SafeCreateNamedObject(%name, %object)
+{
+	if(isObject(%name))
+	{
+		%originalObject = nameToID(%name);
+		if(%originalObject.getClassName() !$= %object.getClassName())
+		{
+			warn("Attempted to change the class of the named object " @ %name @ "!");
+			warn("Original Class: " @ %originalObject.getClassName());
+			warn("New Class: " @ %object.getClassName());
+			return;
+		}
+		%originalObject.assignFieldsFrom(%object);
+		%object.delete();
+	}
+	else
+	{
+		%object.setName(%name);
+	}
+}
+
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 
 
-new GuiCursor(DefaultCursor)
+
+SafeCreateNamedObject("DefaultCursor", new GuiCursor()
 {
 {
     hotSpot = "1 1";
     hotSpot = "1 1";
     renderOffset = "0 0";
     renderOffset = "0 0";
     bitmapName = "^AppCore/gui/images/cursors/defaultCursor";
     bitmapName = "^AppCore/gui/images/cursors/defaultCursor";
-};
+});
 
 
-new GuiCursor(LeftRightCursor)
+SafeCreateNamedObject("LeftRightCursor", new GuiCursor()
 {
 {
    hotSpot = "0.5 0";
    hotSpot = "0.5 0";
    renderOffset = "0.5 0";
    renderOffset = "0.5 0";
    bitmapName = "^AppCore/gui/images/cursors/leftRight";
    bitmapName = "^AppCore/gui/images/cursors/leftRight";
-};
+});
 
 
-new GuiCursor(UpDownCursor)
+SafeCreateNamedObject("UpDownCursor", new GuiCursor()
 {
 {
    hotSpot = "1 1";
    hotSpot = "1 1";
    renderOffset = "0 1";
    renderOffset = "0 1";
    bitmapName = "^AppCore/gui/images/cursors/upDown";
    bitmapName = "^AppCore/gui/images/cursors/upDown";
-};
+});
 
 
-new GuiCursor(NWSECursor)
+SafeCreateNamedObject("NWSECursor", new GuiCursor()
 {
 {
    hotSpot = "1 1";
    hotSpot = "1 1";
    renderOffset = "0.5 0.5";
    renderOffset = "0.5 0.5";
    bitmapName = "^AppCore/gui/images/cursors/NWSE";
    bitmapName = "^AppCore/gui/images/cursors/NWSE";
-};
+});
 
 
-new GuiCursor(NESWCursor)
+SafeCreateNamedObject("NESWCursor", new GuiCursor()
 {
 {
    hotSpot = "1 1";
    hotSpot = "1 1";
    renderOffset = "0.5 0.5";
    renderOffset = "0.5 0.5";
    bitmapName = "^AppCore/gui/images/cursors/NESW";
    bitmapName = "^AppCore/gui/images/cursors/NESW";
-};
+});
 
 
-new GuiCursor(MoveCursor)
+SafeCreateNamedObject("MoveCursor", new GuiCursor()
 {
 {
    hotSpot = "1 1";
    hotSpot = "1 1";
    renderOffset = "0.5 0.5";
    renderOffset = "0.5 0.5";
    bitmapName = "^AppCore/gui/images/cursors/move";
    bitmapName = "^AppCore/gui/images/cursors/move";
-};
+});
 
 
-new GuiCursor(EditCursor)
+SafeCreateNamedObject("EditCursor", new GuiCursor()
 {
 {
    hotSpot = "0 0";
    hotSpot = "0 0";
    renderOffset = "0.5 0.5";
    renderOffset = "0.5 0.5";
    bitmapName = "^AppCore/gui/images/cursors/ibeam";
    bitmapName = "^AppCore/gui/images/cursors/ibeam";
-};
+});
 
 
-//The Torque gods will be displeased if you change the default gui profile! Consider making a new child profile instead.
-if (!isObject(GuiDefaultBorderProfile)) new GuiBorderProfile (GuiDefaultBorderProfile)
+//Changing the default gui profile and border profile might cause engine instability! Consider making a new child profile instead.
+SafeCreateNamedObject("GuiDefaultBorderProfile", new GuiBorderProfile()
 {
 {
 	// Default margin
 	// Default margin
 	margin = 0;
 	margin = 0;
@@ -146,9 +168,10 @@ if (!isObject(GuiDefaultBorderProfile)) new GuiBorderProfile (GuiDefaultBorderPr
 	paddingNA = 0;
 	paddingNA = 0;
 	//Default underfill
 	//Default underfill
 	underfill = true;
 	underfill = true;
-};
+});
 
 
-if(!isObject(GuiDefaultProfile)) new GuiControlProfile (GuiDefaultProfile)
+//See the warning above! You should avoid changing this.
+SafeCreateNamedObject("GuiDefaultProfile", new GuiControlProfile()
 {
 {
     // fill color
     // fill color
     fillColor = "0 0 0 0";
     fillColor = "0 0 0 0";
@@ -165,9 +188,9 @@ if(!isObject(GuiDefaultProfile)) new GuiControlProfile (GuiDefaultProfile)
 
 
 	borderDefault = GuiDefaultBorderProfile;
 	borderDefault = GuiDefaultBorderProfile;
 	category = "default";
 	category = "default";
-};
+});
 
 
-if (!isObject(GuiBrightBorderProfile)) new GuiBorderProfile (GuiBrightBorderProfile : GuiDefaultBorderProfile)
+SafeCreateNamedObject("GuiBrightBorderProfile", new GuiBorderProfile()
 {
 {
 	border = 2;
 	border = 2;
 	borderHL = 2;
 	borderHL = 2;
@@ -180,17 +203,24 @@ if (!isObject(GuiBrightBorderProfile)) new GuiBorderProfile (GuiBrightBorderProf
 	borderColorNA = "255 255 255 50";
 	borderColorNA = "255 255 255 50";
 
 
 	underfill = true;
 	underfill = true;
-};
+});
 
 
-if (!isObject(GuiDarkBorderProfile)) new GuiBorderProfile (GuiDarkBorderProfile : GuiBrightBorderProfile)
+SafeCreateNamedObject("GuiDarkBorderProfile", new GuiBorderProfile()
 {
 {
+	border = 2;
+	borderHL = 2;
+	borderSL = 2;
+	borderNA = 2;
+
 	borderColor = "0 0 0 50";
 	borderColor = "0 0 0 50";
 	borderColorHL = "0 0 0 50";
 	borderColorHL = "0 0 0 50";
 	borderColorSL = "0 0 0 50";
 	borderColorSL = "0 0 0 50";
 	borderColorNA = "0 0 0 50";
 	borderColorNA = "0 0 0 50";
-};
 
 
-if(!isObject(GuiPanelProfile)) new GuiControlProfile (GuiPanelProfile : GuiDefaultProfile)
+	underfill = true;
+});
+
+SafeCreateNamedObject("GuiPanelProfile", new GuiControlProfile()
 {
 {
 	fillColor = $color1;
 	fillColor = $color1;
     fillColorHL = AdjustColorValue($color1, 10);
     fillColorHL = AdjustColorValue($color1, 10);
@@ -198,9 +228,9 @@ if(!isObject(GuiPanelProfile)) new GuiControlProfile (GuiPanelProfile : GuiDefau
     fillColorNA = SetColorAlpha($color1, 100);
     fillColorNA = SetColorAlpha($color1, 100);
 	borderDefault = GuiBrightBorderProfile;
 	borderDefault = GuiBrightBorderProfile;
 	category = "defaultPanel";
 	category = "defaultPanel";
-};
+});
 
 
-if (!isObject(GuiListBoxBorderProfile)) new GuiBorderProfile (GuiListBoxBorderProfile : GuiDefaultBorderProfile)
+SafeCreateNamedObject("GuiListBoxBorderProfile", new GuiBorderProfile()
 {
 {
 	margin = 1;
 	margin = 1;
 	marginHL = 1;
 	marginHL = 1;
@@ -211,9 +241,9 @@ if (!isObject(GuiListBoxBorderProfile)) new GuiBorderProfile (GuiListBoxBorderPr
 	paddingHL = 4;
 	paddingHL = 4;
 	paddingSL = 4;
 	paddingSL = 4;
 	paddingNA = 4;
 	paddingNA = 4;
-};
+});
 
 
-if(!isObject(GuiListBoxProfile)) new GuiControlProfile (GuiListBoxProfile : GuiDefaultProfile)
+SafeCreateNamedObject("GuiListBoxProfile", new GuiControlProfile()
 {
 {
     // fill color
     // fill color
     fillColor = $color1;
     fillColor = $color1;
@@ -232,17 +262,17 @@ if(!isObject(GuiListBoxProfile)) new GuiControlProfile (GuiListBoxProfile : GuiD
 	fontColorNA = AdjustColorValue($color3, -30);
 	fontColorNA = AdjustColorValue($color3, -30);
 
 
 	borderDefault = GuiListBoxBorderProfile;
 	borderDefault = GuiListBoxBorderProfile;
-};
+});
 
 
-if(!isObject(GuiWindowBorderProfile)) new GuiBorderProfile (GuiWindowBorderProfile : GuiDefaultBorderProfile)
+SafeCreateNamedObject("GuiWindowBorderProfile", new GuiBorderProfile()
 {
 {
 	padding = 10;
 	padding = 10;
 	paddingHL = 10;
 	paddingHL = 10;
 	paddingSL = 10;
 	paddingSL = 10;
 	paddingNA = 4;
 	paddingNA = 4;
-};
+});
 
 
-if(!isObject(GuiWindowProfile)) new GuiControlProfile (GuiWindowProfile : GuiDefaultProfile)
+SafeCreateNamedObject("GuiWindowProfile", new GuiControlProfile()
 {
 {
    fillColor = AdjustColorValue($color1, 10);
    fillColor = AdjustColorValue($color1, 10);
    fillColorHL = AdjustColorValue($color1, 12);
    fillColorHL = AdjustColorValue($color1, 12);
@@ -254,27 +284,27 @@ if(!isObject(GuiWindowProfile)) new GuiControlProfile (GuiWindowProfile : GuiDef
    fontColorSL = $color5;
    fontColorSL = $color5;
 
 
    borderLeft = GuiWindowBorderProfile;
    borderLeft = GuiWindowBorderProfile;
-};
+});
 
 
-if(!isObject(GuiWindowContentBorderProfile)) new GuiBorderProfile (GuiWindowContentBorderProfile : GuiDefaultBorderProfile)
+SafeCreateNamedObject("GuiWindowContentBorderProfile", new GuiBorderProfile()
 {
 {
 	borderColor = AdjustColorValue($color1, 10);
 	borderColor = AdjustColorValue($color1, 10);
 	borderColorSL = AdjustColorValue($color4, -10);
 	borderColorSL = AdjustColorValue($color4, -10);
 
 
 	border = 3;
 	border = 3;
 	borderSL = 3;
 	borderSL = 3;
-};
+});
 
 
-if(!isObject(GuiWindowContentProfile)) new GuiControlProfile (GuiWindowContentProfile : GuiDefaultProfile)
+SafeCreateNamedObject("GuiWindowContentProfile", new GuiControlProfile()
 {
 {
 	fillColor = AdjustColorValue($color1, -10);
 	fillColor = AdjustColorValue($color1, -10);
 	fillColorSL = AdjustColorValue($color1, -10);
 	fillColorSL = AdjustColorValue($color1, -10);
 
 
 	borderDefault = GuiWindowContentBorderProfile;
 	borderDefault = GuiWindowContentBorderProfile;
 	borderTop = GuiDefaultBorderProfile;
 	borderTop = GuiDefaultBorderProfile;
-};
+});
 
 
-if(!isObject(GuiWindowButtonBorderProfile)) new GuiBorderProfile (GuiWindowButtonBorderProfile : GuiDefaultBorderProfile)
+SafeCreateNamedObject("GuiWindowButtonBorderProfile", new GuiBorderProfile()
 {
 {
 	margin = 1;
 	margin = 1;
 	marginHL = 1;
 	marginHL = 1;
@@ -285,9 +315,9 @@ if(!isObject(GuiWindowButtonBorderProfile)) new GuiBorderProfile (GuiWindowButto
 	paddingHL = 3;
 	paddingHL = 3;
 	paddingSL = 3;
 	paddingSL = 3;
 	paddingNA = 3;
 	paddingNA = 3;
-};
+});
 
 
-if(!isObject(GuiWindowCloseButtonProfile)) new GuiControlProfile (GuiWindowCloseButtonProfile : GuiDefaultProfile)
+SafeCreateNamedObject("GuiWindowCloseButtonProfile", new GuiControlProfile()
 {
 {
    fillColor = SetColorAlpha($color1, 150);
    fillColor = SetColorAlpha($color1, 150);
    fillColorHL = SetColorAlpha($color6, 150);
    fillColorHL = SetColorAlpha($color6, 150);
@@ -300,24 +330,50 @@ if(!isObject(GuiWindowCloseButtonProfile)) new GuiControlProfile (GuiWindowClose
    fontColorNA = SetColorAlpha($color3, 150);
    fontColorNA = SetColorAlpha($color3, 150);
 
 
    borderDefault = GuiWindowButtonBorderProfile;
    borderDefault = GuiWindowButtonBorderProfile;
-};
+});
 
 
-if(!isObject(GuiWindowMinButtonProfile)) new GuiControlProfile (GuiWindowMinButtonProfile : GuiWindowCloseButtonProfile)
+SafeCreateNamedObject("GuiWindowMinButtonProfile", new GuiControlProfile()
 {
 {
+   fillColor = SetColorAlpha($color1, 150);
    fillColorHL = SetColorAlpha($color4, 150);
    fillColorHL = SetColorAlpha($color4, 150);
    fillColorSL = AdjustColorValue($color4, 10);
    fillColorSL = AdjustColorValue($color4, 10);
-};
+   fillColorNA = $color1;
+
+   fontColor = SetColorAlpha($color3, 150);
+   fontColorHL = SetColorAlpha($color3, 170);
+   fontColorSL = $color5;
+   fontColorNA = SetColorAlpha($color3, 150);
+
+   borderDefault = GuiWindowButtonBorderProfile;
+});
+
+SafeCreateNamedObject("GuiWindowMaxButtonProfile", new GuiControlProfile()
+{
+	fillColor = SetColorAlpha($color1, 150);
+    fillColorHL = SetColorAlpha($color4, 150);
+    fillColorSL = AdjustColorValue($color4, 10);
+    fillColorNA = $color1;
+
+    fontColor = SetColorAlpha($color3, 150);
+    fontColorHL = SetColorAlpha($color3, 170);
+    fontColorSL = $color5;
+    fontColorNA = SetColorAlpha($color3, 150);
+
+    borderDefault = GuiWindowButtonBorderProfile;
+});
+
+SafeCreateNamedObject("GuiTransparentProfile", new GuiControlProfile());
+
+SafeCreateNamedObject("GuiGridProfile", new GuiControlProfile());
 
 
-if(!isObject(GuiWindowMaxButtonProfile)) new GuiControlProfile (GuiWindowMaxButtonProfile : GuiWindowMinButtonProfile);
-if(!isObject(GuiTransparentProfile)) new GuiControlProfile (GuiTransparentProfile : GuiDefaultProfile);
-if(!isObject(GuiGridProfile)) new GuiControlProfile (GuiGridProfile : GuiDefaultProfile);
-if(!isObject(GuiChainProfile)) new GuiControlProfile (GuiChainProfile : GuiDefaultProfile);
-if(!isObject(GuiTabBookProfile)) new GuiControlProfile (GuiTabBookProfile : GuiDefaultProfile)
+SafeCreateNamedObject("GuiChainProfile", new GuiControlProfile());
+
+SafeCreateNamedObject("GuiTabBookProfile", new GuiControlProfile()
 {
 {
 	fillColor = SetColorAlpha($color1, 100);
 	fillColor = SetColorAlpha($color1, 100);
 	category = "defaultTabBook";
 	category = "defaultTabBook";
-};
-if(!isObject(GuiTabProfile)) new GuiControlProfile (GuiTabProfile : GuiDefaultProfile)
+});
+SafeCreateNamedObject("GuiTabProfile", new GuiControlProfile()
 {
 {
 	fontColor = "255 255 255 255";
 	fontColor = "255 255 255 255";
     fontColorHL = "232 240 248 255";
     fontColorHL = "232 240 248 255";
@@ -330,20 +386,20 @@ if(!isObject(GuiTabProfile)) new GuiControlProfile (GuiTabProfile : GuiDefaultPr
 	borderDefault = GuiBrightBorderProfile;
 	borderDefault = GuiBrightBorderProfile;
 	align = Center;
 	align = Center;
 	category = "defaultTab";
 	category = "defaultTab";
-};
-if(!isObject(GuiTabPageProfile)) new GuiControlProfile (GuiTabPageProfile : GuiDefaultProfile)
+});
+SafeCreateNamedObject("GuiTabPageProfile", new GuiControlProfile()
 {
 {
 	fillColor = $color1;
 	fillColor = $color1;
 	fillColorHL = AdjustColorValue($color1, 10);
 	fillColorHL = AdjustColorValue($color1, 10);
 	fillColorSL = AdjustColorValue($color1, 15);
 	fillColorSL = AdjustColorValue($color1, 15);
 	fillColorNA = SetColorAlpha($color1, 100);
 	fillColorNA = SetColorAlpha($color1, 100);
 	category = "defaultTabPage";
 	category = "defaultTabPage";
-};
+});
 
 
 
 
-if(!isObject(GuiSpriteProfile)) new GuiControlProfile (GuiSpriteProfile : GuiDefaultProfile);
+SafeCreateNamedObject("GuiSpriteProfile", new GuiControlProfile());
 
 
-if (!isObject(GuiTreeViewProfile)) new GuiControlProfile (GuiTreeViewProfile : GuiDefaultProfile)
+SafeCreateNamedObject("GuiTreeViewProfile", new GuiControlProfile()
 {
 {
 	fontColor = "255 255 255 255";
 	fontColor = "255 255 255 255";
     fontColorHL = "232 240 248 255";
     fontColorHL = "232 240 248 255";
@@ -356,9 +412,9 @@ if (!isObject(GuiTreeViewProfile)) new GuiControlProfile (GuiTreeViewProfile : G
 	bitmap = "./images/treeView";
 	bitmap = "./images/treeView";
 	canKeyFocus = true;
 	canKeyFocus = true;
 	autoSizeHeight = true;
 	autoSizeHeight = true;
-};
+});
 
 
-if (!isObject(GuiSolidBorderProfile)) new GuiBorderProfile (GuiSolidBorderProfile : GuiDefaultBorderProfile)
+SafeCreateNamedObject("GuiSolidBorderProfile", new GuiBorderProfile()
 {
 {
 	border = 1;
 	border = 1;
 
 
@@ -366,9 +422,9 @@ if (!isObject(GuiSolidBorderProfile)) new GuiBorderProfile (GuiSolidBorderProfil
 	paddingHL = 10;
 	paddingHL = 10;
 	paddingSL = 10;
 	paddingSL = 10;
 	paddingNA = 10;
 	paddingNA = 10;
-};
+});
 
 
-if(!isObject(GuiSolidProfile)) new GuiControlProfile (GuiSolidProfile : GuiDefaultProfile)
+SafeCreateNamedObject("GuiSolidProfile", new GuiControlProfile()
 {
 {
 	// fill color
 	// fill color
     fillColor = $color1;
     fillColor = $color1;
@@ -377,17 +433,17 @@ if(!isObject(GuiSolidProfile)) new GuiControlProfile (GuiSolidProfile : GuiDefau
     fillColorNA = SetColorAlpha($color1, 100);
     fillColorNA = SetColorAlpha($color1, 100);
 
 
 	borderDefault = GuiSolidBorderProfile;
 	borderDefault = GuiSolidBorderProfile;
-};
+});
 
 
-if (!isObject(GuiToolTipProfile)) new GuiControlProfile (GuiToolTipProfile : GuiSolidProfile)
+SafeCreateNamedObject("GuiToolTipProfile", new GuiControlProfile()
 {
 {
     fillColor = SetColorAlpha($color1, 220);
     fillColor = SetColorAlpha($color1, 220);
 	fontColor = $color5;
 	fontColor = $color5;
 
 
 	borderDefault = GuiBrightBorderProfile;
 	borderDefault = GuiBrightBorderProfile;
-};
+});
 
 
-if (!isObject(GuiTextProfile)) new GuiControlProfile (GuiTextProfile : GuiDefaultProfile)
+SafeCreateNamedObject("GuiTextProfile", new GuiControlProfile()
 {
 {
     fontColor = $color3;
     fontColor = $color3;
 
 
@@ -397,20 +453,36 @@ if (!isObject(GuiTextProfile)) new GuiControlProfile (GuiTextProfile : GuiDefaul
     returnTab = false;
     returnTab = false;
     numbersOnly = false;
     numbersOnly = false;
     cursorColor = "0 0 0 255";
     cursorColor = "0 0 0 255";
-};
+});
 
 
-if(!isObject(GuiTextArrayProfile)) new GuiControlProfile (GuiTextArrayProfile : GuiTextProfile)
+SafeCreateNamedObject("GuiTextArrayProfile", new GuiControlProfile()
 {
 {
+	fontColor = $color3;
+
+    align = "left";
+    autoSizeWidth = false;
+    autoSizeHeight = false;
+    returnTab = false;
+    numbersOnly = false;
+    cursorColor = "0 0 0 255";
+
    fontColorHL = $color3;
    fontColorHL = $color3;
    fillColorHL = AdjustColorValue($color1, 10);
    fillColorHL = AdjustColorValue($color1, 10);
-};
+});
 
 
-if (!isObject(GuiTextRightProfile)) new GuiControlProfile (GuiTextRightProfile : GuiTextProfile)
+SafeCreateNamedObject("GuiTextRightProfile", new GuiControlProfile()
 {
 {
+	fontColor = $color3;
+
     align = "right";
     align = "right";
-};
+    autoSizeWidth = false;
+    autoSizeHeight = false;
+    returnTab = false;
+    numbersOnly = false;
+    cursorColor = "0 0 0 255";
+});
 
 
-if (!isObject(GuiCheckBoxProfile)) new GuiControlProfile (GuiCheckBoxProfile : GuiDefaultProfile)
+SafeCreateNamedObject("GuiCheckBoxProfile", new GuiControlProfile()
 {
 {
     fillColor = $color3;
     fillColor = $color3;
     fillColorHL = AdjustColorValue($color3, -10);
     fillColorHL = AdjustColorValue($color3, -10);
@@ -427,9 +499,9 @@ if (!isObject(GuiCheckBoxProfile)) new GuiControlProfile (GuiCheckBoxProfile : G
 	borderDefault = "GuiBrightBorderProfile";
 	borderDefault = "GuiBrightBorderProfile";
 	borderRight = "GuiDarkBorderProfile";
 	borderRight = "GuiDarkBorderProfile";
 	borderBottom = "GuiDarkBorderProfile";
 	borderBottom = "GuiDarkBorderProfile";
-};
+});
 
 
-if (!isObject(GuiTextEditProfile)) new GuiControlProfile (GuiTextEditProfile : GuiDefaultProfile)
+SafeCreateNamedObject("GuiTextEditProfile", new GuiControlProfile()
 {
 {
     fillColor = "232 240 248 255";
     fillColor = "232 240 248 255";
     fillColorHL = "242 250 255 255";
     fillColorHL = "242 250 255 255";
@@ -440,22 +512,20 @@ if (!isObject(GuiTextEditProfile)) new GuiControlProfile (GuiTextEditProfile : G
     fontColorNA = "0 0 0 52";
     fontColorNA = "0 0 0 52";
     fontColorSL = "0 0 0 255";
     fontColorSL = "0 0 0 255";
     textOffset = "5 2";
     textOffset = "5 2";
-    autoSizeWidth = false;
-    autoSizeHeight = false;
     tab = false;
     tab = false;
     canKeyFocus = true;
     canKeyFocus = true;
     returnTab = true;
     returnTab = true;
-};
+});
 
 
-if(!isObject(GuiScrollTrackProfile)) new GuiControlProfile (GuiScrollTrackProfile : GuiDefaultProfile)
+SafeCreateNamedObject("GuiScrollTrackProfile", new GuiControlProfile()
 {
 {
 	fillColor = $color1;
 	fillColor = $color1;
     fillColorHL = $color1;
     fillColorHL = $color1;
     fillColorSL = $color1;
     fillColorSL = $color1;
     fillColorNA = $color1;
     fillColorNA = $color1;
-};
+});
 
 
-if (!isObject(GuiScrollBrightBorderProfile)) new GuiBorderProfile (GuiScrollBrightBorderProfile : GuiBrightBorderProfile)
+SafeCreateNamedObject("GuiScrollBrightBorderProfile", new GuiBorderProfile()
 {
 {
 	padding = 3;
 	padding = 3;
 	paddingHL = 2;
 	paddingHL = 2;
@@ -466,17 +536,36 @@ if (!isObject(GuiScrollBrightBorderProfile)) new GuiBorderProfile (GuiScrollBrig
 	borderHL = 2;
 	borderHL = 2;
 	borderSL = 2;
 	borderSL = 2;
 	borderNA = 1;
 	borderNA = 1;
-};
 
 
-if (!isObject(GuiScrollDarkBorderProfile)) new GuiBorderProfile (GuiScrollDarkBorderProfile : GuiScrollBrightBorderProfile)
+	borderColor = "255 255 255 50";
+	borderColorHL = "255 255 255 50";
+	borderColorSL = "255 255 255 50";
+	borderColorNA = "255 255 255 50";
+
+	underfill = true;
+});
+
+SafeCreateNamedObject("GuiScrollDarkBorderProfile", new GuiBorderProfile()
 {
 {
+	padding = 3;
+	paddingHL = 2;
+	paddingSL = 2;
+	paddingNA = 3;
+
+	border = 1;
+	borderHL = 2;
+	borderSL = 2;
+	borderNA = 1;
+
 	borderColor = "0 0 0 20";
 	borderColor = "0 0 0 20";
 	borderColorHL = "0 0 0 20";
 	borderColorHL = "0 0 0 20";
 	borderColorSL = "0 0 0 20";
 	borderColorSL = "0 0 0 20";
 	borderColorNA = "0 0 0 20";
 	borderColorNA = "0 0 0 20";
-};
 
 
-if(!isObject(GuiScrollThumbProfile)) new GuiControlProfile (GuiScrollThumbProfile : GuiDefaultProfile)
+	underfill = true;
+});
+
+SafeCreateNamedObject("GuiScrollThumbProfile", new GuiControlProfile()
 {
 {
 	fillColor = $color3;
 	fillColor = $color3;
     fillColorHL = AdjustColorValue($color3, 10);
     fillColorHL = AdjustColorValue($color3, 10);
@@ -486,10 +575,15 @@ if(!isObject(GuiScrollThumbProfile)) new GuiControlProfile (GuiScrollThumbProfil
 	borderDefault = GuiScrollBrightBorderProfile;
 	borderDefault = GuiScrollBrightBorderProfile;
 	borderRight = GuiScrollDarkBorderProfile;
 	borderRight = GuiScrollDarkBorderProfile;
 	borderBottom = GuiScrollDarkBorderProfile;
 	borderBottom = GuiScrollDarkBorderProfile;
-};
+});
 
 
-if(!isObject(GuiScrollArrowProfile)) new GuiControlProfile (GuiScrollArrowProfile : GuiScrollThumbProfile)
+SafeCreateNamedObject("GuiScrollArrowProfile", new GuiControlProfile()
 {
 {
+	fillColor = $color3;
+    fillColorHL = AdjustColorValue($color3, 10);
+    fillColorSL = $color4;
+    fillColorNA = SetColorAlpha($color3, 100);
+
 	fontColor = "0 0 0 100";
 	fontColor = "0 0 0 100";
     fontColorHL = "0 0 0 150";
     fontColorHL = "0 0 0 150";
     fontColorSL = $color5;
     fontColorSL = $color5;
@@ -498,20 +592,22 @@ if(!isObject(GuiScrollArrowProfile)) new GuiControlProfile (GuiScrollArrowProfil
 	borderDefault = GuiScrollBrightBorderProfile;
 	borderDefault = GuiScrollBrightBorderProfile;
 	borderRight = GuiScrollDarkBorderProfile;
 	borderRight = GuiScrollDarkBorderProfile;
 	borderBottom = GuiScrollDarkBorderProfile;
 	borderBottom = GuiScrollDarkBorderProfile;
-};
+});
 
 
-if(!isObject(GuiScrollProfile)) new GuiControlProfile (GuiScrollProfile)
+SafeCreateNamedObject("GuiScrollProfile", new GuiControlProfile()
 {
 {
     fillColor = $color2;
     fillColor = $color2;
     borderDefault = GuiDefaultBorderProfile;
     borderDefault = GuiDefaultBorderProfile;
-};
+});
 
 
-if(!isObject(GuiTransparentScrollProfile)) new GuiControlProfile (GuiTransparentScrollProfile : GuiScrollProfile)
+SafeCreateNamedObject("GuiTransparentScrollProfile", new GuiControlProfile()
 {
 {
    fillColor = "255 255 255 0";
    fillColor = "255 255 255 0";
-};
+   fillColor = $color2;
+   borderDefault = GuiDefaultBorderProfile;
+});
 
 
-if (!isObject(GuiDarkButtonBorderProfile)) new GuiBorderProfile (GuiDarkButtonBorderProfile : GuiDarkBorderProfile)
+SafeCreateNamedObject("GuiDarkButtonBorderProfile", new GuiBorderProfile()
 {
 {
 	padding = 4;
 	padding = 4;
 	paddingHL = 4;
 	paddingHL = 4;
@@ -522,9 +618,16 @@ if (!isObject(GuiDarkButtonBorderProfile)) new GuiBorderProfile (GuiDarkButtonBo
 	borderHL = 3;
 	borderHL = 3;
 	borderSL = 3;
 	borderSL = 3;
 	borderNA = 3;
 	borderNA = 3;
-};
 
 
-if (!isObject(GuiBrightButtonBorderProfile)) new GuiBorderProfile (GuiBrightButtonBorderProfile : GuiBrightBorderProfile)
+	borderColor = "0 0 0 50";
+	borderColorHL = "0 0 0 50";
+	borderColorSL = "0 0 0 50";
+	borderColorNA = "0 0 0 50";
+
+	underfill = true;
+});
+
+SafeCreateNamedObject("GuiBrightButtonBorderProfile", new GuiBorderProfile()
 {
 {
 	padding = 4;
 	padding = 4;
 	paddingHL = 4;
 	paddingHL = 4;
@@ -535,9 +638,16 @@ if (!isObject(GuiBrightButtonBorderProfile)) new GuiBorderProfile (GuiBrightButt
 	borderHL = 3;
 	borderHL = 3;
 	borderSL = 3;
 	borderSL = 3;
 	borderNA = 3;
 	borderNA = 3;
-};
 
 
-if (!isObject(GuiButtonProfile)) new GuiControlProfile (GuiButtonProfile : GuiDefaultProfile)
+	borderColor = "255 255 255 50";
+	borderColorHL = "255 255 255 50";
+	borderColorSL = "255 255 255 50";
+	borderColorNA = "255 255 255 50";
+
+	underfill = true;
+});
+
+SafeCreateNamedObject("GuiButtonProfile", new GuiControlProfile()
 {
 {
 	fillColor = $color3;
 	fillColor = $color3;
 	fillColorHL = AdjustColorValue($color3, 10);
 	fillColorHL = AdjustColorValue($color3, 10);
@@ -558,9 +668,9 @@ if (!isObject(GuiButtonProfile)) new GuiControlProfile (GuiButtonProfile : GuiDe
 
 
 	canKeyFocus = true;
 	canKeyFocus = true;
 	tab = true;
 	tab = true;
-};
+});
 
 
-if (!isObject(GuiRadioProfile)) new GuiControlProfile (GuiRadioProfile : GuiDefaultProfile)
+SafeCreateNamedObject("GuiRadioProfile", new GuiControlProfile()
 {
 {
 	fillColor = $color3;
 	fillColor = $color3;
     fillColorHL = AdjustColorValue($color3, -10);
     fillColorHL = AdjustColorValue($color3, -10);
@@ -581,11 +691,15 @@ if (!isObject(GuiRadioProfile)) new GuiControlProfile (GuiRadioProfile : GuiDefa
 
 
 	canKeyFocus = true;
 	canKeyFocus = true;
 	tab = true;
 	tab = true;
-};
+});
 
 
-if (!isObject(GuiHeaderProfile)) new GuiControlProfile (GuiHeaderProfile : GuiSolidProfile)
+SafeCreateNamedObject("GuiHeaderProfile", new GuiControlProfile()
 {
 {
     fillColor = $color2;
     fillColor = $color2;
+    fillColorHL = AdjustColorValue($color1, 10);
+    fillColorSL = AdjustColorValue($color1, 15);
+    fillColorNA = SetColorAlpha($color1, 100);
+
 	fontColor = $color3;
 	fontColor = $color3;
 	fontSize = $platformFontSize + 2;
 	fontSize = $platformFontSize + 2;
 	align = "left";
 	align = "left";
@@ -593,22 +707,22 @@ if (!isObject(GuiHeaderProfile)) new GuiControlProfile (GuiHeaderProfile : GuiSo
 	borderDefault = "GuiBrightBorderProfile";
 	borderDefault = "GuiBrightBorderProfile";
 	borderRight = "GuiDarkBorderProfile";
 	borderRight = "GuiDarkBorderProfile";
 	borderBottom = "GuiDarkBorderProfile";
 	borderBottom = "GuiDarkBorderProfile";
-};
+});
 
 
-if (!isObject(GuiLabelProfile)) new GuiControlProfile (GuiLabelProfile : GuiDefaultProfile)
+SafeCreateNamedObject("GuiLabelProfile", new GuiControlProfile()
 {
 {
 	fontColor = "255 255 255 255";
 	fontColor = "255 255 255 255";
 	fontSize = $platformFontSize;
 	fontSize = $platformFontSize;
 	align = "left";
 	align = "left";
-};
+});
 
 
-if(!isObject(GuiDragAndDropProfile)) new GuiControlProfile (GuiDragAndDropProfile : GuiDefaultProfile)
+SafeCreateNamedObject("GuiDragAndDropProfile", new GuiControlProfile()
 {
 {
    fillColor = SetColorAlpha($color4, 50);
    fillColor = SetColorAlpha($color4, 50);
    fontColor = $color5;
    fontColor = $color5;
-};
+});
 
 
-if (!isObject(GuiProgressBorderProfile)) new GuiBorderProfile (GuiProgressBorderProfile : GuiDefaultBorderProfile)
+SafeCreateNamedObject("GuiProgressBorderProfile", new GuiBorderProfile()
 {
 {
 	padding = 2;
 	padding = 2;
 	paddingHL = 0;
 	paddingHL = 0;
@@ -625,15 +739,28 @@ if (!isObject(GuiProgressBorderProfile)) new GuiBorderProfile (GuiProgressBorder
 	borderColor = AdjustColorValue($color1, -10);
 	borderColor = AdjustColorValue($color1, -10);
 	borderColorHL = "255 255 255 50";
 	borderColorHL = "255 255 255 50";
 	borderColorSL = "255 255 255 50";
 	borderColorSL = "255 255 255 50";
-};
+});
 
 
-if (!isObject(GuiProgressDarkBorderProfile)) new GuiBorderProfile (GuiProgressDarkBorderProfile : GuiProgressBorderProfile)
+SafeCreateNamedObject("GuiProgressDarkBorderProfile", new GuiBorderProfile()
 {
 {
+	padding = 2;
+	paddingHL = 0;
+	paddingSL = 0;
+
+	border = 2;
+	borderHL = 2;
+	borderSL = 2;
+
+	margin = 0;
+	marginHL = 3;
+	marginSL = 3;
+
+	borderColor = AdjustColorValue($color1, -10);
 	borderColorHL = "0 0 0 50";
 	borderColorHL = "0 0 0 50";
 	borderColorSL = "0 0 0 50";
 	borderColorSL = "0 0 0 50";
-};
+});
 
 
-if(!isObject(GuiProgressProfile)) new GuiControlProfile (GuiProgressProfile : GuiDefaultProfile)
+SafeCreateNamedObject("GuiProgressProfile", new GuiControlProfile()
 {
 {
    fillColor = $color1;
    fillColor = $color1;
    fillColorHL = $color4;
    fillColorHL = $color4;
@@ -645,25 +772,49 @@ if(!isObject(GuiProgressProfile)) new GuiControlProfile (GuiProgressProfile : Gu
    borderDefault = GuiProgressBorderProfile;
    borderDefault = GuiProgressBorderProfile;
    borderBottom = GuiProgressDarkBorderProfile;
    borderBottom = GuiProgressDarkBorderProfile;
    borderRight = GuiProgressDarkBorderProfile;
    borderRight = GuiProgressDarkBorderProfile;
-};
+});
 
 
-if (!isObject(GuiDropDownDarkBorderProfile)) new GuiBorderProfile (GuiDropDownDarkBorderProfile : GuiDarkBorderProfile)
+SafeCreateNamedObject("GuiDropDownDarkBorderProfile", new GuiBorderProfile()
 {
 {
 	padding = 4;
 	padding = 4;
 	paddingHL = 4;
 	paddingHL = 4;
 	paddingSL = 4;
 	paddingSL = 4;
 	paddingNA = 4;
 	paddingNA = 4;
-};
 
 
-if (!isObject(GuiDropDownBrightBorderProfile)) new GuiBorderProfile (GuiDropDownBrightBorderProfile : GuiBrightBorderProfile)
+	border = 2;
+	borderHL = 2;
+	borderSL = 2;
+	borderNA = 2;
+
+	borderColor = "0 0 0 50";
+	borderColorHL = "0 0 0 50";
+	borderColorSL = "0 0 0 50";
+	borderColorNA = "0 0 0 50";
+
+	underfill = true;
+});
+
+SafeCreateNamedObject("GuiDropDownBrightBorderProfile", new GuiBorderProfile()
 {
 {
 	padding = 4;
 	padding = 4;
 	paddingHL = 4;
 	paddingHL = 4;
 	paddingSL = 4;
 	paddingSL = 4;
 	paddingNA = 4;
 	paddingNA = 4;
-};
 
 
-if(!isObject(GuiDropDownProfile)) new GuiControlProfile (GuiDropDownProfile : GuiDefaultProfile)
+	border = 2;
+	borderHL = 2;
+	borderSL = 2;
+	borderNA = 2;
+
+	borderColor = "255 255 255 50";
+	borderColorHL = "255 255 255 50";
+	borderColorSL = "255 255 255 50";
+	borderColorNA = "255 255 255 50";
+
+	underfill = true;
+});
+
+SafeCreateNamedObject("GuiDropDownProfile", new GuiControlProfile()
 {
 {
     // fill color
     // fill color
     fillColor = AdjustColorValue($color3, -15);
     fillColor = AdjustColorValue($color3, -15);
@@ -684,22 +835,22 @@ if(!isObject(GuiDropDownProfile)) new GuiControlProfile (GuiDropDownProfile : Gu
 	borderRight = GuiDropDownDarkBorderProfile;
 	borderRight = GuiDropDownDarkBorderProfile;
 	borderBottom = GuiDropDownDarkBorderProfile;
 	borderBottom = GuiDropDownDarkBorderProfile;
 	category = "dropDown";
 	category = "dropDown";
-};
+});
 
 
-if (!isObject(GuiMenuBarBorderProfile)) new GuiBorderProfile (GuiMenuBarBorderProfile : GuiDefaultBorderProfile)
+SafeCreateNamedObject("GuiMenuBarBorderProfile", new GuiBorderProfile()
 {
 {
 	padding = 2;
 	padding = 2;
-};
+});
 
 
-if(!isObject(GuiMenuBarProfile)) new GuiControlProfile (GuiMenuBarProfile : GuiDefaultProfile)
+SafeCreateNamedObject("GuiMenuBarProfile", new GuiControlProfile()
 {
 {
 	fillColor = AdjustColorValue($color1, -7);
 	fillColor = AdjustColorValue($color1, -7);
 	canKeyFocus = true;
 	canKeyFocus = true;
 	borderDefault = GuiMenuBarBorderProfile;
 	borderDefault = GuiMenuBarBorderProfile;
 	category = "defaultMenuBar";
 	category = "defaultMenuBar";
-};
+});
 
 
-if (!isObject(GuiMenuBorderProfile)) new GuiBorderProfile (GuiMenuBorderProfile : GuiDefaultBorderProfile)
+SafeCreateNamedObject("GuiMenuBorderProfile", new GuiBorderProfile()
 {
 {
 	margin = 2;
 	margin = 2;
 	marginHL = 0;
 	marginHL = 0;
@@ -713,16 +864,21 @@ if (!isObject(GuiMenuBorderProfile)) new GuiBorderProfile (GuiMenuBorderProfile
 
 
 	borderColorHL = "255 255 255 30";
 	borderColorHL = "255 255 255 30";
 	borderColorSL = $color4;
 	borderColorSL = $color4;
-};
+});
 
 
-if (!isObject(GuiMenuBottomBorderProfile)) new GuiBorderProfile (GuiMenuBottomBorderProfile : GuiMenuBorderProfile)
+SafeCreateNamedObject("GuiMenuBottomBorderProfile", new GuiBorderProfile()
 {
 {
+	fillColor = AdjustColorValue($color1, -7);
+	canKeyFocus = true;
+	borderDefault = GuiMenuBarBorderProfile;
+	category = "defaultMenuBar";
+
 	paddingSL = 2;
 	paddingSL = 2;
 	marginSL = 0;
 	marginSL = 0;
 	borderSL = 0;
 	borderSL = 0;
-};
+});
 
 
-if (!isObject(GuiMenuSideBorderProfile)) new GuiBorderProfile (GuiMenuSideBorderProfile : GuiDefaultBorderProfile)
+SafeCreateNamedObject("GuiMenuSideBorderProfile", new GuiBorderProfile()
 {
 {
 	border = 0;
 	border = 0;
 	borderHL = 2;
 	borderHL = 2;
@@ -736,9 +892,9 @@ if (!isObject(GuiMenuSideBorderProfile)) new GuiBorderProfile (GuiMenuSideBorder
 
 
 	borderColorHL = "255 255 255 30";
 	borderColorHL = "255 255 255 30";
 	borderColorSL = $color4;
 	borderColorSL = $color4;
-};
+});
 
 
-if(!isObject(GuiMenuProfile)) new GuiControlProfile (GuiMenuProfile : GuiDefaultProfile)
+SafeCreateNamedObject("GuiMenuProfile", new GuiControlProfile()
 {
 {
 	fillColor = "0 0 0 0";
 	fillColor = "0 0 0 0";
 	fillColorHL = "255 255 255 10";
 	fillColorHL = "255 255 255 10";
@@ -755,32 +911,32 @@ if(!isObject(GuiMenuProfile)) new GuiControlProfile (GuiMenuProfile : GuiDefault
 	fontColorHL = AdjustColorValue($color3, 10);
 	fontColorHL = AdjustColorValue($color3, 10);
 	fontColorSL = $color3;
 	fontColorSL = $color3;
 	fontColorNA = SetColorAlpha($color3, 100);
 	fontColorNA = SetColorAlpha($color3, 100);
-};
+});
 
 
-if (!isObject(GuiMenuContentVertBorderProfile)) new GuiBorderProfile (GuiMenuContentVertBorderProfile : GuiDefaultBorderProfile)
+SafeCreateNamedObject("GuiMenuContentVertBorderProfile", new GuiBorderProfile()
 {
 {
 	border = 2;
 	border = 2;
 	padding = 4;
 	padding = 4;
 	borderColor = $color4;
 	borderColor = $color4;
-};
+});
 
 
-if (!isObject(GuiMenuContentSideBorderProfile)) new GuiBorderProfile (GuiMenuContentSideBorderProfile : GuiDefaultBorderProfile)
+SafeCreateNamedObject("GuiMenuContentSideBorderProfile", new GuiBorderProfile()
 {
 {
 	border = 2;
 	border = 2;
 	padding = 0;
 	padding = 0;
 	borderColor = $color4;
 	borderColor = $color4;
-};
+});
 
 
-if(!isObject(GuiMenuContentProfile)) new GuiControlProfile (GuiMenuContentProfile : GuiDefaultBorderProfile)
+SafeCreateNamedObject("GuiMenuContentProfile", new GuiControlProfile()
 {
 {
 	fillColor = AdjustColorValue($color1, -5);
 	fillColor = AdjustColorValue($color1, -5);
 
 
 	borderDefault = GuiMenuContentSideBorderProfile;
 	borderDefault = GuiMenuContentSideBorderProfile;
 	borderTop = GuiMenuContentVertBorderProfile;
 	borderTop = GuiMenuContentVertBorderProfile;
 	borderBottom = GuiMenuContentVertBorderProfile;
 	borderBottom = GuiMenuContentVertBorderProfile;
-};
+});
 
 
-if (!isObject(GuiMenuItemBorderTopProfile)) new GuiBorderProfile (GuiMenuItemBorderTopProfile : GuiDefaultBorderProfile)
+SafeCreateNamedObject("GuiMenuItemBorderTopProfile", new GuiBorderProfile()
 {
 {
 	padding = 6;
 	padding = 6;
 	paddingHL = 6;
 	paddingHL = 6;
@@ -790,21 +946,33 @@ if (!isObject(GuiMenuItemBorderTopProfile)) new GuiBorderProfile (GuiMenuItemBor
 	marginSL = 4;
 	marginSL = 4;
 	borderSL = 1;
 	borderSL = 1;
 	borderColorSL = "0 0 0 50";
 	borderColorSL = "0 0 0 50";
-};
+});
 
 
-if (!isObject(GuiMenuItemBorderBottomProfile)) new GuiBorderProfile (GuiMenuItemBorderBottomProfile : GuiMenuItemBorderTopProfile)
+SafeCreateNamedObject("GuiMenuItemBorderBottomProfile", new GuiBorderProfile()
 {
 {
+	padding = 6;
+	paddingHL = 6;
+	paddingSL = 0;
+	paddingNA = 6;
+
+	marginSL = 4;
+	borderSL = 1;
 	borderColorSL = "255 255 255 50";
 	borderColorSL = "255 255 255 50";
-};
+});
 
 
-if (!isObject(GuiMenuItemBorderSideProfile)) new GuiBorderProfile (GuiMenuItemBorderSideProfile : GuiMenuItemBorderTopProfile)
+SafeCreateNamedObject("GuiMenuItemBorderSideProfile", new GuiBorderProfile()
 {
 {
+	padding = 6;
+	paddingHL = 6;
+	paddingSL = 0;
+	paddingNA = 6;
+
 	marginSL = 0;
 	marginSL = 0;
 	borderSL = 0;
 	borderSL = 0;
 	paddingSL = 6;
 	paddingSL = 6;
-};
+});
 
 
-if(!isObject(GuiMenuItemProfile)) new GuiControlProfile (GuiMenuItemProfile : GuiDefaultProfile)
+SafeCreateNamedObject("GuiMenuItemProfile", new GuiControlProfile()
 {
 {
 	fillColor = AdjustColorValue($color1, -5);
 	fillColor = AdjustColorValue($color1, -5);
 	fillColorHL = AdjustColorValue($color4, -15);
 	fillColorHL = AdjustColorValue($color4, -15);
@@ -818,4 +986,4 @@ if(!isObject(GuiMenuItemProfile)) new GuiControlProfile (GuiMenuItemProfile : Gu
 	borderDefault = GuiMenuItemBorderSideProfile;
 	borderDefault = GuiMenuItemBorderSideProfile;
 	borderTop = GuiMenuItemBorderTopProfile;
 	borderTop = GuiMenuItemBorderTopProfile;
 	borderBottom = GuiMenuItemBorderBottomProfile;
 	borderBottom = GuiMenuItemBorderBottomProfile;
-};
+});

+ 4 - 1
library/AppCore/module.taml

@@ -4,7 +4,10 @@
 	Description="Provides critical initialization and functionality needed for every project."
 	Description="Provides critical initialization and functionality needed for every project."
 	ScriptFile="appCore.cs"
 	ScriptFile="appCore.cs"
 	CreateFunction="create"
 	CreateFunction="create"
-	DestroyFunction="destroy" >
+	DestroyFunction="destroy"
+	Project="New Project"
+	ProjectDescription="Set a course for adventure!"
+	Icon="projectIcon.png" >
 	<DeclaredAssets
 	<DeclaredAssets
 		Path="gui"
 		Path="gui"
 		Extension="asset.taml"
 		Extension="asset.taml"

BIN
library/AppCore/projectIcon.png


+ 1 - 1
library/AppCore/scripts/canvas.cs

@@ -64,7 +64,7 @@ function AppCore::initializeCanvas(%this, %windowName)
 	}
 	}
 	else
 	else
 	{
 	{
-		Canvas.setCanvasTitle(%windowName);
+		setCanvasTitle(%windowName);
 		Canvas.repaint();
 		Canvas.repaint();
 	}
 	}
     Canvas.UseBackgroundColor = true;
     Canvas.UseBackgroundColor = true;

+ 14 - 7
main.cs

@@ -20,6 +20,9 @@
 // IN THE SOFTWARE.
 // IN THE SOFTWARE.
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 
 
+// Set the random seed
+setRandomSeed();
+
 // Set log mode.
 // Set log mode.
 setLogMode(2);
 setLogMode(2);
 
 
@@ -53,11 +56,9 @@ AssetDatabase.EchoInfo = false;
 // This cases assets to stay in memory unless assets are purged.
 // This cases assets to stay in memory unless assets are purged.
 AssetDatabase.IgnoreAutoUnload = true;
 AssetDatabase.IgnoreAutoUnload = true;
 
 
-// Scan modules in your game. This defaults to the toybox for now. You should make an empty game folder, move some modules into it from the library, and change this to scan it.
-ModuleDatabase.scanModules( "./toybox" );
-
-// You'll need to load a starting module for your game. This will likely be the AppCore.
-ModuleDatabase.LoadExplicit( "AppCore" );
+// If you want your game to start directly instead of first starting the Project Manager, you can load it here. This is an example using the toybox.
+//ModuleDatabase.scanModules( "./toybox" );
+//ModuleDatabase.LoadExplicit( "AppCore" );
 
 
 // Starts the editor.
 // Starts the editor.
 exec("./editor/main.cs");
 exec("./editor/main.cs");
@@ -67,8 +68,14 @@ exec("./editor/main.cs");
 function onExit()
 function onExit()
 {
 {
     // Unload the AppCore or EditorCore modules.
     // Unload the AppCore or EditorCore modules.
-    EditorManager.unloadGroup( "EditorGroup" );
-    ModuleDatabase.unloadExplicit( "AppCore" );
+	if(isObject(EditorManager))
+	{
+	    EditorManager.unloadGroup( "EditorGroup" );
+	}
+	if(isObject(AppCore))
+	{
+    	ModuleDatabase.unloadExplicit( "AppCore" );
+	}
 }
 }
 
 
 function androidBackButton(%val)
 function androidBackButton(%val)

+ 4 - 1
toybox/AppCore/1/module.taml

@@ -4,4 +4,7 @@
 	Description="Barebones startup module"
 	Description="Barebones startup module"
 	ScriptFile="main.cs"
 	ScriptFile="main.cs"
 	CreateFunction="create"
 	CreateFunction="create"
-	DestroyFunction="destroy" />
+	DestroyFunction="destroy"
+	Project="Toy Box"
+	ProjectDescription="A collection of simple programs to demonstrate different features of Torque2D."
+	Icon="projectIcon.png" />

BIN
toybox/AppCore/1/projectIcon.png


+ 1 - 1
toybox/AppCore/1/scripts/canvas.cs

@@ -64,7 +64,7 @@ function initializeCanvas(%windowName)
 	}
 	}
 	else
 	else
 	{
 	{
-		Canvas.setCanvasTitle(%windowName);
+		setCanvasTitle(%windowName);
 		Canvas.repaint();
 		Canvas.repaint();
 	}
 	}
 }
 }

File diff suppressed because it is too large
+ 326 - 175
toybox/Sandbox/1/gui/guiProfiles.cs


Some files were not shown because too many files changed in this diff