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

choiced

A preference that is a choice of one option among a fixed set. Used for preferences such as clothing.

Vars

main_feature_nameIf the preference is a main feature (PREFERENCE_CATEGORY_FEATURES or PREFERENCE_CATEGORY_CLOTHING) this is the name of the feature that will be presented.
should_generate_iconsIf this is TRUE, an icon will be generated for every value. If you implement this, you must implement icon_for(value) for every possible value.

Procs

get_choicesReturns a list of every possible value. The first time this is called, will run init_values(). Return value can be in the form of:
get_choices_serializedReturns a list of every possible value, serialized.
icon_forWhen should_generate_icons is TRUE, this proc is called for every value. It can return either an icon or a typepath to an atom to create.
init_possible_valuesReturns a list of every possible value. This must be overriden by /datum/preference/choiced subtypes. If should_generate_icons is TRUE, then you will also need to implement icon_for(value) for every possible value.

Var Details

main_feature_name

If the preference is a main feature (PREFERENCE_CATEGORY_FEATURES or PREFERENCE_CATEGORY_CLOTHING) this is the name of the feature that will be presented.

should_generate_icons

If this is TRUE, an icon will be generated for every value. If you implement this, you must implement icon_for(value) for every possible value.

Proc Details

get_choices

Returns a list of every possible value. The first time this is called, will run init_values(). Return value can be in the form of:

get_choices_serialized

Returns a list of every possible value, serialized.

icon_for

When should_generate_icons is TRUE, this proc is called for every value. It can return either an icon or a typepath to an atom to create.

init_possible_values

Returns a list of every possible value. This must be overriden by /datum/preference/choiced subtypes. If should_generate_icons is TRUE, then you will also need to implement icon_for(value) for every possible value.