RigsofRods
Soft-body Physics Simulation
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 #define RESOURCE_FILENAME "MyGUI_Core.xml"
49 
50 using namespace RoR;
51 
54 {
55  // Cvar name | NOVICE, REGULAR, EXPERT, MINIMALLIST
56  { "gfx_surveymap_icons", {"true", "true", "true", "false"} },
57  { "gfx_declutter_map", {"false", "true", "false", "true"} },
58  { "ui_show_live_repair_controls", {"true", "false", "false", "false"} },
59 
60  // List closure
61  { nullptr, {} }
62 };
63 
65 {
66  std::string gui_logpath = PathCombine(App::sys_logs_dir->getStr(), "MyGUI.log");
67  auto mygui_platform = new MyGUI::OgrePlatform();
68  mygui_platform->initialise(
69  App::GetAppContext()->GetRenderWindow(),
70  App::GetGfxScene()->GetSceneManager(),
71  Ogre::ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME,
72  gui_logpath); // use cache resource group so preview images are working
73  auto mygui = new MyGUI::Gui();
74 
75  // empty init
76  mygui->initialise("");
77 
78  // add layer factory
79  MyGUI::FactoryManager::getInstance().registerFactory<MyGUI::RTTLayer>("Layer");
80 
81  // then load the actual config
82  MyGUI::ResourceManager::getInstance().load(RESOURCE_FILENAME);
83 
84  MyGUI::ResourceManager::getInstance().load("MyGUI_FontsEnglish.xml");
85 
86  m_mygui_platform = mygui_platform;
87  m_mygui = mygui;
88  MyGUI::PointerManager::getInstance().setVisible(false); // RoR is using mouse cursor drawn by DearIMGUI.
89 
90 #ifdef _WIN32
91  MyGUI::LanguageManager::getInstance().eventRequestTag = MyGUI::newDelegate(this, &GUIManager::eventRequestTag);
92 #endif // _WIN32
93 
94  this->SetupImGui();
95 
96  // Configure the chatbox console view
99 }
100 
102 {
103 }
104 
106 {
107  if (m_mygui)
108  {
109  m_mygui->shutdown();
110  delete m_mygui;
111  m_mygui = nullptr;
112  }
113 
114  if (m_mygui_platform)
115  {
116  m_mygui_platform->shutdown();
117  delete m_mygui_platform;
118  m_mygui_platform = nullptr;
119  }
120 }
121 
123 {
125 };
126 
128 {
129  return (App::GetCameraManager()->GetCurrentBehavior() != CameraManager::CAMERA_BEHAVIOR_FREE &&
130  !this->ConsoleWindow.IsHovered() &&
131  !this->GameControls.IsHovered() &&
132  !this->FrictionSettings.IsHovered() &&
133  !this->TextureToolWindow.IsHovered() &&
134  !this->NodeBeamUtils.IsHovered() &&
135  !this->CollisionsDebug.IsHovered() &&
136  !this->MainSelector.IsHovered() &&
137  !this->SurveyMap.IsHovered() &&
138  !this->FlexbodyDebug.IsHovered());
139 }
140 
142 {
143  const int preset = App::ui_preset->getInt();
144  int i = 0;
145  while (UiPresets[i].uip_cvar != nullptr)
146  {
148  UiPresets[i].uip_cvar,
149  UiPresets[i].uip_values[preset]);
150  i++;
151  }
152 }
153 
155 {
156  if (App::app_state->getEnum<AppState>() == AppState::SIMULATION)
157  {
158  this->TopMenubar.Draw(dt);
159 
160  if (this->GameMainMenu.IsVisible())
161  {
162  this->GameMainMenu.Draw();
163  }
164  }
165 
166  if (this->NodeBeamUtils.IsVisible())
167  {
168  this->NodeBeamUtils.Draw();
169  }
170 
171  if (this->CollisionsDebug.IsVisible())
172  {
173  this->CollisionsDebug.Draw();
174  }
175 
176  if (this->MessageBoxDialog.IsVisible())
177  {
178  this->MessageBoxDialog.Draw();
179  }
180 
181  if (this->FlexbodyDebug.IsVisible())
182  {
183  this->FlexbodyDebug.Draw();
184  }
185 };
186 
188 {
189  this->DrawCommonGui();
190 
191  if (player_gfx_actor && !this->GameMainMenu.IsVisible())
192  {
193  this->VehicleInfoTPanel.Draw(player_gfx_actor);
194  }
195 
196  if (!this->ConsoleWindow.IsVisible())
197  {
198  if (!App::ui_hide_gui->getBool())
199  {
200  this->ChatBox.Draw(); // Messages must be always visible
201  }
202  }
203 
204  if (this->LoadingWindow.IsVisible())
205  {
206  this->LoadingWindow.Draw();
207  }
208 
209  if (this->FrictionSettings.IsVisible())
210  {
211  this->FrictionSettings.Draw();
212  }
213 
214  if (this->SimPerfStats.IsVisible())
215  {
216  this->SimPerfStats.Draw();
217  }
218 
219  if (this->TextureToolWindow.IsVisible())
220  {
221  this->TextureToolWindow.Draw();
222  }
223 
224  if (this->SurveyMap.IsVisible())
225  {
226  this->SurveyMap.Draw();
227  }
228 
229  this->DirectionArrow.Update(player_gfx_actor);
230 }
231 
232 void GUIManager::eventRequestTag(const MyGUI::UString& _tag, MyGUI::UString& _result)
233 {
234  _result = MyGUI::LanguageManager::getInstance().getTag(_tag);
235 }
236 
238 {
239  // Determine image filename
240  using namespace Ogre;
241  FileInfoListPtr files = ResourceGroupManager::getSingleton().findResourceFileInfo("Wallpapers", "*.jpg", false);
242  if (files.isNull() || files->empty())
243  {
244  files = ResourceGroupManager::getSingleton().findResourceFileInfo("Wallpapers", "*.png", false);
245  }
246  srand ( time(NULL) );
247 
248  int num = 0;
249  for (int i = 0; i<Math::RangeRandom(0, 10); i++)
250  num = Math::RangeRandom(0, files->size());
251 
252  // Set up wallpaper
253  // ...texture...
254  Ogre::ResourceManager::ResourceCreateOrRetrieveResult wp_tex_result
255  = Ogre::TextureManager::getSingleton().createOrRetrieve(files->at(num).filename, "Wallpapers");
256  Ogre::TexturePtr wp_tex = wp_tex_result.first.staticCast<Ogre::Texture>();
257  // ...material...
258  Ogre::MaterialPtr wp_mat = Ogre::MaterialManager::getSingleton().create("rigsofrods/WallpaperMat", Ogre::RGN_DEFAULT);
259  Ogre::TextureUnitState* wp_tus = wp_mat->getTechnique(0)->getPass(0)->createTextureUnitState();
260  wp_tus->setTexture(wp_tex);
261  wp_mat->compile();
262  // ...panel...
263  Ogre::OverlayElement* wp_panel = Ogre::OverlayManager::getSingleton()
264  .createOverlayElement("Panel", "rigsofrods/WallpaperPanel", /*isTemplate=*/false);
265  wp_panel->setMaterial(wp_mat);
266  wp_panel->setDimensions(1.f, 1.f);
267  // ...overlay...
268  this->MenuWallpaper = Ogre::OverlayManager::getSingleton().create("rigsofrods/WallpaperOverlay");
269  this->MenuWallpaper->add2D(static_cast<Ogre::OverlayContainer*>(wp_panel)); // 'Panel' inherits from 'Container'
270  this->MenuWallpaper->setZOrder(0);
271  this->MenuWallpaper->show();
272 }
273 
274 void GUIManager::SetSceneManagerForGuiRendering(Ogre::SceneManager* scene_manager)
275 {
276  m_mygui_platform->getRenderManagerPtr()->setSceneManager(scene_manager);
277 }
278 
279 void GUIManager::SetGuiHidden(bool hidden)
280 {
281  App::ui_hide_gui->setVal(hidden);
282  App::GetOverlayWrapper()->showDashboardOverlays(!hidden, App::GetGameContext()->GetPlayerActor());
283  if (hidden)
284  {
285  this->SimPerfStats.SetVisible(false);
286  this->ChatBox.SetVisible(false);
287  }
288 }
289 
291 {
292  switch (visi)
293  {
295  ImGui::GetIO().MouseDrawCursor = true;
296  this->SupressCursor(false);
297  return;
298 
300  ImGui::GetIO().MouseDrawCursor = false;
301  return;
302 
304  ImGui::GetIO().MouseDrawCursor = false;
305  this->SupressCursor(true);
306  return;
307  }
308 }
309 
311 {
312  if (m_last_mousemove_time.getMilliseconds() > 5000)
313  {
315  }
316 }
317 
319 {
320  ImGuiIO& io = ImGui::GetIO();
321  OIS::Keyboard* kb = App::GetInputEngine()->GetOisKeyboard();
322 
323  // Read keyboard modifiers inputs
324  io.KeyCtrl = kb->isKeyDown(OIS::KC_LCONTROL);
325  io.KeyShift = kb->isKeyDown(OIS::KC_LSHIFT);
326  io.KeyAlt = kb->isKeyDown(OIS::KC_LMENU);
327  io.KeySuper = false;
328 
329  // Call IMGUI
330  Ogre::FrameEvent ev;
331  ev.timeSinceLastFrame = dt;
333 
334  // Reset state
335  m_gui_kb_capture_queued = false;
336 }
337 
339 {
340  m_imgui.Init();
341  // Colors
342  ImGuiStyle& style = ImGui::GetStyle();
343  style.Colors[ImGuiCol_Text] = ImVec4(0.90f, 0.90f, 0.90f, 1.00f);
344  style.Colors[ImGuiCol_TextDisabled] = ImVec4(0.60f, 0.60f, 0.60f, 1.00f);
345  style.Colors[ImGuiCol_WindowBg] = ImVec4(0.06f, 0.06f, 0.06f, 0.90f);
346  style.Colors[ImGuiCol_ChildWindowBg] = ImVec4(0.00f, 0.00f, 0.00f, 0.1f);
347  style.Colors[ImGuiCol_PopupBg] = ImVec4(0.05f, 0.05f, 0.10f, 0.90f);
348  style.Colors[ImGuiCol_Border] = ImVec4(0.20f, 0.20f, 0.20f, 0.90f);
349  style.Colors[ImGuiCol_BorderShadow] = ImVec4(0.00f, 0.00f, 0.00f, 0.90f);
350  style.Colors[ImGuiCol_FrameBg] = ImVec4(0.20f, 0.20f, 0.20f, 0.90f);
351  style.Colors[ImGuiCol_FrameBgHovered] = ImVec4(0.13f, 0.40f, 0.60f, 0.90f);
352  style.Colors[ImGuiCol_FrameBgActive] = ImVec4(0.18f, 0.53f, 0.79f, 0.90f);
353  style.Colors[ImGuiCol_TitleBg] = ImVec4(0.11f, 0.33f, 0.49f, 1.00f);
354  style.Colors[ImGuiCol_TitleBgCollapsed] = ImVec4(0.13f, 0.40f, 0.60f, 1.00f);
355  style.Colors[ImGuiCol_TitleBgActive] = ImVec4(0.13f, 0.40f, 0.60f, 1.00f);
356  style.Colors[ImGuiCol_MenuBarBg] = ImVec4(0.20f, 0.20f, 0.20f, 0.90f);
357  style.Colors[ImGuiCol_ScrollbarBg] = ImVec4(0.16f, 0.16f, 0.16f, 0.90f);
358  style.Colors[ImGuiCol_ScrollbarGrab] = ImVec4(0.30f, 0.30f, 0.29f, 0.90f);
359  style.Colors[ImGuiCol_ScrollbarGrabHovered] = ImVec4(0.13f, 0.40f, 0.60f, 0.90f);
360  style.Colors[ImGuiCol_ScrollbarGrabActive] = ImVec4(0.18f, 0.53f, 0.79f, 0.90f);
361  style.Colors[ImGuiCol_CheckMark] = ImVec4(0.90f, 0.90f, 0.90f, 0.90f);
362  style.Colors[ImGuiCol_SliderGrab] = ImVec4(0.39f, 0.39f, 0.39f, 0.90f);
363  style.Colors[ImGuiCol_SliderGrabActive] = ImVec4(0.18f, 0.53f, 0.79f, 0.90f);
364  style.Colors[ImGuiCol_Button] = ImVec4(0.26f, 0.26f, 0.25f, 0.90f);
365  style.Colors[ImGuiCol_ButtonHovered] = ImVec4(0.13f, 0.40f, 0.60f, 0.90f);
366  style.Colors[ImGuiCol_ButtonActive] = ImVec4(0.18f, 0.53f, 0.79f, 0.90f);
367  style.Colors[ImGuiCol_Header] = ImVec4(0.20f, 0.20f, 0.20f, 0.90f);
368  style.Colors[ImGuiCol_HeaderHovered] = ImVec4(0.13f, 0.40f, 0.60f, 0.90f);
369  style.Colors[ImGuiCol_HeaderActive] = ImVec4(0.18f, 0.53f, 0.79f, 0.90f);
370  style.Colors[ImGuiCol_ResizeGrip] = ImVec4(0.22f, 0.22f, 0.21f, 0.90f);
371  style.Colors[ImGuiCol_ResizeGripHovered] = ImVec4(0.13f, 0.40f, 0.60f, 0.90f);
372  style.Colors[ImGuiCol_ResizeGripActive] = ImVec4(0.18f, 0.53f, 0.79f, 0.90f);
373  style.Colors[ImGuiCol_PlotLines] = ImVec4(1.00f, 1.00f, 1.00f, 0.90f);
374  style.Colors[ImGuiCol_PlotLinesHovered] = ImVec4(0.13f, 0.40f, 0.60f, 0.90f);
375  style.Colors[ImGuiCol_PlotHistogram] = ImVec4(0.18f, 0.53f, 0.79f, 0.90f);
376  style.Colors[ImGuiCol_PlotHistogramHovered] = ImVec4(0.13f, 0.40f, 0.60f, 0.90f);
377  style.Colors[ImGuiCol_TextSelectedBg] = ImVec4(0.00f, 0.00f, 1.00f, 0.90f);
378  style.Colors[ImGuiCol_ModalWindowDarkening] = ImVec4(0.20f, 0.20f, 0.20f, 0.90f);
379  // Styles
380  style.WindowPadding = ImVec2(10.f, 10.f);
381  style.FrameRounding = 2.f;
382  style.WindowRounding = 4.f;
383  style.WindowTitleAlign = ImVec2(0.5f, 0.5f);
384  style.ItemSpacing = ImVec2(5.f, 5.f);
385  style.GrabRounding = 3.f;
386  style.WindowBorderSize = 0.f;
387 
388  App::GetGfxScene()->GetSceneManager()->addRenderQueueListener(&m_imgui);
389 }
390 
392 {
393  if (App::mp_state->getEnum<MpState>() == MpState::CONNECTED && !App::ui_hide_gui->getBool() && !this->SurveyMap.IsVisible())
394  {
395  this->MpClientList.Draw();
396  }
397 
398  if (this->MainSelector.IsVisible())
399  {
400  this->MainSelector.Draw();
401  }
402 
403  if (this->ConsoleWindow.IsVisible())
404  {
405  this->ConsoleWindow.Draw();
406  }
407 
408  if (this->GameControls.IsVisible())
409  {
410  this->GameControls.Draw();
411  }
412 }
413 
415 {
416  this->DrawCommonGui();
417 
418  if (this->MultiplayerSelector.IsVisible())
419  {
420  this->MultiplayerSelector.Draw();
421  }
422 
423  if (this->GameMainMenu.IsVisible())
424  {
425  this->GameMainMenu.Draw();
426  }
427 
428  if (this->GameSettings.IsVisible())
429  {
430  this->GameSettings.Draw();
431  }
432 
433  if (this->MessageBoxDialog.IsVisible())
434  {
435  this->MessageBoxDialog.Draw();
436  }
437 
438  if (this->LoadingWindow.IsVisible())
439  {
440  this->LoadingWindow.Draw();
441  }
442 
443  if (this->GameAbout.IsVisible())
444  {
445  this->GameAbout.Draw();
446  }
447 
448  if (this->RepositorySelector.IsVisible())
449  {
450  this->RepositorySelector.Draw();
451  }
452 }
453 
454 void GUIManager::ShowMessageBox(const char* title, const char* text, bool allow_close, const char* btn1_text, const char* btn2_text)
455 {
456  this->MessageBoxDialog.Show(title, text, allow_close, btn1_text, btn2_text);
457 }
458 
460 {
461  this->MessageBoxDialog.Show(conf);
462 }
463 
465 {
467 }
468 
470 {
471  m_last_mousemove_time.reset();
473  {
475  }
476 }
477 
478 void GUIManager::SupressCursor(bool do_supress)
479 {
480  m_is_cursor_supressed = do_supress;
481 }
482 
484 {
485  // EV_COMMON_CONSOLE_TOGGLE - display console GUI (anytime)
486  if (App::GetInputEngine()->getEventBoolValueBounce(EV_COMMON_CONSOLE_TOGGLE))
487  {
489  }
490 
491  if (App::app_state->getEnum<AppState>() == AppState::SIMULATION)
492  {
493  // EV_COMMON_HIDE_GUI
494  if (App::GetInputEngine()->getEventBoolValueBounce(EV_COMMON_HIDE_GUI))
495  {
496  this->SetGuiHidden(!this->IsGuiHidden());
497  }
498 
499  // EV_COMMON_ENTER_CHATMODE
500  if (App::GetInputEngine()->getEventBoolValueBounce(EV_COMMON_ENTER_CHATMODE, 0.5f) &&
501  App::mp_state->getEnum<MpState>() == MpState::CONNECTED)
502  {
503  this->ChatBox.SetVisible(!this->ChatBox.IsVisible());
504  }
505 
506  // EV_COMMON_TRUCK_INFO - Vehicle info side-panel (aka The T-Screen)
507  if (App::GetInputEngine()->getEventBoolValueBounce(EV_COMMON_TRUCK_INFO) && App::GetGameContext()->GetPlayerActor())
508  {
510  {
512  }
513  else
514  {
516  }
517  }
518 
519  // EV_COMMON_TRUCK_DESCRIPTION - The T-screen with commands
520  if (App::GetInputEngine()->getEventBoolValueBounce(EV_COMMON_TRUCK_DESCRIPTION) && App::GetGameContext()->GetPlayerActor())
521  {
523  {
525  }
526  else
527  {
529  }
530  }
531 
532  // EV_COMMON_TOGGLE_DASHBOARD
533  if (App::GetInputEngine()->getEventBoolValueBounce(EV_COMMON_TOGGLE_DASHBOARD))
534  {
536  }
537 
538  // EV_COMMON_TOGGLE_STATS - FPS, draw batch count etc...
539  if (App::GetInputEngine()->getEventBoolValueBounce(EV_COMMON_TOGGLE_STATS))
540  {
542  }
543 
544  if (App::GetCameraManager()->GetCurrentBehavior() != CameraManager::CAMERA_BEHAVIOR_FREE)
545  {
546  // EV_SURVEY_MAP_CYCLE
547  if (App::GetInputEngine()->getEventBoolValueBounce(EV_SURVEY_MAP_CYCLE))
548  {
549  this->SurveyMap.CycleMode();
550  }
551 
552  // EV_SURVEY_MAP_TOGGLE
553  if (App::GetInputEngine()->getEventBoolValueBounce(EV_SURVEY_MAP_TOGGLE))
554  {
555  this->SurveyMap.ToggleMode();
556  }
557  }
558  }
559 }
GameContext.h
Game state manager and message-queue provider.
RoR::GUIManager::VehicleInfoTPanel
GUI::VehicleInfoTPanel VehicleInfoTPanel
Definition: GUIManager.h:118
RoR::GUI::VehicleInfoTPanel::IsVisible
bool IsVisible(TPanelFocus focus=TPANELFOCUS_NONE) const
Definition: GUI_VehicleInfoTPanel.h:41
RoR::GUIManager::SurveyMap
GUI::SurveyMap SurveyMap
Definition: GUIManager.h:133
RoR::GUI::ConsoleWindow::IsVisible
bool IsVisible() const
Definition: GUI_ConsoleWindow.h:47
RoR::EV_SURVEY_MAP_CYCLE
@ EV_SURVEY_MAP_CYCLE
cycle overview-map mode
Definition: InputEngine.h:292
Ogre::ImGuiOverlay::NewFrame
static void NewFrame(const FrameEvent &evt)
Definition: OgreImGuiOverlay.cpp:126
RoR::GUIManager::GUIManager
GUIManager()
Definition: GUIManager.cpp:64
RoR::EV_SURVEY_MAP_TOGGLE
@ EV_SURVEY_MAP_TOGGLE
toggle overview-map mode
Definition: InputEngine.h:293
RoR::GUI::GameAbout::Draw
void Draw()
Definition: GUI_GameAbout.cpp:39
RoR::GUIManager::m_mygui_platform
MyGUI::OgrePlatform * m_mygui_platform
Definition: GUIManager.h:178
RoR::GUI::LoadingWindow::Draw
void Draw()
Definition: GUI_LoadingWindow.cpp:80
RoR::GUIManager::m_imgui
OgreImGui m_imgui
Definition: GUIManager.h:179
RoR::GUI::RepositorySelector::Draw
void Draw()
Definition: GUI_RepositorySelector.cpp:387
RoR::GUI::FrictionSettings::Draw
void Draw()
Definition: GUI_FrictionSettings.cpp:42
OverlayWrapper.h
RoR::EV_COMMON_CONSOLE_TOGGLE
@ EV_COMMON_CONSOLE_TOGGLE
show / hide the console
Definition: InputEngine.h:227
RoR::GUIManager::m_theme
GuiTheme m_theme
Definition: GUIManager.h:180
RoR::MpState::CONNECTED
@ CONNECTED
RoR::GUIManager::FrictionSettings
GUI::FrictionSettings FrictionSettings
Definition: GUIManager.h:125
RoR::GUI::SimPerfStats::Draw
void Draw()
Definition: GUI_SimPerfStats.cpp:36
RoR::App::GetCameraManager
CameraManager * GetCameraManager()
Definition: Application.cpp:278
RESOURCE_FILENAME
#define RESOURCE_FILENAME
Definition: GUIManager.cpp:48
RoR::GUI::VehicleInfoTPanel::TPANELMODE_OPAQUE
@ TPANELMODE_OPAQUE
Definition: GUI_VehicleInfoTPanel.h:37
RoR::GUIManager::ApplyGuiCaptureKeyboard
void ApplyGuiCaptureKeyboard()
Call after rendered frame to apply queued value.
Definition: GUIManager.cpp:122
RoR::GUI::GameSettings::IsVisible
bool IsVisible() const
Definition: GUI_GameSettings.h:33
RoR::GUI::VehicleInfoTPanel::TPANELMODE_HIDDEN
@ TPANELMODE_HIDDEN
Definition: GUI_VehicleInfoTPanel.h:37
RoR::GUIManager::MouseCursorVisibility
MouseCursorVisibility
Definition: GUIManager.h:103
RoR::GUIManager::eventRequestTag
void eventRequestTag(const MyGUI::UString &_tag, MyGUI::UString &_result)
Definition: GUIManager.cpp:232
RoR::GUIManager::SimPerfStats
GUI::SimPerfStats SimPerfStats
Definition: GUIManager.h:119
ContentManager.h
RoR::App::GetAppContext
AppContext * GetAppContext()
Definition: Application.cpp:269
RoR::GUI::ConsoleView::cvw_background_padding
ImVec2 cvw_background_padding
Definition: GUI_ConsoleView.h:63
GUIUtils.h
RoR::GUI::DirectionArrow::Update
void Update(RoR::GfxActor *player)
Definition: GUI_DirectionArrow.cpp:66
RoR::GUI::LoadingWindow::IsVisible
bool IsVisible() const
Definition: GUI_LoadingWindow.h:42
RoR::CameraManager::CAMERA_BEHAVIOR_FREE
@ CAMERA_BEHAVIOR_FREE
Definition: CameraManager.h:52
RoR::GUIManager::TextureToolWindow
GUI::TextureToolWindow TextureToolWindow
Definition: GUIManager.h:126
RoR::GUI::GameControls::IsVisible
bool IsVisible() const
Definition: GUI_GameControls.h:34
RoR::GUIManager::SetupImGui
void SetupImGui()
Definition: GUIManager.cpp:338
RoR::App::GetOverlayWrapper
OverlayWrapper * GetOverlayWrapper()
Definition: Application.cpp:271
RoR::GUI::ConsoleWindow::SetVisible
void SetVisible(bool visible)
Definition: GUI_ConsoleWindow.h:46
CameraManager.h
RoR::GUIManager::IsGuiHidden
bool IsGuiHidden() const
Definition: GUIManager.h:154
RoR::EV_COMMON_HIDE_GUI
@ EV_COMMON_HIDE_GUI
hide all GUI elements
Definition: InputEngine.h:238
AppContext.h
System integration layer; inspired by OgreBites::ApplicationContext.
RoR::GUI::GameChatBox::GetConsoleView
ConsoleView & GetConsoleView()
Definition: GUI_GameChatBox.h:49
RoR::GUIManager::GameControls
GUI::GameControls GameControls
Definition: GUIManager.h:127
RoR::GUIManager::MpClientList
GUI::MpClientList MpClientList
Definition: GUIManager.h:124
RoR::OverlayWrapper::ToggleDashboardOverlays
void ToggleDashboardOverlays(ActorPtr actor)
Definition: OverlayWrapper.cpp:370
RoR::App::ui_preset
CVar * ui_preset
enum RoR::UiPreset
Definition: Application.cpp:265
RoR::GUIManager::ChatBox
GUI::GameChatBox ChatBox
Definition: GUIManager.h:123
RoR::GUIManager::GuiTheme::semitrans_text_bg_color
ImVec4 semitrans_text_bg_color
Definition: GUIManager.h:93
RoR::GUIManager::GameSettings
GUI::GameSettings GameSettings
Definition: GUIManager.h:117
RoR::GUI::GameSettings::Draw
void Draw()
Definition: GUI_GameSettings.cpp:37
RoR::GUIManager::DrawMainMenuGui
void DrawMainMenuGui()
Definition: GUIManager.cpp:414
RoR::App::sys_logs_dir
CVar * sys_logs_dir
Definition: Application.cpp:167
Language.h
RoR::UiPresetEntry
Definition: GUIManager.h:67
OgreImGui.h
RoR::GUIManager::DirectionArrow
GUI::DirectionArrow DirectionArrow
Definition: GUIManager.h:134
GUIManager.h
RoR::GUI::TextureToolWindow::IsVisible
bool IsVisible() const
Definition: GUI_TextureToolWindow.h:35
ActorManager.h
RoR::GUIManager::~GUIManager
~GUIManager()
Definition: GUIManager.cpp:101
Actor.h
OgreImGui::Init
void Init()
Definition: OgreImGui.cpp:38
RoR::GUIManager::LoadingWindow
GUI::LoadingWindow LoadingWindow
Definition: GUIManager.h:130
RoR::GfxScene::GetSceneManager
Ogre::SceneManager * GetSceneManager()
Definition: GfxScene.h:69
RoR::GUIManager::RepositorySelector
GUI::RepositorySelector RepositorySelector
Definition: GUIManager.h:128
RoR::GUIManager::SupressCursor
void SupressCursor(bool do_supress)
Definition: GUIManager.cpp:478
RoR::App::mp_state
CVar * mp_state
Definition: Application.cpp:115
RoR::GUIManager::NewImGuiFrame
void NewImGuiFrame(float dt)
Definition: GUIManager.cpp:318
RoR::GUI::SurveyMap::Draw
void Draw()
Definition: GUI_SurveyMap.cpp:46
Script2Game::KC_LSHIFT
enum Script2Game::inputEvents KC_LSHIFT
RoR::GUIManager::UpdateMouseCursorVisibility
void UpdateMouseCursorVisibility()
Definition: GUIManager.cpp:310
RoR::GUI::MultiplayerSelector::IsVisible
bool IsVisible() const
Definition: GUI_MultiplayerSelector.h:63
RoR::GUI::SurveyMap::IsVisible
bool IsVisible() const
Definition: GUI_SurveyMap.h:57
RoR::GUI::SurveyMap::ToggleMode
void ToggleMode()
Definition: GUI_SurveyMap.cpp:547
RoR::GUI::GameChatBox::IsVisible
bool IsVisible() const
Definition: GUI_GameChatBox.h:46
RoR::GUIManager::MultiplayerSelector
GUI::MultiplayerSelector MultiplayerSelector
Definition: GUIManager.h:121
RoR::Console::cVarSet
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:268
RoR::GUIManager::MenuWallpaper
Ogre::Overlay * MenuWallpaper
Definition: GUIManager.h:136
RoR::GUIManager::SetMouseCursorVisibility
void SetMouseCursorVisibility(MouseCursorVisibility visi)
Definition: GUIManager.cpp:290
RoR::GUIManager::UpdateInputEvents
void UpdateInputEvents(float dt)
Definition: GUIManager.cpp:483
RoR::PathCombine
std::string PathCombine(std::string a, std::string b)
Definition: PlatformUtils.h:48
RoR::GUI::SimPerfStats::IsVisible
bool IsVisible() const
Definition: GUI_SimPerfStats.h:33
RoR::GUI::CollisionsDebug::IsVisible
bool IsVisible() const
Definition: GUI_CollisionsDebug.h:47
MyGUI::RTTLayer
Definition: RTTLayer.h:11
RoR::GUI::RepositorySelector::IsVisible
bool IsVisible() const
Definition: GUI_RepositorySelector.h:97
RoR::GUIManager::CollisionsDebug
GUI::CollisionsDebug CollisionsDebug
Definition: GUIManager.h:114
RoR::GUI::MainSelector::IsVisible
bool IsVisible()
Definition: GUI_MainSelector.h:48
RoR::GUI::GameChatBox::SetVisible
void SetVisible(bool v)
Definition: GUI_GameChatBox.h:45
RoR::App::app_state
CVar * app_state
Definition: Application.cpp:79
RoR::GUI::FlexbodyDebug::IsVisible
bool IsVisible() const
Definition: GUI_FlexbodyDebug.h:35
RoR::GUI::TopMenubar::Draw
void Draw(float dt)
Definition: GUI_TopMenubar.cpp:154
RoR::GUI::ConsoleView::cvw_background_color
ImVec4 cvw_background_color
Text-background color.
Definition: GUI_ConsoleView.h:62
RoR::EV_COMMON_TOGGLE_DASHBOARD
@ EV_COMMON_TOGGLE_DASHBOARD
display or hide the dashboard overlay
Definition: InputEngine.h:239
RoR::GUIManager::DrawSimGuiBuffered
void DrawSimGuiBuffered(GfxActor *player_gfx_actor)
Reads data from simbuffer.
Definition: GUIManager.cpp:187
RoR::GUI::ConsoleWindow::Draw
void Draw()
Definition: GUI_ConsoleWindow.cpp:40
RoR::GUIManager::m_gui_kb_capture_queued
bool m_gui_kb_capture_queued
Resets and accumulates every frame.
Definition: GUIManager.h:181
RoR::GUI::TextureToolWindow::Draw
void Draw()
Definition: GUI_TextureToolWindow.cpp:38
GfxScene.h
PlatformUtils.h
Platform-specific utilities. We use narrow UTF-8 encoded strings as paths. Inspired by http://utf8eve...
RoR::GUIManager::AreStaticMenusAllowed
bool AreStaticMenusAllowed()
i.e. top menubar / vehicle UI buttons
Definition: GUIManager.cpp:127
RoR::GUI::VehicleInfoTPanel::TPANELFOCUS_STATS
@ TPANELFOCUS_STATS
Definition: GUI_VehicleInfoTPanel.h:38
RoR::OverlayWrapper::showDashboardOverlays
void showDashboardOverlays(bool show, ActorPtr actor)
Definition: OverlayWrapper.cpp:375
RoR::GUI::FlexbodyDebug::Draw
void Draw()
Definition: GUI_FlexbodyDebug.cpp:40
RoR::App::GetConsole
Console * GetConsole()
Definition: Application.cpp:273
RoR::GUI::CollisionsDebug::Draw
void Draw()
Definition: GUI_CollisionsDebug.cpp:42
RoR::GUI::GameControls::Draw
void Draw()
Definition: GUI_GameControls.cpp:37
RoR::GUIManager::MouseCursorVisibility::SUPRESSED
@ SUPRESSED
Hidden manually, will not re-appear until explicitly set VISIBLE.
RoR::App::GetGameContext
GameContext * GetGameContext()
Definition: Application.cpp:283
RoR::GUIManager::RequestGuiCaptureKeyboard
void RequestGuiCaptureKeyboard(bool val)
Pass true during frame to prevent input passing to application.
Definition: GUIManager.cpp:464
files
This is a raw Ogre binding for Imgui No project cmake no just four source files
Definition: README-OgreImGui.txt:3
RoR::GUIManager::ApplyUiPreset
void ApplyUiPreset()
reads cvar 'ui_preset'
Definition: GUIManager.cpp:141
RoR::GUI::MessageBoxDialog::Show
void Show(MessageBoxConfig const &cfg)
Definition: GUI_MessageBox.cpp:42
RoR::AppState::SIMULATION
@ SIMULATION
RoR::GUI::GameChatBox::Draw
void Draw()
Definition: GUI_GameChatBox.cpp:49
RoR::GUIManager::NodeBeamUtils
GUI::NodeBeamUtils NodeBeamUtils
Definition: GUIManager.h:129
RoR::GUIManager::ConsoleWindow
GUI::ConsoleWindow ConsoleWindow
Definition: GUIManager.h:132
RoR::GUIManager::DrawSimulationGui
void DrawSimulationGui(float dt)
Touches live data; must be called in sync with sim. thread.
Definition: GUIManager.cpp:154
RoR::GUIManager::ShutdownMyGUI
void ShutdownMyGUI()
Definition: GUIManager.cpp:105
RoR::GUIManager::TopMenubar
GUI::TopMenubar TopMenubar
Definition: GUIManager.h:131
RoR::GUI::SurveyMap::CycleMode
void CycleMode()
Definition: GUI_SurveyMap.cpp:536
RoR::GUI::MessageBoxDialog::IsVisible
bool IsVisible() const
Definition: GUI_MessageBox.h:71
RoR::GUIManager::SetSceneManagerForGuiRendering
void SetSceneManagerForGuiRendering(Ogre::SceneManager *scene_manager)
Definition: GUIManager.cpp:274
RoR::GUIManager::ShowMessageBox
void ShowMessageBox(const char *title, const char *text, bool allow_close=true, const char *btn1_text="OK", const char *btn2_text=nullptr)
Definition: GUIManager.cpp:454
RTTLayer.h
RoR::GUI::MessageBoxDialog::Draw
void Draw()
Definition: GUI_MessageBox.cpp:97
RoR::GUIManager::FlexbodyDebug
GUI::FlexbodyDebug FlexbodyDebug
Definition: GUIManager.h:135
RoR::GUIManager::m_last_mousemove_time
Ogre::Timer m_last_mousemove_time
Definition: GUIManager.h:183
RoR::GUI::MessageBoxConfig
Definition: GUI_MessageBox.h:50
RoR::CVar::setVal
void setVal(T val)
Definition: CVar.h:72
RoR::GUIManager::WakeUpGUI
void WakeUpGUI()
Definition: GUIManager.cpp:469
RoR::GUIManager::DrawCommonGui
void DrawCommonGui()
Definition: GUIManager.cpp:391
RoR::EV_COMMON_TRUCK_DESCRIPTION
@ EV_COMMON_TRUCK_DESCRIPTION
toggle truck description
Definition: InputEngine.h:279
RoR::GUIManager::GameAbout
GUI::GameAbout GameAbout
Definition: GUIManager.h:116
RoR::App::GetInputEngine
InputEngine * GetInputEngine()
Definition: Application.cpp:274
RoR::EV_COMMON_ENTER_CHATMODE
@ EV_COMMON_ENTER_CHATMODE
enter the chat mode
Definition: InputEngine.h:228
RoR::GUI::GameAbout::IsVisible
bool IsVisible() const
Definition: GUI_GameAbout.h:35
RoR::GUIManager::MessageBoxDialog
GUI::MessageBoxDialog MessageBoxDialog
Definition: GUIManager.h:120
RoR::GUI::FrictionSettings::IsVisible
bool IsVisible() const
Definition: GUI_FrictionSettings.h:52
RoR::GUI::GameMainMenu::IsVisible
bool IsVisible() const
Definition: GUI_GameMainMenu.h:42
Terrain.h
RoR::GfxActor
Definition: GfxActor.h:52
RoR::GUI::VehicleInfoTPanel::Draw
void Draw(RoR::GfxActor *actorx)
Definition: GUI_VehicleInfoTPanel.cpp:43
InputEngine.h
Handles controller inputs from player. Defines input events and binding mechanism,...
RoR::GUIManager::MainSelector
GUI::MainSelector MainSelector
Definition: GUIManager.h:122
Ogre
Definition: ExtinguishableFireAffector.cpp:35
GfxActor.h
Manager for all visuals belonging to a single actor.
RoR::GUI::NodeBeamUtils::IsVisible
bool IsVisible() const
Definition: GUI_NodeBeamUtils.h:34
RoR::GUIManager::SetUpMenuWallpaper
void SetUpMenuWallpaper()
Definition: GUIManager.cpp:237
RoR::GUI::MainSelector::Draw
void Draw()
Definition: GUI_MainSelector.cpp:87
RoR::CVar::getInt
int getInt() const
Definition: CVar.h:97
RoR::GUIManager::m_mygui
MyGUI::Gui * m_mygui
Definition: GUIManager.h:177
RoR::GUIManager::GuiTheme::semitrans_text_bg_padding
ImVec2 semitrans_text_bg_padding
Definition: GUIManager.h:97
RoR::GUI::VehicleInfoTPanel::SetVisible
void SetVisible(TPanelMode mode, TPanelFocus focus=TPANELFOCUS_NONE)
Definition: GUI_VehicleInfoTPanel.cpp:606
RoR::EV_COMMON_TRUCK_INFO
@ EV_COMMON_TRUCK_INFO
toggle truck HUD
Definition: InputEngine.h:278
RoR::GUI::MultiplayerSelector::Draw
void Draw()
Definition: GUI_MultiplayerSelector.cpp:148
RoR::GUI::SimPerfStats::SetVisible
void SetVisible(bool vis)
Definition: GUI_SimPerfStats.h:32
RoR::GUIManager::m_gui_kb_capture_requested
bool m_gui_kb_capture_requested
Effective value, persistent.
Definition: GUIManager.h:182
RoR::EV_COMMON_TOGGLE_STATS
@ EV_COMMON_TOGGLE_STATS
toggle Ogre statistics (FPS etc.)
Definition: InputEngine.h:272
RoR::GUI::GameMainMenu::Draw
void Draw()
Definition: GUI_GameMainMenu.cpp:43
RoR::GUIManager::MouseCursorVisibility::HIDDEN
@ HIDDEN
Hidden as inactive, will re-appear the moment user moves mouse.
RoR::GUI::VehicleInfoTPanel::TPANELFOCUS_COMMANDS
@ TPANELFOCUS_COMMANDS
Definition: GUI_VehicleInfoTPanel.h:38
RoR::GUIManager::m_is_cursor_supressed
bool m_is_cursor_supressed
True if cursor was manually hidden.
Definition: GUIManager.h:184
RoR
Definition: AppContext.h:36
RoR::UiPresets
UiPresetEntry UiPresets[]
Global list of UI Presets, selectable via Settings menu in TopMenubar.
Definition: GUIManager.cpp:53
RoR::GUIManager::SetGuiHidden
void SetGuiHidden(bool visible)
Definition: GUIManager.cpp:279
RoR::GUI::MpClientList::Draw
void Draw()
Definition: GUI_MultiplayerClientList.cpp:74
RoR::GUI::NodeBeamUtils::Draw
void Draw()
Definition: GUI_NodeBeamUtils.cpp:32
RoR::App::GetGfxScene
GfxScene * GetGfxScene()
Definition: Application.cpp:279
RoR::GUIManager::GameMainMenu
GUI::GameMainMenu GameMainMenu
Definition: GUIManager.h:115
RoR::GUIManager::MouseCursorVisibility::VISIBLE
@ VISIBLE
Visible, will be auto-hidden if not moving for a while.
RoR::App::ui_hide_gui
CVar * ui_hide_gui
bool; The 'hide GUI' hotkey state
Definition: Application.cpp:266
RoR::GUI::ConsoleWindow::IsHovered
bool IsHovered() const
Definition: GUI_ConsoleWindow.h:48
RoR::InputEngine::GetOisKeyboard
OIS::Keyboard * GetOisKeyboard()
Definition: InputEngine.h:477