Module: Lich::Common::CharSettings

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

Class Method Summary collapse

Class Method Details

.[](name) ⇒ Object

Retrieves the value associated with the given setting name.

Examples:

value = CharSettings[:some_setting]

Parameters:

  • name (String)

    the name of the setting to retrieve

Returns:

  • (Object)

    the value of the setting, or nil if not found



14
15
16
# File 'lib/common/settings/charsettings.rb', line 14

def CharSettings.[](name)
  Settings.to_hash("#{XMLData.game}:#{XMLData.name}")[name]
end

.[]=(name, value) ⇒ Object

Sets the value for the given setting name.

Examples:

CharSettings[:some_setting] = 'new_value'

Parameters:

  • name (String)

    the name of the setting to set

  • value (Object)

    the value to assign to the setting

Returns:

  • (Object)

    the value that was set



25
26
27
# File 'lib/common/settings/charsettings.rb', line 25

def CharSettings.[]=(name, value)
  Settings.set_script_settings("#{XMLData.game}:#{XMLData.name}", name, value)
end

.autonil

Deprecated.

This method is deprecated and not applicable.

Retrieves the auto setting (deprecated).

Examples:

value = CharSettings.auto

Returns:

  • (nil)

    always returns nil



100
101
102
103
# File 'lib/common/settings/charsettings.rb', line 100

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

.auto=(_val) ⇒ nil

Deprecated.

This method is deprecated and not applicable.

Sets the auto setting (deprecated).

Examples:

CharSettings.auto = true

Parameters:

  • _val (Object)

    the value to set (not used)

Returns:

  • (nil)

    always returns nil



89
90
91
92
# File 'lib/common/settings/charsettings.rb', line 89

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

.autoloadnil

Deprecated.

This method is deprecated and not applicable.

Retrieves the autoload setting (deprecated).

Examples:

value = CharSettings.autoload

Returns:

  • (nil)

    always returns nil



111
112
113
114
# File 'lib/common/settings/charsettings.rb', line 111

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

.clearnil

Deprecated.

This method is deprecated and not applicable.

Clears character settings (deprecated).

Examples:

CharSettings.clear

Returns:

  • (nil)

    always returns nil



77
78
79
80
# File 'lib/common/settings/charsettings.rb', line 77

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

.loadnil

Deprecated.

This method is deprecated and not applicable.

Loads character settings (deprecated).

Examples:

CharSettings.load

Returns:

  • (nil)

    always returns nil



44
45
46
47
# File 'lib/common/settings/charsettings.rb', line 44

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

.savenil

Deprecated.

This method is deprecated and not applicable.

Saves character settings (deprecated).

Examples:

CharSettings.save

Returns:

  • (nil)

    always returns nil



55
56
57
58
# File 'lib/common/settings/charsettings.rb', line 55

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

.save_allnil

Deprecated.

This method is deprecated and not applicable.

Saves all character settings (deprecated).

Examples:

CharSettings.save_all

Returns:

  • (nil)

    always returns nil



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

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

.to_hashHash

Converts the character settings to a hash.

Examples:

settings_hash = CharSettings.to_hash

Returns:

  • (Hash)

    a hash representation of the character settings



34
35
36
# File 'lib/common/settings/charsettings.rb', line 34

def CharSettings.to_hash
  Settings.to_hash("#{XMLData.game}:#{XMLData.name}")
end