فهرست منبع

Merge pull request #1 from TorqueGameEngines/development

Sync with upstream Development
sierra-zero 4 سال پیش
والد
کامیت
4ed292fef8
100فایلهای تغییر یافته به همراه1433 افزوده شده و 982 حذف شده
  1. 85 33
      editor/AssetAdmin/AssetAdmin.cs
  2. 31 25
      editor/AssetAdmin/AssetDictionary.cs
  3. 115 0
      editor/AssetAdmin/AssetDictionaryButton.cs
  4. 155 0
      editor/AssetAdmin/AssetWindow.cs
  5. 13 4
      editor/EditorCore/Themes/ThemeManager.cs
  6. 7 0
      engine/Link/VC2012.Debug.Win32/Torque2D/Torque2D_DEBUG.exe.recipe
  7. 0 5
      engine/compilers/VisualStudio 2017/Torque 2D.vcxproj
  8. 0 15
      engine/compilers/VisualStudio 2017/Torque 2D.vcxproj.filters
  9. BIN
      engine/compilers/VisualStudio 2019/Torque 2D.aps
  10. 14 13
      engine/compilers/VisualStudio 2019/Torque 2D.rc
  11. 70 39
      engine/compilers/VisualStudio 2019/Torque 2D.vcxproj
  12. 197 112
      engine/compilers/VisualStudio 2019/Torque 2D.vcxproj.filters
  13. 2 2
      engine/compilers/VisualStudio 2019/libogg.vcxproj
  14. 2 2
      engine/compilers/VisualStudio 2019/libvorbis.vcxproj
  15. 2 2
      engine/compilers/VisualStudio 2019/ljpeg.vcxproj
  16. 2 2
      engine/compilers/VisualStudio 2019/lpng.vcxproj
  17. 16 0
      engine/compilers/VisualStudio 2019/resource.h
  18. 2 2
      engine/compilers/VisualStudio 2019/zlib.vcxproj
  19. 9 0
      engine/source/2d/gui/SceneWindow.cc
  20. 4 4
      engine/source/2d/gui/guiSceneObjectCtrl.cc
  21. 6 2
      engine/source/2d/gui/guiSpriteCtrl.cc
  22. 1 8
      engine/source/gui/buttons/guiButtonCtrl.cc
  23. 9 33
      engine/source/gui/buttons/guiCheckBoxCtrl.cc
  24. 16 6
      engine/source/gui/buttons/guiRadioCtrl.cc
  25. 2 2
      engine/source/gui/containers/guiRolloutCtrl.cc
  26. 10 177
      engine/source/gui/containers/guiScrollCtrl.cc
  27. 0 6
      engine/source/gui/containers/guiScrollCtrl.h
  28. 2 6
      engine/source/gui/containers/guiTabBookCtrl.cc
  29. 1 1
      engine/source/gui/containers/guiWindowCtrl.cc
  30. 2 2
      engine/source/gui/containers/guiWindowCtrl.h
  31. 2 2
      engine/source/gui/editor/guiMenuBar.cc
  32. 2 2
      engine/source/gui/guiBubbleTextCtrl.h
  33. 42 1
      engine/source/gui/guiCanvas.cc
  34. 6 0
      engine/source/gui/guiCanvas.h
  35. 2 2
      engine/source/gui/guiControl.cc
  36. 184 194
      engine/source/gui/guiDefaultControlRender.cc
  37. 7 5
      engine/source/gui/guiDefaultControlRender.h
  38. 14 14
      engine/source/gui/guiPopUpCtrl.cc
  39. 2 2
      engine/source/gui/guiPopUpCtrl.h
  40. 10 10
      engine/source/gui/guiPopUpCtrlEx.cc
  41. 2 2
      engine/source/gui/guiPopUpCtrlEx.h
  42. 2 2
      engine/source/gui/guiProgressCtrl.h
  43. 1 1
      engine/source/gui/guiSliderCtrl.cc
  44. 0 16
      engine/source/gui/guiTextCtrl.cc
  45. 135 11
      engine/source/gui/guiTextEditCtrl.cc
  46. 13 3
      engine/source/gui/guiTextEditCtrl.h
  47. 159 126
      engine/source/gui/guiTypes.cc
  48. 24 5
      engine/source/gui/guiTypes.h
  49. 5 1
      toybox/AppCore/1/scripts/defaultPreferences.cs
  50. 13 13
      toybox/DeathBallToy/1/main.cs
  51. 5 4
      toybox/DeathBallToy/1/scripts/faceObjectBehavior.cs
  52. 0 3
      toybox/Sandbox/1/assets/gui/ReplayBtn128x128Down.asset.taml
  53. BIN
      toybox/Sandbox/1/assets/gui/ReplayBtn128x128Down.png
  54. 0 3
      toybox/Sandbox/1/assets/gui/ReplayBtn128x128Hover.asset.taml
  55. BIN
      toybox/Sandbox/1/assets/gui/ReplayBtn128x128Hover.png
  56. 0 3
      toybox/Sandbox/1/assets/gui/ReplayBtn128x128Inactive.asset.taml
  57. BIN
      toybox/Sandbox/1/assets/gui/ReplayBtn128x128Inactive.png
  58. 0 3
      toybox/Sandbox/1/assets/gui/ReplayBtn128x128Up.asset.taml
  59. BIN
      toybox/Sandbox/1/assets/gui/ReplayBtn128x128Up.png
  60. 0 3
      toybox/Sandbox/1/assets/gui/mediumCancelDown.asset.taml
  61. BIN
      toybox/Sandbox/1/assets/gui/mediumCancelDown.png
  62. 0 3
      toybox/Sandbox/1/assets/gui/mediumCancelHover.asset.taml
  63. BIN
      toybox/Sandbox/1/assets/gui/mediumCancelHover.png
  64. 0 3
      toybox/Sandbox/1/assets/gui/mediumCancelInactive.asset.taml
  65. BIN
      toybox/Sandbox/1/assets/gui/mediumCancelInactive.png
  66. 0 3
      toybox/Sandbox/1/assets/gui/mediumCancelNormal.asset.taml
  67. BIN
      toybox/Sandbox/1/assets/gui/mediumCancelNormal.png
  68. 7 0
      toybox/Sandbox/1/assets/gui/minusButton.asset.taml
  69. BIN
      toybox/Sandbox/1/assets/gui/minusButton.png
  70. 0 3
      toybox/Sandbox/1/assets/gui/minusButtonDown.asset.taml
  71. BIN
      toybox/Sandbox/1/assets/gui/minusButtonDown.png
  72. 0 3
      toybox/Sandbox/1/assets/gui/minusButtonHover.asset.taml
  73. BIN
      toybox/Sandbox/1/assets/gui/minusButtonHover.png
  74. 0 3
      toybox/Sandbox/1/assets/gui/minusButtonInactive.asset.taml
  75. BIN
      toybox/Sandbox/1/assets/gui/minusButtonInactive.png
  76. 0 3
      toybox/Sandbox/1/assets/gui/minusButtonNormal.asset.taml
  77. BIN
      toybox/Sandbox/1/assets/gui/minusButtonNormal.png
  78. 7 0
      toybox/Sandbox/1/assets/gui/northArrow.asset.taml
  79. BIN
      toybox/Sandbox/1/assets/gui/northArrow.png
  80. 0 3
      toybox/Sandbox/1/assets/gui/northArrowDown.asset.taml
  81. BIN
      toybox/Sandbox/1/assets/gui/northArrowDown.png
  82. 0 3
      toybox/Sandbox/1/assets/gui/northArrowHover.asset.taml
  83. BIN
      toybox/Sandbox/1/assets/gui/northArrowHover.png
  84. 0 3
      toybox/Sandbox/1/assets/gui/northArrowNormal.asset.taml
  85. BIN
      toybox/Sandbox/1/assets/gui/northArrowNormal.png
  86. 7 0
      toybox/Sandbox/1/assets/gui/plusButton.asset.taml
  87. BIN
      toybox/Sandbox/1/assets/gui/plusButton.png
  88. 0 3
      toybox/Sandbox/1/assets/gui/plusButtonDown.asset.taml
  89. BIN
      toybox/Sandbox/1/assets/gui/plusButtonDown.png
  90. 0 3
      toybox/Sandbox/1/assets/gui/plusButtonHover.asset.taml
  91. BIN
      toybox/Sandbox/1/assets/gui/plusButtonHover.png
  92. 0 3
      toybox/Sandbox/1/assets/gui/plusButtonInactive.asset.taml
  93. BIN
      toybox/Sandbox/1/assets/gui/plusButtonInactive.png
  94. 0 3
      toybox/Sandbox/1/assets/gui/plusButtonNormal.asset.taml
  95. BIN
      toybox/Sandbox/1/assets/gui/plusButtonNormal.png
  96. 7 0
      toybox/Sandbox/1/assets/gui/southArrow.asset.taml
  97. BIN
      toybox/Sandbox/1/assets/gui/southArrow.png
  98. 0 3
      toybox/Sandbox/1/assets/gui/southArrowDown.asset.taml
  99. BIN
      toybox/Sandbox/1/assets/gui/southArrowDown.png
  100. 0 3
      toybox/Sandbox/1/assets/gui/southArrowHover.asset.taml

+ 85 - 33
editor/AssetAdmin/AssetAdmin.cs

@@ -23,30 +23,38 @@
 function AssetAdmin::create(%this)
 {
 	exec("./AssetDictionary.cs");
+	exec("./AssetWindow.cs");
+	exec("./AssetDictionaryButton.cs");
 
 	%this.guiPage = EditorCore.RegisterEditor("Asset Manager", %this);
+	%this.guiPage.add(%this.buildAssetWindow());
+	%this.guiPage.add(%this.buildLibrary());
+	%this.guiPage.add(%this.buildInspector());
 
-	%this.scroller = new GuiScrollCtrl()
+	EditorCore.FinishRegistration(%this.guiPage);
+}
+
+function AssetAdmin::buildLibrary(%this)
+{
+	%this.libScroller = new GuiScrollCtrl()
 	{
 		HorizSizing="left";
 		VertSizing="height";
 		Position="700 0";
 		Extent="324 768";
-		MinExtent="220 200";
+		MinExtent="162 384";
 		hScrollBar="dynamic";
 		vScrollBar="alwaysOn";
 		constantThumbHeight="0";
 		showArrowButtons="1";
 		scrollBarThickness="14";
 	};
-	ThemeManager.setProfile(%this.scroller, "scrollingPanelProfile");
-	ThemeManager.setProfile(%this.scroller, "scrollingPanelThumbProfile", ThumbProfile);
-	ThemeManager.setProfile(%this.scroller, "scrollingPanelTrackProfile", TrackProfile);
-	ThemeManager.setProfile(%this.scroller, "scrollingPanelArrowProfile", ArrowProfile);
+	ThemeManager.setProfile(%this.libScroller, "scrollingPanelProfile");
+	ThemeManager.setProfile(%this.libScroller, "scrollingPanelThumbProfile", ThumbProfile);
+	ThemeManager.setProfile(%this.libScroller, "scrollingPanelTrackProfile", TrackProfile);
+	ThemeManager.setProfile(%this.libScroller, "scrollingPanelArrowProfile", ArrowProfile);
 
-	%this.guiPage.add(%this.scroller);
-
-	%this.dictionaryContainer = new GuiChainCtrl()
+	%this.dictionaryList = new GuiChainCtrl()
 	{
 		HorizSizing="bottom";
 		VertSizing="right";
@@ -54,42 +62,80 @@ function AssetAdmin::create(%this)
 		Extent="310 768";
 		MinExtent="220 200";
 	};
-	ThemeManager.setProfile(%this.dictionaryContainer, "emptyProfile");
-	%this.scroller.add(%this.dictionaryContainer);
+	ThemeManager.setProfile(%this.dictionaryList, "emptyProfile");
+	%this.libScroller.add(%this.dictionaryList);
+
+	%this.dictionaryList.add(%this.buildDictionary("Images", "ImageAsset"));
+	%this.dictionaryList.add(%this.buildDictionary("Animations", "AnimationAsset"));
+
+	return %this.libScroller;
+}
 
-	%this.Dictionary["ImageAsset"] = new GuiPanelCtrl()
+function AssetAdmin::buildDictionary(%this, %title, %type)
+{
+	%this.Dictionary[%type] = new GuiPanelCtrl()
 	{
 		Class = AssetDictionary;
-		Text="Image Assets";
+		Text=%title;
 		command="";
 		HorizSizing="bottom";
 		VertSizing="right";
 		Position="0 0";
 		Extent="310 22";
 		MinExtent="80 22";
-		Type = "ImageAsset";
+		Type = %type;
 	};
-	%this.Dictionary["ImageAsset"].setExpandEase("EaseOutBounce", 1500);
-	ThemeManager.setProfile(%this.Dictionary["ImageAsset"], "panelProfile");
-	%this.dictionaryContainer.add(%this.Dictionary["ImageAsset"]);
+	%this.Dictionary[%type].setExpandEase("EaseInOut", 1000);
+	ThemeManager.setProfile(%this.Dictionary[%type], "panelProfile");
+
+	return %this.Dictionary[%type];
+}
 
-	%this.Dictionary["AnimationAsset"] = new GuiPanelCtrl()
+function AssetAdmin::buildInspector(%this)
+{
+	%this.insScroller = new GuiScrollCtrl()
 	{
-		Class = AssetDictionary;
-		Text="Animation Assets";
-		command="";
-		HorizSizing="bottom";
-		VertSizing="right";
-		Position="0 0";
-		Extent="310 22";
-		MinExtent="80 22";
-		Type = "AnimationAsset";
+		HorizSizing="width";
+		VertSizing="top";
+		Position="0 444";
+		Extent="700 324";
+		MinExtent="350 222";
+		hScrollBar="alwaysOn";
+		vScrollBar="alwaysOn";
+		constantThumbHeight="0";
+		showArrowButtons="1";
+		scrollBarThickness="14";
 	};
-	%this.Dictionary["AnimationAsset"].setExpandEase("EaseOutBounce", 1500);
-	ThemeManager.setProfile(%this.Dictionary["AnimationAsset"], "panelProfile");
-	%this.dictionaryContainer.add(%this.Dictionary["AnimationAsset"]);
+	ThemeManager.setProfile(%this.insScroller, "scrollingPanelProfile");
+	ThemeManager.setProfile(%this.insScroller, "scrollingPanelThumbProfile", ThumbProfile);
+	ThemeManager.setProfile(%this.insScroller, "scrollingPanelTrackProfile", TrackProfile);
+	ThemeManager.setProfile(%this.insScroller, "scrollingPanelArrowProfile", ArrowProfile);
 
-	EditorCore.FinishRegistration(%this.guiPage);
+	return %this.insScroller;
+}
+
+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 = "175 111";
+		cameraPosition = "0 0";
+		cameraSize = "175 111";
+		useWindowInputEvents = false;
+		useObjectInputEvents = true;
+	};
+	%this.assetWindow.setScene(%this.assetScene);
+
+	return %this.assetWindow;
 }
 
 function AssetAdmin::destroy(%this)
@@ -99,10 +145,16 @@ function AssetAdmin::destroy(%this)
 
 function AssetAdmin::open(%this)
 {
-	//%this.Dictionary["ImageAsset"].load();
+	%this.Dictionary["ImageAsset"].load();
+	%this.Dictionary["AnimationAsset"].load();
+
+	%this.assetScene.setScenePause(false);
 }
 
 function AssetAdmin::close(%this)
 {
-	//%this.Dictionary["ImageAsset"].unload();
+	%this.Dictionary["ImageAsset"].unload();
+	%this.Dictionary["AnimationAsset"].unload();
+
+	%this.assetScene.setScenePause(true);
 }

+ 31 - 25
editor/AssetAdmin/AssetDictionary.cs

@@ -35,8 +35,6 @@ function AssetDictionary::onAdd(%this)
 	};
 	ThemeManager.setProfile(%this.grid, "emptyProfile");
 	%this.add(%this.grid);
-
-	%this.load();
 }
 
 function AssetDictionary::load(%this)
@@ -56,32 +54,14 @@ function AssetDictionary::load(%this)
 				Class = AssetDictionaryButton;
 				HorizSizing="center";
 				VertSizing="center";
-				Cmd = "OpenAsset";
 				Tooltip = AssetDatabase.getAssetName(%assetID);
 				Text = "";
+				AssetID = %assetID;
+				Type = %this.Type;
 			};
 			ThemeManager.setProfile(%button, "buttonProfile");
 			ThemeManager.setProfile(%button, "tipProfile", "TooltipProfile");
 			%this.grid.add(%button);
-
-			%texture = new GuiSpriteCtrl()
-			{
-				HorizSizing="center";
-				VertSizing="bottom";
-				Extent = "50 50";
-				minExtent="8 8";
-				Position = "0 0";
-			};
-			ThemeManager.setProfile(%texture, "spriteProfile");
-			%button.add(%texture);
-			if(%this.Type $= "ImageAsset")
-			{
-				%texture.setImage(%assetID);
-			}
-			else if(%this.Type $= "AnimationAsset")
-			{
-				%texture.setAnimation(%assetID);
-			}
 		}
 	}
 	%query.delete();
@@ -89,9 +69,35 @@ function AssetDictionary::load(%this)
 
 function AssetDictionary::unload(%this)
 {
-	for(%i = %this.getCoun() - 1; %i >= 0; %i++)
+	//Remove all the child gui controls
+	for(%i = %this.grid.getCount() - 1; %i >= 0; %i--)
 	{
-		%obj = %this.getObject(%i);
-		%obj.safeDelete();
+		%obj = %this.grid.getObject(%i);
+		%obj.delete();
 	}
+
+	//release all the assets we loaded for this - might take them out of memory
+	// %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))
+	// 	{
+	// 		AssetDatabase.releaseAsset(%assetID);
+	// 	}
+	// }
+	// %query.delete();
+}
+
+function AssetDictionarySprite::onAnimationEnd(%this, %animationAssetID)
+{
+	%this.schedule(2000, "restartAnimation", %animationAssetID);
+}
+
+function AssetDictionarySprite::restartAnimation(%this, %animationAssetID)
+{
+	%this.setAnimation(%animationAssetID);
 }

+ 115 - 0
editor/AssetAdmin/AssetDictionaryButton.cs

@@ -0,0 +1,115 @@
+//-----------------------------------------------------------------------------
+// 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);
+	%this.assetID = "";
+}
+
+function AssetDictionaryButton::loadImageAsset(%this, %assetID)
+{
+	%imageAsset = AssetDatabase.acquireAsset(%assetID);
+
+	%extent = %this.getIconExtent(%imageAsset.getFrameSize(0));
+	%texture = %this.buildIcon(%extent);
+	%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);
+
+	%extent = %this.getIconExtent(%imageAsset.getFrameSize(0));
+	%texture = %this.buildIcon(%extent);
+	%texture.setAnimation(%assetID);
+
+	%this.ImageAsset = %imageAsset;
+	%this.imageAssetID = %imageAssetID;
+	%this.AnimationAsset = %animationAsset;
+	%this.AnimationAssetID = %assetID;
+
+	%this.add(%texture);
+}
+
+function AssetDictionaryButton::getIconExtent(%this, %size)
+{
+	%x = getWord(%size, 0);
+	%y = getWord(%size, 1);
+	%ratio = %x / %y;
+	%extent = "50 50";
+	if(%x > %y)
+	{
+		%extent = "50" SPC (50/%ratio);
+	}
+	else if(%x < %y)
+	{
+		%extent = (50*%ratio) SPC "50";
+	}
+	return %extent;
+}
+
+function AssetDictionaryButton::buildIcon(%this, %extent)
+{
+	%texture = new GuiSpriteCtrl()
+	{
+		class = "AssetDictionarySprite";
+		HorizSizing="center";
+		VertSizing="center";
+		Extent = %extent;
+		minExtent=%extent;
+		Position = "0 0";
+	};
+	ThemeManager.setProfile(%texture, "spriteProfile");
+	return %texture;
+}
+
+function AssetDictionaryButton::onClick(%this)
+{
+	if(isObject(%this.AnimationAsset) && %this.AnimationAssetID !$= "")
+	{
+		AssetAdmin.AssetWindow.displayAnimationAsset(%this.imageAsset, %this.AnimationAsset, %this.AnimationAssetID);
+	}
+	else if(isObject(%this.ImageAsset) && %this.ImageAssetID !$= "")
+	{
+		AssetAdmin.AssetWindow.displayImageAsset(%this.ImageAsset, %this.ImageAssetID);
+	}
+}
+
+function AssetDictionaryButton::onRemove(%this)
+{
+	if(isObject(%this.ImageAsset))
+	{
+		AssetDatabase.releaseAsset(%this.ImageAssetID);
+	}
+	if(isObject(%this.AnimationAsset))
+	{
+		AssetDatabase.releaseAsset(%this.AnimationAssetID);
+	}
+}

+ 155 - 0
editor/AssetAdmin/AssetWindow.cs

@@ -0,0 +1,155 @@
+//-----------------------------------------------------------------------------
+// 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::displayImageAsset(%this, %imageAsset, %assetID)
+{
+	AssetAdmin.AssetScene.clear(true);
+
+	if(!%imageAsset.getExplicitMode() && %imageAsset.getFrameCount() == 1)
+	{
+		%size = %this.getWorldSize(%imageAsset.getFrameSize(0));
+		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();
+
+		%cellWidth = %imageAsset.getCellWidth();
+		%cellHeight = %imageAsset.getCellHeight();
+
+		%imageSizeX = %cellWidth * %cellCountX;
+		%imageSizeY = %cellHeight * %cellCountY;
+
+		%size = %this.getWorldSize(%imageSizeX SPC %imageSizeY);
+		%sizeX = getWord(%size, 0);
+		%sizeY = getWord(%size, 1);
+
+		%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 * %imageAsset.getCellCountX()) + %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));
+			}
+		}
+	}
+}
+
+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::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);
+}

+ 13 - 4
editor/EditorCore/Themes/ThemeManager.cs

@@ -85,12 +85,21 @@ function ThemeManager::refreshProfiles(%this)
 	{
 		%obj = %this.controlList.getObject(%i);
 
-		if(!isObject(%this.activeTheme.getFieldValue(%obj.profileName)))
+		if(isObject(%obj.gui))
 		{
-			error("ThemeManager::setProfile - Unable to find profile" SPC %obj.profileName SPC "for theme" SPC %this.activeTheme.name @ "!");
-		}
+			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.setFieldValue(%obj.profileTag, %this.activeTheme.getFieldValue(%obj.profileName));
+			%obj.gui.setFieldValue(%obj.profileTag, %this.activeTheme.getFieldValue(%obj.profileName));
+		}
+		else
+		{
+			//let's remove this corpse
+			%this.controlList.remove(%obj);
+			%this.i--;
+		}
 	}
 }
 

+ 7 - 0
engine/Link/VC2012.Debug.Win32/Torque2D/Torque2D_DEBUG.exe.recipe

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project>
+  <ProjectOutputs>C:\Users\Peter\Documents\GitHub\TorqueGameEngines\Torque2D\Torque2D_DEBUG.exe</ProjectOutputs>
+  <ContentFiles></ContentFiles>
+  <SatelliteDlls></SatelliteDlls>
+  <NonRecipeFileRefs></NonRecipeFileRefs>
+</Project>

+ 0 - 5
engine/compilers/VisualStudio 2017/Torque 2D.vcxproj

@@ -266,7 +266,6 @@
     <ClCompile Include="..\..\source\2d\core\Utility.cc" />
     <ClCompile Include="..\..\source\2d\core\Vector2.cc" />
     <ClCompile Include="..\..\source\2d\experimental\composites\WaveComposite.cc" />
-    <ClCompile Include="..\..\source\2d\gui\guiImageButtonCtrl.cc" />
     <ClCompile Include="..\..\source\2d\gui\guiSceneObjectCtrl.cc" />
     <ClCompile Include="..\..\source\2d\gui\guiSpriteCtrl.cc" />
     <ClCompile Include="..\..\source\2d\gui\SceneWindow.cc" />
@@ -419,7 +418,6 @@
     <ClCompile Include="..\..\source\gui\guiPopUpCtrlEx.cc" />
     <ClCompile Include="..\..\source\gui\guiProgressCtrl.cc" />
     <ClCompile Include="..\..\source\gui\guiSliderCtrl.cc" />
-    <ClCompile Include="..\..\source\gui\guiTextCtrl.cc" />
     <ClCompile Include="..\..\source\gui\guiTextEditCtrl.cc" />
     <ClCompile Include="..\..\source\gui\guiTextEditSliderCtrl.cc" />
     <ClCompile Include="..\..\source\gui\guiTextListCtrl.cc" />
@@ -715,8 +713,6 @@
     <ClInclude Include="..\..\source\2d\core\Vector2_ScriptBinding.h" />
     <ClInclude Include="..\..\source\2d\experimental\composites\WaveComposite.h" />
     <ClInclude Include="..\..\source\2d\experimental\composites\WaveComposite_ScriptBinding.h" />
-    <ClInclude Include="..\..\source\2d\gui\guiImageButtonCtrl.h" />
-    <ClInclude Include="..\..\source\2d\gui\guiImageButtonCtrl_ScriptBindings.h" />
     <ClInclude Include="..\..\source\2d\gui\guiSceneObjectCtrl.h" />
     <ClInclude Include="..\..\source\2d\gui\guiSpriteCtrl.h" />
     <ClInclude Include="..\..\source\2d\gui\guiSpriteCtrl_ScriptBindings.h" />
@@ -961,7 +957,6 @@
     <ClInclude Include="..\..\source\gui\guiPopUpCtrlEx.h" />
     <ClInclude Include="..\..\source\gui\guiProgressCtrl.h" />
     <ClInclude Include="..\..\source\gui\guiSliderCtrl.h" />
-    <ClInclude Include="..\..\source\gui\guiTextCtrl.h" />
     <ClInclude Include="..\..\source\gui\guiTextEditCtrl.h" />
     <ClInclude Include="..\..\source\gui\guiTextEditSliderCtrl.h" />
     <ClInclude Include="..\..\source\gui\guiTextListCtrl.h" />

+ 0 - 15
engine/compilers/VisualStudio 2017/Torque 2D.vcxproj.filters

@@ -1116,9 +1116,6 @@
     <ClCompile Include="..\..\source\2d\scene\WorldQuery.cc">
       <Filter>2d\scene</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\source\2d\gui\guiImageButtonCtrl.cc">
-      <Filter>2d\gui</Filter>
-    </ClCompile>
     <ClCompile Include="..\..\source\2d\gui\guiSpriteCtrl.cc">
       <Filter>2d\gui</Filter>
     </ClCompile>
@@ -1372,9 +1369,6 @@
     <ClCompile Include="..\..\source\gui\containers\guiTabPageCtrl.cc">
       <Filter>gui\containers</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\source\gui\guiTextCtrl.cc">
-      <Filter>gui</Filter>
-    </ClCompile>
     <ClCompile Include="..\..\source\Box2D\Particle\b2Particle.cpp">
       <Filter>Box2D\Particle</Filter>
     </ClCompile>
@@ -2559,12 +2553,6 @@
     <ClInclude Include="..\..\source\2d\scene\WorldQuery.h">
       <Filter>2d\scene</Filter>
     </ClInclude>
-    <ClInclude Include="..\..\source\2d\gui\guiImageButtonCtrl.h">
-      <Filter>2d\gui</Filter>
-    </ClInclude>
-    <ClInclude Include="..\..\source\2d\gui\guiImageButtonCtrl_ScriptBindings.h">
-      <Filter>2d\gui</Filter>
-    </ClInclude>
     <ClInclude Include="..\..\source\2d\gui\guiSpriteCtrl.h">
       <Filter>2d\gui</Filter>
     </ClInclude>
@@ -3178,9 +3166,6 @@
     <ClInclude Include="..\..\source\gui\containers\guiTabPageCtrl.h">
       <Filter>gui\containers</Filter>
     </ClInclude>
-    <ClInclude Include="..\..\source\gui\guiTextCtrl.h">
-      <Filter>gui</Filter>
-    </ClInclude>
     <ClInclude Include="..\..\source\Box2D\Particle\b2VoronoiDiagram.h">
       <Filter>Box2D\Particle</Filter>
     </ClInclude>

BIN
engine/compilers/VisualStudio 2019/Torque 2D.aps


+ 14 - 13
engine/compilers/VisualStudio 2019/Torque 2D.rc

@@ -1,6 +1,6 @@
-//Microsoft Developer Studio generated resource script.
+// Microsoft Visual C++ generated resource script.
 //
-#include "../../Source/game/resource.h"
+#include "resource.h"
 
 #define APSTUDIO_READONLY_SYMBOLS
 /////////////////////////////////////////////////////////////////////////////
@@ -13,13 +13,11 @@
 #undef APSTUDIO_READONLY_SYMBOLS
 
 /////////////////////////////////////////////////////////////////////////////
-// English (U.S.) resources
+// English (United States) resources
 
 #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
-#ifdef _WIN32
 LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
 #pragma code_page(1252)
-#endif //_WIN32
 
 /////////////////////////////////////////////////////////////////////////////
 //
@@ -28,7 +26,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
 
 // Icon with lowest ID value placed first to ensure application icon
 // remains consistent on all systems.
-IDI_TORQUE2D               ICON    DISCARDABLE     "Torque 2D.ico"
+IDI_TORQUE2D            ICON                    "Torque 2D.ico"
+
 
 #ifdef APSTUDIO_INVOKED
 /////////////////////////////////////////////////////////////////////////////
@@ -36,18 +35,18 @@ IDI_TORQUE2D               ICON    DISCARDABLE     "Torque 2D.ico"
 // TEXTINCLUDE
 //
 
-1 TEXTINCLUDE DISCARDABLE
+1 TEXTINCLUDE 
 BEGIN
     "resource.h\0"
 END
 
-2 TEXTINCLUDE DISCARDABLE
+2 TEXTINCLUDE 
 BEGIN
     "#include ""afxres.h""\r\n"
     "\0"
 END
 
-3 TEXTINCLUDE DISCARDABLE
+3 TEXTINCLUDE 
 BEGIN
     "\r\n"
     "\0"
@@ -78,13 +77,13 @@ BEGIN
     BEGIN
         BLOCK "040904b0"
         BEGIN
-            VALUE "CompanyName", "GarageGames LLC"
+            VALUE "CompanyName", "Torque Game Engines"
             VALUE "FileDescription", "Torque 2D MIT"
             VALUE "FileVersion", "4, 0, 0, 0"
             VALUE "InternalName", "Torque 2D"
-            VALUE "LegalCopyright", "Copyright (c) 2019 GarageGames, LLC"
+            VALUE "LegalCopyright", "Copyright (c) 2020 Torque Game Engines"
             VALUE "OriginalFilename", "Torque2D.exe"
-            VALUE "ProductName", "Torque 2D MIT"
+            VALUE "ProductName", "Torque 2D"
             VALUE "ProductVersion", "4, 0, 0, 0"
         END
     END
@@ -93,7 +92,8 @@ BEGIN
         VALUE "Translation", 0x409, 1200
     END
 END
-#endif    // English (U.S.) resources
+
+#endif    // English (United States) resources
 /////////////////////////////////////////////////////////////////////////////
 
 
@@ -107,3 +107,4 @@ END
 
 /////////////////////////////////////////////////////////////////////////////
 #endif    // not APSTUDIO_INVOKED
+

+ 70 - 39
engine/compilers/VisualStudio 2019/Torque 2D.vcxproj

@@ -18,7 +18,7 @@
     <ProjectGuid>{1564A07D-230E-4C90-AEE6-52AC9A58D6C9}</ProjectGuid>
     <RootNamespace>TorqueGame</RootNamespace>
     <ProjectName>Torque2D</ProjectName>
-    <WindowsTargetPlatformVersion>10.0.16299.0</WindowsTargetPlatformVersion>
+    <WindowsTargetPlatformVersion>10.0.18362.0</WindowsTargetPlatformVersion>
   </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
@@ -247,7 +247,7 @@
     <ClCompile Include="..\..\source\2d\assets\ParticleAssetEmitter.cc" />
     <ClCompile Include="..\..\source\2d\assets\ParticleAssetField.cc" />
     <ClCompile Include="..\..\source\2d\assets\ParticleAssetFieldCollection.cc" />
-    <ClCompile Include="..\..\source\2d\assets\SkeletonAsset.cc" />
+    <ClCompile Include="..\..\source\2d\assets\SpineAsset.cc" />
     <ClCompile Include="..\..\source\2d\controllers\AmbientForceController.cc" />
     <ClCompile Include="..\..\source\2d\controllers\core\GroupedSceneController.cc" />
     <ClCompile Include="..\..\source\2d\controllers\core\PickingSceneController.cc" />
@@ -266,7 +266,6 @@
     <ClCompile Include="..\..\source\2d\core\Utility.cc" />
     <ClCompile Include="..\..\source\2d\core\Vector2.cc" />
     <ClCompile Include="..\..\source\2d\experimental\composites\WaveComposite.cc" />
-    <ClCompile Include="..\..\source\2d\gui\guiImageButtonCtrl.cc" />
     <ClCompile Include="..\..\source\2d\gui\guiSceneObjectCtrl.cc" />
     <ClCompile Include="..\..\source\2d\gui\guiSpriteCtrl.cc" />
     <ClCompile Include="..\..\source\2d\gui\SceneWindow.cc" />
@@ -279,7 +278,8 @@
     <ClCompile Include="..\..\source\2d\sceneobject\Scroller.cc" />
     <ClCompile Include="..\..\source\2d\sceneobject\LightObject.cc" />
     <ClCompile Include="..\..\source\2d\sceneobject\ShapeVector.cc" />
-    <ClCompile Include="..\..\source\2d\sceneobject\SkeletonObject.cc" />
+    <ClCompile Include="..\..\source\2d\sceneobject\SpineCollisionProxy.cc" />
+    <ClCompile Include="..\..\source\2d\sceneobject\SpineObject.cc" />
     <ClCompile Include="..\..\source\2d\sceneobject\Sprite.cc" />
     <ClCompile Include="..\..\source\2d\sceneobject\TextSprite.cc" />
     <ClCompile Include="..\..\source\2d\sceneobject\Trigger.cc" />
@@ -363,6 +363,7 @@
     <ClCompile Include="..\..\source\collection\nameTags.cpp" />
     <ClCompile Include="..\..\source\collection\undo.cc" />
     <ClCompile Include="..\..\source\collection\vector.cc" />
+    <ClCompile Include="..\..\source\console\arrayObject.cpp" />
     <ClCompile Include="..\..\source\console\consoleBaseType.cc" />
     <ClCompile Include="..\..\source\console\consoleDictionary.cc" />
     <ClCompile Include="..\..\source\console\consoleExprEvalState.cc" />
@@ -381,7 +382,7 @@
     <ClCompile Include="..\..\source\graphics\bitmapBmp.cc" />
     <ClCompile Include="..\..\source\graphics\bitmapJpeg.cc" />
     <ClCompile Include="..\..\source\graphics\bitmapPng.cc" />
-    <ClCompile Include="..\..\source\graphics\color.cc" />
+    <ClCompile Include="..\..\source\graphics\gColor.cc" />
     <ClCompile Include="..\..\source\graphics\dgl.cc" />
     <ClCompile Include="..\..\source\graphics\dglMatrix.cc" />
     <ClCompile Include="..\..\source\graphics\DynamicTexture.cc" />
@@ -393,17 +394,17 @@
     <ClCompile Include="..\..\source\graphics\TextureDictionary.cc" />
     <ClCompile Include="..\..\source\graphics\TextureHandle.cc" />
     <ClCompile Include="..\..\source\graphics\TextureManager.cc" />
+    <ClCompile Include="..\..\source\gui\containers\guiChainCtrl.cc" />
+    <ClCompile Include="..\..\source\gui\containers\guiExpandCtrl.cc" />
     <ClCompile Include="..\..\source\gui\containers\guiGridCtrl.cc" />
+    <ClCompile Include="..\..\source\gui\containers\guiTabPageCtrl.cc" />
     <ClCompile Include="..\..\source\gui\guiArrayCtrl.cc" />
-    <ClCompile Include="..\..\source\gui\guiBackgroundCtrl.cc" />
-    <ClCompile Include="..\..\source\gui\guiBitmapBorderCtrl.cc" />
     <ClCompile Include="..\..\source\gui\guiBitmapCtrl.cc" />
     <ClCompile Include="..\..\source\gui\guiBubbleTextCtrl.cc" />
     <ClCompile Include="..\..\source\gui\guiCanvas.cc" />
     <ClCompile Include="..\..\source\gui\guiColorPicker.cc" />
     <ClCompile Include="..\..\source\gui\guiConsole.cc" />
     <ClCompile Include="..\..\source\gui\guiConsoleEditCtrl.cc" />
-    <ClCompile Include="..\..\source\gui\guiConsoleTextCtrl.cc" />
     <ClCompile Include="..\..\source\gui\guiControl.cc" />
     <ClCompile Include="..\..\source\gui\guiDefaultControlRender.cc" />
     <ClCompile Include="..\..\source\gui\guiFadeinBitmapCtrl.cc" />
@@ -416,10 +417,7 @@
     <ClCompile Include="..\..\source\gui\guiPopUpCtrl.cc" />
     <ClCompile Include="..\..\source\gui\guiPopUpCtrlEx.cc" />
     <ClCompile Include="..\..\source\gui\guiProgressCtrl.cc" />
-    <ClCompile Include="..\..\source\gui\guiScriptNotifyControl.cc" />
     <ClCompile Include="..\..\source\gui\guiSliderCtrl.cc" />
-    <ClCompile Include="..\..\source\gui\guiTabPageCtrl.cc" />
-    <ClCompile Include="..\..\source\gui\guiTextCtrl.cc" />
     <ClCompile Include="..\..\source\gui\guiTextEditCtrl.cc" />
     <ClCompile Include="..\..\source\gui\guiTextEditSliderCtrl.cc" />
     <ClCompile Include="..\..\source\gui\guiTextListCtrl.cc" />
@@ -454,6 +452,7 @@
     <ClCompile Include="..\..\source\io\zip\zipSubStream.cc" />
     <ClCompile Include="..\..\source\io\zip\zipTempStream.cc" />
     <ClCompile Include="..\..\source\math\math_ScriptBinding.cc" />
+    <ClCompile Include="..\..\source\math\mFluid.cpp" />
     <ClCompile Include="..\..\source\math\mPoint.cpp" />
     <ClCompile Include="..\..\source\math\rectClipper.cpp" />
     <ClCompile Include="..\..\source\memory\dataChunker.cc" />
@@ -603,6 +602,7 @@
     <ClCompile Include="..\..\source\spine\Animation.c" />
     <ClCompile Include="..\..\source\spine\AnimationState.c" />
     <ClCompile Include="..\..\source\spine\AnimationStateData.c" />
+    <ClCompile Include="..\..\source\spine\Array.c" />
     <ClCompile Include="..\..\source\spine\Atlas.c" />
     <ClCompile Include="..\..\source\spine\AtlasAttachmentLoader.c" />
     <ClCompile Include="..\..\source\spine\Attachment.c" />
@@ -610,18 +610,34 @@
     <ClCompile Include="..\..\source\spine\Bone.c" />
     <ClCompile Include="..\..\source\spine\BoneData.c" />
     <ClCompile Include="..\..\source\spine\BoundingBoxAttachment.c" />
+    <ClCompile Include="..\..\source\spine\ClippingAttachment.c" />
+    <ClCompile Include="..\..\source\spine\Color.c" />
     <ClCompile Include="..\..\source\spine\Event.c" />
     <ClCompile Include="..\..\source\spine\EventData.c" />
     <ClCompile Include="..\..\source\spine\extension.c" />
+    <ClCompile Include="..\..\source\spine\IkConstraint.c" />
+    <ClCompile Include="..\..\source\spine\IkConstraintData.c" />
     <ClCompile Include="..\..\source\spine\Json.c" />
+    <ClCompile Include="..\..\source\spine\MeshAttachment.c" />
+    <ClCompile Include="..\..\source\spine\PathAttachment.c" />
+    <ClCompile Include="..\..\source\spine\PathConstraint.c" />
+    <ClCompile Include="..\..\source\spine\PathConstraintData.c" />
+    <ClCompile Include="..\..\source\spine\PointAttachment.c" />
     <ClCompile Include="..\..\source\spine\RegionAttachment.c" />
     <ClCompile Include="..\..\source\spine\Skeleton.c" />
+    <ClCompile Include="..\..\source\spine\SkeletonBinary.c" />
     <ClCompile Include="..\..\source\spine\SkeletonBounds.c" />
+    <ClCompile Include="..\..\source\spine\SkeletonClipping.c" />
     <ClCompile Include="..\..\source\spine\SkeletonData.c" />
     <ClCompile Include="..\..\source\spine\SkeletonJson.c" />
     <ClCompile Include="..\..\source\spine\Skin.c" />
     <ClCompile Include="..\..\source\spine\Slot.c" />
     <ClCompile Include="..\..\source\spine\SlotData.c" />
+    <ClCompile Include="..\..\source\spine\TransformConstraint.c" />
+    <ClCompile Include="..\..\source\spine\TransformConstraintData.c" />
+    <ClCompile Include="..\..\source\spine\Triangulator.c" />
+    <ClCompile Include="..\..\source\spine\VertexAttachment.c" />
+    <ClCompile Include="..\..\source\spine\VertexEffect.c" />
     <ClCompile Include="..\..\source\string\findMatch.cc" />
     <ClCompile Include="..\..\source\string\stringBuffer.cc" />
     <ClCompile Include="..\..\source\string\stringStack.cc" />
@@ -632,15 +648,11 @@
     <ClCompile Include="..\..\source\gui\buttons\guiCheckBoxCtrl.cc" />
     <ClCompile Include="..\..\source\gui\buttons\guiRadioCtrl.cc" />
     <ClCompile Include="..\..\source\gui\containers\guiAutoScrollCtrl.cc" />
-    <ClCompile Include="..\..\source\gui\containers\guiCtrlArrayCtrl.cc" />
     <ClCompile Include="..\..\source\gui\containers\guiDragAndDropCtrl.cc" />
-    <ClCompile Include="..\..\source\gui\containers\guiDynamicCtrlArrayCtrl.cc" />
     <ClCompile Include="..\..\source\gui\containers\guiFormCtrl.cc" />
-    <ClCompile Include="..\..\source\gui\containers\guiFrameCtrl.cc" />
-    <ClCompile Include="..\..\source\gui\containers\guiPaneCtrl.cc" />
+    <ClCompile Include="..\..\source\gui\containers\guiPanelCtrl.cc" />
     <ClCompile Include="..\..\source\gui\containers\guiRolloutCtrl.cc" />
     <ClCompile Include="..\..\source\gui\containers\guiScrollCtrl.cc" />
-    <ClCompile Include="..\..\source\gui\containers\guiStackCtrl.cc" />
     <ClCompile Include="..\..\source\gui\containers\guiTabBookCtrl.cc" />
     <ClCompile Include="..\..\source\gui\containers\guiWindowCtrl.cc" />
     <ClCompile Include="..\..\source\gui\editor\guiControlListPopup.cc" />
@@ -648,11 +660,9 @@
     <ClCompile Include="..\..\source\gui\editor\guiEditCtrl.cc" />
     <ClCompile Include="..\..\source\gui\editor\guiFilterCtrl.cc" />
     <ClCompile Include="..\..\source\gui\editor\guiGraphCtrl.cc" />
-    <ClCompile Include="..\..\source\gui\editor\guiImageList.cc" />
     <ClCompile Include="..\..\source\gui\editor\guiInspector.cc" />
     <ClCompile Include="..\..\source\gui\editor\guiInspectorTypes.cc" />
     <ClCompile Include="..\..\source\gui\editor\guiMenuBar.cc" />
-    <ClCompile Include="..\..\source\gui\editor\guiSeparatorCtrl.cc" />
     <ClCompile Include="..\..\source\testing\tests\platformFileIoTests.cc" />
     <ClCompile Include="..\..\source\testing\tests\platformMemoryTests.cc" />
     <ClCompile Include="..\..\source\testing\tests\platformStringTests.cc" />
@@ -671,8 +681,8 @@
     <ClInclude Include="..\..\source\2d\assets\ParticleAssetField.h" />
     <ClInclude Include="..\..\source\2d\assets\ParticleAssetFieldCollection.h" />
     <ClInclude Include="..\..\source\2d\assets\ParticleAsset_ScriptBinding.h" />
-    <ClInclude Include="..\..\source\2d\assets\SkeletonAsset.h" />
-    <ClInclude Include="..\..\source\2d\assets\SkeletonAsset_ScriptBinding.h" />
+    <ClInclude Include="..\..\source\2d\assets\SpineAsset.h" />
+    <ClInclude Include="..\..\source\2d\assets\SpineAsset_ScriptBinding.h" />
     <ClInclude Include="..\..\source\2d\controllers\AmbientForceController.h" />
     <ClInclude Include="..\..\source\2d\controllers\AmbientForceController_ScriptBinding.h" />
     <ClInclude Include="..\..\source\2d\controllers\core\GroupedSceneController.h" />
@@ -703,8 +713,6 @@
     <ClInclude Include="..\..\source\2d\core\Vector2_ScriptBinding.h" />
     <ClInclude Include="..\..\source\2d\experimental\composites\WaveComposite.h" />
     <ClInclude Include="..\..\source\2d\experimental\composites\WaveComposite_ScriptBinding.h" />
-    <ClInclude Include="..\..\source\2d\gui\guiImageButtonCtrl.h" />
-    <ClInclude Include="..\..\source\2d\gui\guiImageButtonCtrl_ScriptBindings.h" />
     <ClInclude Include="..\..\source\2d\gui\guiSceneObjectCtrl.h" />
     <ClInclude Include="..\..\source\2d\gui\guiSpriteCtrl.h" />
     <ClInclude Include="..\..\source\2d\gui\guiSpriteCtrl_ScriptBindings.h" />
@@ -729,8 +737,9 @@
     <ClInclude Include="..\..\source\2d\sceneobject\LightObject_ScriptBinding.h" />
     <ClInclude Include="..\..\source\2d\sceneobject\ShapeVector.h" />
     <ClInclude Include="..\..\source\2d\sceneobject\ShapeVector_ScriptBinding.h" />
-    <ClInclude Include="..\..\source\2d\sceneobject\SkeletonObject.h" />
-    <ClInclude Include="..\..\source\2d\sceneobject\SkeletonObject_ScriptBinding.h" />
+    <ClInclude Include="..\..\source\2d\sceneobject\SpineCollisionProxy.h" />
+    <ClInclude Include="..\..\source\2d\sceneobject\SpineObject.h" />
+    <ClInclude Include="..\..\source\2d\sceneobject\SpineObject_ScriptBinding.h" />
     <ClInclude Include="..\..\source\2d\sceneobject\Sprite.h" />
     <ClInclude Include="..\..\source\2d\sceneobject\Sprite_ScriptBinding.h" />
     <ClInclude Include="..\..\source\2d\sceneobject\TextSprite.h" />
@@ -862,6 +871,8 @@
     <ClInclude Include="..\..\source\component\behaviors\behaviorTemplate_ScriptBinding.h" />
     <ClInclude Include="..\..\source\component\dynamicConsoleMethodComponent_ScriptBinding.h" />
     <ClInclude Include="..\..\source\component\simComponent_ScriptBinding.h" />
+    <ClInclude Include="..\..\source\console\arrayObject.h" />
+    <ClInclude Include="..\..\source\console\arrayObject_ScriptBinding.h" />
     <ClInclude Include="..\..\source\console\consoleBaseType.h" />
     <ClInclude Include="..\..\source\console\consoleDictionary.h" />
     <ClInclude Include="..\..\source\console\consoleDoc_ScriptBinding.h" />
@@ -895,8 +906,8 @@
     <ClInclude Include="..\..\source\game\gameInterface.h" />
     <ClInclude Include="..\..\source\game\gameInterface_ScriptBinding.h" />
     <ClInclude Include="..\..\source\game\version_ScriptBinding.h" />
-    <ClInclude Include="..\..\source\graphics\color.h" />
-    <ClInclude Include="..\..\source\graphics\color_ScriptBinding.h" />
+    <ClInclude Include="..\..\source\graphics\gColor.h" />
+    <ClInclude Include="..\..\source\graphics\gColor_ScriptBinding.h" />
     <ClInclude Include="..\..\source\graphics\dgl.h" />
     <ClInclude Include="..\..\source\graphics\dglMac_Scriptbinding.h" />
     <ClInclude Include="..\..\source\graphics\dgl_ScriptBinding.h" />
@@ -913,12 +924,19 @@
     <ClInclude Include="..\..\source\graphics\TextureManager.h" />
     <ClInclude Include="..\..\source\graphics\TextureManager_ScriptBinding.h" />
     <ClInclude Include="..\..\source\graphics\TextureObject.h" />
+    <ClInclude Include="..\..\source\gui\buttons\guiButtonCtrl_ScriptBinding.h" />
     <ClInclude Include="..\..\source\gui\buttons\guiCheckBoxCtrl_ScriptBinding.h" />
+    <ClInclude Include="..\..\source\gui\containers\guiChainCtrl.h" />
+    <ClInclude Include="..\..\source\gui\containers\guiChainCtrl_ScriptBinding.h" />
+    <ClInclude Include="..\..\source\gui\containers\guiExpandCtrl.h" />
+    <ClInclude Include="..\..\source\gui\containers\guiExpandCtrl_ScriptBinding.h" />
     <ClInclude Include="..\..\source\gui\containers\guiGridCtrl.h" />
+    <ClInclude Include="..\..\source\gui\containers\guiGridCtrl_ScriptBinding.h" />
+    <ClInclude Include="..\..\source\gui\containers\guiPanelCtrl_ScriptBinding.h" />
     <ClInclude Include="..\..\source\gui\containers\guiScrollCtrl_ScriptBinding.h" />
     <ClInclude Include="..\..\source\gui\containers\guiTabBookCtrl_ScriptBinding.h" />
+    <ClInclude Include="..\..\source\gui\containers\guiTabPageCtrl.h" />
     <ClInclude Include="..\..\source\gui\guiArrayCtrl.h" />
-    <ClInclude Include="..\..\source\gui\guiBackgroundCtrl.h" />
     <ClInclude Include="..\..\source\gui\guiBitmapCtrl.h" />
     <ClInclude Include="..\..\source\gui\guiBubbleTextCtrl.h" />
     <ClInclude Include="..\..\source\gui\guiCanvas.h" />
@@ -926,7 +944,6 @@
     <ClInclude Include="..\..\source\gui\guiColorPicker.h" />
     <ClInclude Include="..\..\source\gui\guiConsole.h" />
     <ClInclude Include="..\..\source\gui\guiConsoleEditCtrl.h" />
-    <ClInclude Include="..\..\source\gui\guiConsoleTextCtrl.h" />
     <ClInclude Include="..\..\source\gui\guiControl.h" />
     <ClInclude Include="..\..\source\gui\guiControl_ScriptBinding.h" />
     <ClInclude Include="..\..\source\gui\guiDefaultControlRender.h" />
@@ -939,10 +956,7 @@
     <ClInclude Include="..\..\source\gui\guiPopUpCtrl.h" />
     <ClInclude Include="..\..\source\gui\guiPopUpCtrlEx.h" />
     <ClInclude Include="..\..\source\gui\guiProgressCtrl.h" />
-    <ClInclude Include="..\..\source\gui\guiScriptNotifyControl.h" />
     <ClInclude Include="..\..\source\gui\guiSliderCtrl.h" />
-    <ClInclude Include="..\..\source\gui\guiTabPageCtrl.h" />
-    <ClInclude Include="..\..\source\gui\guiTextCtrl.h" />
     <ClInclude Include="..\..\source\gui\guiTextEditCtrl.h" />
     <ClInclude Include="..\..\source\gui\guiTextEditSliderCtrl.h" />
     <ClInclude Include="..\..\source\gui\guiTextListCtrl.h" />
@@ -982,6 +996,7 @@
     <ClInclude Include="..\..\source\io\zip\zipTempStream.h" />
     <ClInclude Include="..\..\source\math\box_ScriptBinding.h" />
     <ClInclude Include="..\..\source\math\matrix_ScriptBinding.h" />
+    <ClInclude Include="..\..\source\math\mFluid.h" />
     <ClInclude Include="..\..\source\math\mNormalDistribution.h" />
     <ClInclude Include="..\..\source\math\random_ScriptBinding.h" />
     <ClInclude Include="..\..\source\math\rectClipper.h" />
@@ -1206,6 +1221,7 @@
     <ClInclude Include="..\..\source\spine\Animation.h" />
     <ClInclude Include="..\..\source\spine\AnimationState.h" />
     <ClInclude Include="..\..\source\spine\AnimationStateData.h" />
+    <ClInclude Include="..\..\source\spine\Array.h" />
     <ClInclude Include="..\..\source\spine\Atlas.h" />
     <ClInclude Include="..\..\source\spine\AtlasAttachmentLoader.h" />
     <ClInclude Include="..\..\source\spine\Attachment.h" />
@@ -1213,19 +1229,36 @@
     <ClInclude Include="..\..\source\spine\Bone.h" />
     <ClInclude Include="..\..\source\spine\BoneData.h" />
     <ClInclude Include="..\..\source\spine\BoundingBoxAttachment.h" />
+    <ClInclude Include="..\..\source\spine\ClippingAttachment.h" />
+    <ClInclude Include="..\..\source\spine\Color.h" />
+    <ClInclude Include="..\..\source\spine\dll.h" />
     <ClInclude Include="..\..\source\spine\Event.h" />
     <ClInclude Include="..\..\source\spine\EventData.h" />
     <ClInclude Include="..\..\source\spine\extension.h" />
+    <ClInclude Include="..\..\source\spine\IkConstraint.h" />
+    <ClInclude Include="..\..\source\spine\IkConstraintData.h" />
     <ClInclude Include="..\..\source\spine\Json.h" />
+    <ClInclude Include="..\..\source\spine\MeshAttachment.h" />
+    <ClInclude Include="..\..\source\spine\PathAttachment.h" />
+    <ClInclude Include="..\..\source\spine\PathConstraint.h" />
+    <ClInclude Include="..\..\source\spine\PathConstraintData.h" />
+    <ClInclude Include="..\..\source\spine\PointAttachment.h" />
     <ClInclude Include="..\..\source\spine\RegionAttachment.h" />
     <ClInclude Include="..\..\source\spine\Skeleton.h" />
+    <ClInclude Include="..\..\source\spine\SkeletonBinary.h" />
     <ClInclude Include="..\..\source\spine\SkeletonBounds.h" />
+    <ClInclude Include="..\..\source\spine\SkeletonClipping.h" />
     <ClInclude Include="..\..\source\spine\SkeletonData.h" />
     <ClInclude Include="..\..\source\spine\SkeletonJson.h" />
     <ClInclude Include="..\..\source\spine\Skin.h" />
     <ClInclude Include="..\..\source\spine\Slot.h" />
     <ClInclude Include="..\..\source\spine\SlotData.h" />
     <ClInclude Include="..\..\source\spine\spine.h" />
+    <ClInclude Include="..\..\source\spine\TransformConstraint.h" />
+    <ClInclude Include="..\..\source\spine\TransformConstraintData.h" />
+    <ClInclude Include="..\..\source\spine\Triangulator.h" />
+    <ClInclude Include="..\..\source\spine\VertexAttachment.h" />
+    <ClInclude Include="..\..\source\spine\VertexEffect.h" />
     <ClInclude Include="..\..\source\string\findMatch.h" />
     <ClInclude Include="..\..\source\string\stringBuffer.h" />
     <ClInclude Include="..\..\source\string\stringBuffer_ScriptBinding.h" />
@@ -1238,29 +1271,24 @@
     <ClInclude Include="..\..\source\gui\buttons\guiCheckBoxCtrl.h" />
     <ClInclude Include="..\..\source\gui\buttons\guiRadioCtrl.h" />
     <ClInclude Include="..\..\source\gui\containers\guiAutoScrollCtrl.h" />
-    <ClInclude Include="..\..\source\gui\containers\guiCtrlArrayCtrl.h" />
     <ClInclude Include="..\..\source\gui\containers\guiDragAndDropCtrl.h" />
-    <ClInclude Include="..\..\source\gui\containers\guiDynamicCtrlArrayCtrl.h" />
     <ClInclude Include="..\..\source\gui\containers\guiFormCtrl.h" />
-    <ClInclude Include="..\..\source\gui\containers\guiFrameCtrl.h" />
-    <ClInclude Include="..\..\source\gui\containers\guiPaneCtrl.h" />
+    <ClInclude Include="..\..\source\gui\containers\guiPanelCtrl.h" />
     <ClInclude Include="..\..\source\gui\containers\guiRolloutCtrl.h" />
     <ClInclude Include="..\..\source\gui\containers\guiScrollCtrl.h" />
-    <ClInclude Include="..\..\source\gui\containers\guiStackCtrl.h" />
     <ClInclude Include="..\..\source\gui\containers\guiTabBookCtrl.h" />
     <ClInclude Include="..\..\source\gui\containers\guiWindowCtrl.h" />
     <ClInclude Include="..\..\source\gui\editor\guiDebugger.h" />
     <ClInclude Include="..\..\source\gui\editor\guiEditCtrl.h" />
     <ClInclude Include="..\..\source\gui\editor\guiFilterCtrl.h" />
     <ClInclude Include="..\..\source\gui\editor\guiGraphCtrl.h" />
-    <ClInclude Include="..\..\source\gui\editor\guiImageList.h" />
     <ClInclude Include="..\..\source\gui\editor\guiInspector.h" />
     <ClInclude Include="..\..\source\gui\editor\guiInspectorTypes.h" />
     <ClInclude Include="..\..\source\gui\editor\guiMenuBar.h" />
-    <ClInclude Include="..\..\source\gui\editor\guiSeparatorCtrl.h" />
     <ClInclude Include="..\..\source\testing\unitTesting.h" />
     <ClInclude Include="..\..\source\testing\unitTesting_ScriptBinding.h" />
     <ClInclude Include="..\..\source\torqueConfig.h" />
+    <ClInclude Include="resource.h" />
   </ItemGroup>
   <ItemGroup>
     <CustomBuild Include="..\..\source\math\mMath_ASM.asm">
@@ -1326,10 +1354,13 @@
       <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
     </ProjectReference>
   </ItemGroup>
+  <ItemGroup>
+    <Image Include="Torque 2D.ico" />
+  </ItemGroup>
   <ItemGroup>
     <None Include="..\..\source\Box2D\Particle\b2ParticleAssembly.neon.s" />
   </ItemGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">
   </ImportGroup>
-</Project>
+</Project>

+ 197 - 112
engine/compilers/VisualStudio 2019/Torque 2D.vcxproj.filters

@@ -465,33 +465,18 @@
     <ClCompile Include="..\..\source\gui\containers\guiAutoScrollCtrl.cc">
       <Filter>gui\containers</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\source\gui\containers\guiCtrlArrayCtrl.cc">
-      <Filter>gui\containers</Filter>
-    </ClCompile>
     <ClCompile Include="..\..\source\gui\containers\guiDragAndDropCtrl.cc">
       <Filter>gui\containers</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\source\gui\containers\guiDynamicCtrlArrayCtrl.cc">
-      <Filter>gui\containers</Filter>
-    </ClCompile>
     <ClCompile Include="..\..\source\gui\containers\guiFormCtrl.cc">
       <Filter>gui\containers</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\source\gui\containers\guiFrameCtrl.cc">
-      <Filter>gui\containers</Filter>
-    </ClCompile>
-    <ClCompile Include="..\..\source\gui\containers\guiPaneCtrl.cc">
-      <Filter>gui\containers</Filter>
-    </ClCompile>
     <ClCompile Include="..\..\source\gui\containers\guiRolloutCtrl.cc">
       <Filter>gui\containers</Filter>
     </ClCompile>
     <ClCompile Include="..\..\source\gui\containers\guiScrollCtrl.cc">
       <Filter>gui\containers</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\source\gui\containers\guiStackCtrl.cc">
-      <Filter>gui\containers</Filter>
-    </ClCompile>
     <ClCompile Include="..\..\source\gui\containers\guiTabBookCtrl.cc">
       <Filter>gui\containers</Filter>
     </ClCompile>
@@ -513,9 +498,6 @@
     <ClCompile Include="..\..\source\gui\editor\guiGraphCtrl.cc">
       <Filter>gui\editor</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\source\gui\editor\guiImageList.cc">
-      <Filter>gui\editor</Filter>
-    </ClCompile>
     <ClCompile Include="..\..\source\gui\editor\guiInspector.cc">
       <Filter>gui\editor</Filter>
     </ClCompile>
@@ -525,9 +507,6 @@
     <ClCompile Include="..\..\source\gui\editor\guiMenuBar.cc">
       <Filter>gui\editor</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\source\gui\editor\guiSeparatorCtrl.cc">
-      <Filter>gui\editor</Filter>
-    </ClCompile>
     <ClCompile Include="..\..\source\Box2D\Collision\b2BroadPhase.cpp">
       <Filter>Box2D\Collision</Filter>
     </ClCompile>
@@ -762,12 +741,6 @@
     <ClCompile Include="..\..\source\gui\guiArrayCtrl.cc">
       <Filter>gui</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\source\gui\guiBackgroundCtrl.cc">
-      <Filter>gui</Filter>
-    </ClCompile>
-    <ClCompile Include="..\..\source\gui\guiBitmapBorderCtrl.cc">
-      <Filter>gui</Filter>
-    </ClCompile>
     <ClCompile Include="..\..\source\gui\guiBitmapCtrl.cc">
       <Filter>gui</Filter>
     </ClCompile>
@@ -786,9 +759,6 @@
     <ClCompile Include="..\..\source\gui\guiConsoleEditCtrl.cc">
       <Filter>gui</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\source\gui\guiConsoleTextCtrl.cc">
-      <Filter>gui</Filter>
-    </ClCompile>
     <ClCompile Include="..\..\source\gui\guiControl.cc">
       <Filter>gui</Filter>
     </ClCompile>
@@ -825,18 +795,9 @@
     <ClCompile Include="..\..\source\gui\guiProgressCtrl.cc">
       <Filter>gui</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\source\gui\guiScriptNotifyControl.cc">
-      <Filter>gui</Filter>
-    </ClCompile>
     <ClCompile Include="..\..\source\gui\guiSliderCtrl.cc">
       <Filter>gui</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\source\gui\guiTabPageCtrl.cc">
-      <Filter>gui</Filter>
-    </ClCompile>
-    <ClCompile Include="..\..\source\gui\guiTextCtrl.cc">
-      <Filter>gui</Filter>
-    </ClCompile>
     <ClCompile Include="..\..\source\gui\guiTextEditCtrl.cc">
       <Filter>gui</Filter>
     </ClCompile>
@@ -1155,9 +1116,6 @@
     <ClCompile Include="..\..\source\2d\scene\WorldQuery.cc">
       <Filter>2d\scene</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\source\2d\gui\guiImageButtonCtrl.cc">
-      <Filter>2d\gui</Filter>
-    </ClCompile>
     <ClCompile Include="..\..\source\2d\gui\guiSpriteCtrl.cc">
       <Filter>2d\gui</Filter>
     </ClCompile>
@@ -1212,9 +1170,6 @@
     <ClCompile Include="..\..\source\platformWin32\nativeDialogs\win32FileDialog.cc">
       <Filter>platformWin32\nativeDialogs</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\source\graphics\color.cc">
-      <Filter>graphics</Filter>
-    </ClCompile>
     <ClCompile Include="..\..\source\2d\assets\ParticleAsset.cc">
       <Filter>2d\assets</Filter>
     </ClCompile>
@@ -1389,12 +1344,6 @@
     <ClCompile Include="..\..\source\spine\SlotData.c">
       <Filter>spine</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\source\2d\assets\SkeletonAsset.cc">
-      <Filter>2d\assets</Filter>
-    </ClCompile>
-    <ClCompile Include="..\..\source\2d\sceneobject\SkeletonObject.cc">
-      <Filter>2d\sceneobject</Filter>
-    </ClCompile>
     <ClCompile Include="..\..\source\audio\vorbisStreamSource.cc">
       <Filter>audio</Filter>
     </ClCompile>
@@ -1417,6 +1366,9 @@
     <ClCompile Include="..\..\source\platform\platformNet.cpp" />
     <ClCompile Include="..\..\source\platform\platformNetAsync.cpp" />
     <ClCompile Include="..\..\source\platform\platformNet_ScriptBinding.cc" />
+    <ClCompile Include="..\..\source\gui\containers\guiTabPageCtrl.cc">
+      <Filter>gui\containers</Filter>
+    </ClCompile>
     <ClCompile Include="..\..\source\Box2D\Particle\b2Particle.cpp">
       <Filter>Box2D\Particle</Filter>
     </ClCompile>
@@ -1447,6 +1399,84 @@
     <ClCompile Include="..\..\source\2d\sceneobject\Path.cc">
       <Filter>2d\sceneobject</Filter>
     </ClCompile>
+    <ClCompile Include="..\..\source\spine\Array.c">
+      <Filter>spine</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\source\spine\ClippingAttachment.c">
+      <Filter>spine</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\source\spine\Color.c">
+      <Filter>spine</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\source\spine\IkConstraint.c">
+      <Filter>spine</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\source\spine\IkConstraintData.c">
+      <Filter>spine</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\source\spine\MeshAttachment.c">
+      <Filter>spine</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\source\spine\PathAttachment.c">
+      <Filter>spine</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\source\spine\PathConstraint.c">
+      <Filter>spine</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\source\spine\PathConstraintData.c">
+      <Filter>spine</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\source\spine\PointAttachment.c">
+      <Filter>spine</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\source\spine\SkeletonBinary.c">
+      <Filter>spine</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\source\spine\SkeletonClipping.c">
+      <Filter>spine</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\source\spine\TransformConstraint.c">
+      <Filter>spine</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\source\spine\TransformConstraintData.c">
+      <Filter>spine</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\source\spine\Triangulator.c">
+      <Filter>spine</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\source\spine\VertexAttachment.c">
+      <Filter>spine</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\source\spine\VertexEffect.c">
+      <Filter>spine</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\source\graphics\gColor.cc">
+      <Filter>graphics</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\source\2d\sceneobject\SpineObject.cc">
+      <Filter>2d\sceneobject</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\source\2d\assets\SpineAsset.cc">
+      <Filter>2d\assets</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\source\2d\sceneobject\SpineCollisionProxy.cc">
+      <Filter>2d\sceneobject</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\source\console\arrayObject.cpp">
+      <Filter>console</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\source\math\mFluid.cpp">
+      <Filter>math</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\source\gui\containers\guiExpandCtrl.cc">
+      <Filter>gui\containers</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\source\gui\containers\guiPanelCtrl.cc">
+      <Filter>gui\containers</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\source\gui\containers\guiChainCtrl.cc">
+      <Filter>gui\containers</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="..\..\source\audio\audio.h">
@@ -1731,33 +1761,18 @@
     <ClInclude Include="..\..\source\gui\containers\guiAutoScrollCtrl.h">
       <Filter>gui\containers</Filter>
     </ClInclude>
-    <ClInclude Include="..\..\source\gui\containers\guiCtrlArrayCtrl.h">
-      <Filter>gui\containers</Filter>
-    </ClInclude>
     <ClInclude Include="..\..\source\gui\containers\guiDragAndDropCtrl.h">
       <Filter>gui\containers</Filter>
     </ClInclude>
-    <ClInclude Include="..\..\source\gui\containers\guiDynamicCtrlArrayCtrl.h">
-      <Filter>gui\containers</Filter>
-    </ClInclude>
     <ClInclude Include="..\..\source\gui\containers\guiFormCtrl.h">
       <Filter>gui\containers</Filter>
     </ClInclude>
-    <ClInclude Include="..\..\source\gui\containers\guiFrameCtrl.h">
-      <Filter>gui\containers</Filter>
-    </ClInclude>
-    <ClInclude Include="..\..\source\gui\containers\guiPaneCtrl.h">
-      <Filter>gui\containers</Filter>
-    </ClInclude>
     <ClInclude Include="..\..\source\gui\containers\guiRolloutCtrl.h">
       <Filter>gui\containers</Filter>
     </ClInclude>
     <ClInclude Include="..\..\source\gui\containers\guiScrollCtrl.h">
       <Filter>gui\containers</Filter>
     </ClInclude>
-    <ClInclude Include="..\..\source\gui\containers\guiStackCtrl.h">
-      <Filter>gui\containers</Filter>
-    </ClInclude>
     <ClInclude Include="..\..\source\gui\containers\guiTabBookCtrl.h">
       <Filter>gui\containers</Filter>
     </ClInclude>
@@ -1776,9 +1791,6 @@
     <ClInclude Include="..\..\source\gui\editor\guiGraphCtrl.h">
       <Filter>gui\editor</Filter>
     </ClInclude>
-    <ClInclude Include="..\..\source\gui\editor\guiImageList.h">
-      <Filter>gui\editor</Filter>
-    </ClInclude>
     <ClInclude Include="..\..\source\gui\editor\guiInspector.h">
       <Filter>gui\editor</Filter>
     </ClInclude>
@@ -1788,9 +1800,6 @@
     <ClInclude Include="..\..\source\gui\editor\guiMenuBar.h">
       <Filter>gui\editor</Filter>
     </ClInclude>
-    <ClInclude Include="..\..\source\gui\editor\guiSeparatorCtrl.h">
-      <Filter>gui\editor</Filter>
-    </ClInclude>
     <ClInclude Include="..\..\source\Box2D\Box2D.h">
       <Filter>Box2D</Filter>
     </ClInclude>
@@ -2070,9 +2079,6 @@
     <ClInclude Include="..\..\source\gui\guiArrayCtrl.h">
       <Filter>gui</Filter>
     </ClInclude>
-    <ClInclude Include="..\..\source\gui\guiBackgroundCtrl.h">
-      <Filter>gui</Filter>
-    </ClInclude>
     <ClInclude Include="..\..\source\gui\guiBitmapCtrl.h">
       <Filter>gui</Filter>
     </ClInclude>
@@ -2091,9 +2097,6 @@
     <ClInclude Include="..\..\source\gui\guiConsoleEditCtrl.h">
       <Filter>gui</Filter>
     </ClInclude>
-    <ClInclude Include="..\..\source\gui\guiConsoleTextCtrl.h">
-      <Filter>gui</Filter>
-    </ClInclude>
     <ClInclude Include="..\..\source\gui\guiControl.h">
       <Filter>gui</Filter>
     </ClInclude>
@@ -2127,18 +2130,9 @@
     <ClInclude Include="..\..\source\gui\guiProgressCtrl.h">
       <Filter>gui</Filter>
     </ClInclude>
-    <ClInclude Include="..\..\source\gui\guiScriptNotifyControl.h">
-      <Filter>gui</Filter>
-    </ClInclude>
     <ClInclude Include="..\..\source\gui\guiSliderCtrl.h">
       <Filter>gui</Filter>
     </ClInclude>
-    <ClInclude Include="..\..\source\gui\guiTabPageCtrl.h">
-      <Filter>gui</Filter>
-    </ClInclude>
-    <ClInclude Include="..\..\source\gui\guiTextCtrl.h">
-      <Filter>gui</Filter>
-    </ClInclude>
     <ClInclude Include="..\..\source\gui\guiTextEditCtrl.h">
       <Filter>gui</Filter>
     </ClInclude>
@@ -2274,9 +2268,6 @@
     <ClInclude Include="..\..\source\algorithm\hashFunction.h">
       <Filter>algorithm</Filter>
     </ClInclude>
-    <ClInclude Include="..\..\source\graphics\color.h">
-      <Filter>graphics</Filter>
-    </ClInclude>
     <ClInclude Include="..\..\source\collection\bitMatrix.h">
       <Filter>collection</Filter>
     </ClInclude>
@@ -2562,12 +2553,6 @@
     <ClInclude Include="..\..\source\2d\scene\WorldQuery.h">
       <Filter>2d\scene</Filter>
     </ClInclude>
-    <ClInclude Include="..\..\source\2d\gui\guiImageButtonCtrl.h">
-      <Filter>2d\gui</Filter>
-    </ClInclude>
-    <ClInclude Include="..\..\source\2d\gui\guiImageButtonCtrl_ScriptBindings.h">
-      <Filter>2d\gui</Filter>
-    </ClInclude>
     <ClInclude Include="..\..\source\2d\gui\guiSpriteCtrl.h">
       <Filter>2d\gui</Filter>
     </ClInclude>
@@ -2865,9 +2850,6 @@
     <ClInclude Include="..\..\source\console\expando_ScriptBinding.h">
       <Filter>console</Filter>
     </ClInclude>
-    <ClInclude Include="..\..\source\graphics\color_ScriptBinding.h">
-      <Filter>graphics</Filter>
-    </ClInclude>
     <ClInclude Include="..\..\source\sim\simObject_ScriptBinding.h">
       <Filter>sim</Filter>
     </ClInclude>
@@ -3127,18 +3109,6 @@
     <ClInclude Include="..\..\source\spine\spine.h">
       <Filter>spine</Filter>
     </ClInclude>
-    <ClInclude Include="..\..\source\2d\assets\SkeletonAsset.h">
-      <Filter>2d\assets</Filter>
-    </ClInclude>
-    <ClInclude Include="..\..\source\2d\assets\SkeletonAsset_ScriptBinding.h">
-      <Filter>2d\assets</Filter>
-    </ClInclude>
-    <ClInclude Include="..\..\source\2d\sceneobject\SkeletonObject_ScriptBinding.h">
-      <Filter>2d\sceneobject</Filter>
-    </ClInclude>
-    <ClInclude Include="..\..\source\2d\sceneobject\SkeletonObject.h">
-      <Filter>2d\sceneobject</Filter>
-    </ClInclude>
     <ClInclude Include="..\..\source\audio\vorbisStreamSource.h">
       <Filter>audio</Filter>
     </ClInclude>
@@ -3186,9 +3156,16 @@
     <ClInclude Include="..\..\source\gui\containers\guiTabBookCtrl_ScriptBinding.h">
       <Filter>gui\containers</Filter>
     </ClInclude>
+    <ClInclude Include="resource.h" />
+    <ClInclude Include="..\..\source\gui\containers\guiGridCtrl_ScriptBinding.h">
+      <Filter>gui\containers</Filter>
+    </ClInclude>
     <ClInclude Include="..\..\source\gui\containers\guiScrollCtrl_ScriptBinding.h">
       <Filter>gui\containers</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\source\gui\containers\guiTabPageCtrl.h">
+      <Filter>gui\containers</Filter>
+    </ClInclude>
     <ClInclude Include="..\..\source\Box2D\Particle\b2VoronoiDiagram.h">
       <Filter>Box2D\Particle</Filter>
     </ClInclude>
@@ -3237,6 +3214,111 @@
     <ClInclude Include="..\..\source\2d\sceneobject\LightObject_ScriptBinding.h">
       <Filter>2d\sceneobject</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\source\spine\Array.h">
+      <Filter>spine</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\source\spine\ClippingAttachment.h">
+      <Filter>spine</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\source\spine\Color.h">
+      <Filter>spine</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\source\spine\dll.h">
+      <Filter>spine</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\source\spine\IkConstraint.h">
+      <Filter>spine</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\source\spine\IkConstraintData.h">
+      <Filter>spine</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\source\spine\MeshAttachment.h">
+      <Filter>spine</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\source\spine\PathAttachment.h">
+      <Filter>spine</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\source\spine\PathConstraint.h">
+      <Filter>spine</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\source\spine\PathConstraintData.h">
+      <Filter>spine</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\source\spine\PointAttachment.h">
+      <Filter>spine</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\source\spine\SkeletonBinary.h">
+      <Filter>spine</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\source\spine\SkeletonClipping.h">
+      <Filter>spine</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\source\spine\TransformConstraint.h">
+      <Filter>spine</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\source\spine\TransformConstraintData.h">
+      <Filter>spine</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\source\spine\Triangulator.h">
+      <Filter>spine</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\source\spine\VertexAttachment.h">
+      <Filter>spine</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\source\spine\VertexEffect.h">
+      <Filter>spine</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\source\graphics\gColor.h">
+      <Filter>graphics</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\source\graphics\gColor_ScriptBinding.h">
+      <Filter>graphics</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\source\2d\sceneobject\SpineObject.h">
+      <Filter>2d\sceneobject</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\source\2d\sceneobject\SpineObject_ScriptBinding.h">
+      <Filter>2d\sceneobject</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\source\2d\assets\SpineAsset.h">
+      <Filter>2d\assets</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\source\2d\assets\SpineAsset_ScriptBinding.h">
+      <Filter>2d\assets</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\source\2d\sceneobject\SpineCollisionProxy.h">
+      <Filter>2d\sceneobject</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\source\console\arrayObject.h">
+      <Filter>console</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\source\console\arrayObject_ScriptBinding.h">
+      <Filter>console</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\source\math\mFluid.h">
+      <Filter>math</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\source\gui\containers\guiExpandCtrl.h">
+      <Filter>gui\containers</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\source\gui\containers\guiExpandCtrl_ScriptBinding.h">
+      <Filter>gui\containers</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\source\gui\containers\guiPanelCtrl.h">
+      <Filter>gui\containers</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\source\gui\containers\guiPanelCtrl_ScriptBinding.h">
+      <Filter>gui\containers</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\source\gui\buttons\guiButtonCtrl_ScriptBinding.h">
+      <Filter>gui\buttons</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\source\gui\containers\guiChainCtrl.h">
+      <Filter>gui\containers</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\source\gui\containers\guiChainCtrl_ScriptBinding.h">
+      <Filter>gui\containers</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <CustomBuild Include="..\..\source\math\mMath_ASM.asm">
@@ -3255,9 +3337,12 @@
   <ItemGroup>
     <ResourceCompile Include="Torque 2D.rc" />
   </ItemGroup>
+  <ItemGroup>
+    <Image Include="Torque 2D.ico" />
+  </ItemGroup>
   <ItemGroup>
     <None Include="..\..\source\Box2D\Particle\b2ParticleAssembly.neon.s">
       <Filter>Box2D\Particle</Filter>
     </None>
   </ItemGroup>
-</Project>
+</Project>

+ 2 - 2
engine/compilers/VisualStudio 2019/libogg.vcxproj

@@ -30,7 +30,7 @@
     <ProjectGuid>{15CBFEFF-7965-41F5-B4E2-21E8795C9159}</ProjectGuid>
     <RootNamespace>libogg</RootNamespace>
     <Keyword>Win32Proj</Keyword>
-    <WindowsTargetPlatformVersion>10.0.16299.0</WindowsTargetPlatformVersion>
+    <WindowsTargetPlatformVersion>10.0.18362.0</WindowsTargetPlatformVersion>
   </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
@@ -179,4 +179,4 @@
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">
   </ImportGroup>
-</Project>
+</Project>

+ 2 - 2
engine/compilers/VisualStudio 2019/libvorbis.vcxproj

@@ -22,7 +22,7 @@
     <ProjectGuid>{3A214E06-B95E-4D61-A291-1F8DF2EC10FD}</ProjectGuid>
     <RootNamespace>libvorbis</RootNamespace>
     <Keyword>Win32Proj</Keyword>
-    <WindowsTargetPlatformVersion>10.0.16299.0</WindowsTargetPlatformVersion>
+    <WindowsTargetPlatformVersion>10.0.18362.0</WindowsTargetPlatformVersion>
   </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
@@ -241,4 +241,4 @@
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">
   </ImportGroup>
-</Project>
+</Project>

+ 2 - 2
engine/compilers/VisualStudio 2019/ljpeg.vcxproj

@@ -16,7 +16,7 @@
   </ItemGroup>
   <PropertyGroup Label="Globals">
     <ProjectGuid>{0B07BA94-AA53-4FD4-ADB4-79EC2DA53B36}</ProjectGuid>
-    <WindowsTargetPlatformVersion>10.0.16299.0</WindowsTargetPlatformVersion>
+    <WindowsTargetPlatformVersion>10.0.18362.0</WindowsTargetPlatformVersion>
   </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
@@ -628,4 +628,4 @@
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">
   </ImportGroup>
-</Project>
+</Project>

+ 2 - 2
engine/compilers/VisualStudio 2019/lpng.vcxproj

@@ -16,7 +16,7 @@
   </ItemGroup>
   <PropertyGroup Label="Globals">
     <ProjectGuid>{AF1179E3-A838-46A3-A427-1E62AA4C52F4}</ProjectGuid>
-    <WindowsTargetPlatformVersion>10.0.16299.0</WindowsTargetPlatformVersion>
+    <WindowsTargetPlatformVersion>10.0.18362.0</WindowsTargetPlatformVersion>
   </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
@@ -184,4 +184,4 @@
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">
   </ImportGroup>
-</Project>
+</Project>

+ 16 - 0
engine/compilers/VisualStudio 2019/resource.h

@@ -0,0 +1,16 @@
+//{{NO_DEPENDENCIES}}
+// Microsoft Visual C++ generated include file.
+// Used by Torque 2D.rc
+//
+#define IDI_TORQUE2D                    107
+
+// Next default values for new objects
+// 
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE        108
+#define _APS_NEXT_COMMAND_VALUE         40001
+#define _APS_NEXT_CONTROL_VALUE         1000
+#define _APS_NEXT_SYMED_VALUE           101
+#endif
+#endif

+ 2 - 2
engine/compilers/VisualStudio 2019/zlib.vcxproj

@@ -46,7 +46,7 @@
   </ItemGroup>
   <PropertyGroup Label="Globals">
     <ProjectGuid>{86CB2525-0CF3-40D3-BF42-A0A95035EE8C}</ProjectGuid>
-    <WindowsTargetPlatformVersion>10.0.16299.0</WindowsTargetPlatformVersion>
+    <WindowsTargetPlatformVersion>10.0.18362.0</WindowsTargetPlatformVersion>
   </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
@@ -182,4 +182,4 @@
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">
   </ImportGroup>
-</Project>
+</Project>

+ 9 - 0
engine/source/2d/gui/SceneWindow.cc

@@ -1606,6 +1606,12 @@ void SceneWindow::onRender( Point2I offset, const RectI& updateRect )
     // Debug Profiling.
     PROFILE_SCOPE(SceneWindow_onRender);
 
+	//save the old clip
+	RectI oldClipRect = dglGetClipRect();
+
+	//clip to the updateRect
+	dglSetClipRect(updateRect);
+
     // Fetch scene.
     Scene* pScene = getScene();
 
@@ -1724,6 +1730,9 @@ void SceneWindow::onRender( Point2I offset, const RectI& updateRect )
 
     // Update Window.
     setUpdate();
+
+	//return the clip rect
+	dglSetClipRect(oldClipRect);
 }
 
 //------------------------------------------------------------------------------

+ 4 - 4
engine/source/2d/gui/guiSceneObjectCtrl.cc

@@ -227,21 +227,21 @@ void GuiSceneObjectCtrl::onRender(Point2I offset, const RectI& updateRect)
       if( mDepressed )
       {
          if( mHasTexture )
-            renderSizableBitmapBordersFilled( ctrlRect, 3, mProfile );
+			 renderUniversalRect( ctrlRect, mProfile, GuiControlState::SelectedState);
          else
             dglDrawRectFill( ctrlRect, mProfile->mFillColorHL );
       }
       else if ( mMouseOver )
       {
          if( mHasTexture )
-            renderSizableBitmapBordersFilled( ctrlRect, 2, mProfile );
+			 renderUniversalRect( ctrlRect, mProfile, GuiControlState::HighlightState);
          else
             dglDrawRectFill( ctrlRect, mProfile->mFillColorHL );
       }
       else
       {
          if( mHasTexture )
-            renderSizableBitmapBordersFilled( ctrlRect, 1, mProfile );
+			 renderUniversalRect( ctrlRect, mProfile, GuiControlState::NormalState);
          else
             dglDrawRectFill( ctrlRect, mProfile->mFillColor );
       }
@@ -262,7 +262,7 @@ void GuiSceneObjectCtrl::onRender(Point2I offset, const RectI& updateRect)
 
       // Draw Canvas color for object
 	if( mHasTexture )
-		renderSizableBitmapBordersFilled( objRect, 4, mProfile );
+		renderUniversalRect( objRect, mProfile, GuiControlState::DisabledState);
 	else
 		dglDrawRectFill( objRect, mProfile->mFillColorNA );
 

+ 6 - 2
engine/source/2d/gui/guiSpriteCtrl.cc

@@ -324,6 +324,10 @@ void GuiSpriteCtrl::onRender( Point2I offset, const RectI &updateRect)
 
 void GuiSpriteCtrl::onAnimationEnd( void )
 {
-    // Clear assets.
-    ImageFrameProvider::clearAssets();
+	// We've arrived at the end - pause it
+	ImageFrameProvider::pauseAnimation(true);
+
+	// Send a callback
+	if(isMethod("onAnimationEnd"))
+		Con::executef(this, 3, "onAnimationEnd", ImageFrameProvider::getCurrentAnimationAssetId());
 }

+ 1 - 8
engine/source/gui/buttons/guiButtonCtrl.cc

@@ -278,14 +278,7 @@ void GuiButtonCtrl::onRender(Point2I offset, const RectI& updateRect)
 	GuiControlState currentState = getCurrentState();
 	RectI ctrlRect = applyMargins(offset, mBounds.extent, currentState, mProfile);
 
-	if(mProfile->mBitmapName != NULL && mProfile->constructBitmapArray() >= 36)
-	{
-		renderSizableBitmapBordersFilled(ctrlRect, getBitmapIndex(currentState), mProfile );
-	}
-	else
-	{
-		renderBorderedRect(ctrlRect, mProfile, currentState, getFillColor(currentState));
-	}
+	renderUniversalRect(ctrlRect, mProfile, currentState, getFillColor(currentState), true);
 
 	//Render Text
 	dglSetBitmapModulation(mProfile->getFontColor(currentState));

+ 9 - 33
engine/source/gui/buttons/guiCheckBoxCtrl.cc

@@ -64,18 +64,18 @@ bool GuiCheckBoxCtrl::onWake()
 
 void GuiCheckBoxCtrl::onRender(Point2I offset, const RectI &updateRect)
 {
-	GuiControlState currentState = GuiControlState::NormalState;
+	GuiControlState currentState = mStateOn ? GuiControlState::NormalStateOn : GuiControlState::NormalState;
 	if (!mActive)
 	{
-		currentState = GuiControlState::DisabledState;
+		currentState = mStateOn ? GuiControlState::DisabledStateOn : GuiControlState::DisabledState;
 	}
-	else if (mDepressed || mStateOn)
+	else if (mDepressed)
 	{
-		currentState = GuiControlState::SelectedState;
+		currentState = mStateOn ? GuiControlState::SelectedStateOn : GuiControlState::SelectedState;
 	}
 	else if (mMouseOver)
 	{
-		currentState = GuiControlState::HighlightState;
+		currentState = mStateOn ? GuiControlState::HighlightStateOn : GuiControlState::HighlightState;
 	}
 
 	RectI ctrlRect = applyMargins(offset, mBounds.extent, currentState, mProfile);
@@ -92,33 +92,9 @@ void GuiCheckBoxCtrl::onRender(Point2I offset, const RectI &updateRect)
 	{
 		boxRect.extent.y = contentRect.point.y + contentRect.extent.y - boxRect.point.y;
 	}
-
-	if(mProfile->mBitmapName != NULL && mProfile->constructBitmapArray() >= 6)
-	{
-		//Use the bitmap to create the checkbox
-		S32 index = 1;
-		if (mStateOn || mDepressed)
-		{
-			index = 2;
-		}
-		if (mMouseOver)
-		{
-			index += 2;
-		}
-		else if (!mActive)
-		{
-			index += 4;
-		}
-
-		RectI dest = RectI(offset + mBoxOffset, mBoxExtent);
-		dglClearBitmapModulation();
-		dglDrawBitmapStretchSR(mProfile->mTextureHandle, dest, mProfile->mBitmapArrayRects[index-1]);
-	}
-	else
-	{
-		//Draw the checkbox
-		renderInnerControl(boxRect, currentState);
-	}
+	
+	//Draw the checkbox
+	renderInnerControl(boxRect, currentState);
 
 	RectI textRect(contentRect.point + mTextOffset, mTextExtent);
 
@@ -142,7 +118,7 @@ void GuiCheckBoxCtrl::onRender(Point2I offset, const RectI &updateRect)
 
 void GuiCheckBoxCtrl::renderInnerControl(RectI &boxRect, const GuiControlState currentState)
 {
-	renderBorderedRect(boxRect, mProfile, currentState);
+	renderUniversalRect(boxRect, mProfile, currentState);
 }
 
 void GuiCheckBoxCtrl::onAction()

+ 16 - 6
engine/source/gui/buttons/guiRadioCtrl.cc

@@ -43,14 +43,24 @@ void GuiRadioCtrl::initPersistFields()
 
 void GuiRadioCtrl::renderInnerControl(RectI &boxRect, const GuiControlState currentState)
 {
-	S32 radius = boxRect.extent.x;
-	if (boxRect.extent.y < radius)
+	U8 stateIndex = currentState;
+
+	if ((mProfile->mImageAsset->isAssetValid() && mProfile->mImageAsset->getFrameCount() > stateIndex) 
+		|| (mProfile->mBitmapName != NULL && mProfile->constructBitmapArray() > stateIndex))
+	{
+		renderUniversalRect(boxRect, mProfile, currentState);
+	}
+	else 
 	{
-		radius = boxRect.extent.y;
+		S32 radius = boxRect.extent.x;
+		if (boxRect.extent.y < radius)
+		{
+			radius = boxRect.extent.y;
+		}
+		radius = (S32)round(radius / 2);
+		Point2I center = Point2I(boxRect.point.x + (boxRect.extent.x / 2), boxRect.point.y + (boxRect.extent.y / 2));
+		renderBorderedCircle(center, radius, mProfile, currentState);
 	}
-	radius = (S32)round(radius / 2);
-	Point2I center = Point2I(boxRect.point.x + (boxRect.extent.x / 2), boxRect.point.y + (boxRect.extent.y / 2));
-	renderBorderedCircle(center, radius, mProfile, currentState);
 }
 
 void GuiRadioCtrl::onAction()

+ 2 - 2
engine/source/gui/containers/guiRolloutCtrl.cc

@@ -344,8 +344,8 @@ void GuiRolloutCtrl::onRender(Point2I offset, const RectI &updateRect)
       // Draw Rollout From Skin
       if( !mIsExpanded )
          renderFixedBitmapBordersFilled( worldBounds, 1, mProfile );
-      else// Draw Border
-         renderSizableBitmapBordersFilledIndex( worldBounds, TopLeftHeader, mProfile );
+      //else// Draw Border
+         //renderSizableBitmapBordersFilledIndex( worldBounds, TopLeftHeader, mProfile );
 
       // Draw Caption ( Vertically Centered )
       ColorI currColor;

+ 10 - 177
engine/source/gui/containers/guiScrollCtrl.cc

@@ -814,29 +814,14 @@ void GuiScrollCtrl::onRender(Point2I offset, const RectI &updateRect)
 		return;
 	}
 
-	renderBorderedRect(ctrlRect, mProfile, NormalState);
+	renderUniversalRect(ctrlRect, mProfile, NormalState);
 
 	RectI fillRect = applyBorders(ctrlRect.point, ctrlRect.extent, NormalState, mProfile);
 	RectI contentRect = applyScrollBarSpacing(fillRect.point, fillRect.extent);
 	mChildArea.set(contentRect.point, contentRect.extent);
 
-	if (mProfile->mBitmapName == NULL || mProfile->constructBitmapArray() < 39)
-	{
-		renderVScrollBar(offset);
-		renderHScrollBar(offset);
-	}
-	else
-	{
-		if (mHasVScrollBar)
-			drawVScrollBar(offset);
-
-		if (mHasHScrollBar)
-			drawHScrollBar(offset);
-
-		//draw the scroll corner
-		if (mHasVScrollBar && mHasHScrollBar)
-			drawScrollCorner(offset);
-   }
+	renderVScrollBar(offset);
+	renderHScrollBar(offset);
 
 	if (contentRect.isValidRect())
 	{
@@ -890,7 +875,7 @@ void GuiScrollCtrl::renderBorderedRectWithArrow(RectI& bounds, GuiControlProfile
 		return;
 	}
 
-	renderBorderedRect(bounds, profile, state);
+	renderUniversalRect(bounds, profile, state);
 
 	RectI ctrlRect = applyMargins(bounds.point, bounds.extent, state, profile);
 	RectI fillRect = applyBorders(ctrlRect.point, ctrlRect.extent, state, profile);
@@ -938,13 +923,13 @@ void GuiScrollCtrl::renderVScrollBar(const Point2I& offset)
 				renderBorderedRectWithArrow(RectI(mUpArrowRect.point + offset, mUpArrowRect.extent), mArrowProfile, getRegionCurrentState(Region::UpArrow), GuiDirection::Up);
 				renderBorderedRectWithArrow(RectI(mDownArrowRect.point + offset, mDownArrowRect.extent), mArrowProfile, getRegionCurrentState(Region::DownArrow), GuiDirection::Down);
 			}
-			renderBorderedRect(RectI(mVTrackRect.point + offset, mVTrackRect.extent), mTrackProfile, GuiControlState::NormalState);
+			renderUniversalRect(RectI(mVTrackRect.point + offset, mVTrackRect.extent), mTrackProfile, GuiControlState::NormalState);
 
 			//The Thumb
 			GuiControlState thumbState = getRegionCurrentState(Region::VertThumb);
 			RectI vThumb = RectI(mVTrackRect.point.x + offset.x, mVTrackRect.point.y + mVThumbPos + offset.y, mScrollBarThickness, mVThumbSize);
 			RectI vThumbWithMargins = applyMargins(vThumb.point, vThumb.extent, thumbState, mThumbProfile);
-			renderBorderedRect(vThumbWithMargins, mThumbProfile, thumbState);
+			renderUniversalRect(vThumbWithMargins, mThumbProfile, thumbState);
 		}
 		else
 		{
@@ -953,7 +938,7 @@ void GuiScrollCtrl::renderVScrollBar(const Point2I& offset)
 				renderBorderedRectWithArrow(RectI(mUpArrowRect.point + offset, mUpArrowRect.extent), mArrowProfile, GuiControlState::DisabledState, GuiDirection::Up);
 				renderBorderedRectWithArrow(RectI(mDownArrowRect.point + offset, mDownArrowRect.extent), mArrowProfile, GuiControlState::DisabledState, GuiDirection::Down);
 			}
-			renderBorderedRect(RectI(mVTrackRect.point + offset, mVTrackRect.extent), mTrackProfile, GuiControlState::DisabledState);
+			renderUniversalRect(RectI(mVTrackRect.point + offset, mVTrackRect.extent), mTrackProfile, GuiControlState::DisabledState);
 		}
 	}
 }
@@ -969,13 +954,13 @@ void GuiScrollCtrl::renderHScrollBar(const Point2I& offset)
 				renderBorderedRectWithArrow(RectI(mLeftArrowRect.point + offset, mLeftArrowRect.extent), mArrowProfile, getRegionCurrentState(Region::LeftArrow), GuiDirection::Left);
 				renderBorderedRectWithArrow(RectI(mRightArrowRect.point + offset, mRightArrowRect.extent), mArrowProfile, getRegionCurrentState(Region::RightArrow), GuiDirection::Right);
 			}
-			renderBorderedRect(RectI(mHTrackRect.point + offset, mHTrackRect.extent), mTrackProfile, GuiControlState::NormalState);
+			renderUniversalRect(RectI(mHTrackRect.point + offset, mHTrackRect.extent), mTrackProfile, GuiControlState::NormalState);
 
 			//The Thumb
 			GuiControlState thumbState = getRegionCurrentState(Region::HorizThumb);
 			RectI hThumb = RectI(mHTrackRect.point.x + mHThumbPos + offset.x, mHTrackRect.point.y + offset.y, mHThumbSize, mScrollBarThickness);
 			RectI hThumbWithMargins = applyMargins(hThumb.point, hThumb.extent, thumbState, mThumbProfile);
-			renderBorderedRect(hThumbWithMargins, mThumbProfile, thumbState);
+			renderUniversalRect(hThumbWithMargins, mThumbProfile, thumbState);
 		}
 		else
 		{
@@ -984,7 +969,7 @@ void GuiScrollCtrl::renderHScrollBar(const Point2I& offset)
 				renderBorderedRectWithArrow(RectI(mLeftArrowRect.point + offset, mLeftArrowRect.extent), mArrowProfile, GuiControlState::DisabledState, GuiDirection::Left);
 				renderBorderedRectWithArrow(RectI(mRightArrowRect.point + offset, mRightArrowRect.extent), mArrowProfile, GuiControlState::DisabledState, GuiDirection::Right);
 			}
-			renderBorderedRect(RectI(mHTrackRect.point + offset, mHTrackRect.extent), mTrackProfile, GuiControlState::DisabledState);
+			renderUniversalRect(RectI(mHTrackRect.point + offset, mHTrackRect.extent), mTrackProfile, GuiControlState::DisabledState);
 		}
 	}
 }
@@ -1039,157 +1024,5 @@ void GuiScrollCtrl::renderChildControls(Point2I offset, RectI content, const Rec
 		}
 	}
 }
-
-void GuiScrollCtrl::drawVScrollBar(const Point2I &offset)
-{
-   Point2I pos = offset + mUpArrowRect.point;
-   S32 bitmap = (mVBarEnabled ? ((curHitRegion == UpArrow && mDepressed) ?
-         BmpStates * BmpUp + BmpHilite : BmpStates * BmpUp) : BmpStates * BmpUp + BmpDisabled);
-
-   dglClearBitmapModulation();
-   dglDrawBitmapSR(mTextureHandle, pos, mBitmapBounds[bitmap]);
-
-   pos.y += mScrollBarThickness;
-   S32 end;
-   if (mVBarEnabled)
-      end = mVThumbPos + mChildArea.point.y + mDownArrowRect.extent.y;
-   else
-      end = mDownArrowRect.point.y + offset.y;
-
-   bitmap = (mVBarEnabled ? ((curHitRegion == DownPage && mDepressed) ?
-         BmpStates * BmpVPage + BmpHilite : BmpStates * BmpVPage) : BmpStates * BmpVPage + BmpDisabled);
-
-   if (end > pos.y)
-   {
-      dglClearBitmapModulation();
-      dglDrawBitmapStretchSR(mTextureHandle, RectI(pos, Point2I(mBitmapBounds[bitmap].extent.x, end - pos.y)), mBitmapBounds[bitmap]);
-   }
-
-   pos.y = end;
-   if (mVBarEnabled)
-   {
-      bool thumbSelected = (curHitRegion == VertThumb && mDepressed);
-      S32 ttop = (thumbSelected ? BmpStates * BmpVThumbTopCap + BmpHilite : BmpStates * BmpVThumbTopCap);
-      S32 tmid = (thumbSelected ? BmpStates * BmpVThumb + BmpHilite : BmpStates * BmpVThumb);
-      S32 tbot = (thumbSelected ? BmpStates * BmpVThumbBottomCap + BmpHilite : BmpStates * BmpVThumbBottomCap);
-
-      // draw the thumb
-      dglClearBitmapModulation();
-      dglDrawBitmapSR(mTextureHandle, pos, mBitmapBounds[ttop]);
-      pos.y += mBitmapBounds[ttop].extent.y;
-      end = (mVThumbPos + mChildArea.point.y + mDownArrowRect.extent.y) + mVThumbSize - mBitmapBounds[tbot].extent.y;
-
-      if (end > pos.y)
-      {
-         dglClearBitmapModulation();
-         dglDrawBitmapStretchSR(mTextureHandle, RectI(pos, Point2I(mBitmapBounds[tmid].extent.x, end - pos.y)), mBitmapBounds[tmid]);
-      }
-
-      pos.y = end;
-      dglClearBitmapModulation();
-      dglDrawBitmapSR(mTextureHandle, pos, mBitmapBounds[tbot]);
-      pos.y += mBitmapBounds[tbot].extent.y;
-      end = mVTrackRect.point.y + mVTrackRect.extent.y - 1 + offset.y;
-
-      bitmap = (curHitRegion == DownPage && mDepressed) ? BmpStates * BmpVPage + BmpHilite : BmpStates * BmpVPage;
-      if (end > pos.y)
-      {
-         dglClearBitmapModulation();
-         dglDrawBitmapStretchSR(mTextureHandle, RectI(pos, Point2I(mBitmapBounds[bitmap].extent.x, end - pos.y)), mBitmapBounds[bitmap]);
-      }
-
-      pos.y = end;
-   }
-
-   bitmap = (mVBarEnabled ? ((curHitRegion == DownArrow && mDepressed ) ?
-         BmpStates * BmpDown + BmpHilite : BmpStates * BmpDown) : BmpStates * BmpDown + BmpDisabled);
-
-   dglClearBitmapModulation();
-   dglDrawBitmapSR(mTextureHandle, pos, mBitmapBounds[bitmap]);
-}
-
-void GuiScrollCtrl::drawHScrollBar(const Point2I &offset)
-{
-   S32 bitmap;
-
-   //draw the left arrow
-   bitmap = (mHBarEnabled ? ((curHitRegion == LeftArrow && mDepressed) ?
-            BmpStates * BmpLeft + BmpHilite : BmpStates * BmpLeft) : BmpStates * BmpLeft + BmpDisabled);
-
-   Point2I pos = offset;
-   pos += mLeftArrowRect.point;
-
-   dglClearBitmapModulation();
-   dglDrawBitmapSR(mTextureHandle, pos, mBitmapBounds[bitmap]);
-
-   pos.x += mLeftArrowRect.extent.x;
-
-   //draw the left page
-   S32 end;
-   if (mHBarEnabled)
-      end = mHThumbPos + mChildArea.point.x + mDownArrowRect.extent.x;
-   else
-      end = mRightArrowRect.point.x + offset.x;
-
-   bitmap = (mHBarEnabled ? ((curHitRegion == LeftPage && mDepressed) ?
-            BmpStates * BmpHPage + BmpHilite : BmpStates * BmpHPage) : BmpStates * BmpHPage + BmpDisabled);
-
-   if (end > pos.x)
-   {
-      dglClearBitmapModulation();
-      dglDrawBitmapStretchSR(mTextureHandle, RectI(pos, Point2I(end - pos.x, mBitmapBounds[bitmap].extent.y)), mBitmapBounds[bitmap]);
-   }
-   pos.x = end;
-
-   //draw the thumb and the rightPage
-   if (mHBarEnabled)
-   {
-      bool thumbSelected = (curHitRegion == HorizThumb && mDepressed);
-      S32 ttop = (thumbSelected ? BmpStates * BmpHThumbLeftCap + BmpHilite : BmpStates * BmpHThumbLeftCap );
-      S32 tmid = (thumbSelected ? BmpStates * BmpHThumb + BmpHilite : BmpStates * BmpHThumb);
-      S32 tbot = (thumbSelected ? BmpStates * BmpHThumbRightCap + BmpHilite : BmpStates * BmpHThumbRightCap);
-
-      // draw the thumb
-      dglClearBitmapModulation();
-      dglDrawBitmapSR(mTextureHandle, pos, mBitmapBounds[ttop]);
-      pos.x += mBitmapBounds[ttop].extent.x;
-      end = (mHThumbPos + mChildArea.point.x + mDownArrowRect.extent.x) + mHThumbSize - mBitmapBounds[tbot].extent.x;
-      if (end > pos.x)
-      {
-         dglClearBitmapModulation();
-         dglDrawBitmapStretchSR(mTextureHandle, RectI(pos, Point2I(end - pos.x, mBitmapBounds[tmid].extent.y)), mBitmapBounds[tmid]);
-      }
-
-      pos.x = end;
-      dglClearBitmapModulation();
-      dglDrawBitmapSR(mTextureHandle, pos, mBitmapBounds[tbot]);
-      pos.x += mBitmapBounds[tbot].extent.x;
-      end = mHTrackRect.point.x + mHTrackRect.extent.x - 1 + offset.x;
-
-      bitmap = ((curHitRegion == RightPage && mDepressed) ? BmpStates * BmpHPage + BmpHilite : BmpStates * BmpHPage);
-
-      if (end > pos.x)
-      {
-         dglClearBitmapModulation();
-         dglDrawBitmapStretchSR(mTextureHandle, RectI(pos, Point2I(end - pos.x, mBitmapBounds[bitmap].extent.y)), mBitmapBounds[bitmap]);
-      }
-
-      pos.x = end;
-   }
-   bitmap = (mHBarEnabled ? ((curHitRegion == RightArrow && mDepressed) ?
-            BmpStates * BmpRight + BmpHilite : BmpStates * BmpRight) : BmpStates * BmpRight + BmpDisabled);
-
-   dglClearBitmapModulation();
-   dglDrawBitmapSR(mTextureHandle, pos, mBitmapBounds[bitmap]);
-}
-
-void GuiScrollCtrl::drawScrollCorner(const Point2I &offset)
-{
-   Point2I pos = offset;
-   pos.x += mRightArrowRect.point.x + mRightArrowRect.extent.x;
-   pos.y += mRightArrowRect.point.y;
-   dglClearBitmapModulation();
-   dglDrawBitmapSR(mTextureHandle, pos, mBitmapBounds[BmpStates * BmpResize]);
-}
 #pragma endregion
 

+ 0 - 6
engine/source/gui/containers/guiScrollCtrl.h

@@ -166,9 +166,6 @@ public:
 
    void computeSizes();
 
-   // you can change the bitmap array dynamically.
-   void loadBitmapArray();
-
    void addObject(SimObject *obj);
    void resize(const Point2I &newPosition, const Point2I &newExtent);
    void childResized(GuiControl *child);
@@ -203,9 +200,6 @@ public:
    void renderBorderedRectWithArrow(RectI& bounds, GuiControlProfile* profile, GuiControlState state, GuiDirection direction);
    void renderVScrollBar(const Point2I& offset);
    void renderHScrollBar(const Point2I& offset);
-   virtual void drawVScrollBar(const Point2I &offset);
-   virtual void drawHScrollBar(const Point2I &offset);
-   virtual void drawScrollCorner(const Point2I &offset);
    virtual GuiControl* findHitControl(const Point2I &pt, S32 initialLayer = -1);
    virtual void renderChildControls(Point2I offset, RectI content, const RectI& updateRect);
 };

+ 2 - 6
engine/source/gui/containers/guiTabBookCtrl.cc

@@ -157,10 +157,6 @@ void GuiTabBookCtrl::onChildAdded( GuiControl *child )
    calculatePageTabs();
 
    child->resize( mPageRect.point, mPageRect.extent );
-
-
-   // Select this Page
-   selectPage( page );
 }
 
 
@@ -335,7 +331,7 @@ void GuiTabBookCtrl::onRender(Point2I offset, const RectI &updateRect)
 		return;
 	}
 
-	renderBorderedRect(ctrlRect, mProfile, NormalState);
+	renderUniversalRect(ctrlRect, mProfile, NormalState);
 	RectI fillRect = applyBorders(ctrlRect.point, ctrlRect.extent, NormalState, mProfile);
 	RectI contentRect = applyPadding(fillRect.point, fillRect.extent, NormalState, mProfile);
 	if (contentRect.isValidRect())
@@ -387,7 +383,7 @@ void GuiTabBookCtrl::renderTab( RectI tabRect, GuiTabPageCtrl *tab )
 	   return;
    }
 
-   renderBorderedRect(ctrlRect, mTabProfile, currentState);
+   renderUniversalRect(ctrlRect, mTabProfile, currentState);
 
    //Render Text
    dglSetBitmapModulation(mTabProfile->getFontColor(currentState));

+ 1 - 1
engine/source/gui/containers/guiWindowCtrl.cc

@@ -644,7 +644,7 @@ void GuiWindowCtrl::onRender(Point2I offset, const RectI &updateRect)
    if( textWidth > winRect.extent.x ) start.set( 0, 0 );
    // center the vertical
 //   start.y = ( winRect.extent.y - ( font->getHeight() - 2 ) ) / 2;
-   dglDrawText(mFont, start + offset + mProfile->mTextOffset, mText);
+   dglDrawText(mProfile->mFont, start + offset + mProfile->mTextOffset, mText);
 
    // deal with rendering the titlebar controls
    AssertFatal(root, "Unable to get the root Canvas.");

+ 2 - 2
engine/source/gui/containers/guiWindowCtrl.h

@@ -31,10 +31,10 @@
 ///
 /// @ingroup gui_group Gui System
 /// @{
-class GuiWindowCtrl : public GuiTextCtrl
+class GuiWindowCtrl : public GuiControl
 {
    private:
-      typedef GuiTextCtrl Parent;
+      typedef GuiControl Parent;
 
       bool mResizeWidth;
       bool mResizeHeight;

+ 2 - 2
engine/source/gui/editor/guiMenuBar.cc

@@ -981,11 +981,11 @@ void GuiMenuBar::onRender(Point2I offset, const RectI &updateRect)
         highlightBounds.inset(1,1);
          if(walk == mouseDownMenu)
 		 {
-			renderBorderedRect(highlightBounds, mProfile, GuiControlState::HighlightState);
+			 renderUniversalRect(highlightBounds, mProfile, GuiControlState::HighlightState);
          }
 		 else if(walk == mouseOverMenu && mouseDownMenu == NULL)
 		 {
-			 renderBorderedRect(highlightBounds, mProfile, GuiControlState::NormalState);
+			 renderUniversalRect(highlightBounds, mProfile, GuiControlState::NormalState);
 		 }
 	  }
 

+ 2 - 2
engine/source/gui/guiBubbleTextCtrl.h

@@ -30,10 +30,10 @@
 #include "gui/guiMLTextCtrl.h"
 #endif
 
-class GuiBubbleTextCtrl : public GuiTextCtrl
+class GuiBubbleTextCtrl : public GuiControl
 {
   private:
-   typedef GuiTextCtrl Parent;
+   typedef GuiControl Parent;
 
   protected:
      bool mInAction;

+ 42 - 1
engine/source/gui/guiCanvas.cc

@@ -95,6 +95,10 @@ GuiCanvas::GuiCanvas()
    mDoubleClickHeight = Input::getDoubleClickHeight();
    mDoubleClickTime = Input::getDoubleClickTime();
 
+   mTouchDetectionSize = 100;
+   mPotentialTouchEvent = false;
+   mHideCursorBecauseOfTouch = false;
+
     /// Background color.
     mBackgroundColor.set( 0.0f, 0.0f, 0.0f, 0.0f );
     mUseBackgroundColor = true;
@@ -276,6 +280,32 @@ void GuiCanvas::processMouseMoveEvent(const MouseMoveEvent *event)
          mRightMouseLast = false;
       }
 
+		//should we try to detect a touch event pretending to be a mouse event?
+		if( Con::getBoolVariable( "$pref::Gui::hideCursorWhenTouchEventDetected", false ))
+		{
+			mPotentialTouchEvent = false;
+			Point2F jump = mPrevMouseMovePosition - cursorPt;
+			if ((mAbs((S32)jump.x) > mTouchDetectionSize) || (mAbs((S32)jump.y) > mTouchDetectionSize))
+			{
+				mPotentialTouchEvent = true;
+				mPotentialMouseEventCount = 0;
+			}
+			else if(mHideCursorBecauseOfTouch && !mMouseButtonDown)
+			{
+				if(mPotentialMouseEventCount > 20) 
+				{
+					//This is our 20th small movement with no click or drag so it must be a mouse!
+					mHideCursorBecauseOfTouch = false;
+					mPotentialMouseEventCount = 0;
+				}
+				else 
+				{
+					mPotentialMouseEventCount++;
+				}
+			}
+			mPrevMouseMovePosition.set(cursorPt.x, cursorPt.y);
+		}
+
         if (mMouseButtonDown)
             rootMouseDragged(mLastEvent);
         else if (mMouseRightButtonDown)
@@ -475,6 +505,15 @@ bool GuiCanvas::processInputEvent(const InputEvent *event)
                mLastMouseDownTime = curTime;
                mLastEvent.mouseClickCount = mLastMouseClickCount;
 
+			   if(mHideCursorBecauseOfTouch)
+			   {
+					mPotentialMouseEventCount = 0;
+				}
+			   if(mPotentialTouchEvent)
+			   {
+					mHideCursorBecauseOfTouch = true;
+			   }
+
                rootMouseDown(mLastEvent);
             }
             //else button was released
@@ -487,6 +526,7 @@ bool GuiCanvas::processInputEvent(const InputEvent *event)
          }
          else if(event->objInst == KEY_BUTTON1) // right button
          {
+			mHideCursorBecauseOfTouch = false;
             if(event->action == SI_MAKE)
             {
                U32 curTime = Platform::getVirtualMilliseconds();
@@ -517,6 +557,7 @@ bool GuiCanvas::processInputEvent(const InputEvent *event)
          }
          else if(event->objInst == KEY_BUTTON2) // middle button
          {
+			 mHideCursorBecauseOfTouch = false;
             if(event->action == SI_MAKE)
             {
                U32 curTime = Platform::getVirtualMilliseconds();
@@ -1317,7 +1358,7 @@ void GuiCanvas::renderFrame(bool preRenderOnly, bool bufferSwap /* = true */)
       //   helpCtrl->render(srf);
       //}
 
-      if (cursorON && mouseCursor && mShowCursor)
+      if (cursorON && mouseCursor && mShowCursor && !mHideCursorBecauseOfTouch)
       {
          Point2I pos((S32)cursorPt.x, (S32)cursorPt.y);
          Point2I spot = mouseCursor->getHotSpot();

+ 6 - 0
engine/source/gui/guiCanvas.h

@@ -136,6 +136,12 @@ protected:
    S32                        mDoubleClickHeight;
    S32                        mDoubleClickTime;
 
+   Point2F					  mPrevMouseMovePosition; ///< Holds the previous position of the mouse the last time a mouse move event was processed.
+   S32						  mTouchDetectionSize; ///< Changes in the x or y position of the mouse greater than this value will could be touch events.
+   bool						  mPotentialTouchEvent; ///< True if the mouse made a jump that looks like a touch event.
+   U8						  mPotentialMouseEventCount; ///< Counts how many small mouse movements have occured in a row that to determine if touch has been abandoned.
+   bool						  mHideCursorBecauseOfTouch; ///< Touch event has been detected. Hide the cursor.
+
    virtual void findMouseControl(const GuiEvent &event);
    virtual void refreshMouseControl();
    /// @}

+ 2 - 2
engine/source/gui/guiControl.cc

@@ -464,7 +464,7 @@ void GuiControl::onRender(Point2I offset, const RectI &updateRect)
 		return;
 	}
 
-    renderBorderedRect(ctrlRect, mProfile, NormalState);
+	renderUniversalRect(ctrlRect, mProfile, NormalState);
 
 	//Render Text
 	dglSetBitmapModulation(mProfile->mFontColor);
@@ -696,7 +696,7 @@ bool GuiControl::renderTooltip(Point2I cursorPos, const char* tipText )
     dglSetClipRect(rect);
 
     // Draw body and border of the tool tip
-	renderBorderedRect(rect, mTooltipProfile, NormalState);
+	renderUniversalRect(rect, mTooltipProfile, NormalState);
 
     // Draw the text centered in the tool tip box
     dglSetBitmapModulation( mTooltipProfile->mFontColor );

+ 184 - 194
engine/source/gui/guiDefaultControlRender.cc

@@ -26,6 +26,58 @@
 #include "graphics/gColor.h"
 #include "math/mRect.h"
 
+// Renders a rect in one of three ways: ImageAsset, bitmap, or default render. ImageAsset and bitmap can use
+// nine frames per state or one frame per state. The default render is used as a fall back if neither are present.
+void renderUniversalRect(RectI &bounds, GuiControlProfile *profile, GuiControlState state, const ColorI &fillColor, const bool bUseFillColor)
+{
+	if (profile == NULL)
+	{
+		return;
+	}
+
+	U8 stateIndex = state;
+
+	//prepare
+	S32 bitmapFrameCount = 0;
+	S32 imageFrameCount = 0;
+	if (profile->mImageAsset != NULL && profile->mImageAsset->isAssetValid())
+	{
+		imageFrameCount = profile->mImageAsset->getFrameCount();
+	}
+	else if (profile->mBitmapName != NULL)
+	{
+		bitmapFrameCount = profile->constructBitmapArray();
+	}
+
+	if (imageFrameCount >= (9 * (stateIndex + 1)))
+	{
+		renderSizableBorderedImageAsset(bounds, stateIndex, profile->mImageAsset, imageFrameCount);
+	}
+	else if (imageFrameCount > stateIndex && imageFrameCount < 9)
+	{
+		renderStretchedImageAsset(bounds, stateIndex, profile);
+	}
+	else if (bitmapFrameCount >= (9 * (stateIndex + 1)))
+	{
+		renderSizableBorderedBitmap(bounds, stateIndex, profile->mTextureHandle, profile->mBitmapArrayRects.address(), bitmapFrameCount);
+	}
+	else if (bitmapFrameCount > stateIndex && bitmapFrameCount < 9)
+	{
+		renderStretchedBitmap(bounds, stateIndex, profile);
+	}
+	else
+	{
+		if (bUseFillColor)
+		{
+			renderBorderedRect(bounds, profile, state, fillColor);
+		}
+		else
+		{
+			renderBorderedRect(bounds, profile, state);
+		}
+	}
+}
+
 void renderBorderedRect(RectI &bounds, GuiControlProfile *profile, GuiControlState state)
 {
 	if(profile)
@@ -101,6 +153,16 @@ void renderBorderedRect(RectI &bounds, GuiControlProfile *profile, GuiControlSta
 	{
 		dglDrawQuadFill(p6, p2, p3, p7, bottomColor);
 	}
+
+	if (state > 3)
+	{
+		RectI checkRect = RectI(bounds);
+		checkRect.inset(3, 3);
+		if (checkRect.isValidRect())
+		{
+			renderBorderedRect(checkRect, profile, GuiControlState::SelectedState);
+		}
+	}
 }
 
 void renderBorderedCircle(Point2I &center, S32 radius, GuiControlProfile *profile, GuiControlState state)
@@ -119,169 +181,122 @@ void renderBorderedCircle(Point2I &center, S32 radius, GuiControlProfile *profil
 
 	//Draw the border
 	dglDrawCircle(center, (F32)radius, borderColor, (F32)borderSize);
+
+	if (state > 3 && radius >= 8)
+	{
+		dglDrawCircleFill(center, radius - 6, profile->getFillColor(GuiControlState::SelectedState));
+	}
 }
 
-// DAW: Render out the sizable bitmap borders based on a multiplier into the bitmap array
 // Based on the 'Skinnable GUI Controls in TGE' resource by Justin DuJardin
-void renderSizableBitmapBordersFilled(RectI &bounds, S32 baseMultiplier, GuiControlProfile *profile)
+void renderSizableBorderedImageAsset(RectI &bounds, U8 frame, ImageAsset *imageAsset, S32 frameCount)
 {
-   S32 NumBitmaps = 9;
-   S32 startIndex = NumBitmaps * (baseMultiplier - 1);
+	S32 NumFrames = 9;
+	S32 i = NumFrames * frame;
 
-   renderSizableBitmapBordersFilledIndex(bounds, startIndex, profile);
+	if (frameCount >= (NumFrames + i))
+	{
+		const ImageAsset::FrameArea::PixelArea& pixelArea1 = imageAsset->getImageFrameArea((U32)i).mPixelArea;
+		const ImageAsset::FrameArea::PixelArea& pixelArea2 = imageAsset->getImageFrameArea((U32)i+1).mPixelArea;
+		const ImageAsset::FrameArea::PixelArea& pixelArea3 = imageAsset->getImageFrameArea((U32)i+2).mPixelArea;
+		const ImageAsset::FrameArea::PixelArea& pixelArea4 = imageAsset->getImageFrameArea((U32)i+3).mPixelArea;
+		const ImageAsset::FrameArea::PixelArea& pixelArea5 = imageAsset->getImageFrameArea((U32)i+4).mPixelArea;
+		const ImageAsset::FrameArea::PixelArea& pixelArea6 = imageAsset->getImageFrameArea((U32)i+5).mPixelArea;
+		const ImageAsset::FrameArea::PixelArea& pixelArea7 = imageAsset->getImageFrameArea((U32)i+6).mPixelArea;
+		const ImageAsset::FrameArea::PixelArea& pixelArea8 = imageAsset->getImageFrameArea((U32)i+7).mPixelArea;
+		const ImageAsset::FrameArea::PixelArea& pixelArea9 = imageAsset->getImageFrameArea((U32)i+8).mPixelArea;
+
+		renderSizableBorderedTexture(bounds, imageAsset->getImageTexture(), 
+			RectI(pixelArea1.mPixelOffset, Point2I(pixelArea1.mPixelWidth, pixelArea1.mPixelHeight)),
+			RectI(pixelArea2.mPixelOffset, Point2I(pixelArea2.mPixelWidth, pixelArea2.mPixelHeight)),
+			RectI(pixelArea3.mPixelOffset, Point2I(pixelArea3.mPixelWidth, pixelArea3.mPixelHeight)), 
+			RectI(pixelArea4.mPixelOffset, Point2I(pixelArea4.mPixelWidth, pixelArea4.mPixelHeight)), 
+			RectI(pixelArea5.mPixelOffset, Point2I(pixelArea5.mPixelWidth, pixelArea5.mPixelHeight)), 
+			RectI(pixelArea6.mPixelOffset, Point2I(pixelArea6.mPixelWidth, pixelArea6.mPixelHeight)), 
+			RectI(pixelArea7.mPixelOffset, Point2I(pixelArea7.mPixelWidth, pixelArea7.mPixelHeight)), 
+			RectI(pixelArea8.mPixelOffset, Point2I(pixelArea8.mPixelWidth, pixelArea8.mPixelHeight)), 
+			RectI(pixelArea9.mPixelOffset, Point2I(pixelArea9.mPixelWidth, pixelArea9.mPixelHeight)));
+	}
 }
 
-
-// DAW: Render out the sizable bitmap borders based on a multiplier into the bitmap array
-// Based on the 'Skinnable GUI Controls in TGE' resource by Justin DuJardin
-void renderSizableBitmapBordersFilledIndex(RectI &bounds, S32 startIndex, GuiControlProfile *profile)
+void renderSizableBorderedBitmap(RectI &bounds, U8 frame, TextureHandle &texture, RectI *bitmapBounds, S32 frameCount)
 {
-   // DAW: Indices into the bitmap array
-   S32 NumBitmaps = 9;
-   S32 BorderTopLeft =     startIndex;
-   S32 BorderTop =         1 + BorderTopLeft;
-   S32 BorderTopRight =    2 + BorderTopLeft;
-   S32 BorderLeft =        3 + BorderTopLeft;
-   S32 Fill =              4 + BorderTopLeft;
-   S32 BorderRight =       5 + BorderTopLeft;
-   S32 BorderBottomLeft =  6 + BorderTopLeft;
-   S32 BorderBottom =      7 + BorderTopLeft;
-   S32 BorderBottomRight = 8 + BorderTopLeft;
+   S32 NumFrames = 9;
+   S32 i = NumFrames * frame;
 
-   dglClearBitmapModulation();
-   if (profile->mBitmapArrayRects.size() >= (NumBitmaps + startIndex))
+   if (frameCount >= (NumFrames + i))
    {
-	   RectI destRect;
-	   RectI stretchRect;
-	   RectI* mBitmapBounds = profile->mBitmapArrayRects.address();
-
-	   // Draw all corners first.
-
-	   //top left border
-	   dglDrawBitmapSR(profile->mTextureHandle, Point2I(bounds.point.x, bounds.point.y), mBitmapBounds[BorderTopLeft]);
-	   //top right border
-	   dglDrawBitmapSR(profile->mTextureHandle, Point2I(bounds.point.x + bounds.extent.x - mBitmapBounds[BorderTopRight].extent.x, bounds.point.y), mBitmapBounds[BorderTopRight]);
-
-	   //bottom left border
-	   dglDrawBitmapSR(profile->mTextureHandle, Point2I(bounds.point.x, bounds.point.y + bounds.extent.y - mBitmapBounds[BorderBottomLeft].extent.y), mBitmapBounds[BorderBottomLeft]);
-	   //bottom right border
-	   dglDrawBitmapSR(profile->mTextureHandle, Point2I(
-		   bounds.point.x + bounds.extent.x - mBitmapBounds[BorderBottomRight].extent.x,
-		   bounds.point.y + bounds.extent.y - mBitmapBounds[BorderBottomRight].extent.y),
-		   mBitmapBounds[BorderBottomRight]);
-
-	   // End drawing corners
-
-	   // Begin drawing sides and top stretched borders
-
-	   //start with top line stretch
-	   destRect.point.x = bounds.point.x + mBitmapBounds[BorderTopLeft].extent.x;
-	   destRect.extent.x = bounds.extent.x - mBitmapBounds[BorderTopRight].extent.x - mBitmapBounds[BorderTopLeft].extent.x;
-	   destRect.extent.y = mBitmapBounds[BorderTop].extent.y;
-	   destRect.point.y = bounds.point.y;
-	   //stretch it
-	   stretchRect = mBitmapBounds[BorderTop];
-	   stretchRect.inset(1, 0);
-	   //draw it
-	   dglDrawBitmapStretchSR(profile->mTextureHandle, destRect, stretchRect);
-	   //bottom line stretch
-	   destRect.point.x = bounds.point.x + mBitmapBounds[BorderBottomLeft].extent.x;
-	   destRect.extent.x = bounds.extent.x - mBitmapBounds[BorderBottomRight].extent.x - mBitmapBounds[BorderBottomLeft].extent.x;
-	   destRect.extent.y = mBitmapBounds[BorderBottom].extent.y;
-	   destRect.point.y = bounds.point.y + bounds.extent.y - mBitmapBounds[BorderBottom].extent.y;
-	   //stretch it
-	   stretchRect = mBitmapBounds[BorderBottom];
-	   stretchRect.inset(1, 0);
-	   //draw it
-	   dglDrawBitmapStretchSR(profile->mTextureHandle, destRect, stretchRect);
-	   //left line stretch
-	   destRect.point.x = bounds.point.x;
-	   destRect.extent.x = mBitmapBounds[BorderLeft].extent.x;
-	   destRect.extent.y = bounds.extent.y - mBitmapBounds[BorderTopLeft].extent.y - mBitmapBounds[BorderBottomLeft].extent.y;
-	   destRect.point.y = bounds.point.y + mBitmapBounds[BorderTopLeft].extent.y;
-	   //stretch it
-	   stretchRect = mBitmapBounds[BorderLeft];
-	   stretchRect.inset(0, 1);
-	   //draw it
-	   dglDrawBitmapStretchSR(profile->mTextureHandle, destRect, stretchRect);
-	   //right line stretch
-	   destRect.point.x = bounds.point.x + bounds.extent.x - mBitmapBounds[BorderRight].extent.x;
-	   destRect.extent.x = mBitmapBounds[BorderRight].extent.x;
-	   destRect.extent.y = bounds.extent.y - mBitmapBounds[BorderTopRight].extent.y - mBitmapBounds[BorderBottomRight].extent.y;
-	   destRect.point.y = bounds.point.y + mBitmapBounds[BorderTopRight].extent.y;
-	   //stretch it
-	   stretchRect = mBitmapBounds[BorderRight];
-	   stretchRect.inset(0, 1);
-	   //draw it
-	   dglDrawBitmapStretchSR(profile->mTextureHandle, destRect, stretchRect);
-	   //fill stretch
-	   destRect.point.x = bounds.point.x + mBitmapBounds[BorderLeft].extent.x;
-	   destRect.extent.x = (bounds.extent.x) - mBitmapBounds[BorderLeft].extent.x - mBitmapBounds[BorderRight].extent.x;
-	   destRect.extent.y = bounds.extent.y - mBitmapBounds[BorderTop].extent.y - mBitmapBounds[BorderBottom].extent.y;
-	   destRect.point.y = bounds.point.y + mBitmapBounds[BorderTop].extent.y;
-	   //stretch it
-	   stretchRect = mBitmapBounds[Fill];
-	   stretchRect.inset(1, 1);
-	   //draw it
-	   dglDrawBitmapStretchSR(profile->mTextureHandle, destRect, stretchRect);
-
-	   // End drawing sides and top stretched borders
+	   renderSizableBorderedTexture(bounds, texture, bitmapBounds[i], bitmapBounds[i+1], bitmapBounds[i+2], bitmapBounds[i+3], bitmapBounds[i+4], bitmapBounds[i+5], bitmapBounds[i+6], bitmapBounds[i+7], bitmapBounds[i+8]);
    }
 }
 
-
-
-// DAW: Render out the fixed bitmap borders based on a multiplier into the bitmap array
-// It renders left and right caps, with a sizable fill area in the middle to reach
-// the x extent.  It does not stretch in the y direction.
-void renderFixedBitmapBordersFilled(RectI &bounds, S32 baseMultiplier, GuiControlProfile *profile)
+void renderSizableBorderedTexture(RectI &bounds, TextureHandle &texture, RectI &TopLeft, RectI &Top, RectI &TopRight, RectI &Left, RectI &Fill, RectI &Right, RectI &BottomLeft, RectI &Bottom, RectI &BottomRight)
 {
-   // DAW: Indices into the bitmap array
-   S32 NumBitmaps = 3;
-   S32 BorderLeft =     NumBitmaps * baseMultiplier - NumBitmaps;
-   S32 Fill =              1 + BorderLeft;
-   S32 BorderRight =       2 + BorderLeft;
-
-   dglClearBitmapModulation();
-   if(profile->mBitmapArrayRects.size() >= (NumBitmaps * baseMultiplier))
-   {
-      RectI destRect;
-      RectI stretchRect;
-      RectI* mBitmapBounds = profile->mBitmapArrayRects.address();
-
-      // Draw all corners first.
-
-      //left border
-      dglDrawBitmapSR(profile->mTextureHandle,Point2I(bounds.point.x,bounds.point.y),mBitmapBounds[BorderLeft]);
-      //right border
-      dglDrawBitmapSR(profile->mTextureHandle,Point2I(bounds.point.x + bounds.extent.x - mBitmapBounds[BorderRight].extent.x,bounds.point.y),mBitmapBounds[BorderRight]);
-
-      // End drawing corners
-
-      // Begin drawing fill
-
-      //fill stretch
-      destRect.point.x = bounds.point.x + mBitmapBounds[BorderLeft].extent.x;
-      destRect.extent.x = (bounds.extent.x) - mBitmapBounds[BorderLeft].extent.x - mBitmapBounds[BorderRight].extent.x;
-      destRect.extent.y = mBitmapBounds[Fill].extent.y;
-      destRect.point.y = bounds.point.y;
-      //stretch it
-      stretchRect = mBitmapBounds[Fill];
-      stretchRect.inset(1,0);
-      //draw it
-      dglDrawBitmapStretchSR(profile->mTextureHandle,destRect,stretchRect);
-
-      // End drawing fill
-   }
+	dglClearBitmapModulation();
+	RectI destRect;
+	RectI stretchRect;
+
+	//top corners
+	dglDrawBitmapSR(texture, bounds.point, TopLeft);
+	dglDrawBitmapSR(texture, Point2I(bounds.point.x + bounds.extent.x - TopRight.extent.x, bounds.point.y), TopRight);
+
+	//bottom corners
+	dglDrawBitmapSR(texture, Point2I(bounds.point.x, bounds.point.y + bounds.extent.y - BottomLeft.extent.y), BottomLeft);
+	dglDrawBitmapSR(texture, Point2I(bounds.point.x + bounds.extent.x - BottomRight.extent.x, bounds.point.y + bounds.extent.y - BottomRight.extent.y), BottomRight);
+
+	//top line stretch
+	destRect.point.x = bounds.point.x + TopLeft.extent.x;
+	destRect.extent.x = bounds.extent.x - TopRight.extent.x - TopLeft.extent.x;
+	destRect.extent.y = Top.extent.y;
+	destRect.point.y = bounds.point.y;
+	stretchRect = Top;
+	stretchRect.inset(1, 0);
+	dglDrawBitmapStretchSR(texture, destRect, stretchRect);
+
+	//bottom line stretch
+	destRect.point.x = bounds.point.x + BottomLeft.extent.x;
+	destRect.extent.x = bounds.extent.x - BottomRight.extent.x - BottomLeft.extent.x;
+	destRect.extent.y = Bottom.extent.y;
+	destRect.point.y = bounds.point.y + bounds.extent.y - Bottom.extent.y;
+	stretchRect = Bottom;
+	stretchRect.inset(1, 0);
+	dglDrawBitmapStretchSR(texture, destRect, stretchRect);
+
+	//left line stretch
+	destRect.point.x = bounds.point.x;
+	destRect.extent.x = Left.extent.x;
+	destRect.extent.y = bounds.extent.y - TopLeft.extent.y - BottomLeft.extent.y;
+	destRect.point.y = bounds.point.y + TopLeft.extent.y;
+	stretchRect = Left;
+	stretchRect.inset(0, 1);
+	dglDrawBitmapStretchSR(texture, destRect, stretchRect);
+
+	//right line stretch
+	destRect.point.x = bounds.point.x + bounds.extent.x - Right.extent.x;
+	destRect.extent.x = Right.extent.x;
+	destRect.extent.y = bounds.extent.y - TopRight.extent.y - BottomRight.extent.y;
+	destRect.point.y = bounds.point.y + TopRight.extent.y;
+	stretchRect = Right;
+	stretchRect.inset(0, 1);
+	dglDrawBitmapStretchSR(texture, destRect, stretchRect);
+
+	//fill stretch
+	destRect.point.x = bounds.point.x + Left.extent.x;
+	destRect.extent.x = (bounds.extent.x) - Left.extent.x - Right.extent.x;
+	destRect.extent.y = bounds.extent.y - Top.extent.y - Bottom.extent.y;
+	destRect.point.y = bounds.point.y + Top.extent.y;
+	stretchRect = Fill;
+	stretchRect.inset(1, 1);
+	dglDrawBitmapStretchSR(texture, destRect, stretchRect);
 }
 
-// DAW: Render out the fixed bitmap borders based on a multiplier into the bitmap array
+// Renders out the fixed bitmap borders based on a multiplier into the bitmap array.
 // It renders left and right caps, with a sizable fill area in the middle to reach
 // the x extent.  It does not stretch in the y direction.
-void renderFixedBitmapBordersFilledIndex(RectI &bounds, S32 startIndex, GuiControlProfile *profile)
+void renderFixedBitmapBordersFilled(RectI &bounds, S32 baseMultiplier, GuiControlProfile *profile)
 {
-   // DAW: Indices into the bitmap array
-   S32 NumBitmaps = 3;
+	S32 NumBitmaps = 3;
+	S32 startIndex = NumBitmaps * (baseMultiplier - 1);
    S32 BorderLeft =     startIndex;
    S32 Fill =              1 + startIndex;
    S32 BorderRight =       2 + startIndex;
@@ -293,73 +308,48 @@ void renderFixedBitmapBordersFilledIndex(RectI &bounds, S32 startIndex, GuiContr
       RectI stretchRect;
       RectI* mBitmapBounds = profile->mBitmapArrayRects.address();
 
-      // Draw all corners first.
-
-      //left border
+      //draw left endcap
       dglDrawBitmapSR(profile->mTextureHandle,Point2I(bounds.point.x,bounds.point.y),mBitmapBounds[BorderLeft]);
-      //right border
+      //draw right endcap
       dglDrawBitmapSR(profile->mTextureHandle,Point2I(bounds.point.x + bounds.extent.x - mBitmapBounds[BorderRight].extent.x,bounds.point.y),mBitmapBounds[BorderRight]);
 
-      // End drawing corners
-
-      // Begin drawing fill
-
-      //fill stretch
+      //draw stretched content
       destRect.point.x = bounds.point.x + mBitmapBounds[BorderLeft].extent.x;
       destRect.extent.x = (bounds.extent.x) - mBitmapBounds[BorderLeft].extent.x - mBitmapBounds[BorderRight].extent.x;
-      destRect.extent.y = mBitmapBounds[Fill].extent.y;
+      destRect.extent.y = bounds.extent.y;
       destRect.point.y = bounds.point.y;
       //stretch it
       stretchRect = mBitmapBounds[Fill];
       stretchRect.inset(1,0);
       //draw it
       dglDrawBitmapStretchSR(profile->mTextureHandle,destRect,stretchRect);
-
-      // End drawing fill
    }
 }
 
-// DAW: Render out the fixed bitmap borders based on a multiplier into the bitmap array
-// It renders left and right caps, with a sizable fill area in the middle to reach
-// the x extent.  It does not stretch in the y direction.
-void renderFixedBitmapBordersStretchYFilled(RectI &bounds, S32 baseMultiplier, GuiControlProfile *profile)
+// Renders out a stretched bitmap.
+void renderStretchedBitmap(RectI &bounds, U8 frame, GuiControlProfile *profile)
 {
-   // DAW: Indices into the bitmap array
-   S32 NumBitmaps = 3;
-   S32 BorderLeft =     NumBitmaps * baseMultiplier - NumBitmaps;
-   S32 Fill =              1 + BorderLeft;
-   S32 BorderRight =       2 + BorderLeft;
-
-   dglClearBitmapModulation();
-   if(profile->mBitmapArrayRects.size() >= (NumBitmaps * baseMultiplier))
-   {
-      RectI destRect;
-      RectI stretchRect;
-      RectI* mBitmapBounds = profile->mBitmapArrayRects.address();
-
-      // Draw all corners first.
-
-      //left border
-      dglDrawBitmapStretchSR(profile->mTextureHandle, RectI( bounds.point.x, bounds.point.y, mBitmapBounds[BorderLeft].extent.x, bounds.extent.y ), mBitmapBounds[BorderLeft] );
-      //right border
-      dglDrawBitmapStretchSR(profile->mTextureHandle, RectI(bounds.point.x + bounds.extent.x - mBitmapBounds[BorderRight].extent.x, bounds.point.y, mBitmapBounds[BorderRight].extent.x, bounds.extent.y ), mBitmapBounds[BorderRight] );
-
-      // End drawing corners
+	dglClearBitmapModulation();
+	if (profile->mBitmapArrayRects.size() > frame)
+	{
+		RectI* mBitmapBounds = profile->mBitmapArrayRects.address();
+		dglDrawBitmapStretchSR(profile->mTextureHandle, bounds, mBitmapBounds[frame]);
+	}
+}
 
-      // Begin drawing fill
+// Renders out a stretched image asset.
+void renderStretchedImageAsset(RectI &bounds, U8 frame, GuiControlProfile *profile)
+{
+	dglClearBitmapModulation();
+	ImageAsset *imageAsset = profile->mImageAsset;
 
-      //fill stretch
-      destRect.point.x = bounds.point.x + mBitmapBounds[BorderLeft].extent.x;
-      destRect.extent.x = (bounds.extent.x) - mBitmapBounds[BorderLeft].extent.x - mBitmapBounds[BorderRight].extent.x;
-      destRect.extent.y = bounds.extent.y;
-      destRect.point.y = bounds.point.y;
-      //stretch it
-      stretchRect = mBitmapBounds[Fill];
-      stretchRect.inset(1,0);
-      //draw it
-      dglDrawBitmapStretchSR(profile->mTextureHandle, destRect, stretchRect);
+	if (imageAsset != NULL && imageAsset->isAssetValid() && imageAsset->getFrameCount() > frame)
+	{
+		const ImageAsset::FrameArea::PixelArea& pixelArea = imageAsset->getImageFrameArea(frame).mPixelArea;
+		RectI srcRect(pixelArea.mPixelOffset, Point2I(pixelArea.mPixelWidth, pixelArea.mPixelHeight));
 
-      // End drawing fill
-   }
+		// Render image.
+		dglDrawBitmapStretchSR(imageAsset->getImageTexture(), bounds, srcRect);
+	}
 }
 

+ 7 - 5
engine/source/gui/guiDefaultControlRender.h

@@ -29,13 +29,15 @@
 
 class GuiControlProfile;
 
+void renderUniversalRect(RectI &bounds, GuiControlProfile *profile, GuiControlState state, const ColorI &fillColor = "White", const bool bUseFillColor = false);
 void renderBorderedRect(RectI &bounds, GuiControlProfile *profile, GuiControlState state);
 void renderBorderedRect(RectI &bounds, GuiControlProfile *profile, GuiControlState state, const ColorI &fillColor);
 void renderBorderedCircle(Point2I &center, S32 radius, GuiControlProfile *profile, GuiControlState state);
-void renderSizableBitmapBordersFilled(RectI &bounds, S32 baseMultiplier, GuiControlProfile *profile); 
-void renderSizableBitmapBordersFilledIndex(RectI &bounds, S32 startIndex, GuiControlProfile *profile);
-void renderFixedBitmapBordersFilled(RectI &bounds, S32 baseMultiplier, GuiControlProfile *profile); 
-void renderFixedBitmapBordersFilled(RectI &bounds, S32 startIndex, GuiControlProfile *profile);
-void renderFixedBitmapBordersStretchYFilled(RectI &bounds, S32 baseMultiplier, GuiControlProfile *profile);
+void renderSizableBorderedImageAsset(RectI &bounds, U8 frame, ImageAsset *mImageAsset, S32 frameCount);
+void renderSizableBorderedBitmap(RectI &bounds, U8 frame, TextureHandle &texture, RectI *bitmapBounds, S32 frameCount);
+void renderSizableBorderedTexture(RectI &bounds, TextureHandle &texture, RectI &TopLeft, RectI &Top, RectI &TopRight, RectI &Left, RectI &Fill, RectI &Right, RectI &BottomLeft, RectI &Bottom, RectI &BottomRight);
+void renderFixedBitmapBordersFilled(RectI &bounds, S32 baseMultiplier, GuiControlProfile *profile);
+void renderStretchedBitmap(RectI &bounds, U8 frame, GuiControlProfile *profile);
+void renderStretchedImageAsset(RectI &bounds, U8 frame, GuiControlProfile *profile);
 
 #endif

+ 14 - 14
engine/source/gui/guiPopUpCtrl.cc

@@ -839,7 +839,7 @@ void GuiPopUpMenuCtrl::onRender(Point2I offset, const RectI &updateRect)
             index = 4; // inactive state images are indexes 4 and 5.
             //S32 l = r.point.x, r2 = r.point.x + r.extent.x - 1;
             //S32 t = r.point.y, b = r.point.y + r.extent.y - 1;
-            renderFixedBitmapBordersStretchYFilled(r, index, mProfile);
+			renderFixedBitmapBordersFilled(r, index, mProfile);
             return;
         }
     }
@@ -852,7 +852,7 @@ void GuiPopUpMenuCtrl::onRender(Point2I offset, const RectI &updateRect)
       if(mProfile->mProfileForChildren && mProfile->mBitmapArrayRects.size())
       {
          // Render the fixed, filled in border
-         renderFixedBitmapBordersStretchYFilled(r, 3, mProfile);
+		  renderFixedBitmapBordersFilled(r, 3, mProfile);
          renderedBitmapIndex = 3;
       } 
       else
@@ -895,7 +895,7 @@ void GuiPopUpMenuCtrl::onRender(Point2I offset, const RectI &updateRect)
          if(mProfile->mProfileForChildren && mProfile->mBitmapArrayRects.size())
          {
             // Render the fixed, filled in border
-            renderFixedBitmapBordersStretchYFilled(r, 2, mProfile);
+			 renderFixedBitmapBordersFilled(r, 2, mProfile);
             renderedBitmapIndex = 2;
 
          } else
@@ -927,7 +927,7 @@ void GuiPopUpMenuCtrl::onRender(Point2I offset, const RectI &updateRect)
          if(mProfile->mProfileForChildren && mProfile->mBitmapArrayRects.size())
          {
             // Render the fixed, filled in border
-            renderFixedBitmapBordersStretchYFilled(r, 1, mProfile);
+			 renderFixedBitmapBordersFilled(r, 1, mProfile);
             renderedBitmapIndex = 1;
 
          } else
@@ -951,9 +951,9 @@ void GuiPopUpMenuCtrl::onRender(Point2I offset, const RectI &updateRect)
       }
       //      renderSlightlyRaisedBox(r, mProfile); // DAW: Used to be the only 'else' condition to mInAction above.
 
-      S32 txt_w = mFont->getStrWidth(mText);
+      S32 txt_w = mProfile->mFont->getStrWidth(mText);
       localStart.x = 0;
-      localStart.y = (mBounds.extent.y - (mFont->getHeight())) / 2;
+      localStart.y = (mBounds.extent.y - (mProfile->mFont->getHeight())) / 2;
 
         // DAW: Indices into the bitmap array
         const S32 NumBitmaps = 3;
@@ -1069,28 +1069,28 @@ void GuiPopUpMenuCtrl::onRender(Point2I offset, const RectI &updateRect)
 
          // Draw the first column
          getColumn(mText, buff, 0, "\t");
-         dglDrawText(mFont, globalStart, buff, mProfile->mFontColors);
+         dglDrawText(mProfile->mFont, globalStart, buff, mProfile->mFontColors);
 
          // Draw the second column to the right
          getColumn(mText, buff, 1, "\t");
-         S32 txt_w = mFont->getStrWidth(buff);
+         S32 txt_w = mProfile->mFont->getStrWidth(buff);
          if(mProfile->mProfileForChildren && mProfile->mBitmapArrayRects.size())
          {
             // We're making use of a bitmap border, so take into account the
             // right cap of the border.
             RectI* mBitmapBounds = mProfile->mBitmapArrayRects.address();
             Point2I textpos = localToGlobalCoord(Point2I(mBounds.extent.x - txt_w - mBitmapBounds[2].extent.x,localStart.y));
-            dglDrawText(mFont, textpos, buff, mProfile->mFontColors);
+            dglDrawText(mProfile->mFont, textpos, buff, mProfile->mFontColors);
 
          } else
          {
             Point2I textpos = localToGlobalCoord(Point2I(mBounds.extent.x - txt_w - 12,localStart.y));
-            dglDrawText(mFont, textpos, buff, mProfile->mFontColors);
+            dglDrawText(mProfile->mFont, textpos, buff, mProfile->mFontColors);
          }
 
       } else
       {
-         dglDrawText(mFont, globalStart, mText, mProfile->mFontColors);
+         dglDrawText(mProfile->mFont, globalStart, mText, mProfile->mFontColors);
       }
 
       // Restore the clip rectangle.
@@ -1224,8 +1224,8 @@ void GuiPopUpMenuCtrl::onAction()
    bool setScroll = false;
 
    for( U32 i=0; i < (U32)mEntries.size(); ++i )
-      if(S32(mFont->getStrWidth(mEntries[i].buf)) > textWidth)
-         textWidth = mFont->getStrWidth(mEntries[i].buf);
+      if(S32(mProfile->mFont->getStrWidth(mEntries[i].buf)) > textWidth)
+         textWidth = mProfile->mFont->getStrWidth(mEntries[i].buf);
 
    //if(textWidth > mBounds.extent.x)
    S32 sbWidth = 0;//mSc->mProfile->mBorderSize * 2 + mSc->scrollBarThickness(); // DAW: Calculate the scroll bar width
@@ -1242,7 +1242,7 @@ void GuiPopUpMenuCtrl::onAction()
    }
 
    //mTl->setCellSize(Point2I(width, mFont->getHeight()+3));
-   mTl->setCellSize(Point2I(width, mFont->getHeight() + textSpace)); // DAW: Modified the above line to use textSpace rather than the '3' as this is what is used below.
+   mTl->setCellSize(Point2I(width, mProfile->mFont->getHeight() + textSpace)); // DAW: Modified the above line to use textSpace rather than the '3' as this is what is used below.
 
    for( U32 j = 0; j < (U32)mEntries.size(); ++j )
       mTl->addEntry(mEntries[j].id, mEntries[j].buf);

+ 2 - 2
engine/source/gui/guiPopUpCtrl.h

@@ -70,9 +70,9 @@ public:
    void onRenderCell(Point2I offset, Point2I cell, bool selected, bool mouseOver);
 };
 
-class GuiPopUpMenuCtrl : public GuiTextCtrl
+class GuiPopUpMenuCtrl : public GuiControl
 {
-   typedef GuiTextCtrl Parent;
+   typedef GuiControl Parent;
 
 public:
    struct Entry

+ 10 - 10
engine/source/gui/guiPopUpCtrlEx.cc

@@ -960,9 +960,9 @@ void GuiPopUpMenuCtrlEx::onRender(Point2I offset, const RectI &updateRect)
    }
 //      renderSlightlyRaisedBox(r, mProfile); // DAW: Used to be the only 'else' condition to mInAction above.
 
-   S32 txt_w = mFont->getStrWidth(mText);
+   S32 txt_w = mProfile->mFont->getStrWidth(mText);
    localStart.x = 0;
-   localStart.y = (mBounds.extent.y - (mFont->getHeight())) / 2;
+   localStart.y = (mBounds.extent.y - (mProfile->mFont->getHeight())) / 2;
 
    // align the horizontal
    switch (mProfile->mAlignment)
@@ -1046,28 +1046,28 @@ void GuiPopUpMenuCtrlEx::onRender(Point2I offset, const RectI &updateRect)
 
       // Draw the first column
       getColumn(mText, buff, 0, "\t");
-      dglDrawText(mFont, globalStart, buff, mProfile->mFontColors);
+      dglDrawText(mProfile->mFont, globalStart, buff, mProfile->mFontColors);
 
 	  // Draw the second column to the right
       getColumn(mText, buff, 1, "\t");
-      S32 txt_w = mFont->getStrWidth(buff);
+      S32 txt_w = mProfile->mFont->getStrWidth(buff);
       if(mProfile->mProfileForChildren && mProfile->mBitmapArrayRects.size())
       {
          // We're making use of a bitmap border, so take into account the
          // right cap of the border.
          RectI* mBitmapBounds = mProfile->mBitmapArrayRects.address();
          Point2I textpos = localToGlobalCoord(Point2I(mBounds.extent.x - txt_w - mBitmapBounds[2].extent.x,localStart.y));
-         dglDrawText(mFont, textpos, buff, mProfile->mFontColors);
+         dglDrawText(mProfile->mFont, textpos, buff, mProfile->mFontColors);
 
       } else
       {
          Point2I textpos = localToGlobalCoord(Point2I(mBounds.extent.x - txt_w - 12,localStart.y));
-         dglDrawText(mFont, textpos, buff, mProfile->mFontColors);
+         dglDrawText(mProfile->mFont, textpos, buff, mProfile->mFontColors);
 	  }
 
    } else
    {
-      dglDrawText(mFont, globalStart, mText, mProfile->mFontColors);
+      dglDrawText(mProfile->mFont, globalStart, mText, mProfile->mFontColors);
    }
 
    // If we're rendering a bitmap border, then it will take care of the arrow.
@@ -1207,8 +1207,8 @@ void GuiPopUpMenuCtrlEx::onAction()
    bool setScroll = false;
       
    for( U32 i = 0; i < (U32)mEntries.size(); ++i )
-      if(S32(mFont->getStrWidth(mEntries[i].buf)) > textWidth)
-         textWidth = mFont->getStrWidth(mEntries[i].buf);
+      if(S32(mProfile->mFont->getStrWidth(mEntries[i].buf)) > textWidth)
+         textWidth = mProfile->mFont->getStrWidth(mEntries[i].buf);
 
    //if(textWidth > mBounds.extent.x)
    S32 sbWidth = 0;//TODO: mSc->mProfile->mBorderSize * 2 + mSc->scrollBarThickness(); // DAW: Calculate the scroll bar width
@@ -1225,7 +1225,7 @@ void GuiPopUpMenuCtrlEx::onAction()
    }
 
    //mTl->setCellSize(Point2I(width, mFont->getHeight()+3));
-   mTl->setCellSize(Point2I(width, mFont->getHeight() + textSpace)); // DAW: Modified the above line to use textSpace rather than the '3' as this is what is used below.
+   mTl->setCellSize(Point2I(width, mProfile->mFont->getHeight() + textSpace)); // DAW: Modified the above line to use textSpace rather than the '3' as this is what is used below.
 
    for( U32 j=0; j < (U32)mEntries.size(); ++j )
       mTl->addEntry(mEntries[j].id, mEntries[j].buf);

+ 2 - 2
engine/source/gui/guiPopUpCtrlEx.h

@@ -90,9 +90,9 @@ class GuiPopupTextListCtrlEx : public GuiTextListCtrl
       void onRenderCell(Point2I offset, Point2I cell, bool selected, bool mouseOver);
 };
 
-class GuiPopUpMenuCtrlEx : public GuiTextCtrl
+class GuiPopUpMenuCtrlEx : public GuiControl
 {
-   typedef GuiTextCtrl Parent;
+   typedef GuiControl Parent;
 
   public:
    struct Entry

+ 2 - 2
engine/source/gui/guiProgressCtrl.h

@@ -32,10 +32,10 @@
 #endif
 
 
-class GuiProgressCtrl : public GuiTextCtrl
+class GuiProgressCtrl : public GuiControl
 {
 private:
-   typedef GuiTextCtrl Parent;
+   typedef GuiControl Parent;
 
    F32 mProgress;
 

+ 1 - 1
engine/source/gui/guiSliderCtrl.cc

@@ -440,7 +440,7 @@ void GuiSliderCtrl::onRender(Point2I offset, const RectI &updateRect)
 
         // draw the thumb
         thumb.point += pos;
-        renderBorderedRect(thumb, mProfile, NormalState);
+		renderUniversalRect(thumb, mProfile, NormalState);
     }
 
     if (mDisplayValue)

+ 0 - 16
engine/source/gui/guiTextCtrl.cc

@@ -157,22 +157,6 @@ void GuiTextCtrl::setText(const char *txt)
 		mProfile->decRefCount();
 		return;
 	}
-
-	//resize
-	//DEPRECIATED
-   /*
-   if (mProfile->mAutoSizeWidth)
-   {
-      if (mProfile->mAutoSizeHeight)
-         resize(mBounds.point, Point2I(mFont->getStrWidth((const UTF8 *)mText), mFont->getHeight() + 4));
-      else
-         resize(mBounds.point, Point2I(mFont->getStrWidth((const UTF8 *)mText), mBounds.extent.y));
-   }
-   else if (mProfile->mAutoSizeHeight)
-   {
-      resize(mBounds.point, Point2I(mBounds.extent.x, mFont->getHeight() + 4));
-   }
-   */
       
    setVariable((char*)mText);
    setUpdate();

+ 135 - 11
engine/source/gui/guiTextEditCtrl.cc

@@ -22,6 +22,7 @@
 
 #include "console/consoleTypes.h"
 #include "console/console.h"
+#include "graphics/gColor.h"
 #include "graphics/dgl.h"
 #include "gui/guiCanvas.h"
 #include "gui/guiMLTextCtrl.h"
@@ -69,6 +70,8 @@ GuiTextEditCtrl::GuiTextEditCtrl()
    mPasswordMask = StringTable->insert( "*" );
 
    mEditCursor = NULL;
+   mMaxStrLen = GuiTextEditCtrl::MAX_STRING_LENGTH;
+   mTruncateWhenUnfocused = false;
 }
 
 GuiTextEditCtrl::~GuiTextEditCtrl()
@@ -95,6 +98,8 @@ void GuiTextEditCtrl::initPersistFields()
    addField("sinkAllKeyEvents",  TypeBool,      Offset(mSinkAllKeyEvents,  GuiTextEditCtrl));
    addField("password",          TypeBool,      Offset(mPasswordText,      GuiTextEditCtrl));
    addField("passwordMask",      TypeString,    Offset(mPasswordMask,      GuiTextEditCtrl));
+   addField("maxLength",		TypeS32, Offset(mMaxStrLen, GuiTextEditCtrl));
+   addField("truncate",			TypeBool, Offset(mTruncateWhenUnfocused, GuiTextEditCtrl));
 }
 
 bool GuiTextEditCtrl::onAdd()
@@ -127,11 +132,41 @@ void GuiTextEditCtrl::onStaticModified(const char* slotName)
       setText(mText);
 }
 
+void GuiTextEditCtrl::inspectPostApply()
+{
+	Parent::inspectPostApply();
+	if (mTextID && *mTextID != 0)
+		setTextID(mTextID);
+	else
+		setText(mText);
+}
+
 bool GuiTextEditCtrl::onWake()
 {
    if (! Parent::onWake())
       return false;
 
+   mFont = mProfile->mFont;
+   AssertFatal(mFont, "GuiTextCtrl::onWake: invalid font in profile");
+
+   if (mConsoleVariable[0])
+   {
+	   const char *txt = Con::getVariable(mConsoleVariable);
+	   if (txt)
+	   {
+		   if (dStrlen(txt) > (U32)mMaxStrLen)
+		   {
+			   char* buf = new char[mMaxStrLen + 1];
+			   dStrncpy(buf, txt, mMaxStrLen);
+			   buf[mMaxStrLen] = 0;
+			   setScriptValue(buf);
+			   delete[] buf;
+		   }
+		   else
+			   setScriptValue(txt);
+	   }
+   }
+
    // If this is the first awake text edit control, enable keyboard translation
    if (smNumAwake == 0)
       Platform::enableKeyboardTranslation();
@@ -143,6 +178,7 @@ bool GuiTextEditCtrl::onWake()
 void GuiTextEditCtrl::onSleep()
 {
    Parent::onSleep();
+   mFont = NULL;
 
    // If this is the last awake text edit control, disable keyboard translation
    --smNumAwake;
@@ -207,6 +243,28 @@ void GuiTextEditCtrl::getText( char *dest )
  
 void GuiTextEditCtrl::setText( const UTF8 *txt )
 {
+	//make sure we don't call this before onAdd();
+	if (!mProfile)
+		return;
+
+	//Make sure we have a font
+	mProfile->incRefCount();
+	mFont = mProfile->mFont;
+
+	//If the font isn't found, we want to decrement the profile usage and return now or we may crash!
+	if (mFont.isNull())
+	{
+		//decrement the profile referrence
+		mProfile->decRefCount();
+		return;
+	}
+
+	setVariable((char*)mText);
+	setUpdate();
+
+	//decrement the profile referrence
+	mProfile->decRefCount();
+
    if(txt && txt[0] != 0)
    {
       Parent::setText(txt);
@@ -229,21 +287,29 @@ void GuiTextEditCtrl::setText( const UTF16* txt)
    {
       UTF8* txt8 = convertUTF16toUTF8( txt );
       Parent::setText( txt8 );
+	  setText(txt8);
       delete[] txt8;
-      mTextBuffer.set( txt );
    }
    else
    {
       Parent::setText("");
-      mTextBuffer.set("");
-   }
-   
-    //respect the max size
-    int diff = mTextBuffer.length() - mMaxStrLen; 
-    if( diff > 0 ) {
-        mTextBuffer.cut( mMaxStrLen, diff );
-    }
-   mCursorPos = mTextBuffer.length();   
+      setText("");
+   }  
+}
+
+void GuiTextEditCtrl::setTextID(const char *id)
+{
+	S32 n = Con::getIntVariable(id, -1);
+	if (n != -1)
+	{
+		setTextID(n);
+	}
+}
+void GuiTextEditCtrl::setTextID(S32 id)
+{
+	const UTF8 *str = getGUIString(id);
+	if (str)
+		setText((const char*)str);
 }
 
 void GuiTextEditCtrl::selectAllText()
@@ -1128,7 +1194,7 @@ void GuiTextEditCtrl::onRender(Point2I offset, const RectI & updateRect)
 		return;
 	}
 
-	renderBorderedRect(ctrlRect, mProfile, currentState);
+	renderUniversalRect(ctrlRect, mProfile, currentState);
 
 	//Render Text
 	dglSetBitmapModulation(mProfile->mFontColor);
@@ -1386,6 +1452,64 @@ void GuiTextEditCtrl::setScriptValue(const char *value)
    mCursorPos = getMin((S32)(mTextBuffer.length() - 1), 0);
 }
 
+
+StringBuffer GuiTextEditCtrl::truncate(StringBuffer buffer, StringBuffer terminationString, S32 width)
+{
+	// Check if the buffer width exceeds the specified width
+	S32 bufferWidth = textBufferWidth(buffer);
+
+	// If not, just return the unmodified buffer
+	if (bufferWidth <= width)
+		return buffer;
+
+	// Get the width of the termination string
+	S32 terminationWidth = textBufferWidth(terminationString) + 6; // add an extra bit of space at the end
+
+	// Calculate the new target width with space allowed for the termination string
+	S32 targetWidth = width - terminationWidth;
+
+	// If the target width is zero or less, just replace the entire buffer with the termination string
+	if (targetWidth <= 0)
+		return terminationString;
+
+	// Step backwards in the buffer until we find the character that fits within the target width
+	S32 currentWidth = 0;
+	S32 count = 0;
+	for (S32 i = 0; i < (S32)buffer.length(); i++)
+	{
+		if (currentWidth >= targetWidth)
+			break;
+
+		UTF16 c = buffer.getChar(i);
+		currentWidth += mFont->getCharXIncrement(c);
+		count++;
+	}
+
+	// Get the substring
+	StringBuffer retBuffer = buffer.substring(0, count - 2);
+
+	// Append terminating string
+	retBuffer.append(terminationString);
+
+	return retBuffer;
+}
+
+S32 GuiTextEditCtrl::textBufferWidth(StringBuffer buffer)
+{
+	S32 charLength = 0;
+
+	for (S32 count = 0; count < (S32)buffer.length(); count++)
+	{
+		UTF16 c = buffer.getChar(count);
+		if (!mFont->isValidChar(c))
+			continue;
+
+		charLength += mFont->getCharXIncrement(c);
+	}
+
+	return charLength;
+}
+
 ConsoleMethod( GuiTextEditCtrl, getText, const char*, 2, 2, "() Get the contents of the textedit control\n"
               "@return Returns the current textedit buffer.")
 {

+ 13 - 3
engine/source/gui/guiTextEditCtrl.h

@@ -30,15 +30,18 @@
 #include "gui/guiTextCtrl.h"
 #endif
 
-class GuiTextEditCtrl : public GuiTextCtrl
+class GuiTextEditCtrl : public GuiControl
 {
 private:
-   typedef GuiTextCtrl Parent;
+   typedef GuiControl Parent;
 
    static U32 smNumAwake;
 
 protected:
 
+	S32 mMaxStrLen;   // max string len, must be less then or equal to 255
+	Resource<GFont> mFont;
+	bool     mTruncateWhenUnfocused;
    StringBuffer mTextBuffer;
 
    StringTableEntry mValidateCommand;
@@ -86,6 +89,8 @@ protected:
    UTF16   **mHistoryBuf;
    void updateHistory(StringBuffer *txt, bool moveIndex);
 
+   S32 textBufferWidth(StringBuffer buffer);
+   StringBuffer truncate(StringBuffer buffer, StringBuffer terminationString, S32 width);
 
 public:
    GuiTextEditCtrl();
@@ -94,6 +99,7 @@ public:
    static void initPersistFields();
 
    bool onAdd();
+   void inspectPostApply();
    bool onWake();
    void onSleep();
 
@@ -104,6 +110,8 @@ public:
 
    virtual void setText(const UTF8* txt);
    virtual void setText(const UTF16* txt);
+   virtual void setTextID(S32 id);
+   virtual void setTextID(const char *id);
    S32   getCursorPos()   { return( mCursorPos ); }
    void  reallySetCursorPos( const S32 newPos );
    
@@ -134,7 +142,9 @@ public:
    virtual void drawText( const RectI &drawRect, GuiControlState currentState );
 	
 	void playDeniedSound();
-	void execConsoleCallback();	
+	void execConsoleCallback();
+
+	enum Constants { MAX_STRING_LENGTH = 1024 };
 };
 
 #endif //_GUI_TEXTEDIT_CTRL_H

+ 159 - 126
engine/source/gui/guiTypes.cc

@@ -57,7 +57,7 @@ void GuiCursor::initPersistFields()
 bool GuiCursor::onAdd()
 {
    if(!Parent::onAdd())
-      return false;
+	  return false;
 
    Sim::getGuiDataGroup()->addObject(this);
 
@@ -73,10 +73,10 @@ void GuiCursor::render(const Point2I &pos)
 {
    if (!mTextureHandle && mBitmapName && mBitmapName[0])
    {
-      mTextureHandle = TextureHandle(mBitmapName, TextureHandle::BitmapTexture);
-      if(!mTextureHandle)
-         return;
-      mExtent.set(mTextureHandle.getWidth(), mTextureHandle.getHeight());
+	  mTextureHandle = TextureHandle(mBitmapName, TextureHandle::BitmapTexture);
+	  if(!mTextureHandle)
+		 return;
+	  mExtent.set(mTextureHandle.getWidth(), mTextureHandle.getHeight());
    }
 
    // Render the cursor centered according to dimensions of texture
@@ -96,8 +96,7 @@ IMPLEMENT_CONOBJECT(GuiBorderProfile);
 
 GuiBorderProfile::GuiBorderProfile()
 {
-	S32 stateCount = static_cast<S32>(StateCount);
-	for(S32 i = 0; i < stateCount; i++)
+	for(S32 i = 0; i < 4; i++)
 	{
 		mMargin[i] = 0;
 		mBorder[i] = 0;
@@ -156,22 +155,22 @@ void GuiBorderProfile::onRemove()
 
 S32 GuiBorderProfile::getMargin(const GuiControlState state)
 {
-	return getMax(mMargin[static_cast<S32>(state)], 0);
+	return getMax(mMargin[getStateIndex(state)], 0);
 }
 
 S32 GuiBorderProfile::getBorder(const GuiControlState state)
 {
-	return getMax(mBorder[static_cast<S32>(state)], 0);
+	return getMax(mBorder[getStateIndex(state)], 0);
 }
 
 const ColorI& GuiBorderProfile::getBorderColor(const GuiControlState state)
 {
-	return mBorderColor[static_cast<S32>(state)];
+	return mBorderColor[getStateIndex(state)];
 }
 
 S32 GuiBorderProfile::getPadding(const GuiControlState state)
 {
-	return getMax(mPadding[static_cast<S32>(state)], 0);
+	return getMax(mPadding[getStateIndex(state)], 0);
 }
 
 //------------------------------------------------------------------------------
@@ -195,25 +194,25 @@ static EnumTable gVAlignTable(3, &vAlignEnums[0]);
 
 static EnumTable::Enums charsetEnums[]=
 {
-    { TGE_ANSI_CHARSET,         "ANSI" },
-    { TGE_SYMBOL_CHARSET,       "SYMBOL" },
-    { TGE_SHIFTJIS_CHARSET,     "SHIFTJIS" },
-    { TGE_HANGEUL_CHARSET,      "HANGEUL" },
-    { TGE_HANGUL_CHARSET,       "HANGUL" },
-    { TGE_GB2312_CHARSET,       "GB2312" },
-    { TGE_CHINESEBIG5_CHARSET,  "CHINESEBIG5" },
-    { TGE_OEM_CHARSET,          "OEM" },
-    { TGE_JOHAB_CHARSET,        "JOHAB" },
-    { TGE_HEBREW_CHARSET,       "HEBREW" },
-    { TGE_ARABIC_CHARSET,       "ARABIC" },
-    { TGE_GREEK_CHARSET,        "GREEK" },
-    { TGE_TURKISH_CHARSET,      "TURKISH" },
-    { TGE_VIETNAMESE_CHARSET,   "VIETNAMESE" },
-    { TGE_THAI_CHARSET,         "THAI" },
-    { TGE_EASTEUROPE_CHARSET,   "EASTEUROPE" },
-    { TGE_RUSSIAN_CHARSET,      "RUSSIAN" },
-    { TGE_MAC_CHARSET,          "MAC" },
-    { TGE_BALTIC_CHARSET,       "BALTIC" },
+	{ TGE_ANSI_CHARSET,         "ANSI" },
+	{ TGE_SYMBOL_CHARSET,       "SYMBOL" },
+	{ TGE_SHIFTJIS_CHARSET,     "SHIFTJIS" },
+	{ TGE_HANGEUL_CHARSET,      "HANGEUL" },
+	{ TGE_HANGUL_CHARSET,       "HANGUL" },
+	{ TGE_GB2312_CHARSET,       "GB2312" },
+	{ TGE_CHINESEBIG5_CHARSET,  "CHINESEBIG5" },
+	{ TGE_OEM_CHARSET,          "OEM" },
+	{ TGE_JOHAB_CHARSET,        "JOHAB" },
+	{ TGE_HEBREW_CHARSET,       "HEBREW" },
+	{ TGE_ARABIC_CHARSET,       "ARABIC" },
+	{ TGE_GREEK_CHARSET,        "GREEK" },
+	{ TGE_TURKISH_CHARSET,      "TURKISH" },
+	{ TGE_VIETNAMESE_CHARSET,   "VIETNAMESE" },
+	{ TGE_THAI_CHARSET,         "THAI" },
+	{ TGE_EASTEUROPE_CHARSET,   "EASTEUROPE" },
+	{ TGE_RUSSIAN_CHARSET,      "RUSSIAN" },
+	{ TGE_MAC_CHARSET,          "MAC" },
+	{ TGE_BALTIC_CHARSET,       "BALTIC" },
 };
 
 #define NUMCHARSETENUMS     (sizeof(charsetEnums) / sizeof(EnumTable::Enums))
@@ -226,14 +225,15 @@ GuiControlProfile::GuiControlProfile(void) :
    mFontColor(mFontColors[BaseColor]),
    mFontColorHL(mFontColors[ColorHL]),
    mFontColorNA(mFontColors[ColorNA]),
-   mFontColorSL(mFontColors[ColorSL])
+   mFontColorSL(mFontColors[ColorSL]),
+   mImageAssetID( StringTable->EmptyString )
 {
-    mRefCount = 0;
-    mBitmapArrayRects.clear();
-    mMouseOverSelected = false;
-    
-    mTabable       = false;
-    mCanKeyFocus   = false;
+	mRefCount = 0;
+	mBitmapArrayRects.clear();
+	mMouseOverSelected = false;
+	
+	mTabable       = false;
+	mCanKeyFocus   = false;
 	mUseInput      = true;
 
 	mBorderDefault = NULL;
@@ -241,22 +241,25 @@ GuiControlProfile::GuiControlProfile(void) :
 	mBorderRight = NULL;
 	mBorderTop = NULL;
 	mBorderBottom = NULL;
-    
-    // default font
-    mFontType      = StringTable->EmptyString;
-    mFontSize      = 12;
-    mFontCharset   = TGE_ANSI_CHARSET;
-    mFontColors[BaseColor].set(255,255,255,255);
-    
-    // default bitmap
-    mBitmapName    = NULL;
-    mTextOffset.set(0,0);
-    
-    mAlignment     = LeftAlign;
+	
+	// default font
+	mFontType      = StringTable->EmptyString;
+	mFontSize      = 12;
+	mFontCharset   = TGE_ANSI_CHARSET;
+	mFontColors[BaseColor].set(255,255,255,255);
+	
+	// default bitmap
+	mBitmapName    = NULL;
+	mTextOffset.set(0,0);
+
+	// default image asset
+	mImageAsset = NULL;
+	
+	mAlignment     = LeftAlign;
 	mVAlignment    = MiddleVAlign;
-    mReturnTab     = false;
-    mNumbersOnly   = false;
-    mProfileForChildren = NULL;
+	mReturnTab     = false;
+	mNumbersOnly   = false;
+	mProfileForChildren = NULL;
 
 	//fill color
 	mFillColor.set(0, 0, 0, 0);
@@ -309,6 +312,7 @@ void GuiControlProfile::initPersistFields()
    addField("cursorColor",   TypeColorI,     Offset(mCursorColor, GuiControlProfile));
 
    addField("bitmap",        TypeFilename,   Offset(mBitmapName, GuiControlProfile));
+   addProtectedField("imageAsset", TypeAssetId, Offset(mImageAssetID, GuiControlProfile), &setImageAsset, &getImageAsset, "The image asset ID used to render the control");
 
    addField("soundButtonDown", TypeAudioAssetPtr,  Offset(mSoundButtonDown, GuiControlProfile));
    addField("soundButtonOver", TypeAudioAssetPtr,  Offset(mSoundButtonOver, GuiControlProfile));
@@ -318,7 +322,7 @@ void GuiControlProfile::initPersistFields()
 bool GuiControlProfile::onAdd()
 {
    if(!Parent::onAdd())
-      return false;
+	  return false;
 
    Sim::getGuiDataGroup()->addObject(this);
 
@@ -328,22 +332,22 @@ bool GuiControlProfile::onAdd()
 S32 GuiControlProfile::constructBitmapArray()
 {
    if(mBitmapArrayRects.size())
-      return mBitmapArrayRects.size();
+	  return mBitmapArrayRects.size();
 
    GBitmap *bmp = mTextureHandle.getBitmap();
 
    // Make sure the texture exists.
    if( !bmp )
-      return 0;
+	  return 0;
   
    //get the separator color
    ColorI sepColor;
    if ( !bmp || !bmp->getColor( 0, 0, sepColor ) )
-    {
-      Con::errorf("Failed to create bitmap array from %s for profile %s - couldn't ascertain seperator color!", mBitmapName, getName());
-      AssertFatal( false, avar("Failed to create bitmap array from %s for profile %s - couldn't ascertain seperator color!", mBitmapName, getName()));
-      return 0;
-    }
+	{
+	  Con::errorf("Failed to create bitmap array from %s for profile %s - couldn't ascertain seperator color!", mBitmapName, getName());
+	  AssertFatal( false, avar("Failed to create bitmap array from %s for profile %s - couldn't ascertain seperator color!", mBitmapName, getName()));
+	  return 0;
+	}
 
    //now loop through all the scroll pieces, and find the bounding rectangle for each piece in each state
    S32 curY = 0;
@@ -353,101 +357,126 @@ S32 GuiControlProfile::constructBitmapArray()
    mBitmapArrayRects.clear();
    while(curY < (S32)bmp->getHeight())
    {
-      // skip any sep colors
-      bmp->getColor( 0, curY, color);
-      if(color == sepColor)
-      {
-         curY++;
-         continue;
-      }
-      // ok, process left to right, grabbing bitmaps as we go...
-      S32 curX = 0;
-      while(curX < (S32)bmp->getWidth())
-      {
-         bmp->getColor(curX, curY, color);
-         if(color == sepColor)
-         {
-            curX++;
-            continue;
-         }
-         S32 startX = curX;
-         while(curX < (S32)bmp->getWidth())
-         {
-            bmp->getColor(curX, curY, color);
-            if(color == sepColor)
-               break;
-            curX++;
-         }
-         S32 stepY = curY;
-         while(stepY < (S32)bmp->getHeight())
-         {
-            bmp->getColor(startX, stepY, color);
-            if(color == sepColor)
-               break;
-            stepY++;
-         }
-         mBitmapArrayRects.push_back(RectI(startX, curY, curX - startX, stepY - curY));
-      }
-      // ok, now skip to the next separation color on column 0
-      while(curY < (S32)bmp->getHeight())
-      {
-         bmp->getColor(0, curY, color);
-         if(color == sepColor)
-            break;
-         curY++;
-      }
+	  // skip any sep colors
+	  bmp->getColor( 0, curY, color);
+	  if(color == sepColor)
+	  {
+		 curY++;
+		 continue;
+	  }
+	  // ok, process left to right, grabbing bitmaps as we go...
+	  S32 curX = 0;
+	  while(curX < (S32)bmp->getWidth())
+	  {
+		 bmp->getColor(curX, curY, color);
+		 if(color == sepColor)
+		 {
+			curX++;
+			continue;
+		 }
+		 S32 startX = curX;
+		 while(curX < (S32)bmp->getWidth())
+		 {
+			bmp->getColor(curX, curY, color);
+			if(color == sepColor)
+			   break;
+			curX++;
+		 }
+		 S32 stepY = curY;
+		 while(stepY < (S32)bmp->getHeight())
+		 {
+			bmp->getColor(startX, stepY, color);
+			if(color == sepColor)
+			   break;
+			stepY++;
+		 }
+		 mBitmapArrayRects.push_back(RectI(startX, curY, curX - startX, stepY - curY));
+	  }
+	  // ok, now skip to the next separation color on column 0
+	  while(curY < (S32)bmp->getHeight())
+	  {
+		 bmp->getColor(0, curY, color);
+		 if(color == sepColor)
+			break;
+		 curY++;
+	  }
    }
    return mBitmapArrayRects.size();
 }
 
 void GuiControlProfile::incRefCount()
 {
-   if(!mRefCount++)
-   {
-      sFontCacheDirectory = Con::getVariable("$GUI::fontCacheDirectory");
-
-      //verify the font
-      mFont = GFont::create(mFontType, mFontSize, sFontCacheDirectory);
-      if (mFont.isNull())
-         Con::errorf("Failed to load/create profile font (%s/%d)", mFontType, mFontSize);
-       
-      if ( mBitmapName != NULL && mBitmapName != StringTable->EmptyString )
-      {
-          mTextureHandle = TextureHandle(mBitmapName, TextureHandle::BitmapKeepTexture);
-          if (!(bool)mTextureHandle)
-             Con::errorf("Failed to load profile bitmap (%s)",mBitmapName);
-      }
-   }
+	if(!mRefCount++)
+	{
+		sFontCacheDirectory = Con::getVariable("$GUI::fontCacheDirectory");
+
+		//verify the font
+		mFont = GFont::create(mFontType, mFontSize, sFontCacheDirectory);
+		if (mFont.isNull())
+			Con::errorf("Failed to load/create profile font (%s/%d)", mFontType, mFontSize);
+
+		//Set the bitmap
+		if ( mBitmapName != NULL && mBitmapName != StringTable->EmptyString )
+		{
+			mTextureHandle = TextureHandle(mBitmapName, TextureHandle::BitmapKeepTexture);
+			if (!(bool)mTextureHandle)
+				Con::errorf("Failed to load profile bitmap (%s)",mBitmapName);
+		}
+
+		//set the image asset
+		if (mImageAssetID != NULL && mImageAssetID != StringTable->EmptyString)
+		{
+			mImageAsset = mImageAssetID;
+		}
+	}
 }
 
 void GuiControlProfile::decRefCount()
 {
    AssertFatal(mRefCount, "GuiControlProfile::decRefCount: zero ref count");
    if(!mRefCount)
-      return;
+	  return;
 
    if(!--mRefCount)
    {
-      mFont = NULL;
-      mTextureHandle = NULL;
+	  mFont = NULL;
+	  mTextureHandle = NULL;
+	  mImageAsset.clear();
    }
 }
 
+void GuiControlProfile::setImageAsset(const char* pImageAssetID)
+{
+	// Sanity!
+	AssertFatal(pImageAssetID != NULL, "Cannot use a NULL asset ID.");
+
+	// Fetch the asset ID
+	mImageAsset = StringTable->insert(pImageAssetID);
+
+	// Assign asset if this profile is being used.
+	if (mRefCount != 0)
+		mImageAsset = pImageAssetID;
+}
+
 const ColorI& GuiControlProfile::getFillColor(const GuiControlState state)
 {
 	switch (state)
 	{
 	default:
 	case NormalState:
+	case NormalStateOn:
 		return mFillColor;
 		break;
 	case HighlightState:
+	case HighlightStateOn:
 		return mFillColorHL;
 		break;
 	case SelectedState:
+	case SelectedStateOn:
 		return mFillColorSL;
 		break;
 	case DisabledState:
+	case DisabledStateOn:
 		return mFillColorNA;
 		break;
 	}
@@ -459,15 +488,19 @@ const ColorI& GuiControlProfile::getFontColor(const GuiControlState state)
 	{
 	default:
 	case NormalState:
+	case NormalStateOn:
 		return mFontColor;
 		break;
 	case HighlightState:
+	case HighlightStateOn:
 		return mFontColorHL;
 		break;
 	case SelectedState:
+	case SelectedStateOn:
 		return mFontColorSL;
 		break;
 	case DisabledState:
+	case DisabledStateOn:
 		return mFontColorNA;
 		break;
 	}
@@ -479,20 +512,20 @@ ConsoleSetType( TypeGuiProfile )
 {
    GuiControlProfile *profile = NULL;
    if(argc == 1)
-      Sim::findObject(argv[0], profile);
+	  Sim::findObject(argv[0], profile);
 
    AssertWarn(profile != NULL, avar("GuiControlProfile: requested gui profile (%s) does not exist.", argv[0]));
    if(!profile)
-      profile = dynamic_cast<GuiControlProfile*>(Sim::findObject("GuiDefaultProfile"));
+	  profile = dynamic_cast<GuiControlProfile*>(Sim::findObject("GuiDefaultProfile"));
 
    AssertFatal(profile != NULL, avar("GuiControlProfile: unable to find specified profile (%s) and GuiDefaultProfile does not exist!", argv[0]));
 
    GuiControlProfile **obj = (GuiControlProfile **)dptr;
    if((*obj) == profile)
-      return;
+	  return;
 
    if(*obj)
-      (*obj)->decRefCount();
+	  (*obj)->decRefCount();
 
    *obj = profile;
    (*obj)->incRefCount();

+ 24 - 5
engine/source/gui/guiTypes.h

@@ -55,6 +55,10 @@
 #include "audio/AudioAsset.h"
 #endif
 
+#ifndef _IMAGE_ASSET_H_
+#include "2d/assets/ImageAsset.h"
+#endif
+
 #include "graphics/gFont.h"
 
 class GBitmap;
@@ -78,6 +82,10 @@ enum GuiControlState
 	HighlightState,				//Control is highlighted
 	SelectedState,				//Control has been selected
 	DisabledState,				//Control cannot be used
+	NormalStateOn,				//Used by controls like checkboxes to denote the normal state while checked
+	HighlightStateOn,			//The highlight state while on
+	SelectedStateOn,			//The selected state while on
+	DisabledStateOn,			//The disabled state while on
 	StateCount					//Not an actual state! Should always be at the end of the list.
 };
 
@@ -120,13 +128,14 @@ class GuiBorderProfile : public SimObject
 {
 private:
 	typedef SimObject Parent;
+	inline U8 getStateIndex(const GuiControlState state) { return state >= 4 ? state - 4 : state; }
 
 public:
-	S32 mMargin[static_cast<S32>(StateCount)];					//The distance between the edge and the start of the border. Margin is outside of the control.
-	S32 mBorder[static_cast<S32>(StateCount)];					//Width of the border.
-	ColorI mBorderColor[static_cast<S32>(StateCount)];			//The color of the border.
-	S32 mPadding[static_cast<S32>(StateCount)];					//The distance between the border and content of the control.
-	bool mUnderfill;											//True if the control's fill color should appear under the border.
+	S32 mMargin[static_cast<S32>(4)];					//The distance between the edge and the start of the border. Margin is outside of the control.
+	S32 mBorder[static_cast<S32>(4)];					//Width of the border.
+	ColorI mBorderColor[static_cast<S32>(4)];			//The color of the border.
+	S32 mPadding[static_cast<S32>(4)];					//The distance between the border and content of the control.
+	bool mUnderfill;									//True if the control's fill color should appear under the border.
 public:
 	DECLARE_CONOBJECT(GuiBorderProfile);
 	GuiBorderProfile();
@@ -218,6 +227,16 @@ public:
 
    Point2I mTextOffset;                            ///< Text offset for the control
 
+   // imageAsset members
+   StringTableEntry mImageAssetID;
+   AssetPtr<ImageAsset> mImageAsset;
+   void setImageAsset( const char* pImageAssetID );
+   inline StringTableEntry getImageAsset( void ) const { return mImageAssetID; }
+protected:
+	static bool setImageAsset(void* obj, const char* data) { static_cast<GuiControlProfile*>(obj)->setImageAsset(data); return false; }
+	static const char* getImageAsset(void* obj, const char* data) { return static_cast<GuiControlProfile*>(obj)->getImageAsset(); }
+
+public:
    // bitmap members
    StringTableEntry mBitmapName;                   ///< Bitmap file name for the bitmap of the control
    TextureHandle mTextureHandle;                   ///< Texture handle for the control

+ 5 - 1
toybox/AppCore/1/scripts/defaultPreferences.cs

@@ -32,7 +32,7 @@ $pref::iOS::UseMusic            = 0;
 $pref::iOS::UseMoviePlayer      = 0;
 $pref::iOS::UseAutoRotate       = 1;
 $pref::iOS::EnableOrientationRotation = 1;
-$pref::iOS::EnableOtherOrientationRotation = 1;   
+$pref::iOS::EnableOtherOrientationRotation = 1;
 $pref::iOS::StatusBarType       = 0;
 
 /// Audio
@@ -69,3 +69,7 @@ $pref::OpenGL::gammaCorrection = 0.5;
 
 /// Fonts.
 $Gui::fontCacheDirectory = expandPath( "^AppCore/fonts" );
+
+// Gui
+$pref::Gui::noClampTorqueCursorToWindow = 1;
+$pref::Gui::hideCursorWhenTouchEventDetected = 1;

+ 13 - 13
toybox/DeathBallToy/1/main.cs

@@ -79,7 +79,7 @@ function DeathBallToy::reset(%this)
 
     // Limit the camera to the four sections of the desert
     SandboxWindow.setViewLimitOn( DeathBallToy.WorldLeft, DeathBallToy.WorldBottom, DeathBallToy.WorldRight, DeathBallToy.WorldTop );
-    
+
     // Add backgrounds
     %this.createDesertBackgrounds();
 
@@ -196,12 +196,12 @@ function DeathBallToy::spawnDeathball(%this, %position)
         maxSpeed = "15";
         CollisionCallback = true;
     };
-    
+
     %db.createCircleCollisionShape(8);
     %dealsDamageBehavior = DealsDamageBehavior.createInstance();
     %dealsDamageBehavior.initialize(100, false);
     Deathball.addBehavior(%dealsDamageBehavior);
-    
+
     //%db.pauseAnimation(1);
 
     Deathball.rollSchedule = Deathball.schedule(100, "updateRollAnimation");
@@ -217,7 +217,7 @@ function Deathball::updateRollAnimation(%this)
 {
     %this.rollSchedule = "";
 
-    %velocity = %this.getLinearVelocity();    
+    %velocity = %this.getLinearVelocity();
     %scaledVelocity = VectorLen(%velocity); // (mAbs(getWord(%velocity, 0))) + mAbs(getWord(%velocity, 1)) / 50;
     %flooredVelocity = mFloatLength(%scaledVelocity, 1);
 
@@ -242,10 +242,10 @@ function DeathBallToy::generateSoldierTemplate(%this)
     };
 
     %soldier.createPolygonBoxCollisionShape(5, 8);
-    
+
     // Return it to the toy
     %this.soldierTemplate = %soldier;
-    
+
     SandboxScene.add(%this.soldierTemplate);
 
     // Disable it
@@ -254,15 +254,15 @@ function DeathBallToy::generateSoldierTemplate(%this)
     // Add the behaviors
     %takesDamageBehavior = TakesDamageBehavior.createInstance();
     %takesDamageBehavior.initialize(1, "", "", "DeathBallToy:soldierDeathAnim", false);
-    
+
     %moveTowardBehavior = MoveTowardBehavior.createInstance();
-    
+
     %adjustedSpeed = DeathBallToy.soldierSpeed / DeathBallToy.maxSoldierSpeed;
     %moveTowardBehavior.initialize(Deathball, %adjustedSpeed);
-    
+
     %faceObjectBehavior = FaceObjectBehavior.createInstance();
     %faceObjectBehavior.initialize(Deathball, 0, 0);
-    
+
     %soldier.addBehavior(%takesDamageBehavior);
     %soldier.addBehavior(%moveTowardBehavior);
     %soldier.addBehavior(%faceObjectBehavior);
@@ -469,17 +469,17 @@ function DeathBallToy::onTouchUp(%this, %touchID, %worldPosition)
 {
     %origin = Deathball.getPosition();
     %angle = mAtan( Vector2Sub( %worldPosition, %origin ) );
-    
+
     // Since the speed is used instead of time, we can use the current velocity to set it's speed.
     %adjustedSpeed = VectorLen(DeathBall.getLinearVelocity());// (DeathBallToy.ballSpeed / DeathBallToy.maxBallSpeed) * 3000;
-   
+
     Deathball.MoveTo( %worldPosition, %adjustedSpeed, true, false );
 }
 
 //-----------------------------------------------------------------------------
 
 function DeathBallToy::onTouchDragged(%this, %touchID, %worldPosition)
-{    
+{
     %origin = Deathball.getPosition();
     %angle = mAtan( Vector2Sub( %worldPosition, %origin ) ) - 90;
 

+ 5 - 4
toybox/DeathBallToy/1/scripts/faceObjectBehavior.cs

@@ -40,10 +40,11 @@ function FaceObjectBehavior::updateFace(%this)
 {
     if (!isObject(%this.target) || !%this.owner.active)
         return;
-   
+
     %origin = %this.owner.getPosition();
     %angle = mAtan( Vector2Sub( %this.target.getPosition(), %origin ) );
-    
+	%angle -= 90;
+
     if ( %this.turnSpeed > 0.0 )
     {
         %this.owner.rotateTo(%angle, %this.turnSpeed);
@@ -52,7 +53,7 @@ function FaceObjectBehavior::updateFace(%this)
     {
         %this.owner.setAngle(%angle);
     }
-    
-      
+
+
     %this.schedule(200, updateFace);
 }

+ 0 - 3
toybox/Sandbox/1/assets/gui/ReplayBtn128x128Down.asset.taml

@@ -1,3 +0,0 @@
-<ImageAsset
-    AssetName="ReplayBtn128x128DownImage"
-    ImageFile="ReplayBtn128x128Down.png" />

BIN
toybox/Sandbox/1/assets/gui/ReplayBtn128x128Down.png


+ 0 - 3
toybox/Sandbox/1/assets/gui/ReplayBtn128x128Hover.asset.taml

@@ -1,3 +0,0 @@
-<ImageAsset
-    AssetName="ReplayBtn128x128HoverImage"
-    ImageFile="ReplayBtn128x128Hover.png" />

BIN
toybox/Sandbox/1/assets/gui/ReplayBtn128x128Hover.png


+ 0 - 3
toybox/Sandbox/1/assets/gui/ReplayBtn128x128Inactive.asset.taml

@@ -1,3 +0,0 @@
-<ImageAsset
-    AssetName="ReplayBtn128x128InactiveImage"
-    ImageFile="ReplayBtn128x128Inactive.png" />

BIN
toybox/Sandbox/1/assets/gui/ReplayBtn128x128Inactive.png


+ 0 - 3
toybox/Sandbox/1/assets/gui/ReplayBtn128x128Up.asset.taml

@@ -1,3 +0,0 @@
-<ImageAsset
-    AssetName="ReplayBtn128x128UpImage"
-    ImageFile="ReplayBtn128x128Up.png" />

BIN
toybox/Sandbox/1/assets/gui/ReplayBtn128x128Up.png


+ 0 - 3
toybox/Sandbox/1/assets/gui/mediumCancelDown.asset.taml

@@ -1,3 +0,0 @@
-<ImageAsset
-    AssetName="mediumCancelDown"
-    ImageFile="mediumCancelDown.png" />

BIN
toybox/Sandbox/1/assets/gui/mediumCancelDown.png


+ 0 - 3
toybox/Sandbox/1/assets/gui/mediumCancelHover.asset.taml

@@ -1,3 +0,0 @@
-<ImageAsset
-    AssetName="mediumCancelHover"
-    ImageFile="mediumCancelHover.png" />

BIN
toybox/Sandbox/1/assets/gui/mediumCancelHover.png


+ 0 - 3
toybox/Sandbox/1/assets/gui/mediumCancelInactive.asset.taml

@@ -1,3 +0,0 @@
-<ImageAsset
-    AssetName="mediumCancelInactive"
-    ImageFile="mediumCancelInactive" />

BIN
toybox/Sandbox/1/assets/gui/mediumCancelInactive.png


+ 0 - 3
toybox/Sandbox/1/assets/gui/mediumCancelNormal.asset.taml

@@ -1,3 +0,0 @@
-<ImageAsset
-    AssetName="mediumCancelNormal"
-    ImageFile="mediumCancelNormal" />

BIN
toybox/Sandbox/1/assets/gui/mediumCancelNormal.png


+ 7 - 0
toybox/Sandbox/1/assets/gui/minusButton.asset.taml

@@ -0,0 +1,7 @@
+<ImageAsset
+    AssetName="minusButton"
+    ImageFile="minusButton"
+	CellCountX="1"
+	CellCountY="4"
+	CellWidth="22"
+	CellHeight="25" />

BIN
toybox/Sandbox/1/assets/gui/minusButton.png


+ 0 - 3
toybox/Sandbox/1/assets/gui/minusButtonDown.asset.taml

@@ -1,3 +0,0 @@
-<ImageAsset
-    AssetName="minusButtonDown"
-    ImageFile="minusButtonDown.png" />

BIN
toybox/Sandbox/1/assets/gui/minusButtonDown.png


+ 0 - 3
toybox/Sandbox/1/assets/gui/minusButtonHover.asset.taml

@@ -1,3 +0,0 @@
-<ImageAsset
-    AssetName="minusButtonHover"
-    ImageFile="minusButtonHover.png" />

BIN
toybox/Sandbox/1/assets/gui/minusButtonHover.png


+ 0 - 3
toybox/Sandbox/1/assets/gui/minusButtonInactive.asset.taml

@@ -1,3 +0,0 @@
-<ImageAsset
-    AssetName="minusButtonInactive"
-    ImageFile="minusButtonInactive.png" />

BIN
toybox/Sandbox/1/assets/gui/minusButtonInactive.png


+ 0 - 3
toybox/Sandbox/1/assets/gui/minusButtonNormal.asset.taml

@@ -1,3 +0,0 @@
-<ImageAsset
-    AssetName="minusButtonNormal"
-    ImageFile="minusButtonNormal.png" />

BIN
toybox/Sandbox/1/assets/gui/minusButtonNormal.png


+ 7 - 0
toybox/Sandbox/1/assets/gui/northArrow.asset.taml

@@ -0,0 +1,7 @@
+<ImageAsset
+    AssetName="northArrow"
+    ImageFile="northArrow"
+	CellCountX="1"
+	CellCountY="3"
+	CellWidth="69"
+	CellHeight="23" />

BIN
toybox/Sandbox/1/assets/gui/northArrow.png


+ 0 - 3
toybox/Sandbox/1/assets/gui/northArrowDown.asset.taml

@@ -1,3 +0,0 @@
-<ImageAsset
-    AssetName="northArrowDown"
-    ImageFile="northArrowDown.png" />

BIN
toybox/Sandbox/1/assets/gui/northArrowDown.png


+ 0 - 3
toybox/Sandbox/1/assets/gui/northArrowHover.asset.taml

@@ -1,3 +0,0 @@
-<ImageAsset
-    AssetName="northArrowHover"
-    ImageFile="northArrowHover.png" />

BIN
toybox/Sandbox/1/assets/gui/northArrowHover.png


+ 0 - 3
toybox/Sandbox/1/assets/gui/northArrowNormal.asset.taml

@@ -1,3 +0,0 @@
-<ImageAsset
-    AssetName="northArrowNormal"
-    ImageFile="northArrowNormal" />

BIN
toybox/Sandbox/1/assets/gui/northArrowNormal.png


+ 7 - 0
toybox/Sandbox/1/assets/gui/plusButton.asset.taml

@@ -0,0 +1,7 @@
+<ImageAsset
+    AssetName="plusButton"
+    ImageFile="plusButton"
+	CellCountX="1"
+	CellCountY="4"
+	CellWidth="22"
+	CellHeight="25" />

BIN
toybox/Sandbox/1/assets/gui/plusButton.png


+ 0 - 3
toybox/Sandbox/1/assets/gui/plusButtonDown.asset.taml

@@ -1,3 +0,0 @@
-<ImageAsset
-    AssetName="plusButtonDown"
-    ImageFile="plusButtonDown.png" />

BIN
toybox/Sandbox/1/assets/gui/plusButtonDown.png


+ 0 - 3
toybox/Sandbox/1/assets/gui/plusButtonHover.asset.taml

@@ -1,3 +0,0 @@
-<ImageAsset
-    AssetName="plusButtonHover"
-    ImageFile="plusButtonHover.png" />

BIN
toybox/Sandbox/1/assets/gui/plusButtonHover.png


+ 0 - 3
toybox/Sandbox/1/assets/gui/plusButtonInactive.asset.taml

@@ -1,3 +0,0 @@
-<ImageAsset
-    AssetName="plusButtonInactive"
-    ImageFile="plusButtonInactive.png" />

BIN
toybox/Sandbox/1/assets/gui/plusButtonInactive.png


+ 0 - 3
toybox/Sandbox/1/assets/gui/plusButtonNormal.asset.taml

@@ -1,3 +0,0 @@
-<ImageAsset
-    AssetName="plusButtonNormal"
-    ImageFile="plusButtonNormal.png" />

BIN
toybox/Sandbox/1/assets/gui/plusButtonNormal.png


+ 7 - 0
toybox/Sandbox/1/assets/gui/southArrow.asset.taml

@@ -0,0 +1,7 @@
+<ImageAsset
+    AssetName="southArrow"
+    ImageFile="southArrow"
+	CellCountX="1"
+	CellCountY="3"
+	CellWidth="69"
+	CellHeight="23" />

BIN
toybox/Sandbox/1/assets/gui/southArrow.png


+ 0 - 3
toybox/Sandbox/1/assets/gui/southArrowDown.asset.taml

@@ -1,3 +0,0 @@
-<ImageAsset
-    AssetName="southArrowDown"
-    ImageFile="southArrowDown.png" />

BIN
toybox/Sandbox/1/assets/gui/southArrowDown.png


+ 0 - 3
toybox/Sandbox/1/assets/gui/southArrowHover.asset.taml

@@ -1,3 +0,0 @@
-<ImageAsset
-    AssetName="southArrowHover"
-    ImageFile="southArrowHover.png" />

برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است