NRF SDK 0.9

Reference

ModResources

Public Kotlin SDK declarations.

Usage context

ModulePackageSDK source
Kotlin/Nativenimbykotlin/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.

Imports on this page
import nimby.ModInfo
import nimby.ModMetadata
import nimby.SignalConstruction
import nimby.signalMod
import nimby.toolMod

ModInfo

nimby · class
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

nimby · val
val id: String

Stable technical package identifier from mod.json; used to declare the mod and its services.

ModInfo.title

nimby · val
val title: String

Name 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

nimby · class
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.author

nimby · val
val author: String

Author credit shown in mod information; this text defines neither a service identity nor a rule.

ModMetadata.description

nimby · val
val description: String

Displayed mod description; accepts tr and line breaks. The package retains readable fallback text.

ModMetadata.name

nimby · val
val name: String? = null

Optional 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

nimby · class
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

nimby · val
val name: String

Name in the construction menu; accepts plain text or tr. Separate from the model identifier.

SignalConstruction.kind

nimby · val
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

nimby · val
val catalogueName: String = name

Displayed texture-set name, equal to name by default; accepts tr.

SignalConstruction.nameKey

nimby · val
val nameKey: String? = null

Native localization key for an existing catalogue. Leave null with name=tr(...), as these mechanisms cannot be combined for the same name.

SignalConstruction.catalogueNameKey

nimby · val
val catalogueNameKey: String? = null

Native catalogue localization key. Leave null when catalogueName uses tr; this is not a key in the mod’s translation JSON.

SignalConstruction.size

nimby · val
val size: Int = 0

Default size of the signal to build, from 0 to 4; defaults to 0. Explicitly declare 4 to select that size.

SignalConstruction.left

nimby · val
val left: Boolean = false

Initial left-side choice when building. Defaults to false; set true when the model should be placed on the left.

SignalConstruction.states

nimby · val
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

nimby · fun
fun signalMod(info: ModInfo, block: SignalModelsBuilder.() -> Unit): SignallingMod

Assembles independent models with the identity generated from mod.json. Return it from createMod; declaration must remain free of game access.

toolMod

nimby · fun
fun toolMod(info: ModInfo, block: ToolModBuilder.() -> Unit): ToolMod

Assembles a tool with the identity generated from mod.json, without a fictitious signal. Declare at least one service or window.