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