Merge pull request #2090 from Areloch/ConsoleLogFilters

Adds some filtering options to the console log gui
This commit is contained in:
Areloch 2018-03-16 23:41:00 -05:00 committed by GitHub
commit 5bf3d67959
5 changed files with 585 additions and 105 deletions

View file

@ -1,51 +1,191 @@
new GuiControl(ConsoleDlg) {
profile = "GuiDefaultProfile";
//--- OBJECT WRITE BEGIN ---
%guiContent = new GuiControl(ConsoleDlg) {
position = "0 0";
extent = "1024 768";
minExtent = "8 8";
horizSizing = "right";
vertSizing = "bottom";
position = "0 0";
extent = "640 480";
minExtent = "8 8";
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";
horizSizing = "width";
vertSizing = "top";
position = "0 462";
extent = "640 18";
minExtent = "8 8";
visible = "1";
altCommand = "ConsoleEntry::eval();";
helpTag = "0";
maxLength = "255";
useSiblingScroller = "1";
historySize = "40";
password = "0";
tabComplete = "0";
sinkAllKeyEvents = "1";
useSiblingScroller = "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";
profile = "ConsoleTextEditProfile";
visible = "1";
active = "1";
altCommand = "ConsoleEntry::eval();";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "0";
};
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 = "top";
profile = "GuiDefaultProfile";
visible = "1";
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() {
internalName = "Scroll";
profile = "ConsoleScrollProfile";
horizSizing = "width";
vertSizing = "height";
position = "0 0";
extent = "640 462";
minExtent = "8 8";
visible = "1";
helpTag = "0";
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 ---

View file

@ -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");
}