Module: Lich::Common::GameSettings
- Defined in:
- documented/common/settings/gamesettings.rb
Overview
Module for managing game settings in Lich 5 Provides methods to access and modify game settings.
Class Method Summary collapse
-
.[](name) ⇒ Object
Retrieves a scoped setting by name.
-
.[]=(name, value) ⇒ void
Sets a scoped setting by name.
-
.active_scope ⇒ String
Helper to get the active scope for GameSettings Assumes XMLData.game is available and provides the correct scope string.
-
.auto ⇒ nil
deprecated
Deprecated.
This method is not applicable and will log a deprecation warning.
-
.auto=(_val) ⇒ void
deprecated
Deprecated.
This method is not applicable and will log a deprecation warning.
-
.autoload ⇒ nil
deprecated
Deprecated.
This method is not applicable and will log a deprecation warning.
-
.clear ⇒ nil
deprecated
Deprecated.
This method is not applicable and will log a deprecation warning.
-
.load ⇒ nil
deprecated
Deprecated.
This method is not applicable and will log a deprecation warning.
-
.save ⇒ nil
deprecated
Deprecated.
This method is not applicable and will log a deprecation warning.
-
.save_all ⇒ nil
deprecated
Deprecated.
This method is not applicable and will log a deprecation warning.
-
.to_hash ⇒ Object
Converts the current game settings to a hash-like structure.
Class Method Details
.[](name) ⇒ Object
Retrieves a scoped setting by name.
27 28 29 |
# File 'documented/common/settings/gamesettings.rb', line 27 def self.[](name) Settings.get_scoped_setting(active_scope, name) end |
.[]=(name, value) ⇒ void
This method returns an undefined value.
Sets a scoped setting by name.
37 38 39 |
# File 'documented/common/settings/gamesettings.rb', line 37 def self.[]=(name, value) Settings.set_script_settings(active_scope, name, value) end |
.active_scope ⇒ String
Helper to get the active scope for GameSettings Assumes XMLData.game is available and provides the correct scope string. Retrieves the active scope for GameSettings. Assumes XMLData.game is available and provides the correct scope string.
18 19 20 |
# File 'documented/common/settings/gamesettings.rb', line 18 def self.active_scope XMLData.game end |
.auto ⇒ nil
This method is not applicable and will log a deprecation warning.
Retrieves the auto setting (deprecated).
107 108 109 110 |
# File 'documented/common/settings/gamesettings.rb', line 107 def GameSettings.auto Lich.deprecated("GameSettings.auto", "not using, not applicable,", caller[0], fe_log: true) nil end |
.auto=(_val) ⇒ void
This method is not applicable and will log a deprecation warning.
This method returns an undefined value.
Sets the auto setting (deprecated).
100 101 102 |
# File 'documented/common/settings/gamesettings.rb', line 100 def GameSettings.auto=(_val) Lich.deprecated("GameSettings.auto=(val)", "not using, not applicable,", caller[0], fe_log: true) end |
.autoload ⇒ nil
This method is not applicable and will log a deprecation warning.
Retrieves the autoload setting (deprecated).
115 116 117 118 |
# File 'documented/common/settings/gamesettings.rb', line 115 def GameSettings.autoload Lich.deprecated("GameSettings.autoload", "not using, not applicable,", caller[0], fe_log: true) nil end |
.clear ⇒ nil
This method is not applicable and will log a deprecation warning.
Clears game settings (deprecated).
91 92 93 94 |
# File 'documented/common/settings/gamesettings.rb', line 91 def GameSettings.clear Lich.deprecated("GameSettings.clear", "not using, not applicable,", caller[0], fe_log: true) nil end |
.load ⇒ nil
This method is not applicable and will log a deprecation warning.
deprecated Loads game settings (deprecated).
61 62 63 64 |
# File 'documented/common/settings/gamesettings.rb', line 61 def GameSettings.load Lich.deprecated("GameSettings.load", "not using, not applicable,", caller[0], fe_log: true) nil end |
.save ⇒ nil
This method is not applicable and will log a deprecation warning.
Saves game settings (deprecated).
71 72 73 74 |
# File 'documented/common/settings/gamesettings.rb', line 71 def GameSettings.save Lich.deprecated("GameSettings.save", "not using, not applicable,", caller[0], fe_log: true) nil end |
.save_all ⇒ nil
This method is not applicable and will log a deprecation warning.
Saves all game settings (deprecated).
81 82 83 84 |
# File 'documented/common/settings/gamesettings.rb', line 81 def GameSettings.save_all Lich.deprecated("GameSettings.save_all", "not using, not applicable,", caller[0], fe_log: true) nil end |
.to_hash ⇒ Object
Converts the current game settings to a hash-like structure. This method does not behave like a standard Ruby hash request. It returns a root proxy for the game settings scope, allowing persistent modifications on the returned object for legacy support.
48 49 50 51 52 53 |
# File 'documented/common/settings/gamesettings.rb', line 48 def self.to_hash # NB: This method does not behave like a standard Ruby hash request. # It returns a root proxy for the game settings scope, allowing persistent # modifications on the returned object for legacy support. Settings.wrap_value_if_container(Settings.current_script_settings(active_scope), active_scope, []) end |