Module: Lich::Common::CharSettings Private

Defined in:
documented/common/settings/charsettings.rb

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Class Method Summary collapse

Class Method Details

.[](name) ⇒ OpenStruct

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Retrieves a scoped setting by name.

Parameters:

  • name (String) —

    the name of the setting to retrieve

Returns:

  • (OpenStruct) —

    the value of the setting



19
20
21
# File 'documented/common/settings/charsettings.rb', line 19

def self.[](name)
  Settings.get_scoped_setting(active_scope, name)
end

.[]=(name, value) ⇒ void

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

This method returns an undefined value.

Sets a scoped setting by name.

Parameters:

  • name (String) —

    the name of the setting to set

  • value (OpenStruct) —

    the value to assign to the setting



28
29
30
# File 'documented/common/settings/charsettings.rb', line 28

def self.[]=(name, value)
  Settings.set_script_settings(active_scope, name, value)
end

.active_scope ⇒ String

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns the active scope for character settings.

This scope is a combination of the current game and character name.

Returns:

  • (String) —

    the active scope in the format "game:name"



10
11
12
13
# File 'documented/common/settings/charsettings.rb', line 10

def self.active_scope
  # Ensure XMLData.game and XMLData.name are available and up-to-date when scope is needed
  "#{XMLData.game}:#{XMLData.name}"
end

.auto ⇒ nil

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Retrieves the auto setting (deprecated).

This method is deprecated and not applicable.

Returns:

  • (nil)


93
94
95
96
# File 'documented/common/settings/charsettings.rb', line 93

def self.auto
  Lich.deprecated("CharSettings.auto", "not using, not applicable,", caller[0], fe_log: true)
  nil
end

.auto=(_val) ⇒ void

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

This method returns an undefined value.

Sets the auto setting (deprecated).

This method is deprecated and not applicable.

Parameters:

  • _val (Boolean) —

    the value to set for auto



85
86
87
# File 'documented/common/settings/charsettings.rb', line 85

def self.auto=(_val)
  Lich.deprecated("CharSettings.auto=(val)", "not using, not applicable,", caller[0], fe_log: true)
end

.autoload ⇒ nil

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Retrieves the autoload setting (deprecated).

This method is deprecated and not applicable.

Returns:

  • (nil)


102
103
104
105
# File 'documented/common/settings/charsettings.rb', line 102

def self.autoload
  Lich.deprecated("CharSettings.autoload", "not using, not applicable,", caller[0], fe_log: true)
  nil
end

.clear ⇒ nil

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Clears character settings (deprecated).

This method is deprecated and not applicable.

Returns:

  • (nil)


75
76
77
78
# File 'documented/common/settings/charsettings.rb', line 75

def self.clear
  Lich.deprecated("CharSettings.clear", "not using, not applicable,", caller[0], fe_log: true)
  nil
end

.load ⇒ nil

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Loads character settings (deprecated).

This method is deprecated and not applicable.

Returns:

  • (nil)


48
49
50
51
# File 'documented/common/settings/charsettings.rb', line 48

def self.load
  Lich.deprecated("CharSettings.load", "not using, not applicable,", caller[0], fe_log: true)
  nil
end

.save ⇒ nil

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Saves character settings (deprecated).

This method is deprecated and not applicable.

Returns:

  • (nil)


57
58
59
60
# File 'documented/common/settings/charsettings.rb', line 57

def self.save
  Lich.deprecated("CharSettings.save", "not using, not applicable,", caller[0], fe_log: true)
  nil
end

.save_all ⇒ nil

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Saves all character settings (deprecated).

This method is deprecated and not applicable.

Returns:

  • (nil)


66
67
68
69
# File 'documented/common/settings/charsettings.rb', line 66

def self.save_all
  Lich.deprecated("CharSettings.save_all", "not using, not applicable,", caller[0], fe_log: true)
  nil
end

.to_hash ⇒ OpenStruct

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Converts the character settings to a hash-like structure.

This method returns a root proxy for the character settings scope, allowing persistent modifications on the returned object for legacy support.

Returns:

  • (OpenStruct) —

    a proxy for the character settings



37
38
39
40
41
42
# File 'documented/common/settings/charsettings.rb', line 37

def self.to_hash
  # NB:  This method does not behave like a standard Ruby hash request.
  # It returns a root proxy for the character 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