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_ConsoleWindow.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
23
24#pragma once
25
26#include "Application.h"
27
28#include "Application.h"
29#include "GUI_ConsoleView.h"
30#include "OgreImGui.h"
32#include "GUI_ScriptMonitor.h"
33
34#include <vector>
35#include <string>
36
37namespace RoR {
38namespace GUI {
39
41{
42public:
43 static const size_t HISTORY_CAP = 100u;
44
46 void SetVisible(bool visible) { m_is_visible = visible; }
47 bool IsVisible() const { return m_is_visible; }
48 bool IsHovered() const { return IsVisible() && m_is_hovered; }
49
50 void Draw();
51 void doCommand(std::string msg);
52
53private:
54
55 static int TextEditCallback(ImGuiTextEditCallbackData *data);
56 void TextEditCallbackProc(ImGuiTextEditCallbackData *data);
57
58 // Window state
59 bool m_is_visible = false;
60 bool m_is_hovered = false;
61
62 // Special panels
65
66 // Console context
69 std::vector<std::string> m_cmd_history;
71};
72
73} // namespace GUI
74} // namespace RoR
Central state/object manager and communications hub.
Generic console rendering.
std::vector< std::string > m_cmd_history
AngelScriptExamples m_angelscript_examples
void SetVisible(bool visible)
void TextEditCallbackProc(ImGuiTextEditCallbackData *data)
void doCommand(std::string msg)
static const size_t HISTORY_CAP
static int TextEditCallback(ImGuiTextEditCallbackData *data)
Wrapper for classic c-string (local buffer) Refresher: strlen() excludes '\0' terminator; strncat() A...
Definition Str.h:36
Configurable console renderer, implements filtering, colorized text, incons.