Add clear console when starting gamemode setting.
Signed-off-by: sphrose <82213493+sphrose@users.noreply.github.com>
This commit is contained in:
@@ -537,6 +537,10 @@ 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
|
||||
|
||||
@@ -174,6 +174,8 @@ public:
|
||||
|
||||
static void AddToPendingLines(const QString& text, bool bNewLine); // call this function instead of AddToConsole() until an instance of CConsoleSCB exists to prevent messages from getting lost
|
||||
|
||||
void ClearText();
|
||||
|
||||
// EditorPreferencesNotificationBus...
|
||||
void OnEditorPreferencesChanged() override;
|
||||
|
||||
|
||||
@@ -31,6 +31,7 @@ void CEditorPreferencesPage_General::Reflect(AZ::SerializeContext& serialize)
|
||||
->Field("PreviewPanel", &GeneralSettings::m_previewPanel)
|
||||
->Field("ApplyConfigSpec", &GeneralSettings::m_applyConfigSpec)
|
||||
->Field("EnableSourceControl", &GeneralSettings::m_enableSourceControl)
|
||||
->Field("ClearConsole", &GeneralSettings::m_clearConsoleOnGameModeStart)
|
||||
->Field("ConsoleBackgroundColorTheme", &GeneralSettings::m_consoleBackgroundColorTheme)
|
||||
->Field("AutoloadLastLevel", &GeneralSettings::m_autoLoadLastLevel)
|
||||
->Field("ShowTimeInConsole", &GeneralSettings::m_bShowTimeInConsole)
|
||||
@@ -76,6 +77,8 @@ void CEditorPreferencesPage_General::Reflect(AZ::SerializeContext& serialize)
|
||||
->DataElement(AZ::Edit::UIHandlers::CheckBox, &GeneralSettings::m_previewPanel, "Show Geometry Preview Panel", "Show Geometry Preview Panel")
|
||||
->DataElement(AZ::Edit::UIHandlers::CheckBox, &GeneralSettings::m_applyConfigSpec, "Hide objects by config spec", "Hide objects by config spec")
|
||||
->DataElement(AZ::Edit::UIHandlers::CheckBox, &GeneralSettings::m_enableSourceControl, "Enable Source Control", "Enable Source Control")
|
||||
->DataElement(
|
||||
AZ::Edit::UIHandlers::CheckBox, &GeneralSettings::m_clearConsoleOnGameModeStart, "Clear Console at Game Startup", "Clear Console when Game Mode Starts")
|
||||
->DataElement(AZ::Edit::UIHandlers::ComboBox, &GeneralSettings::m_consoleBackgroundColorTheme, "Console Background", "Console Background")
|
||||
->EnumAttribute(AzToolsFramework::ConsoleColorTheme::Light, "Light")
|
||||
->EnumAttribute(AzToolsFramework::ConsoleColorTheme::Dark, "Dark")
|
||||
@@ -141,6 +144,7 @@ void CEditorPreferencesPage_General::OnApply()
|
||||
gSettings.bPreviewGeometryWindow = m_generalSettings.m_previewPanel;
|
||||
gSettings.bApplyConfigSpecInEditor = m_generalSettings.m_applyConfigSpec;
|
||||
gSettings.enableSourceControl = m_generalSettings.m_enableSourceControl;
|
||||
gSettings.clearConsoleOnGameModeStart = m_generalSettings.m_clearConsoleOnGameModeStart;
|
||||
gSettings.consoleBackgroundColorTheme = m_generalSettings.m_consoleBackgroundColorTheme;
|
||||
gSettings.bShowTimeInConsole = m_generalSettings.m_bShowTimeInConsole;
|
||||
gSettings.bShowDashboardAtStartup = m_messaging.m_showDashboard;
|
||||
@@ -175,6 +179,7 @@ void CEditorPreferencesPage_General::InitializeSettings()
|
||||
m_generalSettings.m_previewPanel = gSettings.bPreviewGeometryWindow;
|
||||
m_generalSettings.m_applyConfigSpec = gSettings.bApplyConfigSpecInEditor;
|
||||
m_generalSettings.m_enableSourceControl = gSettings.enableSourceControl;
|
||||
m_generalSettings.m_clearConsoleOnGameModeStart = gSettings.clearConsoleOnGameModeStart;
|
||||
m_generalSettings.m_consoleBackgroundColorTheme = gSettings.consoleBackgroundColorTheme;
|
||||
m_generalSettings.m_bShowTimeInConsole = gSettings.bShowTimeInConsole;
|
||||
m_generalSettings.m_autoLoadLastLevel = gSettings.bAutoloadLastLevelAtStartup;
|
||||
|
||||
@@ -45,6 +45,7 @@ private:
|
||||
bool m_previewPanel;
|
||||
bool m_applyConfigSpec;
|
||||
bool m_enableSourceControl;
|
||||
bool m_clearConsoleOnGameModeStart;
|
||||
AzToolsFramework::ConsoleColorTheme m_consoleBackgroundColorTheme;
|
||||
bool m_autoLoadLastLevel;
|
||||
bool m_bShowTimeInConsole;
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
|
||||
// Editor
|
||||
#include "IEditorImpl.h"
|
||||
#include "Controls/ConsoleSCB.h"
|
||||
#include "CryEditDoc.h"
|
||||
#include "Settings.h"
|
||||
|
||||
@@ -565,6 +566,11 @@ void CGameEngine::SwitchToInGame()
|
||||
streamer->QueueRequest(flush);
|
||||
wait.acquire();
|
||||
}
|
||||
|
||||
if (gSettings.clearConsoleOnGameModeStart)
|
||||
{
|
||||
CConsoleSCB::GetCreatedInstance()->ClearText();
|
||||
}
|
||||
|
||||
GetIEditor()->Notify(eNotify_OnBeginGameMode);
|
||||
|
||||
|
||||
@@ -188,6 +188,7 @@ SEditorSettings::SEditorSettings()
|
||||
|
||||
consoleBackgroundColorTheme = AzToolsFramework::ConsoleColorTheme::Dark;
|
||||
bShowTimeInConsole = false;
|
||||
clearConsoleOnGameModeStart = false;
|
||||
|
||||
enableSceneInspector = false;
|
||||
|
||||
@@ -526,6 +527,8 @@ void SEditorSettings::Save()
|
||||
|
||||
SaveValue("Settings", "ConsoleBackgroundColorThemeV2", (int)consoleBackgroundColorTheme);
|
||||
|
||||
SaveValue("Settings", "ClearConsoleOnGameModeStart", clearConsoleOnGameModeStart);
|
||||
|
||||
SaveValue("Settings", "ShowTimeInConsole", bShowTimeInConsole);
|
||||
|
||||
SaveValue("Settings", "EnableSceneInspector", enableSceneInspector);
|
||||
@@ -744,6 +747,8 @@ void SEditorSettings::Load()
|
||||
consoleBackgroundColorTheme = AzToolsFramework::ConsoleColorTheme::Dark;
|
||||
}
|
||||
|
||||
LoadValue("Settings", "ClearConsoleOnGameModeStart", clearConsoleOnGameModeStart);
|
||||
|
||||
LoadValue("Settings", "ShowTimeInConsole", bShowTimeInConsole);
|
||||
|
||||
LoadValue("Settings", "EnableSceneInspector", enableSceneInspector);
|
||||
|
||||
@@ -379,6 +379,7 @@ AZ_POP_DISABLE_DLL_EXPORT_BASECLASS_WARNING
|
||||
|
||||
//! Source Control Enabling.
|
||||
bool enableSourceControl;
|
||||
bool clearConsoleOnGameModeStart;
|
||||
|
||||
//! Text editor.
|
||||
QString textEditorForScript;
|
||||
|
||||
Reference in New Issue
Block a user