/tg/ Station 13 - Modules - TypesVar Details - Proc Details

spellbook_customization_entry

NOT SERIALIZED - The data provided by these entries are instead extracted and serialized into lists of (string -> any) values, that are then associated in the spellbook preference as (item.type -> list).

Vars

current_valueThe stored value of this key. This is what will be serialized into a list, and displayed to the user. Should be updated every time the value changes. Do not access directly - use get_value and change_value()
default_valueIn the case that no current value is provided in construction, or a pre-sanitized value cannot be converted into the correct format, default_value will be used.
interfacetypeHow the user will interface with this entry. Accepted types: SPELLBOOK_CUSTOMIZATION_BOOLEAN - Creates a checkbox SPELLBOOK_CUSTOMIZATION_ANY_INPUT - Creates a text field that can have anything put in it SPELLBOOK_CUSTOMIZATION_SLIDER - Creates a numeric slider, with min/max associated with min/max_value SPELLBOOK_CUSTOMIZATION_NUMERIC_INPUT - Creates a text field that only accepts numbers Uses defines from spellbook_customization_interfaces.dm
keyThe savefile key that this entry is associated with. This will be the "key" of the serialization. This specific parameter will save to, and take from, this key. Ex. "damage_amount" will look for the "damage_amount" parameter assocaited with item.type, and apply the value of that to this entry. When we are done, we will save the value of this entry to the "damage_amount" parameter.
nameThe name that will be displayed to the left of the interface (e.g. button, input, slider, etc.)
tooltipThe tooltip to be displayed when you hover over the interface. Optional.

Procs

change_valueSetter for current_value. Sanitizes new_value before setting current_value to it.
generate_ui_dataGenerates the data to be supplies to the TGUI window. Should be in list(key -> value) format.
get_valueGetter for current_value. Sanitizes it before returning it.
sanitize_valueEnsures the provided value is correctly formatted for this entry. If it isn't, it will convert it into a correct format. Ex. numeric entries will clamp numbers to the max and min, booleans will default to FALSE if the value isn't a boolean.

Var Details

current_value

The stored value of this key. This is what will be serialized into a list, and displayed to the user. Should be updated every time the value changes. Do not access directly - use get_value and change_value()

default_value

In the case that no current value is provided in construction, or a pre-sanitized value cannot be converted into the correct format, default_value will be used.

interfacetype

How the user will interface with this entry. Accepted types: SPELLBOOK_CUSTOMIZATION_BOOLEAN - Creates a checkbox SPELLBOOK_CUSTOMIZATION_ANY_INPUT - Creates a text field that can have anything put in it SPELLBOOK_CUSTOMIZATION_SLIDER - Creates a numeric slider, with min/max associated with min/max_value SPELLBOOK_CUSTOMIZATION_NUMERIC_INPUT - Creates a text field that only accepts numbers Uses defines from spellbook_customization_interfaces.dm

key

The savefile key that this entry is associated with. This will be the "key" of the serialization. This specific parameter will save to, and take from, this key. Ex. "damage_amount" will look for the "damage_amount" parameter assocaited with item.type, and apply the value of that to this entry. When we are done, we will save the value of this entry to the "damage_amount" parameter.

name

The name that will be displayed to the left of the interface (e.g. button, input, slider, etc.)

tooltip

The tooltip to be displayed when you hover over the interface. Optional.

Proc Details

change_value

Setter for current_value. Sanitizes new_value before setting current_value to it.

generate_ui_data

Generates the data to be supplies to the TGUI window. Should be in list(key -> value) format.

get_value

Getter for current_value. Sanitizes it before returning it.

sanitize_value

Ensures the provided value is correctly formatted for this entry. If it isn't, it will convert it into a correct format. Ex. numeric entries will clamp numbers to the max and min, booleans will default to FALSE if the value isn't a boolean.