Makes it properly force an update of the filter via a dirty flag.

This commit is contained in:
Areloch 2017-10-26 20:11:35 -05:00
parent 9b83e47302
commit a36192ffd8
2 changed files with 6 additions and 1 deletions

View file

@ -68,6 +68,7 @@ GuiConsole::GuiConsole()
mDisplayErrors = true; mDisplayErrors = true;
mDisplayWarnings = true; mDisplayWarnings = true;
mDisplayNormalMessages = true; mDisplayNormalMessages = true;
mFiltersDirty = true;
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@ -108,7 +109,7 @@ void GuiConsole::refreshLogText()
Con::getLockLog(log, size); Con::getLockLog(log, size);
if (mFilteredLog.size() != size) if (mFilteredLog.size() != size || mFiltersDirty)
{ {
mFilteredLog.clear(); mFilteredLog.clear();
@ -221,6 +222,7 @@ void GuiConsole::setDisplayFilters(bool errors, bool warns, bool normal)
mDisplayErrors = errors; mDisplayErrors = errors;
mDisplayWarnings = warns; mDisplayWarnings = warns;
mDisplayNormalMessages = normal; mDisplayNormalMessages = normal;
mFiltersDirty = true;
refreshLogText(); refreshLogText();
@ -235,6 +237,8 @@ void GuiConsole::setDisplayFilters(bool errors, bool warns, bool normal)
setExtent(Point2I(mCellSize.x, mCellSize.y * mFilteredLog.size())); setExtent(Point2I(mCellSize.x, mCellSize.y * mFilteredLog.size()));
scrollCellVisible(Point2I(0, mSize.y - 1)); scrollCellVisible(Point2I(0, mSize.y - 1));
mFiltersDirty = false;
} }
DefineEngineMethod(GuiConsole, setDisplayFilters, void, (bool errors, bool warns, bool normal), (true, true, true), DefineEngineMethod(GuiConsole, setDisplayFilters, void, (bool errors, bool warns, bool normal), (true, true, true),

View file

@ -42,6 +42,7 @@ class GuiConsole : public GuiArrayCtrl
bool mDisplayErrors; bool mDisplayErrors;
bool mDisplayWarnings; bool mDisplayWarnings;
bool mDisplayNormalMessages; bool mDisplayNormalMessages;
bool mFiltersDirty;
S32 getMaxWidth(S32 startIndex, S32 endIndex); S32 getMaxWidth(S32 startIndex, S32 endIndex);