Review changes

Changed text case, removed ClearText API and added GameStartup motify listening.

Signed-off-by: sphrose <82213493+sphrose@users.noreply.github.com>
This commit is contained in:
sphrose
2021-07-14 10:14:25 +01:00
parent 4c627405f2
commit 93cbb7c981
4 changed files with 23 additions and 13 deletions
+19 -4
View File
@@ -337,6 +337,8 @@ CConsoleSCB::CConsoleSCB(QWidget* parent)
connect(findPreviousAction, &QAction::triggered, this, &CConsoleSCB::findPrevious);
ui->findPrevButton->addAction(findPreviousAction);
GetIEditor()->RegisterNotifyListener(this);
connect(ui->button, &QPushButton::clicked, this, &CConsoleSCB::showVariableEditor);
connect(ui->findButton, &QPushButton::clicked, this, &CConsoleSCB::toggleConsoleSearch);
connect(ui->textEdit, &ConsoleTextEdit::searchBarRequested, this, [this]
@@ -375,6 +377,8 @@ CConsoleSCB::~CConsoleSCB()
{
AzToolsFramework::EditorPreferencesNotificationBus::Handler::BusDisconnect();
GetIEditor()->UnregisterNotifyListener(this);
s_consoleSCB = nullptr;
CLogFile::AttachEditBox(nullptr);
}
@@ -537,10 +541,6 @@ void CConsoleSCB::AddToPendingLines(const QString& text, bool bNewLine)
s_pendingLines.push_back({ text, bNewLine });
}
void CConsoleSCB::ClearText()
{
ui->textEdit->clear();
}
/**
* When a CVar variable is updated, we need to tell alert our console variables
* pane so it can update the corresponding row
@@ -1355,4 +1355,19 @@ CConsoleSCB* CConsoleSCB::GetCreatedInstance()
return s_consoleSCB;
}
void CConsoleSCB::OnEditorNotifyEvent(EEditorNotifyEvent event)
{
switch (event)
{
case eNotify_OnBeginGameMode:
if (gSettings.clearConsoleOnGameModeStart)
{
ui->textEdit->clear();
}
break;
default:
break;
}
}
#include <Controls/moc_ConsoleSCB.cpp>