Interface ISortableConfigValueFactory
Prefer adding sorting configs directly with
IConfigScreenCategoryBuilder.addSortingConfig(String, String, ISortingConfig, Collection, IConfigValueSerializer)
or
IConfigScreenCategoryBuilder.addStringSortingConfig(String, String, ISortingConfig, Collection)
when customizing a screen category. This factory remains for callers that still need to create a screen value
explicitly.
- Since:
- 0.1.0
-
Method Summary
Modifier and TypeMethodDescription<T> IConfigScreenValue<List<T>> create(String name, String localizationKey, net.mezzdev.config.api.sorting.ISortingConfig<T> sortingConfig, Collection<T> values, net.mezzdev.config.api.value.serializer.IConfigValueSerializer<T> valueSerializer) Create a config value for editing a runtime value list backed by a sorting config.<T> IConfigScreenValue<List<T>> create(String name, String localizationKey, net.mezzdev.config.api.sorting.ISortingConfig<T> sortingConfig, Collection<T> values, net.mezzdev.config.api.value.serializer.IConfigValueSerializer<T> valueSerializer, ConfigValueApplyMode applyMode) Create a config value for editing a runtime value list backed by a sorting config.createStringList(String name, String localizationKey, net.mezzdev.config.api.sorting.ISortingConfig<String> sortingConfig, Collection<String> values, Map<String, net.minecraft.network.chat.Component> valueNames, Map<String, net.minecraft.network.chat.Component> valueDescriptions, Map<String, IConfigValueIcon> valueIcons) Create a string-list config value for editing a runtime value list backed by a sorting config.createStringList(String name, String localizationKey, net.mezzdev.config.api.sorting.ISortingConfig<String> sortingConfig, Collection<String> values, Map<String, net.minecraft.network.chat.Component> valueNames, Map<String, net.minecraft.network.chat.Component> valueDescriptions, Map<String, IConfigValueIcon> valueIcons, ConfigValueApplyMode applyMode) Create a string-list config value for editing a runtime value list backed by a sorting config.
-
Method Details
-
create
<T> IConfigScreenValue<List<T>> create(String name, String localizationKey, net.mezzdev.config.api.sorting.ISortingConfig<T> sortingConfig, Collection<T> values, net.mezzdev.config.api.value.serializer.IConfigValueSerializer<T> valueSerializer) Create a config value for editing a runtime value list backed by a sorting config.The given values are copied when this method is called. The sorting config keeps owning storage and sorting behavior; this config value only adapts it for the config GUI list editor.
- Parameters:
name- stable config value namelocalizationKey- translation key for this config value's namesortingConfig- sorting config that stores and applies the edited ordervalues- complete runtime value set to expose in the list editorvalueSerializer- serializer and display metadata for one list value- Returns:
- a config screen value for the sortable runtime list
- Since:
- 0.1.0
-
create
<T> IConfigScreenValue<List<T>> create(String name, String localizationKey, net.mezzdev.config.api.sorting.ISortingConfig<T> sortingConfig, Collection<T> values, net.mezzdev.config.api.value.serializer.IConfigValueSerializer<T> valueSerializer, ConfigValueApplyMode applyMode) Create a config value for editing a runtime value list backed by a sorting config.The given values are copied when this method is called. The sorting config keeps owning storage and sorting behavior; this config value only adapts it for the config GUI list editor.
- Parameters:
name- stable config value namelocalizationKey- translation key for this config value's namesortingConfig- sorting config that stores and applies the edited ordervalues- complete runtime value set to expose in the list editorvalueSerializer- serializer and display metadata for one list valueapplyMode- when saved order edits are written- Returns:
- a config screen value for the sortable runtime list
- Since:
- 0.1.0
-
createStringList
IConfigScreenValue<List<String>> createStringList(String name, String localizationKey, net.mezzdev.config.api.sorting.ISortingConfig<String> sortingConfig, Collection<String> values, Map<String, net.minecraft.network.chat.Component> valueNames, Map<String, net.minecraft.network.chat.Component> valueDescriptions, Map<String, IConfigValueIcon> valueIcons) Create a string-list config value for editing a runtime value list backed by a sorting config.- Parameters:
name- stable config value namelocalizationKey- translation key for this config value's namesortingConfig- sorting config that stores and applies the edited ordervalues- complete runtime value set to expose in the list editorvalueNames- display names for list valuesvalueDescriptions- optional descriptions for list valuesvalueIcons- optional icons for list values- Returns:
- a config screen value for the sortable runtime list
- Since:
- 0.1.0
-
createStringList
IConfigScreenValue<List<String>> createStringList(String name, String localizationKey, net.mezzdev.config.api.sorting.ISortingConfig<String> sortingConfig, Collection<String> values, Map<String, net.minecraft.network.chat.Component> valueNames, Map<String, net.minecraft.network.chat.Component> valueDescriptions, Map<String, IConfigValueIcon> valueIcons, ConfigValueApplyMode applyMode) Create a string-list config value for editing a runtime value list backed by a sorting config.- Parameters:
name- stable config value namelocalizationKey- translation key for this config value's namesortingConfig- sorting config that stores and applies the edited ordervalues- complete runtime value set to expose in the list editorvalueNames- display names for list valuesvalueDescriptions- optional descriptions for list valuesvalueIcons- optional icons for list valuesapplyMode- when saved order edits are written- Returns:
- a config screen value for the sortable runtime list
- Since:
- 0.1.0
-