瀏覽代碼

Merge pull request #2090 from Areloch/ConsoleLogFilters

Adds some filtering options to the console log gui
Areloch 7 年之前
父節點
當前提交
ac67ed8e1a

+ 153 - 39
Engine/source/gui/controls/guiConsole.cpp

@@ -50,6 +50,12 @@ IMPLEMENT_CALLBACK( GuiConsole, onMessageSelected, void, ( ConsoleLogEntry::Leve
    "@param level Diagnostic level of the message.\n"
    "@param message Message text.\n" );
 
+IMPLEMENT_CALLBACK(GuiConsole, onNewMessage, void, (U32 errorCount, U32 warnCount, U32 normalCount), (errorCount, warnCount, normalCount),
+   "Called when a new message is logged.\n\n"
+   "@param errorCount The number of error messages logged.\n"
+   "@param warnCount The number of warning messages logged.\n"
+   "@param normalCount The number of normal messages logged.\n");
+
 
 //-----------------------------------------------------------------------------
 
@@ -58,6 +64,11 @@ GuiConsole::GuiConsole()
    setExtent(64, 64);
    mCellSize.set(1, 1);
    mSize.set(1, 0);
+
+   mDisplayErrors = true;
+   mDisplayWarnings = true;
+   mDisplayNormalMessages = true;
+   mFiltersDirty = true;
 }
 
 //-----------------------------------------------------------------------------
@@ -81,56 +92,98 @@ S32 GuiConsole::getMaxWidth(S32 startIndex, S32 endIndex)
    U32 size;
    ConsoleLogEntry *log;
 
-   Con::getLockLog(log, size);
-
-   if(startIndex < 0 || (U32)endIndex >= size || startIndex > endIndex)
+   if (startIndex < 0 || (U32)endIndex >= mFilteredLog.size() || startIndex > endIndex)
       return 0;
 
    S32 result = 0;
    for(S32 i = startIndex; i <= endIndex; i++)
-      result = getMax(result, (S32)(mFont->getStrWidth((const UTF8 *)log[i].mString)));
-   
-   Con::unlockLog();
+      result = getMax(result, (S32)(mFont->getStrWidth((const UTF8 *)mFilteredLog[i].mString)));
    
    return(result + 6);
 }
 
+void GuiConsole::refreshLogText()
+{
+   U32 size;
+   ConsoleLogEntry *log;
+
+   Con::getLockLog(log, size);
+
+   if (mFilteredLog.size() != size || mFiltersDirty)
+   {
+      mFilteredLog.clear();
+
+      U32 errorCount = 0;
+      U32 warnCount = 0;
+      U32 normalCount = 0;
+
+      //Filter the log if needed
+      for (U32 i = 0; i < size; ++i)
+      {
+         ConsoleLogEntry &entry = log[i];
+
+         if (entry.mLevel == ConsoleLogEntry::Error)
+         {
+            errorCount++;
+            if (mDisplayErrors)
+            {
+               mFilteredLog.push_back(entry);
+            }
+         }
+         else if (entry.mLevel == ConsoleLogEntry::Warning)
+         {
+            warnCount++;
+            if (mDisplayWarnings)
+            {
+               mFilteredLog.push_back(entry);
+            }
+         }
+         else if (entry.mLevel == ConsoleLogEntry::Normal)
+         {
+            normalCount++;
+            if (mDisplayNormalMessages)
+            {
+               mFilteredLog.push_back(entry);
+            }
+         }
+      }
+
+      onNewMessage_callback(errorCount, warnCount, normalCount);
+   }
+
+   Con::unlockLog();
+}
+
 //-----------------------------------------------------------------------------
 
 void GuiConsole::onPreRender()
 {
    //see if the size has changed
    U32 prevSize = getHeight() / mCellSize.y;
-   U32 size;
-   ConsoleLogEntry *log;
 
-   Con::getLockLog(log, size);
-   Con::unlockLog(); // we unlock immediately because we only use size here, not log.
+   refreshLogText();
    
-   if(size != prevSize)
-   {
-      //first, find out if the console was scrolled up
-      bool scrolled = false;
-      GuiScrollCtrl *parent = dynamic_cast<GuiScrollCtrl*>(getParent());
+   //first, find out if the console was scrolled up
+   bool scrolled = false;
+   GuiScrollCtrl *parent = dynamic_cast<GuiScrollCtrl*>(getParent());
 
-      if(parent)
-         scrolled = parent->isScrolledToBottom();
+   if(parent)
+      scrolled = parent->isScrolledToBottom();
 
-      //find the max cell width for the new entries
-      S32 newMax = getMaxWidth(prevSize, size - 1);
-      if(newMax > mCellSize.x)
-         mCellSize.set(newMax, mFont->getHeight());
+   //find the max cell width for the new entries
+   S32 newMax = getMaxWidth(prevSize, mFilteredLog.size() - 1);
+   if(newMax > mCellSize.x)
+      mCellSize.set(newMax, mFont->getHeight());
 
-      //set the array size
-      mSize.set(1, size);
+   //set the array size
+   mSize.set(1, mFilteredLog.size());
 
-      //resize the control
-      setExtent( Point2I(mCellSize.x, mCellSize.y * size));
+   //resize the control
+   setExtent(Point2I(mCellSize.x, mCellSize.y * mFilteredLog.size()));
 
-      //if the console was not scrolled, make the last entry visible
-      if (scrolled)
-         scrollCellVisible(Point2I(0,mSize.y - 1));
-   }
+   //if the console was not scrolled, make the last entry visible
+   if (scrolled)
+      scrollCellVisible(Point2I(0,mSize.y - 1));
 }
 
 //-----------------------------------------------------------------------------
@@ -139,10 +192,8 @@ void GuiConsole::onRenderCell(Point2I offset, Point2I cell, bool /*selected*/, b
 {
    U32 size;
    ConsoleLogEntry *log;
-
-   Con::getLockLog(log, size);
-
-   ConsoleLogEntry &entry = log[cell.y];
+   
+   ConsoleLogEntry &entry = mFilteredLog[cell.y];
    switch (entry.mLevel)
    {
       case ConsoleLogEntry::Normal:   GFX->getDrawUtil()->setBitmapModulation(mProfile->mFontColor); break;
@@ -151,8 +202,6 @@ void GuiConsole::onRenderCell(Point2I offset, Point2I cell, bool /*selected*/, b
       default: AssertFatal(false, "GuiConsole::onRenderCell - Unrecognized ConsoleLogEntry type, update this.");
    }
    GFX->getDrawUtil()->drawText(mFont, Point2I(offset.x + 3, offset.y), entry.mString, mProfile->mFontColors);
-   
-   Con::unlockLog();
 }
 
 //-----------------------------------------------------------------------------
@@ -164,10 +213,75 @@ void GuiConsole::onCellSelected( Point2I cell )
    U32 size;
    ConsoleLogEntry* log;
 
-   Con::getLockLog(log, size);
-
-   ConsoleLogEntry& entry = log[ cell.y ];
+   ConsoleLogEntry& entry = mFilteredLog[cell.y];
    onMessageSelected_callback( entry.mLevel, entry.mString );
+}
 
-   Con::unlockLog();
+void GuiConsole::setDisplayFilters(bool errors, bool warns, bool normal)
+{
+   mDisplayErrors = errors;
+   mDisplayWarnings = warns;
+   mDisplayNormalMessages = normal;
+   mFiltersDirty = true;
+
+   refreshLogText();
+
+   //find the max cell width for the new entries
+   S32 newMax = getMaxWidth(0, mFilteredLog.size() - 1);
+   mCellSize.set(newMax, mFont->getHeight());
+
+   //set the array size
+   mSize.set(1, mFilteredLog.size());
+
+   //resize the control
+   setExtent(Point2I(mCellSize.x, mCellSize.y * mFilteredLog.size()));
+
+   scrollCellVisible(Point2I(0, mSize.y - 1));
+
+   mFiltersDirty = false;
+}
+
+DefineEngineMethod(GuiConsole, setDisplayFilters, void, (bool errors, bool warns, bool normal), (true, true, true),
+   "Sets the current display filters for the console gui. Allows you to indicate if it should display errors, warns and/or normal messages.\n\n"
+   "@param errors If true, the console gui will display any error messages that were emitted.\n\n"
+   "@param warns If true, the console gui will display any warning messages that were emitted.\n\n"
+   "@param normal If true, the console gui will display any regular messages that were emitted.\n\n")
+{
+   object->setDisplayFilters(errors, warns, normal);
+}
+
+DefineEngineMethod(GuiConsole, getErrorFilter, bool, (), ,
+   "Returns if the error filter is on or not.")
+{
+   return object->getErrorFilter();
+}
+
+DefineEngineMethod(GuiConsole, getWarnFilter, bool, (), ,
+   "Returns if the warning filter is on or not.")
+{
+   return object->getWarnFilter();
 }
+
+DefineEngineMethod(GuiConsole, getNormalFilter, bool, (), ,
+   "Returns if the normal message filter is on or not.")
+{
+   return object->getNormalFilter();
+}
+
+DefineEngineMethod(GuiConsole, toggleErrorFilter, void, (), ,
+   "Toggles the error filter.")
+{
+   object->toggleErrorFilter();
+}
+
+DefineEngineMethod(GuiConsole, toggleWarnFilter, void, (), ,
+   "Toggles the warning filter.")
+{
+   object->toggleWarnFilter();
+}
+
+DefineEngineMethod(GuiConsole, toggleNormalFilter, void, (), ,
+   "Toggles the normal messages filter.")
+{
+   object->toggleNormalFilter();
+}

+ 28 - 0
Engine/source/gui/controls/guiConsole.h

@@ -39,14 +39,22 @@ class GuiConsole : public GuiArrayCtrl
 
       Resource<GFont> mFont;
 
+      bool mDisplayErrors;
+      bool mDisplayWarnings;
+      bool mDisplayNormalMessages;
+      bool mFiltersDirty;
+
       S32 getMaxWidth(S32 startIndex, S32 endIndex);
 
+      Vector<ConsoleLogEntry> mFilteredLog;
+
    protected:
 
       /// @name Callbacks
       /// @{
 
       DECLARE_CALLBACK( void, onMessageSelected, ( ConsoleLogEntry::Level level, const char* message ) );
+      DECLARE_CALLBACK(void, onNewMessage, (U32 errorCount, U32 warnCount, U32 normalCount));
 
       /// @}
 
@@ -63,6 +71,26 @@ class GuiConsole : public GuiArrayCtrl
       virtual bool onWake();
       virtual void onPreRender();
       virtual void onRenderCell(Point2I offset, Point2I cell, bool selected, bool mouseOver);
+
+      void setDisplayFilters(bool errors, bool warns, bool normal);
+      bool getErrorFilter() { return mDisplayErrors; }
+      bool getWarnFilter() { return mDisplayWarnings; }
+      bool getNormalFilter() { return mDisplayNormalMessages; }
+
+      void toggleErrorFilter()
+      {
+         setDisplayFilters(!mDisplayErrors, mDisplayWarnings, mDisplayNormalMessages);
+      }
+      void toggleWarnFilter()
+      {
+         setDisplayFilters(mDisplayErrors, !mDisplayWarnings, mDisplayNormalMessages);
+      }
+      void toggleNormalFilter()
+      {
+         setDisplayFilters(mDisplayErrors, mDisplayWarnings, !mDisplayNormalMessages);
+      }
+
+      void refreshLogText();
 };
 
 #endif

+ 171 - 31
Templates/BaseGame/game/core/console/console.gui

@@ -1,51 +1,191 @@
-new GuiControl(ConsoleDlg) {
-   profile = "GuiDefaultProfile";
-   horizSizing = "right";
-   vertSizing = "bottom";
+//--- OBJECT WRITE BEGIN ---
+%guiContent = new GuiControl(ConsoleDlg) {
    position = "0 0";
-   extent = "640 480";
+   extent = "1024 768";
    minExtent = "8 8";
+   horizSizing = "right";
+   vertSizing = "bottom";
+   profile = "GuiDefaultProfile";
    visible = "1";
-   helpTag = "0";
+   active = "1";
+   tooltipProfile = "GuiToolTipProfile";
+   hovertime = "1000";
+   isContainer = "1";
+   canSave = "1";
+   canSaveDynamicFields = "1";
+      helpTag = "0";
 
    new GuiConsoleEditCtrl(ConsoleEntry) {
-      profile = "ConsoleTextEditProfile";
+      useSiblingScroller = "1";
+      historySize = "40";
+      tabComplete = "0";
+      sinkAllKeyEvents = "1";
+      password = "0";
+      passwordMask = "*";
+      maxLength = "255";
+      margin = "0 0 0 0";
+      padding = "0 0 0 0";
+      anchorTop = "1";
+      anchorBottom = "0";
+      anchorLeft = "1";
+      anchorRight = "0";
+      position = "0 750";
+      extent = "1024 18";
+      minExtent = "8 8";
       horizSizing = "width";
       vertSizing = "top";
-      position = "0 462";
-      extent = "640 18";
-      minExtent = "8 8";
+      profile = "ConsoleTextEditProfile";
       visible = "1";
+      active = "1";
       altCommand = "ConsoleEntry::eval();";
-      helpTag = "0";
-      maxLength = "255";
-      historySize = "40";
-      password = "0";
-      tabComplete = "0";
-      sinkAllKeyEvents = "1";
-      useSiblingScroller = "1";
+      tooltipProfile = "GuiToolTipProfile";
+      hovertime = "1000";
+      isContainer = "1";
+      canSave = "1";
+      canSaveDynamicFields = "0";
    };
-   new GuiScrollCtrl() {
-      internalName = "Scroll";
-      profile = "ConsoleScrollProfile";
+   new GuiContainer() {
+      margin = "0 0 0 0";
+      padding = "0 0 0 0";
+      anchorTop = "1";
+      anchorBottom = "0";
+      anchorLeft = "1";
+      anchorRight = "0";
+      position = "1 728";
+      extent = "1024 22";
+      minExtent = "8 2";
       horizSizing = "width";
-      vertSizing = "height";
-      position = "0 0";
-      extent = "640 462";
-      minExtent = "8 8";
+      vertSizing = "top";
+      profile = "GuiDefaultProfile";
       visible = "1";
-      helpTag = "0";
+      active = "1";
+      tooltipProfile = "GuiToolTipProfile";
+      hovertime = "1000";
+      isContainer = "1";
+      canSave = "1";
+      canSaveDynamicFields = "0";
+
+      new GuiBitmapCtrl() {
+         bitmap = "data/ui/art/hudfill.png";
+         color = "255 255 255 255";
+         wrap = "0";
+         position = "0 0";
+         extent = "1024 22";
+         minExtent = "8 2";
+         horizSizing = "width";
+         vertSizing = "bottom";
+         profile = "GuiDefaultProfile";
+         visible = "1";
+         active = "1";
+         tooltipProfile = "GuiToolTipProfile";
+         hovertime = "1000";
+         isContainer = "0";
+         canSave = "1";
+         canSaveDynamicFields = "0";
+      };
+      new GuiCheckBoxCtrl(ConsoleDlgErrorFilterBtn) {
+         text = "Errors";
+         groupNum = "-1";
+         buttonType = "ToggleButton";
+         useMouseEvents = "0";
+         position = "2 2";
+         extent = "113 20";
+         minExtent = "8 2";
+         horizSizing = "right";
+         vertSizing = "bottom";
+         profile = "GuiCheckBoxProfile";
+         visible = "1";
+         active = "1";
+         tooltipProfile = "GuiToolTipProfile";
+         hovertime = "1000";
+         isContainer = "0";
+         canSave = "1";
+         canSaveDynamicFields = "0";
+      };
+      new GuiCheckBoxCtrl(ConsoleDlgWarnFilterBtn) {
+         text = "Warnings";
+         groupNum = "-1";
+         buttonType = "ToggleButton";
+         useMouseEvents = "0";
+         position = "119 2";
+         extent = "113 20";
+         minExtent = "8 2";
+         horizSizing = "right";
+         vertSizing = "bottom";
+         profile = "GuiCheckBoxProfile";
+         visible = "1";
+         active = "1";
+         tooltipProfile = "GuiToolTipProfile";
+         hovertime = "1000";
+         isContainer = "0";
+         canSave = "1";
+         canSaveDynamicFields = "0";
+      };
+      new GuiCheckBoxCtrl(ConsoleDlgNormalFilterBtn) {
+         text = "Normal Messages";
+         groupNum = "-1";
+         buttonType = "ToggleButton";
+         useMouseEvents = "0";
+         position = "236 2";
+         extent = "113 20";
+         minExtent = "8 2";
+         horizSizing = "right";
+         vertSizing = "bottom";
+         profile = "GuiCheckBoxProfile";
+         visible = "1";
+         active = "1";
+         tooltipProfile = "GuiToolTipProfile";
+         hovertime = "1000";
+         isContainer = "0";
+         canSave = "1";
+         canSaveDynamicFields = "0";
+      };
+   };
+   new GuiScrollCtrl() {
       willFirstRespond = "1";
       hScrollBar = "alwaysOn";
       vScrollBar = "alwaysOn";
-      lockHorizScroll = "false";
-      lockVertScroll = "false";
+      lockHorizScroll = "0";
+      lockVertScroll = "0";
       constantThumbHeight = "0";
       childMargin = "0 0";
+      mouseWheelScrollSpeed = "-1";
+      margin = "0 0 0 0";
+      padding = "0 0 0 0";
+      anchorTop = "1";
+      anchorBottom = "0";
+      anchorLeft = "1";
+      anchorRight = "0";
+      position = "0 0";
+      extent = "1024 730";
+      minExtent = "8 8";
+      horizSizing = "width";
+      vertSizing = "height";
+      profile = "ConsoleScrollProfile";
+      visible = "1";
+      active = "1";
+      tooltipProfile = "GuiToolTipProfile";
+      hovertime = "1000";
+      isContainer = "1";
+      internalName = "Scroll";
+      canSave = "1";
+      canSaveDynamicFields = "0";
 
-         new GuiConsole( ConsoleMessageLogView ) {
-            profile = "GuiConsoleProfile";
-            position = "0 0";
-         };
+      new GuiConsole(ConsoleMessageLogView) {
+         position = "1 1";
+         extent = "622 324";
+         minExtent = "8 2";
+         horizSizing = "right";
+         vertSizing = "bottom";
+         profile = "GuiConsoleProfile";
+         visible = "1";
+         active = "1";
+         tooltipProfile = "GuiToolTipProfile";
+         hovertime = "1000";
+         isContainer = "1";
+         canSave = "1";
+         canSaveDynamicFields = "0";
       };
+   };
 };
+//--- OBJECT WRITE END ---

+ 30 - 0
Templates/BaseGame/game/core/console/main.cs

@@ -99,6 +99,13 @@ function ConsoleDlg::showWindow(%this)
    %this-->Scroll.setVisible(true);
 }
 
+function ConsoleDlg::onWake(%this)
+{
+   ConsoleDlgErrorFilterBtn.setStateOn(ConsoleMessageLogView.getErrorFilter());
+   ConsoleDlgWarnFilterBtn.setStateOn(ConsoleMessageLogView.getWarnFilter());
+   ConsoleDlgNormalFilterBtn.setStateOn(ConsoleMessageLogView.getNormalFilter());
+}
+
 function ConsoleDlg::setAlpha( %this, %alpha)
 {
    if (%alpha $= "")
@@ -106,3 +113,26 @@ function ConsoleDlg::setAlpha( %this, %alpha)
    else
       ConsoleScrollProfile.fillColor = getWords($ConsoleDefaultFillColor, 0, 2) SPC %alpha * 255.0;
 }
+
+function ConsoleDlgErrorFilterBtn::onClick(%this)
+{
+   ConsoleMessageLogView.toggleErrorFilter();
+}
+
+function ConsoleDlgWarnFilterBtn::onClick(%this)
+{
+  
+   ConsoleMessageLogView.toggleWarnFilter();
+}
+
+function ConsoleDlgNormalFilterBtn::onClick(%this)
+{
+   ConsoleMessageLogView.toggleNormalFilter();
+}
+
+function ConsoleMessageLogView::onNewMessage(%this, %errorCount, %warnCount, %normalCount)
+{
+   ConsoleDlgErrorFilterBtn.setText("(" @ %errorCount @ ") Errors");
+   ConsoleDlgWarnFilterBtn.setText("(" @ %warnCount @ ") Warnings");
+   ConsoleDlgNormalFilterBtn.setText("(" @ %normalCount @ ") Messages");
+}

+ 198 - 30
Templates/Full/game/core/art/gui/console.gui

@@ -1,54 +1,192 @@
 //--- OBJECT WRITE BEGIN ---
 %guiContent = new GuiControl(ConsoleDlg) {
-   profile = "GuiDefaultProfile";
-   horizSizing = "right";
-   vertSizing = "bottom";
    position = "0 0";
-   extent = "640 480";
+   extent = "1024 768";
    minExtent = "8 8";
+   horizSizing = "right";
+   vertSizing = "bottom";
+   profile = "GuiDefaultProfile";
    visible = "1";
-   helpTag = "0";
+   active = "1";
+   tooltipProfile = "GuiToolTipProfile";
+   hovertime = "1000";
+   isContainer = "1";
+   canSave = "1";
+   canSaveDynamicFields = "1";
+      helpTag = "0";
 
    new GuiConsoleEditCtrl(ConsoleEntry) {
-      profile = "ConsoleTextEditProfile";
+      useSiblingScroller = "1";
+      historySize = "40";
+      tabComplete = "0";
+      sinkAllKeyEvents = "1";
+      password = "0";
+      passwordMask = "*";
+      maxLength = "255";
+      margin = "0 0 0 0";
+      padding = "0 0 0 0";
+      anchorTop = "1";
+      anchorBottom = "0";
+      anchorLeft = "1";
+      anchorRight = "0";
+      position = "0 750";
+      extent = "1024 18";
+      minExtent = "8 8";
       horizSizing = "width";
       vertSizing = "top";
-      position = "0 462";
-      extent = "640 18";
-      minExtent = "8 8";
+      profile = "ConsoleTextEditProfile";
       visible = "1";
+      active = "1";
       altCommand = "ConsoleEntry::eval();";
-      helpTag = "0";
-      maxLength = "255";
-      historySize = "40";
-      password = "0";
-      tabComplete = "0";
-      sinkAllKeyEvents = "1";
-      useSiblingScroller = "1";
+      tooltipProfile = "GuiToolTipProfile";
+      hovertime = "1000";
+      isContainer = "1";
+      canSave = "1";
+      canSaveDynamicFields = "0";
    };
-   new GuiScrollCtrl() {
-      internalName = "Scroll";
-      profile = "ConsoleScrollProfile";
+   new GuiContainer() {
+      margin = "0 0 0 0";
+      padding = "0 0 0 0";
+      anchorTop = "1";
+      anchorBottom = "0";
+      anchorLeft = "1";
+      anchorRight = "0";
+      position = "1 728";
+      extent = "1024 22";
+      minExtent = "8 2";
       horizSizing = "width";
-      vertSizing = "height";
-      position = "0 0";
-      extent = "640 462";
-      minExtent = "8 8";
+      vertSizing = "top";
+      profile = "GuiDefaultProfile";
       visible = "1";
-      helpTag = "0";
+      active = "1";
+      tooltipProfile = "GuiToolTipProfile";
+      hovertime = "1000";
+      isContainer = "1";
+      canSave = "1";
+      canSaveDynamicFields = "0";
+
+      new GuiBitmapCtrl() {
+         bitmap = "data/ui/art/hudfill.png";
+         color = "255 255 255 255";
+         wrap = "0";
+         position = "0 0";
+         extent = "1024 22";
+         minExtent = "8 2";
+         horizSizing = "width";
+         vertSizing = "bottom";
+         profile = "GuiDefaultProfile";
+         visible = "1";
+         active = "1";
+         tooltipProfile = "GuiToolTipProfile";
+         hovertime = "1000";
+         isContainer = "0";
+         canSave = "1";
+         canSaveDynamicFields = "0";
+      };
+      new GuiCheckBoxCtrl(ConsoleDlgErrorFilterBtn) {
+         text = "Errors";
+         groupNum = "-1";
+         buttonType = "ToggleButton";
+         useMouseEvents = "0";
+         position = "2 2";
+         extent = "113 20";
+         minExtent = "8 2";
+         horizSizing = "right";
+         vertSizing = "bottom";
+         profile = "GuiCheckBoxProfile";
+         visible = "1";
+         active = "1";
+         tooltipProfile = "GuiToolTipProfile";
+         hovertime = "1000";
+         isContainer = "0";
+         canSave = "1";
+         canSaveDynamicFields = "0";
+      };
+      new GuiCheckBoxCtrl(ConsoleDlgWarnFilterBtn) {
+         text = "Warnings";
+         groupNum = "-1";
+         buttonType = "ToggleButton";
+         useMouseEvents = "0";
+         position = "119 2";
+         extent = "113 20";
+         minExtent = "8 2";
+         horizSizing = "right";
+         vertSizing = "bottom";
+         profile = "GuiCheckBoxProfile";
+         visible = "1";
+         active = "1";
+         tooltipProfile = "GuiToolTipProfile";
+         hovertime = "1000";
+         isContainer = "0";
+         canSave = "1";
+         canSaveDynamicFields = "0";
+      };
+      new GuiCheckBoxCtrl(ConsoleDlgNormalFilterBtn) {
+         text = "Normal Messages";
+         groupNum = "-1";
+         buttonType = "ToggleButton";
+         useMouseEvents = "0";
+         position = "236 2";
+         extent = "113 20";
+         minExtent = "8 2";
+         horizSizing = "right";
+         vertSizing = "bottom";
+         profile = "GuiCheckBoxProfile";
+         visible = "1";
+         active = "1";
+         tooltipProfile = "GuiToolTipProfile";
+         hovertime = "1000";
+         isContainer = "0";
+         canSave = "1";
+         canSaveDynamicFields = "0";
+      };
+   };
+   new GuiScrollCtrl() {
       willFirstRespond = "1";
       hScrollBar = "alwaysOn";
       vScrollBar = "alwaysOn";
-      lockHorizScroll = "false";
-      lockVertScroll = "false";
+      lockHorizScroll = "0";
+      lockVertScroll = "0";
       constantThumbHeight = "0";
       childMargin = "0 0";
+      mouseWheelScrollSpeed = "-1";
+      margin = "0 0 0 0";
+      padding = "0 0 0 0";
+      anchorTop = "1";
+      anchorBottom = "0";
+      anchorLeft = "1";
+      anchorRight = "0";
+      position = "0 0";
+      extent = "1024 730";
+      minExtent = "8 8";
+      horizSizing = "width";
+      vertSizing = "height";
+      profile = "ConsoleScrollProfile";
+      visible = "1";
+      active = "1";
+      tooltipProfile = "GuiToolTipProfile";
+      hovertime = "1000";
+      isContainer = "1";
+      internalName = "Scroll";
+      canSave = "1";
+      canSaveDynamicFields = "0";
 
-         new GuiConsole( ConsoleMessageLogView ) {
-            profile = "GuiConsoleProfile";
-            position = "0 0";
-         };
+      new GuiConsole(ConsoleMessageLogView) {
+         position = "1 1";
+         extent = "622 324";
+         minExtent = "8 2";
+         horizSizing = "right";
+         vertSizing = "bottom";
+         profile = "GuiConsoleProfile";
+         visible = "1";
+         active = "1";
+         tooltipProfile = "GuiToolTipProfile";
+         hovertime = "1000";
+         isContainer = "1";
+         canSave = "1";
+         canSaveDynamicFields = "0";
       };
+   };
 };
 //--- OBJECT WRITE END ---
 
@@ -173,3 +311,33 @@ function ConsoleMessageLogView::onMessageSelected( %this, %level, %message )
    
    EditorOpenFileInTorsion( %fileName, %lineNumber );
 }
+
+function ConsoleDlg::onWake(%this)
+{
+   ConsoleDlgErrorFilterBtn.setStateOn(ConsoleMessageLogView.getErrorFilter());
+   ConsoleDlgWarnFilterBtn.setStateOn(ConsoleMessageLogView.getWarnFilter());
+   ConsoleDlgNormalFilterBtn.setStateOn(ConsoleMessageLogView.getNormalFilter());
+}
+
+function ConsoleDlgErrorFilterBtn::onClick(%this)
+{
+   ConsoleMessageLogView.toggleErrorFilter();
+}
+
+function ConsoleDlgWarnFilterBtn::onClick(%this)
+{
+  
+   ConsoleMessageLogView.toggleWarnFilter();
+}
+
+function ConsoleDlgNormalFilterBtn::onClick(%this)
+{
+   ConsoleMessageLogView.toggleNormalFilter();
+}
+
+function ConsoleMessageLogView::onNewMessage(%this, %errorCount, %warnCount, %normalCount)
+{
+   ConsoleDlgErrorFilterBtn.setText("(" @ %errorCount @ ") Errors");
+   ConsoleDlgWarnFilterBtn.setText("(" @ %warnCount @ ") Warnings");
+   ConsoleDlgNormalFilterBtn.setText("(" @ %normalCount @ ") Messages");
+}