/tg/ Station 13 - Modules - TypesProc Details

vore_pref

Procs

create_default_valueProduce a default, potentially random value for when no value for this preference is found in the savefile. Either this or create_informed_default_value must be overriden by subtypes.
create_informed_default_valueProduce a default, potentially random value for when no value for this preference is found in the savefile. Unlike create_default_value(), will provide the preferences object if you need to use it. If not overriden, will call create_default_value() instead.
deserializeCalled on the saved input when retrieving. Also called by the value sent from the user through UI. Do not trust it. Input is the value inside the savefile, output is to tell other code what the value is. This is useful either for more optimal data saving or for migrating older data. Must be overridden by subtypes. Can return null if no value was found.
is_validChecks that a given value is valid. Must be overriden by subtypes. Any type can be passed through.
readGiven a savefile, return either the saved data or an acceptable default. This will write to the savefile if a value was not found with the new value.
serializeCalled on the input while saving. Input is the current value, output is what to save in the savefile.
writeGiven a savefile, writes the inputted value. Returns TRUE for a successful application. Return FALSE if it is invalid.

Proc Details

create_default_value

Produce a default, potentially random value for when no value for this preference is found in the savefile. Either this or create_informed_default_value must be overriden by subtypes.

create_informed_default_value

Produce a default, potentially random value for when no value for this preference is found in the savefile. Unlike create_default_value(), will provide the preferences object if you need to use it. If not overriden, will call create_default_value() instead.

deserialize

Called on the saved input when retrieving. Also called by the value sent from the user through UI. Do not trust it. Input is the value inside the savefile, output is to tell other code what the value is. This is useful either for more optimal data saving or for migrating older data. Must be overridden by subtypes. Can return null if no value was found.

is_valid

Checks that a given value is valid. Must be overriden by subtypes. Any type can be passed through.

read

Given a savefile, return either the saved data or an acceptable default. This will write to the savefile if a value was not found with the new value.

serialize

Called on the input while saving. Input is the current value, output is what to save in the savefile.

write

Given a savefile, writes the inputted value. Returns TRUE for a successful application. Return FALSE if it is invalid.