Browse Source

Merge pull request #28 from TorqueGameEngines/development

T2D 4.0 EA 1
Peter Robinson 4 years ago
parent
commit
be8ca31307
100 changed files with 7242 additions and 18 deletions
  1. 1 0
      .gitignore
  2. 24 18
      README.md
  3. 224 0
      editor/AssetAdmin/AssetAdmin.cs
  4. 40 0
      editor/AssetAdmin/AssetAudioPlayButton.cs
  5. 151 0
      editor/AssetAdmin/AssetDictionary.cs
  6. 210 0
      editor/AssetAdmin/AssetDictionaryButton.cs
  7. 486 0
      editor/AssetAdmin/AssetInspector.cs
  8. 280 0
      editor/AssetAdmin/AssetWindow.cs
  9. 105 0
      editor/AssetAdmin/DeleteAssetDialog.cs
  10. 234 0
      editor/AssetAdmin/NewAnimationAssetDialog.cs
  11. 91 0
      editor/AssetAdmin/NewAssetButton.cs
  12. 180 0
      editor/AssetAdmin/NewAudioAssetDialog.cs
  13. 180 0
      editor/AssetAdmin/NewFontAssetDialog.cs
  14. 187 0
      editor/AssetAdmin/NewImageAssetDialog.cs
  15. 279 0
      editor/AssetAdmin/NewParticleAssetDialog.cs
  16. 296 0
      editor/AssetAdmin/ParticleEditor/AssetParticleGraphTool.cs
  17. 272 0
      editor/AssetAdmin/ParticleEditor/AssetParticleGraphUnit.cs
  18. 174 0
      editor/AssetAdmin/ParticleEditor/NewParticleEmitterDialog.cs
  19. 139 0
      editor/AssetAdmin/ParticleEditor/ParticleGraphCameraController.cs
  20. 4 0
      editor/AssetAdmin/ParticleEditor/exec.cs
  21. 8 0
      editor/AssetAdmin/images/assetIcons.asset.taml
  22. BIN
      editor/AssetAdmin/images/assetIcons.png
  23. 13 0
      editor/AssetAdmin/module.taml
  24. 106 0
      editor/EditorConsole/EditorConsole.cs
  25. 8 0
      editor/EditorConsole/module.taml
  26. 38 0
      editor/EditorCore/EditorButtonBar.cs
  27. 235 0
      editor/EditorCore/EditorCore.cs
  28. 71 0
      editor/EditorCore/EditorDialog.cs
  29. 184 0
      editor/EditorCore/EditorForm.cs
  30. 73 0
      editor/EditorCore/EditorIconButton.cs
  31. 1724 0
      editor/EditorCore/Themes/BaseTheme/BaseTheme.cs
  32. BIN
      editor/EditorCore/Themes/BaseTheme/fonts/black ops one 12 (ansi).uft
  33. BIN
      editor/EditorCore/Themes/BaseTheme/fonts/black ops one 14 (ansi).uft
  34. BIN
      editor/EditorCore/Themes/BaseTheme/fonts/black ops one 16 (ansi).uft
  35. BIN
      editor/EditorCore/Themes/BaseTheme/fonts/black ops one 18 (ansi).uft
  36. BIN
      editor/EditorCore/Themes/BaseTheme/fonts/black ops one 19 (ansi).uft
  37. BIN
      editor/EditorCore/Themes/BaseTheme/fonts/black ops one 20 (ansi).uft
  38. BIN
      editor/EditorCore/Themes/BaseTheme/fonts/black ops one 24 (ansi).uft
  39. BIN
      editor/EditorCore/Themes/BaseTheme/fonts/fira code semibold 12 (ansi).uft
  40. BIN
      editor/EditorCore/Themes/BaseTheme/fonts/fira code semibold 14 (ansi).uft
  41. BIN
      editor/EditorCore/Themes/BaseTheme/fonts/fira code semibold 16 (ansi).uft
  42. BIN
      editor/EditorCore/Themes/BaseTheme/fonts/fira code semibold 18 (ansi).uft
  43. BIN
      editor/EditorCore/Themes/BaseTheme/fonts/fira code semibold 20 (ansi).uft
  44. BIN
      editor/EditorCore/Themes/BaseTheme/fonts/fira code semibold 22 (ansi).uft
  45. BIN
      editor/EditorCore/Themes/BaseTheme/fonts/fira code semibold 24 (ansi).uft
  46. BIN
      editor/EditorCore/Themes/BaseTheme/fonts/raleway 12 (ansi).uft
  47. BIN
      editor/EditorCore/Themes/BaseTheme/fonts/raleway 14 (ansi).uft
  48. BIN
      editor/EditorCore/Themes/BaseTheme/fonts/raleway 16 (ansi).uft
  49. BIN
      editor/EditorCore/Themes/BaseTheme/fonts/raleway 18 (ansi).uft
  50. BIN
      editor/EditorCore/Themes/BaseTheme/fonts/raleway 20 (ansi).uft
  51. BIN
      editor/EditorCore/Themes/BaseTheme/fonts/raleway 24 (ansi).uft
  52. 19 0
      editor/EditorCore/Themes/ForestRobe/ForestRobeTheme.cs
  53. BIN
      editor/EditorCore/Themes/ForestRobe/fonts/cinzel decorative bold 12 (ansi).uft
  54. BIN
      editor/EditorCore/Themes/ForestRobe/fonts/cinzel decorative bold 14 (ansi).uft
  55. BIN
      editor/EditorCore/Themes/ForestRobe/fonts/cinzel decorative bold 16 (ansi).uft
  56. BIN
      editor/EditorCore/Themes/ForestRobe/fonts/cinzel decorative bold 18 (ansi).uft
  57. BIN
      editor/EditorCore/Themes/ForestRobe/fonts/cinzel decorative bold 19 (ansi).uft
  58. BIN
      editor/EditorCore/Themes/ForestRobe/fonts/cinzel decorative bold 20 (ansi).uft
  59. BIN
      editor/EditorCore/Themes/ForestRobe/fonts/cinzel decorative bold 24 (ansi).uft
  60. BIN
      editor/EditorCore/Themes/ForestRobe/fonts/fira code semibold 12 (ansi).uft
  61. BIN
      editor/EditorCore/Themes/ForestRobe/fonts/fira code semibold 14 (ansi).uft
  62. BIN
      editor/EditorCore/Themes/ForestRobe/fonts/fira code semibold 16 (ansi).uft
  63. BIN
      editor/EditorCore/Themes/ForestRobe/fonts/fira code semibold 18 (ansi).uft
  64. BIN
      editor/EditorCore/Themes/ForestRobe/fonts/fira code semibold 20 (ansi).uft
  65. BIN
      editor/EditorCore/Themes/ForestRobe/fonts/fira code semibold 22 (ansi).uft
  66. BIN
      editor/EditorCore/Themes/ForestRobe/fonts/fira code semibold 24 (ansi).uft
  67. BIN
      editor/EditorCore/Themes/ForestRobe/fonts/raleway 12 (ansi).uft
  68. BIN
      editor/EditorCore/Themes/ForestRobe/fonts/raleway 14 (ansi).uft
  69. BIN
      editor/EditorCore/Themes/ForestRobe/fonts/raleway 16 (ansi).uft
  70. BIN
      editor/EditorCore/Themes/ForestRobe/fonts/raleway 18 (ansi).uft
  71. BIN
      editor/EditorCore/Themes/ForestRobe/fonts/raleway 20 (ansi).uft
  72. BIN
      editor/EditorCore/Themes/ForestRobe/fonts/raleway 24 (ansi).uft
  73. 163 0
      editor/EditorCore/Themes/LabCoat/LabCoatTheme.cs
  74. BIN
      editor/EditorCore/Themes/LabCoat/fonts/roboto 12 (ansi).uft
  75. BIN
      editor/EditorCore/Themes/LabCoat/fonts/roboto 14 (ansi).uft
  76. BIN
      editor/EditorCore/Themes/LabCoat/fonts/roboto 16 (ansi).uft
  77. BIN
      editor/EditorCore/Themes/LabCoat/fonts/roboto 18 (ansi).uft
  78. BIN
      editor/EditorCore/Themes/LabCoat/fonts/roboto 20 (ansi).uft
  79. BIN
      editor/EditorCore/Themes/LabCoat/fonts/roboto 24 (ansi).uft
  80. BIN
      editor/EditorCore/Themes/LabCoat/fonts/share tech mono 12 (ansi).uft
  81. BIN
      editor/EditorCore/Themes/LabCoat/fonts/share tech mono 14 (ansi).uft
  82. BIN
      editor/EditorCore/Themes/LabCoat/fonts/share tech mono 16 (ansi).uft
  83. BIN
      editor/EditorCore/Themes/LabCoat/fonts/share tech mono 18 (ansi).uft
  84. BIN
      editor/EditorCore/Themes/LabCoat/fonts/share tech mono 20 (ansi).uft
  85. BIN
      editor/EditorCore/Themes/LabCoat/fonts/share tech mono 22 (ansi).uft
  86. BIN
      editor/EditorCore/Themes/LabCoat/fonts/share tech mono 24 (ansi).uft
  87. BIN
      editor/EditorCore/Themes/LabCoat/fonts/zen dots 12 (ansi).uft
  88. BIN
      editor/EditorCore/Themes/LabCoat/fonts/zen dots 14 (ansi).uft
  89. BIN
      editor/EditorCore/Themes/LabCoat/fonts/zen dots 16 (ansi).uft
  90. BIN
      editor/EditorCore/Themes/LabCoat/fonts/zen dots 18 (ansi).uft
  91. BIN
      editor/EditorCore/Themes/LabCoat/fonts/zen dots 19 (ansi).uft
  92. BIN
      editor/EditorCore/Themes/LabCoat/fonts/zen dots 20 (ansi).uft
  93. BIN
      editor/EditorCore/Themes/LabCoat/fonts/zen dots 24 (ansi).uft
  94. 189 0
      editor/EditorCore/Themes/LabCoat/images/banner1.asset.taml
  95. BIN
      editor/EditorCore/Themes/LabCoat/images/banner1.png
  96. 163 0
      editor/EditorCore/Themes/ThemeManager.cs
  97. 691 0
      editor/EditorCore/Themes/TorqueSuit/TorqueSuitTheme.cs
  98. BIN
      editor/EditorCore/Themes/TorqueSuit/fonts/Audiowide 12 (ansi).uft
  99. BIN
      editor/EditorCore/Themes/TorqueSuit/fonts/Audiowide 14 (ansi).uft
  100. BIN
      editor/EditorCore/Themes/TorqueSuit/fonts/Audiowide 16 (ansi).uft

+ 1 - 0
.gitignore

@@ -27,6 +27,7 @@ Torque2D_DEBUG.exe
 Torque2DGame.app
 Torque2DGame_Debug.app
 linkmap.txt
+**/.vs/**
 
 # Compiled source #
 ###################

+ 24 - 18
README.md

@@ -1,13 +1,25 @@
-![Torque Logo](modules/Sandbox/1/assets/t2d.png)
-## Torque 2D 3.5
+![Torque Logo](images/banner1.png)
+## Torque2D 4.0 Early Access 1
 
-MIT Licensed Open Source version of Torque 2D from GarageGames. Maintained by the T2D Steering Committee and contributions from the community.
+MIT Licensed Open Source version of Torque2D from GarageGames. Maintained by the Torque Game Engines team and contributions from the community.
 
 Dedicated to 2D game development, Torque 2D is an extremely powerful, flexible, and fast C++ engine which has been used in hundreds of professional games. It is a true cross platform solution providing you access to Windows, OSX, Linux, iOS, Android, and the web - all from one codebase. It includes an OpenGL batched rendering system, Box2D physics, OpenAL audio, skeletal and spritesheet animation, automated asset management, a modular project structure, TAML object persistence, and a C-like scripting language.
 
+### What's New?
+
+Torque2D 4.0: Rocket Edition is currently in progress. The major change with 4.0 is the addition of editors! At this time there is a working Asset Manager that allows a user to create, edit, and remove images, animations, particle effects, bitmap fonts, and audio assets. This represents a major step forward from editing xml files by hand. This is especially useful in the case of particle effects which are nearly impossible to create without an interactive tool. Expect additional refinement of this tool over the coming releases.
+
+The Asset Manager can be reached by opening the console using the console button in the Toybox or by pressing Tilde(~) + Ctrl. You will then notice tabs along that top that include the Asset Manager.
+
+You may also notice that we have several toys such as the Gui Editor Toy and Scene Editor Toy that are in-progress versions of future editors. These toys are not very useful yet, but we plan to develop them into full editors in coming releases.
+
+The Rocket Edition also features a revamped Gui System! Until now it has been a common practice among those seriously using T2D to avoid the Gui System as much as possible. We aim to fix that with the Rocket Edition. Explanation of how to use the updated Gui System can be found in the wiki in the [Gui Guide](https://github.com/TorqueGameEngines/Torque2D/wiki/GUI-Guide).
+
+More features and editors are coming before 4.0 is official done, but new projects should make use of the Early Access version to avoid future conflicts.
+
 ### Branches
 
-Here is an overview of the branches found in the Torque 2D repository:
+Here is an overview of the branches found in the Torque2D repository:
 
 * **master:** this branch contains the current stable release code that can be used in a production environment.
 * **development:** this branch is dedicated to active development. It contains the latest bug fixes, new features, and other updates. All pull requests need to go to the development branch. While we try our best to test all incoming changes, it is possible for mistakes to slip in therefore this branch should always be considered unstable.
@@ -21,7 +33,7 @@ If you do not wish to compile the source code yourself, precompiled binary files
 
 After downloading a copy of the source code, the following project files for each platform are provided for you and can be found in the `engine/compilers` folder.
 
-* **Windows:** Visual Studio 2017 (works with the free Community Edition)
+* **Windows:** Visual Studio 2017 (works with the free Community Edition) and 2019
 * **OSX:** Xcode
 * **Linux:** Make
 * **iOS:** Xcode_iOS
@@ -32,37 +44,31 @@ See the [wiki](https://github.com/TorqueGameEngines/Torque2D/wiki) for available
 
 ### Batteries Included
 
-Running Torque 2D for the first time out of the box will start you off in the Sandbox. The Sandbox is a collection of over 30 simple "toys" (or modules) which demonstrate various features in T2D. The default toy is a side scrolling level with a monster truck. To see a list of the available modules/toys to choose from, click on the `Show Tools` button in the lower right corner of the screen.
+Running Torque2D for the first time out of the box will start you off in the Toybox. The Toybox is a collection of over 30 simple "toys" (or modules) which demonstrate various features in T2D. The default toy is a side scrolling level with a monster truck. To see a list of the available modules/toys to choose from, click on the `Show Tools` button in the lower right corner of the screen.
 
 Naturally all of the script code and assets for each toy are available to you in the modules folder to use as practical examples while learning T2D.
 
-The Sandbox is also an excellent framework for rapidly prototyping your own game ideas - it allows for easy integration of additional modules and provides numerous debugging features, like console access and real-time metrics.
+The Toybox is also an excellent framework for rapidly prototyping your own game ideas - it allows for easy integration of additional modules and provides numerous debugging features, like console access and real-time metrics.
 
 ### Documentation
 
-All documentation for the open source version of Torque 2D can be found on our [Github wiki page](https://github.com/TorqueGameEngines/Torque2D/wiki). It contains many tutorials, detailed technical information on engine systems, a script reference guide automatically generated from the source code, and articles on how to contribute to our open source development.
+All documentation for the Torque2D can be found on our [Github wiki page](https://github.com/TorqueGameEngines/Torque2D/wiki). It contains many tutorials, detailed technical information on engine systems, a script reference guide automatically generated from the source code, and articles on how to contribute to our open source development.
 
 ### Community
 
 Don't go it alone! Join the active Torque community. Ask questions, talk about T2D and general game development topics, learn the latest news, or post a blog promoting your game or showing off additional engine features in your T2D fork.
 
-* [Torque 2D Forums on the Torque 3D Website](https://forums.torque3d.org/viewforum.php?f=31)
+* [Torque 2D Forums on the Torque Game Engines Website](https://torque3d.org/forums/forum/26-general/)
+* [Torque Game Engines on Discord](https://discord.com/invite/qdAZxT4)
 
-You also might be able to find useful information on the less active GarageGames website.
+GarageGames is mostly gone, but their website still contains valuable information for those willing to search.
 
 * [Torque 2D Beginner Forum](http://www.garagegames.com/community/forums/84)
 * [Torque 2D Professional Forum](http://www.garagegames.com/community/forums/85)
 * [GarageGames Community Blogs](http://www.garagegames.com/community/blogs)
 
-### Support
-
-Torque 2D is completely free to use, but like all things, it takes time and energy to maintain and develop. You can support T2D by becoming a sponsor on Patreon. Doing so ensures that T2D will continue receiving the attention it needs to remain competitive.
-
-[Become a Patron](https://www.patreon.com/bePatron?u=15485520)
-
-You can also support development directly by submitting pull requests or joining the steering committee! See the wiki for details.
-
 # License
+
 Copyright (c) 2012 GarageGames, LLC
 
 Permission is hereby granted, free of charge, to any person obtaining a copy

+ 224 - 0
editor/AssetAdmin/AssetAdmin.cs

@@ -0,0 +1,224 @@
+//-----------------------------------------------------------------------------
+// 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 AssetAdmin::create(%this)
+{
+	exec("./AssetDictionary.cs");
+	exec("./AssetWindow.cs");
+	exec("./AssetDictionaryButton.cs");
+	exec("./AssetInspector.cs");
+	exec("./AssetAudioPlayButton.cs");
+	exec("./NewAssetButton.cs");
+	exec("./NewImageAssetDialog.cs");
+	exec("./NewAnimationAssetDialog.cs");
+	exec("./NewParticleAssetDialog.cs");
+	exec("./NewFontAssetDialog.cs");
+	exec("./NewAudioAssetDialog.cs");
+	exec("./DeleteAssetDialog.cs");
+	exec("./ParticleEditor/exec.cs");
+
+	%this.guiPage = EditorCore.RegisterEditor("Asset Manager", %this);
+	%this.guiPage.add(%this.buildAssetWindow());
+	%this.guiPage.add(%this.buildAudioPlayButton());
+	%this.guiPage.add(%this.buildLibrary());
+	%this.guiPage.add(%this.buildInspector());
+
+	EditorCore.FinishRegistration(%this.guiPage);
+
+	%this.isOpen = false;
+}
+
+function AssetAdmin::buildLibrary(%this)
+{
+	%this.libScroller = new GuiScrollCtrl()
+	{
+		HorizSizing="left";
+		VertSizing="height";
+		Position="700 0";
+		Extent="324 768";
+		MinExtent="162 384";
+		hScrollBar="dynamic";
+		vScrollBar="alwaysOn";
+		constantThumbHeight="0";
+		showArrowButtons="1";
+		scrollBarThickness="14";
+	};
+	ThemeManager.setProfile(%this.libScroller, "scrollingPanelProfile");
+	ThemeManager.setProfile(%this.libScroller, "scrollingPanelThumbProfile", ThumbProfile);
+	ThemeManager.setProfile(%this.libScroller, "scrollingPanelTrackProfile", TrackProfile);
+	ThemeManager.setProfile(%this.libScroller, "scrollingPanelArrowProfile", ArrowProfile);
+
+	%this.dictionaryList = new GuiChainCtrl()
+	{
+		HorizSizing="right";
+		VertSizing="bottom";
+		Position="0 0";
+		Extent="310 768";
+		MinExtent="220 200";
+	};
+	ThemeManager.setProfile(%this.dictionaryList, "emptyProfile");
+	%this.libScroller.add(%this.dictionaryList);
+
+	%this.dictionaryList.add(%this.buildDictionary("Images", "ImageAsset"));
+	%this.dictionaryList.add(%this.buildDictionary("Animations", "AnimationAsset"));
+	%this.dictionaryList.add(%this.buildDictionary("Particle Effects", "ParticleAsset"));
+	%this.dictionaryList.add(%this.buildDictionary("Fonts", "FontAsset"));
+	%this.dictionaryList.add(%this.buildDictionary("Audio", "AudioAsset"));
+	//%this.dictionaryList.add(%this.buildDictionary("Spines", "SpineAsset"));
+
+	return %this.libScroller;
+}
+
+function AssetAdmin::buildDictionary(%this, %title, %type)
+{
+	%this.Dictionary[%type] = new GuiPanelCtrl()
+	{
+		Class = AssetDictionary;
+		Text=%title;
+		command="";
+		HorizSizing="right";
+		VertSizing="bottom";
+		Position="0 0";
+		Extent="310 22";
+		MinExtent="80 22";
+		Type = %type;
+	};
+	%this.Dictionary[%type].setExpandEase("EaseInOut", 1000);
+	ThemeManager.setProfile(%this.Dictionary[%type], "panelProfile");
+
+	return %this.Dictionary[%type];
+}
+
+function AssetAdmin::buildInspector(%this)
+{
+	%this.inspector = new GuiControl()
+	{
+		class = "AssetInspector";
+		HorizSizing="width";
+		VertSizing="top";
+		Position="0 444";
+		Extent="700 324";
+		MinExtent="350 222";
+	};
+	ThemeManager.setProfile(%this.inspector, "overlayProfile");
+
+	return %this.inspector;
+}
+
+function AssetAdmin::buildAssetWindow(%this)
+{
+	%this.assetScene = new Scene();
+	%this.assetScene.setScenePause(true);
+
+	%this.assetWindow = new SceneWindow()
+	{
+		class = AssetWindow;
+		profile = ThemeManager.activeTheme.overlayProfile;
+		position = "0 0";
+		extent = "700 444";
+		HorizSizing="width";
+		VertSizing="height";
+		minExtent = "0 0";
+		cameraPosition = "0 0";
+		cameraSize = "175 111";
+		useWindowInputEvents = true;
+		useObjectInputEvents = true;
+		constantThumbHeight = false;
+		scrollBarThickness = 14;
+		 showArrowButtons = false;
+	};
+	ThemeManager.setProfile(%this.assetWindow, "thumbProfile", ThumbProfile);
+	ThemeManager.setProfile(%this.assetWindow, "trackProfile", TrackProfile);
+	ThemeManager.setProfile(%this.assetWindow, "scrollArrowProfile", ArrowProfile);
+
+	%this.assetWindow.setScene(%this.assetScene);
+	%this.assetWindow.setViewLimitOn("-87.5 -55.5 87.5 55.5");
+	%this.assetWindow.setShowScrollBar(true);
+	%this.assetWindow.setMouseWheelScrolls(false);
+
+	return %this.assetWindow;
+}
+
+function AssetAdmin::buildAudioPlayButton(%this)
+{
+	%this.audioPlayButtonContainer = new GuiControl()
+	{
+		position = "0 0";
+		extent = "700 444";
+		HorizSizing="width";
+		VertSizing="height";
+		Visible="0";
+	};
+	ThemeManager.setProfile(%this.audioPlayButtonContainer, "emptyProfile");
+
+	%this.audioPlayButton = new GuiButtonCtrl()
+	{
+		class="AssetAudioPlayButton";
+		HorizSizing="center";
+		VertSizing="center";
+		Extent="100 48";
+		Text = "Play";
+	};
+	ThemeManager.setProfile(%this.audioPlayButton, "buttonProfile");
+	%this.audioPlayButtonContainer.add(%this.audioPlayButton);
+
+	return %this.audioPlayButtonContainer;
+}
+
+function AssetAdmin::destroy(%this)
+{
+
+}
+
+function AssetAdmin::open(%this)
+{
+	%this.Dictionary["ImageAsset"].load();
+	%this.Dictionary["AnimationAsset"].load();
+	%this.Dictionary["ParticleAsset"].load();
+	%this.Dictionary["FontAsset"].load();
+	%this.Dictionary["AudioAsset"].load();
+	//%this.Dictionary["SpineAsset"].load();
+
+	%this.assetScene.setScenePause(false);
+	%this.isOpen = true;
+}
+
+function AssetAdmin::close(%this)
+{
+	%this.Dictionary["ImageAsset"].unload();
+	%this.Dictionary["AnimationAsset"].unload();
+	%this.Dictionary["ParticleAsset"].unload();
+	%this.Dictionary["FontAsset"].unload();
+	%this.Dictionary["AudioAsset"].unload();
+	//%this.Dictionary["SpineAsset"].unload();
+
+	%this.assetScene.setScenePause(true);
+	%this.isOpen = false;
+}
+
+function AssetBase::onRefresh(%this)
+{
+	if(AssetAdmin.isOpen  && isObject(AssetAdmin.chosenButton))
+	{
+		AssetAdmin.chosenButton.onClick();
+	}
+}

+ 40 - 0
editor/AssetAdmin/AssetAudioPlayButton.cs

@@ -0,0 +1,40 @@
+
+function AssetAudioPlayButton::onClick(%this)
+{
+	if(alxIsPlaying(%this.sound))
+	{
+		%this.resetSound();
+	}
+	else
+	{
+		%this.sound = alxPlay(%this.assetID);
+		%this.setText("Stop");
+
+		if(!%this.asset.Looping)
+		{
+			%this.soundSchedule = %this.schedule(100, "testSound");
+		}
+	}
+}
+
+function AssetAudioPlayButton::testSound(%this)
+{
+	if(alxIsPlaying(%this.sound))
+	{
+		%this.soundSchedule = %this.schedule(100, "testSound");
+	}
+	else
+	{
+		%this.setText("Play");
+	}
+}
+
+function AssetAudioPlayButton::resetSound(%this)
+{
+	if(alxIsPlaying(%this.sound))
+	{
+		alxStop(%this.sound);
+		%this.setText("Play");
+		cancel(%this.soundSchedule);
+	}
+}

+ 151 - 0
editor/AssetAdmin/AssetDictionary.cs

@@ -0,0 +1,151 @@
+//-----------------------------------------------------------------------------
+// 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 AssetDictionary::onAdd(%this)
+{
+	%this.newButton = new GuiButtonCtrl()
+	{
+		class = "NewAssetButton";
+		Position = "5 27";
+		Extent = "300 30";
+		Text = "New";
+	};
+	ThemeManager.setProfile(%this.newButton, "buttonProfile");
+	%this.add(%this.newButton);
+
+	%this.grid = new GuiGridCtrl()
+	{
+		Position="0 62";
+		Extent = "310 50";
+		CellSizeX = 60;
+		CellSizeY = 60;
+		CellModeX = variable;
+		CellSpacingX = 4;
+		CellSpacingY = 4;
+		OrderMode = "LRTB";
+	};
+	ThemeManager.setProfile(%this.grid, "emptyProfile");
+	%this.add(%this.grid);
+}
+
+function AssetDictionary::load(%this)
+{
+	%query = new AssetQuery();
+	AssetDatabase.findAllAssets(%query);
+	AssetDatabase.findAssetType(%query, %this.Type, true);
+
+	for(%i = 0; %i < %query.getCount(); %i++)
+	{
+		%assetID = %query.getAsset(%i);
+
+		if(!AssetDatabase.isAssetInternal(%assetID))
+		{
+			%this.addButton(%assetID);
+		}
+	}
+	%query.delete();
+
+	%this.newButton.text = "New" SPC %this.type;
+	%this.newButton.type = %this.type;
+}
+
+function AssetDictionary::addButton(%this, %assetID)
+{
+	%button = new GuiButtonCtrl()
+	{
+		Class = AssetDictionaryButton;
+		HorizSizing="center";
+		VertSizing="center";
+		Extent = "100 100";
+		Tooltip = AssetDatabase.getAssetName(%assetID);
+		Text = "";
+		AssetID = %assetID;
+		Type = %this.Type;
+	};
+	ThemeManager.setProfile(%button, "itemSelectProfile");
+	ThemeManager.setProfile(%button, "tipProfile", "TooltipProfile");
+	%this.grid.add(%button);
+
+	%this.fixSize();
+
+	return %button;
+}
+
+function AssetDictionary::removeButton(%this, %assetID)
+{
+	%button = %this.getButton(%assetID);
+	if(isObject(%button))
+	{
+		%button.delete();
+		%this.fixSize();
+		return true;
+	}
+	return false;
+}
+
+function AssetDictionary::fixSize(%this)
+{
+	if(%this.getExpanded())
+	{
+		%this.setExpanded(false);
+		%this.setExpanded(true);
+	}
+}
+
+function AssetDictionary::getButton(%this, %assetID)
+{
+	for(%i = 0; %i < %this.grid.getCount(); %i++)
+	{
+		%button = %this.grid.getObject(%i);
+		if(%button.AssetID $= %assetID)
+		{
+			return %button;
+		}
+	}
+	return 0;
+}
+
+function AssetDictionary::unload(%this)
+{
+	//Remove all the child gui controls
+	for(%i = %this.grid.getCount() - 1; %i >= 0; %i--)
+	{
+		%obj = %this.grid.getObject(%i);
+		%obj.delete();
+	}
+}
+
+function AssetDictionary::reload(%this)
+{
+	%this.unload();
+	%this.load();
+}
+
+function AssetDictionarySprite::onAnimationEnd(%this, %animationAssetID)
+{
+	%this.schedule(2000, "restartAnimation", %animationAssetID);
+}
+
+function AssetDictionarySprite::restartAnimation(%this, %animationAssetID)
+{
+	%this.setAnimation(%animationAssetID);
+}

+ 210 - 0
editor/AssetAdmin/AssetDictionaryButton.cs

@@ -0,0 +1,210 @@
+//-----------------------------------------------------------------------------
+// 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 AssetDictionaryButton::onAdd(%this)
+{
+	%this.call("load" @ %this.type, %this.assetID);
+}
+
+function AssetDictionaryButton::loadImageAsset(%this, %assetID)
+{
+	%imageAsset = AssetDatabase.acquireAsset(%assetID);
+
+	%texture = %this.buildIcon();
+	%texture.setImage(%assetID);
+
+	%this.ImageAsset = %imageAsset;
+	%this.ImageAssetID = %assetID;
+
+	%this.add(%texture);
+}
+
+function AssetDictionaryButton::loadAnimationAsset(%this, %assetID)
+{
+	%animationAsset = AssetDatabase.acquireAsset(%assetID);
+	%imageAssetID = %animationAsset.getImage();
+	%imageAsset = AssetDatabase.acquireAsset(%imageAssetID);
+
+	%texture = %this.buildIcon();
+	%texture.setAnimation(%assetID);
+
+	%this.ImageAsset = %imageAsset;
+	%this.imageAssetID = %imageAssetID;
+	%this.AnimationAsset = %animationAsset;
+	%this.AnimationAssetID = %assetID;
+
+	%this.add(%texture);
+}
+
+function AssetDictionaryButton::loadParticleAsset(%this, %assetID)
+{
+	%particleAsset = AssetDatabase.acquireAsset(%assetID);
+
+	%texture = %this.buildIcon();
+	%texture.setImage("AssetAdmin:assetIcons");
+	%texture.setImageFrame(0);
+
+	%this.particleAsset = %particleAsset;
+	%this.particleAssetID = %assetID;
+
+	%this.add(%texture);
+}
+
+function AssetDictionaryButton::loadFontAsset(%this, %assetID)
+{
+	%fontAsset = AssetDatabase.acquireAsset(%assetID);
+
+	%texture = %this.buildIcon();
+	%texture.setImage("AssetAdmin:assetIcons");
+	%texture.setImageFrame(1);
+
+	%this.fontAsset = %fontAsset;
+	%this.fontAssetID = %assetID;
+
+	%this.add(%texture);
+}
+
+function AssetDictionaryButton::loadAudioAsset(%this, %assetID)
+{
+	%audioAsset = AssetDatabase.acquireAsset(%assetID);
+
+	%texture = %this.buildIcon();
+	%texture.setImage("AssetAdmin:assetIcons");
+	%texture.setImageFrame(3);
+
+	%this.audioAsset = %audioAsset;
+	%this.audioAssetID = %assetID;
+
+	%this.add(%texture);
+}
+
+function AssetDictionaryButton::loadSpineAsset(%this, %assetID)
+{
+	%spineAsset = AssetDatabase.acquireAsset(%assetID);
+
+	%texture = %this.buildIcon();
+	%texture.setImage("AssetAdmin:assetIcons");
+	%texture.setImageFrame(2);
+
+	%this.spineAsset = %spineAsset;
+	%this.spineAssetID = %assetID;
+
+	%this.add(%texture);
+}
+
+function AssetDictionaryButton::buildIcon(%this)
+{
+	%texture = new GuiSpriteCtrl()
+	{
+		class = "AssetDictionarySprite";
+		HorizSizing="center";
+		VertSizing="center";
+		Extent = "50 50";
+		minExtent = "50 50";
+		Position = "0 0";
+		constrainProportions = "1";
+		fullSize = "1";
+	};
+	ThemeManager.setProfile(%texture, "spriteProfile");
+	return %texture;
+}
+
+function AssetDictionaryButton::onClick(%this)
+{
+	%firstLoad = false;
+	if(AssetAdmin.chosenButton != %this)
+	{
+		if(isObject(AssetAdmin.chosenButton))
+		{
+			ThemeManager.setProfile(AssetAdmin.chosenButton, "itemSelectProfile");
+		}
+		ThemeManager.setProfile(%this, "itemSelectedProfile");
+		%firstLoad = true;
+		AssetAdmin.AssetWindow.resetCamera();
+	}
+
+	AssetAdmin.audioPlayButtonContainer.setVisible(false);
+	AssetAdmin.AssetWindow.setVisible(true);
+
+	if(isObject(%this.AnimationAsset) && %this.AnimationAssetID !$= "")
+	{
+		AssetAdmin.AssetWindow.displayAnimationAsset(%this.imageAsset, %this.AnimationAsset, %this.AnimationAssetID);
+		if(%firstLoad)
+		{
+			AssetAdmin.inspector.loadAnimationAsset(%this.AnimationAsset, %this.AnimationAssetID);
+		}
+	}
+	else if(isObject(%this.ImageAsset) && %this.ImageAssetID !$= "")
+	{
+		AssetAdmin.AssetWindow.displayImageAsset(%this.ImageAsset, %this.ImageAssetID);
+		if(%firstLoad)
+		{
+			AssetAdmin.inspector.loadImageAsset(%this.ImageAsset, %this.ImageAssetID);
+		}
+	}
+	else if(isObject(%this.ParticleAsset) && %this.ParticleAssetID !$= "")
+	{
+		AssetAdmin.AssetWindow.displayParticleAsset(%this.ParticleAsset, %this.ParticleAssetID);
+		if(%firstLoad)
+		{
+			AssetAdmin.inspector.loadParticleAsset(%this.ParticleAsset, %this.ParticleAssetID);
+		}
+	}
+	else if(isObject(%this.FontAsset) && %this.FontAssetID !$= "")
+	{
+		AssetAdmin.AssetWindow.displayFontAsset(%this.FontAsset, %this.FontAssetID);
+		if(%firstLoad)
+		{
+			AssetAdmin.inspector.loadFontAsset(%this.FontAsset, %this.FontAssetID);
+		}
+	}
+	else if(isObject(%this.AudioAsset) && %this.AudioAssetID !$= "")
+	{
+		AssetAdmin.AssetWindow.displayAudioAsset(%this.AudioAsset, %this.AudioAssetID);
+		if(%firstLoad)
+		{
+			AssetAdmin.inspector.loadAudioAsset(%this.AudioAsset, %this.AudioAssetID);
+		}
+	}
+	else if(isObject(%this.SpineAsset) && %this.SpineAssetID !$= "")
+	{
+		AssetAdmin.AssetWindow.displaySpineAsset(%this.SpineAsset, %this.SpineAssetID);
+		if(%firstLoad)
+		{
+			AssetAdmin.inspector.loadSpineAsset(%this.SpineAsset, %this.SpineAssetID);
+		}
+	}
+
+	AssetAdmin.chosenButton = %this;
+}
+
+function AssetDictionaryButton::onRemove(%this)
+{
+	if(isObject(%this.ImageAsset))
+	{
+		AssetDatabase.releaseAsset(%this.ImageAssetID);
+	}
+	if(isObject(%this.AnimationAsset))
+	{
+		AssetDatabase.releaseAsset(%this.AnimationAssetID);
+	}
+}

+ 486 - 0
editor/AssetAdmin/AssetInspector.cs

@@ -0,0 +1,486 @@
+//-----------------------------------------------------------------------------
+// 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 AssetInspector::onAdd(%this)
+{
+	%this.titlebar = new GuiControl()
+	{
+		HorizSizing="width";
+		VertSizing="top";
+		Position="0 0";
+		Extent="700 34";
+		MinExtent="350 34";
+		Text = "";
+	};
+	ThemeManager.setProfile(%this.titlebar, "panelProfile");
+	%this.add(%this.titlebar);
+
+	%this.titleDropDown = new GuiDropDownCtrl()
+	{
+		Position = "5 3";
+		Extent = 320 SPC 26;
+		ConstantThumbHeight = false;
+		ScrollBarThickness = 12;
+		ShowArrowButtons = true;
+		Visible = false;
+	};
+	ThemeManager.setProfile(%this.titleDropDown, "dropDownProfile");
+	ThemeManager.setProfile(%this.titleDropDown, "dropDownItemProfile", "listBoxProfile");
+	ThemeManager.setProfile(%this.titleDropDown, "emptyProfile", "backgroundProfile");
+	ThemeManager.setProfile(%this.titleDropDown, "scrollingPanelProfile", "ScrollProfile");
+	ThemeManager.setProfile(%this.titleDropDown, "scrollingPanelThumbProfile", "ThumbProfile");
+	ThemeManager.setProfile(%this.titleDropDown, "scrollingPanelTrackProfile", "TrackProfile");
+	ThemeManager.setProfile(%this.titleDropDown, "scrollingPanelArrowProfile", "ArrowProfile");
+	%this.titlebar.add(%this.titleDropDown);
+
+	%this.deleteAssetButton = new GuiButtonCtrl()
+	{
+		HorizSizing = "left";
+		Class = "EditorIconButton";
+		Frame = 48;
+		Position = "660 5";
+		Command = %this.getId() @ ".deleteAsset();";
+		Tooltip = "Delete Asset";
+		Visible = false;
+	};
+	ThemeManager.setProfile(%this.deleteAssetButton, "iconButtonProfile");
+	%this.add(%this.deleteAssetButton);
+
+	%this.emitterButtonBar = new GuiChainCtrl()
+	{
+		Class = "EditorButtonBar";
+		Position = "340 5";
+		Extent = "0 24";
+		ChildSpacing = 4;
+		IsVertical = false;
+		Tool = %this;
+		Visible = false;
+	};
+	ThemeManager.setProfile(%this.emitterButtonBar, "emptyProfile");
+	%this.add(%this.emitterButtonBar);
+	%this.emitterButtonBar.addButton("AddEmitter", 25, "Add Emitter", "");
+	%this.emitterButtonBar.addButton("MoveEmitterBackward", 27, "Move Emitter Backward", "getMoveEmitterBackwardEnabled");
+	%this.emitterButtonBar.addButton("MoveEmitterForward", 28, "Move Emitter Forward", "getMoveEmitterForwardEnabled");
+	%this.emitterButtonBar.addButton("RemoveEmitter", 23, "Remove Emitter", "getRemoveEmitterEnabled");
+
+	%this.tabBook = new GuiTabBookCtrl()
+	{
+		Class = AssetInspectorTabBook;
+		HorizSizing = width;
+		VertSizing = height;
+		Position = "0 34";
+		Extent = "700 290";
+		MinExtent="350 290";
+		TabPosition = top;
+		Visible = false;
+	};
+	ThemeManager.setProfile(%this.tabBook, "smallTabBookProfile");
+	ThemeManager.setProfile(%this.tabBook, "smallTabProfile", "TabProfile");
+	%this.add(%this.tabBook);
+
+	//Inspector Tab
+	%this.insPage = %this.createTabPage("Inspector", "");
+	%this.tabBook.add(%this.insPage);
+
+	%this.insScroller = %this.createScroller();
+	%this.insPage.add(%this.insScroller);
+
+	%this.inspector = %this.createInspector();
+	%this.insScroller.add(%this.inspector);
+
+	//Particle Graph Tool
+	%this.scaleGraphPage = %this.createTabPage("Scale Graph", "AssetParticleGraphTool", "");
+
+	//Emitter Graph Tool
+	%this.emitterGraphPage = %this.createTabPage("Emitter Graph", "AssetParticleGraphEmitterTool", "AssetParticleGraphTool");
+}
+
+function AssetInspector::createTabPage(%this, %name, %class, %superClass)
+{
+	%page = new GuiTabPageCtrl()
+	{
+		Class = %class;
+		SuperClass = %superClass;
+		HorizSizing = width;
+		VertSizing = height;
+		Position = "0 0";
+		Extent = "700 290";
+		Text = %name;
+	};
+	ThemeManager.setProfile(%page, "tabPageProfile");
+
+	return %page;
+}
+
+function AssetInspector::createScroller(%this)
+{
+	%scroller = new GuiScrollCtrl()
+	{
+		HorizSizing="width";
+		VertSizing="height";
+		Position="0 0";
+		Extent="700 290";
+		hScrollBar="alwaysOff";
+		vScrollBar="alwaysOn";
+		constantThumbHeight="0";
+		showArrowButtons="1";
+		scrollBarThickness="14";
+	};
+	ThemeManager.setProfile(%scroller, "scrollingPanelProfile");
+	ThemeManager.setProfile(%scroller, "scrollingPanelThumbProfile", "ThumbProfile");
+	ThemeManager.setProfile(%scroller, "scrollingPanelTrackProfile", "TrackProfile");
+	ThemeManager.setProfile(%scroller, "scrollingPanelArrowProfile", "ArrowProfile");
+
+	return %scroller;
+}
+
+function AssetInspector::createInspector(%this)
+{
+	%inspector = new GuiInspector()
+	{
+		HorizSizing="width";
+		VertSizing="height";
+		Position="0 0";
+		Extent="686 290";
+		FieldCellSize="300 40";
+		ControlOffset="10 18";
+		ConstantThumbHeight=false;
+		ScrollBarThickness=12;
+		ShowArrowButtons=true;
+	};
+	ThemeManager.setProfile(%inspector, "emptyProfile");
+	ThemeManager.setProfile(%inspector, "panelProfile", "GroupPanelProfile");
+	ThemeManager.setProfile(%inspector, "emptyProfile", "GroupGridProfile");
+	ThemeManager.setProfile(%inspector, "labelProfile", "LabelProfile");
+	ThemeManager.setProfile(%inspector, "textEditProfile", "textEditProfile");
+	ThemeManager.setProfile(%inspector, "dropDownProfile", "dropDownProfile");
+	ThemeManager.setProfile(%inspector, "dropDownItemProfile", "dropDownItemProfile");
+	ThemeManager.setProfile(%inspector, "emptyProfile", "backgroundProfile");
+	ThemeManager.setProfile(%inspector, "scrollingPanelProfile", "ScrollProfile");
+	ThemeManager.setProfile(%inspector, "scrollingPanelThumbProfile", "ThumbProfile");
+	ThemeManager.setProfile(%inspector, "scrollingPanelTrackProfile", "TrackProfile");
+	ThemeManager.setProfile(%inspector, "scrollingPanelArrowProfile", "ArrowProfile");
+	ThemeManager.setProfile(%inspector, "checkboxProfile", "checkboxProfile");
+	ThemeManager.setProfile(%inspector, "buttonProfile", "buttonProfile");
+	ThemeManager.setProfile(%inspector, "tipProfile", "tooltipProfile");
+
+	return %inspector;
+}
+
+function AssetInspector::hideInspector(%this)
+{
+	%this.titlebar.setText("");
+	%this.titleDropDown.visible = false;
+	%this.tabBook.Visible = false;
+	%this.emitterButtonBar.visible = false;
+	%this.deleteAssetButton.visible = false;
+}
+
+function AssetInspector::resetInspector(%this)
+{
+	%this.titlebar.setText("");
+	%this.titleDropDown.visible = false;
+	%this.tabBook.Visible = true;
+	%this.tabBook.selectPage(0);
+	if(%this.tabBook.isMember(%this.scaleGraphPage))
+	{
+		%this.tabBook.remove(%this.scaleGraphPage);
+	}
+	if(%this.tabBook.isMember(%this.emitterGraphPage))
+	{
+		%this.tabBook.remove(%this.emitterGraphPage);
+	}
+
+	%this.emitterButtonBar.visible = false;
+	%this.deleteAssetButton.visible = true;
+}
+
+function AssetInspector::loadImageAsset(%this, %imageAsset, %assetID)
+{
+	%this.resetInspector();
+	%this.titlebar.setText("Image Asset:" SPC %imageAsset.AssetName);
+
+	%this.inspector.clearHiddenFields();
+	%this.inspector.addHiddenField("hidden");
+	%this.inspector.addHiddenField("locked");
+	%this.inspector.addHiddenField("AssetInternal");
+	%this.inspector.addHiddenField("AssetPrivate");
+	%this.inspector.addHiddenField("ExplicitMode");
+	%this.inspector.inspect(%imageAsset);
+	%this.inspector.openGroupByIndex(0);
+}
+
+function AssetInspector::loadAnimationAsset(%this, %animationAsset, %assetID)
+{
+	%this.resetInspector();
+	%this.titlebar.setText("Animation Asset:" SPC %animationAsset.AssetName);
+
+	%this.inspector.clearHiddenFields();
+	%this.inspector.addHiddenField("hidden");
+	%this.inspector.addHiddenField("locked");
+	%this.inspector.addHiddenField("AssetInternal");
+	%this.inspector.addHiddenField("AssetPrivate");
+	%this.inspector.inspect(%animationAsset);
+	%this.inspector.openGroupByIndex(0);
+}
+
+function AssetInspector::loadParticleAsset(%this, %particleAsset, %assetID)
+{
+	%this.resetInspector();
+	%this.titleDropDown.visible = true;
+
+	%this.refreshParticleTitleDropDown(%particleAsset, 0);
+	%this.titleDropDown.Command = %this.getId() @ ".onChooseParticleAsset(" @ %particleAsset.getId() @ ");";
+
+	%this.onChooseParticleAsset(%particleAsset);
+}
+
+function AssetInspector::refreshParticleTitleDropDown(%this, %particleAsset, %index)
+{
+	%this.titleDropDown.clearItems();
+	%this.titleDropDown.addItem("Particle Asset:" SPC %particleAsset.AssetName);
+	for(%i = 0; %i < %particleAsset.getEmitterCount(); %i++)
+	{
+		%emitter = %particleAsset.getEmitter(%i);
+		%this.titleDropDown.addItem("Emitter:" SPC %emitter.EmitterName);
+		%this.titleDropDown.setItemColor(%i + 1, ThemeManager.activeTheme.color5);
+	}
+	%this.titleDropDown.setCurSel(%index);
+}
+
+function AssetInspector::onChooseParticleAsset(%this, %particleAsset)
+{
+	%index = %this.titleDropDown.getSelectedItem();
+	%this.inspector.clearHiddenFields();
+	%curSel = %this.tabBook.getSelectedPage();
+	if(%index == 0)
+	{
+		%this.inspector.addHiddenField("hidden");
+		%this.inspector.addHiddenField("locked");
+		%this.inspector.addHiddenField("AssetInternal");
+		%this.inspector.addHiddenField("AssetPrivate");
+		%this.inspector.inspect(%particleAsset);
+
+		if(%this.tabBook.isMember(%this.emitterGraphPage))
+		{
+			%this.tabBook.remove(%this.emitterGraphPage);
+		}
+		%this.tabBook.add(%this.scaleGraphPage);
+		%this.scaleGraphPage.inspect(%particleAsset);
+	}
+	else if(%index > 0)
+	{
+		%this.inspector.addHiddenField("hidden");
+		%this.inspector.addHiddenField("locked");
+		%this.inspector.inspect(%particleAsset.getEmitter(%index - 1));
+
+		if(%this.tabBook.isMember(%this.scaleGraphPage))
+		{
+			%this.tabBook.remove(%this.scaleGraphPage);
+		}
+		%this.tabBook.add(%this.emitterGraphPage);
+		%this.emitterGraphPage.inspect(%particleAsset, %index - 1);
+	}
+	%this.tabBook.selectPage(%curSel);
+	%this.inspector.openGroupByIndex(0);
+
+	%this.emitterButtonBar.visible = true;
+	%this.emitterButtonBar.refreshEnabled();
+}
+
+function AssetInspector::loadFontAsset(%this, %fontAsset, %assetID)
+{
+	%this.resetInspector();
+	%this.titlebar.setText("Font Asset:" SPC %fontAsset.AssetName);
+
+	%this.inspector.clearHiddenFields();
+	%this.inspector.addHiddenField("hidden");
+	%this.inspector.addHiddenField("locked");
+	%this.inspector.addHiddenField("AssetInternal");
+	%this.inspector.addHiddenField("AssetPrivate");
+	%this.inspector.inspect(%fontAsset);
+	%this.inspector.openGroupByIndex(0);
+}
+
+function AssetInspector::loadAudioAsset(%this, %audioAsset, %assetID)
+{
+	%this.resetInspector();
+	%this.titlebar.setText("Audio Asset:" SPC %audioAsset.AssetName);
+
+	%this.inspector.clearHiddenFields();
+	%this.inspector.addHiddenField("hidden");
+	%this.inspector.addHiddenField("locked");
+	%this.inspector.addHiddenField("AssetInternal");
+	%this.inspector.addHiddenField("AssetPrivate");
+	%this.inspector.inspect(%audioAsset);
+	%this.inspector.openGroupByIndex(0);
+}
+
+function AssetInspector::loadSpineAsset(%this, %spineAsset, %assetID)
+{
+	%this.resetInspector();
+	%this.titlebar.setText("Spine Asset:" SPC %spineAsset.AssetName);
+
+	%this.inspector.clearHiddenFields();
+	%this.inspector.addHiddenField("hidden");
+	%this.inspector.addHiddenField("locked");
+	%this.inspector.addHiddenField("AssetInternal");
+	%this.inspector.addHiddenField("AssetPrivate");
+	%this.inspector.inspect(%spineAsset);
+	%this.inspector.openGroupByIndex(0);
+}
+
+function AssetInspector::deleteAsset(%this)
+{
+	%asset = %this.inspector.getInspectObject();
+	if(%this.titleDropDown.visible && %this.titleDropDown.getSelectedItem() != 0)
+	{
+		%asset = %asset.getOwner();
+	}
+
+	%width = 700;
+	%height = 230;
+	%dialog = new GuiControl()
+	{
+		class = "DeleteAssetDialog";
+		superclass = "EditorDialog";
+		dialogSize = (%width + 8) SPC (%height + 8);
+		dialogCanClose = true;
+		dialogText = "Delete Asset";
+		doomedAsset = %asset;
+	};
+	%dialog.init(%width, %height);
+
+	Canvas.pushDialog(%dialog);
+}
+
+function AssetInspector::addEmitter(%this)
+{
+	%asset = %this.inspector.getInspectObject();
+	if(%this.titleDropDown.getSelectedItem() != 0)
+	{
+		%asset = %asset.getOwner();
+	}
+
+	%width = 700;
+	%height = 230;
+	%dialog = new GuiControl()
+	{
+		class = "NewParticleEmitterDialog";
+		superclass = "EditorDialog";
+		dialogSize = (%width + 8) SPC (%height + 8);
+		dialogCanClose = true;
+		dialogText = "New Particle Emitter";
+		parentAsset = %asset;
+	};
+	%dialog.init(%width, %height);
+
+	Canvas.pushDialog(%dialog);
+}
+
+function AssetInspector::MoveEmitterForward(%this)
+{
+	%emitter = %this.inspector.getInspectObject();
+	%asset = %emitter.getOwner();
+	%index = %this.titleDropDown.getSelectedItem();
+	%asset.moveEmitter(%index-1, %index);
+
+	%this.refreshParticleTitleDropDown(%asset, %index+1);
+
+	%asset.refreshAsset();
+}
+
+function AssetInspector::MoveEmitterBackward(%this)
+{
+	%emitter = %this.inspector.getInspectObject();
+	%asset = %emitter.getOwner();
+	%index = %this.titleDropDown.getSelectedItem();
+	%asset.moveEmitter(%index-1, %index-2);
+
+	%this.refreshParticleTitleDropDown(%asset, %index-1);
+
+	%asset.refreshAsset();
+}
+
+function AssetInspector::RemoveEmitter(%this)
+{
+	%emitter = %this.inspector.getInspectObject();
+	%asset = %emitter.getOwner();
+	%asset.RemoveEmitter(%emitter, true);
+
+	%index = %this.titleDropDown.getSelectedItem();
+	%this.titleDropDown.deleteItem(%index);
+
+	if(%this.titleDropDown.getItemCount() <= %index)
+	{
+		%index = %this.titleDropDown.getItemCount() - 1;
+	}
+	%this.titleDropDown.setCurSel(%index);
+	%this.inspector.inspect(%asset.getEmitter(%index - 1));
+	%this.emitterGraphPage.inspect(%asset, %index - 1);
+	%this.emitterButtonBar.refreshEnabled();
+
+	%asset.refreshAsset();
+}
+
+function AssetInspector::getMoveEmitterForwardEnabled(%this)
+{
+	if(isObject(%this.titleDropDown) && %this.titleDropDown.getSelectedItem() <= 0)
+	{
+		return false;
+	}
+	if(isObject(%this.inspector))
+	{
+		%asset = %this.inspector.getInspectObject();
+		%emitterID = %this.emitterGraphPage.emitterID;
+
+		return %emitterID != (%asset.getOwner().getEmitterCount() - 1);
+	}
+	return false;
+}
+
+function AssetInspector::getMoveEmitterBackwardEnabled(%this)
+{
+	if(isObject(%this.titleDropDown) && %this.titleDropDown.getSelectedItem() <= 0)
+	{
+		return false;
+	}
+	if(isObject(%this.inspector))
+	{
+		return %this.emitterGraphPage.emitterID != 0;
+	}
+	return false;
+}
+
+function AssetInspector::getRemoveEmitterEnabled(%this)
+{
+	if(isObject(%this.titleDropDown) && %this.titleDropDown.getSelectedItem() <= 0)
+	{
+		return false;
+	}
+	if(isObject(%this.inspector))
+	{
+		%asset = %this.inspector.getInspectObject();
+		return %asset.getOwner().getEmitterCount() > 1;
+	}
+	return false;
+}

+ 280 - 0
editor/AssetAdmin/AssetWindow.cs

@@ -0,0 +1,280 @@
+//-----------------------------------------------------------------------------
+// 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 AssetWindow::onAdd(%this)
+{
+
+}
+
+function AssetWindow::resetCamera(%this)
+{
+	%this.setCameraPosition("0 0");
+	%this.setCameraZoom(1);
+}
+
+function AssetWindow::displayImageAsset(%this, %imageAsset, %assetID)
+{
+	AssetAdmin.AssetScene.clear(true);
+
+	%size = %this.getWorldSize(%imageAsset.getImageSize());
+	%sizeX = getWord(%size, 0);
+	%sizeY = getWord(%size, 1);
+
+	if(!%imageAsset.getExplicitMode() && %imageAsset.getFrameCount() == 1)
+	{
+		new Sprite()
+		{
+			Scene = AssetAdmin.AssetScene;
+			Image = %assetID;
+			size = %size;
+			BlandColor = "1 1 1 1";
+			SceneLayer = 1;
+			Position = "0 0";
+			BodyType = static;
+		};
+	}
+	else if(!%imageAsset.getExplicitMode() && %imageAsset.getFrameCount() > 1)
+	{
+		%cellCountX = %imageAsset.getCellCountX();
+		%cellCountY = %imageAsset.getCellCountY();
+
+		%worldCellWidth = %sizeX / %cellCountX;
+		%worldCellHeight = %sizeY / %cellCountY;
+
+		for(%j = 0; %j < %cellCountY; %j++)
+		{
+			for(%i = 0; %i < %cellCountX; %i++)
+			{
+				%sprite = new Sprite()
+				{
+					Scene = AssetAdmin.AssetScene;
+					Image = %assetID;
+					Frame = (%j * %cellCountX) + %i;
+					size = Vector2Scale(%worldCellWidth SPC %worldCellHeight, 2.8);
+					position = ((%worldCellWidth * %i) + (%worldCellWidth/2) - (%sizeX/2)) SPC ((-%worldCellHeight * %j) - (%worldCellHeight/2) + (%sizeY/2));
+					BlendColor = "1 1 1 0";
+					SceneLayer = 1;
+					BodyType = static;
+				};
+
+				%sprite.growToTime(Vector2Scale(%worldCellWidth SPC %worldCellHeight, 0.94), 225 + (%i * 20));
+				%sprite.fadetoTime("1 1 1 1", 225 + (%i * 20));
+			}
+		}
+	}
+	else if(%imageAsset.getExplicitMode())
+	{
+		for(%i = 0; %i < %imageAsset.getExplicitCellCount(); %i++)
+		{
+			%worldCellWidth = %sizeX * (%imageAsset.getExplicitCellWidth(%i) / %imageAsset.getImageWidth());
+			%worldCellHeight = %sizeY * (%imageAsset.getExplicitCellHeight(%i) / %imageAsset.getImageHeight());
+
+			%offset = %imageAsset.getExplicitCellOffset(%i);
+			%offsetX = getWord(%offset, 0);
+			%offsetY = getWord(%offset, 1);
+
+			%worldCellOffsetX = (%sizeX * (%offsetX / %imageAsset.getImageWidth())) - (%sizeX / 2) + (%worldCellWidth / 2);
+			%worldCellOffsetY = (%sizeY - (%sizeY * (%offsetY / %imageAsset.getImageHeight()))) - (%sizeY / 2) - (%worldCellHeight / 2);
+
+			%sprite = new Sprite()
+			{
+				Scene = AssetAdmin.AssetScene;
+				Image = %assetID;
+				Frame = %i;
+				size = Vector2Scale(%worldCellWidth SPC %worldCellHeight, 2.8);
+				position = %worldCellOffsetX SPC %worldCellOffsetY;
+				BlendColor = "1 1 1 0";
+				SceneLayer = 1;
+				BodyType = static;
+			};
+
+			%sprite.growToTime(Vector2Scale(%worldCellWidth SPC %worldCellHeight, 0.94), 225 + (%i * 20));
+			%sprite.fadetoTime("1 1 1 1", 225 + (%i * 20));
+		}
+	}
+}
+
+function AssetWindow::displayAnimationAsset(%this, %imageAsset, %animationAsset, %assetID)
+{
+	AssetAdmin.AssetScene.clear(true);
+
+	%size = %this.getWorldSize(%imageAsset.getFrameSize(0));
+	new Sprite()
+	{
+		Scene = AssetAdmin.AssetScene;
+		Animation = %assetID;
+		size = %size;
+		BlandColor = "1 1 1 1";
+		SceneLayer = 1;
+		Position = "0 0";
+		BodyType = static;
+	};
+}
+
+function AssetWindow::displayParticleAsset(%this, %particleAsset, %assetID)
+{
+	AssetAdmin.AssetScene.clear(true);
+
+	new ParticlePlayer()
+	{
+		Scene = AssetAdmin.AssetScene;
+		Particle = %assetID;
+		size = "10 10";
+		BlandColor = "1 1 1 1";
+		SceneLayer = 1;
+		Position = "0 0";
+		BodyType = static;
+	};
+}
+
+function AssetWindow::displayFontAsset(%this, %fontAsset, %assetID)
+{
+	AssetAdmin.AssetScene.clear(true);
+
+	%size = %this.getWorldSize("10 10");
+	new TextSprite()
+	{
+		Scene = AssetAdmin.AssetScene;
+		Font = %assetID;
+		fontSize = 4;
+		size = %size;
+		BlandColor = "1 1 1 1";
+		SceneLayer = 1;
+		Position = "0 0";
+		BodyType = static;
+		Text = "A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9";
+		OverflowModeY = "Visible";
+		OverflowModeX = "Wrap";
+		TextAlignment = "center";
+		TextVAlignment = "middle";
+	};
+}
+
+function AssetWindow::displayAudioAsset(%this, %audioAsset, %assetID)
+{
+	AssetAdmin.AssetScene.clear(true);
+
+	AssetAdmin.audioPlayButtonContainer.setVisible(true);
+	AssetAdmin.AssetWindow.setVisible(false);
+
+	AssetAdmin.audioPlayButton.resetSound();
+	AssetAdmin.audioPlayButton.assetID = %assetID;
+	AssetAdmin.audioPlayButton.asset = %audioAsset;
+	AssetAdmin.audioPlayButton.onClick();
+}
+
+function AssetWindow::displaySpineAsset(%this, %spineAsset, %assetID)
+{
+	AssetAdmin.AssetScene.clear(true);
+	//good luck!
+}
+
+function AssetWindow::getWorldSize(%this, %size)
+{
+	%cameraSize = %this.getCameraSize();
+	%cameraX = getWord(%cameraSize, 0);
+	%cameraY = getWord(%cameraSize, 1);
+
+	%x = getWord(%size, 0);
+	%y = getWord(%size, 1);
+
+	%inset = 10;
+
+	//calculate the finished rect 2 ways
+	%finX1 = %cameraX - %inset;
+	%finY1 = (%y * %finX1) / %x;
+
+	%finY2 = %cameraY - %inset;
+	%finX2 = (%x * %finY2) / %y;
+
+	//Return 1 if it's bigger and fits or if it's smaller and 2 doesn't fit
+	if((%finX1 > %finX2 && %finX1 <= (%cameraX - %inset) && %finY1 <= (%cameraY - %inset)) || (%finX1 < %finX2 && (%finX2 > (%cameraX - %inset) || %finY2 > (%cameraY - %inset))))
+	{
+		return %finX1 SPC %finY1;
+	}
+	else
+	{
+		//otherwise use the second finished rect
+		return %finX2 SPC %finY2;
+	}
+}
+
+function AssetWindow::onExtentChange(%this, %d)
+{
+	%x = getWord(%d, 2);
+	%y = getWord(%d, 3);
+
+	if(%x >= %y)
+	{
+		%mult = 100/%x;
+		%areaY =  (%y * %mult);
+		%topLeft = "-50" SPC (%areaY / 2);
+		%bottomRight = "50" SPC -(%areaY / 2);
+	}
+	else
+	{
+		%mult = 100/%y;
+		%areaX =  (%x * %mult);
+		%topLeft = (%areaX / 2) SPC "-50";
+		%bottomRight = -(%areaX / 2) SPC "50";
+	}
+	%area = %topLeft SPC %bottomRight;
+	%this.setCameraArea(%area);
+	%this.setViewLimitOn(%area);
+
+	if(isObject(AssetAdmin.chosenButton))
+	{
+		AssetAdmin.chosenButton.onClick();
+	}
+}
+
+function AssetWindow::onMouseWheelUp(%this)
+{
+	%zoom = %this.getTargetCameraZoom();
+	if(%zoom > 1)
+	{
+		//prevent gradual rounding errors
+		%zoom = mRound(%zoom);
+	}
+	if(%zoom == 1)
+	{
+		%this.setTargetCameraPosition("0 0");
+	}
+	%this.setTargetCameraZoom(mGetMin(16, %zoom * 2));
+	%this.startCameraMove(0.2);
+}
+
+function AssetWindow::onMouseWheelDown(%this)
+{
+	%zoom = %this.getTargetCameraZoom();
+	if(%zoom > 1)
+	{
+		//prevent gradual rounding errors
+		%zoom = mRound(%zoom);
+	}
+	if(%zoom == 1)
+	{
+		%this.setTargetCameraPosition("0 0");
+	}
+	%this.setTargetCameraZoom(mGetMax(0.0625, %zoom / 2));
+	%this.startCameraMove(0.2);
+}

+ 105 - 0
editor/AssetAdmin/DeleteAssetDialog.cs

@@ -0,0 +1,105 @@
+
+function DeleteAssetDialog::init(%this, %width, %height)
+{
+	//Get the dialog contents
+	%window = %this.getObject(0);
+	%content = %window.getObject(0);
+
+	%this.feedback = new GuiControl()
+	{
+		HorizSizing = "right";
+		VertSizing = "bottom";
+		Position = "12 12";
+		Extent = (%width - 24) SPC 70;
+		text = "Whoa there! Once you delete this asset, it's long gone! There's no undo. Are you sure you want to move forward?";
+		textWrap = true;
+	};
+	ThemeManager.setProfile(%this.feedback, "infoProfile");
+	%content.add(%this.feedback);
+
+	//Create the file text box
+	%form = new GuiGridCtrl()
+	{
+		class = "EditorForm";
+		extent = %width SPC %height;
+		Position = "0 80";
+		cellSizeX = %width / 2;
+		cellSizeY = 50;
+	};
+	%form.addListener(%this);
+
+	%item = %form.addFormItem("Delete Dependencies", %width SPC 30);
+	%this.deleteDependenaciesBox = %form.createCheckboxItem(%item);
+	%this.deleteDependenaciesBox.textExtent = (%width / 2) SPC "30";
+
+	%item = %form.addFormItem("Delete Loose Files", %width SPC 30);
+	%this.deleteLooseFilesBox = %form.createCheckboxItem(%item);
+	%this.deleteLooseFilesBox.textExtent = (%width / 2) SPC "30";
+
+	%content.add(%form);
+
+	%this.cancelButton = new GuiButtonCtrl()
+	{
+		HorizSizing = "right";
+		VertSizing = "bottom";
+		Position = "478 160";
+		Extent = "100 30";
+		Text = "Cancel";
+		Command = %this.getID() @ ".onClose();";
+	};
+	ThemeManager.setProfile(%this.cancelButton, "buttonProfile");
+
+	%this.deleteButton = new GuiButtonCtrl()
+	{
+		HorizSizing = "right";
+		VertSizing = "bottom";
+		Position = "588 158";
+		Extent = "100 34";
+		Text = "Delete";
+		Command = %this.getID() @ ".onDelete();";
+	};
+	ThemeManager.setProfile(%this.deleteButton, "primaryButtonProfile");
+
+	%content.add(%this.cancelButton);
+	%content.add(%this.deleteButton);
+}
+
+function DeleteAssetDialog::onClose(%this)
+{
+	Canvas.popDialog(%this);
+}
+
+function DeleteAssetDialog::onDelete(%this)
+{
+	%assetID = %this.doomedAsset.getAssetId();
+	%deleteDependants = %this.deleteDependenaciesBox.getStateOn();
+
+	//Remove the asset...
+	AssetDatabase.deleteAsset(%assetID, %this.deleteLooseFilesBox.getStateOn(), %deleteDependants);
+
+	//Remove the button, but we don't know who has it. So just try them all...
+	%killedAnImage = AssetAdmin.Dictionary["ImageAsset"].removeButton(%assetID);
+	%killedAnAnimation = AssetAdmin.Dictionary["AnimationAsset"].removeButton(%assetID);
+	AssetAdmin.Dictionary["ParticleAsset"].removeButton(%assetID);
+	AssetAdmin.Dictionary["FontAsset"].removeButton(%assetID);
+	AssetAdmin.Dictionary["AudioAsset"].removeButton(%assetID);
+
+	if(%killedAnImage && %deleteDependants)
+	{
+		AssetAdmin.Dictionary["AnimationAsset"].reload();
+		AssetAdmin.Dictionary["FontAsset"].reload();
+	}
+
+	if((%killedAnImage || %killedAnAnimation) && %deleteDependants)
+	{
+		AssetAdmin.Dictionary["ParticleAsset"].reload();
+	}
+
+	AssetAdmin.inspector.hideInspector();
+
+	AssetAdmin.AssetScene.clear(true);
+	AssetAdmin.audioPlayButtonContainer.setVisible(false);
+	AssetAdmin.AssetWindow.setVisible(false);
+
+	%this.onClose();
+}

+ 234 - 0
editor/AssetAdmin/NewAnimationAssetDialog.cs

@@ -0,0 +1,234 @@
+
+function NewAnimationAssetDialog::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("Image Asset", %width SPC 30);
+	%this.imageDropDown = %form.createDropDownItem(%item);
+	%this.populateImageDropDown();
+
+	%item = %form.addFormItem("Target Folder", %width SPC 30);
+	%this.folderBox = %form.createFolderOpenItem(%item, "Select Target Folder");
+	%this.folderBox.Command = %this.getId() @ ".Validate();";
+
+	%item = %form.addFormItem("Asset Name", %width SPC 30);
+	%this.assetNameBox = %form.createTextEditItem(%item);
+	%this.assetNameBox.Command = %this.getId() @ ".Validate();";
+
+	%item = %form.addFormItem("Target Module", %width SPC 30);
+	%this.moduleNameBox = %form.createTextEditItem(%item);
+	%this.moduleNameBox.setActive(false);
+
+	%content.add(%form);
+
+	%this.feedback = new GuiControl()
+	{
+		HorizSizing = "right";
+		VertSizing = "bottom";
+		Position = "12 220";
+		Extent = (%width - 24) SPC 80;
+		text = "Select an Image Asset to get started!";
+	};
+	ThemeManager.setProfile(%this.feedback, "infoProfile");
+
+	%this.cancelButton = new GuiButtonCtrl()
+	{
+		HorizSizing = "right";
+		VertSizing = "bottom";
+		Position = "478 320";
+		Extent = "100 30";
+		Text = "Cancel";
+		Command = %this.getID() @ ".onClose();";
+	};
+	ThemeManager.setProfile(%this.cancelButton, "buttonProfile");
+
+	%this.createButton = new GuiButtonCtrl()
+	{
+		HorizSizing = "right";
+		VertSizing = "bottom";
+		Position = "588 318";
+		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.prevFolder = "";
+}
+
+function NewAnimationAssetDialog::Validate(%this)
+{
+	%this.createButton.active = false;
+
+	%assetID = %this.imageDropDown.getText();
+	if(%assetID $= "")
+	{
+		%this.feedback.setText("Select an Image Asset to get started!");
+		return false;
+	}
+	%imageAssetFilePath = AssetDatabase.getAssetFilePath(%assetID);
+
+	if(%this.folderBox.getText() $= "")
+	{
+		%this.folderBox.setText(makeRelativePath(filePath(%imageAssetFilePath), getMainDotCsDir()));
+	}
+
+	if(%this.assetNameBox.getText() $= "")
+	{
+		%this.assetNameBox.setText(getUnit(%assetID, 1, ":") @ "_AN");
+	}
+
+	%folderPath = %this.getFolderPath();
+	%assetName = %this.assetNameBox.getText();
+
+	if(%folderPath !$= %this.prevFolder)
+	{
+		%modSig = EditorCore.findModuleOfPath(%folderPath @ "a.txt");
+		%this.moduleNameBox.setText(%modSig);
+		%this.prevFolder = %folderPath;
+	}
+	%assetPath = %folderPath @ %assetName @ ".asset.taml";
+	%moduleName = getUnit(%this.moduleNameBox.getText(), 0, "_");
+	%moduleVersion = getUnit(%this.moduleNameBox.getText(), 1, "_");
+	%assetID = %moduleName @ ":" @ %assetName;
+
+	if(%folderPath $= "")
+	{
+		%this.feedback.setText("Please select a target folder.");
+		return false;
+	}
+
+	if(%assetName $= "")
+	{
+		%this.feedback.setText("An animation asset must have an Asset Name.");
+		return false;
+	}
+
+	if(%moduleName $= "")
+	{
+		%this.feedback.setText("You can only create an animation asset inside of a module.");
+		return false;
+	}
+
+	%button = AssetAdmin.Dictionary["AnimationAsset"].getButton(%assetID);
+	if(isObject(%button))
+	{
+		%this.feedback.setText("An asset by this name already exists in this module. Try choosing a different name.");
+		return false;
+	}
+
+	%this.createButton.active = true;
+	%this.feedback.setText("Press the Create button to open the new asset for editing.");
+	return true;
+}
+
+function NewAnimationAssetDialog::onClose(%this)
+{
+	Canvas.popDialog(%this);
+}
+
+function NewAnimationAssetDialog::onCreate(%this)
+{
+	if(%this.validate())
+	{
+		%folderPath = %this.getFolderPath();
+		%assetName = %this.assetNameBox.getText();
+		%assetPath = %folderPath @ %assetName @ ".asset.taml";
+		%moduleName = getUnit(%this.moduleNameBox.getText(), 0, "_");
+		%moduleVersion = getUnit(%this.moduleNameBox.getText(), 1, "_");
+		%assetID = %moduleName @ ":" @ %assetName;
+
+		//Time to create a new file
+		%newAsset = new AnimationAsset()
+		{
+			assetName = %assetName;
+			Image = %this.imageDropDown.getText();
+			AnimationFrames = "0 1";
+			AnimationTime = "1";
+			AnimationCycle = "1";
+		};
+
+		%assetImportSuccessful = TAMLWrite(%newAsset, %assetPath);
+
+		%moduleDef = ModuleDatabase.findModule(%moduleName, %moduleVersion);
+		AssetDatabase.addDeclaredAsset(%moduleDef, %assetPath);
+
+		//Do we already have this button?
+		%button = AssetAdmin.Dictionary["AnimationAsset"].getButton(%assetID);
+
+		if(!isObject(%button))
+		{
+			//Load it into the image dictionary
+			%button = AssetAdmin.Dictionary["AnimationAsset"].addButton(%assetID);
+		}
+		%button.onClick();
+		%this.onClose();
+	}
+}
+
+function NewAnimationAssetDialog::onFolderOpened(%this, %textBox)
+{
+	%this.Validate();
+}
+
+function NewAnimationAssetDialog::getFolderPath(%this)
+{
+	%folderPath = stripTrailingSpaces(makeFullPath(%this.folderBox.getText()));
+	%length = strlen(%folderPath);
+	%lastChar = getSubStr(%folderPath, %length - 1, 1);
+	if(%lastChar $= "/")
+	{
+		return %folderPath;
+	}
+	return %folderPath @ "/";
+}
+
+function NewAnimationAssetDialog::onDropDownClosed(%this, %dropDown)
+{
+	%this.validate();
+}
+
+function NewAnimationAssetDialog::populateImageDropDown(%this)
+{
+	%this.imageDropDown.clearItems();
+
+	%query = new AssetQuery();
+	AssetDatabase.findAllAssets(%query);
+	AssetDatabase.findAssetType(%query, "ImageAsset", true);
+
+	for(%i = 0; %i < %query.getCount(); %i++)
+	{
+		%assetID = %query.getAsset(%i);
+
+		if(!AssetDatabase.isAssetInternal(%assetID))
+		{
+			%imageAsset = AssetDatabase.acquireAsset(%assetID);
+
+			if(%imageAsset.getFrameCount() > 1)
+			{
+				%this.imageDropDown.addItem(%assetID);
+			}
+		}
+	}
+	%query.delete();
+
+	%this.imageDropDown.sortByText();
+	%this.imageDropDown.insertItem(0, "");
+	%this.imageDropDown.setSelected(0);
+}

+ 91 - 0
editor/AssetAdmin/NewAssetButton.cs

@@ -0,0 +1,91 @@
+//NewAssetButton.cs
+
+function NewAssetButton::onClick(%this)
+{
+	%this.call("onNew" @ %this.type);
+}
+
+function NewAssetButton::onNewImageAsset(%this)
+{
+	%width = 700;
+	%height = 340;
+	%dialog = new GuiControl()
+	{
+		class = "NewImageAssetDialog";
+		superclass = "EditorDialog";
+		dialogSize = (%width + 8) SPC (%height + 8);
+		dialogCanClose = true;
+		dialogText = "New Image Asset";
+	};
+	%dialog.init(%width, %height);
+
+	Canvas.pushDialog(%dialog);
+}
+
+function NewAssetButton::onNewAnimationAsset(%this)
+{
+	%width = 700;
+	%height = 390;
+	%dialog = new GuiControl()
+	{
+		class = "NewAnimationAssetDialog";
+		superclass = "EditorDialog";
+		dialogSize = (%width + 8) SPC (%height + 8);
+		dialogCanClose = true;
+		dialogText = "New Animation Asset";
+	};
+	%dialog.init(%width, %height);
+
+	Canvas.pushDialog(%dialog);
+}
+
+function NewAssetButton::onNewParticleAsset(%this)
+{
+	%width = 700;
+	%height = 440;
+	%dialog = new GuiControl()
+	{
+		class = "NewParticleAssetDialog";
+		superclass = "EditorDialog";
+		dialogSize = (%width + 8) SPC (%height + 8);
+		dialogCanClose = true;
+		dialogText = "New Particle Asset";
+	};
+	%dialog.init(%width, %height);
+
+	Canvas.pushDialog(%dialog);
+}
+
+function NewAssetButton::onNewFontAsset(%this)
+{
+	%width = 700;
+	%height = 340;
+	%dialog = new GuiControl()
+	{
+		class = "NewFontAssetDialog";
+		superclass = "EditorDialog";
+		dialogSize = (%width + 8) SPC (%height + 8);
+		dialogCanClose = true;
+		dialogText = "New Bitmap Font Asset";
+	};
+	%dialog.init(%width, %height);
+
+	Canvas.pushDialog(%dialog);
+}
+
+function NewAssetButton::onNewAudioAsset(%this)
+{
+	%width = 700;
+	%height = 340;
+	%dialog = new GuiControl()
+	{
+		class = "NewAudioAssetDialog";
+		superclass = "EditorDialog";
+		dialogSize = (%width + 8) SPC (%height + 8);
+		dialogCanClose = true;
+		dialogText = "New Audio Asset";
+	};
+	%dialog.init(%width, %height);
+
+	Canvas.pushDialog(%dialog);
+}

+ 180 - 0
editor/AssetAdmin/NewAudioAssetDialog.cs

@@ -0,0 +1,180 @@
+
+function NewAudioAssetDialog::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("Audio File", %width SPC 30);
+	%this.imageFileBox = %form.createFileOpenItem(%item, "Waveform Audio (*.WAV;*.WAVE)|*.WAV;*.WAVE|OGG (*.OGG;*.OGV;*.OGA;*.OGX;*.OGM;*.SPX;*.OPUS)|*.OGG;*.OGV;*.OGA;*.OGX;*.OGM;*.SPX;*.OPUS", "Open Audio File");
+	%this.imageFileBox.Command = %this.getId() @ ".Validate();";
+
+	%item = %form.addFormItem("Asset Name", %width SPC 30);
+	%this.assetNameBox = %form.createTextEditItem(%item);
+	%this.assetNameBox.Command = %this.getId() @ ".Validate();";
+
+	%item = %form.addFormItem("Target Module", %width SPC 30);
+	%this.moduleNameBox = %form.createTextEditItem(%item);
+	%this.moduleNameBox.setActive(false);
+
+	%content.add(%form);
+
+	%this.feedback = new GuiControl()
+	{
+		HorizSizing = "right";
+		VertSizing = "bottom";
+		Position = "12 170";
+		Extent = (%width - 24) SPC 80;
+		text = "Select an Audio File to get started!";
+	};
+	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.prevFile = "";
+}
+
+function NewAudioAssetDialog::Validate(%this)
+{
+	%this.createButton.active = false;
+
+	%file = %this.imageFileBox.getText();
+	%assetName = %this.assetNameBox.getText();
+
+	if(%file !$= %this.prevFile)
+	{
+		//remove the extention
+		%fileNameSansExt = fileBase(fileName(%file));
+		if(%fileNameSansExt !$= "" && %assetName $= "")
+		{
+			%assetName = %fileNameSansExt;
+			%this.assetNameBox.setText(%fileNameSansExt);
+		}
+		%modSig = EditorCore.findModuleOfPath(%file);
+		%this.moduleNameBox.setText(%modSig);
+		%this.prevFile = %file;
+	}
+	%assetPath = filePath(%file) @ "/" @ %assetName @ ".asset.taml";
+	%moduleName = getUnit(%this.moduleNameBox.getText(), 0, "_");
+	%moduleVersion = getUnit(%this.moduleNameBox.getText(), 1, "_");
+	%assetID = %moduleName @ ":" @ %assetName;
+
+	if(!isFile(%file))
+	{
+		//We need a real image file!
+		%this.feedback.setText("An existing audio file must be used to create an audio asset!");
+		return false;
+	}
+
+	if(%file $= "")
+	{
+		%this.feedback.setText("Select an Audio File to get started!");
+		return false;
+	}
+
+	if(%assetName $= "")
+	{
+		%this.feedback.setText("An audio asset must have an Asset Name.");
+		return false;
+	}
+
+	if(%moduleName $= "")
+	{
+		%this.feedback.setText("You can only create an audio asset inside of a module.");
+		return false;
+	}
+
+	%button = AssetAdmin.Dictionary["AudioAsset"].getButton(%assetID);
+	if(isObject(%button))
+	{
+		%this.feedback.setText("An asset by this name already exists in this module. Try choosing a different name.");
+		return false;
+	}
+
+	%this.createButton.active = true;
+	%this.feedback.setText("Press the Create button to open the new asset for editing.");
+	return true;
+}
+
+function NewAudioAssetDialog::onClose(%this)
+{
+	Canvas.popDialog(%this);
+}
+
+function NewAudioAssetDialog::onCreate(%this)
+{
+	if(%this.validate())
+	{
+		%file = makeFullPath(%this.imageFileBox.getText());
+		%assetName = %this.assetNameBox.getText();
+		%assetPath = filePath(%file) @ "/" @ %assetName @ ".asset.taml";
+		%moduleName = getUnit(%this.moduleNameBox.getText(), 0, "_");
+		%moduleVersion = getUnit(%this.moduleNameBox.getText(), 1, "_");
+		%assetID = %moduleName @ ":" @ %assetName;
+
+		//Time to create a new file
+		%newAsset = new AudioAsset()
+		{
+			assetName = %assetName;
+			audioFile = %file;
+		};
+
+		%assetImportSuccessful = TAMLWrite(%newAsset, %assetPath);
+
+		%moduleDef = ModuleDatabase.findModule(%moduleName, %moduleVersion);
+		AssetDatabase.addDeclaredAsset(%moduleDef, %assetPath);
+
+		//Refresh the asset so that the loose file will be a path relative to the asset file.
+		AssetDatabase.refreshAsset(%assetID);
+
+		//Do we already have this button?
+		%button = AssetAdmin.Dictionary["AudioAsset"].getButton(%assetID);
+
+		if(!isObject(%button))
+		{
+			//Load it into the image dictionary
+			%button = AssetAdmin.Dictionary["AudioAsset"].addButton(%assetID);
+		}
+		%button.onClick();
+		%this.onClose();
+	}
+}
+
+function NewAudioAssetDialog::onFileOpened(%this, %textBox)
+{
+	%this.Validate();
+}

+ 180 - 0
editor/AssetAdmin/NewFontAssetDialog.cs

@@ -0,0 +1,180 @@
+
+function NewFontAssetDialog::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("Font File", %width SPC 30);
+	%this.imageFileBox = %form.createFileOpenItem(%item, "Bitmap Font (*.FNT)|*.FNT", "Open Bitmap Font File");
+	%this.imageFileBox.Command = %this.getId() @ ".Validate();";
+
+	%item = %form.addFormItem("Asset Name", %width SPC 30);
+	%this.assetNameBox = %form.createTextEditItem(%item);
+	%this.assetNameBox.Command = %this.getId() @ ".Validate();";
+
+	%item = %form.addFormItem("Target Module", %width SPC 30);
+	%this.moduleNameBox = %form.createTextEditItem(%item);
+	%this.moduleNameBox.setActive(false);
+
+	%content.add(%form);
+
+	%this.feedback = new GuiControl()
+	{
+		HorizSizing = "right";
+		VertSizing = "bottom";
+		Position = "12 170";
+		Extent = (%width - 24) SPC 80;
+		text = "Select a Bimap Font File to get started!";
+	};
+	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.prevFile = "";
+}
+
+function NewFontAssetDialog::Validate(%this)
+{
+	%this.createButton.active = false;
+
+	%file = %this.imageFileBox.getText();
+	%assetName = %this.assetNameBox.getText();
+
+	if(%file !$= %this.prevFile)
+	{
+		//remove the extention
+		%fileNameSansExt = fileBase(fileName(%file));
+		if(%fileNameSansExt !$= "" && %assetName $= "")
+		{
+			%assetName = %fileNameSansExt;
+			%this.assetNameBox.setText(%fileNameSansExt);
+		}
+		%modSig = EditorCore.findModuleOfPath(%file);
+		%this.moduleNameBox.setText(%modSig);
+		%this.prevFile = %file;
+	}
+	%assetPath = filePath(%file) @ "/" @ %assetName @ ".asset.taml";
+	%moduleName = getUnit(%this.moduleNameBox.getText(), 0, "_");
+	%moduleVersion = getUnit(%this.moduleNameBox.getText(), 1, "_");
+	%assetID = %moduleName @ ":" @ %assetName;
+
+	if(!isFile(%file))
+	{
+		//We need a real image file!
+		%this.feedback.setText("An existing font file must be used to create a font asset!");
+		return false;
+	}
+
+	if(%file $= "")
+	{
+		%this.feedback.setText("Select a Bitmap Font File to get started!");
+		return false;
+	}
+
+	if(%assetName $= "")
+	{
+		%this.feedback.setText("A font asset must have an Asset Name.");
+		return false;
+	}
+
+	if(%moduleName $= "")
+	{
+		%this.feedback.setText("You can only create a font asset inside of a module.");
+		return false;
+	}
+
+	%button = AssetAdmin.Dictionary["FontAsset"].getButton(%assetID);
+	if(isObject(%button))
+	{
+		%this.feedback.setText("An asset by this name already exists in this module. Try choosing a different name.");
+		return false;
+	}
+
+	%this.createButton.active = true;
+	%this.feedback.setText("Press the Create button to open the new asset for editing.");
+	return true;
+}
+
+function NewFontAssetDialog::onClose(%this)
+{
+	Canvas.popDialog(%this);
+}
+
+function NewFontAssetDialog::onCreate(%this)
+{
+	if(%this.validate())
+	{
+		%file = makeFullPath(%this.imageFileBox.getText());
+		%assetName = %this.assetNameBox.getText();
+		%assetPath = filePath(%file) @ "/" @ %assetName @ ".asset.taml";
+		%moduleName = getUnit(%this.moduleNameBox.getText(), 0, "_");
+		%moduleVersion = getUnit(%this.moduleNameBox.getText(), 1, "_");
+		%assetID = %moduleName @ ":" @ %assetName;
+
+		//Time to create a new file
+		%newAsset = new FontAsset()
+		{
+			assetName = %assetName;
+			fontFile = %file;
+		};
+
+		%assetImportSuccessful = TAMLWrite(%newAsset, %assetPath);
+
+		%moduleDef = ModuleDatabase.findModule(%moduleName, %moduleVersion);
+		AssetDatabase.addDeclaredAsset(%moduleDef, %assetPath);
+
+		//Refresh the asset so that the loose file will be a path relative to the asset file.
+		AssetDatabase.refreshAsset(%assetID);
+
+		//Do we already have this button?
+		%button = AssetAdmin.Dictionary["FontAsset"].getButton(%assetID);
+
+		if(!isObject(%button))
+		{
+			//Load it into the image dictionary
+			%button = AssetAdmin.Dictionary["FontAsset"].addButton(%assetID);
+		}
+		%button.onClick();
+		%this.onClose();
+	}
+}
+
+function NewFontAssetDialog::onFileOpened(%this, %textBox)
+{
+	%this.Validate();
+}

+ 187 - 0
editor/AssetAdmin/NewImageAssetDialog.cs

@@ -0,0 +1,187 @@
+
+function NewImageAssetDialog::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("Image File", %width SPC 30);
+	%this.imageFileBox = %form.createFileOpenItem(%item, "PNG (*.PNG)|*.PNG|JPEG (*.JPG;*.JPEG;*.JPE)|*.JPG;*.JPEG;*.JPE", "Open Image File");
+	%this.imageFileBox.Command = %this.getId() @ ".Validate();";
+
+	%item = %form.addFormItem("Asset Name", %width SPC 30);
+	%this.assetNameBox = %form.createTextEditItem(%item);
+	%this.assetNameBox.Command = %this.getId() @ ".Validate();";
+
+	%item = %form.addFormItem("Target Module", %width SPC 30);
+	%this.moduleNameBox = %form.createTextEditItem(%item);
+	%this.moduleNameBox.setActive(false);
+
+	%content.add(%form);
+
+	%this.feedback = new GuiControl()
+	{
+		HorizSizing = "right";
+		VertSizing = "bottom";
+		Position = "12 170";
+		Extent = (%width - 24) SPC 80;
+		text = "Select an Image File to get started!";
+	};
+	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.prevFile = "";
+}
+
+function NewImageAssetDialog::Validate(%this)
+{
+	%this.createButton.active = false;
+
+	%file = %this.imageFileBox.getText();
+	%assetName = %this.assetNameBox.getText();
+
+	if(%file !$= %this.prevFile)
+	{
+		//remove the extention
+		%fileNameSansExt = fileBase(fileName(%file));
+		if(%fileNameSansExt !$= "" && %assetName $= "")
+		{
+			%assetName = %fileNameSansExt;
+			%this.assetNameBox.setText(%fileNameSansExt);
+		}
+		%modSig = EditorCore.findModuleOfPath(%file);
+		%this.moduleNameBox.setText(%modSig);
+		%this.prevFile = %file;
+	}
+	%assetPath = filePath(%file) @ "/" @ %assetName @ ".asset.taml";
+	%moduleName = getUnit(%this.moduleNameBox.getText(), 0, "_");
+	%moduleVersion = getUnit(%this.moduleNameBox.getText(), 1, "_");
+	%assetID = %moduleName @ ":" @ %assetName;
+
+	if(!isFile(%file))
+	{
+		//We need a real image file!
+		%this.feedback.setText("An existing image file must be used to create an image asset!");
+		return false;
+	}
+
+	if(!isValidImageFile(%file))
+	{
+		//We need a real image file!
+		%this.feedback.setText("There is a problem with the image file!");
+		return false;
+	}
+
+	if(%file $= "")
+	{
+		%this.feedback.setText("Select an Image File to get started!");
+		return false;
+	}
+
+	if(%assetName $= "")
+	{
+		%this.feedback.setText("An image asset must have an Asset Name.");
+		return false;
+	}
+
+	if(%moduleName $= "")
+	{
+		%this.feedback.setText("You can only create an image asset inside of a module.");
+		return false;
+	}
+
+	%button = AssetAdmin.Dictionary["ImageAsset"].getButton(%assetID);
+	if(isObject(%button))
+	{
+		%this.feedback.setText("An asset by this name already exists in this module. Try choosing a different name.");
+		return false;
+	}
+
+	%this.createButton.active = true;
+	%this.feedback.setText("Press the Create button to open the new asset for editing.");
+	return true;
+}
+
+function NewImageAssetDialog::onClose(%this)
+{
+	Canvas.popDialog(%this);
+}
+
+function NewImageAssetDialog::onCreate(%this)
+{
+	if(%this.validate())
+	{
+		%file = makeFullPath(%this.imageFileBox.getText());
+		%assetName = %this.assetNameBox.getText();
+		%assetPath = filePath(%file) @ "/" @ %assetName @ ".asset.taml";
+		%moduleName = getUnit(%this.moduleNameBox.getText(), 0, "_");
+		%moduleVersion = getUnit(%this.moduleNameBox.getText(), 1, "_");
+		%assetID = %moduleName @ ":" @ %assetName;
+
+		//Time to create a new file
+		%newAsset = new ImageAsset()
+		{
+			assetName = %assetName;
+			imageFile = %file;
+		};
+
+		%assetImportSuccessful = TAMLWrite(%newAsset, %assetPath);
+
+		%moduleDef = ModuleDatabase.findModule(%moduleName, %moduleVersion);
+		AssetDatabase.addDeclaredAsset(%moduleDef, %assetPath);
+
+		//Refresh the asset so that the loose file will be a path relative to the asset file.
+		AssetDatabase.refreshAsset(%assetID);
+
+		//Do we already have this button?
+		%button = AssetAdmin.Dictionary["ImageAsset"].getButton(%assetID);
+
+		if(!isObject(%button))
+		{
+			//Load it into the image dictionary
+			%button = AssetAdmin.Dictionary["ImageAsset"].addButton(%assetID);
+		}
+		%button.onClick();
+		%this.onClose();
+	}
+}
+
+function NewImageAssetDialog::onFileOpened(%this, %textBox)
+{
+	%this.Validate();
+}

+ 279 - 0
editor/AssetAdmin/NewParticleAssetDialog.cs

@@ -0,0 +1,279 @@
+
+function NewParticleAssetDialog::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("Image Asset", %width SPC 30);
+	%this.imageDropDown = %form.createDropDownItem(%item);
+	%this.populateImageDropDown();
+
+	%item = %form.addFormItem("Animation Asset", %width SPC 30);
+	%this.animationDropDown = %form.createDropDownItem(%item);
+	%this.populateAnimationDropDown();
+
+	%item = %form.addFormItem("Target Folder", %width SPC 30);
+	%this.folderBox = %form.createFolderOpenItem(%item, "Select Target Folder");
+	%this.folderBox.Command = %this.getId() @ ".Validate();";
+
+	%item = %form.addFormItem("Asset Name", %width SPC 30);
+	%this.assetNameBox = %form.createTextEditItem(%item);
+	%this.assetNameBox.Command = %this.getId() @ ".Validate();";
+
+	%item = %form.addFormItem("Target Module", %width SPC 30);
+	%this.moduleNameBox = %form.createTextEditItem(%item);
+	%this.moduleNameBox.setActive(false);
+
+	%content.add(%form);
+
+	%this.feedback = new GuiControl()
+	{
+		HorizSizing = "right";
+		VertSizing = "bottom";
+		Position = "12 270";
+		Extent = (%width - 24) SPC 80;
+		text = "Select an Image Asset or Animation Assset to get started!";
+	};
+	ThemeManager.setProfile(%this.feedback, "infoProfile");
+
+	%this.cancelButton = new GuiButtonCtrl()
+	{
+		HorizSizing = "right";
+		VertSizing = "bottom";
+		Position = "478 370";
+		Extent = "100 30";
+		Text = "Cancel";
+		Command = %this.getID() @ ".onClose();";
+	};
+	ThemeManager.setProfile(%this.cancelButton, "buttonProfile");
+
+	%this.createButton = new GuiButtonCtrl()
+	{
+		HorizSizing = "right";
+		VertSizing = "bottom";
+		Position = "588 368";
+		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.prevFolder = "";
+}
+
+function NewParticleAssetDialog::Validate(%this)
+{
+	%this.createButton.active = false;
+
+	%imageAssetID = %this.imageDropDown.getText();
+	%animationAssetID = %this.animationDropDown.getText();
+	if(%imageAssetID $= "" && %animationAssetID $= "")
+	{
+		%this.feedback.setText("Select an Image Asset or Animation Assset to get started!");
+		return false;
+	}
+	%assetID = %imageAssetID;
+	if(%imageAssetID $= "")
+	{
+		%assetID = %animationAssetID;
+	}
+
+	%assetFilePath = AssetDatabase.getAssetFilePath(%assetID);
+
+	if(%this.folderBox.getText() $= "")
+	{
+		%this.folderBox.setText(makeRelativePath(filePath(%assetFilePath), getMainDotCsDir()));
+	}
+
+	if(%this.assetNameBox.getText() $= "")
+	{
+		%this.assetNameBox.setText(getUnit(%assetID, 1, ":") @ "_PT");
+	}
+
+	%folderPath = %this.getFolderPath();
+	%assetName = %this.assetNameBox.getText();
+
+	if(%folderPath !$= %this.prevFolder)
+	{
+		%modSig = EditorCore.findModuleOfPath(%folderPath @ "a.txt");
+		%this.moduleNameBox.setText(%modSig);
+		%this.prevFolder = %folderPath;
+	}
+	%assetPath = %folderPath @ %assetName @ ".asset.taml";
+	%moduleName = getUnit(%this.moduleNameBox.getText(), 0, "_");
+	%moduleVersion = getUnit(%this.moduleNameBox.getText(), 1, "_");
+	%assetID = %moduleName @ ":" @ %assetName;
+
+	if(%folderPath $= "")
+	{
+		%this.feedback.setText("Please select a target folder.");
+		return false;
+	}
+
+	if(%assetName $= "")
+	{
+		%this.feedback.setText("A particle asset must have an Asset Name.");
+		return false;
+	}
+
+	if(%moduleName $= "")
+	{
+		%this.feedback.setText("You can only create a particle asset inside of a module.");
+		return false;
+	}
+
+	%button = AssetAdmin.Dictionary["ParticleAsset"].getButton(%assetID);
+	if(isObject(%button))
+	{
+		%this.feedback.setText("An asset by this name already exists in this module. Try choosing a different name.");
+		return false;
+	}
+
+	%this.createButton.active = true;
+	%this.feedback.setText("Press the Create button to open the new asset for editing.");
+	return true;
+}
+
+function NewParticleAssetDialog::onClose(%this)
+{
+	Canvas.popDialog(%this);
+}
+
+function NewParticleAssetDialog::onCreate(%this)
+{
+	if(%this.validate())
+	{
+		%folderPath = %this.getFolderPath();
+		%assetName = %this.assetNameBox.getText();
+		%assetPath = %folderPath @ %assetName @ ".asset.taml";
+		%moduleName = getUnit(%this.moduleNameBox.getText(), 0, "_");
+		%moduleVersion = getUnit(%this.moduleNameBox.getText(), 1, "_");
+		%assetID = %moduleName @ ":" @ %assetName;
+
+		//Time to create a new file
+		%newAsset = new ParticleAsset()
+		{
+			assetName = %assetName;
+		};
+		%newEmitter = %newAsset.createEmitter();
+		%newEmitter.setEmitterName("DefaultEmitter");
+		if(%this.imageDropDown.getText() !$= "")
+		{
+			%newEmitter.setImage(%this.imageDropDown.getText());
+		}
+		else
+		{
+			%newEmitter.setAnimation(%this.animationDropDown.getText());
+		}
+
+		%assetImportSuccessful = TAMLWrite(%newAsset, %assetPath);
+
+		%moduleDef = ModuleDatabase.findModule(%moduleName, %moduleVersion);
+		AssetDatabase.addDeclaredAsset(%moduleDef, %assetPath);
+
+		//Do we already have this button?
+		%button = AssetAdmin.Dictionary["ParticleAsset"].getButton(%assetID);
+
+		if(!isObject(%button))
+		{
+			//Load it into the image dictionary
+			%button = AssetAdmin.Dictionary["ParticleAsset"].addButton(%assetID);
+		}
+		%button.onClick();
+		%this.onClose();
+	}
+}
+
+function NewParticleAssetDialog::onFolderOpened(%this, %textBox)
+{
+	%this.Validate();
+}
+
+function NewParticleAssetDialog::getFolderPath(%this)
+{
+	%folderPath = stripTrailingSpaces(makeFullPath(%this.folderBox.getText()));
+	%length = strlen(%folderPath);
+	%lastChar = getSubStr(%folderPath, %length - 1, 1);
+	if(%lastChar $= "/")
+	{
+		return %folderPath;
+	}
+	return %folderPath @ "/";
+}
+
+function NewParticleAssetDialog::onDropDownClosed(%this, %dropDown)
+{
+	if(%dropDown == %this.imageDropDown && %dropDown.getText() !$= "")
+	{
+		%this.animationDropDown.setSelected(0);
+	}
+	else if(%dropDown == %this.animationDropDown && %dropDown.getText() !$= "")
+	{
+		%this.imageDropDown.setSelected(0);
+	}
+
+	%this.validate();
+}
+
+function NewParticleAssetDialog::populateImageDropDown(%this)
+{
+	%this.imageDropDown.clearItems();
+
+	%query = new AssetQuery();
+	AssetDatabase.findAllAssets(%query);
+	AssetDatabase.findAssetType(%query, "ImageAsset", true);
+
+	for(%i = 0; %i < %query.getCount(); %i++)
+	{
+		%assetID = %query.getAsset(%i);
+
+		if(!AssetDatabase.isAssetInternal(%assetID))
+		{
+			%this.imageDropDown.addItem(%assetID);
+		}
+	}
+	%query.delete();
+
+	%this.imageDropDown.sortByText();
+	%this.imageDropDown.insertItem(0, "");
+	%this.imageDropDown.setSelected(0);
+}
+
+function NewParticleAssetDialog::populateAnimationDropDown(%this)
+{
+	%this.animationDropDown.clearItems();
+
+	%query = new AssetQuery();
+	AssetDatabase.findAllAssets(%query);
+	AssetDatabase.findAssetType(%query, "AnimationAsset", true);
+
+	for(%i = 0; %i < %query.getCount(); %i++)
+	{
+		%assetID = %query.getAsset(%i);
+
+		if(!AssetDatabase.isAssetInternal(%assetID))
+		{
+			%this.animationDropDown.addItem(%assetID);
+		}
+	}
+	%query.delete();
+
+	%this.animationDropDown.sortByText();
+	%this.animationDropDown.insertItem(0, "");
+	%this.animationDropDown.setSelected(0);
+}

+ 296 - 0
editor/AssetAdmin/ParticleEditor/AssetParticleGraphTool.cs

@@ -0,0 +1,296 @@
+//-----------------------------------------------------------------------------
+// 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 AssetParticleGraphTool::onAdd(%this)
+{
+	%this.init();
+	%this.addItem("Lifetime Scale");
+	%this.addItem("Quantity Scale");
+	%this.addItem("SizeX Scale");
+	%this.addItem("SizeY Scale");
+	%this.addItem("Speed Scale");
+	%this.addItem("Spin Scale");
+	%this.addItem("Fixed Force Scale");
+	%this.addItem("Random Motion Scale");
+	%this.addItem("Alpha Channel Scale");
+}
+
+function AssetParticleGraphEmitterTool::onAdd(%this)
+{
+	%this.init();
+	%this.initEmitter();
+	%this.addItem("Lifetime");
+	%this.addItem("Quantity");
+	%this.addItem("SizeX");
+	%this.addItem("SizeY");
+	%this.addItem("Speed");
+	%this.addItem("Spin");
+	%this.addItem("Fixed Force");
+	%this.addItem("Random Motion");
+	%this.addItem("Emission Force");
+	%this.addItem("Emission Angle");
+	%this.addItem("Emission Arc");
+	%this.addItem("Red Channel");
+	%this.addItem("Green Channel");
+	%this.addItem("Blue Channel");
+	%this.addItem("Alpha Channel");
+}
+
+function AssetParticleGraphTool::init(%this)
+{
+	%this.listScroll = new GuiScrollCtrl()
+	{
+		HorizSizing="right";
+		VertSizing="height";
+		Position="0 0";
+		Extent="200" SPC getWord(%this.extent, 1);
+		hScrollBar="alwaysOff";
+		vScrollBar="alwaysOn";
+		constantThumbHeight="0";
+		showArrowButtons="1";
+		scrollBarThickness="14";
+	};
+	ThemeManager.setProfile(%this.listScroll, "scrollingPanelProfile");
+	ThemeManager.setProfile(%this.listScroll, "scrollingPanelThumbProfile", "ThumbProfile");
+	ThemeManager.setProfile(%this.listScroll, "scrollingPanelTrackProfile", "TrackProfile");
+	ThemeManager.setProfile(%this.listScroll, "scrollingPanelArrowProfile", "ArrowProfile");
+	%this.add(%this.listScroll);
+
+	%this.baseList = new GuiListBoxCtrl()
+	{
+		Class = "AssetParticleGraphToolList";
+		HorizSizing="width";
+		VertSizing="height";
+		Position="0 0";
+		Extent= "200 100";
+		hScrollBar="dynamic";
+		vScrollBar="dynamic";
+	};
+	%this.startListening(%this.baseList);
+	ThemeManager.setProfile(%this.baseList, "listBoxProfile");
+	%this.listScroll.add(%this.baseList);
+
+	%this.toolScroll = new GuiScrollCtrl()
+	{
+		HorizSizing="width";
+		VertSizing="height";
+		Position="200 0";
+		Extent= (getWord(%this.extent, 0) - 200) SPC getWord(%this.extent, 1);
+		hScrollBar="dynamic";
+		vScrollBar="dynamic";
+		constantThumbHeight="0";
+		showArrowButtons="1";
+		scrollBarThickness="14";
+	};
+	ThemeManager.setProfile(%this.toolScroll, "scrollingPanelProfile");
+	ThemeManager.setProfile(%this.toolScroll, "scrollingPanelThumbProfile", "ThumbProfile");
+	ThemeManager.setProfile(%this.toolScroll, "scrollingPanelTrackProfile", "TrackProfile");
+	ThemeManager.setProfile(%this.toolScroll, "scrollingPanelArrowProfile", "ArrowProfile");
+	%this.add(%this.toolScroll);
+
+	%itemWidth = 360;
+	%this.toolGrid = new GuiGridCtrl()
+	{
+		HorizSizing="width";
+		VertSizing="height";
+		Position="0 0";
+		Extent = (getWord(%this.toolScroll.Extent, 0) - 14) SPC getWord(%this.extent, 1);
+		CellSizeX = %itemWidth;
+		CellSizeY = 0;
+		CellModeX = variable;
+		CellModeY = variable;
+		CellSpacingX = 4;
+		CellSpacingY = 4;
+		OrderMode = "LRTB";
+	};
+	ThemeManager.setProfile(%this.toolGrid, "emptyProfile");
+	%this.toolScroll.add(%this.toolGrid);
+
+	%this.baseGraph = new GuiControl()
+	{
+		Class = "AssetParticleGraphUnit";
+		HorizSizing="right";
+		VertSizing="bottom";
+		Position="0 0";
+		Extent= %itemWidth SPC (getWord(%this.extent, 1) - 30);
+		Text = "Base Value";
+	};
+	ThemeManager.setProfile(%this.baseGraph, "labelProfile");
+	%this.toolGrid.add(%this.baseGraph);
+}
+
+function AssetParticleGraphEmitterTool::initEmitter(%this)
+{
+	%this.variGraph = new GuiControl()
+	{
+		Class = "AssetParticleGraphUnit";
+		HorizSizing="right";
+		VertSizing="bottom";
+		Position="0 0";
+		Extent= %itemWidth SPC (getWord(%this.extent, 1) - 30);
+		Text = "Variation";
+		Tool = %this.toolGrid;
+	};
+	ThemeManager.setProfile(%this.variGraph, "labelProfile");
+	%this.toolGrid.add(%this.variGraph);
+
+	%this.lifeGraph = new GuiControl()
+	{
+		Class = "AssetParticleGraphUnit";
+		HorizSizing="right";
+		VertSizing="bottom";
+		Position="0 0";
+		Extent= %itemWidth SPC (getWord(%this.extent, 1) - 30);
+		Text = "Scale Over Particle Lifetime";
+		Tool = %this.toolGrid;
+	};
+	ThemeManager.setProfile(%this.lifeGraph, "labelProfile");
+	%this.toolGrid.add(%this.lifeGraph);
+}
+
+function AssetParticleGraphTool::addItem(%this, %item, %color)
+{
+	if(%color !$= "")
+	{
+		%this.baseList.addItem(%item, %color);
+	}
+	else
+	{
+		%this.baseList.addItem(%item);
+	}
+}
+
+function AssetParticleGraphTool::inspect(%this, %asset, %emitterID)
+{
+	%this.asset = %asset;
+	%this.baseGraph.graph.inspect(%asset);
+	if(isObject(%this.variGraph))
+	{
+		%this.variGraph.graph.inspect(%asset);
+	}
+	if(isObject(%this.lifeGraph))
+	{
+		%this.lifeGraph.graph.inspect(%asset);
+	}
+	%this.baseList.clearSelection();
+	%this.emitterID = %emitterID;
+	%this.baseList.setCurSel(0);
+}
+
+function AssetParticleGraphToolList::onSelect(%this, %index, %text, %id)
+{
+	%this.postEvent("Select", %index);
+}
+
+function AssetParticleGraphTool::onSelect(%this, %index)
+{
+	%i = 0;
+	%graphTable[%i] = "LifeTimeScale"; %i++;
+	%graphTable[%i] = "QuantityScale"; %i++;
+	%graphTable[%i] = "SizeXScale"; %i++;
+	%graphTable[%i] = "SizeYScale"; %i++;
+	%graphTable[%i] = "SpeedScale"; %i++;
+	%graphTable[%i] = "SpinScale"; %i++;
+	%graphTable[%i] = "FixedForceScale"; %i++;
+	%graphTable[%i] = "RandomMotionScale"; %i++;
+	%graphTable[%i] = "AlphaChannelScale";
+
+	%name = %graphTable[%index];
+	%this.baseGraph.setToScale(%name);
+	%this.baseGraph.setValueController(%this.getValueController(%name));
+	%this.baseGraph.setTimeController(%this.getTimeController(%name));
+}
+
+function AssetParticleGraphTool::getValueController(%this, %name)
+{
+	if(%name $= "")
+	{
+		return "";
+	}
+	return new ScriptObject()
+	{
+		class = ParticleGraphCameraController;
+		fieldName = %name;
+		isTime = false;
+		asset = %this.asset;
+	};
+}
+
+function AssetParticleGraphTool::getTimeController(%this, %name)
+{
+	if(%name $= "")
+	{
+		return "";
+	}
+	return new ScriptObject()
+	{
+		class = ParticleGraphCameraController;
+		fieldName = %name;
+		isTime = true;
+		asset = %this.asset;
+	};
+}
+
+function AssetParticleGraphEmitterTool::onSelect(%this, %index)
+{
+	%i = 0;
+	%graphTable[%i] = "Lifetime"; %i++;
+	%graphTable[%i] = "Quantity"; %i++;
+	%graphTable[%i] = "SizeX"; %i++;
+	%graphTable[%i] = "SizeY"; %i++;
+	%graphTable[%i] = "Speed"; %i++;
+	%graphTable[%i] = "Spin"; %i++;
+	%graphTable[%i] = "FixedForce"; %i++;
+	%graphTable[%i] = "RandomMotion"; %i++;
+	%graphTable[%i] = "EmissionForce"; %i++;
+	%graphTable[%i] = "EmissionAngle"; %i++;
+	%graphTable[%i] = "EmissionArc"; %i++;
+	%graphTable[%i] = "RedChannel"; %i++;
+	%graphTable[%i] = "GreenChannel"; %i++;
+	%graphTable[%i] = "BlueChannel"; %i++;
+	%graphTable[%i] = "AlphaChannel";
+
+	for(%i = 0; %i < 11; %i++)
+	{
+		%varTable[%i] = %graphTable[%i] @ "Variation";
+	}
+
+	for(%i = 2; %i < 8; %i++)
+	{
+		%lifeTable[%i] = %graphTable[%i] @ "Life";
+	}
+
+	%name = %graphTable[%index];
+	%this.baseGraph.setToBase(%name, %varTable[%index], %this.emitterID);
+	%this.baseGraph.setValueController(%this.getValueController(%name));
+	%this.baseGraph.setTimeController(%this.getTimeController(%name));
+
+	%name = %varTable[%index];
+	%this.variGraph.setToVari( %name, %this.emitterID);
+	%this.variGraph.setValueController(%this.getValueController(%name));
+	%this.variGraph.setTimeController(%this.getTimeController(%name));
+
+	%name = %lifeTable[%index];
+	%this.lifeGraph.setToLife( %name, %this.emitterID);
+	%this.lifeGraph.setValueController(%this.getValueController(%name));
+	%this.lifeGraph.setTimeController(%this.getTimeController(%name));
+}

+ 272 - 0
editor/AssetAdmin/ParticleEditor/AssetParticleGraphUnit.cs

@@ -0,0 +1,272 @@
+
+function AssetParticleGraphUnit::onAdd(%this)
+{
+	%this.graph = new GuiParticleGraphInspector()
+	{
+		HorizSizing="width";
+		VertSizing="height";
+		Position="30 18";
+		Extent= (getWord(%this.extent, 0) - 40) SPC (getWord(%this.extent, 1) - 60);
+	};
+	ThemeManager.setProfile(%this.graph, "graphProfile");
+	%this.add(%this.graph);
+
+	//Value zoom buttons
+	%center = 6 + mRound(getWord(%this.graph.extent, 1) / 2);
+	%this.valueZoomInButton = new GuiButtonCtrl()
+	{
+		Class = "EditorIconButton";
+		Frame = 0;
+		Position = "2" SPC (%center + 13);
+		Command = %this.getId() @ ".valueZoomIn();";
+		Tooltip = "Zoom In";
+	};
+	ThemeManager.setProfile(%this.valueZoomInButton, "iconButtonProfile");
+	%this.add(%this.valueZoomInButton);
+
+	%this.valueZoomOutButton = new GuiButtonCtrl()
+	{
+		Class = "EditorIconButton";
+		Frame = 1;
+		Position = "2" SPC (%center - 13);
+		Command = %this.getId() @ ".valueZoomOut();";
+		Tooltip = "Zoom Out";
+	};
+	ThemeManager.setProfile(%this.valueZoomOutButton, "iconButtonProfile");
+	%this.add(%this.valueZoomOutButton);
+
+	//Value move buttons
+	%this.valueMoveUpButton = new GuiButtonCtrl()
+	{
+		Class = "EditorIconButton";
+		Frame = 2;
+		Position = "2 18";
+		Command = %this.getId() @ ".valueMoveUp();";
+		Tooltip = "Move Graph Up";
+	};
+	ThemeManager.setProfile(%this.valueMoveUpButton, "iconButtonProfile");
+	%this.add(%this.valueMoveUpButton);
+
+	%this.valueMoveDownButton = new GuiButtonCtrl()
+	{
+		Class = "EditorIconButton";
+		Frame = 6;
+		Position = "2" SPC (getWord(%this.extent, 1) - 66);
+		Command = %this.getId() @ ".valueMoveDown();";
+		Tooltip = "Move Graph Down";
+	};
+	ThemeManager.setProfile(%this.valueMoveDownButton, "iconButtonProfile");
+	%this.add(%this.valueMoveDownButton);
+
+	//time zoom buttons
+	%center = 18 + mRound(getWord(%this.graph.extent, 0));
+	%bottom = getWord(%this.extent, 1) - 38;
+	%this.timeZoomContainer = new GuiControl()
+	{
+		HorizSizing = "Center";
+		Position = "0" SPC %bottom;
+		Extent = "50 24";
+	};
+	ThemeManager.setProfile(%this.timeZoomContainer, "emptyProfile");
+	%this.add(%this.timeZoomContainer);
+
+	%this.timeZoomInButton = new GuiButtonCtrl()
+	{
+		Class = "EditorIconButton";
+		Frame = 0;
+		Position = "0 0";
+		Command = %this.getId() @ ".timeZoomIn();";
+		Tooltip = "Zoom In";
+	};
+	ThemeManager.setProfile(%this.timeZoomInButton, "iconButtonProfile");
+	%this.timeZoomContainer.add(%this.timeZoomInButton);
+
+	%this.timeZoomOutButton = new GuiButtonCtrl()
+	{
+		Class = "EditorIconButton";
+		Frame = 1;
+		Position = "26 0";
+		Command = %this.getId() @ ".timeZoomOut();";
+		Tooltip = "Zoom Out";
+	};
+	ThemeManager.setProfile(%this.timeZoomOutButton, "iconButtonProfile");
+	%this.timeZoomContainer.add(%this.timeZoomOutButton);
+
+	//Time move buttons
+	%this.timeMoveBackButton = new GuiButtonCtrl()
+	{
+		Class = "EditorIconButton";
+		Frame = 8;
+		HorizSizing = "right";
+		Position = "30" SPC %bottom;
+		Command = %this.getId() @ ".timeMoveBack();";
+		Tooltip = "Move Graph Back";
+	};
+	ThemeManager.setProfile(%this.timeMoveBackButton, "iconButtonProfile");
+	%this.add(%this.timeMoveBackButton);
+
+	%this.timeMoveForwardButton = new GuiButtonCtrl()
+	{
+		Class = "EditorIconButton";
+		Frame = 4;
+		HorizSizing = "left";
+		Position = (getWord(%this.graph.extent, 0) + 6) SPC %bottom;
+		Command = %this.getId() @ ".timeMoveForward();";
+		Tooltip = "Move Graph Forward";
+	};
+	ThemeManager.setProfile(%this.timeMoveForwardButton, "iconButtonProfile");
+	%this.add(%this.timeMoveForwardButton);
+}
+
+function AssetParticleGraphUnit::setToScale(%this, %scaleName)
+{
+	%this.graph.setDisplayLabels("Time", "Scale");
+	%this.graph.setDisplayField(%scaleName);
+}
+
+function AssetParticleGraphUnit::setToBase(%this, %baseName, %variName, %emitterID)
+{
+	%this.graph.setDisplayLabels("Time", "Base Value");
+	%this.graph.setDisplayField(%baseName, %emitterID);
+}
+
+function AssetParticleGraphUnit::setToVari(%this, %variName, %emitterID)
+{
+	if(%variName $= "")
+	{
+		if(%this.Tool.isMember(%this))
+		{
+			%this.Tool.remove(%this);
+		}
+		return;
+	}
+
+	if(!%this.Tool.isMember(%this))
+	{
+		%this.Tool.add(%this);
+	}
+	%this.graph.setDisplayLabels("Time", "Variation");
+	%this.graph.setDisplayField(%variName, %emitterID);
+}
+
+function AssetParticleGraphUnit::setToLife(%this, %lifeName, %emitterID)
+{
+	if(%lifeName $= "")
+	{
+		if(%this.Tool.isMember(%this))
+		{
+			%this.Tool.remove(%this);
+		}
+		return;
+	}
+
+	if(!%this.Tool.isMember(%this))
+	{
+		%this.Tool.add(%this);
+	}
+	%this.graph.setDisplayLabels("Time", "Scale");
+	%this.graph.setDisplayField(%lifeName, %emitterID);
+}
+
+function AssetParticleGraphUnit::setValueController(%this, %controller)
+{
+	if(!isObject(%controller))
+	{
+		return;
+	}
+	if(isObject(%this.valueController))
+	{
+		%this.valueController.delete();
+	}
+
+	%this.valueController = %controller;
+	%this.refreshCamera();
+}
+
+function AssetParticleGraphUnit::setTimeController(%this, %controller)
+{
+	if(!isObject(%controller))
+	{
+		return;
+	}
+	if(isObject(%this.timeController))
+	{
+		%this.timeController.delete();
+	}
+
+	%this.timeController = %controller;
+	%this.refreshCamera();
+}
+
+function AssetParticleGraphUnit::refreshCamera(%this)
+{
+	if(!isObject(%this.timeController) || !isObject(%this.valueController))
+	{
+		return;
+	}
+
+	%xMin = %this.timeController.getCameraMin();
+	%xMax = %this.timeController.getCameraMax();
+	%yMin = %this.valueController.getCameraMin();
+	%yMax = %this.valueController.getCameraMax();
+
+	%this.graph.setDisplayArea(%xMin SPC %yMin SPC %xMax SPC %yMax);
+
+	%this.valueMoveUpButton.setActive(%this.valueController.getMoveUpEnabled());
+	%this.valueMoveDownButton.setActive(%this.valueController.getMoveDownEnabled());
+	%this.valueZoomInButton.setActive(%this.valueController.getZoomInEnabled());
+	%this.valueZoomOutButton.setActive(%this.valueController.getZoomOutEnabled());
+
+	%this.timeMoveForwardButton.setActive(%this.timeController.getMoveUpEnabled());
+	%this.timeMoveBackButton.setActive(%this.timeController.getMoveDownEnabled());
+	%this.timeZoomInButton.setActive(%this.timeController.getZoomInEnabled());
+	%this.timeZoomOutButton.setActive(%this.timeController.getZoomOutEnabled());
+}
+
+function AssetParticleGraphUnit::valueZoomIn(%this)
+{
+	%this.valueController.zoomIn();
+	%this.refreshCamera();
+}
+
+function AssetParticleGraphUnit::valueZoomOut(%this)
+{
+	%this.valueController.zoomOut();
+	%this.refreshCamera();
+}
+
+function AssetParticleGraphUnit::valueMoveUp(%this)
+{
+	%this.valueController.moveUp();
+	%this.refreshCamera();
+}
+
+function AssetParticleGraphUnit::valueMoveDown(%this)
+{
+	%this.valueController.moveDown();
+	%this.refreshCamera();
+}
+
+function AssetParticleGraphUnit::timeZoomIn(%this)
+{
+	%this.timeController.zoomIn();
+	%this.refreshCamera();
+}
+
+function AssetParticleGraphUnit::timeZoomOut(%this)
+{
+	%this.timeController.zoomOut();
+	%this.refreshCamera();
+}
+
+function AssetParticleGraphUnit::timeMoveBack(%this)
+{
+	%this.timeController.moveDown();
+	%this.refreshCamera();
+}
+
+function AssetParticleGraphUnit::timeMoveForward(%this)
+{
+	%this.timeController.moveUp();
+	%this.refreshCamera();
+}

+ 174 - 0
editor/AssetAdmin/ParticleEditor/NewParticleEmitterDialog.cs

@@ -0,0 +1,174 @@
+
+function NewParticleEmitterDialog::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("Image Asset", %width SPC 30);
+	%this.imageDropDown = %form.createDropDownItem(%item);
+	%this.populateImageDropDown();
+
+	%item = %form.addFormItem("Animation Asset", %width SPC 30);
+	%this.animationDropDown = %form.createDropDownItem(%item);
+	%this.populateAnimationDropDown();
+
+	%item = %form.addFormItem("Emitter Name", %width SPC 30);
+	%this.emitterNameBox = %form.createTextEditItem(%item);
+	%this.emitterNameBox.Command = %this.getId() @ ".Validate();";
+
+	%content.add(%form);
+
+	%this.cancelButton = new GuiButtonCtrl()
+	{
+		HorizSizing = "right";
+		VertSizing = "bottom";
+		Position = "478 160";
+		Extent = "100 30";
+		Text = "Cancel";
+		Command = %this.getID() @ ".onClose();";
+	};
+	ThemeManager.setProfile(%this.cancelButton, "buttonProfile");
+
+	%this.createButton = new GuiButtonCtrl()
+	{
+		HorizSizing = "right";
+		VertSizing = "bottom";
+		Position = "588 158";
+		Extent = "100 34";
+		Text = "Create";
+		Command = %this.getID() @ ".onCreate();";
+		Active = false;
+	};
+	ThemeManager.setProfile(%this.createButton, "primaryButtonProfile");
+
+	%content.add(%this.cancelButton);
+	%content.add(%this.createButton);
+}
+
+function NewParticleEmitterDialog::Validate(%this)
+{
+	%this.createButton.active = false;
+
+	%emitterName = %this.emitterNameBox.getText();
+
+	%imageAssetID = %this.imageDropDown.getText();
+	%animationAssetID = %this.animationDropDown.getText();
+
+	if(%emitterName !$= "" && (%imageAssetID $= "" || %animationAssetID $= ""))
+	{
+		%this.createButton.active = true;
+		return true;
+	}
+	return false;
+}
+
+function NewParticleEmitterDialog::onClose(%this)
+{
+	Canvas.popDialog(%this);
+}
+
+function NewParticleEmitterDialog::onCreate(%this)
+{
+	if(%this.validate())
+	{
+		%emitter = %this.parentAsset.createEmitter();
+		if(%emitter != 0)
+		{
+			%emitter.setEmitterName(%this.emitterNameBox.getText());
+
+			if(%this.imageDropDown.getText() !$= "")
+			{
+				%emitter.setImage(%this.imageDropDown.getText());
+			}
+			else
+			{
+				%emitter.setAnimation(%this.animationDropDown.getText());
+			}
+
+			%i = %this.parentAsset.getEmitterCount();
+			AssetAdmin.Inspector.titleDropDown.addItem("Emitter:" SPC %emitter.EmitterName);
+			AssetAdmin.Inspector.titleDropDown.setItemColor(%i, ThemeManager.activeTheme.color5);
+			AssetAdmin.Inspector.titleDropDown.setSelected(%i);
+			AssetAdmin.Inspector.onChooseParticleAsset(%this.parentAsset);
+		}
+		else
+		{
+			warn("NewParticleEmitterDialog::onCreate - No emitter created!");
+		}
+
+		%this.onClose();
+	}
+}
+
+function NewParticleEmitterDialog::onDropDownClosed(%this, %dropDown)
+{
+	if(%dropDown == %this.imageDropDown && %dropDown.getText() !$= "")
+	{
+		%this.animationDropDown.setSelected(0);
+	}
+	else if(%dropDown == %this.animationDropDown && %dropDown.getText() !$= "")
+	{
+		%this.imageDropDown.setSelected(0);
+	}
+
+	%this.validate();
+}
+
+function NewParticleEmitterDialog::populateImageDropDown(%this)
+{
+	%this.imageDropDown.clearItems();
+
+	%query = new AssetQuery();
+	AssetDatabase.findAllAssets(%query);
+	AssetDatabase.findAssetType(%query, "ImageAsset", true);
+
+	for(%i = 0; %i < %query.getCount(); %i++)
+	{
+		%assetID = %query.getAsset(%i);
+
+		if(!AssetDatabase.isAssetInternal(%assetID))
+		{
+			%this.imageDropDown.addItem(%assetID);
+		}
+	}
+	%query.delete();
+
+	%this.imageDropDown.sortByText();
+	%this.imageDropDown.insertItem(0, "");
+	%this.imageDropDown.setSelected(0);
+}
+
+function NewParticleEmitterDialog::populateAnimationDropDown(%this)
+{
+	%this.animationDropDown.clearItems();
+
+	%query = new AssetQuery();
+	AssetDatabase.findAllAssets(%query);
+	AssetDatabase.findAssetType(%query, "AnimationAsset", true);
+
+	for(%i = 0; %i < %query.getCount(); %i++)
+	{
+		%assetID = %query.getAsset(%i);
+
+		if(!AssetDatabase.isAssetInternal(%assetID))
+		{
+			%this.animationDropDown.addItem(%assetID);
+		}
+	}
+	%query.delete();
+
+	%this.animationDropDown.sortByText();
+	%this.animationDropDown.insertItem(0, "");
+	%this.animationDropDown.setSelected(0);
+}

+ 139 - 0
editor/AssetAdmin/ParticleEditor/ParticleGraphCameraController.cs

@@ -0,0 +1,139 @@
+
+function ParticleGraphCameraController::onAdd(%this)
+{
+	if(strstr(%this.fieldName, "Scale") > 0)
+	{
+		%this.asset.selectField(%this.fieldName);
+		if(%this.isTime)
+		{
+			%this.min = %this.asset.getMinTime();
+			%this.max = %this.asset.getMaxTime();
+		}
+		else
+		{
+			%this.min = %this.asset.getMinValue();
+			%this.max = %this.asset.getMaxValue();
+		}
+	}
+	else
+	{
+		%emitter = %this.asset.getEmitter(0);
+		%emitter.selectField(%this.fieldName);
+		if(%this.isTime)
+		{
+			%this.min = %emitter.getMinTime();
+			%this.max = %emitter.getMaxTime();
+		}
+		else
+		{
+			%this.min = %emitter.getMinValue();
+			%this.max = %emitter.getMaxValue();
+		}
+
+	}
+	%this.currentPosition = 0;
+
+	%this.zoomLevel[1] = 1;
+	%this.zoomCount = 1;
+	%this.currentZoomLevel = 1;
+
+	if(%this.max > 1)
+	{
+		%this.zoomLevel[2] = 10;
+		%this.zoomCount = 2;
+		%this.currentZoomLevel = 2;
+	}
+
+	if(%this.max > 10)
+	{
+		%this.zoomLevel[3] = 100;
+		%this.zoomCount = 3;
+	}
+
+	if(%this.max > 100)
+	{
+		%this.zoomLevel[4] = 1000;
+		%this.zoomCount = 4;
+	}
+
+	if(%this.max == 180 || %this.max == 360 || %this.max == 720)
+	{
+		%this.setupDegreeValue();
+	}
+}
+
+function ParticleGraphCameraController::setupDegreeValue(%this)
+{
+	%this.currentPosition = %this.min;
+
+	%this.zoomLevel[1] = 5;
+	%this.zoomLevel[2] = 30;
+	%this.zoomLevel[3] = 90;
+	%this.zoomLevel[4] = 360;
+	%this.zoomCount = 4;
+	%this.currentZoomLevel = 4;
+}
+
+function ParticleGraphCameraController::getCameraMin(%this)
+{
+	return %this.currentPosition;
+}
+
+function ParticleGraphCameraController::getCameraMax(%this)
+{
+	return %this.currentPosition + %this.zoomLevel[%this.currentZoomLevel];
+}
+
+function ParticleGraphCameraController::zoomIn(%this)
+{
+	%this.currentZoomLevel = mGetMax(%this.currentZoomLevel - 1, 1);
+}
+
+function ParticleGraphCameraController::zoomOut(%this)
+{
+	%this.currentZoomLevel = mGetMin(%this.currentZoomLevel + 1, %this.zoomCount);
+	%zoom = %this.zoomLevel[%this.currentZoomLevel];
+	%this.currentPosition = mFloor(%this.currentPosition / %zoom) * %zoom;
+
+	if((%this.currentPosition + %zoom) > %this.max)
+	{
+		%this.currentPosition = %this.max - %zoom;
+	}
+
+	if(%this.currentPosition < %this.min)
+	{
+		%this.currentPosition = %this.min;
+	}
+}
+
+function ParticleGraphCameraController::moveUp(%this)
+{
+	%zoom = %this.zoomLevel[%this.currentZoomLevel];
+	%this.currentPosition = mGetMin(%this.currentPosition + %zoom, %this.max - %zoom);
+}
+
+function ParticleGraphCameraController::moveDown(%this)
+{
+	%this.currentPosition = mGetMax(%this.currentPosition - %this.zoomLevel[%this.currentZoomLevel], %this.min);
+}
+
+function ParticleGraphCameraController::getMoveUpEnabled(%this)
+{
+	%zoom = %this.zoomLevel[%this.currentZoomLevel];
+	return (%this.currentPosition + %zoom) < %this.max;
+}
+
+function ParticleGraphCameraController::getMoveDownEnabled(%this)
+{
+	return %this.currentPosition > %this.min;
+}
+
+function ParticleGraphCameraController::getZoomInEnabled(%this)
+{
+	return %this.currentZoomLevel > 1;
+}
+
+function ParticleGraphCameraController::getZoomOutEnabled(%this)
+{
+	return %this.currentZoomLevel < %this.zoomCount;
+}

+ 4 - 0
editor/AssetAdmin/ParticleEditor/exec.cs

@@ -0,0 +1,4 @@
+exec("./AssetParticleGraphTool.cs");
+exec("./AssetParticleGraphUnit.cs");
+exec("./ParticleGraphCameraController.cs");
+exec("./NewParticleEmitterDialog.cs");

+ 8 - 0
editor/AssetAdmin/images/assetIcons.asset.taml

@@ -0,0 +1,8 @@
+<ImageAsset
+    AssetName="assetIcons"
+    ImageFile="assetIcons.png"
+    CellCountX="2"
+    CellCountY="2"
+    CellWidth="64"
+    CellHeight="64"
+	AssetInternal="1" />

BIN
editor/AssetAdmin/images/assetIcons.png


+ 13 - 0
editor/AssetAdmin/module.taml

@@ -0,0 +1,13 @@
+<ModuleDefinition
+	ModuleId="AssetAdmin"
+	VersionId="1"
+	Dependencies="EditorCore=1"
+	Description="Provides controls to view and edit assets."
+	ScriptFile="AssetAdmin.cs"
+	CreateFunction="create"
+	DestroyFunction="destroy">
+		<DeclaredAssets
+			Path="images"
+			Extension="asset.taml"
+			Recurse="true"/>
+</ModuleDefinition>

+ 106 - 0
editor/EditorConsole/EditorConsole.cs

@@ -0,0 +1,106 @@
+//-----------------------------------------------------------------------------
+// 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 EditorConsole::create(%this)
+{
+	%this.guiPage = EditorCore.RegisterEditor("Console", %this);
+
+	%this.consoleEntry = new GuiConsoleEditCtrl()
+	{
+		HorizSizing="width";
+		VertSizing="top";
+		Position="0 738";
+		Extent="1024 30";
+		minExtent="120 20";
+		AltCommand="EditorConsole.eval();";
+		MaxLength="255";
+		active = "1";
+	};
+	ThemeManager.setProfile(%this.consoleEntry, "textEditProfile");
+	%this.guiPage.add(%this.consoleEntry);
+
+	%this.scroller = new GuiScrollCtrl()
+	{
+		HorizSizing="width";
+		VertSizing="height";
+		Position="0 0";
+		Extent="1024 738";
+		MinExtent="220 200";
+		hScrollBar="alwaysOn";
+		vScrollBar="alwaysOn";
+		constantThumbHeight="0";
+		showArrowButtons="1";
+	};
+	ThemeManager.setProfile(%this.scroller, "scrollProfile");
+	ThemeManager.setProfile(%this.scroller, "thumbProfile", ThumbProfile);
+	ThemeManager.setProfile(%this.scroller, "trackProfile", TrackProfile);
+	ThemeManager.setProfile(%this.scroller, "scrollArrowProfile", ArrowProfile);
+	%this.guiPage.add(%this.scroller);
+
+	%this.consoleLog = new GuiConsole()
+	{
+		Position="0 0";
+		Extent="1024 738";
+		HorizSizing="width";
+		VertSizing="height";
+		Visible="1";
+	};
+	ThemeManager.setProfile(%this.consoleLog, "consoleProfile");
+	%this.scroller.add(%this.consoleLog);
+
+	EditorCore.FinishRegistration(%this.guiPage);
+}
+
+function EditorConsole::destroy(%this)
+{
+
+}
+
+function EditorConsole::open(%this)
+{
+	%this.scroller.scrollToBottom();
+	%this.consoleEntry.setFirstResponder();
+}
+
+function EditorConsole::close(%this)
+{
+
+}
+
+function EditorConsole::eval(%this)
+{
+	%text = trim(%this.consoleEntry.getValue());
+
+    if(strpos(%text, "(") == -1 && strpos(%text, "=") == -1 && strpos(%text, " ") == -1 && strpos(%text, "{") == -1 && strpos(%text, "}") == -1)
+    {
+        %text = %text @ "()";
+    }
+
+    %pos = strlen(%text) - 1;
+
+    if(strpos(%text, ";", %pos) == -1 && strpos(%text, "}") == -1)
+        %text = %text @ ";";
+
+    echo("==>" @ %text);
+    eval(%text);
+    %this.consoleEntry.setValue("");
+}

+ 8 - 0
editor/EditorConsole/module.taml

@@ -0,0 +1,8 @@
+<ModuleDefinition
+	ModuleId="EditorConsole"
+	VersionId="1"
+	Dependencies="EditorCore=1"
+	Description="Console for the Editor"
+	ScriptFile="EditorConsole.cs"
+	CreateFunction="create"
+	DestroyFunction="destroy" />

+ 38 - 0
editor/EditorCore/EditorButtonBar.cs

@@ -0,0 +1,38 @@
+
+function EditorButtonBar::addButton(%this, %click, %frame, %tooltip, %enabled)
+{
+	if(!isObject(%this.tool))
+	{
+		warn("EditorButtonBar::addButton: Cannot add a button without a tool to handle callback.");
+		return;
+	}
+
+	%button = new GuiButtonCtrl()
+	{
+		Class = "EditorIconButton";
+		Frame = %frame;
+		Position = "0 0";
+		Command = %this.tool.getId() @ "." @ %click @ "();";
+		Tooltip = %tooltip;
+		EnabledFunction = %enabled;
+	};
+	ThemeManager.setProfile(%button, "iconButtonProfile");
+	%this.add(%button);
+
+	if(%enabled !$= "")
+	{
+		%button.setActive(%this.tool.call(%enabled));
+	}
+}
+
+function EditorButtonBar::refreshEnabled(%this)
+{
+	for(%i = 0; %i < %this.getCount(); %i++)
+	{
+		%button = %this.getObject(%i);
+		if(%button.EnabledFunction !$= "")
+		{
+			%button.setActive(%this.tool.call(%button.EnabledFunction));
+		}
+	}
+}

+ 235 - 0
editor/EditorCore/EditorCore.cs

@@ -0,0 +1,235 @@
+//-----------------------------------------------------------------------------
+// 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::create( %this )
+{
+	exec("./Themes/ThemeManager.cs");
+	exec("./EditorDialog.cs");
+	exec("./EditorForm.cs");
+	exec("./EditorIconButton.cs");
+	exec("./EditorButtonBar.cs");
+
+	new ScriptObject(ThemeManager);
+
+	%this.initGui();
+
+	%this.editorKeyMap = new ActionMap();
+    %this.editorKeyMap.bindCmd( "keyboard", "ctrl tilde", "EditorCore.toggleEditor();", "");
+	%this.editorKeyMap.push();
+}
+
+//-----------------------------------------------------------------------------
+
+function EditorCore::destroy( %this )
+{
+}
+
+function EditorCore::initGui(%this)
+{
+	%this.baseGui = new GuiControl()
+	{
+		HorizSizing = width;
+		VertSizing = height;
+		Position = "0 0";
+		Extent = "1024 768";
+	};
+	ThemeManager.setProfile(%this.baseGui, "emptyProfile");
+
+	%this.menuBar = new GuiMenuBarCtrl()
+	{
+		new GuiMenuItemCtrl() {
+			Text = "Tools";
+
+			new GuiMenuItemCtrl() {
+				Text = "Close Tools";
+				Command = "EditorCore.close();";
+			};
+		};
+		new GuiMenuItemCtrl() {
+			Text = "Theme";
+
+			new GuiMenuItemCtrl() {
+				Text = "Construction Vest";
+				Radio = true;
+				IsOn = true;
+				Command = "ThemeManager.setTheme(0);";
+				Accelerator = "Ctrl 1";
+			};
+
+			new GuiMenuItemCtrl() {
+				Text = "Lab Coat";
+				Radio = true;
+				Command = "ThemeManager.setTheme(1);";
+				Accelerator = "Ctrl 2";
+			};
+
+			new GuiMenuItemCtrl() {
+				Text = "Forest Robe";
+				Radio = true;
+				Command = "ThemeManager.setTheme(2);";
+				Accelerator = "Ctrl 3";
+			};
+
+			new GuiMenuItemCtrl() {
+				Text = "Torque Suit";
+				Radio = true;
+				Command = "ThemeManager.setTheme(3);";
+				Accelerator = "Ctrl 4";
+			};
+		};
+	};
+	ThemeManager.setProfile(%this.menuBar, "menuBarProfile");
+	ThemeManager.setProfile(%this.menuBar, "menuProfile", "MenuProfile");
+	ThemeManager.setProfile(%this.menuBar, "menuItemProfile", "MenuItemProfile");
+	ThemeManager.setProfile(%this.menuBar, "menuContentProfile", "MenuContentProfile");
+	ThemeManager.setProfile(%this.menuBar, "scrollingPanelThumbProfile", "ThumbProfile");
+	ThemeManager.setProfile(%this.menuBar, "scrollingPanelArrowProfile", "ArrowProfile");
+	ThemeManager.setProfile(%this.menuBar, "scrollingPanelTrackProfile", "TrackProfile");
+
+	%this.baseGui.add(%this.menuBar);
+
+	%this.tabBook = new GuiTabBookCtrl()
+	{
+		Class = EditorCoreTabBook;
+		HorizSizing = width;
+		VertSizing = height;
+		Position = "0 26";
+		Extent = "1024 742";
+		TabPosition = top;
+		Core = %this;
+	};
+	ThemeManager.setProfile(%this.tabBook, "tabBookProfileTop");
+	ThemeManager.setProfile(%this.tabBook, "tabProfileTop", "TabProfile");
+
+	%this.baseGui.add(%this.tabBook);
+}
+
+function EditorCore::toggleEditor(%this)
+{
+    // Is the console awake?
+    if ( %this.baseGui.isAwake() )
+    {
+        // Yes, so deactivate it.
+        %this.close();
+        return;
+    }
+
+    // Activate it.
+    %this.open();
+}
+
+function EditorCore::open(%this)
+{
+	if ( $enableDirectInput )
+        deactivateKeyboard();
+
+    Canvas.pushDialog(%this.baseGui);
+
+	%this.tabBook.selectPage(0);
+}
+
+function EditorCore::close(%this)
+{
+	if ( $enableDirectInput )
+		activateKeyboard();
+	Canvas.popDialog(%this.baseGui);
+}
+
+function EditorCore::RegisterEditor(%this, %name, %editor)
+{
+	%this.page[%name] = new GuiTabPageCtrl()
+	{
+		HorizSizing = width;
+		VertSizing = height;
+		Position = "0 0";
+		Extent = "1024 768";
+		Text = %name;
+		Editor = %editor;
+	};
+	ThemeManager.setProfile(%this.page[%name], "tabPageProfile");
+
+	return %this.page[%name];
+}
+
+function EditorCore::FinishRegistration(%this, %page)
+{
+	%this.tabBook.add(%page);
+}
+
+function EditorCoreTabBook::onTabSelected(%this, %tabText)
+{
+	if(isObject(%this.openEditor))
+	{
+		%this.openEditor.close();
+	}
+	%this.Core.page[%tabText].Editor.open();
+	%this.openEditor = %this.Core.page[%tabText].Editor;
+}
+
+function EditorCore::findModuleOfPath(%this, %pathWithFile)
+{
+	%pathWithFile = makeFullPath(%pathWithFile);
+	%loadedModules = ModuleDatabase.findModules(false);
+
+	%chosenModSig = "";
+	for(%i = 0; %i < getWordCount(%loadedModules); %i++)
+	{
+		%mod = getWord(%loadedModules, %i);
+		%modPath = %this.flattenPath(%mod.ModulePath);
+
+		//Now compare the two paths to see if they go together
+		if(strPos(%pathWithFile, %modPath) != -1)
+		{
+			%chosenModSig = %mod.Signature;
+			break;
+		}
+	}
+
+	return %chosenModSig;
+}
+
+function EditorCore::flattenPath(%this, %path)
+{
+	%pen = 0;
+	for(%i = 0; %i < getUnitCount(%path, "/"); %i++)
+	{
+		%token = getUnit(%path, %i, "/");
+
+		if(%token $= "..")
+		{
+			%pen = mGetMax(%pen - 1, 0);
+		}
+		else
+		{
+			%token[%pen] = %token;
+			%pen++;
+		}
+	}
+
+	%result = %token[0];
+	for(%i = 1; %i <= %pen; %i++)
+	{
+		%result = %result @ "/" @ %token[%i];
+	}
+
+	return %result;
+}

+ 71 - 0
editor/EditorCore/EditorDialog.cs

@@ -0,0 +1,71 @@
+//-----------------------------------------------------------------------------
+// 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 EditorDialog::onAdd(%this)
+{
+	ThemeManager.setProfile(%this, "overlayProfile");
+
+	%this.window = new GuiWindowCtrl()
+	{
+		class = "EditorDialogWindow";
+		HorizSizing = "center";
+		VertSizing = "center";
+		Position = "0 0";
+		Extent = %this.dialogSize;
+		Text = %this.dialogText;
+		canClose = %this.dialogCanClose;
+		canMove = true;
+		CanMinimize = false;
+		CanMaximize = false;
+		titleHeight = 30;
+		dialog = %this;
+	};
+	ThemeManager.setProfile(%this.window, "windowProfile");
+	ThemeManager.setProfile(%this.window, "windowContentProfile", "contentProfile");
+	ThemeManager.setProfile(%this.window, "windowButtonProfile", "MinButtonProfile");
+	ThemeManager.setProfile(%this.window, "windowButtonProfile", "MaxButtonProfile");
+	ThemeManager.setProfile(%this.window, "windowButtonProfile", "CloseButtonProfile");
+	%this.add(%this.window);
+
+	%this.content = new GuiScrollCtrl()
+	{
+		HorizSizing = "width";
+		VertSizing = "height";
+		Position = "0 0";
+		Extent = (getWord(%this.dialogSize, 0) - 8) SPC (getWord(%this.dialogSize, 1) - 34);//we assume a 4 pixel border
+		hScrollBar = "dynamic";
+		vScrollBar = "dynamic";
+		constantThumbHeight="0";
+		showArrowButtons = 0;
+		scrollBarThickness = 16;
+	};
+	ThemeManager.setProfile(%this.content, "scrollingPanelProfile");
+	ThemeManager.setProfile(%this.content, "scrollingPanelThumbProfile", ThumbProfile);
+	ThemeManager.setProfile(%this.content, "scrollingPanelTrackProfile", TrackProfile);
+	ThemeManager.setProfile(%this.content, "scrollingPanelArrowProfile", ArrowProfile);
+	%this.window.add(%this.content);
+}
+
+function EditorDialogWindow::onClose(%this)
+{
+	%this.dialog.call("onClose");
+}

+ 184 - 0
editor/EditorCore/EditorForm.cs

@@ -0,0 +1,184 @@
+//-----------------------------------------------------------------------------
+// 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 EditorForm::onAdd(%this)
+{
+	ThemeManager.setProfile(%this, "emptyProfile");
+
+	%this.setCellSpacing("0 0");
+	%this.setCellModeX(Variable);
+	%this.setCellModeY(Variable);
+	%this.setMaxColCount(0);
+}
+
+function EditorForm::addFormItem(%this, %text, %size)
+{
+	%label = new GuiControl()
+	{
+		Extent = %size;
+		Text = %text;
+	};
+	ThemeManager.setProfile(%label, "labelProfile");
+	%this.add(%label);
+	return %label;
+}
+
+function EditorForm::createTextEditItem(%this, %label)
+{
+	%textEdit = new GuiTextEditCtrl()
+	{
+		Position = "10 16";
+		Extent = (getWord(%label.extent, 0) - 24) SPC 30;
+	};
+	ThemeManager.setProfile(%textEdit, "textEditProfile");
+	%label.add(%textEdit);
+	return %textEdit;
+}
+
+function EditorForm::createFileOpenItem(%this, %label, %filters, %dialogTitle)
+{
+	%textEdit = %this.createTextEditItem(%label);
+	%teWidth = getWord(%label.extent, 0) - 110;
+	%textEdit.setExtent(%teWidth, 30);
+
+	%button = new GuiButtonCtrl()
+	{
+		Position = (%teWidth + 20) SPC 16;
+		Extent = "76 30";
+		Text = "Find";
+		Command = %this.getID() @ ".getFilePath(\"" @ %filters @ "\", \"" @ %dialogTitle @ "\", " @ %textEdit.getID() @ ");";
+	};
+	ThemeManager.setProfile(%button, "buttonProfile");
+	%label.add(%button);
+
+	return %textEdit;
+}
+
+function EditorForm::getFilePath(%this, %filter, %title, %textEdit)
+{
+	%dialog = new OpenFileDialog()
+	{
+		Filters = %filter;
+		ChangePath = false;
+		MultipleFiles = false;
+		DefaultFile = "";
+		defaultPath = "./";
+		title = %title;
+	};
+	%result = %dialog.execute();
+
+	if ( %result )
+	{
+		%selectedFile = makeRelativePath(%dialog.fileName, getMainDotCsDir());
+		%textEdit.setText(%selectedFile);
+		%textEdit.setCursorPos(999999);//move it to the far right.
+	}
+	// Cleanup
+	%dialog.delete();
+
+	%this.postEvent("FileOpened", %textEdit);
+}
+
+function EditorForm::createFolderOpenItem(%this, %label, %dialogTitle)
+{
+	%textEdit = %this.createTextEditItem(%label);
+	%teWidth = getWord(%label.extent, 0) - 110;
+	%textEdit.setExtent(%teWidth, 30);
+
+	%button = new GuiButtonCtrl()
+	{
+		Position = (%teWidth + 20) SPC 16;
+		Extent = "76 30";
+		Text = "Select";
+		Command = %this.getID() @ ".getFolderPath(\"" @ %dialogTitle @ "\", " @ %textEdit.getID() @ ");";
+	};
+	ThemeManager.setProfile(%button, "buttonProfile");
+	%label.add(%button);
+
+	return %textEdit;
+}
+
+function EditorForm::getFolderPath(%this, %title, %textEdit)
+{
+	%dialog = new OpenFolderDialog()
+	{
+		Filters = "All Files|*.*";
+		ChangePath = false;
+		DefaultFile = "";
+		defaultPath = "./";
+		title = %title;
+	};
+	%result = %dialog.execute();
+
+	if ( %result )
+	{
+		%selectedFile = makeRelativePath(%dialog.fileName, getMainDotCsDir());
+		%textEdit.setText(%selectedFile);
+		%textEdit.setCursorPos(999999);//move it to the far right.
+	}
+	// Cleanup
+	%dialog.delete();
+
+	%this.postEvent("FolderOpened", %textEdit);
+}
+
+function EditorForm::createDropDownItem(%this, %label)
+{
+	%dropDown = new GuiDropDownCtrl()
+	{
+		class = "EditorFormDropDown";
+		Position = "10 17";
+		Extent = (getWord(%label.extent, 0) - 24) SPC 28;
+		ConstantThumbHeight=false;
+		ScrollBarThickness=12;
+		ShowArrowButtons=true;
+		Form = %this;
+	};
+	ThemeManager.setProfile(%dropDown, "dropDownProfile");
+	ThemeManager.setProfile(%dropDown, "dropDownItemProfile", "listBoxProfile");
+	ThemeManager.setProfile(%dropDown, "emptyProfile", "backgroundProfile");
+	ThemeManager.setProfile(%dropDown, "scrollingPanelProfile", "ScrollProfile");
+	ThemeManager.setProfile(%dropDown, "scrollingPanelThumbProfile", "ThumbProfile");
+	ThemeManager.setProfile(%dropDown, "scrollingPanelTrackProfile", "TrackProfile");
+	ThemeManager.setProfile(%dropDown, "scrollingPanelArrowProfile", "ArrowProfile");
+	%label.add(%dropDown);
+	return %dropDown;
+}
+
+function EditorForm::createCheckboxItem(%this, %label)
+{
+	%box = new GuiCheckBoxCtrl()
+	{
+		Position = "10 16";
+		Extent = (getWord(%label.extent, 0) - 24) SPC 30;
+		Text = %label.text;
+	};
+	ThemeManager.setProfile(%box, "checkboxProfile");
+	%label.add(%box);
+	%label.text = "";
+	return %box;
+}
+
+function EditorFormDropDown::onClose(%this)
+{
+	%this.form.postEvent("DropDownClosed", %this);
+}

+ 73 - 0
editor/EditorCore/EditorIconButton.cs

@@ -0,0 +1,73 @@
+
+function EditorIconButton::onAdd(%this)
+{
+	%this.text = "";
+	%this.extent = "24 24";
+	%this.icon = new GuiSpriteCtrl()
+	{
+		HorizSizing="center";
+		VertSizing="center";
+		Extent = "20 20";
+		minExtent = "20 20";
+		Position = "0 0";
+		constrainProportions = "1";
+		fullSize = "0";
+		Image = "EditorCore:EditorIcons16";
+		ImageSize = "18 18";
+		ImageColor = ThemeManager.activeTheme.iconButtonProfile.FontColor;
+		Frame = %this.frame;
+		Tooltip = %this.Tooltip;
+	};
+	ThemeManager.setProfile(%this.icon, "spriteProfile");
+	%this.add(%this.icon);
+
+	%this.startListening(ThemeManager);
+	if(%this.Tooltip !$= "")
+	{
+		ThemeManager.setProfile(%this, "tipProfile", "TooltipProfile");
+	}
+}
+
+function EditorIconButton::onTouchEnter(%this)
+{
+	%this.icon.fadeTo(ThemeManager.activeTheme.iconButtonProfile.fontColorHL, 200, "EaseInOut");
+	%this.icon.growTo("20 20", 200, "EaseInOut");
+}
+
+function EditorIconButton::onTouchLeave(%this)
+{
+	%this.icon.fadeTo(ThemeManager.activeTheme.iconButtonProfile.fontColor, 200, "EaseInOut");
+	%this.icon.growTo("18 18", 200, "EaseInOut");
+}
+
+function EditorIconButton::onTouchDown(%this)
+{
+	%this.icon.fadeTo(ThemeManager.activeTheme.iconButtonProfile.fontColorSL, 200, "EaseInOut");
+}
+
+function EditorIconButton::onTouchUp(%this)
+{
+	%this.icon.fadeTo(ThemeManager.activeTheme.iconButtonProfile.fontColorHL, 200, "EaseInOut");
+}
+
+function EditorIconButton::onActive(%this)
+{
+	%this.icon.fadeTo(ThemeManager.activeTheme.iconButtonProfile.fontColor, 200, "EaseInOut");
+}
+
+function EditorIconButton::onInactive(%this)
+{
+	%this.icon.fadeTo(ThemeManager.activeTheme.iconButtonProfile.fontColorNA, 200, "EaseInOut");
+}
+
+function EditorIconButton::onThemeChange(%this, %theme)
+{
+	if(%this.active)
+	{
+		%this.icon.setImageColor(ThemeManager.activeTheme.iconButtonProfile.fontColor);
+	}
+	else
+	{
+		%this.icon.setImageColor(ThemeManager.activeTheme.iconButtonProfile.fontColorNA);
+	}
+}

+ 1724 - 0
editor/EditorCore/Themes/BaseTheme/BaseTheme.cs

@@ -0,0 +1,1724 @@
+function BaseTheme::onAdd(%this)
+{
+	%this.init();
+
+	%this.emptyBorder = 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   = $color1;
+	    borderColorHL = AdjustColorValue($color1, 10);
+	    borderColorSL = AdjustColorValue($color1, 10);
+	    borderColorNA = SetColorAlpha($color1, 100);
+		//Default Padding
+		padding = 0;
+		paddingHL = 0;
+		paddingSL = 0;
+		paddingNA = 0;
+		//Default underfill
+		underfill = true;
+	};
+
+	%this.emptyProfile = 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 = %this.fontSize;
+		fontColor = %this.color4;
+		align = center;
+		vAlign = middle;
+
+		borderDefault = %this.emptyBorder;
+	};
+
+	%this.makeTipProfile();
+	%this.makeGeneralProfiles();
+	%this.makePanelProfile();
+	%this.makeItemSelectProfile();
+	%this.makeButtonProfile();
+	%this.makeIconButtonProfile();
+	%this.makePrimaryButtonProfile();
+	%this.makeCheckboxProfile();
+	%this.makeTabProfile();
+	%this.makeSmallTabProfile();
+	%this.makeTextEditProfile();
+	%this.makeScrollProfile();
+	%this.makeConsoleProfile();
+	%this.makeMenuProfile();
+	%this.makeDropDownProfile();
+	%this.makeWindowProfile();
+	%this.makeListBoxProfile();
+	%this.makeGraphProfile();
+}
+
+function BaseTheme::init(%this)
+{
+	%this.name = "Construction Vest";
+	//fonts and font sizes
+	%this.fontCount = 3;
+	%this.font[1] = "raleway";//Most common font
+	%this.font[2] = "black ops one";//Title fontType
+	%this.font[3] = "fira code semibold";//Code and console font
+	%this.fontDirectory = expandPath("^EditorCore/Themes/BaseTheme/Fonts");
+	%this.fontSize = 20;
+
+	%this.color1 = "10 10 10 255";//Most commonly used for backgrounds
+	%this.color2 = "70 70 70 255";//Normally used for things that stand off the background but are still background
+	%this.color3 = "120 120 120 255";//Text set on background
+	%this.color4 = "255 255 255 255";//Similar to color 3 but with more contrast
+	%this.color5 = "255 133 0 255";//Flavor color that mostly is used on objects during interaction
+
+	%this.borderSize = 3;
+}
+
+function BaseTheme::makeTipProfile(%this)
+{
+	%tipBorder = new GuiBorderProfile()
+	{
+		padding = 4;
+		border = 1;
+		borderColor = %this.color1;
+	};
+
+	%this.tipProfile = new GuiControlProfile()
+	{
+		fillColor = %this.setAlpha(%this.color3, 220);
+
+		fontType = %this.font[1];
+		fontDirectory = %this.fontDirectory;
+		fontSize = %this.fontSize - 2;
+		fontColor = %this.color1;
+
+		borderDefault = %tipBorder;
+	};
+}
+
+function BaseTheme::makeGeneralProfiles(%this)
+{
+	//Useful as a background
+	%this.overlayProfile = new GuiControlProfile()
+	{
+		fillColor = %this.setAlpha(%this.color1, 180);
+
+		fontType = %this.font[1];
+		fontDirectory = %this.fontDirectory;
+		fontSize = %this.fontSize - 2;
+		fontColor = %this.color4;
+	};
+
+	%simpleBorder = new GuiBorderProfile()
+	{
+		padding = 0;
+		border = %this.borderSize;
+		borderColor = %this.color5;
+	};
+	//A simple, well-rounded profile for text or containers
+	%this.simpleProfile = new GuiControlProfile()
+	{
+		fillColor = %this.color1;
+
+		fontType = %this.font[1];
+		fontDirectory = %this.fontDirectory;
+		fontSize = %this.fontSize - 2;
+		fontColor = %this.color4;
+		align = center;
+		vAlign = middle;
+
+		borderDefault = %simpleBorder;
+	};
+
+	%simpleBorder2 = new GuiBorderProfile()
+	{
+		padding = 10;
+		border = %this.borderSize;
+		borderColor = %this.color5;
+	};
+	//A simple, well-rounded profile for text or containers
+	%this.simpleProfile2 = new GuiControlProfile()
+	{
+		fillColor = %this.color1;
+
+		fontType = %this.font[1];
+		fontDirectory = %this.fontDirectory;
+		fontSize = %this.fontSize;
+		fontColor = %this.color4;
+		align = center;
+		vAlign = middle;
+
+		borderDefault = %simpleBorder2;
+	};
+
+	%infoBorder = new GuiBorderProfile()
+	{
+		padding = 10;
+		border = %this.borderSize;
+		borderColor = %this.setAlpha(%this.color4, 30);
+	};
+	//A simple, well-rounded profile for text or containers
+	%this.infoProfile = new GuiControlProfile()
+	{
+		fillColor = %this.color1;
+
+		fontType = %this.font[3];
+		fontDirectory = %this.fontDirectory;
+		fontSize = %this.fontSize;
+		fontColor = %this.color5;
+		align = left;
+		vAlign = top;
+
+		borderDefault = %infoBorder;
+	};
+
+	%this.spriteProfile = new GuiControlProfile()
+	{
+		fillColor = "0 0 0 0";
+		align = center;
+		vAlign = middle;
+
+		borderDefault = %this.emptyBorder;
+		useInput = false;
+	};
+}
+
+function BaseTheme::makePanelProfile(%this)
+{
+	%panelBorderH = new GuiBorderProfile()
+	{
+		padding = 10;
+		paddingHL = 10;
+		paddingSL = 10;
+		paddingNA = 10;
+	};
+
+	%panelBorderV = new GuiBorderProfile()
+	{
+		border = 1;
+		borderHL = 1;
+		borderSL = 1;
+		borderNA = 1;
+
+		borderColor = %this.adjustValue(%this.color3, -50);
+		borderColorHL = %this.adjustValue(%this.color3, -60);
+		borderColorSL = %this.adjustValue(%this.color3, -60);
+		borderColorNA = %this.adjustValue(%this.color3, -50);
+	};
+
+	%this.panelProfile = new GuiControlProfile()
+	{
+		fillColor = %this.color2;
+		fillColorHL = %this.adjustValue(%this.color2, 5);
+		fillColorSL = %this.adjustValue(%this.color2, 5);
+		fillColorNA = %this.setAlpha(%this.color2, 80);
+
+		fontType = %this.font[2];
+		fontDirectory = %this.fontDirectory;
+		fontSize = %this.fontSize - 1;
+		fontColor = %this.color5;
+		fontColorHL = %this.adjustValue(%this.color5, 10);
+		fontColorSL = %this.adjustValue(%this.color5, 20);
+		fontColorNA = %this.setAlpha(%this.color4, 100);
+		align = left;
+		vAlign = middle;
+
+		borderDefault = %panelBorderH;
+		borderTop = %panelBorderV;
+		borderBottom = %panelBorderV;
+	};
+
+	//Scrolling panel - a less space demanding scroll bar.
+	%this.scrollingPanelTrackProfile = new GuiControlProfile()
+	{
+		fillColor = %this.color2;
+		fillColorHL = %this.color2;
+		fillColorSL = %this.color2;
+		fillColorNA = %this.setAlpha(%this.color2, 50);
+	};
+
+	%thumbBorder = new GuiBorderProfile()
+	{
+		margin = 3;
+		marginHL = 3;
+		marginSL = 3;
+		paddingNA = 3;
+	};
+
+	%this.scrollingPanelThumbProfile = new GuiControlProfile()
+	{
+		fillColor = %this.color3;
+		fillColorHL = %this.adjustValue(%this.color3, 10);
+		fillColorSL = %this.color5;
+		fillColorNA = %this.setAlpha(%this.color3, 0);
+
+		borderRight = %thumbBorder;
+		borderLeft = %thumbBorder;
+	};
+
+	%buttonBorder = new GuiBorderProfile()
+	{
+		padding = 3;
+		paddingHL = 3;
+		paddingSL = 3;
+		paddingNA = 3;
+	};
+
+	%this.scrollingPanelArrowProfile = new GuiControlProfile()
+	{
+		fillColor = %this.color2;
+		fillColorHL = %this.color2;
+		fillColorSL = %this.color2;
+		fillColorNA = %this.setAlpha(%this.color2, 50);
+
+		fontType = %this.font[1];
+		fontDirectory = %this.fontDirectory;
+		fontColor = %this.color3;
+		fontColorHL = %this.adjustValue(%this.color3, 10);
+		fontColorSL = %this.color5;
+		fontColorNA = %this.setAlpha(%this.color3, 80);
+
+		borderDefault = %buttonBorder;
+	};
+	%this.scrollingPanelProfile = new GuiControlProfile()
+	{
+	    fillColor = %this.color1;
+	};
+}
+
+function BaseTheme::makeItemSelectProfile(%this)
+{
+	%buttonBorder = new GuiBorderProfile()
+	{
+		padding = %this.borderSize;
+		paddingHL = 0;
+		paddingSL = 0;
+		paddingNA = %this.borderSize;
+
+		border = 0;
+		borderHL = %this.borderSize;
+		borderSL = %this.borderSize;
+		borderNA = 0;
+
+		borderColor = "0 0 0 0";
+		borderColorHL = %this.setAlpha(%this.adjustValue(%this.color2, 10), 170);
+		borderColorSL = %this.setAlpha(%this.adjustValue(%this.color5, 10), 170);
+		borderColorNA = "0 0 0 0";
+
+		underfill = false;
+	};
+
+	%this.itemSelectProfile = new GuiControlProfile()
+	{
+		fillColor = %this.color2;
+		fillColorHL = %this.adjustValue(%this.color2, 10);
+		fillColorSL = %this.color3;
+		fillColorNA = %this.setAlpha(%this.color2, 80);
+
+		fontType = %this.font[2];
+		fontDirectory = %this.fontDirectory;
+		fontSize = %this.fontSize;
+		fontColor = %this.color4;
+		fontColorHL = %this.adjustValue(%this.color4, 10);
+		fontColorSL = %this.color1;
+		fontColorNA = %this.setAlpha(%this.color4, 100);
+		align = Center;
+
+		borderDefault = %buttonBorder;
+	};
+
+	%buttonBorder = new GuiBorderProfile()
+	{
+		padding = 0;
+		paddingHL = 0;
+		paddingSL = 0;
+		paddingNA = 0;
+
+		border = %this.borderSize;
+		borderHL = %this.borderSize;
+		borderSL = %this.borderSize;
+		borderNA = %this.borderSize;
+
+		borderColor = %this.setAlpha(%this.adjustValue(%this.color5, 10), 170);
+		borderColorHL = %this.setAlpha(%this.adjustValue(%this.color5, 15), 170);
+		borderColorSL = %this.setAlpha(%this.adjustValue(%this.color5, 10), 130);
+		borderColorNA = "0 0 0 0";
+
+		underfill = false;
+	};
+
+	%this.itemSelectedProfile = new GuiControlProfile()
+	{
+		fillColor = %this.color3;
+		fillColorHL = %this.adjustValue(%this.color3, 10);
+		fillColorSL = %this.color3;
+		fillColorNA = %this.setAlpha(%this.color2, 80);
+
+		fontType = %this.font[2];
+		fontDirectory = %this.fontDirectory;
+		fontSize = %this.fontSize;
+		fontColor = %this.color4;
+		fontColorHL = %this.adjustValue(%this.color4, 10);
+		fontColorSL = %this.color1;
+		fontColorNA = %this.setAlpha(%this.color4, 100);
+		align = Center;
+
+		borderDefault = %buttonBorder;
+	};
+}
+
+function BaseTheme::makeButtonProfile(%this)
+{
+	%borderLightH = new GuiBorderProfile()
+	{
+		padding = 4;
+		paddingHL = 4;
+		paddingSL = 4;
+		paddingNA = 4;
+
+		border = %this.borderSize;
+		borderHL = %this.borderSize;
+		borderSL = %this.borderSize;
+		borderNA = %this.borderSize;
+
+		borderColor = "255 255 255 80";
+		borderColorHL = "255 255 255 80";
+		borderColorSL = "0 0 0 80";
+		borderColorNA = "255 255 255 80";
+
+		underfill = true;
+	};
+
+	%borderLightV = new GuiBorderProfile()
+	{
+		border = %this.borderSize;
+		borderHL = %this.borderSize;
+		borderSL = %this.borderSize;
+		borderNA = %this.borderSize;
+
+		borderColor = "255 255 255 80";
+		borderColorHL = "255 255 255 80";
+		borderColorSL = "0 0 0 80";
+		borderColorNA = "255 255 255 80";
+
+		underfill = true;
+	};
+
+	%borderDarkH = new GuiBorderProfile()
+	{
+		padding = 4;
+		paddingHL = 4;
+		paddingSL = 4;
+		paddingNA = 4;
+
+		border = %this.borderSize;
+		borderHL = %this.borderSize;
+		borderSL = %this.borderSize;
+		borderNA = %this.borderSize;
+
+		borderColor = "0 0 0 80";
+		borderColorHL = "0 0 0 80";
+		borderColorSL = "255 255 255 80";
+		borderColorNA = "0 0 0 80";
+
+		underfill = true;
+	};
+
+	%borderDarkV = new GuiBorderProfile()
+	{
+		border = %this.borderSize;
+		borderHL = %this.borderSize;
+		borderSL = %this.borderSize;
+		borderNA = %this.borderSize;
+
+		borderColor = "0 0 0 80";
+		borderColorHL = "0 0 0 80";
+		borderColorSL = "255 255 255 80";
+		borderColorNA = "0 0 0 80";
+
+		underfill = true;
+	};
+
+	%this.buttonProfile = new GuiControlProfile()
+	{
+		fillColor = %this.color4;
+		fillColorHL = %this.adjustValue(%this.color4, 10);
+		fillColorSL = %this.color5;
+		fillColorNA = %this.setAlpha(%this.color4, 80);
+
+		fontType = %this.font[2];
+		fontDirectory = %this.fontDirectory;
+		fontSize = %this.fontSize;
+		fontColor = %this.color1;
+		fontColorHL = %this.adjustValue(%this.color1, 10);
+		fontColorSL = %this.color1;
+		fontColorNA = %this.setAlpha(%this.color1, 100);
+		align = center;
+		vAlign = middle;
+
+		borderLeft = %borderLightH;
+		borderRight = %borderDarkH;
+		borderTop = %borderLightV;
+		borderBottom = %borderDarkV;
+
+		canKeyFocus = true;
+		tab = true;
+	};
+}
+
+function BaseTheme::makeIconButtonProfile(%this)
+{
+	%borderLight = new GuiBorderProfile()
+	{
+		border = 2;
+		borderHL = 2;
+		borderSL = 2;
+		borderNA = 2;
+
+		borderColor = "255 255 255 80";
+		borderColorHL = "255 255 255 80";
+		borderColorSL = "0 0 0 80";
+		borderColorNA = "255 255 255 80";
+
+		underfill = true;
+	};
+
+	%borderDark = new GuiBorderProfile()
+	{
+		border = 2;
+		borderHL = 2;
+		borderSL = 2;
+		borderNA = 2;
+
+		borderColor = "0 0 0 80";
+		borderColorHL = "0 0 0 80";
+		borderColorSL = "255 255 255 80";
+		borderColorNA = "0 0 0 80";
+
+		underfill = true;
+	};
+
+	%this.iconButtonProfile = new GuiControlProfile()
+	{
+		fillColor = %this.color4;
+		fillColorHL = %this.adjustValue(%this.color4, 10);
+		fillColorSL = %this.color5;
+		fillColorNA = %this.setAlpha(%this.color4, 80);
+
+		fontColor = %this.color1;
+		fontColorHL = %this.adjustValue(%this.color1, 10);
+		fontColorSL = %this.color1;
+		fontColorNA = %this.setAlpha(%this.color1, 100);
+		align = center;
+		vAlign = middle;
+
+		borderLeft = %borderLight;
+		borderRight = %borderDark;
+		borderTop = %borderLight;
+		borderBottom = %borderDark;
+
+		canKeyFocus = true;
+		tab = true;
+	};
+}
+
+function BaseTheme::makePrimaryButtonProfile(%this)
+{
+	%borderLightH = new GuiBorderProfile()
+	{
+		padding = 4;
+		paddingHL = 4;
+		paddingSL = 4;
+		paddingNA = 4;
+
+		border = %this.borderSize;
+		borderHL = %this.borderSize;
+		borderSL = %this.borderSize;
+		borderNA = %this.borderSize;
+
+		borderColor = "255 255 255 80";
+		borderColorHL = "255 255 255 80";
+		borderColorSL = "0 0 0 80";
+		borderColorNA = "255 255 255 80";
+
+		underfill = true;
+	};
+
+	%borderLightV = new GuiBorderProfile()
+	{
+		border = %this.borderSize;
+		borderHL = %this.borderSize;
+		borderSL = %this.borderSize;
+		borderNA = %this.borderSize;
+
+		borderColor = "255 255 255 80";
+		borderColorHL = "255 255 255 80";
+		borderColorSL = "0 0 0 80";
+		borderColorNA = "255 255 255 80";
+
+		underfill = true;
+	};
+
+	%borderDarkH = new GuiBorderProfile()
+	{
+		padding = 4;
+		paddingHL = 4;
+		paddingSL = 4;
+		paddingNA = 4;
+
+		border = %this.borderSize;
+		borderHL = %this.borderSize;
+		borderSL = %this.borderSize;
+		borderNA = %this.borderSize;
+
+		borderColor = "0 0 0 80";
+		borderColorHL = "0 0 0 80";
+		borderColorSL = "255 255 255 80";
+		borderColorNA = "0 0 0 80";
+
+		underfill = true;
+	};
+
+	%borderDarkV = new GuiBorderProfile()
+	{
+		border = %this.borderSize;
+		borderHL = %this.borderSize;
+		borderSL = %this.borderSize;
+		borderNA = %this.borderSize;
+
+		borderColor = "0 0 0 80";
+		borderColorHL = "0 0 0 80";
+		borderColorSL = "255 255 255 80";
+		borderColorNA = "0 0 0 80";
+
+		underfill = true;
+	};
+
+	%this.primaryButtonProfile = new GuiControlProfile()
+	{
+		fillColor = %this.color5;
+		fillColorHL = %this.adjustValue(%this.color5, 10);
+		fillColorSL = %this.adjustValue(%this.color5, 15);
+		fillColorNA = %this.setAlpha(%this.color5, 80);
+
+		fontType = %this.font[2];
+		fontDirectory = %this.fontDirectory;
+		fontSize = %this.fontSize + 1;
+		fontColor = %this.color1;
+		fontColorHL = %this.adjustValue(%this.color1, 10);
+		fontColorSL = %this.color1;
+		fontColorNA = %this.setAlpha(%this.color1, 100);
+		align = center;
+		vAlign = middle;
+
+		borderLeft = %borderLightH;
+		borderRight = %borderDarkH;
+		borderTop = %borderLightV;
+		borderBottom = %borderDarkV;
+
+		canKeyFocus = true;
+		tab = true;
+	};
+}
+
+function BaseTheme::makeCheckboxProfile(%this)
+{
+	%borderLight = new GuiBorderProfile()
+	{
+		border = %this.borderSize;
+		borderHL = %this.borderSize;
+		borderSL = %this.borderSize;
+		borderNA = %this.borderSize;
+
+		borderColor = "255 255 255 80";
+		borderColorHL = "255 255 255 80";
+		borderColorSL = "0 0 0 80";
+		borderColorNA = "255 255 255 0";
+
+		underfill = true;
+	};
+
+	%borderDark = new GuiBorderProfile()
+	{
+		border = %this.borderSize;
+		borderHL = %this.borderSize;
+		borderSL = %this.borderSize;
+		borderNA = %this.borderSize;
+
+		borderColor = "0 0 0 80";
+		borderColorHL = "0 0 0 80";
+		borderColorSL = "255 255 255 80";
+		borderColorNA = "0 0 0 0";
+
+		underfill = true;
+	};
+
+	%this.checkboxProfile = new GuiControlProfile()
+	{
+		fillColor = %this.color4;
+		fillColorHL = %this.adjustValue(%this.color4, 10);
+		fillColorSL = %this.color5;
+		fillColorNA = %this.setAlpha(%this.color4, 80);
+
+		fontType = %this.font[2];
+		fontDirectory = %this.fontDirectory;
+		fontSize = %this.fontSize;
+		fontColor = %this.color4;
+		fontColorHL = %this.color5;
+		fontColorSL = %this.color4;
+		fontColorNA = %this.setAlpha(%this.color4, 100);
+		align = left;
+		vAlign = middle;
+
+		borderLeft = %borderLight;
+		borderRight = %borderDark;
+		borderTop = %borderLight;
+		borderBottom = %borderDark;
+
+		canKeyFocus = true;
+		tab = true;
+	};
+}
+
+function BaseTheme::makeTabProfile(%this)
+{
+	%tabBorderTop = new GuiBorderProfile()
+	{
+		margin = 2;
+		marginHL = 1;
+		marginSL = 0;
+		marginNA = 2;
+
+		border = 2;
+		borderHL = 2;
+		borderSL = 2;
+		borderNA = 2;
+
+		padding = 3;
+		paddingHL = 4;
+		paddingSL = 5;
+		paddingNA = 3;
+
+		borderColor = "255 255 255 90";
+		borderColorHL = "255 255 255 90";
+		borderColorSL = "255 255 255 90";
+		borderColorNA = "255 255 255 90";
+	};
+
+	%tabBorderTopAlt = new GuiBorderProfile()
+	{
+		margin = 2;
+		marginHL = 1;
+		marginSL = 0;
+		marginNA = 2;
+
+		border = 2;
+		borderHL = 2;
+		borderSL = 2;
+		borderNA = 2;
+
+		padding = 3;
+		paddingHL = 4;
+		paddingSL = 5;
+		paddingNA = 3;
+
+		borderColor = "0 0 0 90";
+		borderColorHL = "0 0 0 90";
+		borderColorSL = "0 0 0 90";
+		borderColorNA = "0 0 0 90";
+	};
+
+	%tabBorderLeft = new GuiBorderProfile()
+	{
+		margin = 2;
+		marginHL = 2;
+		marginSL = 2;
+		marginNA = 2;
+
+		border = 2;
+		borderHL = 2;
+		borderSL = 2;
+		borderNA = 2;
+
+		padding = 10;
+		paddingHL = 10;
+		paddingSL = 10;
+		paddingNA = 10;
+
+		borderColor = "255 255 255 90";
+		borderColorHL = "255 255 255 90";
+		borderColorSL = "255 255 255 90";
+		borderColorNA = "255 255 255 90";
+	};
+
+	%tabBorderRight = new GuiBorderProfile()
+	{
+		margin = 2;
+		marginHL = 2;
+		marginSL = 2;
+		marginNA = 2;
+
+		border = 2;
+		borderHL = 2;
+		borderSL = 2;
+		borderNA = 2;
+
+		padding = 10;
+		paddingHL = 10;
+		paddingSL = 10;
+		paddingNA = 10;
+
+		borderColor = "0 0 0 90";
+		borderColorHL = "0 0 0 90";
+		borderColorSL = "0 0 0 90";
+		borderColorNA = "0 0 0 90";
+	};
+
+	%tabBorderBottom = new GuiBorderProfile()
+	{
+		padding = 5;
+		paddingHL = 5;
+		paddingSL = 5;
+		paddingNA = 5;
+	};
+
+	%this.tabProfileTop = new GuiControlProfile ()
+	{
+		fillColor = %this.color3;
+		fillColorHL = %this.adjustValue(%this.color3, 10);
+		fillColorSL = %this.color5;
+		fillColorNA = %this.setAlpha(%this.color3, 150);
+
+		fontType = %this.font[2];
+		fontDirectory = %this.fontDirectory;
+		fontSize = %this.fontSize;
+		fontColor = %this.color4;
+		fontColorHL = %this.adjustValue(%this.color4, 10);
+		fontColorSL = %this.color1;
+		fontColorNA = %this.setAlpha(%this.color4, 100);
+		align = Center;
+		vAlign = Middle;
+
+		borderTop = %tabBorderTop;
+		borderLeft = %tabBorderLeft;
+		borderRight = %tabBorderRight;
+		borderBottom = %tabBorderBottom;
+	};
+
+	%this.tabProfileBottom = new GuiControlProfile ()
+	{
+		fillColor = %this.color3;
+		fillColorHL = %this.adjustValue(%this.color3, 10);
+		fillColorSL = %this.color5;
+		fillColorNA = %this.setAlpha(%this.color3, 150);
+
+		fontType = %this.font[2];
+		fontDirectory = %this.fontDirectory;
+		fontSize = %this.fontSize;
+		fontColor = %this.color4;
+		fontColorHL = %this.adjustValue(%this.color4, 10);
+		fontColorSL = %this.color1;
+		fontColorNA = %this.setAlpha(%this.color4, 100);
+		align = Center;
+
+		borderTop = %tabBorderBottom;
+		borderLeft = %tabBorderLeft;
+		borderRight = %tabBorderRight;
+		borderBottom = %tabBorderTopAlt;
+	};
+
+	%this.tabProfileLeft = new GuiControlProfile ()
+	{
+		fillColor = %this.color3;
+		fillColorHL = %this.adjustValue(%this.color3, 10);
+		fillColorSL = %this.color5;
+		fillColorNA = %this.setAlpha(%this.color3, 150);
+
+		fontType = %this.font[2];
+		fontDirectory = %this.fontDirectory;
+		fontSize = %this.fontSize;
+		fontColor = %this.color4;
+		fontColorHL = %this.adjustValue(%this.color4, 10);
+		fontColorSL = %this.color1;
+		fontColorNA = %this.setAlpha(%this.color4, 100);
+		align = Center;
+
+		borderTop = %tabBorderLeft;
+		borderLeft = %tabBorderTop;
+		borderRight = %tabBorderBottom;
+		borderBottom = %tabBorderRight;
+	};
+
+	%this.tabProfileRight = new GuiControlProfile ()
+	{
+		fillColor = %this.color3;
+		fillColorHL = %this.adjustValue(%this.color3, 10);
+		fillColorSL = %this.color5;
+		fillColorNA = %this.setAlpha(%this.color3, 150);
+
+		fontType = %this.font[2];
+		fontDirectory = %this.fontDirectory;
+		fontSize = %this.fontSize;
+		fontColor = %this.color4;
+		fontColorHL = %this.adjustValue(%this.color4, 10);
+		fontColorSL = %this.color1;
+		fontColorNA = %this.setAlpha(%this.color4, 100);
+		align = Center;
+
+		borderTop = %tabBorderLeft;
+		borderLeft = %tabBorderBottom;
+		borderRight = %tabBorderTopAlt;
+		borderBottom = %tabBorderRight;
+	};
+
+	%bookBorderBottom = new GuiBorderProfile()
+	{
+		margin = 0;
+		border = %this.borderSize;
+		borderColor = "0 0 0 150";
+		padding = 0;
+	};
+
+	%bookBorderDefault = new GuiBorderProfile()
+	{
+		padding = 5;
+	};
+
+	%this.tabBookProfileTop = new GuiControlProfile ()
+	{
+		borderDefault = %bookBorderDefault;
+		borderBottom = %bookBorderBottom;
+		fillcolor = %this.color2;
+	};
+
+	%this.tabBookProfileBottom = new GuiControlProfile ()
+	{
+		borderDefault = %bookBorderDefault;
+		borderTop = %bookBorderBottom;
+		fillcolor = %this.color2;
+	};
+
+	%this.tabBookProfileLeft = new GuiControlProfile ()
+	{
+		borderDefault = %bookBorderDefault;
+		borderRight = %bookBorderBottom;
+		fillcolor = %this.color2;
+	};
+
+	%this.tabBookProfileRight = new GuiControlProfile ()
+	{
+		borderDefault = %bookBorderDefault;
+		borderLeft = %bookBorderBottom;
+		fillcolor = %this.color2;
+	};
+
+	%this.tabPageProfile = new GuiControlProfile ()
+	{
+	    fillColor = %this.setAlpha(%this.color1, 150);
+	};
+}
+
+function BaseTheme::makeSmallTabProfile(%this)
+{
+	%tabBorder = new GuiBorderProfile()
+	{
+		margin = 1;
+		marginHL = 1;
+		marginSL = 0;
+		marginNA = 1;
+
+		border = 1;
+		borderHL = 1;
+		borderSL = 1;
+		borderNA = 1;
+
+		padding = 2;
+		paddingHL = 2;
+		paddingSL = 3;
+		paddingNA = 2;
+
+		borderColor = "0 0 0 90";
+		borderColorHL = "0 0 0 90";
+		borderColorSL = "255 255 255 90";
+		borderColorNA = "0 0 0 90";
+	};
+
+	%this.smallTabProfile = new GuiControlProfile ()
+	{
+		fillColor = %this.color3;
+		fillColorHL = %this.adjustValue(%this.color3, 10);
+		fillColorSL = %this.color5;
+		fillColorNA = %this.setAlpha(%this.color3, 150);
+
+		fontType = %this.font[3];
+		fontDirectory = %this.fontDirectory;
+		fontSize = %this.fontSize - 2;
+		fontColor = %this.color4;
+		fontColorHL = %this.adjustValue(%this.color4, 10);
+		fontColorSL = %this.color1;
+		fontColorNA = %this.setAlpha(%this.color4, 100);
+		align = Center;
+
+		borderDefault = %tabBorder;
+	};
+	%bookBorderDefault = new GuiBorderProfile()
+	{
+		padding = 0;
+		border = 1;
+		borderColor = "0 0 0 50";
+	};
+	%this.smallTabBookProfile = new GuiControlProfile ()
+	{
+		borderDefault = %bookBorderDefault;
+		fillcolor = %this.adjustValue(%this.color2, -10);
+	};
+}
+
+function BaseTheme::makeTextEditProfile(%this)
+{
+	%labelBorder = new GuiBorderProfile()
+	{
+		padding = 2;
+	};
+	%this.labelProfile = new GuiControlProfile()
+	{
+		fillColor = "0 0 0 0";
+
+		fontType = %this.font[2];
+		fontDirectory = %this.fontDirectory;
+		fontSize = %this.fontSize - 2;
+		fontColor = %this.color4;
+		align = "left";
+		vAlign = "top";
+
+		borderDefault = %labelBorder;
+	};
+
+	//border for text boxes never use the HL state.
+	%textBorderV = new GuiBorderProfile()
+	{
+		padding = 2;
+		paddingSL = 2;
+		paddingNA = 2;
+
+		border = %this.borderSize;
+		borderSL = %this.borderSize;
+		borderNA = %this.borderSize;
+
+		borderColor = %this.color3;
+		borderColorSL = %this.color5;
+		borderColorNA = %this.setAlpha(%this.color3, 100);
+	};
+
+	%textBorderH = new GuiBorderProfile()
+	{
+		padding = 10;
+		paddingSL = 10;
+		paddingNA = 10;
+
+		border = %this.borderSize;
+		borderSL = %this.borderSize;
+		borderNA = %this.borderSize;
+
+		borderColor = %this.color3;
+		borderColorSL = %this.color5;
+		borderColorNA = %this.setAlpha(%this.color3, 100);
+	};
+
+	%this.textEditProfile = new GuiControlProfile()
+	{
+		fillColor = %this.color4;
+		fillColorHL = %this.color5;//used for selected text
+		fillColorSL = %this.color4;
+		fillColorNA = %this.setAlpha(%this.color4, 80);
+
+		fontType = %this.font[3];
+		fontDirectory = %this.fontDirectory;
+		fontSize = %this.fontSize;
+		fontColor = %this.setAlpha(%this.color1, 220);
+		fontColorHL = %this.adjustValue(%this.color1, 10);
+		fontColorSL = %this.color1;
+		fontColorNA = %this.setAlpha(%this.color1, 100);
+		align = left;
+		cursorColor = %this.color1;
+
+		borderDefault = %textBorderV;
+		borderRight = %textBorderH;
+		borderLeft = %textBorderH;
+
+		tab = false;
+		canKeyFocus = true;
+		returnTab = true;
+		useInput = true;
+	};
+}
+
+function BaseTheme::makeScrollProfile(%this)
+{
+	%trackBorder = new GuiBorderProfile()
+	{
+		margin = 0;
+		padding = 0;
+		border = 0;
+	};
+
+	%this.trackProfile = 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 = %trackBorder;
+	};
+
+	%buttonBorderLT = new GuiBorderProfile()
+	{
+		padding = 3;
+		paddingHL = 2;
+		paddingSL = 2;
+		paddingNA = 3;
+
+		border = 1;
+		borderHL = 2;
+		borderSL = 2;
+		borderNA = 1;
+
+		borderColor = %this.adjustValue(%this.color3, 20);
+		borderColorHL = %this.adjustValue(%this.color3, 30);
+		borderColorSL = %this.adjustValue(%this.color5, 20);
+		borderColorNA = %this.setAlpha(%this.adjustValue(%this.color3, 20), 80);
+
+		underfill = true;
+	};
+
+	%buttonBorderRB = new GuiBorderProfile()
+	{
+		padding = 3;
+		paddingHL = 2;
+		paddingSL = 2;
+		paddingNA = 3;
+
+		border = 1;
+		borderHL = 2;
+		borderSL = 2;
+		borderNA = 1;
+
+		borderColor = %this.adjustValue(%this.color3, -20);
+		borderColorHL = %this.adjustValue(%this.color3, -10);
+		borderColorSL = %this.adjustValue(%this.color5, -20);
+		borderColorNA = %this.setAlpha(%this.adjustValue(%this.color3, -20), 80);
+
+		underfill = true;
+	};
+
+	%this.thumbProfile = new GuiControlProfile()
+	{
+		fillColor = %this.color3;
+		fillColorHL = %this.adjustValue(%this.color3, 10);
+		fillColorSL = %this.color5;
+		fillColorNA = %this.setAlpha(%this.color3, 80);
+
+		borderDefault = %buttonBorderLT;
+		borderRight = %buttonBorderRB;
+		borderBottom = %buttonBorderRB;
+	};
+
+	%this.scrollArrowProfile = 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 = %buttonBorderLT;
+		borderRight = %buttonBorderRB;
+		borderBottom = %buttonBorderRB;
+	};
+
+	%mainBorder = new GuiBorderProfile()
+	{
+		margin = 5;
+		padding = 5;
+		border = 3;
+		borderColor = %this.color5;
+	};
+	%this.scrollProfile = new GuiControlProfile()
+	{
+	    fillColor = %this.setAlpha(%this.color2, 180);
+
+		borderDefault = %mainBorder;
+	};
+}
+
+function BaseTheme::makeConsoleProfile(%this)
+{
+	%this.consoleProfile = new GuiControlProfile()
+	{
+		fontType = %this.font[3];
+		fontDirectory = %this.fontDirectory;
+		fontSize = %this.fontSize + 2;
+		fontColor = %this.color4; //Normal text
+		fontColorHL = %this.setAlpha(%this.color4, 140); //Warnings
+		fontColorNA = "255 0 0 255"; //Errors
+	};
+}
+
+function BaseTheme::makeMenuProfile(%this)
+{
+	%menuBarBorder = new GuiBorderProfile()
+	{
+		padding = 2;
+	};
+
+	%this.menuBarProfile = new GuiControlProfile()
+	{
+		fillColor = %this.adjustValue(%this.color1, -7);
+		canKeyFocus = true;
+		borderDefault = %menuBarBorder;
+	};
+
+	%menuBorder = new GuiBorderProfile()
+	{
+		margin = 2;
+		marginHL = 0;
+		marginSL = 0;
+		marginNA = 2;
+
+		border = 0;
+		borderHL = 2;
+		borderSL = 2;
+		borderNA = 0;
+
+		borderColorHL = "255 255 255 30";
+		borderColorSL = %this.color5;
+	};
+
+	%menuBottomBorder = new GuiBorderProfile()
+	{
+		paddingSL = 2;
+
+		margin = 2;
+		marginHL = 0;
+		marginSL = 0;
+		marginNA = 2;
+
+		border = 0;
+		borderHL = 2;
+		borderSL = 2;
+		borderNA = 0;
+
+		borderColorHL = "255 255 255 30";
+		borderColorSL = %this.color5;
+	};
+
+	%menuSideBorder = new GuiBorderProfile()
+	{
+		border = 0;
+		borderHL = 2;
+		borderSL = 2;
+		borderNA = 0;
+
+		padding = 10;
+		paddingHL = 8;
+		paddingSL = 8;
+		paddingNA = 10;
+
+		borderColorHL = "255 255 255 30";
+		borderColorSL = %this.color5;
+	};
+
+	%this.menuProfile = new GuiControlProfile()
+	{
+		fillColor = "0 0 0 0";
+		fillColorHL = "255 255 255 10";
+		fillColorSL = %this.adjustValue(%this.color5, -15);
+		fillColorNA = "0 0 0 0";
+
+		borderDefault = %menuBorder;
+		borderLeft = %menuSideBorder;
+		borderRight = %menuSideBorder;
+		borderBottom = %menuBottomBorder;
+
+		fontType = %this.font[3];
+		fontDirectory = %this.fontDirectory;
+		fontSize = %this.fontSize;
+
+		fontColor = %this.color4;
+		fontColorHL = %this.adjustValue(%this.color4, 10);
+		fontColorSL = %this.color4;
+		fontColorNA = %this.adjustValue(%this.color4, 100);
+
+		canKeyFocus = true;
+	};
+
+	%menuContentVertBorder = new GuiBorderProfile()
+	{
+		border = 2;
+		padding = 4;
+		borderColor = %this.color5;
+	};
+
+	%menuContentSideBorder = new GuiBorderProfile()
+	{
+		border = 2;
+		padding = 0;
+		borderColor = %this.color5;
+	};
+
+	%this.menuContentProfile = new GuiControlProfile()
+	{
+		fillColor = %this.adjustValue(%this.color1, -5);
+
+		borderDefault = %menuContentSideBorder;
+		borderTop = %menuContentVertBorder;
+		borderBottom = %menuContentVertBorder;
+	};
+
+	%menuItemBorderTop = new GuiBorderProfile()
+	{
+		padding = 6;
+		paddingHL = 6;
+		paddingSL = 0;
+		paddingNA = 6;
+
+		marginSL = 4;
+		borderSL = 1;
+		borderColorSL = "0 0 0 50";
+	};
+
+	%menuItemBorderBottom = new GuiBorderProfile()
+	{
+		padding = 6;
+		paddingHL = 6;
+		paddingSL = 0;
+		paddingNA = 6;
+
+		marginSL = 4;
+		borderSL = 1;
+		borderColorSL = "255 255 255 50";
+	};
+
+	%menuItemBorderSide = new GuiBorderProfile()
+	{
+		padding = 6;
+		paddingHL = 6;
+		paddingSL = 0;
+		paddingNA = 6;
+
+		marginSL = 0;
+		borderSL = 0;
+		paddingSL = 6;
+	};
+
+	%this.menuItemProfile = new GuiControlProfile()
+	{
+		fillColor = %this.adjustValue(%this.color1, -5);
+		fillColorHL = %this.adjustValue(%this.color5, -15);
+		fillColorNA = %this.color1;
+		align = left;
+
+		tab = false;
+		canKeyFocus = true;
+
+		fontType = %this.font[3];
+		fontDirectory = %this.fontDirectory;
+		fontSize = %this.fontSize;
+
+		fontColor = %this.color4;
+		fontColorHL = %this.adjustValue(%this.color4, 10);
+		fontColorNA = %this.setAlpha(%this.color4, 150);
+
+		borderDefault = %menuItemBorderSide;
+		borderTop = %menuItemBorderTop;
+		borderBottom = %menuItemBorderBottom;
+	};
+}
+
+function BaseTheme::makeDropDownProfile(%this)
+{
+	%borderLightH = new GuiBorderProfile()
+	{
+		padding = 4;
+		paddingHL = 4;
+		paddingSL = 4;
+		paddingNA = 4;
+
+		border = %this.borderSize;
+		borderHL = %this.borderSize;
+		borderSL = %this.borderSize;
+		borderNA = %this.borderSize;
+
+		borderColor = "255 255 255 80";
+		borderColorHL = "255 255 255 80";
+		borderColorSL = "0 0 0 80";
+		borderColorNA = "255 255 255 80";
+
+		underfill = true;
+	};
+
+	%borderLightV = new GuiBorderProfile()
+	{
+		border = %this.borderSize;
+		borderHL = %this.borderSize;
+		borderSL = %this.borderSize;
+		borderNA = %this.borderSize;
+
+		borderColor = "255 255 255 80";
+		borderColorHL = "255 255 255 80";
+		borderColorSL = "0 0 0 80";
+		borderColorNA = "255 255 255 80";
+
+		underfill = true;
+	};
+
+	%borderDarkH = new GuiBorderProfile()
+	{
+		padding = 4;
+		paddingHL = 4;
+		paddingSL = 4;
+		paddingNA = 4;
+
+		border = %this.borderSize;
+		borderHL = %this.borderSize;
+		borderSL = %this.borderSize;
+		borderNA = %this.borderSize;
+
+		borderColor = "0 0 0 80";
+		borderColorHL = "0 0 0 80";
+		borderColorSL = "255 255 255 80";
+		borderColorNA = "0 0 0 80";
+
+		underfill = true;
+	};
+
+	%borderDarkV = new GuiBorderProfile()
+	{
+		border = %this.borderSize;
+		borderHL = %this.borderSize;
+		borderSL = %this.borderSize;
+		borderNA = %this.borderSize;
+
+		borderColor = "0 0 0 80";
+		borderColorHL = "0 0 0 80";
+		borderColorSL = "255 255 255 80";
+		borderColorNA = "0 0 0 80";
+
+		underfill = true;
+	};
+
+	%this.DropDownProfile = new GuiControlProfile()
+	{
+		fillColor = %this.color4;
+		fillColorHL = %this.adjustValue(%this.color4, 10);
+		fillColorSL = %this.color5;
+		fillColorNA = %this.setAlpha(%this.color4, 80);
+
+		fontType = %this.font[3];
+		fontDirectory = %this.fontDirectory;
+		fontSize = %this.fontSize;
+		fontColor = %this.color1;
+		fontColorHL = %this.adjustValue(%this.color1, 10);
+		fontColorSL = %this.color1;
+		fontColorNA = %this.setAlpha(%this.color1, 100);
+		align = left;
+		vAlign = middle;
+
+		borderLeft = %borderLightH;
+		borderRight = %borderDarkH;
+		borderTop = %borderLightV;
+		borderBottom = %borderDarkV;
+
+		canKeyFocus = true;
+		tab = true;
+	};
+
+	%borderItem = new GuiBorderProfile()
+	{
+		margin = 1;
+		marginHL = 1;
+		marginSL = 0;
+		marginNA = 1;
+
+		padding = 3;
+		paddingHL = 3;
+		paddingSL = 4;
+		paddingNA = 3;
+
+		border = 1;
+		borderHL = 1;
+		borderSL = 1;
+		borderNA = 1;
+
+		borderColor = %this.setAlpha(%this.color4, 80);
+		borderColorHL = %this.setAlpha(%this.color4, 80);
+		borderColorSL = %this.setAlpha(%this.color4, 150);
+		borderColorNA = %this.setAlpha(%this.color4, 40);
+
+		underfill = true;
+	};
+
+	%this.DropDownItemProfile = new GuiControlProfile()
+	{
+		fillColor = %this.color1;
+	    fillColorHL = AdjustColorValue(%this.color1, 10);
+	    fillColorSL = %this.color5;
+	    fillColorNA = SetColorAlpha(%this.color1, 100);
+
+		fontType = %this.font[3];
+		fontDirectory = %this.fontDirectory;
+		fontSize = %this.fontSize;
+		fontColor = %this.color4;
+		fontColorHL = %this.adjustValue(%this.color4, 10);
+		fontColorSL = %this.color1;
+		fontColorNA = %this.setAlpha(%this.color4, 100);
+		align = left;
+		vAlign = middle;
+
+		borderDefault = %borderItem;
+
+		tab = false;
+		canKeyFocus = true;
+	};
+}
+
+function BaseTheme::makeWindowProfile(%this)
+{
+	%windowBorderL = new GuiBorderProfile()
+	{
+		padding = 10;
+		paddingHL = 10;
+		paddingSL = 10;
+		paddingNA = 4;
+
+		border = 1;
+		borderHL = 1;
+		borderSL = 1;
+		borderNA = 1;
+
+		borderColor = %this.adjustValue(%this.color3, -50);
+		borderColorHL = %this.adjustValue(%this.color3, -60);
+		borderColorSL = %this.adjustValue(%this.color3, -60);
+		borderColorNA = %this.adjustValue(%this.color3, -50);
+	};
+
+	%windowBorderR = new GuiBorderProfile()
+	{
+		border = 1;
+		borderHL = 1;
+		borderSL = 1;
+		borderNA = 1;
+
+		borderColor = %this.adjustValue(%this.color3, -50);
+		borderColorHL = %this.adjustValue(%this.color3, -60);
+		borderColorSL = %this.adjustValue(%this.color3, -60);
+		borderColorNA = %this.adjustValue(%this.color3, -50);
+	};
+
+	%windowBorderV = new GuiBorderProfile()
+	{
+		border = 1;
+		borderHL = 1;
+		borderSL = 1;
+		borderNA = 1;
+
+		borderColor = %this.adjustValue(%this.color3, -50);
+		borderColorHL = %this.adjustValue(%this.color3, -60);
+		borderColorSL = %this.adjustValue(%this.color3, -60);
+		borderColorNA = %this.adjustValue(%this.color3, -50);
+	};
+
+	%this.windowProfile = new GuiControlProfile()
+	{
+		fillColor = %this.color2;
+		fillColorHL = %this.adjustValue(%this.color2, 1);
+		fillColorSL = %this.adjustValue(%this.color2, 5);
+		fillColorNA = %this.color2;
+
+		fontType = %this.font[2];
+		fontDirectory = %this.fontDirectory;
+		fontSize = %this.fontSize - 1;
+		fontColor = %this.color5;
+		fontColorHL = %this.adjustValue(%this.color5, 2);
+		fontColorSL = %this.adjustValue(%this.color5, 4);
+		fontColorNA = %this.color5;
+		align = left;
+		vAlign = middle;
+
+		borderLeft = %windowBorderL;
+		borderRight = %windowBorderR;
+		borderTop = %windowBorderV;
+		borderBottom = %windowBorderV;
+	};
+
+	%windowContentBorder = new GuiBorderProfile()
+	{
+		border = 3;
+		borderHL = 3;
+		borderSL = 3;
+		borderNA = 3;
+
+		borderColor = %this.adjustValue(%this.color3, -50);
+		borderColorHL = %this.adjustValue(%this.color3, -60);
+		borderColorSL = %this.adjustValue(%this.color3, -60);
+		borderColorNA = %this.adjustValue(%this.color3, -50);
+
+		padding = 1;
+		paddingHL = 1;
+		paddingSL = 1;
+		paddingNA = 1;
+	};
+
+	%this.windowContentProfile = new GuiControlProfile()
+	{
+		fillColor = %this.color1;
+		fillColorSL = %this.adjustValue(%this.color1, 5);
+
+		borderLeft = %windowContentBorder;
+		borderRight = %windowContentBorder;
+		borderTop = %this.emptyBorder;
+		borderBottom = %windowContentBorder;
+	};
+
+	%windowButtonBorder = new GuiBorderProfile()
+	{
+		margin = 3;
+		marginHL = 3;
+		marginSL = 3;
+		marginNA = 3;
+
+		padding = 3;
+		paddingHL = 3;
+		paddingSL = 3;
+		paddingNA = 3;
+	};
+
+	%this.windowButtonProfile = new GuiControlProfile()
+	{
+		fillColor = %this.color3;
+		fillColorHL = %this.adjustValue(%this.color3, 10);
+		fillColorSL = %this.color5;
+		fillColorNA = %this.color3;
+
+		fontColor = %this.color1;
+		fontColorHL = %this.color1;
+		fontColorSL = %this.color1;
+		fontColorNA = %this.color1;
+
+		borderDefault = %windowButtonBorder;
+	};
+}
+
+function BaseTheme::makeListBoxProfile(%this)
+{
+	%borderProfile = new GuiBorderProfile()
+	{
+		margin = 1;
+		marginHL = 1;
+		marginSL = 1;
+		marginNA = 1;
+
+		padding = 4;
+		paddingHL = 4;
+		paddingSL = 4;
+		paddingNA = 4;
+	};
+
+	%this.listBoxProfile = new GuiControlProfile ()
+	{
+	    // fill color
+	    fillColor = %this.adjustValue(%this.color1, 2);
+	    fillColorHL = %this.adjustValue(%this.color1, 4);
+	    fillColorSL = %this.color5;
+	    fillColorNA = %this.setAlpha(%this.color1, 150);
+		align = left;
+
+		tab = false;
+		canKeyFocus = true;
+
+		fontType = %this.font[3];
+		fontDirectory = %this.fontDirectory;
+		fontSize = %this.fontSize;
+		fontColor = %this.color4;
+		fontColorHL = %this.adjustValue(%this.color4, 20);
+		fontColorSL = %this.adjustValue(%this.color1, 2);
+		fontColorNA = %this.adjustValue(%this.color4, -30);
+
+		borderDefault = %borderProfile;
+	};
+}
+
+function BaseTheme::makeGraphProfile(%this)
+{
+	%border = new GuiBorderProfile()
+	{
+		padding = 4;
+		border = %this.borderSize;
+		borderColor = %this.color3; //Used for the border as normal
+	};
+
+	%this.graphProfile = new GuiControlProfile()
+	{
+		fillColor = %this.color2; //Used for the background of the control as normal
+		fillColorHL = %this.setAlpha(%this.color3, 220); //Used for the grid and labels
+		fillColorSL = %this.color5; //Used for the lines of the control
+		fillColorNA = %this.setAlpha(%this.color5, 100); //Used for the variance when it is displayed
+
+		fontType = %this.font[3];
+		fontDirectory = %this.fontDirectory;
+		fontSize = %this.fontSize - 2;
+		fontColor = %this.color4; //Used for the points
+		fontColorHL = %this.adjustValue(%this.color4, 10); //Used for the points when they are hovered over
+		fontColorSL = %this.adjustValue(%this.color5, 10); //Used for the selected points
+
+		borderDefault = %border;
+	};
+}
+
+//Positive values are brighter, negative are darker
+function BaseTheme::adjustValue(%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 BaseTheme::setAlpha(%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));
+}

BIN
editor/EditorCore/Themes/BaseTheme/fonts/black ops one 12 (ansi).uft


BIN
editor/EditorCore/Themes/BaseTheme/fonts/black ops one 14 (ansi).uft


BIN
editor/EditorCore/Themes/BaseTheme/fonts/black ops one 16 (ansi).uft


BIN
editor/EditorCore/Themes/BaseTheme/fonts/black ops one 18 (ansi).uft


BIN
editor/EditorCore/Themes/BaseTheme/fonts/black ops one 19 (ansi).uft


BIN
editor/EditorCore/Themes/BaseTheme/fonts/black ops one 20 (ansi).uft


BIN
editor/EditorCore/Themes/BaseTheme/fonts/black ops one 24 (ansi).uft


BIN
editor/EditorCore/Themes/BaseTheme/fonts/fira code semibold 12 (ansi).uft


BIN
editor/EditorCore/Themes/BaseTheme/fonts/fira code semibold 14 (ansi).uft


BIN
editor/EditorCore/Themes/BaseTheme/fonts/fira code semibold 16 (ansi).uft


BIN
editor/EditorCore/Themes/BaseTheme/fonts/fira code semibold 18 (ansi).uft


BIN
editor/EditorCore/Themes/BaseTheme/fonts/fira code semibold 20 (ansi).uft


BIN
editor/EditorCore/Themes/BaseTheme/fonts/fira code semibold 22 (ansi).uft


BIN
editor/EditorCore/Themes/BaseTheme/fonts/fira code semibold 24 (ansi).uft


BIN
editor/EditorCore/Themes/BaseTheme/fonts/raleway 12 (ansi).uft


BIN
editor/EditorCore/Themes/BaseTheme/fonts/raleway 14 (ansi).uft


BIN
editor/EditorCore/Themes/BaseTheme/fonts/raleway 16 (ansi).uft


BIN
editor/EditorCore/Themes/BaseTheme/fonts/raleway 18 (ansi).uft


BIN
editor/EditorCore/Themes/BaseTheme/fonts/raleway 20 (ansi).uft


BIN
editor/EditorCore/Themes/BaseTheme/fonts/raleway 24 (ansi).uft


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

@@ -0,0 +1,19 @@
+function ForestRobeTheme::init(%this)
+{
+	%this.name = "Forest Robe";
+	//fonts and font sizes
+	%this.fontCount = 3;
+	%this.font[1] = "raleway";//Most common font
+	%this.font[2] = "cinzel decorative bold";//Title fontType
+	%this.font[3] = "fira code semibold";//Code and console font
+	%this.fontDirectory = expandPath("^EditorCore/Themes/ForestRobe/Fonts");
+	%this.fontSize = 20;
+
+	%this.color1 = "43 53 66 255";
+	%this.color2 = "48 88 84 255";
+	%this.color3 = "85 138 132 255";
+	%this.color4 = "240 207 196 255";
+	%this.color5 = "216 114 107 255";
+
+	%this.borderSize = 3;
+}

BIN
editor/EditorCore/Themes/ForestRobe/fonts/cinzel decorative bold 12 (ansi).uft


BIN
editor/EditorCore/Themes/ForestRobe/fonts/cinzel decorative bold 14 (ansi).uft


BIN
editor/EditorCore/Themes/ForestRobe/fonts/cinzel decorative bold 16 (ansi).uft


BIN
editor/EditorCore/Themes/ForestRobe/fonts/cinzel decorative bold 18 (ansi).uft


BIN
editor/EditorCore/Themes/ForestRobe/fonts/cinzel decorative bold 19 (ansi).uft


BIN
editor/EditorCore/Themes/ForestRobe/fonts/cinzel decorative bold 20 (ansi).uft


BIN
editor/EditorCore/Themes/ForestRobe/fonts/cinzel decorative bold 24 (ansi).uft


BIN
editor/EditorCore/Themes/ForestRobe/fonts/fira code semibold 12 (ansi).uft


BIN
editor/EditorCore/Themes/ForestRobe/fonts/fira code semibold 14 (ansi).uft


BIN
editor/EditorCore/Themes/ForestRobe/fonts/fira code semibold 16 (ansi).uft


BIN
editor/EditorCore/Themes/ForestRobe/fonts/fira code semibold 18 (ansi).uft


BIN
editor/EditorCore/Themes/ForestRobe/fonts/fira code semibold 20 (ansi).uft


BIN
editor/EditorCore/Themes/ForestRobe/fonts/fira code semibold 22 (ansi).uft


BIN
editor/EditorCore/Themes/ForestRobe/fonts/fira code semibold 24 (ansi).uft


BIN
editor/EditorCore/Themes/ForestRobe/fonts/raleway 12 (ansi).uft


BIN
editor/EditorCore/Themes/ForestRobe/fonts/raleway 14 (ansi).uft


BIN
editor/EditorCore/Themes/ForestRobe/fonts/raleway 16 (ansi).uft


BIN
editor/EditorCore/Themes/ForestRobe/fonts/raleway 18 (ansi).uft


BIN
editor/EditorCore/Themes/ForestRobe/fonts/raleway 20 (ansi).uft


BIN
editor/EditorCore/Themes/ForestRobe/fonts/raleway 24 (ansi).uft


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

@@ -0,0 +1,163 @@
+function LabCoatTheme::init(%this)
+{
+	%this.name = "Lab Coat";
+	//fonts and font sizes
+	%this.fontCount = 3;
+	%this.font[1] = "roboto";//Most common font
+	%this.font[2] = "zen dots";//Title fontType
+	%this.font[3] = "share tech mono";//Code and console font
+	%this.fontDirectory = expandPath("^EditorCore/Themes/LabCoat/Fonts");
+	%this.fontSize = 20;
+
+	%this.color1 = "255 255 255 255";
+	%this.color2 = "203 217 222 255";
+	%this.color3 = "142 157 161 255";
+	%this.color4 = "33 33 46 255";
+	%this.color5 = "16 162 235 255";
+
+	%this.borderSize = 2;
+}
+
+function LabCoatTheme::makePanelProfile(%this)
+{
+	%panelBorderH = new GuiBorderProfile()
+	{
+		padding = 10;
+		paddingHL = 10;
+		paddingSL = 10;
+		paddingNA = 10;
+	};
+
+	%panelBorderV = new GuiBorderProfile()
+	{
+		border = 1;
+		borderHL = 1;
+		borderSL = 1;
+		borderNA = 1;
+
+		borderColor = %this.adjustValue(%this.color3, -50);
+		borderColorHL = %this.adjustValue(%this.color3, -60);
+		borderColorSL = %this.adjustValue(%this.color3, -60);
+		borderColorNA = %this.adjustValue(%this.color3, -50);
+	};
+
+	%this.panelProfile = new GuiControlProfile()
+	{
+		fillColor = %this.color2;
+		fillColorHL = %this.adjustValue(%this.color2, 5);
+		fillColorSL = %this.adjustValue(%this.color2, 5);
+		fillColorNA = %this.setAlpha(%this.color2, 80);
+
+		fontType = %this.font[2];
+		fontDirectory = %this.fontDirectory;
+		fontSize = %this.fontSize - 1;
+		fontColor = %this.color5;
+		fontColorHL = %this.adjustValue(%this.color5, 10);
+		fontColorSL = %this.adjustValue(%this.color5, 20);
+		fontColorNA = %this.setAlpha(%this.color4, 100);
+		align = left;
+		vAlign = middle;
+
+		imageAsset="EditorCore:labCoatBanner1";
+
+		borderDefault = %panelBorderH;
+		borderTop = %panelBorderV;
+		borderBottom = %panelBorderV;
+	};
+
+	//Scrolling panel - a less space demanding scroll bar.
+	%this.scrollingPanelTrackProfile = new GuiControlProfile()
+	{
+		fillColor = %this.color2;
+		fillColorHL = %this.color2;
+		fillColorSL = %this.color2;
+		fillColorNA = %this.setAlpha(%this.color2, 50);
+	};
+
+	%thumbBorder = new GuiBorderProfile()
+	{
+		margin = 3;
+		marginHL = 3;
+		marginSL = 3;
+		paddingNA = 3;
+	};
+
+	%this.scrollingPanelThumbProfile = new GuiControlProfile()
+	{
+		fillColor = %this.color3;
+		fillColorHL = %this.adjustValue(%this.color3, 10);
+		fillColorSL = %this.color5;
+		fillColorNA = %this.setAlpha(%this.color3, 0);
+
+		borderRight = %thumbBorder;
+		borderLeft = %thumbBorder;
+	};
+
+	%buttonBorder = new GuiBorderProfile()
+	{
+		padding = 3;
+		paddingHL = 3;
+		paddingSL = 3;
+		paddingNA = 3;
+	};
+
+	%this.scrollingPanelArrowProfile = new GuiControlProfile()
+	{
+		fillColor = %this.color2;
+		fillColorHL = %this.color2;
+		fillColorSL = %this.color2;
+		fillColorNA = %this.setAlpha(%this.color2, 50);
+
+		fontType = %this.font[1];
+		fontDirectory = %this.fontDirectory;
+		fontColor = %this.color3;
+		fontColorHL = %this.adjustValue(%this.color3, 10);
+		fontColorSL = %this.color5;
+		fontColorNA = %this.setAlpha(%this.color3, 80);
+
+		borderDefault = %buttonBorder;
+	};
+	%this.scrollingPanelProfile = new GuiControlProfile()
+	{
+	    fillColor = %this.color1;
+	};
+}
+
+function LabCoatTheme::makeListBoxProfile(%this)
+{
+	%borderProfile = new GuiBorderProfile()
+	{
+		margin = 1;
+		marginHL = 1;
+		marginSL = 1;
+		marginNA = 1;
+
+		padding = 4;
+		paddingHL = 4;
+		paddingSL = 4;
+		paddingNA = 4;
+	};
+
+	%this.listBoxProfile = new GuiControlProfile ()
+	{
+	    // fill color
+	    fillColor = %this.adjustValue(%this.color1, -10);
+	    fillColorHL = %this.adjustValue(%this.color1, -15);
+	    fillColorSL = %this.color5;
+	    fillColorNA = %this.setAlpha(%this.color1, 150);
+		align = left;
+
+		tab = false;
+		canKeyFocus = true;
+
+		fontType = %this.font[3];
+		fontDirectory = %this.fontDirectory;
+		fontSize = %this.fontSize;
+		fontColor = %this.color4;
+		fontColorHL = %this.adjustValue(%this.color4, -10);
+		fontColorSL = %this.adjustValue(%this.color1, -2);
+		fontColorNA = %this.adjustValue(%this.color4, 30);
+
+		borderDefault = %borderProfile;
+	};
+}

BIN
editor/EditorCore/Themes/LabCoat/fonts/roboto 12 (ansi).uft


BIN
editor/EditorCore/Themes/LabCoat/fonts/roboto 14 (ansi).uft


BIN
editor/EditorCore/Themes/LabCoat/fonts/roboto 16 (ansi).uft


BIN
editor/EditorCore/Themes/LabCoat/fonts/roboto 18 (ansi).uft


BIN
editor/EditorCore/Themes/LabCoat/fonts/roboto 20 (ansi).uft


BIN
editor/EditorCore/Themes/LabCoat/fonts/roboto 24 (ansi).uft


BIN
editor/EditorCore/Themes/LabCoat/fonts/share tech mono 12 (ansi).uft


BIN
editor/EditorCore/Themes/LabCoat/fonts/share tech mono 14 (ansi).uft


BIN
editor/EditorCore/Themes/LabCoat/fonts/share tech mono 16 (ansi).uft


BIN
editor/EditorCore/Themes/LabCoat/fonts/share tech mono 18 (ansi).uft


BIN
editor/EditorCore/Themes/LabCoat/fonts/share tech mono 20 (ansi).uft


BIN
editor/EditorCore/Themes/LabCoat/fonts/share tech mono 22 (ansi).uft


BIN
editor/EditorCore/Themes/LabCoat/fonts/share tech mono 24 (ansi).uft


BIN
editor/EditorCore/Themes/LabCoat/fonts/zen dots 12 (ansi).uft


BIN
editor/EditorCore/Themes/LabCoat/fonts/zen dots 14 (ansi).uft


BIN
editor/EditorCore/Themes/LabCoat/fonts/zen dots 16 (ansi).uft


BIN
editor/EditorCore/Themes/LabCoat/fonts/zen dots 18 (ansi).uft


BIN
editor/EditorCore/Themes/LabCoat/fonts/zen dots 19 (ansi).uft


BIN
editor/EditorCore/Themes/LabCoat/fonts/zen dots 20 (ansi).uft


BIN
editor/EditorCore/Themes/LabCoat/fonts/zen dots 24 (ansi).uft


+ 189 - 0
editor/EditorCore/Themes/LabCoat/images/banner1.asset.taml

@@ -0,0 +1,189 @@
+<ImageAsset
+    AssetName="labCoatBanner1"
+    ImageFile="@assetFile=banner1.png"
+	AssetInternal="1" 
+    FilterMode="NEAREST"
+    ExplicitMode="true">
+    <ImageAsset.Cells>
+        <Cell
+            RegionName="TL1"
+            Offset="0 0"
+            Width="28"
+            Height="8" />
+        <Cell
+            RegionName="TC1"
+            Offset="28 0"
+            Width="2"
+            Height="8" />
+        <Cell
+            RegionName="TR1"
+            Offset="30 0"
+            Width="59"
+            Height="8" />
+        <Cell
+            RegionName="ML1"
+            Offset="0 8"
+            Width="28"
+            Height="2" />
+        <Cell
+            RegionName="MC1"
+            Offset="28 8"
+            Width="2"
+            Height="2" />
+        <Cell
+            RegionName="MR1"
+            Offset="30 8"
+            Width="59"
+            Height="2" />
+        <Cell
+            RegionName="BL1"
+            Offset="0 10"
+            Width="28"
+            Height="2" />
+        <Cell
+            RegionName="BC1"
+            Offset="28 10"
+            Width="2"
+            Height="2" />
+        <Cell
+            RegionName="BR1"
+            Offset="30 10"
+            Width="59"
+            Height="2" />
+        <Cell
+            RegionName="TL2"
+            Offset="0 12"
+            Width="28"
+            Height="8" />
+        <Cell
+            RegionName="TC2"
+            Offset="28 12"
+            Width="2"
+            Height="8" />
+        <Cell
+            RegionName="TR2"
+            Offset="30 12"
+            Width="59"
+            Height="8" />
+        <Cell
+            RegionName="ML2"
+            Offset="0 20"
+            Width="28"
+            Height="2" />
+        <Cell
+            RegionName="MC2"
+            Offset="28 20"
+            Width="2"
+            Height="2" />
+        <Cell
+            RegionName="MR2"
+            Offset="30 20"
+            Width="59"
+            Height="2" />
+        <Cell
+            RegionName="BL2"
+            Offset="0 22"
+            Width="28"
+            Height="2" />
+        <Cell
+            RegionName="BC2"
+            Offset="28 22"
+            Width="2"
+            Height="2" />
+        <Cell
+            RegionName="BR2"
+            Offset="30 22"
+            Width="59"
+            Height="2" />
+        <Cell
+            RegionName="TL3"
+            Offset="0 24"
+            Width="28"
+            Height="8" />
+        <Cell
+            RegionName="TC3"
+            Offset="28 24"
+            Width="2"
+            Height="8" />
+        <Cell
+            RegionName="TR3"
+            Offset="30 24"
+            Width="59"
+            Height="8" />
+        <Cell
+            RegionName="ML3"
+            Offset="0 32"
+            Width="28"
+            Height="2" />
+        <Cell
+            RegionName="MC3"
+            Offset="28 32"
+            Width="2"
+            Height="2" />
+        <Cell
+            RegionName="MR3"
+            Offset="30 32"
+            Width="59"
+            Height="2" />
+        <Cell
+            RegionName="BL3"
+            Offset="0 34"
+            Width="28"
+            Height="2" />
+        <Cell
+            RegionName="BC3"
+            Offset="28 34"
+            Width="2"
+            Height="2" />
+        <Cell
+            RegionName="BR3"
+            Offset="30 34"
+            Width="59"
+            Height="2" />
+        <Cell
+            RegionName="TL4"
+            Offset="0 36"
+            Width="28"
+            Height="8" />
+        <Cell
+            RegionName="TC4"
+            Offset="28 36"
+            Width="2"
+            Height="8" />
+        <Cell
+            RegionName="TR4"
+            Offset="30 36"
+            Width="59"
+            Height="8" />
+        <Cell
+            RegionName="ML4"
+            Offset="0 44"
+            Width="28"
+            Height="2" />
+        <Cell
+            RegionName="MC4"
+            Offset="28 44"
+            Width="2"
+            Height="2" />
+        <Cell
+            RegionName="MR4"
+            Offset="30 44"
+            Width="59"
+            Height="2" />
+        <Cell
+            RegionName="BL4"
+            Offset="0 46"
+            Width="28"
+            Height="2" />
+        <Cell
+            RegionName="BC4"
+            Offset="28 46"
+            Width="2"
+            Height="2" />
+        <Cell
+            RegionName="BR4"
+            Offset="30 46"
+            Width="59"
+            Height="2" />
+    </ImageAsset.Cells>
+</ImageAsset>

BIN
editor/EditorCore/Themes/LabCoat/images/banner1.png


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

@@ -0,0 +1,163 @@
+//-----------------------------------------------------------------------------
+// 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 ThemeManager::onAdd(%this)
+{
+	exec("./BaseTheme/BaseTheme.cs");
+	exec("./LabCoat/LabCoatTheme.cs");
+	exec("./ForestRobe/ForestRobeTheme.cs");
+	exec("./TorqueSuit/TorqueSuitTheme.cs");
+
+	%this.themeList = new SimSet();
+	%this.controlList = new SimSet();
+
+	%constructionVest = new ScriptObject()
+	{
+		class = "BaseTheme";
+	};
+
+	%labCoat = new ScriptObject()
+	{
+		superclass = "BaseTheme";
+		class = "LabCoatTheme";
+	};
+
+	%forestRobe = new ScriptObject()
+	{
+		superclass = "BaseTheme";
+		class = "ForestRobeTheme";
+	};
+
+	%torqueSuit = new ScriptObject()
+	{
+		superclass = "BaseTheme";
+		class = "TorqueSuitTheme";
+	};
+
+	%this.registerTheme(%constructionVest);
+	%this.registerTheme(%labCoat);
+	%this.registerTheme(%forestRobe);
+	%this.registerTheme(%torqueSuit);
+	%this.setTheme(0);
+}
+
+function ThemeManager::setTheme(%this, %i)
+{
+	%i = mClamp(%i, 0, %this.themeList.getCount() - 1);
+	%this.curTheme = %i;
+	%theme = %this.themeList.getObject(%i);
+	%this.activeTheme = %theme;
+	%this.refreshProfiles();
+	%this.postEvent("ThemeChange", %theme);
+}
+
+function ThemeManager::nextTheme(%this)
+{
+	%this.setTheme(%this.curTheme+1);
+}
+
+function ThemeManager::prevTheme(%this)
+{
+	%this.setTheme(%this.curTheme-1);
+}
+
+function ThemeManager::registerTheme(%this, %theme)
+{
+	%this.themeList.add(%theme);
+}
+
+function ThemeManager::refreshProfiles(%this)
+{
+	for (%i = 0; %i < %this.controlList.getCount(); %i++)
+	{
+		%obj = %this.controlList.getObject(%i);
+
+		if(isObject(%obj.gui))
+		{
+			if(!isObject(%this.activeTheme.getFieldValue(%obj.profileName)))
+			{
+				error("ThemeManager::setProfile - Unable to find profile" SPC %obj.profileName SPC "for theme" SPC %this.activeTheme.name @ "!");
+			}
+
+			%obj.gui.setEditFieldValue(%obj.profileTag, %this.activeTheme.getFieldValue(%obj.profileName));
+		}
+		else
+		{
+			//let's remove this corpse
+			%this.controlList.remove(%obj);
+			%this.i--;
+		}
+	}
+}
+
+function ThemeManager::setProfile(%this, %gui, %profileName, %profileTag)
+{
+	if(%profileTag $= "")
+	{
+		%profileTag = "Profile";
+	}
+
+	if(!isObject(%this.activeTheme.getFieldValue(%profileName)))
+	{
+		error("ThemeManager::setProfile - Unable to find profile" SPC %profileName SPC "for theme" SPC %this.activeTheme.name @ "!");
+	}
+
+	%gui.setEditFieldValue(%profileTag, %this.activeTheme.getFieldValue(%profileName));
+	%this.controlList.add(
+		new ScriptObject()
+		{
+			gui = %gui;
+			profileTag = %profileTag;
+			profileName = %profileName;
+		}
+	);
+}
+
+function ThemeManager::createProfile(%this, %profileName, %parentName, %settings)
+{
+	if(!isObject(%this.activeTheme.getFieldValue(%parentName)))
+	{
+		error("ThemeManager::createProfile - Unable to find parent profile" SPC %parentName SPC "for theme" SPC %this.activeTheme.name @ "!");
+	}
+
+	%this.themeList.callOnChildren("createProfile", %profileName, %parentName, %settings);
+}
+
+function ThemeManager::populateFonts(%this)
+{
+	echo("ThemeManager: Populating fonts...");
+	%oldPath = $GUI::fontCacheDirectory;
+	$GUI::fontCacheDirectory = %this.activeTheme.fontDirectory;
+	echo("  Path set to" SPC $GUI::fontCacheDirectory);
+
+	for(%i = 1; %i <= %this.activeTheme.fontCount; %i++)
+	{
+		echo("  Populating" SPC %this.activeTheme.font[%i]);
+		populateFontCacheRange(%this.activeTheme.font[%i],12,0,65535);
+		populateFontCacheRange(%this.activeTheme.font[%i],14,0,65535);
+		populateFontCacheRange(%this.activeTheme.font[%i],16,0,65535);
+		populateFontCacheRange(%this.activeTheme.font[%i],18,0,65535);
+		populateFontCacheRange(%this.activeTheme.font[%i],24,0,65535);
+		writeSingleFontCache(%this.activeTheme.font[%i]);
+	}
+	$GUI::fontCacheDirectory = %oldPath;
+}

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

@@ -0,0 +1,691 @@
+function TorqueSuitTheme::init(%this)
+{
+	%this.name = "Torque Suit";
+	//fonts and font sizes
+	%this.fontCount = 3;
+	%this.font[1] = "raleway";//Most common font
+	%this.font[2] = "Audiowide";//Title fontType
+	%this.font[3] = "vt323";//Code and console font
+	%this.fontDirectory = expandPath("^EditorCore/Themes/TorqueSuit/Fonts");
+	%this.fontSize = 22;
+
+	%this.color1 = "34 19 30 255";
+	%this.color2 = "62 32 52 255";
+	%this.color3 = "166 38 70 255";
+	%this.color4 = "246 75 72 255";
+	%this.color5 = "33 191 132 255";
+
+	%this.borderSize = 4;
+}
+
+function TorqueSuitTheme::makeButtonProfile(%this)
+{
+	%buttonBorder = new GuiBorderProfile()
+	{
+		padding = 6;
+		paddingHL = 6;
+		paddingSL = 6;
+		paddingNA = 6;
+	};
+
+	%this.buttonProfile = new GuiControlProfile()
+	{
+		fillColor = %this.color2;
+		fillColorHL = %this.adjustValue(%this.color2, 10);
+		fillColorSL = %this.adjustValue(%this.color2, -2);
+		fillColorNA = %this.setAlpha(%this.color2, 80);
+
+		fontType = %this.font[2];
+		fontDirectory = %this.fontDirectory;
+		fontSize = %this.fontSize;
+		fontColor = %this.color4;
+		fontColorHL = %this.adjustValue(%this.color4, 10);
+		fontColorSL = %this.color5;
+		fontColorNA = %this.setAlpha(%this.color3, 100);
+		align = Center;
+		valign = Middle;
+
+		borderDefault = %buttonBorder;
+	};
+}
+
+function TorqueSuitTheme::makeIconButtonProfile(%this)
+{
+	%buttonBorder = new GuiBorderProfile()
+	{
+		padding = 2;
+		paddingHL = 2;
+		paddingSL = 2;
+		paddingNA = 2;
+	};
+
+	%this.iconButtonProfile = new GuiControlProfile()
+	{
+		fillColor = %this.color2;
+		fillColorHL = %this.adjustValue(%this.color2, 10);
+		fillColorSL = %this.adjustValue(%this.color2, -2);
+		fillColorNA = %this.setAlpha(%this.color2, 80);
+
+		fontSize = %this.fontSize;
+		fontColor = %this.color4;
+		fontColorHL = %this.adjustValue(%this.color4, 10);
+		fontColorSL = %this.color5;
+		fontColorNA = %this.setAlpha(%this.color3, 100);
+		align = Center;
+		valign = Middle;
+
+		borderDefault = %buttonBorder;
+	};
+}
+
+function TorqueSuitTheme::makeTabProfile(%this)
+{
+	%tabBorderTop = new GuiBorderProfile()
+	{
+		margin = 2;
+		marginHL = 1;
+		marginSL = 0;
+		marginNA = 2;
+
+		border = 3;
+		borderHL = 4;
+		borderSL = 5;
+		borderNA = 3;
+
+		padding = 8;
+		paddingHL = 8;
+		paddingSL = 8;
+		paddingNA = 8;
+
+		borderColor = "255 255 255 20";
+		borderColorHL = %this.adjustValue(%this.color5, -10);
+		borderColorSL = %this.color5;
+		borderColorNA = "255 255 255 20";
+	};
+
+	%tabBorderSide = new GuiBorderProfile()
+	{
+		margin = 2;
+		marginHL = 1;
+		marginSL = 0;
+		marginNA = 2;
+
+		padding = 10;
+		paddingHL = 11;
+		paddingSL = 12;
+		paddingNA = 10;
+	};
+
+	%tabBorderBottom = new GuiBorderProfile()
+	{
+		padding = 6;
+		paddingHL = 6;
+		paddingSL = 6;
+		paddingNA = 6;
+	};
+
+	%this.tabProfileTop = new GuiControlProfile ()
+	{
+		fillColor = %this.color3;
+		fillColorHL = %this.adjustValue(%this.color3, 10);
+		fillColorSL = %this.color4;
+		fillColorNA = %this.color2;
+
+		fontType = %this.font[2];
+		fontDirectory = %this.fontDirectory;
+		fontSize = %this.fontSize;
+		fontColor = %this.color4;
+		fontColorHL = %this.adjustValue(%this.color4, 10);
+		fontColorSL = %this.color1;
+		fontColorNA = %this.setAlpha(%this.color4, 100);
+		align = Center;
+
+		borderTop = %tabBorderTop;
+		borderLeft = %tabBorderSide;
+		borderRight = %tabBorderSide;
+		borderBottom = %tabBorderBottom;
+	};
+
+	%this.tabProfileBottom = new GuiControlProfile ()
+	{
+		fillColor = %this.color3;
+		fillColorHL = %this.adjustValue(%this.color3, 10);
+		fillColorSL = %this.color4;
+		fillColorNA = %this.color2;
+
+		fontType = %this.font[2];
+		fontDirectory = %this.fontDirectory;
+		fontSize = %this.fontSize;
+		fontColor = %this.color4;
+		fontColorHL = %this.adjustValue(%this.color4, 10);
+		fontColorSL = %this.color1;
+		fontColorNA = %this.setAlpha(%this.color4, 100);
+		align = Center;
+
+		borderTop = %tabBorderBottom;
+		borderLeft = %tabBorderSide;
+		borderRight = %tabBorderSide;
+		borderBottom = %tabBorderTop;
+	};
+
+	%this.tabProfileLeft = new GuiControlProfile ()
+	{
+		fillColor = %this.color3;
+		fillColorHL = %this.adjustValue(%this.color3, 10);
+		fillColorSL = %this.color4;
+		fillColorNA = %this.color2;
+
+		fontType = %this.font[2];
+		fontDirectory = %this.fontDirectory;
+		fontSize = %this.fontSize;
+		fontColor = %this.color4;
+		fontColorHL = %this.adjustValue(%this.color4, 10);
+		fontColorSL = %this.color1;
+		fontColorNA = %this.setAlpha(%this.color4, 100);
+		align = Center;
+
+		borderTop = %tabBorderSide;
+		borderLeft = %tabBorderTop;
+		borderRight = %tabBorderBottom;
+		borderBottom = %tabBorderSide;
+	};
+
+	%this.tabProfileRight = new GuiControlProfile ()
+	{
+		fillColor = %this.color3;
+		fillColorHL = %this.adjustValue(%this.color3, 10);
+		fillColorSL = %this.color4;
+		fillColorNA = %this.color2;
+
+		fontType = %this.font[2];
+		fontDirectory = %this.fontDirectory;
+		fontSize = %this.fontSize;
+		fontColor = %this.color4;
+		fontColorHL = %this.adjustValue(%this.color4, 10);
+		fontColorSL = %this.color1;
+		fontColorNA = %this.setAlpha(%this.color4, 100);
+		align = Center;
+
+		borderTop = %tabBorderSide;
+		borderLeft = %tabBorderBottom;
+		borderRight = %tabBorderTop;
+		borderBottom = %tabBorderSide;
+	};
+
+	%bookBorderBottom = new GuiBorderProfile()
+	{
+		margin = 0;
+		border = 1;
+		borderColor = "0 0 0 150";
+		padding = 0;
+	};
+
+	%bookBorderDefault = new GuiBorderProfile()
+	{
+		padding = 6;
+	};
+
+	%bookBorderSide = new GuiBorderProfile()
+	{
+		padding = 5;
+	};
+
+	%this.tabBookProfileTop = new GuiControlProfile ()
+	{
+		borderDefault = %bookBorderDefault;
+		borderLeft = %bookBorderSide;
+		borderRight = %bookBorderSide;
+		borderBottom = %bookBorderBottom;
+		fillcolor = %this.color2;
+	};
+
+	%this.tabBookProfileBottom = new GuiControlProfile ()
+	{
+		borderDefault = %bookBorderDefault;
+		borderLeft = %bookBorderSide;
+		borderRight = %bookBorderSide;
+		borderTop = %bookBorderBottom;
+		fillcolor = %this.color2;
+	};
+
+	%this.tabBookProfileLeft = new GuiControlProfile ()
+	{
+		borderDefault = %bookBorderDefault;
+		borderTop = %bookBorderSide;
+		borderBottom = %bookBorderSide;
+		borderRight = %bookBorderBottom;
+		fillcolor = %this.color2;
+	};
+
+	%this.tabBookProfileRight = new GuiControlProfile ()
+	{
+		borderDefault = %bookBorderDefault;
+		borderTop = %bookBorderSide;
+		borderBottom = %bookBorderSide;
+		borderLeft = %bookBorderBottom;
+		fillcolor = %this.color2;
+	};
+
+	%this.tabPageProfile = new GuiControlProfile ()
+	{
+	    fillColor = %this.setAlpha(%this.color1, 150);
+	};
+}
+
+function TorqueSuitTheme::makeTextEditProfile(%this)
+{
+	%labelBorder = new GuiBorderProfile()
+	{
+		padding = 2;
+	};
+	%this.labelProfile = new GuiControlProfile()
+	{
+		fillColor = "0 0 0 0";
+
+		fontType = %this.font[2];
+		fontDirectory = %this.fontDirectory;
+		fontSize = %this.fontSize - 2;
+		fontColor = %this.color4;
+		align = "left";
+		vAlign = "top";
+
+		borderDefault = %labelBorder;
+	};
+
+	//border for text boxes never use the HL state.
+	%textBorderV = new GuiBorderProfile()
+	{
+		padding = 3;
+		paddingHL = 3;
+		paddingSL = 3;
+		paddingNA = 3;
+
+		border = 1;
+		borderHL = 1;
+		borderSL = 1;
+		borderNA = 1;
+
+		borderColor = %this.color2;
+		borderColorHL = %this.adjustValue(%this.color2, 10);
+		borderColorSL = %this.color2;
+		borderColorNA = %this.adjustValue(%this.color1, 10);
+	};
+
+	%textBorderLeft = new GuiBorderProfile()
+	{
+		padding = 10;
+		paddingHL = 10 - (%this.borderSize - 1);
+		paddingSL = 10 - (%this.borderSize - 1);
+		paddingNA = 10;
+
+		border = 1;
+		borderHL = %this.borderSize;
+		borderSL = %this.borderSize;
+		borderNA = 1;
+
+		borderColor = %this.color2;
+		borderColorHL = %this.adjustValue(%this.color5, -10);
+		borderColorSL = %this.color5;
+		borderColorNA = %this.adjustValue(%this.color1, 10);
+	};
+
+	%textBorderRight = new GuiBorderProfile()
+	{
+		padding = 10;
+		paddingHL = 10;
+		paddingSL = 10;
+		paddingNA = 10;
+
+		border = 1;
+		borderHL = 1;
+		borderSL = 1;
+		borderNA = 1;
+
+		borderColor = %this.color2;
+		borderColorHL = %this.adjustValue(%this.color2, 10);
+		borderColorSL = %this.color2;
+		borderColorNA = %this.adjustValue(%this.color1, 10);
+	};
+
+	%this.textEditProfile = new GuiControlProfile()
+	{
+		fillColor = %this.color1;
+		fillColorHL = %this.adjustValue(%this.color1, 20);//used for selected text
+		fillColorSL = %this.color1;
+		fillColorNA = %this.setAlpha(%this.color1, 80);
+
+		fontType = %this.font[3];
+		fontDirectory = %this.fontDirectory;
+		fontSize = %this.fontSize + 2;
+		fontColor = %this.setAlpha(%this.color4, 220);
+		fontColorHL = %this.adjustValue(%this.color4, 10);
+		fontColorSL = %this.color4;
+		fontColorNA = %this.setAlpha(%this.color4, 100);
+		align = left;
+		cursorColor = %this.color5;
+
+		borderDefault = %textBorderV;
+		borderRight = %textBorderRight;
+		borderLeft = %textBorderLeft;
+
+		tab = false;
+		canKeyFocus = true;
+		returnTab = true;
+	};
+}
+
+function TorqueSuitTheme::makeScrollProfile(%this)
+{
+	%trackBorder = new GuiBorderProfile()
+	{
+		margin = 0;
+		padding = 0;
+		border = 0;
+	};
+
+	%this.trackProfile = new GuiControlProfile()
+	{
+		fillColor = %this.setAlpha(%this.color2, 150);
+		fillColorHL = %this.setAlpha(%this.color2, 100);
+		fillColorSL = %this.setAlpha(%this.adjustValue(%this.color2, 10), 150);
+		fillColorNA = %this.setAlpha(%this.color2, 50);
+		borderDefault = %trackBorder;
+	};
+
+	%thumbBorder = new GuiBorderProfile()
+	{
+		margin = 3;
+		marginHL = 3;
+		marginSL = 3;
+		marginNA = 3;
+	};
+
+	%this.thumbProfile = new GuiControlProfile()
+	{
+		fillColor = %this.color3;
+		fillColorHL = %this.adjustValue(%this.color3, 10);
+		fillColorSL = %this.color5;
+		fillColorNA = %this.setAlpha(%this.color3, 80);
+
+		borderDefault = %thumbBorder;
+	};
+
+	%arrowBorder = new GuiBorderProfile()
+	{
+		padding = 3;
+		paddingHL = 3;
+		paddingSL = 3;
+		paddingNA = 3;
+	};
+
+	%this.scrollArrowProfile = 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.adjustValue(%this.color5, -20);
+		fontColorNA = %this.setAlpha(%this.color2, 80);
+
+		borderDefault = %arrowBorder;
+	};
+
+	%mainBorder = new GuiBorderProfile()
+	{
+		margin = 0;
+		padding = 8;
+		border = 0;
+	};
+	%this.scrollProfile = new GuiControlProfile()
+	{
+		opaque = true;
+		fillColor = %this.setAlpha(%this.color1, 240);
+
+		borderDefault = %mainBorder;
+	};
+}
+
+function TorqueSuitTheme::makeConsoleProfile(%this)
+{
+	%this.consoleProfile = new GuiControlProfile()
+	{
+		fontType = %this.font[3];
+		fontDirectory = %this.fontDirectory;
+		fontSize = %this.fontSize + 2;
+		fontColor = %this.color4; //Normal text
+		fontColorHL = %this.setAlpha(%this.color4, 140); //Warnings
+		fontColorNA = %this.color5; //Errors
+	};
+}
+
+function TorqueSuitTheme::makeMenuProfile(%this)
+{
+	%menuBarBorder = new GuiBorderProfile()
+	{
+		padding = 2;
+	};
+
+	%this.menuBarProfile = new GuiControlProfile()
+	{
+		fillColor = %this.adjustValue(%this.color1, -7);
+		canKeyFocus = true;
+		borderDefault = %menuBarBorder;
+	};
+
+	%menuBorder = new GuiBorderProfile()
+	{
+		margin = 2;
+		marginHL = 0;
+		marginSL = 0;
+		marginNA = 2;
+
+		border = 0;
+		borderHL = 2;
+		borderSL = 2;
+		borderNA = 0;
+
+		borderColorHL = "255 255 255 30";
+		borderColorSL = %this.color5;
+	};
+
+	%menuBottomBorder = new GuiBorderProfile()
+	{
+		paddingSL = 2;
+
+		margin = 2;
+		marginHL = 0;
+		marginSL = 0;
+		marginNA = 2;
+
+		border = 0;
+		borderHL = 2;
+		borderSL = 2;
+		borderNA = 0;
+
+		borderColorHL = "255 255 255 30";
+		borderColorSL = %this.color5;
+	};
+
+	%menuSideBorder = new GuiBorderProfile()
+	{
+		border = 0;
+		borderHL = 2;
+		borderSL = 2;
+		borderNA = 0;
+
+		padding = 10;
+		paddingHL = 8;
+		paddingSL = 8;
+		paddingNA = 10;
+
+		borderColorHL = "255 255 255 30";
+		borderColorSL = %this.color5;
+	};
+
+	%this.menuProfile = new GuiControlProfile()
+	{
+		fillColor = "0 0 0 0";
+		fillColorHL = "255 255 255 10";
+		fillColorSL = %this.adjustValue(%this.color5, -15);
+		fillColorNA = "0 0 0 0";
+
+		borderDefault = %menuBorder;
+		borderLeft = %menuSideBorder;
+		borderRight = %menuSideBorder;
+		borderBottom = %menuBottomBorder;
+
+		fontType = %this.font[3];
+		fontDirectory = %this.fontDirectory;
+		fontSize = %this.fontSize;
+
+		fontColor = %this.color4;
+		fontColorHL = %this.adjustValue(%this.color4, 10);
+		fontColorSL = %this.color1;
+		fontColorNA = %this.adjustValue(%this.color4, 100);
+
+		canKeyFocus = true;
+	};
+
+	%menuContentVertBorder = new GuiBorderProfile()
+	{
+		border = 2;
+		padding = 4;
+		borderColor = %this.color5;
+	};
+
+	%menuContentSideBorder = new GuiBorderProfile()
+	{
+		border = 2;
+		padding = 0;
+		borderColor = %this.color5;
+	};
+
+	%this.menuContentProfile = new GuiControlProfile()
+	{
+		fillColor = %this.adjustValue(%this.color1, -5);
+
+		borderDefault = %menuContentSideBorder;
+		borderTop = %menuContentVertBorder;
+		borderBottom = %menuContentVertBorder;
+	};
+
+	%menuItemBorderTop = new GuiBorderProfile()
+	{
+		padding = 6;
+		paddingHL = 6;
+		paddingSL = 0;
+		paddingNA = 6;
+
+		marginSL = 4;
+		borderSL = 1;
+		borderColorSL = "0 0 0 50";
+	};
+
+	%menuItemBorderBottom = new GuiBorderProfile()
+	{
+		padding = 6;
+		paddingHL = 6;
+		paddingSL = 0;
+		paddingNA = 6;
+
+		marginSL = 4;
+		borderSL = 1;
+		borderColorSL = "255 255 255 50";
+	};
+
+	%menuItemBorderSide = new GuiBorderProfile()
+	{
+		padding = 6;
+		paddingHL = 6;
+		paddingSL = 0;
+		paddingNA = 6;
+
+		marginSL = 0;
+		borderSL = 0;
+		paddingSL = 6;
+	};
+
+	%this.menuItemProfile = new GuiControlProfile()
+	{
+		fillColor = %this.adjustValue(%this.color1, -5);
+		fillColorHL = %this.adjustValue(%this.color5, -15);
+		fillColorNA = %this.color1;
+		align = left;
+
+		tab = false;
+		canKeyFocus = true;
+
+		fontType = %this.font[3];
+		fontDirectory = %this.fontDirectory;
+		fontSize = %this.fontSize;
+
+		fontColor = %this.color4;
+		fontColorHL = %this.adjustValue(%this.color1, 10);
+		fontColorNA = %this.setAlpha(%this.color1, 150);
+
+		borderDefault = %menuItemBorderSide;
+		borderTop = %menuItemBorderTop;
+		borderBottom = %menuItemBorderBottom;
+	};
+}
+
+function TorqueSuitTheme::makeListBoxProfile(%this)
+{
+	%borderProfile = new GuiBorderProfile()
+	{
+		margin = 1;
+		marginHL = 1;
+		marginSL = 1;
+		marginNA = 1;
+
+		padding = 4;
+		paddingHL = 4;
+		paddingSL = 4;
+		paddingNA = 4;
+	};
+
+	%leftBorderProfile = new GuiBorderProfile()
+	{
+		margin = 1;
+		marginHL = 1;
+		marginSL = 1;
+		marginNA = 1;
+
+		padding = 8;
+		paddingHL = 8;
+		paddingSL = 8 - %this.borderSize;
+		paddingNA = 8;
+
+		borderSL = %this.borderSize;
+		borderColorSL = %this.color5;
+	};
+
+	%this.listBoxProfile = new GuiControlProfile ()
+	{
+	    // fill color
+	    fillColor = %this.adjustValue(%this.color1, 4);
+	    fillColorHL = %this.adjustValue(%this.color1, 8);
+	    fillColorSL = %this.color3;
+	    fillColorNA = %this.setAlpha(%this.color1, 150);
+		align = left;
+
+		tab = false;
+		canKeyFocus = true;
+
+		fontType = %this.font[1];
+		fontDirectory = %this.fontDirectory;
+		fontSize = %this.fontSize;
+		fontColor = %this.color4;
+		fontColorHL = %this.adjustValue(%this.color4, 10);
+		fontColorSL = %this.adjustValue(%this.color1, 2);
+		fontColorNA = %this.adjustValue(%this.color4, -30);
+
+		borderDefault = %borderProfile;
+		borderLeft = %leftBorderProfile;
+	};
+}

BIN
editor/EditorCore/Themes/TorqueSuit/fonts/Audiowide 12 (ansi).uft


BIN
editor/EditorCore/Themes/TorqueSuit/fonts/Audiowide 14 (ansi).uft


BIN
editor/EditorCore/Themes/TorqueSuit/fonts/Audiowide 16 (ansi).uft


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