RigsofRods
Soft-body Physics Simulation
GUI_GameSettings.cpp
Go to the documentation of this file.
1 /*
2  This source file is part of Rigs of Rods
3  Copyright 2016-2020 Petr Ohlidal
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 #include "GUI_GameSettings.h"
21 
22 #include "AppContext.h"
23 #include "CacheSystem.h"
24 #include "GameContext.h"
25 #include "GUIManager.h"
26 #include "GUIUtils.h"
27 #include "Language.h"
28 #include "SoundManager.h"
29 
30 #ifdef USE_OPENAL
31 # include <alc.h>
32 #endif
33 
34 using namespace RoR;
35 using namespace GUI;
36 
38 {
39  const int flags = ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoScrollbar;
40  ImGui::SetNextWindowSize(ImVec2(670.f, 400.f), ImGuiCond_FirstUseEver);
41  if (m_bump_height != 0)
42  {
43  ImGui::SetNextWindowSize(m_window_size + ImVec2(0, m_bump_height));
44  m_bump_height = 0.f;
45  }
46  ImGui::SetNextWindowPosCenter(ImGuiCond_Appearing);
47  bool keep_open = true;
48  ImGui::Begin(_LC("GameSettings", "Game settings"), &keep_open, flags);
49 
50  ImGui::BeginTabBar("GameSettingsTabs");
51 
52  const float child_height = ImGui::GetWindowHeight()
53  - ((2.f * ImGui::GetStyle().WindowPadding.y) + (3.f * ImGui::GetItemsLineHeightWithSpacing())
54  + ImGui::GetStyle().ItemSpacing.y);
55 
56  if (ImGui::BeginTabItem(_LC("GameSettings", "Render System")))
57  {
58  ImGui::BeginChild("Settings-Render-scroll", ImVec2(0.f, child_height), false);
60  ImGui::EndChild();
61  ImGui::EndTabItem();
62  }
63  if (ImGui::BeginTabItem(_LC("GameSettings", "General")))
64  {
65  ImGui::BeginChild("Settings-General-scroll", ImVec2(0.f, child_height), false);
66  this->DrawGeneralSettings();
67  ImGui::EndChild();
68  ImGui::EndTabItem();
69  }
70  if (ImGui::BeginTabItem(_LC("GameSettings", "Gameplay")))
71  {
72  ImGui::BeginChild("Settings-Gameplay-scroll", ImVec2(0.f, child_height), false);
73  this->DrawGameplaySettings();
74  ImGui::EndChild();
75  ImGui::EndTabItem();
76  }
77  if (ImGui::BeginTabItem(_LC("GameSettings", "Graphics")))
78  {
79  ImGui::BeginChild("Settings-Graphics-scroll", ImVec2(0.f, child_height), false);
80  this->DrawGraphicsSettings();
81  ImGui::EndChild();
82  ImGui::EndTabItem();
83  }
84  if (ImGui::BeginTabItem(_LC("GameSettings", "Audio")))
85  {
86  ImGui::BeginChild("Settings-Audio-scroll", ImVec2(0.f, child_height), false);
87  this->DrawAudioSettings();
88  ImGui::EndChild();
89  ImGui::EndTabItem();
90  }
91  if (ImGui::BeginTabItem(_LC("GameSettings", "Controls")))
92  {
93  ImGui::BeginChild("Settings-Controls-scroll", ImVec2(0.f, child_height), false);
94  this->DrawControlSettings();
95  ImGui::EndChild();
96  ImGui::EndTabItem();
97  }
98  if (ImGui::BeginTabItem(_LC("GameSettings", "Diagnostic")))
99  {
100  ImGui::BeginChild("Settings-Diag-scroll", ImVec2(0.f, child_height), false);
101  this->DrawDiagSettings();
102  ImGui::EndChild();
103  ImGui::EndTabItem();
104  }
105 
106  ImGui::EndTabBar();
107 
108  ImGui::SetCursorPosY(ImGui::GetCursorPosY() + 4.f);
109  m_window_size = ImGui::GetWindowSize();
110 
111  ImGui::End();
112  if (!keep_open)
113  {
114  this->SetVisible(false);
115  }
116 }
117 
119 {
120  ImGui::TextDisabled("%s", _LC("GameSettings", "Render system (changes require a restart)"));
121 
123  {
124  std::string text = _LC("GameSettings", "You must restart the game to make changes effective.");
125  ImVec2 box_size = ImGui::CalcTextSize(text.c_str()) + ImGui::GetStyle().FramePadding * 2;
126  ImVec2 box_pos = ImGui::GetCursorPos() + ImVec2(ImGui::GetWindowContentRegionWidth() * 0.5f - box_size.x * 0.5f, 0.f);
127  ImGui::SetCursorPos(box_pos);
128  ImGui::PushStyleColor(ImGuiCol_FrameBg, ImVec4(0.8f, 0.7f, 0.1f, 1.f));
129  ImGui::BeginChildFrame(ImGuiID(123), box_size);
130  ImGui::TextColored(ImVec4(0.1f, 0.1f, 0.1f, 1.f), text.c_str());
131  ImGui::EndChildFrame();
132  ImGui::PopStyleColor(); // FrameBg
133  }
134 
135  const auto ogre_root = App::GetAppContext()->GetOgreRoot();
136  const auto render_systems = ogre_root->getAvailableRenderers();
137  std::string render_system_names;
138  for (auto rs : render_systems)
139  {
140  render_system_names += rs->getName() + '\0';
141  }
142  const auto ro = ogre_root->getRenderSystemByName(App::app_rendersys_override->getStr());
143  const auto rs = ro ? ro : ogre_root->getRenderSystem();
144  const auto it = std::find(render_systems.begin(), render_systems.end(), rs);
145  int render_id = it != render_systems.end() ? std::distance(render_systems.begin(), it) : 0;
146  /* Combobox for selecting the Render System*/
147  if (ImGui::Combo(_LC ("GameSettings", "Render System"), &render_id, render_system_names.c_str()))
148  {
149  App::app_rendersys_override->setStr(render_systems[render_id]->getName());
150  }
151 
152  const auto config_options = ogre_root->getRenderSystem()->getConfigOptions();
153  std::set<std::string> filter = {"Allow NVPerfHUD", "Colour Depth", "Fixed Pipeline Enabled",
154  "Floating-point mode", "Resource Creation Policy", "VSync Interval", "sRGB Gamma Conversion"};
155  for (auto opt : config_options)
156  {
157  auto co = opt.second;
158  if (co.immutable)
159  continue;
160  if (co.possibleValues.empty())
161  continue;
162  if (filter.find(co.name) != filter.end())
163  continue;
164  std::sort(co.possibleValues.rbegin(), co.possibleValues.rend());
165  std::string option_values;
166  for (auto value : co.possibleValues)
167  {
168  option_values += value + '\0';
169  }
170  const auto it = std::find(co.possibleValues.begin(), co.possibleValues.end(), opt.second.currentValue);
171  int option_id = it != co.possibleValues.end() ? std::distance(co.possibleValues.begin(), it) : 0;
172  if (ImGui::Combo(co.name.c_str(), &option_id, option_values.c_str()))
173  {
174  // Check the new value is different from the current one
175  if (co.currentValue != co.possibleValues[option_id])
176  {
177  // Set the new value to the render system
178  rs->setConfigOption(co.name, co.possibleValues[option_id]);
179  if (rs->validateConfigOptions().empty())
180  {
181  ogre_root->saveConfig();
182 
183  // Show the "Must restart game..." box, make the window bigger to accomodate it
185  {
186  m_render_must_restart = true;
187  m_bump_height = ImGui::GetTextLineHeightWithSpacing() + ImGui::GetStyle().FramePadding.y * 2;
188  }
189  }
190  }
191  }
192  }
193 }
194 
196 {
197  ImGui::TextDisabled("%s", _LC("GameSettings", "Application settings"));
198 
199 #ifndef NOLANG
200  std::vector<std::pair<std::string, std::string>> languages = App::GetLanguageEngine()->getLanguages();
201  std::string lang_values;
202  for (auto value : languages)
203  {
204  lang_values += value.first + '\0';
205  }
206  const auto it = std::find_if(languages.begin(), languages.end(),
207  [](const std::pair<std::string, std::string>& l) { return l.second == App::app_language->getStr(); });
208  int lang_selection = it != languages.end() ? std::distance(languages.begin(), it) : 0;
209  if (ImGui::Combo(_LC("GameSettings", "Language"), &lang_selection, lang_values.c_str()))
210  {
211  App::app_language->setStr(languages[lang_selection].second);
213  }
214 #endif
215 
216  // Country selection
217  static Ogre::FileInfoListPtr fl = Ogre::ResourceGroupManager::getSingleton().findResourceFileInfo("FlagsRG", "*");
218  if (!fl->empty())
219  {
220  static std::vector<std::string> countries;
221  if (countries.empty())
222  {
223  for (auto& file : *fl)
224  {
225  std::string country = Ogre::StringUtil::replaceAll(file.filename, ".png", "");
226  if (country.size() == 2) // RoR protocol limitation
227  {
228  countries.push_back(country);
229  }
230  }
231  std::sort(countries.begin(), countries.end());
232  }
233  std::string country_values;
234  for (auto value : countries)
235  {
236  country_values += value + '\0';
237  }
238  const auto it = std::find(countries.begin(), countries.end(), App::app_country->getStr());
239  int country_selection = it != countries.end() ? std::distance(countries.begin(), it) : 0;
240  if (ImGui::Combo(_LC("GameSettings", "Country"), &country_selection, country_values.c_str()))
241  {
242  App::app_country->setStr(countries[country_selection].c_str());
243  }
244  }
245 
246  int sshot_select = (App::app_screenshot_format->getStr() == "jpg") ? 1 : 0; // Hardcoded; TODO: list available formats.
247 
248  /* Screenshot format: Can be png or jpg*/
249  if (ImGui::Combo(_LC("GameSettings", "Screenshot format"), &sshot_select, "png\0jpg\0\0"))
250  {
251  std::string str = (sshot_select == 1) ? "jpg" : "png";
253  }
254 
255  DrawGTextEdit(App::app_extra_mod_path, _LC("GameSettings", "Extra mod path"), m_buf_app_extra_mod_dir);
256 
257  DrawGCheckbox(App::app_skip_main_menu, _LC("GameSettings", "Skip main menu"));
258  DrawGCheckbox(App::app_async_physics, _LC("GameSettings", "Async physics"));
259  DrawGCheckbox(App::app_disable_online_api, _LC("GameSettings", "Disable online api"));
260 
261  if (ImGui::Button(_LC("GameSettings", "Update cache")))
262  {
266  }
267 }
268 
270 {
271  ImGui::TextDisabled("%s", _LC("GameSettings", "Simulation settings"));
272 
273  DrawGCombo(App::sim_gearbox_mode, _LC("GameSettings", "Gearbox mode"),
275 
276  DrawGCheckbox(App::gfx_speedo_digital, _LC("GameSettings", "Digital speedometer"));
277  DrawGCheckbox(App::gfx_speedo_imperial, _LC("GameSettings", "Imperial speedometer"));
278 
279  //DrawGCheckbox(App::gfx_flexbody_cache, "Enable flexbody cache");
280 
281  DrawGCheckbox(App::sim_spawn_running, _LC("GameSettings", "Engines spawn running"));
282 
283  DrawGCheckbox(App::sim_replay_enabled, _LC("GameSettings", "Replay mode"));
284  if (App::sim_replay_enabled->getBool())
285  {
286  DrawGIntBox(App::sim_replay_length, _LC("GameSettings", "Replay length"));
287  DrawGIntBox(App::sim_replay_stepping, _LC("GameSettings", "Replay stepping"));
288  }
289 
290  DrawGCheckbox(App::sim_realistic_commands, _LC("GameSettings", "Realistic forward commands"));
291 
292  DrawGCheckbox(App::sim_races_enabled, _LC("GameSettings", "Enable races"));
293 
294  DrawGCheckbox(App::sim_no_self_collisions, _LC("GameSettings", "No intra truck collisions"));
295  DrawGCheckbox(App::sim_no_collisions, _LC("GameSettings", "No inter truck collisions"));
296 
297  DrawGCheckbox(App::io_discord_rpc, _LC("GameSettings", "Discord Rich Presence"));
298 
299  DrawGCheckbox(App::sim_quickload_dialog, _LC("GameSettings", "Show confirm. UI dialog for quickload"));
300 
301  DrawGCheckbox(App::ui_show_live_repair_controls, _LC("GameSettings", "Show controls in live repair box"));
302 
303  DrawGCheckbox(App::ui_show_vehicle_buttons, _LC("GameSettings", "Show vehicle buttons menu"));
304 
305  DrawGCheckbox(App::sim_tuning_enabled, _LC("GameSettings", "Enable vehicle tuning"));
306 }
307 
309 {
310 #ifdef USE_OPENAL
311  ImGui::TextDisabled("%s", _LC("GameSettings", "Audio settings"));
312 
313  static const ALCchar *devices = alcGetString(NULL, ALC_ALL_DEVICES_SPECIFIER);
314  const ALCchar *device = devices, *next = devices + 1;
315  std::vector<std::string> audio_devices;
316 
317  while (device && *device != '\0' && next && *next != '\0')
318  {
319  audio_devices.push_back(device);
320  size_t len = strlen(device);
321  device += (len + 1);
322  next += (len + 2);
323  }
324 
325  const auto it = std::find(audio_devices.begin(), audio_devices.end(), App::audio_device_name->getStr());
326  int device_id = it != audio_devices.end() ? std::distance(audio_devices.begin(), it) : 0;
327  if (ImGui::Combo(_LC("GameSettings", "Audio device"), &device_id, devices))
328  {
329  App::audio_device_name->setStr(audio_devices[device_id]);
330  }
331 
332  DrawGCheckbox(App::audio_enable_creak, _LC("GameSettings", "Creak sound"));
333  DrawGCheckbox(App::audio_menu_music, _LC("GameSettings", "Main menu music"));
334  DrawGFloatSlider(App::audio_master_volume, _LC("GameSettings", "Master volume"), 0, 1);
335 #endif // USE_OPENAL
336 }
337 
339 {
340  ImGui::TextDisabled("%s", _LC("GameSettings", "Video settings"));
341 
342  DrawGCombo(App::gfx_flares_mode, _LC("GameSettings", "Light sources"),
344 
345  DrawGCombo(App::gfx_shadow_type, _LC("GameSettings", "Shadow type (requires restart)"),
346  m_combo_items_shadow_type.c_str());
347 
348  if (App::gfx_shadow_type->getEnum<GfxShadowType>() != GfxShadowType::NONE)
349  {
350  DrawGCheckbox(App::gfx_reduce_shadows, _LC("GameSettings", "Shadow optimizations"));
351  if (App::gfx_shadow_type->getEnum<GfxShadowType>() == GfxShadowType::PSSM)
352  {
353  DrawGIntSlider(App::gfx_shadow_quality, _LC("GameSettings", "Shadow quality"), 0, 3);
354  }
355  }
356 
357  DrawGCombo(App::gfx_sky_mode, _LC("GameSettings", "Sky gfx"),
358  m_combo_items_sky_mode.c_str());
359 
360  if (App::gfx_sky_mode->getEnum<GfxSkyMode>() != GfxSkyMode::SKYX)
361  {
362  DrawGIntSlider(App::gfx_sight_range, _LC("GameSettings", "Sight range (meters)"), 100, 5000);
363  }
364 
365  DrawGCombo(App::gfx_texture_filter , _LC("GameSettings", "Texture filtering"),
366  m_combo_items_tex_filter.c_str());
367 
368  if (App::gfx_texture_filter->getEnum<GfxTexFilter>() == GfxTexFilter::ANISOTROPIC)
369  {
370  int anisotropy = Ogre::Math::Clamp(App::gfx_anisotropy->getInt(), 1, 16);
371  int selection = std::log2(anisotropy);
372  if (ImGui::Combo(_LC("GameSettings", "Anisotropy"), &selection, "1\0""2\0""4\0""8\0""16\0\0"))
373  {
374  App::gfx_anisotropy->setVal(std::pow(2, selection));
375  }
376  }
377 
378  DrawGCombo(App::gfx_vegetation_mode, _LC("GameSettings", "Vegetation density"),
379  m_combo_items_vegetation.c_str());
380 
381  DrawGCombo(App::gfx_water_mode, _LC("GameSettings", "Water gfx"),
382  m_combo_items_water_mode.c_str());
383 
384  DrawGIntSlider(App::gfx_fps_limit, _LC("GameSettings", "FPS limit"), 0, 240);
385 
386  DrawGIntCheck(App::gfx_particles_mode, _LC("GameSettings", "Enable particle gfx"));
387  DrawGIntCheck(App::gfx_skidmarks_mode, _LC("GameSettings", "Enable skidmarks"));
388 
389  DrawGCheckbox(App::gfx_envmap_enabled, _LC("GameSettings", "Realtime reflections"));
390  if (App::gfx_envmap_enabled->getBool())
391  {
392  ImGui::PushItemWidth(125.f); // Width includes [+/-] buttons
393  DrawGIntSlider(App::gfx_envmap_rate, _LC("GameSettings", "Realtime refl. update rate"), 0, 6);
394  ImGui::PopItemWidth();
395  }
396 
397  DrawGCheckbox(App::gfx_enable_videocams, _LC("GameSettings", "Render video cameras"));
398  DrawGCheckbox(App::gfx_surveymap_icons, _LC("GameSettings", "Overview map icons"));
399  if (App::gfx_surveymap_icons->getBool())
400  {
401  DrawGCheckbox(App::gfx_declutter_map, _LC("GameSettings", "Declutter overview map"));
402  }
403  DrawGCheckbox(App::gfx_water_waves, _LC("GameSettings", "Waves on water"));
404  DrawGCheckbox(App::gfx_alt_actor_materials, _LC("GameSettings", "Use alternate vehicle materials"));
405 
406  DrawGCombo(App::gfx_extcam_mode, "Exterior camera mode",
407  m_combo_items_extcam_mode.c_str());
408 
409  DrawGIntSlider(App::gfx_camera_height, _LC("GameSettings", "Static camera height (meters)"), 1, 50);
410  DrawGIntSlider(App::gfx_fov_external_default, _LC("GameSettings", "Exterior field of view"), 10, 120);
411  DrawGIntSlider(App::gfx_fov_internal_default, _LC("GameSettings", "Interior field of view"), 10, 120);
412 }
413 
415 {
416  ImGui::TextDisabled("%s", _LC("GameSettings", "Diagnostic options"));
417  ImGui::TextColored(ImVec4(0.89f,0.15f,0.21f,1.0f), "%s", _LC("GameSettings", "These settings are for advanced users only, you should only change these if you know what you're doing"));
418 
419  DrawGTextEdit(App::diag_preset_terrain, _LC("GameSettings", "Preselected terrain"), m_buf_diag_preset_terrain);
420  DrawGTextEdit(App::diag_preset_vehicle, _LC("GameSettings", "Preselected vehicle"), m_buf_diag_preset_vehicle);
421  DrawGTextEdit(App::diag_preset_veh_config, _LC("GameSettings", "Presel. veh. config"), m_buf_diag_preset_veh_config);
422  DrawGCheckbox(App::diag_preset_veh_enter, _LC("GameSettings", "Enter preselected vehicle"));
423  DrawGCheckbox(App::diag_auto_spawner_report, _LC("GameSettings", "Auto actor spawner report"));
424  DrawGCheckbox(App::diag_rig_log_node_import, _LC("GameSettings", "Log node import (spawn)"));
425  DrawGCheckbox(App::diag_rig_log_node_stats, _LC("GameSettings", "Log node stats (spawn)"));
426  DrawGCheckbox(App::diag_camera, _LC("GameSettings", "Debug camera (rails)"));
427  DrawGCheckbox(App::diag_truck_mass, _LC("GameSettings", "Debug actor mass"));
428  DrawGCheckbox(App::diag_envmap, _LC("GameSettings", "Debug realtime reflections"));
429  DrawGCheckbox(App::diag_videocameras, _LC("GameSettings", "Debug videocameras"));
430  DrawGCheckbox(App::diag_warning_texture, _LC("GameSettings", "Debug textures"));
431  DrawGCheckbox(App::diag_hide_broken_beams, _LC("GameSettings", "Hide broken beams"));
432  DrawGCheckbox(App::diag_hide_wheel_info, _LC("GameSettings", "Hide wheel info"));
433  DrawGCheckbox(App::diag_hide_wheels, _LC("GameSettings", "Hide wheels"));
434  DrawGCheckbox(App::diag_hide_nodes, _LC("GameSettings", "Hide nodes"));
435  DrawGCheckbox(App::diag_log_console_echo, _LC("GameSettings", "Echo log to console"));
436  DrawGCheckbox(App::diag_log_beam_break, _LC("GameSettings", "Log beam breaking"));
437  DrawGCheckbox(App::diag_log_beam_deform, _LC("GameSettings", "Log beam deforming"));
438  DrawGCheckbox(App::diag_log_beam_trigger, _LC("GameSettings", "Log beam triggers"));
439  DrawGCheckbox(App::diag_allow_window_resize, _LC("GameSettings", "Allow game window resizing"));
440  if (ImGui::Button(_LC("GameSettings", "Rebuild cache")))
441  {
445  }
446 }
447 
449 {
450  ImGui::TextDisabled("%s", _LC("GameSettings", "Controller options"));
451 
452  IoInputGrabMode io_input_grab_mode_old = App::io_input_grab_mode->getEnum<IoInputGrabMode>();
453  DrawGCombo(App::io_input_grab_mode, _LC("GameSettings", "Input grab mode"), m_combo_items_input_grab.c_str());
454  if (io_input_grab_mode_old != App::io_input_grab_mode->getEnum<IoInputGrabMode>())
455  {
457  // This may take a second - display a 'please wait' box
460  _LC("GameSettings", "Restarting input subsystem, please wait..."), /*render_frame:*/false);
461  }
462 
463  DrawGFloatSlider(App::io_analog_smoothing, _LC("GameSettings", "Analog Input Smoothing"), 0.5f, 2.0f);
464  DrawGFloatSlider(App::io_analog_sensitivity, _LC("GameSettings", "Analog Input Sensitivity"), 0.5f, 2.0f);
465  DrawGFloatSlider(App::io_blink_lock_range, _LC("GameSettings", "Blinker Lock Range"), 0.1f, 1.0f);
466 
467  DrawGCheckbox(App::io_arcade_controls, _LC("GameSettings", "Use arcade controls"));
468  DrawGCheckbox(App::io_invert_orbitcam, _LC("GameSettings", "Invert orbit camera"));
469 
470  DrawGCheckbox(App::io_ffb_enabled, _LC("GameSettings", "Enable ForceFeedback"));
471  if (App::io_ffb_enabled->getBool())
472  {
473  ImGui::PushItemWidth(125.f);
474  DrawGFloatBox(App::io_ffb_camera_gain, _LC("GameSettings", "FFB camera gain"));
475  DrawGFloatBox(App::io_ffb_center_gain, _LC("GameSettings", "FFB center gain"));
476  DrawGFloatBox(App::io_ffb_master_gain, _LC("GameSettings", "FFB master gain"));
477  DrawGFloatBox(App::io_ffb_stress_gain, _LC("GameSettings", "FFB stress gain"));
478  ImGui::PopItemWidth();
479  }
480 
481  DrawGIntCheck(App::io_outgauge_mode, _LC("GameSettings", "Enable OutGauge protocol"));
482  if (App::io_outgauge_mode->getBool())
483  {
484  DrawGTextEdit(App::io_outgauge_ip, _LC("GameSettings", "OutGauge IP"), m_buf_io_outgauge_ip);
485  ImGui::PushItemWidth(125.f);
486  DrawGIntBox(App::io_outgauge_port, _LC("GameSettings", "OutGauge port"));
487  DrawGIntBox(App::io_outgauge_id, _LC("GameSettings", "OutGauge ID"));
488  DrawGFloatBox(App::io_outgauge_delay, _LC("GameSettings", "OutGauge delay"));
489  ImGui::PopItemWidth();
490  }
491 }
492 
494 {
495  m_is_visible = v;
496  if (!v && App::app_state->getEnum<AppState>() == RoR::AppState::MAIN_MENU)
497  {
499  }
500 
501  // Pre-format combobox strings.
502  if (m_combo_items_gearbox_mode == "")
503  {
510  }
511 
512  if (m_combo_items_light_sources == "")
513  {
520  }
521 
522  if (m_combo_items_shadow_type == "")
523  {
527  }
528 
529  if (m_combo_items_sky_mode == "")
530  {
535  }
536 
537  if (m_combo_items_tex_filter == "")
538  {
544  }
545 
546  if (m_combo_items_vegetation == "")
547  {
553  }
554 
555  if (m_combo_items_water_mode == "")
556  {
564  }
565 
566  if (m_combo_items_extcam_mode == "")
567  {
572  }
573 
574  if (m_combo_items_input_grab == "")
575  {
580  }
581 }
GameContext.h
Game state manager and message-queue provider.
RoR::App::diag_truck_mass
CVar * diag_truck_mass
Definition: Application.cpp:137
RoR::App::io_invert_orbitcam
CVar * io_invert_orbitcam
Definition: Application.cpp:206
RoR::App::gfx_envmap_rate
CVar * gfx_envmap_rate
Definition: Application.cpp:233
RoR::App::diag_rig_log_node_import
CVar * diag_rig_log_node_import
Definition: Application.cpp:135
RoR::GfxSkyMode::SANDSTORM
@ SANDSTORM
Sandstorm (fastest)
RoR::App::sim_quickload_dialog
CVar * sim_quickload_dialog
Definition: Application.cpp:110
RoR::GUI::GameSettings::DrawControlSettings
void DrawControlSettings()
Definition: GUI_GameSettings.cpp:448
RoR::App::sim_replay_stepping
CVar * sim_replay_stepping
Definition: Application.cpp:103
RoR::App::diag_warning_texture
CVar * diag_warning_texture
Definition: Application.cpp:151
RoR::App::GetLanguageEngine
LanguageEngine * GetLanguageEngine()
Definition: Application.cpp:278
RoR::App::gfx_speedo_imperial
CVar * gfx_speedo_imperial
Definition: Application.cpp:246
RoR::GUI::GameSettings::m_combo_items_extcam_mode
std::string m_combo_items_extcam_mode
Definition: GUI_GameSettings.h:64
RoR::ImAddItemToComboboxString
void ImAddItemToComboboxString(std::string &target, std::string const &item)
Definition: GUIUtils.cpp:374
RoR::GUI::GameSettings::SetVisible
void SetVisible(bool v)
Definition: GUI_GameSettings.cpp:493
RoR::App::diag_preset_vehicle
CVar * diag_preset_vehicle
Definition: Application.cpp:143
RoR::DrawGFloatSlider
void DrawGFloatSlider(CVar *cvar, const char *label, float v_min, float v_max)
Definition: GUIUtils.cpp:300
RoR::GUI::GameSettings::m_window_size
ImVec2 m_window_size
Definition: GUI_GameSettings.h:47
RoR::MSG_APP_REINIT_INPUT_REQUESTED
@ MSG_APP_REINIT_INPUT_REQUESTED
Definition: Application.h:95
RoR::GfxShadowType::NONE
@ NONE
RoR::App::io_discord_rpc
CVar * io_discord_rpc
Definition: Application.cpp:205
RoR::DrawGCombo
void DrawGCombo(CVar *cvar, const char *label, const char *values)
Definition: GUIUtils.cpp:335
RoR::App::app_skip_main_menu
CVar * app_skip_main_menu
Definition: Application.cpp:82
RoR::App::GetGuiManager
GUIManager * GetGuiManager()
Definition: Application.cpp:269
RoR::DrawGTextEdit
void DrawGTextEdit(CVar *cvar, const char *label, Str< 1000 > &buf)
Definition: GUIUtils.cpp:319
RoR::App::diag_hide_broken_beams
CVar * diag_hide_broken_beams
Definition: Application.cpp:152
RoR::GfxExtCamMode::PITCHING
@ PITCHING
file
This is a raw Ogre binding for Imgui No project cmake file
Definition: README-OgreImGui.txt:3
RoR::DrawGIntBox
void DrawGIntBox(CVar *cvar, const char *label)
Definition: GUIUtils.cpp:281
RoR::GfxTexFilter::ANISOTROPIC
@ ANISOTROPIC
RoR::AppState::MAIN_MENU
@ MAIN_MENU
RoR::App::gfx_skidmarks_mode
CVar * gfx_skidmarks_mode
Definition: Application.cpp:235
RoR::App::GetAppContext
AppContext * GetAppContext()
Definition: Application.cpp:266
RoR::App::app_language
CVar * app_language
Definition: Application.cpp:80
GUIUtils.h
RoR::App::gfx_shadow_type
CVar * gfx_shadow_type
Definition: Application.cpp:217
SoundManager.h
RoR::App::gfx_particles_mode
CVar * gfx_particles_mode
Definition: Application.cpp:227
RoR::App::gfx_extcam_mode
CVar * gfx_extcam_mode
Definition: Application.cpp:218
RoR::App::gfx_enable_videocams
CVar * gfx_enable_videocams
Definition: Application.cpp:228
RoR::DrawGFloatBox
void DrawGFloatBox(CVar *cvar, const char *label)
Definition: GUIUtils.cpp:310
RoR::App::io_analog_sensitivity
CVar * io_analog_sensitivity
Definition: Application.cpp:190
RoR::App::sim_replay_length
CVar * sim_replay_length
Definition: Application.cpp:102
RoR::App::io_outgauge_port
CVar * io_outgauge_port
Definition: Application.cpp:202
RoR::App::app_rendersys_override
CVar * app_rendersys_override
Definition: Application.cpp:86
AppContext.h
System integration layer; inspired by OgreBites::ApplicationContext.
RoR::GfxWaterMode::NONE
@ NONE
None.
RoR::App::gfx_fov_external_default
CVar * gfx_fov_external_default
Definition: Application.cpp:239
RoR::App::sim_no_self_collisions
CVar * sim_no_self_collisions
Definition: Application.cpp:107
RoR::DrawGIntSlider
void DrawGIntSlider(CVar *cvar, const char *label, int v_min, int v_max)
Definition: GUIUtils.cpp:290
RoR::App::io_ffb_enabled
CVar * io_ffb_enabled
Definition: Application.cpp:192
RoR::GUIManager::GameSettings
GUI::GameSettings GameSettings
Definition: GUIManager.h:106
RoR::GUI::GameSettings::m_buf_diag_preset_vehicle
Str< 1000 > m_buf_diag_preset_vehicle
Definition: GUI_GameSettings.h:51
RoR::App::app_country
CVar * app_country
Definition: Application.cpp:81
RoR::GUI::GameSettings::DrawAudioSettings
void DrawAudioSettings()
Definition: GUI_GameSettings.cpp:308
RoR::GUI::GameSettings::Draw
void Draw()
Definition: GUI_GameSettings.cpp:37
RoR::App::app_disable_online_api
CVar * app_disable_online_api
Definition: Application.cpp:90
RoR::App::gfx_texture_filter
CVar * gfx_texture_filter
Definition: Application.cpp:222
Language.h
RoR::App::app_extra_mod_path
CVar * app_extra_mod_path
Definition: Application.cpp:87
RoR::App::io_ffb_master_gain
CVar * io_ffb_master_gain
Definition: Application.cpp:195
GUIManager.h
RoR::GfxWaterMode::FULL_HQ
@ FULL_HQ
Reflection + refraction (quality optimized)
RoR::GUI::GameSettings::m_combo_items_water_mode
std::string m_combo_items_water_mode
Definition: GUI_GameSettings.h:63
RoR::GUI::GameSettings::m_combo_items_vegetation
std::string m_combo_items_vegetation
Definition: GUI_GameSettings.h:62
RoR::App::diag_hide_wheel_info
CVar * diag_hide_wheel_info
Definition: Application.cpp:154
RoR::GUIManager::LoadingWindow
GUI::LoadingWindow LoadingWindow
Definition: GUIManager.h:119
RoR::GfxFlaresMode::ALL_VEHICLES_HEAD_ONLY
@ ALL_VEHICLES_HEAD_ONLY
All vehicles, main lights.
RoR::App::audio_enable_creak
CVar * audio_enable_creak
Definition: Application.cpp:210
RoR::SimGearboxMode::AUTO
@ AUTO
Automatic shift.
RoR::GfxExtCamMode::STATIC
@ STATIC
RoR::App::sim_tuning_enabled
CVar * sim_tuning_enabled
Definition: Application.cpp:112
RoR::App::sim_gearbox_mode
CVar * sim_gearbox_mode
Definition: Application.cpp:108
RoR::SimGearboxMode::MANUAL_STICK
@ MANUAL_STICK
Fully manual: stick shift.
RoR::App::gfx_camera_height
CVar * gfx_camera_height
Definition: Application.cpp:237
RoR::GUI::GameSettings::m_bump_height
float m_bump_height
Definition: GUI_GameSettings.h:69
RoR::App::audio_master_volume
CVar * audio_master_volume
Definition: Application.cpp:209
RoR::ToLocalizedString
std::string ToLocalizedString(SimGearboxMode e)
Definition: Application.cpp:440
RoR::App::gfx_alt_actor_materials
CVar * gfx_alt_actor_materials
Definition: Application.cpp:250
RoR::App::io_ffb_camera_gain
CVar * io_ffb_camera_gain
Definition: Application.cpp:193
RoR::GUI::LoadingWindow
Definition: GUI_LoadingWindow.h:31
RoR::App::gfx_speedo_digital
CVar * gfx_speedo_digital
Definition: Application.cpp:245
RoR::GfxSkyMode::CAELUM
@ CAELUM
Caelum (best looking, slower)
RoR::CVar::getStr
std::string const & getStr() const
Definition: CVar.h:95
RoR::App::diag_log_beam_break
CVar * diag_log_beam_break
Definition: Application.cpp:147
RoR::GUI::GameSettings::DrawDiagSettings
void DrawDiagSettings()
Definition: GUI_GameSettings.cpp:414
RoR::App::io_outgauge_mode
CVar * io_outgauge_mode
Definition: Application.cpp:200
RoR::GfxFlaresMode::ALL_VEHICLES_ALL_LIGHTS
@ ALL_VEHICLES_ALL_LIGHTS
All vehicles, all lights.
CacheSystem.h
A database of user-installed content alias 'mods' (vehicles, terrains...)
RoR::App::gfx_fps_limit
CVar * gfx_fps_limit
Definition: Application.cpp:244
RoR::MSG_APP_MODCACHE_PURGE_REQUESTED
@ MSG_APP_MODCACHE_PURGE_REQUESTED
Definition: Application.h:91
RoR::GUI::GameSettings::DrawGameplaySettings
void DrawGameplaySettings()
Definition: GUI_GameSettings.cpp:269
RoR::App::io_arcade_controls
CVar * io_arcade_controls
Definition: Application.cpp:198
RoR::GUI::GameSettings::m_buf_app_extra_mod_dir
Str< 1000 > m_buf_app_extra_mod_dir
Definition: GUI_GameSettings.h:53
RoR::GfxWaterMode::BASIC
@ BASIC
Basic (fastest)
RoR::App::diag_hide_wheels
CVar * diag_hide_wheels
Definition: Application.cpp:155
RoR::GfxVegetation::NONE
@ NONE
RoR::LanguageEngine::getLanguages
std::vector< std::pair< std::string, std::string > > getLanguages()
Definition: Language.h:54
RoR::GfxShadowType::PSSM
@ PSSM
RoR::App::diag_log_beam_trigger
CVar * diag_log_beam_trigger
Definition: Application.cpp:149
RoR::GameContext::PushMessage
void PushMessage(Message m)
Doesn't guarantee order! Use ChainMessage() if order matters.
Definition: GameContext.cpp:65
RoR::App::app_state
CVar * app_state
Definition: Application.cpp:79
RoR::GUI::GameSettings::m_buf_diag_preset_terrain
Str< 1000 > m_buf_diag_preset_terrain
Definition: GUI_GameSettings.h:50
RoR::IoInputGrabMode::DYNAMIC
@ DYNAMIC
RoR::App::io_ffb_center_gain
CVar * io_ffb_center_gain
Definition: Application.cpp:194
RoR::GfxWaterMode::FULL_FAST
@ FULL_FAST
Reflection + refraction (speed optimized)
RoR::GUI::GameSettings::m_combo_items_sky_mode
std::string m_combo_items_sky_mode
Definition: GUI_GameSettings.h:60
RoR::GfxTexFilter::BILINEAR
@ BILINEAR
RoR::GUI::LoadingWindow::SetProgress
void SetProgress(int _percent, const std::string &_text="", bool render_frame=true)
Definition: GUI_LoadingWindow.cpp:33
RoR::App::gfx_declutter_map
CVar * gfx_declutter_map
Definition: Application.cpp:231
RoR::GUI::GameSettings::DrawRenderSystemSettings
void DrawRenderSystemSettings()
Definition: GUI_GameSettings.cpp:118
RoR::App::ui_show_live_repair_controls
CVar * ui_show_live_repair_controls
Definition: Application.cpp:262
RoR::App::diag_log_beam_deform
CVar * diag_log_beam_deform
Definition: Application.cpp:148
RoR::App::sim_races_enabled
CVar * sim_races_enabled
Definition: Application.cpp:105
RoR::GfxVegetation::FULL
@ FULL
RoR::SimGearboxMode::SEMI_AUTO
@ SEMI_AUTO
Manual shift with auto clutch.
RoR::GfxFlaresMode::CURR_VEHICLE_HEAD_ONLY
@ CURR_VEHICLE_HEAD_ONLY
Only current vehicle, main lights.
RoR::GUI::GameSettings::m_combo_items_tex_filter
std::string m_combo_items_tex_filter
Definition: GUI_GameSettings.h:61
RoR::App::GetGameContext
GameContext * GetGameContext()
Definition: Application.cpp:280
RoR::CVar::getEnum
T getEnum() const
Definition: CVar.h:99
RoR::App::io_outgauge_delay
CVar * io_outgauge_delay
Definition: Application.cpp:203
RoR::App::gfx_fov_internal_default
CVar * gfx_fov_internal_default
Definition: Application.cpp:241
RoR::App::gfx_envmap_enabled
CVar * gfx_envmap_enabled
Definition: Application.cpp:232
RoR::App::diag_videocameras
CVar * diag_videocameras
Definition: Application.cpp:139
RoR::App::io_ffb_stress_gain
CVar * io_ffb_stress_gain
Definition: Application.cpp:196
RoR::App::gfx_water_mode
CVar * gfx_water_mode
Definition: Application.cpp:224
RoR::GUI::GameSettings::m_buf_diag_preset_veh_config
Str< 1000 > m_buf_diag_preset_veh_config
Definition: GUI_GameSettings.h:52
RoR::GUI::GameMainMenu::SetVisible
void SetVisible(bool v)
Definition: GUI_GameMainMenu.h:43
RoR::App::gfx_flares_mode
CVar * gfx_flares_mode
Definition: Application.cpp:215
RoR::App::gfx_sky_mode
CVar * gfx_sky_mode
Definition: Application.cpp:219
RoR::GUI::LoadingWindow::PERC_HIDE_PROGRESSBAR
const int PERC_HIDE_PROGRESSBAR
Definition: GUI_LoadingWindow.h:34
_LC
#define _LC(ctx, str)
Definition: Language.h:42
RoR::DrawGIntCheck
void DrawGIntCheck(CVar *cvar, const char *label)
Definition: GUIUtils.cpp:272
RoR::App::gfx_sight_range
CVar * gfx_sight_range
Definition: Application.cpp:236
RoR::App::diag_log_console_echo
CVar * diag_log_console_echo
Definition: Application.cpp:146
RoR::SimGearboxMode::MANUAL
@ MANUAL
Fully manual: sequential shift.
GUI_GameSettings.h
RoR::App::gfx_shadow_quality
CVar * gfx_shadow_quality
Definition: Application.cpp:234
RoR::App::gfx_water_waves
CVar * gfx_water_waves
Definition: Application.cpp:226
RoR::App::io_input_grab_mode
CVar * io_input_grab_mode
Definition: Application.cpp:197
RoR::GUI::GameSettings::m_is_visible
bool m_is_visible
Definition: GUI_GameSettings.h:46
RoR::App::sim_realistic_commands
CVar * sim_realistic_commands
Definition: Application.cpp:104
RoR::App::io_blink_lock_range
CVar * io_blink_lock_range
Definition: Application.cpp:191
RoR::GfxSkyMode::SKYX
@ SKYX
SkyX (best looking, slower)
RoR::App::ui_show_vehicle_buttons
CVar * ui_show_vehicle_buttons
Definition: Application.cpp:263
RoR::App::audio_menu_music
CVar * audio_menu_music
Definition: Application.cpp:212
RoR::App::app_screenshot_format
CVar * app_screenshot_format
Definition: Application.cpp:85
RoR::GUI::GameSettings::m_combo_items_shadow_type
std::string m_combo_items_shadow_type
Definition: GUI_GameSettings.h:59
RoR::App::diag_preset_veh_config
CVar * diag_preset_veh_config
Definition: Application.cpp:144
RoR::GUI::GameSettings::DrawGeneralSettings
void DrawGeneralSettings()
Definition: GUI_GameSettings.cpp:195
RoR::GfxTexFilter::TRILINEAR
@ TRILINEAR
RoR::App::sim_no_collisions
CVar * sim_no_collisions
Definition: Application.cpp:106
RoR::Message
Unified game event system - all requests and state changes are reported using a message.
Definition: GameContext.h:51
RoR::CVar::setVal
void setVal(T val)
Definition: CVar.h:72
RoR::MSG_GUI_OPEN_MENU_REQUESTED
@ MSG_GUI_OPEN_MENU_REQUESTED
Definition: Application.h:133
RoR::App::diag_auto_spawner_report
CVar * diag_auto_spawner_report
Definition: Application.cpp:133
RoR::App::diag_camera
CVar * diag_camera
Definition: Application.cpp:134
RoR::GUI::GameSettings::m_combo_items_light_sources
std::string m_combo_items_light_sources
Definition: GUI_GameSettings.h:58
RoR::App::io_analog_smoothing
CVar * io_analog_smoothing
Definition: Application.cpp:189
RoR::App::diag_rig_log_node_stats
CVar * diag_rig_log_node_stats
Definition: Application.cpp:136
RoR::GUI::GameSettings::m_combo_items_gearbox_mode
std::string m_combo_items_gearbox_mode
Definition: GUI_GameSettings.h:57
RoR::GfxFlaresMode::NONE
@ NONE
None (fastest)
RoR::GUI::GameSettings::DrawGraphicsSettings
void DrawGraphicsSettings()
Definition: GUI_GameSettings.cpp:338
RoR::MSG_APP_MODCACHE_UPDATE_REQUESTED
@ MSG_APP_MODCACHE_UPDATE_REQUESTED
Definition: Application.h:90
RoR::IoInputGrabMode
IoInputGrabMode
Definition: Application.h:267
RoR::IoInputGrabMode::ALL
@ ALL
RoR::App::diag_allow_window_resize
CVar * diag_allow_window_resize
Definition: Application.cpp:159
RoR::App::io_outgauge_id
CVar * io_outgauge_id
Definition: Application.cpp:204
RoR::ImTerminateComboboxString
void ImTerminateComboboxString(std::string &target)
Definition: GUIUtils.cpp:396
RoR::App::diag_hide_nodes
CVar * diag_hide_nodes
Definition: Application.cpp:156
RoR::AppContext::GetOgreRoot
Ogre::Root * GetOgreRoot()
Definition: AppContext.h:65
RoR::SimGearboxMode::MANUAL_RANGES
@ MANUAL_RANGES
Fully manual: stick shift with ranges.
RoR::GUI::GameSettings::m_combo_items_input_grab
std::string m_combo_items_input_grab
Definition: GUI_GameSettings.h:65
RoR::DrawGCheckbox
bool DrawGCheckbox(CVar *cvar, const char *label)
Definition: GUIUtils.cpp:261
RoR::App::diag_envmap
CVar * diag_envmap
Definition: Application.cpp:138
RoR::App::app_async_physics
CVar * app_async_physics
Definition: Application.cpp:83
RoR::App::diag_preset_veh_enter
CVar * diag_preset_veh_enter
Definition: Application.cpp:145
RoR::App::diag_preset_terrain
CVar * diag_preset_terrain
Definition: Application.cpp:140
RoR::GUI::GameSettings::m_render_must_restart
bool m_render_must_restart
Definition: GUI_GameSettings.h:68
RoR::App::gfx_vegetation_mode
CVar * gfx_vegetation_mode
Definition: Application.cpp:223
RoR::IoInputGrabMode::NONE
@ NONE
RoR::App::audio_device_name
CVar * audio_device_name
Definition: Application.cpp:211
RoR::App::gfx_anisotropy
CVar * gfx_anisotropy
Definition: Application.cpp:225
RoR::GfxWaterMode::REFLECT
@ REFLECT
Reflection.
RoR
Definition: AppContext.h:36
RoR::App::sim_spawn_running
CVar * sim_spawn_running
Definition: Application.cpp:100
RoR::GfxFlaresMode::NO_LIGHTSOURCES
@ NO_LIGHTSOURCES
No light sources.
RoR::App::gfx_reduce_shadows
CVar * gfx_reduce_shadows
Definition: Application.cpp:248
RoR::CVar::setStr
void setStr(std::string const &str)
Definition: CVar.h:83
RoR::GUIManager::GameMainMenu
GUI::GameMainMenu GameMainMenu
Definition: GUIManager.h:104
RoR::GUI::GameSettings::m_buf_io_outgauge_ip
Str< 1000 > m_buf_io_outgauge_ip
Definition: GUI_GameSettings.h:54
RoR::GfxExtCamMode::NONE
@ NONE
RoR::GfxVegetation::x20PERC
@ x20PERC
RoR::App::gfx_surveymap_icons
CVar * gfx_surveymap_icons
Definition: Application.cpp:230
RoR::App::io_outgauge_ip
CVar * io_outgauge_ip
Definition: Application.cpp:201
RoR::GfxVegetation::x50PERC
@ x50PERC
RoR::App::sim_replay_enabled
CVar * sim_replay_enabled
Definition: Application.cpp:101
RoR::LanguageEngine::setup
void setup()
Definition: Language.cpp:48
RoR::GfxTexFilter::NONE
@ NONE
RoR::GfxWaterMode::HYDRAX
@ HYDRAX
HydraX.