MCPcopy Create free account
hub / github.com/Panzerschrek/Chasm-Reverse / OptionsMenu

Method OptionsMenu

PanzerChasm/menu.cpp:1823–1845  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1821};
1822
1823OptionsMenu::OptionsMenu( MenuBase* parent, const Sound::SoundEnginePtr& sound_engine, HostCommands& host_commands )
1824 : MenuBase( parent, sound_engine )
1825 , settings_( host_commands.GetSettings() )
1826 , controls_menu_( this, sound_engine, host_commands )
1827 , video_menu_( this, sound_engine, host_commands )
1828 , graphics_menu_( this, sound_engine, host_commands )
1829{
1830 always_run_= settings_.GetOrSetBool( SettingsKeys::always_run, true );
1831 crosshair_= settings_.GetOrSetBool( SettingsKeys::crosshair, true );
1832 reverse_mouse_= settings_.GetOrSetBool( SettingsKeys::reverse_mouse, false );
1833 weapon_reset_= settings_.GetOrSetBool( SettingsKeys::weapon_reset, false );
1834 old_style_perspecive_= settings_.GetBool( SettingsKeys::old_style_perspective, false );
1835
1836 brightness_= static_cast<int>( std::round( float(c_max_slider_value) * settings_.GetOrSetFloat( SettingsKeys::brightness, 0.5f ) ) );
1837 fx_volume_= static_cast<int>( std::round( float(c_max_slider_value) * settings_.GetOrSetFloat( SettingsKeys::fx_volume, 0.5f ) ) );
1838 cd_volume_= static_cast<int>( std::round( float(c_max_slider_value) * settings_.GetOrSetFloat( SettingsKeys::cd_volume, 0.5f ) ) );
1839 {
1840 const float settings_fov= std::max( c_min_fov, std::min( c_max_fov, settings_.GetOrSetFloat( SettingsKeys::fov, 90.0f ) ) );
1841 const float relative_fov_value= ( settings_fov - c_min_fov ) / ( c_max_fov - c_min_fov );
1842 fov_ = static_cast<int>( std::round( float(c_max_slider_value) * relative_fov_value ) );
1843 }
1844 mouse_sensetivity_= static_cast<int>( std::round( float(c_max_slider_value) * settings_.GetOrSetFloat( SettingsKeys::mouse_sensetivity, 0.5f ) ) );
1845}
1846
1847OptionsMenu::~OptionsMenu()
1848{}

Callers

nothing calls this directly

Calls 3

GetOrSetBoolMethod · 0.80
GetBoolMethod · 0.80
GetOrSetFloatMethod · 0.80

Tested by

no test coverage detected