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_GameControls.h
Go to the documentation of this file.
1/*
2 This source file is part of Rigs of Rods
3 Copyright 2020 tritonas00
4
5 For more information, see http://www.rigsofrods.org/
6
7 Rigs of Rods is free software: you can redistribute it and/or modify
8 it under the terms of the GNU General Public License version 3, as
9 published by the Free Software Foundation.
10
11 Rigs of Rods is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with Rigs of Rods. If not, see <http://www.gnu.org/licenses/>.
18*/
19
20#pragma once
21
22#include "InputEngine.h"
23#include "OgreImGui.h"
24
25namespace RoR {
26namespace GUI {
27
29{
30public:
31 const ImVec4 GRAY_HINT_TEXT = ImVec4(0.62f, 0.62f, 0.61f, 1.f);
32
33 void SetVisible(bool visible);
34 bool IsVisible() const { return m_is_visible; }
35 bool IsHovered() const { return m_is_hovered; }
36
38 void Draw();
39
40private:
41 void DrawEventEditBox();
42 void DrawEvent(RoR::events ev_code);
43 void DrawControlsTab(const char* prefix);
44 void DrawControlsTabItem(const char* name, const char* prefix);
45
46 // Edit bindings (used for both expert and interactive modes)
47 void ApplyChanges();
48 void CancelChanges();
49
50 void SaveMapFile();
51 void ReloadMapFile();
52
54
55 bool m_is_visible = false;
56 bool m_is_hovered = false;
57 float m_colum_widths[3] = {};
58
59 // Mode/config file selection
61 bool m_unsaved_changes = false;
62
63 // Editing context
70};
71
72} // namespace GUI
73} // namespace RoR
Handles controller inputs from player.
void DrawEventEditBox()
Only the editing UI, embeddable.
void DrawEvent(RoR::events ev_code)
One line in table.
void SetVisible(bool visible)
void DrawControlsTab(const char *prefix)
Draws table with events matching prefix.
event_trigger_t * m_active_trigger
void DrawControlsTabItem(const char *name, const char *prefix)
Wraps DrawControlsTab() with scrollbar and tabs-bar logic.
bool ShouldDisplay(event_trigger_t &trig)
float m_colum_widths[3]
body->header width sync
static const int DEFAULT_MAPFILE_DEVICEID
virtual device ID for "input.map" entries
Wrapper for classic c-string (local buffer) Refresher: strlen() excludes '\0' terminator; strncat() A...
Definition Str.h:36
eventtypes
Definition InputEngine.h:50
@ ET_NONE
Definition InputEngine.h:51
@ EV_MODE_LAST