Extract editor edit action router
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
#include "Actions/ActionRouting.h"
|
||||
#include "Actions/EditorActions.h"
|
||||
#include "ConsolePanel.h"
|
||||
#include "Core/EditorConsoleSink.h"
|
||||
@@ -18,6 +19,8 @@ void ConsolePanel::Render() {
|
||||
return;
|
||||
}
|
||||
|
||||
Actions::ObserveInactiveActionRoute(*m_context);
|
||||
|
||||
auto* sink = Debug::EditorConsoleSink::GetInstance();
|
||||
|
||||
{
|
||||
@@ -30,11 +33,11 @@ void ConsolePanel::Render() {
|
||||
|
||||
UI::DrawToolbarLabel("Filter");
|
||||
ImGui::SameLine();
|
||||
Actions::DrawToolbarToggleAction(Actions::MakeConsoleInfoFilterAction(m_showInfo), m_showInfo);
|
||||
Actions::DrawToolbarToggleAction(Actions::MakeConsoleInfoFilterAction(m_filterState.ShowInfo()), m_filterState.ShowInfo());
|
||||
ImGui::SameLine();
|
||||
Actions::DrawToolbarToggleAction(Actions::MakeConsoleWarningFilterAction(m_showWarning), m_showWarning);
|
||||
Actions::DrawToolbarToggleAction(Actions::MakeConsoleWarningFilterAction(m_filterState.ShowWarning()), m_filterState.ShowWarning());
|
||||
ImGui::SameLine();
|
||||
Actions::DrawToolbarToggleAction(Actions::MakeConsoleErrorFilterAction(m_showError), m_showError);
|
||||
Actions::DrawToolbarToggleAction(Actions::MakeConsoleErrorFilterAction(m_filterState.ShowError()), m_filterState.ShowError());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,23 +49,7 @@ void ConsolePanel::Render() {
|
||||
const auto logs = sink->GetLogs();
|
||||
size_t logIndex = 0;
|
||||
for (const auto& log : logs) {
|
||||
bool shouldShow = false;
|
||||
switch (log.level) {
|
||||
case ::XCEngine::Debug::LogLevel::Info:
|
||||
case ::XCEngine::Debug::LogLevel::Verbose:
|
||||
case ::XCEngine::Debug::LogLevel::Debug:
|
||||
shouldShow = m_showInfo;
|
||||
break;
|
||||
case ::XCEngine::Debug::LogLevel::Warning:
|
||||
shouldShow = m_showWarning;
|
||||
break;
|
||||
case ::XCEngine::Debug::LogLevel::Error:
|
||||
case ::XCEngine::Debug::LogLevel::Fatal:
|
||||
shouldShow = m_showError;
|
||||
break;
|
||||
}
|
||||
|
||||
if (!shouldShow) {
|
||||
if (!m_filterState.Allows(log.level)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user