CategorySpec¶
abstract class CategorySpec(title: Component, id: String = title.string.toSnakeCase()) : DataSpec
A top-level section of a ConfigSpec, or a nested subsection of another CategorySpec. Declared as a nested singleton object inside a ConfigSpec or a parent CategorySpec - ConfigSpec.categories and subcategories both discover their members by reflecting over nested objects, so there's nothing to override or register manually.
Inheritors¶
Constructors¶
CategorySpec¶
constructor(title: Component, id: String = title.string.toSnakeCase())
Properties¶
client¶
val client: ClientDataSpec
Client-side mirror of this category, used to build the Cloth Config UI.
id¶
Parameters
- id: Stable identifier used as this category's key in its parent and in the serialized file. Defaults to the snake_cased
title.
isEnabled¶
Whether this category is currently active. When false, Cloth Config hides/disables the category's fields in the UI. Override with a get() that reads another field (e.g. a parent toggle) to make this category conditional.
subcategories¶
val subcategories: List<CategorySpec>
Nested CategorySpec objects declared inside this one, for grouping in the UI.
title¶
val title: Component
Parameters
- title: Display title shown in the Cloth Config UI.