These instructions cover customizing the options menus.
User choices persist in a user config file, and are loaded when the app opens.
By default, more options are provided than are generally needed. It is recommended to hide or remove the extras.
- Open
master_options_menu_with_tabs.tscn. - Delete nodes of option scenes that do not apply to the game.
Controlsis usually useful for supporting input remapping.Inputscan be removed unless supporting a 3D camera.Audiois usually useful.Videois usually useful.Gamecan be removed unless supporting persistant game state.
- Open
mini_options_menu.tscnor[audio|visual|input|game]_options_menu.tscnscenes to edit their options. - If an individual option is not desired, it can be hidden or removed entirely (sometimes with some additional work).
New buttons, sliders, or editable text fields can be added that automatically persist user choices between sessions.
Custom options can be added to a menu without any code.
- Add an
option_control.tscnnode as a child to a container in a scene.slider_option_control.tscnortoggle_option_control.tscncan be used if those types match requirements. In that case, skip step 6.list_option_control.tscnandvector_2_list_option_control.tscnare also available, but more complicated. See theScreenResolutionexample.
- Select the
OptionControlnode just added, to edit it in the inspector. - Add an
Option Name. This prefills theKeystring. - Select an
Option Section. This prefills theSectionstring. - Add any kind of
Button,Slider,LineEdit, orTextEditto theOptionControlnode. - Save the scene.
For options to have any effect outside of the menus, they will need to be referenced by their key and section from the PlayerConfig class.
PlayerConfig.get_config(key, section)
For example, here is how to get the player's desired input sensitivity for controlling a player camera.
var mouse_sensitivity : float = PlayerConfig.get_config(AppSettings.INPUT_SECTION, "MouseSensitivity", 1.0)
var joypad_sensitivity : float = PlayerConfig.get_config(AppSettings.INPUT_SECTION, "JoypadSensitivity", 1.0)
Validate the values being stored in your local player_config.cfg file.
- Navigate to
Project > Open User Data Folder. - Open
player_config.cfg. - Find the section by the section name in brackets, and the key name followed by an equals.
For example, here is how the player's desired input sensitivity could appear in the config file.
[InputSettings]
MouseSensitivity=1.05
JoypadSensitivity=0.95
Note
Some settings may not appear until they have been customized.