Skip to content

Setting

GianptDev edited this page Apr 23, 2022 · 3 revisions

Setting

Inherits: Reference < Object

The setting object itself, will hold the current value and emit signals when the the value changes.


Index

  • Signals

    • value_changed ()
    • value_changed_to (Variant _value)
    • value_resetted ()

Properties

  • Variant value = null
    • set_value () setter
    • get_value () getter

The current value the setting is currently holding.

When saving the setting this is the only thing wich is saved.

  • Variant default = null
    • set_default () setter
    • get_default () getter

The initial value the setting has been created, used to know if the value has changed or to give a simple reset method.

Can be changed on the fly.

  • bool archive = true
    • set_archive () setter
    • is_archivable () getter

When saving the setting resource this setting will be included in the file if enabled, if disabled the value will not be saved.

Can be usefull to make temporary settings or stuff like sv_cheats (only chads know).

Signals

  • value_changed ()

Emitted when value changes.

  • value_changed_to (Variant _value)

Same as value_changed but also send the value.

  • value_resetted ()

Emited after the value has changed to his default state.

Methods

  • void reset_value ()

Reset the current value to his default.

  • bool is_default ()

Check if the current value is in his current state, will check for the type, equality and then hash.

Will give the current value as a bool by returning it or converting it.

  • int get_int ()

Will give the current value as a int by returning it or converting it.

Will give the current value as a float by returning it or converting it.

Will give the current value as a string by returning it or converting it.

Will give the current value as a color by returning it or converting it.

Will give the current value as a vector2 by returning it or converting it.

Will give the current value as a vector3 by returning it or converting it.


Wiki for automation

  • Build with wiki-tool by GianptDev, version: 0.0
  • Github
  • Source: 'wiki\classes\Setting.json'
  • Creation date: 23/04/2022 - 15:49:56
  • Process time: 0.0 ms
Clone this wiki locally