ESCSettingsManager

Extends: RefCounted

Description

Escoria settings manager.

Constants

SETTINGS_TEMPLATE

const SETTINGS_TEMPLATE = "settings.tres"

Template for settings filename.

Members

settings_folder

var settings_folder: String

Variable containing the settings folder obtained from Project Settings.

custom_settings

var custom_settings: Dictionary

Dictionary containing specific settings that gamedev wants to save in settings. This variable is access-free. Getting its content is gamedev’s duty. It is saved with other Escoria settings data when save_settings() is called.

Methods


apply_settings

func apply_settings() -> void

Apply the loaded settings.

Parameters

None.

Returns

Returns nothing.


save_settings_resource_to_project_settings

func save_settings_resource_to_project_settings(settings: ESCSaveSettings) -> void

Save the settings resource to project settings.

Parameters

Name

Type

Description

Required?

settings

ESCSaveSettings

ESCSaveSettings resource to save.

yes

Returns

Returns nothing.


load_settings

func load_settings() -> void

Load the game settings from the settings file.

Parameters

None.

Returns

Returns nothing.


get_settings

func get_settings() -> ESCSaveSettings

Load the game settings from the settings file.

Parameters

None.

Returns

Returns a ESCSaveSettings value. (ESCSaveSettings)


load_settings_from_dict

func load_settings_from_dict(settings_dict: Dictionary) -> void

Load the game settings from a dictionary.

Parameters

Name

Type

Description

Required?

settings_dict

Dictionary

Dictionary containing the settings to load.

yes

Returns

Returns nothing.


get_settings_dict

func get_settings_dict() -> Dictionary

Get the game settings as a dictionary.

Parameters

None.

Returns

Returns a Dictionary value. (Dictionary)


save_settings

func save_settings() -> void

Save the game settings in the settings file.

Parameters

None.

Returns

Returns nothing.


get_custom_setting

func get_custom_setting(key: String, default_value: Variant) -> Variant

Returns a custom setting by key or an optional default value. Returns null if not found and no default value is defined.