Browse Source

Changes to the guiConsole

This was mostly theme support for the console.
Peter Robinson 5 years ago
parent
commit
4aff030270

+ 1 - 2
editor/EditorConsole/EditorConsole.cs

@@ -59,7 +59,6 @@ function EditorConsole::create(%this)
 
 	%this.scroller = new GuiScrollCtrl()
 	{
-		Name="ConsoleScrollCtrl";
 		Profile=EditorCore.themes.scrollProfile;
 		ThumbProfile = EditorCore.themes.thumbProfile;
 		TrackProfile = EditorCore.themes.trackProfile;
@@ -78,7 +77,7 @@ function EditorConsole::create(%this)
 
 	%this.consoleLog = new GuiConsole()
 	{
-		Profile="GuiConsoleProfile";
+		Profile=EditorCore.themes.consoleProfile;
 		Position="0 0";
 		Extent="1024 738";
 		HorizSizing="width";

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

@@ -8,6 +8,7 @@ function BaseTheme::onAdd(%this)
 	%this.makeTabProfile();
 	%this.makeTextEditProfile();
 	%this.makeScrollProfile();
+	%this.makeConsoleProfile();
 }
 
 function BaseTheme::init(%this)
@@ -555,22 +556,30 @@ function BaseTheme::makeScrollProfile(%this)
 	%mainBorder = new GuiBorderProfile()
 	{
 		margin = 5;
-		padding = 20;
+		padding = 5;
 		border = 3;
 		borderColor = %this.color5;
 	};
 	%this.scrollProfile = new GuiControlProfile()
 	{
 			opaque = true;
-	    fillColor = %this.setAlpha(%this.color3, 100);
-			fillColorHL = %this.color3;
-			fillColorSL = %this.color4;
-			fillColorNA = %this.setAlpha(%this.color4, 80);
+	    fillColor = %this.setAlpha(%this.color2, 180);
 
 			borderDefault = %mainBorder;
 	};
 }
 
+function BaseTheme::makeConsoleProfile(%this)
+{
+	%this.consoleProfile = new GuiControlProfile()
+	{
+		fontType = %this.font;
+		fontColor = %this.color4; //Normal text
+		fontColorHL = %this.setAlpha(%this.color4, 140); //Warnings
+		fontColorNA = "255 0 0 255"; //Errors
+	};
+}
+
 function BaseTheme::adjustValue(%this, %color, %percent)
 {
 	%red = getWord(%color, 0);

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

@@ -79,4 +79,5 @@ function ThemeManager::activateTheme(%this, %theme)
 	%this.thumbProfile = %theme.thumbProfile;
 	%this.trackProfile = %theme.trackProfile;
 	%this.scrollArrowProfile = %theme.scrollArrowProfile;
+	%this.consoleProfile = %theme.consoleProfile;
 }

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

@@ -100,13 +100,13 @@ void GuiConsole::onPreRender()
       //resize the control
       resize(mBounds.point, Point2I(mCellSize.x, mCellSize.y * size));
 
-      //if the console was not scrolled, make the last entry visible
+      //if the console was scrolled to the bottom then make sure any new row is also visible
       if (scrolled)
          scrollCellVisible(Point2I(0,mSize.y - 1));
    }
 }
 
-void GuiConsole::onRenderCell(Point2I offset, Point2I cell, bool /*selected*/, bool /*mouseOver*/)
+void GuiConsole::onRenderCell(Point2I offset, Point2I cell, bool selected, bool mouseOver)
 {
    U32 size;
    ConsoleLogEntry *log;