ScriptingState

object ScriptingState

Self-contained instance of scripting API use.

Abstracts available scope, running backends, command history Should be unique per isolated use of scripting. E.G. One for the ~-key console screen, one for each mod/all mods per save file (or whatever works best), etc.

Types

BackendSpawnResult
Link copied to clipboard
data class BackendSpawnResult(backend: ScriptingBackend, motd: String)

Functions

autocomplete
Link copied to clipboard
fun autocomplete(command: String, cursorPos: Int? = null): AutocompleteResults
echo
Link copied to clipboard
fun echo(text: String)
equals
Link copied to clipboard
open operator fun equals(other: Any?): Boolean
exec
Link copied to clipboard
fun exec(command: String, asName: String? = null, withParams: Map<String, Any?>? = null): ExecResult
fun exec(command: String, asName: String? = null, withParams: Map<String, Any?>? = null, withBackend: ScriptingBackend): ExecResult
getIndexOfBackend
Link copied to clipboard
fun getIndexOfBackend(backend: ScriptingBackend): Int?
getOutputHistory
Link copied to clipboard
fun getOutputHistory(): List<String>
hasBackend
Link copied to clipboard
fun hasBackend(): Boolean
hashCode
Link copied to clipboard
open fun hashCode(): Int
navigateHistory
Link copied to clipboard
fun navigateHistory(increment: Int): String
spawnBackend
Link copied to clipboard
fun spawnBackend(backendtype: ScriptingBackendType): ScriptingState.BackendSpawnResult
switchToBackend
Link copied to clipboard
fun switchToBackend(backend: ScriptingBackend)
fun switchToBackend(index: Int)
termBackend
Link copied to clipboard
fun termBackend(backend: ScriptingBackend): Exception?
fun termBackend(index: Int): Exception?
toString
Link copied to clipboard
open fun toString(): String

Properties

activeBackend
Link copied to clipboard
val activeBackend: ScriptingBackend
activeBackendIndex
Link copied to clipboard
var activeBackendIndex: Int = 0
activeCommandHistory
Link copied to clipboard
var activeCommandHistory: Int = 0
commandHistory
Link copied to clipboard
private val commandHistory: ArrayList<String>
consoleScreenListener
Link copied to clipboard
var consoleScreenListener: (String) -> Unit? = null
maxCommandHistory
Link copied to clipboard
val maxCommandHistory: Int = 511
maxOutputHistory
Link copied to clipboard
val maxOutputHistory: Int = 511
outputHistory
Link copied to clipboard
private val outputHistory: ArrayList<String>
scriptingBackends
Link copied to clipboard
val scriptingBackends: ArrayList<ScriptingBackend>

Sources

jvm source
Link copied to clipboard