Browse Source

Toy Box Repair

This checkin mostly repairs the toybox. Many of the recent changes to the Gui broke various controls the toybox was using to the point that it couldn't be used at all. This mostly fixes it with the exception of the drop down boxes.
Peter Robinson 4 years ago
parent
commit
4fd5c67333

+ 28 - 1
editor/AssetAdmin/AssetAdmin.cs

@@ -46,6 +46,17 @@ function AssetAdmin::create(%this)
 
 	%this.guiPage.add(%this.scroller);
 
+	%this.dictionaryContainer = new GuiChainCtrl()
+	{
+		HorizSizing="bottom";
+		VertSizing="right";
+		Position="0 0";
+		Extent="310 768";
+		MinExtent="220 200";
+	};
+	ThemeManager.setProfile(%this.dictionaryContainer, "emptyProfile");
+	%this.scroller.add(%this.dictionaryContainer);
+
 	%this.Dictionary["ImageAsset"] = new GuiPanelCtrl()
 	{
 		Class = AssetDictionary;
@@ -60,7 +71,23 @@ function AssetAdmin::create(%this)
 	};
 	%this.Dictionary["ImageAsset"].setExpandEase("EaseOutBounce", 1500);
 	ThemeManager.setProfile(%this.Dictionary["ImageAsset"], "panelProfile");
-	%this.scroller.add(%this.Dictionary["ImageAsset"]);
+	%this.dictionaryContainer.add(%this.Dictionary["ImageAsset"]);
+
+	%this.Dictionary["AnimationAsset"] = new GuiPanelCtrl()
+	{
+		Class = AssetDictionary;
+		Text="Animation Assets";
+		command="";
+		HorizSizing="bottom";
+		VertSizing="right";
+		Position="0 0";
+		Extent="310 22";
+		MinExtent="80 22";
+		Type = "AnimationAsset";
+	};
+	%this.Dictionary["AnimationAsset"].setExpandEase("EaseOutBounce", 1500);
+	ThemeManager.setProfile(%this.Dictionary["AnimationAsset"], "panelProfile");
+	%this.dictionaryContainer.add(%this.Dictionary["AnimationAsset"]);
 
 	EditorCore.FinishRegistration(%this.guiPage);
 }

+ 8 - 1
editor/AssetAdmin/AssetDictionary.cs

@@ -74,7 +74,14 @@ function AssetDictionary::load(%this)
 			};
 			ThemeManager.setProfile(%texture, "spriteProfile");
 			%button.add(%texture);
-			%texture.setImage(%assetID);
+			if(%this.Type $= "ImageAsset")
+			{
+				%texture.setImage(%assetID);
+			}
+			else if(%this.Type $= "AnimationAsset")
+			{
+				%texture.setAnimation(%assetID);
+			}
 		}
 	}
 	%query.delete();

+ 25 - 14
editor/EditorCore/Themes/BaseTheme.cs

@@ -68,7 +68,7 @@ function BaseTheme::makeTipProfile(%this)
 
 	%this.tipProfile = new GuiControlProfile()
 	{
-		fillColor = %this.setAlpha(%this.color3, 100);
+		fillColor = %this.setAlpha(%this.color3, 220);
 
 		fontType = %this.font;
 		fontSize = %this.fontSize;
@@ -94,7 +94,7 @@ function BaseTheme::makeGeneralProfiles(%this)
 	{
 		padding = 0;
 		border = %this.borderSize;
-		borderColor = "0 0 0 60";
+		borderColor = %this.color5;
 	};
 	//A simple, well-rounded profile for text or containers
 	%this.simpleProfile = new GuiControlProfile()
@@ -107,7 +107,27 @@ function BaseTheme::makeGeneralProfiles(%this)
 		align = center;
 		vAlign = middle;
 
-		borderDefault = %standardBorder;
+		borderDefault = %simpleBorder;
+	};
+
+	%simpleBorder2 = new GuiBorderProfile()
+	{
+		padding = 10;
+		border = %this.borderSize;
+		borderColor = %this.color5;
+	};
+	//A simple, well-rounded profile for text or containers
+	%this.simpleProfile2 = new GuiControlProfile()
+	{
+		fillColor = %this.color1;
+
+		fontType = %this.font;
+		fontSize = %this.fontSize + 2;
+		fontColor = %this.color4;
+		align = center;
+		vAlign = middle;
+
+		borderDefault = %simpleBorder2;
 	};
 
 	%this.spriteProfile = new GuiControlProfile()
@@ -675,10 +695,9 @@ function BaseTheme::makeScrollProfile(%this)
 	};
 	%this.scrollProfile = new GuiControlProfile()
 	{
-			opaque = true;
 	    fillColor = %this.setAlpha(%this.color2, 180);
 
-			borderDefault = %mainBorder;
+		borderDefault = %mainBorder;
 	};
 }
 
@@ -701,15 +720,7 @@ function BaseTheme::adjustValue(%this, %color, %percent)
 	%blue = getWord(%color, 2);
 	%alpha = getWord(%color, 3);
 
-	%largest = %red;
-	if(%green > %largest)
-	{
-		%largest = %green;
-	}
-	if(%blue > %largest)
-	{
-		%largest = %blue;
-	}
+	%largest = mGetMax(%red, mGetMax(%blue, %green));
 	%currentValue = %largest / 255;
 	%fullRed = %red / %currentValue;
 	%fullGreen = %green / %currentValue;

+ 2 - 2
editor/EditorCore/Themes/TorqueSuitTheme.cs

@@ -19,8 +19,8 @@ function TorqueSuitTheme::init(%this)
 		%this.fontSize = 18;
 	}
 
-	%this.color1 = "48 0 34 255";
-	%this.color2 = "128 25 70 255";
+	%this.color1 = "34 19 30 255";
+	%this.color2 = "62 32 52 255";
 	%this.color3 = "166 38 70 255";
 	%this.color4 = "246 75 72 255";
 	%this.color5 = "33 191 132 255";

+ 7 - 7
engine/source/2d/gui/SceneWindow.cc

@@ -1144,7 +1144,7 @@ void SceneWindow::sendObjectInputEvent( StringTableEntry name, const GuiEvent& e
 
 //-----------------------------------------------------------------------------
 
-void SceneWindow::onMouseEnter( const GuiEvent& event )
+void SceneWindow::onTouchEnter( const GuiEvent& event )
 {
     // Dispatch input event.
     dispatchInputEvent(mouseEventEnterName, event);
@@ -1152,7 +1152,7 @@ void SceneWindow::onMouseEnter( const GuiEvent& event )
 
 //-----------------------------------------------------------------------------
 
-void SceneWindow::onMouseLeave( const GuiEvent& event )
+void SceneWindow::onTouchLeave( const GuiEvent& event )
 {
     // Dispatch input event.
     dispatchInputEvent(mouseEventLeaveName, event);
@@ -1160,7 +1160,7 @@ void SceneWindow::onMouseLeave( const GuiEvent& event )
 
 //-----------------------------------------------------------------------------
 
-void SceneWindow::onMouseDown( const GuiEvent& event )
+void SceneWindow::onTouchDown( const GuiEvent& event )
 {
     // Lock Mouse (if necessary).
     if(mLockMouse)
@@ -1172,7 +1172,7 @@ void SceneWindow::onMouseDown( const GuiEvent& event )
 
 //-----------------------------------------------------------------------------
 
-void SceneWindow::onMouseUp( const GuiEvent& event )
+void SceneWindow::onTouchUp( const GuiEvent& event )
 {
     // Lock Mouse (if necessary).
     if(mLockMouse)
@@ -1184,7 +1184,7 @@ void SceneWindow::onMouseUp( const GuiEvent& event )
 
 //-----------------------------------------------------------------------------
 
-void SceneWindow::onMouseMove( const GuiEvent& event )
+void SceneWindow::onTouchMove( const GuiEvent& event )
 {
     // Dispatch input event.
     dispatchInputEvent(inputEventMovedName, event);
@@ -1192,7 +1192,7 @@ void SceneWindow::onMouseMove( const GuiEvent& event )
 
 //-----------------------------------------------------------------------------
 
-void SceneWindow::onMouseDragged( const GuiEvent& event )
+void SceneWindow::onTouchDragged( const GuiEvent& event )
 {
     // Dispatch input event.
     dispatchInputEvent(inputEventDraggedName, event);
@@ -1784,7 +1784,7 @@ void SceneWindow::renderMetricsOverlay( Point2I offset, const RectI& updateRect
     // Calculate Debug Banner Offset.
     Point2I bannerOffset = updateRect.point + Point2I(8,8);
 
-    static GLfloat sWindowVertices[] = {
+    GLfloat sWindowVertices[] = {
         (GLfloat)updateRect.point.x, (GLfloat)updateRect.point.y,
         (GLfloat)updateRect.point.x + updateRect.extent.x, (GLfloat)updateRect.point.y,
         (GLfloat)updateRect.point.x, (GLfloat)updateRect.point.y + bannerHeight + 16,

+ 6 - 6
engine/source/2d/gui/SceneWindow.h

@@ -300,13 +300,13 @@ public:
     virtual void resize(const Point2I &newPosition, const Point2I &newExtent);
     virtual void onRender( Point2I offset, const RectI& updateRect );
 
-    virtual void onMouseEnter( const GuiEvent& event );
-    virtual void onMouseLeave( const GuiEvent& event );
+    virtual void onTouchEnter( const GuiEvent& event );
+    virtual void onTouchLeave( const GuiEvent& event );
 
-    virtual void onMouseDown( const GuiEvent& event );
-    virtual void onMouseUp( const GuiEvent& event );
-    virtual void onMouseMove( const GuiEvent& event );
-    virtual void onMouseDragged( const GuiEvent& event );
+    virtual void onTouchDown( const GuiEvent& event );
+    virtual void onTouchUp( const GuiEvent& event );
+    virtual void onTouchMove( const GuiEvent& event );
+    virtual void onTouchDragged( const GuiEvent& event );
 
     virtual void onMiddleMouseDown(const GuiEvent &event);
     virtual void onMiddleMouseUp(const GuiEvent &event);

+ 1 - 1
engine/source/gui/buttons/guiCheckBoxCtrl_ScriptBinding.h

@@ -31,7 +31,7 @@ ConsoleMethodWithDocs(GuiCheckBoxCtrl, setStateOn, ConsoleVoid, 3, 3, (isStateOn
 }
 
 /*! Gets the current state of the control.
-	@return Returns true if on and false if off.
+	@return Returns True if on and false if off.
 */
 ConsoleMethodWithDocs(GuiCheckBoxCtrl, getStateOn, ConsoleBool, 2, 2, ())
 {

+ 11 - 6
engine/source/gui/containers/guiScrollCtrl.cc

@@ -885,6 +885,11 @@ GuiControlState GuiScrollCtrl::getRegionCurrentState(GuiScrollCtrl::Region regio
 
 void GuiScrollCtrl::renderBorderedRectWithArrow(RectI& bounds, GuiControlProfile* profile, GuiControlState state, GuiDirection direction)
 {
+	if (!profile)
+	{
+		return;
+	}
+
 	renderBorderedRect(bounds, profile, state);
 
 	RectI ctrlRect = applyMargins(bounds.point, bounds.extent, state, profile);
@@ -924,11 +929,11 @@ void GuiScrollCtrl::renderBorderedRectWithArrow(RectI& bounds, GuiControlProfile
 
 void GuiScrollCtrl::renderVScrollBar(const Point2I& offset)
 {
-	if(mHasVScrollBar)
+	if(mHasVScrollBar && mTrackProfile && mThumbProfile)
 	{ 
 		if(mVBarEnabled)
 		{
-			if (mShowArrowButtons)
+			if (mShowArrowButtons && mArrowProfile)
 			{
 				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);
@@ -943,7 +948,7 @@ void GuiScrollCtrl::renderVScrollBar(const Point2I& offset)
 		}
 		else
 		{
-			if (mShowArrowButtons)
+			if (mShowArrowButtons && mArrowProfile)
 			{
 				renderBorderedRectWithArrow(RectI(mUpArrowRect.point + offset, mUpArrowRect.extent), mArrowProfile, GuiControlState::DisabledState, GuiDirection::Up);
 				renderBorderedRectWithArrow(RectI(mDownArrowRect.point + offset, mDownArrowRect.extent), mArrowProfile, GuiControlState::DisabledState, GuiDirection::Down);
@@ -955,11 +960,11 @@ void GuiScrollCtrl::renderVScrollBar(const Point2I& offset)
 
 void GuiScrollCtrl::renderHScrollBar(const Point2I& offset)
 {
-	if(mHasHScrollBar)
+	if(mHasHScrollBar && mTrackProfile && mThumbProfile)
 	{
 		if (mHBarEnabled)
 		{
-			if (mShowArrowButtons)
+			if (mShowArrowButtons && mArrowProfile)
 			{
 				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);
@@ -974,7 +979,7 @@ void GuiScrollCtrl::renderHScrollBar(const Point2I& offset)
 		}
 		else
 		{
-			if (mShowArrowButtons)
+			if (mShowArrowButtons && mArrowProfile)
 			{
 				renderBorderedRectWithArrow(RectI(mLeftArrowRect.point + offset, mLeftArrowRect.extent), mArrowProfile, GuiControlState::DisabledState, GuiDirection::Left);
 				renderBorderedRectWithArrow(RectI(mRightArrowRect.point + offset, mRightArrowRect.extent), mArrowProfile, GuiControlState::DisabledState, GuiDirection::Right);

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

@@ -192,7 +192,7 @@ void GuiControl::initPersistFields()
    endGroup("Localization");
 
    addGroup("Text");
-   addField("text", TypeCaseString, Offset(mText, GuiControl));
+   addProtectedField("text", TypeCaseString, Offset(mText, GuiControl), setTextProperty, getTextProperty, "");
    addField("textID", TypeString, Offset(mTextID, GuiControl));
    endGroup("Text");
 }

+ 8 - 9
engine/source/gui/guiControl.h

@@ -188,11 +188,6 @@ public:
 		tRotateRight
 	};
 
-	ColorI mFillColor; //Replaces the default fill color provided by the profile.
-	ColorI mFillColorHL; //The highlight fill color used when the cursor enters the control.
-	ColorI mFillColorSL; //Color used when the control is selected.
-	ColorI mFillColorNA; //Used if the object is not active or disabled.
-
 protected:
     /// @name Control State
     /// @{
@@ -308,10 +303,14 @@ public:
     const S32        getWidth() { return mBounds.extent.x; } ///< Returns the width of the control
     const S32        getHeight() { return mBounds.extent.y; } ///< Returns the height of the control
 	
-	void             setText(const char *text);
-	void             setTextID(S32 id);
-	void             setTextID(const char *id);
-	const char*      getText();
+	virtual void             setText(const char *text);
+	virtual void             setTextID(S32 id);
+	virtual void             setTextID(const char *id);
+	virtual const char*      getText();
+
+	// Text Property Accessors
+	static bool setTextProperty(void* obj, const char* data) { static_cast<GuiControl*>(obj)->setText(data); return true; }
+	static const char* getTextProperty(void* obj, const char* data) { return static_cast<GuiControl*>(obj)->getText(); }
 
     /// @}
 

+ 10 - 2
engine/source/gui/guiDefaultControlRender.cc

@@ -28,12 +28,20 @@
 
 void renderBorderedRect(RectI &bounds, GuiControlProfile *profile, GuiControlState state)
 {
-	ColorI fillColor = profile->getFillColor(state);
-	renderBorderedRect(bounds, profile, state, fillColor);
+	if(profile)
+	{
+		ColorI fillColor = profile->getFillColor(state);
+		renderBorderedRect(bounds, profile, state, fillColor);
+	}
 }
 
 void renderBorderedRect(RectI &bounds, GuiControlProfile *profile, GuiControlState state, const ColorI &fillColor)
 {
+	if (!profile)
+	{
+		return;
+	}
+
 	//Get the border profiles
 	GuiBorderProfile *leftProfile = profile->getLeftBorder();
 	GuiBorderProfile *rightProfile = profile->getRightBorder();

+ 91 - 95
toybox/Sandbox/1/gui/ToolboxDialog.gui.taml

@@ -35,14 +35,14 @@
 		Profile="GuiDefaultProfile"
 		HorizSizing="relative"
 		VertSizing="relative"
-		Position="805 585"
-		Extent="320 160">
+		Position="761 600"
+		Extent="320 132">
 
 		<!-- Background Color -->
-		<GuiTextCtrl
+		<GuiControl
 			canSaveDynamicFields="0"
 			isContainer="0"
-			Profile="GuiTextProfile"
+			Profile="GuiLabelProfile"
 			HorizSizing="relative"
 			VertSizing="relative"
 			Position="0 4"
@@ -64,7 +64,7 @@
 			Profile="GuiPopUpMenuProfile"
 			HorizSizing="relative"
 			VertSizing="relative"
-			Position="0 24"
+			Position="0 22"
 			Extent="180 25"
 			MinExtent="8 2"
 			canSave="1"
@@ -81,14 +81,14 @@
 			bitmapBounds="16 16" />
 
 		<!-- Resolution -->
-		<GuiTextCtrl
+		<GuiControl
 			Name="ResolutionSelectLabel"
 			canSaveDynamicFields="0"
 			isContainer="0"
-			Profile="GuiTextProfile"
+			Profile="GuiLabelProfile"
 			HorizSizing="relative"
 			VertSizing="relative"
-			Position="0 64"
+			Position="0 60"
 			Extent="128 15"
 			MinExtent="8 2"
 			canSave="1"
@@ -107,7 +107,7 @@
 			Profile="GuiPopUpMenuProfile"
 			HorizSizing="relative"
 			VertSizing="relative"
-			Position="0 84"
+			Position="0 78"
 			Extent="180 25"
 			MinExtent="8 2"
 			canSave="1"
@@ -124,27 +124,25 @@
 			bitmapBounds="16 16" />
 
 		<!-- Fullscreen Option -->
-		<GuiButtonCtrl
+		<GuiCheckBoxCtrl
 			Name="FullscreenOptionButton"
 			canSaveDynamicFields="0"
 			isContainer="0"
-			Profile="BlueButtonProfile"
+			Profile="GuiCheckBoxProfile"
 			HorizSizing="relative"
 			VertSizing="relative"
-			Position="0 110"
-			Extent="180 24"
+			Position="0 102"
+			Extent="180 30"
 			MinExtent="8 2"
 			canSave="1"
 			Visible="0"
 			Active="1"
 			hovertime="1000"
-			groupNum="-1"
-			buttonType="ToggleButton"
 			useMouseEvents="1"
 			Text="Fullscreen"
 			tooltipprofile="GuiToolTipProfile"
 			ToolTip="Whether the window is full-screen or not."
-			Command="setFullscreenOption(FullscreenOptionButton.getValue());"/>
+			Command="setFullscreenOption(FullscreenOptionButton.getStateOn());"/>
 
 	</GuiControl>
 
@@ -153,7 +151,10 @@
 		Name="CustomControlsScroller"
 		canSaveDynamicFields="1"
 		isContainer="1"
-		Profile="GuiLightScrollProfile"
+		Profile="GuiTransparentScrollProfile"
+		ThumbProfile = "GuiScrollThumbProfile"
+		TrackProfile = "GuiScrollTrackProfile"
+		ArrowProfile = "GuiScrollArrowProfile"
 		HorizSizing="relative"
 		VertSizing="relative"
 		Position="365 30"
@@ -162,19 +163,19 @@
 		canSave="1"
 		Visible="1"
 		Active="1"
-		hovertime="1000"
 		willFirstRespond="1"
 		hScrollBar="alwaysOff"
 		vScrollBar="dynamic"
 		constantThumbHeight="0"
-		childMargin="2 3" >
+		showArrowButtons="1"
+		scrollBarThickness="14" >
 		<GuiControl
 			Name="ToyCustomControls"
 			Profile="GuiSunkenContainerProfile"
 			HorizSizing="relative"
 			VertSizing="relative"
-			Position="3 3"
-			Extent="295 705" />
+			Position="0 0"
+			Extent="301 705" />
 	</GuiScrollCtrl>
 
 	<!-- Toy Selection Panel -->
@@ -186,10 +187,10 @@
 		Extent="300 900">
 
 		<!-- Toy Category -->
-		<GuiTextCtrl
+		<GuiControl
 			canSaveDynamicFields="0"
 			isContainer="0"
-			Profile="GuiTextProfile"
+			Profile="GuiLabelProfile"
 			HorizSizing="relative"
 			VertSizing="relative"
 			Position="0 0"
@@ -225,7 +226,7 @@
             command="ToyCategorySelectList.previousCategory();"
             canSaveDynamicFields="0"
             isContainer="0"
-            Profile="GuiDefaultProfile"
+            Profile="GuiSpriteProfile"
             HorizSizing="relative"
             VertSizing="relative"
             Position="0 18"
@@ -247,7 +248,7 @@
             command="ToyCategorySelectList.nextCategory();"
             canSaveDynamicFields="0"
             isContainer="0"
-            Profile="GuiDefaultProfile"
+            Profile="GuiSpriteProfile"
             HorizSizing="relative"
             VertSizing="relative"
             Position="192 18"
@@ -270,7 +271,7 @@
 			canSaveDynamicFields="0"
 			command="ToyListScroller.scrollToPrevious();"
 			isContainer="0"
-			Profile="GuiDefaultProfile"
+			Profile="GuiSpriteProfile"
 			HorizSizing="relative"
 			VertSizing="relative"
 			Position="70 65"
@@ -291,7 +292,7 @@
 			command="ToyListScroller.scrollToNext();"
 			canSaveDynamicFields="0"
 			isContainer="0"
-			Profile="GuiDefaultProfile"
+			Profile="GuiSpriteProfile"
 			HorizSizing="relative"
 			VertSizing="relative"
 			Position="70 700"
@@ -317,8 +318,8 @@
             HorizSizing="relative"
             VertSizing="relative"
             Position="0 95"
-            Extent="215 600"
-            MinExtent="8 2"
+            Extent="280 600"
+            MinExtent="280 600"
             canSave="1"
             Visible="1"
             Active="1"
@@ -328,21 +329,25 @@
 				Name="ToyListScroller"
 				canSaveDynamicFields="1"
 				isContainer="1"
-				Profile="GuiLightScrollProfile"
+				Profile="GuiTransparentScrollProfile"
+				ThumbProfile = "GuiScrollThumbProfile"
+				TrackProfile = "GuiScrollTrackProfile"
+				ArrowProfile = "GuiScrollArrowProfile"
 				HorizSizing="relative"
 				VertSizing="relative"
 				Position="0 5"
-				Extent="215 575"
-				MinExtent="215 575"
+				Extent="258 575"
+				MinExtent="258 575"
 				canSave="1"
 				Visible="1"
 				Active="1"
 				hovertime="1000"
 				willFirstRespond="1"
 				hScrollBar="alwaysOff"
-				vScrollBar="dynamic"
+				vScrollBar="alwaysOn"
 				constantThumbHeight="0"
-				childMargin="2 3" >
+				showArrowButtons="0"
+				scrollBarThickness="14" >
 
 				<GuiGridCtrl
 					Name="ToyListArray"
@@ -352,18 +357,18 @@
 					Profile="GuiTransparentProfile"
 					HorizSizing="relative"
 					VertSizing="relative"
-					Position="25 1"
-					Extent="190 300"
-					MinExtent="1 2"
+					Position="0 1"
+					Extent="230 300"
+					MinExtent="230 50"
 					canSave="1"
 					Visible="1"
 					Active="1"
 					tooltipprofile="GuiToolTipProfile"
 					hovertime="1000"
 					MaxColCount="1"
-					CellSizeX="180"
+					CellSizeX="188"
 					CellSizeY="50"
-					CellSpacingX="8"
+					CellSpacingX="0"
 					CellSpacingY="8"
 					CellModeX="Variable" />
 			</GuiScrollCtrl>
@@ -372,30 +377,27 @@
 
 	<!-- Options Panel -->
 	<GuiControl
-		Profile="GuiDefaultProfile"
+		Profile="GuiSunkenContainerProfile"
 		HorizSizing="relative"
 		VertSizing="relative"
-		Position="805 22"
-		Extent="240 550">
+		Position="750 30"
+		Extent="240 566"
+		minExtent="240 566">
 
-		<GuiTextCtrl
-            canSaveDynamicFields="0"
-            isContainer="0"
-            Profile="GuiTextProfile"
+		<GuiControl
+            Profile="GuiLabelProfile"
             HorizSizing="relative"
             VertSizing="relative"
             Position="0 0"
-            Extent="120 15"
-            MinExtent="8 2"
+            Extent="240 20"
+            MinExtent="24 2"
             canSave="1"
             Visible="1"
             Active="0"
             hovertime="1000"
             toolTipProfile="GuiToolTipProfile"
             toolTip="Toggles debug rendering modes."
-            text="Debug Options:"
-            maxLength="255"
-            truncate="0" />
+            text="Debug Options:" />
 
 		<!-- Metrics Option -->
         <GuiCheckBoxCtrl
@@ -403,22 +405,19 @@
             Command="setMetricsOption(MetricsOptionCheckBox.getStateOn());"
             canSaveDynamicFields="0"
             isContainer="0"
-            Profile="BlueButtonProfile"
+            Profile="GuiCheckBoxProfile"
             HorizSizing="relative"
             VertSizing="relative"
             Position="0 20"
-            Extent="180 35"
+            Extent="180 30"
             MinExtent="8 2"
             canSave="1"
             Visible="1"
             Active="1"
             tooltipprofile="GuiToolTipProfile"
-            ToolTip="Whether to show the metrics overlay or not."
+            ToolTip="Displays the complete debug metrics for a scene."
             hovertime="100"
-            text="Full Metrics"
-            groupNum="-1"
-            buttonType="ToggleButton"
-            useMouseEvents="0" />
+            text="Full Metrics" />
 
 		<!-- FPS Metrics Option -->
 		<GuiCheckBoxCtrl
@@ -426,22 +425,19 @@
             Command="setFPSMetricsOption(FpsMetricsOptionCheckBox.getStateOn());"
             canSaveDynamicFields="0"
             isContainer="0"
-            Profile="BlueButtonProfile"
+            Profile="GuiCheckBoxProfile"
             HorizSizing="relative"
             VertSizing="relative"
             Position="0 65"
-            Extent="180 35"
+            Extent="180 30"
             MinExtent="8 2"
             canSave="1"
             Visible="1"
             Active="1"
             tooltipprofile="GuiToolTipProfile"
-            ToolTip="Whether to show the FPS metrics overlay or not."
+            ToolTip="Displays the current frames per second if Full Metrics is off."
             hovertime="100"
-            text="FPS Metric Only"
-            groupNum="-1"
-            buttonType="ToggleButton"
-            useMouseEvents="0" />
+            text="FPS Metric"/>
 
 		<!-- Controllers Option -->
 		<GuiCheckBoxCtrl
@@ -449,17 +445,17 @@
             Command="setControllersOption(ControllersOptionCheckBox.getStateOn());"
             canSaveDynamicFields="0"
             isContainer="0"
-            Profile="BlueButtonProfile"
+            Profile="GuiCheckBoxProfile"
             HorizSizing="relative"
             VertSizing="relative"
             Position="0 110"
-            Extent="180 35"
+            Extent="180 30"
             MinExtent="8 2"
             canSave="1"
             Visible="1"
             Active="1"
             tooltipprofile="GuiToolTipProfile"
-            ToolTip="Whether to show the controllers overlay or not."
+            ToolTip="Displays a controller overlay if available."
             hovertime="100"
             text="Controllers"
             groupNum="-1"
@@ -472,17 +468,17 @@
             Command="setJointsOption(JointsOptionCheckBox.getStateOn());"
             canSaveDynamicFields="0"
             isContainer="0"
-            Profile="BlueButtonProfile"
+            Profile="GuiCheckBoxProfile"
             HorizSizing="relative"
             VertSizing="relative"
             Position="0 155"
-            Extent="180 35"
+            Extent="180 30"
             MinExtent="8 2"
             canSave="1"
             Visible="1"
             Active="1"
             tooltipprofile="GuiToolTipProfile"
-            ToolTip="Whether to show the joints overlay or not."
+            ToolTip="Displays an overlay of the joints currently in the scene."
             hovertime="100"
             text="Joints"
             groupNum="-1"
@@ -495,17 +491,17 @@
             Command="setWireframeOption(WireframeOptionCheckBox.getValue());"
             canSaveDynamicFields="0"
             isContainer="0"
-            Profile="BlueButtonProfile"
+            Profile="GuiCheckBoxProfile"
             HorizSizing="relative"
             VertSizing="relative"
             Position="0 200"
-            Extent="180 35"
+            Extent="180 30"
             MinExtent="8 2"
             canSave="1"
             Visible="1"
             Active="1"
             tooltipprofile="GuiToolTipProfile"
-            ToolTip="Whether to render using wireframe or not."
+            ToolTip="Renders all objects as wireframes."
             hovertime="100"
             text="Wireframe"
             groupNum="-1"
@@ -517,18 +513,18 @@
             Name="AABBOptionCheckBox"
             canSaveDynamicFields="0"
             isContainer="0"
-            Profile="BlueButtonProfile"
+            Profile="GuiCheckBoxProfile"
             HorizSizing="relative"
             VertSizing="relative"
             Position="0 245"
-            Extent="180 35"
+            Extent="180 30"
             MinExtent="8 2"
             canSave="1"
             Visible="1"
             Command="setAABBOption(AABBOptionCheckBox.getStateOn());"
             Active="1"
             tooltipprofile="GuiToolTipProfile"
-            ToolTip="Whether to show the AABB overlay or not."
+            ToolTip="Displays Axis-Aligned Bounding Boxes - Boxes that will not rotate as the objects rotate."
             tooltipWidth="250"
             hovertime="1000"
             text="AABBs"
@@ -542,18 +538,18 @@
             Name="OOBBOptionCheckBox"
             canSaveDynamicFields="0"
             isContainer="0"
-            Profile="BlueButtonProfile"
+            Profile="GuiCheckBoxProfile"
             HorizSizing="relative"
             VertSizing="relative"
             Position="0 290"
-            Extent="180 35"
+            Extent="180 30"
             MinExtent="8 2"
             canSave="1"
             Visible="1"
             Command="setOOBBOption(OOBBOptionCheckBox.getStateOn());"
             Active="1"
             tooltipprofile="GuiToolTipProfile"
-            ToolTip="Whether to show the OOBB overlay or not."
+            ToolTip="Displays Object-Orientated Bounding Boxes - boxes that that rotate as the objects rotate."
             tooltipWidth="250"
             hovertime="1000"
             text="OOBBs"
@@ -567,18 +563,18 @@
             Name="SleepOptionCheckBox"
             canSaveDynamicFields="0"
             isContainer="0"
-            Profile="BlueButtonProfile"
+            Profile="GuiCheckBoxProfile"
             HorizSizing="relative"
             VertSizing="relative"
             Position="0 335"
-            Extent="180 35"
+            Extent="180 30"
             MinExtent="8 2"
             canSave="1"
             Visible="1"
             Command="setSleepOption(SleepOptionCheckBox.getStateOn());"
             Active="1"
             tooltipprofile="GuiToolTipProfile"
-            ToolTip="Whether to show the sleeping overlay or not."
+            ToolTip="Displays sleeping overlay."
             tooltipWidth="250"
             hovertime="1000"
             text="Sleeping"
@@ -592,18 +588,18 @@
             Name="CollisionOptionCheckBox"
             canSaveDynamicFields="0"
             isContainer="0"
-            Profile="BlueButtonProfile"
+            Profile="GuiCheckBoxProfile"
             HorizSizing="relative"
             VertSizing="relative"
             Position="0 380"
-            Extent="180 35"
+            Extent="180 30"
             MinExtent="8 2"
             canSave="1"
             Visible="1"
             Command="setCollisionOption(CollisionOptionCheckBox.getStateOn());"
             Active="1"
             tooltipprofile="GuiToolTipProfile"
-            ToolTip="Whether to show the collision-shape overlay or not."
+            ToolTip="Renders all collision-shapes for the scene."
             tooltipWidth="250"
             hovertime="1000"
             text="Collision Shapes"
@@ -617,18 +613,18 @@
             Name="PositionOptionCheckBox"
             canSaveDynamicFields="0"
             isContainer="0"
-            Profile="BlueButtonProfile"
+            Profile="GuiCheckBoxProfile"
             HorizSizing="relative"
             VertSizing="relative"
             Position="0 425"
-            Extent="180 35"
+            Extent="180 30"
             MinExtent="8 2"
             canSave="1"
             Visible="1"
             Command="setPositionOption(PositionOptionCheckBox.getStateOn());"
             Active="1"
             tooltipprofile="GuiToolTipProfile"
-            ToolTip="Whether to show the position and center-of-mass overlay or not."
+            ToolTip="Displays the position and center-of-mass overlays."
             tooltipWidth="250"
             hovertime="1000"
             text="Positions"
@@ -642,18 +638,18 @@
             Name="SortOptionCheckBox"
             canSaveDynamicFields="0"
             isContainer="0"
-            Profile="BlueButtonProfile"
+            Profile="GuiCheckBoxProfile"
             HorizSizing="relative"
             VertSizing="relative"
             Position="0 470"
-            Extent="180 35"
+            Extent="180 30"
             MinExtent="8 2"
             canSave="1"
             Visible="1"
             Command="setSortOption(SortOptionCheckBox.getStateOn());"
             Active="1"
             tooltipprofile="GuiToolTipProfile"
-            ToolTip="Whether to show the sort-point overlay or not."
+            ToolTip="Shows the sort-point overlay. Sort points can affect the order that sprites are rendered within a layer."
             tooltipWidth="250"
             hovertime="1000"
             text="Sort Points"
@@ -667,18 +663,18 @@
             Name="BatchOptionCheckBox"
             canSaveDynamicFields="0"
             isContainer="0"
-            Profile="BlueButtonProfile"
+            Profile="GuiCheckBoxProfile"
             HorizSizing="relative"
             VertSizing="relative"
             Position="0 515"
-            Extent="180 35"
+            Extent="180 30"
             MinExtent="8 2"
             canSave="1"
             Visible="1"
             Command="SandboxScene.setBatchingEnabled(!SandboxScene.getBatchingEnabled());"
             Active="1"
             tooltipprofile="GuiToolTipProfile"
-            ToolTip="Whether to use scene render batching or not."
+            ToolTip="Turns on render batching. The batcher will attempt to draw multiple sprites with a single draw command. This typically takes planning."
             tooltipWidth="250"
             hovertime="1000"
             text="Batching"

+ 207 - 221
toybox/Sandbox/1/gui/guiProfiles.cs

@@ -33,6 +33,42 @@ else if ($platform $= "Android")
 else
 	$platformFontSize = 12;
 
+$color[1] = "43 43 43 255";
+$color[2] = "81 92 102 255";
+$color[3] = "224 224 224 255";
+$color[4] = "54 135 196 255";
+$color[5] = "245 210 50 255";
+
+function AdjustColorValue(%color, %percent)
+{
+	%red = getWord(%color, 0);
+	%green = getWord(%color, 1);
+	%blue = getWord(%color, 2);
+	%alpha = getWord(%color, 3);
+
+	%largest = mGetMax(%red, mGetMax(%blue, %green));
+	%currentValue = %largest / 255;
+	%fullRed = %red / %currentValue;
+	%fullGreen = %green / %currentValue;
+	%fullBlue = %blue / %currentValue;
+
+	%newValue = %currentValue += (%percent/100);
+	%newValue = mClamp(%newValue, 0, 100);
+	%newColor = mRound(mClamp((%fullRed * %newValue), 0, 255)) SPC
+		mRound(mClamp((%fullGreen * %newValue), 0, 255)) SPC
+		mRound(mClamp((%fullBlue * %newValue), 0, 255)) SPC %alpha;
+
+	return %newColor;
+}
+
+function SetColorAlpha(%color, %newAlpha)
+{
+	%red = getWord(%color, 0);
+	%green = getWord(%color, 1);
+	%blue = getWord(%color, 2);
+	return %red SPC %green SPC %blue SPC mRound(mClamp(%newAlpha, 0, 255));
+}
+
 //-----------------------------------------------------------------------------
 
 new GuiCursor(DefaultCursor)
@@ -42,139 +78,110 @@ new GuiCursor(DefaultCursor)
     bitmapName = "^Sandbox/gui/images/defaultCursor";
 };
 
-//---------------------------------------------------------------------------------------------
-// GuiDefaultProfile is a special profile that all other profiles inherit defaults from. It
-// must exist.
-//---------------------------------------------------------------------------------------------
-if(!isObject(GuiDefaultProfile)) new GuiControlProfile (GuiDefaultProfile)
+if (!isObject(GuiDefaultBorderProfile)) new GuiBorderProfile (GuiDefaultBorderProfile)
 {
-    tab = false;
-    canKeyFocus = false;
-    hasBitmapArray = false;
-    mouseOverSelected = false;
+	border = 0;
+    borderColor   = $color1;
+    borderColorHL = AdjustColorValue($color1, 10);
+    borderColorSL = AdjustColorValue($color1, 10);
+    borderColorNA = SetColorAlpha($color1, 100);
+};
 
-    // fill color
-    fillColor = "211 211 211 0";
-    fillColorHL = "244 244 244 0";
-    fillColorNA = "244 244 244 0";
+if (!isObject(GuiBrightBorderProfile)) new GuiBorderProfile (GuiBrightBorderProfile : GuiDefaultBorderProfile)
+{
+	border = 2;
+	borderHL = 2;
+	borderSL = 2;
+	borderNA = 2;
+
+	borderColor = "255 255 255 50";
+	borderColorHL = "255 255 255 50";
+	borderColorSL = "255 255 255 50";
+	borderColorNA = "255 255 255 50";
 
-    // border color
-    border = 0;
-    borderColor   = "100 100 100 255";
-    borderColorHL = "128 128 128 255";
-    borderColorNA = "64 64 64 255";
+	underfill = true;
+};
+
+if (!isObject(GuiDarkBorderProfile)) new GuiBorderProfile (GuiDarkBorderProfile : GuiBrightBorderProfile)
+{
+	borderColor = "0 0 0 50";
+	borderColorHL = "0 0 0 50";
+	borderColorSL = "0 0 0 50";
+	borderColorNA = "0 0 0 50";
+};
+
+if(!isObject(GuiDefaultProfile)) new GuiControlProfile (GuiDefaultProfile)
+{
+    // fill color
+    fillColor = "0 0 0 0";
 
     // font
     fontType = $platformFontType;
     fontSize = $platformFontSize;
-
-    fontColor = "0 0 0";
-    fontColorHL = "32 100 100";
-    fontColorNA = "0 0 0";
-    fontColorSEL= "10 10 10";
+    fontColor = "255 255 255 255";
+	align = center;
+	vAlign = middle;
 
     // bitmap information
-    bitmap = "^Sandbox/gui/images/window.png";
-    bitmapBase = "";
-    textOffset = "0 0";
-
-    // used by guiTextControl
-    modal = true;
-    align = "left";
-    autoSizeWidth = false;
-    autoSizeHeight = false;
-    returnTab = false;
-    numbersOnly = false;
-    cursorColor = "0 0 0 255";
+	cursorColor = "0 0 0 255";
 
-    // sounds
-    soundButtonDown = $ButtonSound.fileName;
-    soundButtonOver = "";
+	borderDefault = GuiDefaultBorderProfile;
 };
 
-// ----------------------------------------------------------------------------
+if(!isObject(GuiTransparentProfile)) new GuiControlProfile (GuiTransparentProfile : GuiDefaultProfile);
 
-if (!isObject(GuiTransparentProfile)) new GuiControlProfile (GuiTransparentProfile : GuiDefaultProfile)
+if(!isObject(GuiSpriteProfile)) new GuiControlProfile (GuiSpriteProfile : GuiDefaultProfile)
 {
-    opaque = false;
-    border = false;
+	FillColor = "255 255 255 255";
 };
 
 // ----------------------------------------------------------------------------
 
-if(!isObject(GuiSolidProfile)) new GuiControlProfile (GuiSolidProfile)
+if (!isObject(GuiSolidBorderProfile)) new GuiBorderProfile (GuiSolidBorderProfile : GuiDefaultBorderProfile)
 {
-   opaque = true;
-   border = true;
-};
+	border = 1;
 
-// ----------------------------------------------------------------------------
+	padding = 10;
+	paddingHL = 10;
+	paddingSL = 10;
+	paddingNA = 10;
+};
 
-if (!isObject(GuiToolTipProfile)) new GuiControlProfile (GuiToolTipProfile : GuiDefaultProfile)
+if(!isObject(GuiSolidProfile)) new GuiControlProfile (GuiSolidProfile : GuiDefaultProfile)
 {
-    fillColor = "246 220 165 255";
+	// fill color
+    fillColor = $color1;
+    fillColorHL = AdjustColorValue($color1, 10);
+    fillColorSL = AdjustColorValue($color1, 15);
+    fillColorNA = SetColorAlpha($color1, 100);
 
-    fontType = $platformFontType;
-    fontSize = $platformFontSize;
+	borderDefault = GuiSolidBorderProfile;
 };
 
 // ----------------------------------------------------------------------------
 
-if (!isObject(GuiPopupMenuItemBorder)) new GuiControlProfile (GuiPopupMenuItemBorder : GuiDefaultProfile)
+if (!isObject(GuiToolTipProfile)) new GuiControlProfile (GuiToolTipProfile : GuiSolidProfile)
 {
-    bitmap = "^Sandbox/gui/images/scroll";
-    hasBitmapArray = true;
+    fillColor = SetColorAlpha($color1, 220);
+	fontColor = $color5;
+
+	borderDefault = GuiBrightBorderProfile;
 };
 
 // ----------------------------------------------------------------------------
 
-if (!isObject(GuiPopUpMenuDefault)) new GuiControlProfile (GuiPopUpMenuDefault)
+if (!isObject(GuiPopUpMenuDefault)) new GuiControlProfile (GuiPopUpMenuDefault : GuiDefaultProfile)
 {
-    tab = false;
-    canKeyFocus = false;
-    hasBitmapArray = false;
-    mouseOverSelected = false;
-
     // fill color
-    opaque = false;
     fillColor = "255 255 255 192";
     fillColorHL = "255 0 0 192";
+    fillColorSL = "255 0 0 192";
     fillColorNA = "0 0 255 255";
 
-    // border color
-    border = 1;
-    borderColor    = "100 100 100 255";
-    borderColorHL = "0 128 0 255";
-    borderColorNA = "0 226 226 52";
-
-    // font
-    fontType = $platformFontType;
-    fontSize = $platformFontSize;
-
     fontColor = "27 59 95 255";
     fontColorHL = "232 240 248 255";
+    fontColorSL= "255 255 255 255";
     fontColorNA = "0 0 0 255";
-    fontColorSEL= "255 255 255 255";
-
-    // bitmap information
-    bitmap = "^Sandbox/gui/images/scroll";
-    hasBitmapArray = true;
-    bitmapBase = "";
-    textOffset = "0 0";
-
-    // used by guiTextControl
-    modal = true;
-    align = "left";
-    autoSizeWidth = false;
-    autoSizeHeight = false;
-    returnTab = false;
-    numbersOnly = false;
-    cursorColor = "0 0 0 255";
-
-    profileForChildren = GuiPopupMenuItemBorder;
-    // sounds
-    soundButtonDown = "";
-    soundButtonOver = "";
 };
 
 // ----------------------------------------------------------------------------
@@ -184,25 +191,15 @@ if (!isObject(GuiPopUpMenuProfile)) new GuiControlProfile (GuiPopUpMenuProfile :
     textOffset = "6 3";
     align = "center";
     bitmap = "^Sandbox/gui/images/dropDown";
-    hasBitmapArray = true;
-    border = -3;
     profileForChildren = GuiPopUpMenuDefault;
-    opaque = true;
 };
 
 //-----------------------------------------------------------------------------
 
-if (!isObject(GuiTextProfile)) new GuiControlProfile (GuiTextProfile)
+if (!isObject(GuiTextProfile)) new GuiControlProfile (GuiTextProfile : GuiDefaultProfile)
 {
-    border=false;
-
-    // font
-    fontType = $platformFontType;
-    fontSize = $platformFontSize;
-
-    fontColor = "white";
+    fontColor = $color3;
 
-    modal = true;
     align = "left";
     autoSizeWidth = false;
     autoSizeHeight = false;
@@ -213,53 +210,38 @@ if (!isObject(GuiTextProfile)) new GuiControlProfile (GuiTextProfile)
 
 //-----------------------------------------------------------------------------
 
-if (!isObject(GuiCheckBoxProfile)) new GuiControlProfile (GuiCheckBoxProfile)
+if (!isObject(GuiCheckBoxProfile)) new GuiControlProfile (GuiCheckBoxProfile : GuiDefaultProfile)
 {
-    opaque = false;
-    fontColor = "white";
-    fillColor = "232 232 232 255";
-    fontColorHL = "white";
-    border = false;
-    borderColor = "0 0 0 255";
-    fontType = $platformFontType;
-    fontSize = $platformFontSize;
-    fixedExtent = true;
-    align = "left";
-    bitmap = "^Sandbox/gui/images/checkBox";
-    hasBitmapArray = true;
-};
 
-//-----------------------------------------------------------------------------
+    fillColor = $color3;
+    fillColorHL = AdjustColorValue($color3, -10);
+    fillColorSL = $color4;
+    fillColorNA = SetColorAlpha($color3, 100);
 
-if(!isObject(GuiConsoleProfile)) new GuiControlProfile (GuiConsoleProfile)
-{
-    fontType = $platformFontType;
-    fontSize = $platformFontSize * 1.1;
-    fontColor = White;
-    fontColorHL = LightSlateGray;
-    fontColorNA = Red;
-    fontColors[6] = "100 100 100";
-    fontColors[7] = "100 100 0";
-    fontColors[8] = "0 0 100";
-    fontColors[9] = "0 100 0";
+    fontColor = $color3;
+	fontColorHL = $color4;
+	fontColorSL = $color5;
+	fontColorNA = SetColorAlpha($color3, 100);
+    align = "left";
+	tab = true;
+
+	borderDefault = "GuiBrightBorderProfile";
+	borderRight = "GuiDarkBorderProfile";
+	borderBottom = "GuiDarkBorderProfile";
 };
 
 //-----------------------------------------------------------------------------
 
-if (!isObject(GuiTextEditProfile)) new GuiControlProfile (GuiTextEditProfile)
+if (!isObject(GuiTextEditProfile)) new GuiControlProfile (GuiTextEditProfile : GuiDefaultProfile)
 {
-    fontSize = $platformFontSize;
-    opaque = false;
     fillColor = "232 240 248 255";
     fillColorHL = "251 170 0 255";
     fillColorNA = "127 127 127 52";
-    border = -2;
     bitmap = "^Sandbox/gui/images/textEdit.png";
-    borderColor = "40 40 40 10";
     fontColor = "27 59 95 255";
     fontColorHL = "232 240 248 255";
     fontColorNA = "0 0 0 52";
-    fontColorSEL = "0 0 0 255";
+    fontColorSL = "0 0 0 255";
     textOffset = "5 2";
     autoSizeWidth = false;
     autoSizeHeight = false;
@@ -277,57 +259,77 @@ if(!isObject(GuiNumberEditProfile)) new GuiControlProfile (GuiNumberEditProfile:
 
 //-----------------------------------------------------------------------------
 
-if(!isObject(GuiConsoleTextEditProfile)) new GuiControlProfile (GuiConsoleTextEditProfile : GuiTextEditProfile)
+if(!isObject(GuiScrollTrackProfile)) new GuiControlProfile (GuiScrollTrackProfile : GuiDefaultProfile)
 {
-    fontType = $platformFontType;
-    fontSize = $platformFontSize * 1.1;
+	fillColor = $color1;
+    fillColorHL = $color1;
+    fillColorSL = $color1;
+    fillColorNA = $color1;
 };
 
-//-----------------------------------------------------------------------------
+if (!isObject(GuiScrollBrightBorderProfile)) new GuiBorderProfile (GuiScrollBrightBorderProfile : GuiBrightBorderProfile)
+{
+	padding = 3;
+	paddingHL = 2;
+	paddingSL = 2;
+	paddingNA = 3;
+
+	border = 1;
+	borderHL = 2;
+	borderSL = 2;
+	borderNA = 1;
+};
 
-if(!isObject(GuiScrollProfile)) new GuiControlProfile (GuiScrollProfile)
+if (!isObject(GuiScrollDarkBorderProfile)) new GuiBorderProfile (GuiScrollDarkBorderProfile : GuiScrollBrightBorderProfile)
 {
-    opaque = true;
-    fillColor = "255 255 255";
-    border = 1;
-    borderThickness = 2;
-    bitmap = "^Sandbox/gui/images/scrollBar.png";
-    hasBitmapArray = true;
+	borderColor = "0 0 0 20";
+	borderColorHL = "0 0 0 20";
+	borderColorSL = "0 0 0 20";
+	borderColorNA = "0 0 0 20";
 };
 
-//-----------------------------------------------------------------------------
+if(!isObject(GuiScrollThumbProfile)) new GuiControlProfile (GuiScrollThumbProfile : GuiDefaultProfile)
+{
+	fillColor = $color3;
+    fillColorHL = AdjustColorValue($color3, 10);
+    fillColorSL = $color4;
+    fillColorNA = SetColorAlpha($color3, 100);
+
+	borderDefault = GuiScrollBrightBorderProfile;
+	borderRight = GuiScrollDarkBorderProfile;
+	borderBottom = GuiScrollDarkBorderProfile;
+};
+
+if(!isObject(GuiScrollArrowProfile)) new GuiControlProfile (GuiScrollArrowProfile : GuiScrollThumbProfile)
+{
+	fontColor = "0 0 0 100";
+    fontColorHL = "0 0 0 150";
+    fontColorSL = $color5;
+    fontColorNA = "0 0 0 50";
+
+	borderDefault = GuiScrollBrightBorderProfile;
+	borderRight = GuiScrollDarkBorderProfile;
+	borderBottom = GuiScrollDarkBorderProfile;
+};
 
-if(!isObject(GuiTransparentScrollProfile)) new GuiControlProfile (GuiTransparentScrollProfile)
+if(!isObject(GuiScrollProfile)) new GuiControlProfile (GuiScrollProfile)
 {
-   opaque = false;
-   fillColor = "255 255 255";
-   border = false;
-   borderThickness = 2;
-   borderColor = "0 0 0";
-   bitmap = "^Sandbox/gui/images/scrollBar.png";
-   hasBitmapArray = true;
+    fillColor = $color2;
+    borderDefault = GuiDefaultBorderProfile;
 };
 
 //-----------------------------------------------------------------------------
 
-if(!isObject(ConsoleScrollProfile)) new GuiControlProfile( ConsoleScrollProfile : GuiScrollProfile )
+if(!isObject(GuiTransparentScrollProfile)) new GuiControlProfile (GuiTransparentScrollProfile : GuiScrollProfile)
 {
-    opaque = true;
-    fillColor = "0 0 0 120";
-    border = 3;
-    borderThickness = 0;
-    borderColor = "0 0 0";
+   fillColor = "255 255 255 0";
 };
 
 //-----------------------------------------------------------------------------
 
 if(!isObject(GuiToolboxProfile)) new GuiControlProfile( GuiToolboxProfile : GuiScrollProfile )
 {
-    opaque = true;
     fillColor = "255 255 255 220";
-    border = 3;
-    borderThickness = 0;
-    borderColor = "0 0 0";
 };
 
 //-----------------------------------------------------------------------------
@@ -335,28 +337,19 @@ if(!isObject(GuiToolboxProfile)) new GuiControlProfile( GuiToolboxProfile : GuiS
 if(!isObject(SandboxWindowProfile)) new GuiControlProfile (SandboxWindowProfile : GuiDefaultProfile)
 {
     // fill color
-    opaque = false;
-    fillColor = "0 0 0 92";
+    fillColor = "0 0 0 100";
 
     // font
-    fontType = $platformFontType;
-    fontSize = $platformFontSize;
     fontColor = "255 255 255 255";
 	lockMouse = "0";
 };
 
 //-----------------------------------------------------------------------------
 
-if (!isObject(GuiButtonProfile)) new GuiControlProfile (GuiButtonProfile)
+if (!isObject(GuiButtonProfile)) new GuiControlProfile (GuiButtonProfile : GuiDefaultProfile)
 {
-    opaque = true;
-    border = -1;
-    fontColor = "white";
-    fontColorHL = "229 229 229 255";
-    fixedExtent = true;
-    align = "center";
-    canKeyFocus = false;
-    fontType = $platformFontType;
+    fontColor = "255 255 255 255";
+    fontColorHL = $color5;
     bitmap = "^Sandbox/gui/images/smallButtonContainer";
 };
 
@@ -364,10 +357,8 @@ if (!isObject(GuiButtonProfile)) new GuiControlProfile (GuiButtonProfile)
 
 if (!isObject(BlueButtonProfile)) new GuiControlProfile (BlueButtonProfile : GuiButtonProfile)
 {
-    fontSize = $platformFontSize;
-    fontColor = "255 255 255 255";
+    fontColor = "240 240 240 255";
     fontColorHL = "255 255 255 255";
-	align = "center";
     bitmap = "^Sandbox/gui/images/blueButton.png";
 };
 
@@ -375,8 +366,7 @@ if (!isObject(BlueButtonProfile)) new GuiControlProfile (BlueButtonProfile : Gui
 
 if (!isObject(RedButtonProfile)) new GuiControlProfile (RedButtonProfile : GuiButtonProfile)
 {
-    fontSize = $platformFontSize;
-    fontColor = "255 255 255 255";
+    fontColor = "240 240 240 255";
     fontColorHL = "255 255 255 255";
     bitmap = "^Sandbox/gui/images/redButton.png";
 };
@@ -385,8 +375,7 @@ if (!isObject(RedButtonProfile)) new GuiControlProfile (RedButtonProfile : GuiBu
 
 if (!isObject(GreenButtonProfile)) new GuiControlProfile (GreenButtonProfile : GuiButtonProfile)
 {
-    fontSize = $platformFontSize;
-    fontColor = "255 255 255 255";
+	fontColor = "240 240 240 255";
     fontColorHL = "255 255 255 255";
     bitmap = "^Sandbox/gui/images/greenButton.png";
 };
@@ -396,9 +385,7 @@ if (!isObject(GreenButtonProfile)) new GuiControlProfile (GreenButtonProfile : G
 if (!isObject(GuiRadioProfile)) new GuiControlProfile (GuiRadioProfile : GuiDefaultProfile)
 {
     fillColor = "232 232 232 255";
-    fixedExtent = true;
     bitmap = "^Sandbox/gui/images/radioButton.png";
-    hasBitmapArray = true;
 };
 
 //-----------------------------------------------------------------------------
@@ -422,26 +409,23 @@ if (!isObject(GuiSliderNoTextProfile)) new GuiControlProfile (GuiSliderNoTextPro
 
 //-----------------------------------------------------------------------------
 
-if (!isObject(GuiSpinnerProfile)) new GuiControlProfile (GuiSpinnerProfile)
+if (!isObject(GuiSpinnerProfile)) new GuiControlProfile (GuiSpinnerProfile : GuiDefaultProfile)
 {
-    fontType = $platformFontType;
-    fontSize = $platformFontSize;
-    opaque = false;
-    align = "center";
-    fillColor = "232 240 248 255";
-    fillColorHL = "251 170 0 255";
-    fillColorNA = "127 127 127 52";
+    fillColor = $color3;
+    fillColorHL = $color5;
+	fillColorSL = $color3;
+    fillColorNA = SetColorAlpha(%this.color3, 100);
     numbersOnly = true;
-    border = -2;
-    bitmap = "^Sandbox/gui/images/textEdit_noSides";
-    borderColor = "40 40 40 10";
-    fontColor = "27 59 95 255";
-    fontColorHL = "232 240 248 255";
-    fontColorNA = "0 0 0 52";
-    fontColorSEL = "0 0 0 255";
-    textOffset = "4 2";
-    autoSizeWidth = false;
-    autoSizeHeight = false;
+
+	fontSize = $platformFontSize + 2;
+    fontColor = $color1;
+    fontColorHL = $color4;
+	fontColorSL = $color1;
+    fontColorNA = SetColorAlpha($color1, 100);
+
+	borderTop = "GuiDarkBorderProfile";
+	borderBottom = "GuiBrightBorderProfile";
+
     tab = false;
     canKeyFocus = true;
     returnTab = true;
@@ -449,24 +433,26 @@ if (!isObject(GuiSpinnerProfile)) new GuiControlProfile (GuiSpinnerProfile)
 
 //-----------------------------------------------------------------------------
 
-if (!isObject(GuiLightScrollProfile)) new GuiControlProfile (GuiLightScrollProfile : GuiScrollProfile)
+if (!isObject(GuiSunkenContainerProfile)) new GuiControlProfile (GuiSunkenContainerProfile : GuiSolidProfile)
 {
-    opaque = false;
-    fillColor = "212 216 220";
-    border = 0;
-    bitmap = "^Sandbox/gui/images/scrollBar";
-    hasBitmapArray = true;
+    fillColor = SetColorAlpha($color1, 150);
 };
 
-//-----------------------------------------------------------------------------
+if (!isObject(GuiHeaderProfile)) new GuiControlProfile (GuiHeaderProfile : GuiSolidProfile)
+{
+    fillColor = $color2;
+	fontColor = $color3;
+	fontSize = $platformFontSize + 2;
+	align = "left";
+
+	borderDefault = "GuiBrightBorderProfile";
+	borderRight = "GuiDarkBorderProfile";
+	borderBottom = "GuiDarkBorderProfile";
+};
 
-if (!isObject(GuiSunkenContainerProfile)) new GuiControlProfile (GuiSunkenContainerProfile)
+if (!isObject(GuiLabelProfile)) new GuiControlProfile (GuiLabelProfile : GuiDefaultProfile)
 {
-    opaque = false;
-    fillColor = "232 240 248 255";
-    fillColorHL = "251 170 0 255";
-    fillColorNA = "127 127 127 52";
-    border = -2;
-    bitmap = "^Sandbox/gui/images/sunkenContainer";
-    borderColor = "40 40 40 10";
+	fontColor = "255 255 255 255";
+	fontSize = $platformFontSize;
+	align = "left";
 };

+ 14 - 14
toybox/Sandbox/1/scripts/customToolboxGui.cs

@@ -26,7 +26,7 @@ Sandbox.customLabelSpacing = "18";
 Sandbox.customOptionSpacing = "15";
 Sandbox.customContainerExtent = "250 3";
 Sandbox.containerXPosition = "20";
-Sandbox.flagOptionExtent = "240 35";
+Sandbox.flagOptionExtent = "240 30";
 Sandbox.buttonOptionExtent = "240 35";
 Sandbox.spinnerExtent = "22 25";
 Sandbox.intOptionExtent = "196 25";
@@ -54,13 +54,13 @@ function createCustomLabel(%text)
     %labelWidth = Sandbox.customLabelWidth + (%characterCount * 5);
     %labelExtent = %labelWidth SPC Sandbox.customLabelHeight;
 
-    %labelControl = new GuiTextCtrl()
+    %labelControl = new GuiControl()
     {
         text = %text;
         Extent = %labelExtent;
         HorizSizing = "relative";
         VertSizing = "relative";
-        Profile = "GuiTextProfile";
+        Profile = "GuiLabelProfile";
         canSaveDynamicFields = "0";
         isContainer = "0";
         Position = "3 0";
@@ -105,13 +105,13 @@ function addFlagOption( %label, %callback, %startingValue, %shouldReset, %toolti
         VertSizing = "relative";
     };
 
-    %button = new GuiButtonCtrl()
+    %button = new GuiCheckBoxCtrl()
     {
         canSaveDynamicFields = "0";
         HorizSizing = "relative";
         VertSizing = "relative";
         isContainer = "0";
-        Profile = "BlueButtonProfile";
+        Profile = "GuiCheckBoxProfile";
         Position = "0 0";
         Extent = Sandbox.flagOptionExtent;
         Visible = "1";
@@ -125,9 +125,6 @@ function addFlagOption( %label, %callback, %startingValue, %shouldReset, %toolti
         toolTipProfile = "GuiToolTipProfile";
         toolTip = %tooltipText;
         text = %label;
-        groupNum = "-1";
-        buttonType = "ToggleButton";
-        useMouseEvents = "0";
      };
 
     %button.setStateOn(%startingValue);
@@ -282,7 +279,7 @@ function addNumericOption( %label, %min, %max, %step, %callback, %startingValue,
         VertSizing = "relative";
         canSaveDynamicFields = "0";
         isContainer = "0";
-        Profile = "GuiDefaultProfile";
+        Profile = "GuiSpriteProfile";
         Position = %spinnerPosition;
         Extent = Sandbox.spinnerExtent;
         MinExtent = "8 2";
@@ -334,7 +331,7 @@ function addNumericOption( %label, %min, %max, %step, %callback, %startingValue,
         Step = %step;
         canSaveDynamicFields = "0";
         isContainer = "0";
-        Profile = "GuiDefaultProfile";
+        Profile = "GuiSpriteProfile";
         Position = %spinnerPosition;
         Extent = Sandbox.spinnerExtent;
         MinExtent = "8 2";
@@ -507,7 +504,10 @@ function addSelectionOption( %entries, %label, %maxDisplay, %callback, %shouldRe
         canSaveDynamicFields = "1";
         isContainer = "1";
         class = "CustomScrollControl";
-        Profile = "GuiLightScrollProfile";
+        Profile = "GuiScrollProfile";
+		ThumbProfile = "GuiScrollThumbProfile";
+		TrackProfile = "GuiScrollTrackProfile";
+		ArrowProfile = "GuiScrollArrowProfile";
         HorizSizing = "relative";
         VertSizing = "relative";
         Position = "3 3";
@@ -534,7 +534,7 @@ function addSelectionOption( %entries, %label, %maxDisplay, %callback, %shouldRe
         Profile = "GuiTransparentProfile";
         HorizSizing = "relative";
         VertSizing = "relative";
-        Position = "25 1";
+        Position = "0 1";
         Extent = %arrayListWidth SPC %arrayListHeight;
         MinExtent = "1 2";
         canSave = "1";
@@ -596,7 +596,7 @@ function addSelectionOption( %entries, %label, %maxDisplay, %callback, %shouldRe
     {
         canSaveDynamicFields = "0";
         isContainer = "0";
-        Profile = "GuiDefaultProfile";
+        Profile = "GuiSpriteProfile";
         HorizSizing = "relative";
         VertSizing = "relative";
         Position = %buttonX SPC %upButtonY;
@@ -622,7 +622,7 @@ function addSelectionOption( %entries, %label, %maxDisplay, %callback, %shouldRe
     {
         canSaveDynamicFields = "0";
         isContainer = "0";
-        Profile = "GuiDefaultProfile";
+        Profile = "GuiSpriteProfile";
         HorizSizing = "relative";
         VertSizing = "relative";
         Position = %buttonX SPC %downButtonY;

+ 22 - 24
toybox/VirtualKeyboard/1/main.cs

@@ -1,12 +1,12 @@
 function VirtualKeyboard::create(%this)
 {
    %this.resetState();
-   
+
 }
 
 function VirtualKeyboard::destroy(%this)
 {
-   
+
 }
 
 function VirtualKeyboard::resetState(%this)
@@ -20,22 +20,22 @@ function VirtualKeyboard::push(%this, %targetGui, %textBox, %showClose)
 {
    Sandbox.add( TamlRead("./gui/keyboardGui.taml") );
    %textBox.setText("");
-   
+
    %this.targetGui = %targetGui;
    %this.textBox = %textBox;
    Canvas.pushDialog(%targetGui);
    // resize to targetGui
    %targetExtent = %targetGui.Extent;
-   KeyboardGui.resize(0, 0, %targetExtent._0, %targetExtent._1); 
+   KeyboardGui.resize(0, 0, %targetExtent._0, %targetExtent._1);
    %this.targetGui.addGuiControl(KeyboardSet);
    %textBox.setFirstResponder();
-   
+
    if (%showClose)
       keyCloseBtn.setVisible(true);
    else
       keyCloseBtn.setVisible(false);
    %this.toLower();
-   
+
 }
 
 function VirtualKeyboard::Pop(%this)
@@ -55,11 +55,11 @@ function VirtualKeyboard::toLower(%this)
    toNumber_symbolBtn.visible = false;
    toLower_UpperLockBtn.visible = false;
    toUpperLockBtn.visible =false;
-   
+
    toUpperBtn.visible = true;
    toNumberBtn.visible = true;
    keyboardSet.Image = "VirtualKeyboard:keyboardAlphaLower";
-   
+
 }
 
 function VirtualKeyboard::toUpper(%this)
@@ -86,7 +86,7 @@ function VirtualKeyboard::toUpperLock(%this)
    toLower_NumberBtn.visible = false;
    toSymbolBtn.visible = false;
    toNumber_symbolBtn.visible = false;
-   
+
    toLower_UpperLockBtn.visible = true;
    toNumberBtn.visible = true;
    keyboardSet.Image = "VirtualKeyboard:keyboardAlpha";
@@ -101,7 +101,7 @@ function VirtualKeyboard::toNumber(%this)
    toNumber_symbolBtn.visible = false;
    toLower_UpperLockBtn.visible = false;
    toUpperLockBtn.visible =false;
-   
+
    toSymbolBtn.visible = true;
    toLower_NumberBtn.visible = true;
    keyboardSet.Image = "VirtualKeyboard:keyboardNumber";
@@ -116,10 +116,10 @@ function VirtualKeyboard::toSymbol(%this)
    toNumberBtn.visible = false;
    toLower_UpperLockBtn.visible = false;
    toUpperLockBtn.visible =false;
-   
+
    toNumber_symbolBtn.visible = true;
    toLower_NumberBtn.visible = true;
-   
+
    keyboardSet.Image = "VirtualKeyboard:keyboardSymbol";
 }
 
@@ -190,16 +190,17 @@ if(!isObject(GuiKeyboardProfile)) new GuiControlProfile (GuiKeyboardProfile)
     mouseOverSelected = false;
 
     // fill color
-    opaque = false;
-    fillColor = "211 211 211";
-    fillColorHL = "244 244 244";
-    fillColorNA = "244 244 244";
+    fillColor = "211 211 211 255";
+    fillColorHL = "244 244 244 255";
+    fillColorSL = "244 244 244 255";
+    fillColorNA = "244 244 244 255";
 
     // border color
     border = 0;
     borderColor   = "100 100 100 255";
-    borderColorHL = "128 128 128";
-    borderColorNA = "64 64 64";
+    borderColorHL = "128 128 128 255";
+    borderColorSL = "128 128 128 255";
+    borderColorNA = "64 64 64 255";
 
     // font
     fontType = $platformFontType;
@@ -207,14 +208,11 @@ if(!isObject(GuiKeyboardProfile)) new GuiControlProfile (GuiKeyboardProfile)
 
     fontColor = "0 0 0";
     fontColorHL = "32 100 100";
+    fontColorSL= "10 10 10";
     fontColorNA = "0 0 0";
-    fontColorSEL= "10 10 10";
 
     // used by guiTextControl
-    modal = true;
-    justify = "left";
-    autoSizeWidth = false;
-    autoSizeHeight = false;
+    align = "left";
     returnTab = false;
     numbersOnly = false;
     cursorColor = "0 0 0 255";
@@ -222,4 +220,4 @@ if(!isObject(GuiKeyboardProfile)) new GuiControlProfile (GuiKeyboardProfile)
     // sounds
     soundButtonDown = "VirtualKeyboard:keypress";
     //soundButtonOver = "Sandbox:mouseOver";
-};
+};