Elaztek Developer Hub
Blamite Game Engine - Keystone  00355.06.11.22.0220.blamite
A library that enables the use of Qt in Blamite's editing tools.
output.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <QDockWidget>
4 #include <Strings/components/interface/logger/logger.h>
5 
8 #include "ui_console_output.h"
9 
11 
19 class BlamOutputLogReceiver : public BlamLogReceiver, public EditorEventListener
20 {
21  BlamEditorToolWindow_Output* output_window = nullptr;
22  std::vector<BlamBasicLogMessage> messages = std::vector<BlamBasicLogMessage>();
23 
24 public:
25 
28 
34  void LogMessageReceived(BlamBasicLogMessage message);
35 
36  void OnTickEvent(EditorTickEvent* event);
37 };
38 
45 {
46  Q_OBJECT
47 
48 public:
51 
52  void RebuildLogOutput();
53 
54 private:
55  Ui::guerilla_console_output ui;
56 
57  BlamOutputLogReceiver* output_receiver = nullptr;
58 
59  int displayed_error_count = 0;
60  int displayed_warning_count = 0;
61  int displayed_info_count = 0;
62 
63  int total_error_count = 0;
64  int total_warning_count = 0;
65  int total_info_count = 0;
66 
67  int last_message_index = 0;
68 
69  void AppendLogMessage(BlamBasicLogMessage message);
70 
71 public slots:
72 
73  void log_message_notify(BlamBasicLogMessage message);
74 
75 private slots:
79  void btn_clear_Click();
80 
86  void btn_copy_Click();
87 
88  void btn_show_errors_Click();
89  void btn_show_warnings_Click();
90  void btn_show_info_Click();
91  void cbox_show_output_from_indexChanged(int index);
92 };
BlamEditorToolWindow
Base class for all editor tool windows.
Definition: BlamEditorToolWindow.h:37
BlamEditorToolWindow.h
BlamEditorToolWindow_Output
The console output window.
Definition: output.h:44
BlamEditorToolWindow_Output::BlamEditorToolWindow_Output
BlamEditorToolWindow_Output()
Definition: BlamEditorToolWindow_Output.cpp:10
events.h
BlamEditorToolWindow_Output::~BlamEditorToolWindow_Output
~BlamEditorToolWindow_Output()
Definition: BlamEditorToolWindow_Output.cpp:37
BlamOutputLogReceiver::LogMessageReceived
void LogMessageReceived(BlamBasicLogMessage message)
Adds a new log message to the output text field.
Definition: BlamOutputLogReceiver.cpp:17
BlamEditorToolWindow_Output::RebuildLogOutput
void RebuildLogOutput()
Definition: BlamEditorToolWindow_Output.cpp:111
EditorTickEvent
Definition: event_types.h:9
BlamOutputLogReceiver::OnTickEvent
void OnTickEvent(EditorTickEvent *event)
Definition: BlamOutputLogReceiver.cpp:24
BlamOutputLogReceiver::~BlamOutputLogReceiver
~BlamOutputLogReceiver()
Definition: BlamOutputLogReceiver.cpp:12
BlamOutputLogReceiver::BlamOutputLogReceiver
BlamOutputLogReceiver(BlamEditorToolWindow_Output *_output_window)
Definition: BlamOutputLogReceiver.cpp:5
BlamEditorToolWindow_Output::log_message_notify
void log_message_notify(BlamBasicLogMessage message)
Definition: BlamEditorToolWindow_Output.cpp:60
EditorEventListener
Definition: events.h:25
BlamOutputLogReceiver
Log message receiver, used to listen for new messages from any logger.
Definition: output.h:19