Rigs of Rods 2023.09
Soft-body Physics Simulation
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Loading...
Searching...
No Matches
GUI_ConsoleView.h
Go to the documentation of this file.
1/*
2 This source file is part of Rigs of Rods
3 Copyright 2005-2012 Pierre-Michel Ricordel
4 Copyright 2007-2012 Thomas Fischer
5 Copyright 2013-2020 Petr Ohlidal
6
7 For more information, see http://www.rigsofrods.org/
8
9 Rigs of Rods is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License version 3, as
11 published by the Free Software Foundation.
12
13 Rigs of Rods is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with Rigs of Rods. If not, see <http://www.gnu.org/licenses/>.
20*/
21
24
25#pragma once
26
27#include "Application.h"
28
29#include "Application.h"
30#include "Console.h"
31#include "OgreImGui.h"
32
33#include <vector>
34
35
36namespace RoR {
37namespace GUI {
38
41{
45
46 // Filtering (true means allowed)
52 bool cvw_filter_area_echo = false;
57
58 // Misc options
59 size_t cvw_msg_duration_ms = 0u;
60 bool cvw_enable_scrolling = false; // !< Vertical, multiline messages are broken apart when enabled
61 bool cvw_enable_icons = false;
62 ImVec4 cvw_background_color = ImVec4(0,0,0,0);
63 ImVec2 cvw_background_padding = ImVec2(0,0);
64 float cvw_line_spacing = 1.f;
65 float alpha = 1.f;
66 size_t fadeout_interval = 700u;
67
68private:
69 bool MessageFilter(Console::Message const& m);
71 ImVec2 DrawColoredTextWithIcon(ImVec2 text_cursor, Ogre::TexturePtr icon, ImVec4 default_color, std::string const& line);
72 int UpdateMessages();
73 ImVec2 DrawMessage(ImVec2 cursor, Console::Message const& m);
74
75 std::vector<Console::Message> m_filtered_messages;
76 std::vector<const Console::Message*> m_display_messages;
77 bool m_reload_messages = false;
78 size_t m_total_messages = 0;
79};
80
81} // namespace GUI
82} // namespace RoR
Central state/object manager and communications hub.
Configurable console renderer, implements filtering, colorized text, incons.
bool cvw_filter_area_echo
Not the same thing as 'log' command!
ImVec2 DrawMessage(ImVec2 cursor, Console::Message const &m)
size_t cvw_msg_duration_ms
Message expiration; 0 means unlimited.
int UpdateMessages()
Ret. num of new message(s)
std::vector< Console::Message > m_filtered_messages
Updated as needed.
ImVec4 cvw_background_color
Text-background color.
bool MessageFilter(Console::Message const &m)
Returns true if message should be displayed.
std::vector< const Console::Message * > m_display_messages
Rebuilt every frame; kept as member to reuse allocated memory.
ImVec2 DrawColoredTextWithIcon(ImVec2 text_cursor, Ogre::TexturePtr icon, ImVec4 default_color, std::string const &line)
Returns final text size.