SproutyDialogsSettingsManager
Inherits: RefCounted
Description
This class manages the settings for the Sprouty Dialogs plugin. It provides methods to get, set, check and reset settings.
You shouldn't instantiate this class directly, use SproutyDialogsSettingsManager as a global class. Preferably use it through the Sprouty Dialogs autoload instead, as it is the recommended option.
Methods
| Return Type | Method |
|---|---|
| Variant | get_setting(setting_name: String) |
| void | set_setting(setting_name: String, value: Variant) |
| bool | has_setting(setting_name: String) |
| Variant | get_default_setting(setting_name: String) |
| void | reset_setting(setting_name: String) |
| void | initialize_default_settings() |
Constants
const DEFAULT_DIALOG_BOX_PATH = "res://addons/sprouty_dialogs/nodes/defaults/default_dialog_box.tscn"
Default dialog box path to load if no dialog box is specified.
const DEFAULT_PORTRAIT_PATH = "res://addons/sprouty_dialogs/nodes/defaults/default_portrait.tscn"
Default portrait scene path to load when creating a new portrait.
Method Descriptions
func get_setting(setting_name: String) -> Variant
Returns a setting value from the plugin settings. If the setting is not found, it returns null and prints an error message.
func set_setting(setting_name: String, value: Variant) -> void
Sets a setting value in the plugin settings. If the setting is not found, it prints an error message.
func has_setting(setting_name: String) -> bool
Checks if a setting exists in the plugin settings.
func get_default_setting(setting_name: String) -> Variant
Returns the default value of a setting.
func reset_setting(setting_name: String) -> void
Reset a setting to its default value.
func initialize_default_settings() -> void
Initializes the default settings for the plugin. This method should be called when the plugin is first loaded or when the settings are reset.