Rigs of Rods 2026.01
Soft-body Physics Simulation
Loading...
Searching...
No Matches
GUIManager.cpp
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#include "GUIManager.h"
26
27#include "Actor.h"
28#include "AppContext.h"
29#include "ActorManager.h"
30#include "CameraManager.h"
31#include "ContentManager.h"
32#include "GameContext.h"
33#include "GfxActor.h"
34#include "GfxScene.h"
35#include "GUIUtils.h"
36#include "InputEngine.h"
37#include "Language.h"
38#include "OgreImGui.h"
39#include "OverlayWrapper.h"
40#include "PlatformUtils.h"
41#include "RTTLayer.h"
42#include "Terrain.h"
43
44#include <OgreOverlayElement.h>
45#include <OgreOverlayContainer.h>
46#include <OgreOverlayManager.h>
47
48#include <imgui_internal.h>
49
50#define RESOURCE_FILENAME "MyGUI_Core.xml"
51
52using namespace RoR;
53
56{
57 // Cvar name | NOVICE, REGULAR, EXPERT, MINIMALLIST
58 { "gfx_surveymap_icons", {"true", "true", "true", "false"} },
59 { "gfx_declutter_map", {"false", "true", "false", "true"} },
60 { "ui_show_live_repair_controls", {"true", "false", "false", "false"} },
61
62 // List closure
63 { nullptr, {} }
64};
65
67{
68 // Logfile disabled by default - easily overbloats by errors, see https://github.com/RigsOfRods/rigs-of-rods/issues/3345
69 std::string mygui_logpath = "";
70 if (App::diag_use_mygui_logfile->getBool())
71 {
72 mygui_logpath = PathCombine(App::sys_logs_dir->getStr(), "MyGUI.log");
73 }
74 auto mygui_platform = new MyGUI::OgrePlatform();
75 mygui_platform->initialise(
76 App::GetAppContext()->GetRenderWindow(),
77 App::GetGfxScene()->GetSceneManager(),
78 Ogre::ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME,
79 mygui_logpath);
80 auto mygui = new MyGUI::Gui();
81
82 // empty init
83 mygui->initialise("");
84
85 // add layer factory
86 MyGUI::FactoryManager::getInstance().registerFactory<RTTLayer>("Layer");
87
88 // then load the actual config
89 MyGUI::ResourceManager::getInstance().load(RESOURCE_FILENAME);
90
91 MyGUI::ResourceManager::getInstance().load("MyGUI_FontsEnglish.xml");
92
93 m_mygui_platform = mygui_platform;
94 m_mygui = mygui;
95 MyGUI::PointerManager::getInstance().setVisible(false); // RoR is using mouse cursor drawn by DearIMGUI.
96
97#ifdef _WIN32
98 MyGUI::LanguageManager::getInstance().eventRequestTag = MyGUI::newDelegate(this, &GUIManager::eventRequestTag);
99#endif // _WIN32
100
101 this->SetupImGui();
102
103 // Configure the chatbox console view
105}
106
110
112{
113 if (m_mygui)
114 {
115 m_mygui->shutdown();
116 delete m_mygui;
117 m_mygui = nullptr;
118 }
119
121 {
122 m_mygui_platform->shutdown();
123 delete m_mygui_platform;
124 m_mygui_platform = nullptr;
125 }
126}
127
132
134{
135 return (App::GetCameraManager()->GetCurrentBehavior() != CameraManager::CAMERA_BEHAVIOR_FREE &&
136 !this->ConsoleWindow.IsHovered() &&
137 !this->GameControls.IsHovered() &&
138 !this->FrictionSettings.IsHovered() &&
139 !this->TextureToolWindow.IsHovered() &&
140 !this->NodeBeamUtils.IsHovered() &&
141 !this->CollisionsDebug.IsHovered() &&
142 !this->MainSelector.IsHovered() &&
143 !this->SurveyMap.IsHovered() &&
144 !this->FlexbodyDebug.IsHovered());
145}
146
148{
149 const int preset = App::ui_preset->getInt();
150 int i = 0;
151 while (UiPresets[i].uip_cvar != nullptr)
152 {
154 UiPresets[i].uip_cvar,
155 UiPresets[i].uip_values[preset]);
156 i++;
157 }
158}
159
161{
162 if (App::app_state->getEnum<AppState>() == AppState::SIMULATION)
163 {
164 this->TopMenubar.Draw(dt);
165
166 if (this->GameMainMenu.IsVisible())
167 {
168 this->GameMainMenu.Draw();
169 }
170 }
171
172 if (this->NodeBeamUtils.IsVisible())
173 {
174 this->NodeBeamUtils.Draw();
175 }
176
177 if (this->CollisionsDebug.IsVisible())
178 {
179 this->CollisionsDebug.Draw();
180 }
181
182 if (this->MessageBoxDialog.IsVisible())
183 {
184 this->MessageBoxDialog.Draw();
185 }
186
187 if (this->FlexbodyDebug.IsVisible())
188 {
189 this->FlexbodyDebug.Draw();
190 }
191
192
193};
194
196{
197 this->DrawCommonGui();
198
199 if (player_gfx_actor && !this->GameMainMenu.IsVisible())
200 {
201 this->VehicleInfoTPanel.Draw(player_gfx_actor);
202 }
203
204 if (!this->ConsoleWindow.IsVisible())
205 {
206 if (!App::ui_hide_gui->getBool())
207 {
208 this->ChatBox.Draw(); // Messages must be always visible
209 }
210 }
211
212 if (this->LoadingWindow.IsVisible())
213 {
214 this->LoadingWindow.Draw();
215 }
216
217 if (this->FrictionSettings.IsVisible())
218 {
219 this->FrictionSettings.Draw();
220 }
221
222 if (this->SimPerfStats.IsVisible())
223 {
224 this->SimPerfStats.Draw();
225 }
226
227 if (this->TextureToolWindow.IsVisible())
228 {
229 this->TextureToolWindow.Draw();
230 }
231
232 if (this->SurveyMap.IsVisible())
233 {
234 this->SurveyMap.Draw();
235 }
236
237 this->DirectionArrow.Update(player_gfx_actor);
238}
239
240void GUIManager::eventRequestTag(const MyGUI::UString& _tag, MyGUI::UString& _result)
241{
242 _result = MyGUI::LanguageManager::getInstance().getTag(_tag);
243}
244
246{
247 // Determine image filename
248 using namespace Ogre;
249 FileInfoListPtr files = ResourceGroupManager::getSingleton().findResourceFileInfo("Wallpapers", "*.jpg", false);
250 if (!files || files->empty())
251 {
252 files = ResourceGroupManager::getSingleton().findResourceFileInfo("Wallpapers", "*.png", false);
253 }
254 srand ( time(NULL) );
255
256 int num = 0;
257 for (int i = 0; i<Math::RangeRandom(0, 10); i++)
258 num = Math::RangeRandom(0, files->size());
259
260 // Set up wallpaper
261 // ...texture...
262 Ogre::ResourceManager::ResourceCreateOrRetrieveResult wp_tex_result
263 = Ogre::TextureManager::getSingleton().createOrRetrieve(files->at(num).filename, "Wallpapers");
264 Ogre::TexturePtr wp_tex = Ogre::static_pointer_cast<Ogre::Texture>(wp_tex_result.first);
265 // ...material...
266 Ogre::MaterialPtr wp_mat = Ogre::MaterialManager::getSingleton().create("rigsofrods/WallpaperMat", Ogre::RGN_DEFAULT);
267 Ogre::TextureUnitState* wp_tus = wp_mat->getTechnique(0)->getPass(0)->createTextureUnitState();
268 wp_tus->setTexture(wp_tex);
269 wp_mat->compile();
270 // ...panel...
271 Ogre::OverlayElement* wp_panel = Ogre::OverlayManager::getSingleton()
272 .createOverlayElement("Panel", "rigsofrods/WallpaperPanel", /*isTemplate=*/false);
273 wp_panel->setMaterial(wp_mat);
274 wp_panel->setDimensions(1.f, 1.f);
275 // ...overlay...
276 this->MenuWallpaper = Ogre::OverlayManager::getSingleton().create("rigsofrods/WallpaperOverlay");
277 this->MenuWallpaper->add2D(static_cast<Ogre::OverlayContainer*>(wp_panel)); // 'Panel' inherits from 'Container'
278 this->MenuWallpaper->setZOrder(0);
279 this->MenuWallpaper->show();
280}
281
282void GUIManager::SetSceneManagerForGuiRendering(Ogre::SceneManager* scene_manager)
283{
284 m_mygui_platform->getRenderManagerPtr()->setSceneManager(scene_manager);
285}
286
288{
289 App::ui_hide_gui->setVal(hidden);
291 if (hidden)
292 {
293 this->SimPerfStats.SetVisible(false);
294 this->ChatBox.SetVisible(false);
295 }
296}
297
299{
300 switch (visi)
301 {
303 ImGui::GetIO().MouseDrawCursor = true;
304 this->SupressCursor(false);
305 return;
306
308 ImGui::GetIO().MouseDrawCursor = false;
309 return;
310
312 ImGui::GetIO().MouseDrawCursor = false;
313 this->SupressCursor(true);
314 return;
315 }
316}
317
325
327{
328 ImGuiIO& io = ImGui::GetIO();
329 OIS::Keyboard* kb = App::GetInputEngine()->GetOisKeyboard();
330
331 // Read keyboard modifiers inputs
332 io.KeyCtrl = kb->isKeyDown(OIS::KC_LCONTROL);
333 io.KeyShift = kb->isKeyDown(OIS::KC_LSHIFT);
334 io.KeyAlt = kb->isKeyDown(OIS::KC_LMENU);
335 io.KeySuper = false;
336
337 // Call IMGUI
338 Ogre::FrameEvent ev;
339 ev.timeSinceLastFrame = dt;
341
342 // Reset state
344}
345
347{
349 this->ApplyImGuiStyle();
351 App::GetGfxScene()->GetSceneManager()->addRenderQueueListener(&m_imgui);
352}
353
355{
357 this->ApplyImGuiStyle();
358
359 // Resize imgui windows using <imgui_internal.h>
360 float resize_ratio = this->GetUiScaleFactor() / m_active_ui_scale_factor;
362 for (ImGuiWindow* window: ImGui::GetCurrentContext()->Windows)
363 {
364 if (!(window->Flags & ImGuiWindowFlags_AlwaysAutoResize) && !(window->Flags & ImGuiWindowFlags_ChildWindow))
365 {
366 const ImVec2 oldsize = window->SizeFull;
367 ImGui::SetWindowSize(window, ImVec2(oldsize.x * resize_ratio, oldsize.y * resize_ratio));
368 }
369 }
370}
371
373{
374 return Ogre::Math::Clamp(App::ui_scale_factor->getFloat(), UI_SCALE_FACTOR_MIN, UI_SCALE_FACTOR_MAX);
375}
376
378{
379 ImGuiStyle& style = ImGui::GetStyle();
380 style = ImGuiStyle(); // Reset sizes, so that scaling isn't applied repeatedly
381 // Colors
382 style.Colors[ImGuiCol_Text] = ImVec4(0.90f, 0.90f, 0.90f, 1.00f);
383 style.Colors[ImGuiCol_TextDisabled] = ImVec4(0.60f, 0.60f, 0.60f, 1.00f);
384 style.Colors[ImGuiCol_WindowBg] = ImVec4(0.06f, 0.06f, 0.06f, 0.90f);
385 style.Colors[ImGuiCol_ChildWindowBg] = ImVec4(0.00f, 0.00f, 0.00f, 0.1f);
386 style.Colors[ImGuiCol_PopupBg] = ImVec4(0.05f, 0.05f, 0.10f, 0.90f);
387 style.Colors[ImGuiCol_Border] = ImVec4(0.20f, 0.20f, 0.20f, 0.90f);
388 style.Colors[ImGuiCol_BorderShadow] = ImVec4(0.00f, 0.00f, 0.00f, 0.90f);
389 style.Colors[ImGuiCol_FrameBg] = ImVec4(0.20f, 0.20f, 0.20f, 0.90f);
390 style.Colors[ImGuiCol_FrameBgHovered] = ImVec4(0.13f, 0.40f, 0.60f, 0.90f);
391 style.Colors[ImGuiCol_FrameBgActive] = ImVec4(0.18f, 0.53f, 0.79f, 0.90f);
392 style.Colors[ImGuiCol_TitleBg] = ImVec4(0.11f, 0.33f, 0.49f, 1.00f);
393 style.Colors[ImGuiCol_TitleBgCollapsed] = ImVec4(0.13f, 0.40f, 0.60f, 1.00f);
394 style.Colors[ImGuiCol_TitleBgActive] = ImVec4(0.13f, 0.40f, 0.60f, 1.00f);
395 style.Colors[ImGuiCol_MenuBarBg] = ImVec4(0.20f, 0.20f, 0.20f, 0.90f);
396 style.Colors[ImGuiCol_ScrollbarBg] = ImVec4(0.16f, 0.16f, 0.16f, 0.90f);
397 style.Colors[ImGuiCol_ScrollbarGrab] = ImVec4(0.30f, 0.30f, 0.29f, 0.90f);
398 style.Colors[ImGuiCol_ScrollbarGrabHovered] = ImVec4(0.13f, 0.40f, 0.60f, 0.90f);
399 style.Colors[ImGuiCol_ScrollbarGrabActive] = ImVec4(0.18f, 0.53f, 0.79f, 0.90f);
400 style.Colors[ImGuiCol_CheckMark] = ImVec4(0.90f, 0.90f, 0.90f, 0.90f);
401 style.Colors[ImGuiCol_SliderGrab] = ImVec4(0.39f, 0.39f, 0.39f, 0.90f);
402 style.Colors[ImGuiCol_SliderGrabActive] = ImVec4(0.18f, 0.53f, 0.79f, 0.90f);
403 style.Colors[ImGuiCol_Button] = ImVec4(0.26f, 0.26f, 0.25f, 0.90f);
404 style.Colors[ImGuiCol_ButtonHovered] = ImVec4(0.13f, 0.40f, 0.60f, 0.90f);
405 style.Colors[ImGuiCol_ButtonActive] = ImVec4(0.18f, 0.53f, 0.79f, 0.90f);
406 style.Colors[ImGuiCol_Header] = ImVec4(0.20f, 0.20f, 0.20f, 0.90f);
407 style.Colors[ImGuiCol_HeaderHovered] = ImVec4(0.13f, 0.40f, 0.60f, 0.90f);
408 style.Colors[ImGuiCol_HeaderActive] = ImVec4(0.18f, 0.53f, 0.79f, 0.90f);
409 style.Colors[ImGuiCol_ResizeGrip] = ImVec4(0.22f, 0.22f, 0.21f, 0.90f);
410 style.Colors[ImGuiCol_ResizeGripHovered] = ImVec4(0.13f, 0.40f, 0.60f, 0.90f);
411 style.Colors[ImGuiCol_ResizeGripActive] = ImVec4(0.18f, 0.53f, 0.79f, 0.90f);
412 style.Colors[ImGuiCol_PlotLines] = ImVec4(1.00f, 1.00f, 1.00f, 0.90f);
413 style.Colors[ImGuiCol_PlotLinesHovered] = ImVec4(0.13f, 0.40f, 0.60f, 0.90f);
414 style.Colors[ImGuiCol_PlotHistogram] = ImVec4(0.18f, 0.53f, 0.79f, 0.90f);
415 style.Colors[ImGuiCol_PlotHistogramHovered] = ImVec4(0.13f, 0.40f, 0.60f, 0.90f);
416 style.Colors[ImGuiCol_TextSelectedBg] = ImVec4(0.00f, 0.00f, 1.00f, 0.90f);
417 style.Colors[ImGuiCol_ModalWindowDarkening] = ImVec4(0.20f, 0.20f, 0.20f, 0.90f);
418 // Styles
419 style.WindowPadding = ImVec2(10.f, 10.f);
420 style.FrameRounding = 2.f;
421 style.WindowRounding = 4.f;
422 style.WindowTitleAlign = ImVec2(0.5f, 0.5f);
423 style.ItemSpacing = ImVec2(5.f, 5.f);
424 style.GrabRounding = 3.f;
425 style.WindowBorderSize = 0.f;
426 // Scaling
427 style.ScaleAllSizes(this->GetUiScaleFactor());
428
429 // Theme sizes (relative to font size)
430 const float font_size = ImGui::GetIO().Fonts->Fonts[0]->FontSize;
431 m_theme.screen_edge_padding = ImVec2(0.625f, 0.625f) * font_size;
432 m_theme.semitrans_text_bg_padding = ImVec2(0.25f, 0.125f) * font_size;
434}
435
437{
438 // UI usable in both main menu and simulation
439 // ------------------------------------------
440
441 if ((App::mp_state->getEnum<MpState>() == MpState::CONNECTED || App::mp_state->getEnum<MpState>() == MpState::LOCAL_SCRIPT)
442 && !App::ui_hide_gui->getBool()
443 && !this->SurveyMap.IsVisible())
444 {
445 this->MpClientList.Draw();
446 }
447
448 if (this->MainSelector.IsVisible())
449 {
450 this->MainSelector.Draw();
451 }
452
453 if (this->ConsoleWindow.IsVisible())
454 {
455 this->ConsoleWindow.Draw();
456 }
457
458 if (this->GameControls.IsVisible())
459 {
460 this->GameControls.Draw();
461 }
462
463 if (this->RepositorySelector.IsVisible())
464 {
465 this->RepositorySelector.Draw();
466 }
467}
468
470{
471 this->DrawCommonGui();
472
473 if (this->MultiplayerSelector.IsVisible())
474 {
476 }
477
478 if (this->GameMainMenu.IsVisible())
479 {
480 this->GameMainMenu.Draw();
481 }
482
483 if (this->GameSettings.IsVisible())
484 {
485 this->GameSettings.Draw();
486 }
487
488 if (this->MessageBoxDialog.IsVisible())
489 {
490 this->MessageBoxDialog.Draw();
491 }
492
493 if (this->LoadingWindow.IsVisible())
494 {
495 this->LoadingWindow.Draw();
496 }
497
498 if (this->GameAbout.IsVisible())
499 {
500 this->GameAbout.Draw();
501 }
502}
503
504void GUIManager::ShowMessageBox(const char* title, const char* text, bool allow_close, const char* btn1_text, const char* btn2_text)
505{
506 this->MessageBoxDialog.Show(title, text, allow_close, btn1_text, btn2_text);
507}
508
510{
511 this->MessageBoxDialog.Show(conf);
512}
513
518
527
528void GUIManager::SupressCursor(bool do_supress)
529{
530 m_is_cursor_supressed = do_supress;
531}
532
534{
535 // EV_COMMON_CONSOLE_TOGGLE - display console GUI (anytime)
536 if (App::GetInputEngine()->getEventBoolValueBounce(EV_COMMON_CONSOLE_TOGGLE))
537 {
539 }
540
541 if (App::app_state->getEnum<AppState>() == AppState::SIMULATION)
542 {
543 // EV_COMMON_HIDE_GUI
544 if (App::GetInputEngine()->getEventBoolValueBounce(EV_COMMON_HIDE_GUI))
545 {
546 this->SetGuiHidden(!this->IsGuiHidden());
547 }
548
549 // EV_COMMON_ENTER_CHATMODE
550 if (App::GetInputEngine()->getEventBoolValueBounce(EV_COMMON_ENTER_CHATMODE, 0.5f) &&
551 (App::mp_state->getEnum<MpState>() == MpState::CONNECTED || App::mp_state->getEnum<MpState>() == MpState::LOCAL_SCRIPT))
552 {
553 this->ChatBox.SetVisible(!this->ChatBox.IsVisible());
554 }
555
556 // EV_COMMON_TRUCK_INFO - Vehicle info side-panel (aka The T-Screen)
557 if (App::GetInputEngine()->getEventBoolValueBounce(EV_COMMON_TRUCK_INFO) && App::GetGameContext()->GetPlayerActor())
558 {
560 {
562 }
563 else
564 {
566 }
567 }
568
569 // EV_COMMON_TRUCK_DESCRIPTION - The T-screen with commands
570 if (App::GetInputEngine()->getEventBoolValueBounce(EV_COMMON_TRUCK_DESCRIPTION) && App::GetGameContext()->GetPlayerActor())
571 {
573 {
575 }
576 else
577 {
579 }
580 }
581
582 // EV_COMMON_TOGGLE_DASHBOARD
583 if (App::GetInputEngine()->getEventBoolValueBounce(EV_COMMON_TOGGLE_DASHBOARD))
584 {
586 }
587
588 // EV_COMMON_TOGGLE_STATS - FPS, draw batch count etc...
589 if (App::GetInputEngine()->getEventBoolValueBounce(EV_COMMON_TOGGLE_STATS))
590 {
592 }
593
594 if (App::GetCameraManager()->GetCurrentBehavior() != CameraManager::CAMERA_BEHAVIOR_FREE)
595 {
596 // EV_SURVEY_MAP_CYCLE
597 if (App::GetInputEngine()->getEventBoolValueBounce(EV_SURVEY_MAP_CYCLE))
598 {
599 this->SurveyMap.CycleMode();
600 }
601
602 // EV_SURVEY_MAP_TOGGLE
603 if (App::GetInputEngine()->getEventBoolValueBounce(EV_SURVEY_MAP_TOGGLE))
604 {
605 this->SurveyMap.ToggleMode();
606 }
607 }
608 }
609}
System integration layer; inspired by OgreBites::ApplicationContext.
#define RESOURCE_FILENAME
Game state manager and message-queue provider.
Manager for all visuals belonging to a single actor.
Handles controller inputs from player.
Platform-specific utilities. We use narrow UTF-8 encoded strings as paths. Inspired by http://utf8eve...
static void NewFrame(const FrameEvent &evt)
void Init(float font_scale)
Definition OgreImGui.cpp:38
void ReloadFonts(float font_scale)
Must not be called while an ImGui frame is in progress.
Definition OgreImGui.cpp:88
void setVal(T val)
Definition CVar.h:72
int getInt() const
Definition CVar.h:97
CVar * cVarSet(std::string const &input_name, std::string const &input_val)
Set existing cvar by short/long name. Return the modified cvar (or NULL if not found)
Definition CVar.cpp:293
void SetVisible(bool visible)
void Update(RoR::GfxActor *player)
bool IsVisible() const
ConsoleView & GetConsoleView()
void Show(MessageBoxConfig const &cfg)
bool IsVisible() const
void SetVisible(TPanelMode mode, TPanelFocus focus=TPANELFOCUS_NONE)
bool IsVisible(TPanelFocus focus=TPANELFOCUS_NONE) const
void Draw(RoR::GfxActor *actorx)
void NewImGuiFrame(float dt)
MyGUI::OgrePlatform * m_mygui_platform
Definition GUIManager.h:185
GUI::RepositorySelector RepositorySelector
Definition GUIManager.h:131
GUI::TextureToolWindow TextureToolWindow
Definition GUIManager.h:129
bool IsGuiHidden() const
Definition GUIManager.h:159
GUI::SimPerfStats SimPerfStats
Definition GUIManager.h:122
@ HIDDEN
Hidden as inactive, will re-appear the moment user moves mouse.
@ VISIBLE
Visible, will be auto-hidden if not moving for a while.
@ SUPRESSED
Hidden manually, will not re-appear until explicitly set VISIBLE.
bool m_gui_kb_capture_queued
Resets and accumulates every frame.
Definition GUIManager.h:189
void SetGuiHidden(bool visible)
void UpdateInputEvents(float dt)
Ogre::Timer m_last_mousemove_time
Definition GUIManager.h:191
GUI::MultiplayerSelector MultiplayerSelector
Definition GUIManager.h:124
GUI::GameAbout GameAbout
Definition GUIManager.h:119
void SetSceneManagerForGuiRendering(Ogre::SceneManager *scene_manager)
GUI::MainSelector MainSelector
Definition GUIManager.h:125
GUI::GameSettings GameSettings
Definition GUIManager.h:120
GUI::VehicleInfoTPanel VehicleInfoTPanel
Definition GUIManager.h:121
GUI::GameChatBox ChatBox
Definition GUIManager.h:126
void SetUpMenuWallpaper()
GUI::TopMenubar TopMenubar
Definition GUIManager.h:134
void ApplyGuiCaptureKeyboard()
Call after rendered frame to apply queued value.
OgreImGui m_imgui
Definition GUIManager.h:186
void UpdateMouseCursorVisibility()
void DrawSimGuiBuffered(GfxActor *player_gfx_actor)
Reads data from simbuffer.
bool m_is_cursor_supressed
True if cursor was manually hidden.
Definition GUIManager.h:192
void ApplyUiPreset()
reads cvar 'ui_preset'
void ShowMessageBox(const char *title, const char *text, bool allow_close=true, const char *btn1_text="OK", const char *btn2_text=nullptr)
Ogre::Overlay * MenuWallpaper
Definition GUIManager.h:139
GUI::FrictionSettings FrictionSettings
Definition GUIManager.h:128
void DrawSimulationGui(float dt)
Touches live data; must be called in sync with sim. thread.
GUI::CollisionsDebug CollisionsDebug
Definition GUIManager.h:117
void RequestGuiCaptureKeyboard(bool val)
Pass true during frame to prevent input passing to application.
GUI::LoadingWindow LoadingWindow
Definition GUIManager.h:133
GUI::GameControls GameControls
Definition GUIManager.h:130
GUI::MpClientList MpClientList
Definition GUIManager.h:127
void ApplyImGuiStyle()
Resets style to defaults, applies RoR theme and scales by 'ui_scale_factor'.
void ReinitUI()
Reloads fonts and re-applies style; reads cvar 'ui_scale_factor'. Must be called outside ImGui frame ...
bool AreStaticMenusAllowed()
i.e. top menubar / vehicle UI buttons
GUI::SurveyMap SurveyMap
Definition GUIManager.h:136
GUI::GameMainMenu GameMainMenu
Definition GUIManager.h:118
bool m_gui_kb_capture_requested
Effective value, persistent.
Definition GUIManager.h:190
GUI::DirectionArrow DirectionArrow
Definition GUIManager.h:137
void eventRequestTag(const MyGUI::UString &_tag, MyGUI::UString &_result)
void SetMouseCursorVisibility(MouseCursorVisibility visi)
GuiTheme m_theme
Definition GUIManager.h:187
float GetUiScaleFactor() const
Reads cvar 'ui_scale_factor', clamped to sane range.
GUI::NodeBeamUtils NodeBeamUtils
Definition GUIManager.h:132
GUI::ConsoleWindow ConsoleWindow
Definition GUIManager.h:135
GUI::MessageBoxDialog MessageBoxDialog
Definition GUIManager.h:123
MyGUI::Gui * m_mygui
Definition GUIManager.h:184
GUI::FlexbodyDebug FlexbodyDebug
Definition GUIManager.h:138
float m_active_ui_scale_factor
Last applied value of cvar 'ui_scale_factor', clamped to sane range.
Definition GUIManager.h:193
void SupressCursor(bool do_supress)
Ogre::SceneManager * GetSceneManager()
Definition GfxScene.h:83
OIS::Keyboard * GetOisKeyboard()
void showDashboardOverlays(bool show, ActorPtr actor)
void ToggleDashboardOverlays(ActorPtr actor)
RTT texture 'slot' within MyGUI system; we can only create them, not destroy, so we reuse.
Definition RTTLayer.h:13
std::string PathCombine(std::string a, std::string b)
@ LOCAL_SCRIPT
Not actually connected to network, but running server script locally.
@ EV_COMMON_ENTER_CHATMODE
enter the chat mode
@ EV_SURVEY_MAP_CYCLE
cycle overview-map mode
@ EV_COMMON_CONSOLE_TOGGLE
show / hide the console
@ EV_COMMON_TRUCK_INFO
toggle truck HUD
@ EV_COMMON_HIDE_GUI
hide all GUI elements
@ EV_COMMON_TOGGLE_DASHBOARD
display or hide the dashboard overlay
@ EV_COMMON_TOGGLE_STATS
toggle Ogre statistics (FPS etc.)
@ EV_COMMON_TRUCK_DESCRIPTION
toggle truck description
@ EV_SURVEY_MAP_TOGGLE
toggle overview-map mode
AppContext * GetAppContext()
OverlayWrapper * GetOverlayWrapper()
InputEngine * GetInputEngine()
CVar * sys_logs_dir
CVar * ui_preset
enum RoR::UiPreset
CameraManager * GetCameraManager()
CVar * ui_scale_factor
float; Resizes imgui-based UI (fonts + style sizes); apply by pushing MSG_APP_REINIT_UI_REQUESTED.
GameContext * GetGameContext()
CVar * ui_hide_gui
bool; The 'hide GUI' hotkey state
GfxScene * GetGfxScene()
CVar * app_state
CVar * mp_state
Console * GetConsole()
CVar * diag_use_mygui_logfile
static const float UI_SCALE_FACTOR_MAX
static const float UI_SCALE_FACTOR_MIN
UiPresetEntry UiPresets[]
Global list of UI Presets, selectable via Settings menu in TopMenubar.
ImVec4 cvw_background_color
Text-background color.
ImVec2 semitrans_text_bg_padding
Set by ApplyImGuiStyle() relative to font size.
Definition GUIManager.h:98
ImVec2 screen_edge_padding
Set by ApplyImGuiStyle() relative to font size.
Definition GUIManager.h:97
Definition GUIManager.h:68