ConfigSpecList¶
class ConfigSpecList<T : ConfigSpec>(
title: Component,
id: String = title.string.toSnakeCase(),
directory: String = id,
synchronized: Boolean = false,
factory: (entryId: String) -> T
) : ConfigSpecCollection<T>
A ConfigSpecCollection exposed as an ordered entries list.
Constructors¶
ConfigSpecList¶
Properties¶
directory¶
Parameters
- directory: Subfolder (under whatever
baseFolderresolves to) this collection's files live in. Defaults toid.
entries¶
The current entries, in discovery/insertion order.
id¶
Stable identifier - this node's path segment when nested under a ConfigGroup.
synchronized¶
val synchronized: Boolean
Parameters
- synchronized: Whether
factoryproducesConfigSpec.Serverentries that should sync to clients, server-authoritative: the server broadcasts which entries exist (a client's own add/remove is disabled in the UI - seebuildCollectionEntry), and an existing entry's values sync like a normalConfigSpec.Server's (permission-gated edits, reverted with a message if denied). All entries share one channel, registered once at attach time - a fresh payload type per entry can't be negotiated once the server has already accepted connections, so entries can't each get their own the way a standaloneConfigSpec.Serverdoes.
title¶
open override val title: Component
Display title shown for this node's row in its parent's screen.
Functions¶
add¶
Creates, saves, and registers a new entry for entryId. For a synchronized collection, only ever call this server-side - see the class doc.
remove¶
Deletes entryId's file and drops it from this collection. No-op if absent. For a synchronized collection, only ever call this server-side - see the class doc.