Reference
ModResources
Public Kotlin SDK declarations.
Usage context
| Module | Package | SDK source |
|---|---|---|
| Kotlin/Native | nimby | kotlin/src/nimby/ModResources.kt |
Public API for SDK 0.9.0-alpha.2. Each entry provides the Kotlin signature and its contract: what the value means, conditions of use and effects to understand. Choose imports from the module shown above.
import nimby.ModInfo
import nimby.ModMetadata
import nimby.SignalConstruction
import nimby.signalMod
import nimby.toolModModInfo
data class ModInfo(val id: String, val title: String)Package identity generated from mod.json as nimby.mod.modInfo. Reuse it in createMod to avoid duplicating the identifier and name.
ModInfo.id
val id: StringStable technical package identifier from mod.json; used to declare the mod and its services.
ModInfo.title
val title: StringName from mod.json, used as the group heading in Options → NRF Hub with toolMod(modInfo) or signalMod(modInfo). metadata(name=...) separately customizes the name in the game’s mod lists.
ModMetadata
data class ModMetadata(val author: String, val description: String, val name: String? = null)Information for the game’s mod lists and details. name and description accept tr; Hub or Steam distribution metadata remains separate.
ModMetadata.description
val description: StringDisplayed mod description; accepts tr and line breaks. The package retains readable fallback text.
ModMetadata.name
val name: String? = nullOptional name for the game’s mod lists and details, possibly translated. null uses the name from mod.json. Does not replace GameMod.title in the Options → NRF Hub group or ToolWindow.title; identifier and version remain unchanged.
SignalConstruction
class SignalConstruction(
states: List<String>, val name: String, val kind: String = "path",
val catalogueName: String = name,
val nameKey: String? = null, val catalogueNameKey: String? = null,
val size: Int = 0,
val left: Boolean = false,
)Declares the image catalogue and constructible signal. Paths are package-relative and checked during generation. Preserve published order for existing saves.
SignalConstruction.name
val name: StringName in the construction menu; accepts plain text or tr. Separate from the model identifier.
SignalConstruction.kind
val kind: String = "path"Signal kind recognized by the game; defaults to path. A syntactically valid value does not guarantee support for another kind.
SignalConstruction.catalogueName
val catalogueName: String = nameDisplayed texture-set name, equal to name by default; accepts tr.
SignalConstruction.nameKey
val nameKey: String? = nullNative localization key for an existing catalogue. Leave null with name=tr(...), as these mechanisms cannot be combined for the same name.
SignalConstruction.catalogueNameKey
val catalogueNameKey: String? = nullNative catalogue localization key. Leave null when catalogueName uses tr; this is not a key in the mod’s translation JSON.
SignalConstruction.size
val size: Int = 0Default size of the signal to build, from 0 to 4; defaults to 0. Explicitly declare 4 to select that size.
SignalConstruction.left
val left: Boolean = falseInitial left-side choice when building. Defaults to false; set true when the model should be placed on the left.
SignalConstruction.states
val states: List<String>Copy of 1 to 256 distinct paths in their permanent order. Declare every steady image and both images of every blink.
signalMod
fun signalMod(info: ModInfo, block: SignalModelsBuilder.() -> Unit): SignallingModAssembles independent models with the identity generated from mod.json. Return it from createMod; declaration must remain free of game access.
toolMod
fun toolMod(info: ModInfo, block: ToolModBuilder.() -> Unit): ToolModAssembles a tool with the identity generated from mod.json, without a fictitious signal. Declare at least one service or window.