 |
RigsofRods
Soft-body Physics Simulation
|
Go to the documentation of this file.
39 const int flags = ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoScrollbar;
40 ImGui::SetNextWindowSize(ImVec2(670.f, 400.f), ImGuiCond_FirstUseEver);
46 ImGui::SetNextWindowPosCenter(ImGuiCond_Appearing);
47 bool keep_open =
true;
48 ImGui::Begin(
_LC(
"GameSettings",
"Game settings"), &keep_open, flags);
50 ImGui::BeginTabBar(
"GameSettingsTabs");
52 const float child_height = ImGui::GetWindowHeight()
53 - ((2.f * ImGui::GetStyle().WindowPadding.y) + (3.f * ImGui::GetItemsLineHeightWithSpacing())
54 + ImGui::GetStyle().ItemSpacing.y);
56 if (ImGui::BeginTabItem(
_LC(
"GameSettings",
"Render System")))
58 ImGui::BeginChild(
"Settings-Render-scroll", ImVec2(0.f, child_height),
false);
63 if (ImGui::BeginTabItem(
_LC(
"GameSettings",
"General")))
65 ImGui::BeginChild(
"Settings-General-scroll", ImVec2(0.f, child_height),
false);
70 if (ImGui::BeginTabItem(
_LC(
"GameSettings",
"Gameplay")))
72 ImGui::BeginChild(
"Settings-Gameplay-scroll", ImVec2(0.f, child_height),
false);
77 if (ImGui::BeginTabItem(
_LC(
"GameSettings",
"UI")))
79 ImGui::BeginChild(
"Settings-UI-scroll", ImVec2(0.f, child_height),
false);
84 if (ImGui::BeginTabItem(
_LC(
"GameSettings",
"Graphics")))
86 ImGui::BeginChild(
"Settings-Graphics-scroll", ImVec2(0.f, child_height),
false);
91 if (ImGui::BeginTabItem(
_LC(
"GameSettings",
"Audio")))
93 ImGui::BeginChild(
"Settings-Audio-scroll", ImVec2(0.f, child_height),
false);
98 if (ImGui::BeginTabItem(
_LC(
"GameSettings",
"Controls")))
100 ImGui::BeginChild(
"Settings-Controls-scroll", ImVec2(0.f, child_height),
false);
105 if (ImGui::BeginTabItem(
_LC(
"GameSettings",
"Diagnostic")))
107 ImGui::BeginChild(
"Settings-Diag-scroll", ImVec2(0.f, child_height),
false);
115 ImGui::SetCursorPosY(ImGui::GetCursorPosY() + 4.f);
127 ImGui::TextDisabled(
"%s",
_LC(
"GameSettings",
"Render system (changes require a restart)"));
131 std::string text =
_LC(
"GameSettings",
"You must restart the game to make changes effective.");
132 ImVec2 box_size = ImGui::CalcTextSize(text.c_str()) + ImGui::GetStyle().FramePadding * 2;
133 ImVec2 box_pos = ImGui::GetCursorPos() + ImVec2(ImGui::GetWindowContentRegionWidth() * 0.5f - box_size.x * 0.5f, 0.f);
134 ImGui::SetCursorPos(box_pos);
135 ImGui::PushStyleColor(ImGuiCol_FrameBg, ImVec4(0.8f, 0.7f, 0.1f, 1.f));
136 ImGui::BeginChildFrame(ImGuiID(123), box_size);
137 ImGui::TextColored(ImVec4(0.1f, 0.1f, 0.1f, 1.f), text.c_str());
138 ImGui::EndChildFrame();
139 ImGui::PopStyleColor();
143 const auto render_systems = ogre_root->getAvailableRenderers();
144 std::string render_system_names;
145 for (
auto rs : render_systems)
147 render_system_names += rs->getName() +
'\0';
150 const auto rs = ro ? ro : ogre_root->getRenderSystem();
151 const auto it = std::find(render_systems.begin(), render_systems.end(), rs);
152 int render_id = it != render_systems.end() ? std::distance(render_systems.begin(), it) : 0;
154 if (ImGui::Combo(
_LC (
"GameSettings",
"Render System"), &render_id, render_system_names.c_str()))
159 const auto config_options = ogre_root->getRenderSystem()->getConfigOptions();
160 std::set<std::string> filter = {
"Allow NVPerfHUD",
"Colour Depth",
"Fixed Pipeline Enabled",
161 "Floating-point mode",
"Resource Creation Policy",
"VSync Interval",
"sRGB Gamma Conversion"};
162 for (
auto opt : config_options)
164 auto co = opt.second;
167 if (co.possibleValues.empty())
169 if (filter.find(co.name) != filter.end())
171 std::sort(co.possibleValues.rbegin(), co.possibleValues.rend());
172 std::string option_values;
173 for (
auto value : co.possibleValues)
175 option_values += value +
'\0';
177 const auto it = std::find(co.possibleValues.begin(), co.possibleValues.end(), opt.second.currentValue);
178 int option_id = it != co.possibleValues.end() ? std::distance(co.possibleValues.begin(), it) : 0;
179 if (ImGui::Combo(co.name.c_str(), &option_id, option_values.c_str()))
182 if (co.currentValue != co.possibleValues[option_id])
185 rs->setConfigOption(co.name, co.possibleValues[option_id]);
186 if (rs->validateConfigOptions().empty())
188 ogre_root->saveConfig();
194 m_bump_height = ImGui::GetTextLineHeightWithSpacing() + ImGui::GetStyle().FramePadding.y * 2;
204 ImGui::TextDisabled(
"%s",
_LC(
"GameSettings",
"Application settings"));
208 std::string lang_values;
209 for (
auto value : languages)
211 lang_values += value.first +
'\0';
213 const auto it = std::find_if(languages.begin(), languages.end(),
214 [](
const std::pair<std::string, std::string>& l) { return l.second == App::app_language->getStr(); });
215 int lang_selection = it != languages.end() ? std::distance(languages.begin(), it) : 0;
216 if (ImGui::Combo(
_LC(
"GameSettings",
"Language"), &lang_selection, lang_values.c_str()))
224 static Ogre::FileInfoListPtr fl = Ogre::ResourceGroupManager::getSingleton().findResourceFileInfo(
"FlagsRG",
"*");
227 static std::vector<std::string> countries;
228 if (countries.empty())
230 for (
auto&
file : *fl)
232 std::string country = Ogre::StringUtil::replaceAll(
file.filename,
".png",
"");
233 if (country.size() == 2)
235 countries.push_back(country);
238 std::sort(countries.begin(), countries.end());
240 std::string country_values;
241 for (
auto value : countries)
243 country_values += value +
'\0';
246 int country_selection = it != countries.end() ? std::distance(countries.begin(), it) : 0;
247 if (ImGui::Combo(
_LC(
"GameSettings",
"Country"), &country_selection, country_values.c_str()))
256 if (ImGui::Combo(
_LC(
"GameSettings",
"Screenshot format"), &sshot_select,
"png\0jpg\0\0"))
258 std::string str = (sshot_select == 1) ?
"jpg" :
"png";
268 if (ImGui::Button(
_LC(
"GameSettings",
"Update cache")))
278 ImGui::TextDisabled(
"%s",
_LC(
"GameSettings",
"Simulation settings"));
311 ImGui::TextDisabled(
"%s",
_LC(
"GameSettings",
"Audio settings"));
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;
317 while (device && *device !=
'\0' && next && *next !=
'\0')
319 audio_devices.push_back(device);
320 size_t len = strlen(device);
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))
367 ImGui::TextDisabled(
"%s",
_LC(
"GameSettings",
"UI settings"));
391 ImGui::TextDisabled(
"%s",
_LC(
"GameSettings",
"Video settings"));
422 int selection = std::log2(anisotropy);
423 if (ImGui::Combo(
_LC(
"GameSettings",
"Anisotropy"), &selection,
"1\0""2\0""4\0""8\0""16\0\0"))
445 ImGui::PushItemWidth(125.f);
447 ImGui::PopItemWidth();
464 ImGui::TextDisabled(
"%s",
_LC(
"GameSettings",
"Diagnostic options"));
465 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"));
488 if (ImGui::Button(
_LC(
"GameSettings",
"Rebuild cache")))
498 ImGui::TextDisabled(
"%s",
_LC(
"GameSettings",
"Controller options"));
508 _LC(
"GameSettings",
"Restarting input subsystem, please wait..."),
false);
521 ImGui::PushItemWidth(125.f);
526 ImGui::PopItemWidth();
533 ImGui::PushItemWidth(125.f);
537 ImGui::PopItemWidth();
650 ImGui::PushID(
"uiPreset");
658 if (ImGui::IsItemHovered())
660 ImGui::BeginTooltip();
661 const float COLLUMNWIDTH_NAME = 175.f;
662 const float COLLUMNWIDTH_VALUE = 60.f;
664 ImGui::Dummy(ImVec2(COLLUMNWIDTH_NAME + COLLUMNWIDTH_VALUE*((
int)
UiPreset::Count), 1.f));
668 ImGui::SetColumnWidth(0, COLLUMNWIDTH_NAME);
671 ImGui::SetColumnWidth(i+1, COLLUMNWIDTH_VALUE);
675 ImGui::TextDisabled(
"%s",
"Setting");
687 while (
UiPresets[presetId].uip_cvar !=
nullptr)
689 ImGui::Text(
"%s",
UiPresets[presetId].uip_cvar);
693 ImGui::Text(
"%s",
UiPresets[presetId].uip_values[i].c_str());
715 ImGui::AlignTextToFramePadding();
724 ImGui::Text(
"%s", label.c_str());
Game state manager and message-queue provider.
CVar * io_invert_orbitcam
CVar * diag_rig_log_node_import
@ SANDSTORM
Sandstorm (fastest)
CVar * sim_quickload_dialog
CVar * audio_doppler_factor
void DrawControlSettings()
CVar * sim_replay_stepping
CVar * diag_warning_texture
Ogre::String dname
name parsed from the file
Str< 1000 > m_buf_audio_force_listener_efx_preset
LanguageEngine * GetLanguageEngine()
CVar * gfx_speedo_imperial
std::string m_combo_items_extcam_mode
void ImAddItemToComboboxString(std::string &target, std::string const &item)
CVar * diag_preset_vehicle
void DrawGFloatSlider(CVar *cvar, const char *label, float v_min, float v_max)
@ MSG_APP_REINIT_INPUT_REQUESTED
CVar * audio_enable_occlusion
CVar * audio_default_efx_preset
CVar * app_skip_main_menu
GUIManager * GetGuiManager()
void DrawGTextEdit(CVar *cvar, const char *label, Str< 1000 > &buf)
CVar * diag_hide_broken_beams
UiPreset
See UiPresets[] list in GUIManager.cpp (declared extern in GUIManager.h)
std::string m_cached_uipreset_combo_string
CVar * audio_engine_controls_environmental_audio
This is a raw Ogre binding for Imgui No project cmake file
void DrawGIntBox(CVar *cvar, const char *label)
CVar * gfx_skidmarks_mode
AppContext * GetAppContext()
CacheCategoryId default_dash_being_selected
Truck file format(technical spec)
void DrawUiDefaultDashboard(CacheEntryPtr &entry, CVar *cvar, CacheCategoryId category_id, const std::string &label)
CVar * gfx_particles_mode
CVar * gfx_enable_videocams
void DrawGFloatBox(CVar *cvar, const char *label)
CVar * io_analog_sensitivity
CVar * app_rendersys_override
CVar * ui_default_boat_dash
string; name of the '.dashboard' file in modcache.
System integration layer; inspired by OgreBites::ApplicationContext.
bool DrawGCombo(CVar *cvar, const char *label, const char *values)
CVar * gfx_fov_external_default
CVar * sim_no_self_collisions
void DrawGIntSlider(CVar *cvar, const char *label, int v_min, int v_max)
CVar * ui_preset
enum RoR::UiPreset
GUI::GameSettings GameSettings
Str< 1000 > m_buf_diag_preset_vehicle
CVar * app_disable_online_api
CVar * audio_enable_reflection_panning
CVar * gfx_texture_filter
CVar * app_extra_mod_path
CVar * io_ffb_master_gain
@ FULL_HQ
Reflection + refraction (quality optimized)
std::string m_combo_items_water_mode
std::string m_combo_items_vegetation
CVar * diag_hide_wheel_info
GUI::LoadingWindow LoadingWindow
@ ALL_VEHICLES_HEAD_ONLY
All vehicles, main lights.
CVar * audio_enable_creak
const float UI_SELECTOR_WIDTH
CVar * sim_tuning_enabled
std::string m_combo_items_efx_reverb_engine
@ MANUAL_STICK
Fully manual: stick shift.
CVar * audio_master_volume
std::string ToLocalizedString(SimGearboxMode e)
CVar * gfx_alt_actor_materials
CVar * io_ffb_camera_gain
CVar * audio_force_listener_efx_preset
@ CAELUM
Caelum (best looking, slower)
std::string const & getStr() const
CVar * ui_default_truck_dash
string; name of the '.dashboard' file in modcache.
CVar * diag_log_beam_break
CacheEntryPtr FindEntryByFilename(RoR::LoaderType type, bool partial, const std::string &_filename_maybe_bundlequalified)
Returns NULL if none found; "Bundle-qualified" format also specifies the ZIP/directory in modcache,...
@ ALL_VEHICLES_ALL_LIGHTS
All vehicles, all lights.
A database of user-installed content alias 'mods' (vehicles, terrains...)
@ MSG_APP_MODCACHE_PURGE_REQUESTED
void DrawGameplaySettings()
CVar * io_arcade_controls
Str< 1000 > m_buf_app_extra_mod_dir
std::vector< std::pair< std::string, std::string > > getLanguages()
CVar * diag_log_beam_trigger
void PushMessage(Message m)
Doesn't guarantee order! Use ChainMessage() if order matters.
Str< 1000 > m_buf_diag_preset_terrain
CVar * io_ffb_center_gain
@ FULL_FAST
Reflection + refraction (speed optimized)
std::string m_combo_items_sky_mode
void SetProgress(int _percent, const std::string &_text="", bool render_frame=true)
void DrawRenderSystemSettings()
CVar * ui_show_live_repair_controls
bool
@ MSG_GUI_OPEN_SELECTOR_REQUESTED
Payload = LoaderType* (owner), Description = GUID | empty.
CVar * diag_log_beam_deform
LoaderType
< Search mode for ModCache::Query() & Operation mode for GUI::MainSelector
@ SEMI_AUTO
Manual shift with auto clutch.
@ CURR_VEHICLE_HEAD_ONLY
Only current vehicle, main lights.
std::string m_combo_items_tex_filter
GameContext * GetGameContext()
CVar * audio_enable_directed_sounds
CVar * gfx_fov_internal_default
void ApplyUiPreset()
reads cvar 'ui_preset'
CVar * gfx_envmap_enabled
CVar * io_ffb_stress_gain
Str< 1000 > m_buf_diag_preset_veh_config
CacheEntryPtr m_ui_known_dash_boat
const int PERC_HIDE_PROGRESSBAR
Quake-style console variable, defined in RoR.cfg or crated via Console UI and scripts.
void DrawGIntCheck(CVar *cvar, const char *label)
CVar * diag_log_console_echo
@ MANUAL
Fully manual: sequential shift.
CVar * gfx_shadow_quality
CVar * io_input_grab_mode
CVar * sim_realistic_commands
CVar * io_blink_lock_range
CacheSystem * GetCacheSystem()
@ SKYX
SkyX (best looking, slower)
CVar * ui_show_vehicle_buttons
CVar * app_screenshot_format
std::string m_combo_items_shadow_type
CVar * diag_preset_veh_config
void DrawGeneralSettings()
CVar * audio_force_obstruction_inside_vehicles
Unified game event system - all requests and state changes are reported using a message.
CVar * audio_efx_reverb_engine
@ MSG_GUI_OPEN_MENU_REQUESTED
CVar * diag_auto_spawner_report
std::string m_combo_items_light_sources
CVar * io_analog_smoothing
CVar * diag_rig_log_node_stats
std::string m_combo_items_gearbox_mode
class AngelOgre::OverlayManager & getName
void DrawGraphicsSettings()
@ MSG_APP_MODCACHE_UPDATE_REQUESTED
CVar * diag_allow_window_resize
void ImTerminateComboboxString(std::string &target)
Ogre::Root * GetOgreRoot()
@ MANUAL_RANGES
Fully manual: stick shift with ranges.
std::string m_combo_items_input_grab
bool DrawGCheckbox(CVar *cvar, const char *label)
CVar * diag_preset_veh_enter
Str< 1000 > m_buf_audio_default_efx_preset
CVar * diag_preset_terrain
bool m_render_must_restart
CVar * gfx_vegetation_mode
CacheEntryPtr m_ui_known_dash_truck
CVar * audio_enable_obstruction
UiPresetEntry UiPresets[]
Global list of UI Presets, selectable via Settings menu in TopMenubar.
@ NO_LIGHTSOURCES
No light sources.
CVar * gfx_reduce_shadows
void setStr(std::string const &str)
GUI::GameMainMenu GameMainMenu
Str< 1000 > m_buf_io_outgauge_ip
CVar * gfx_surveymap_icons
CVar * sim_replay_enabled
Ogre::String fname
filename