Setting

abstract class Setting<T>(val name: String, val visibility: Visibility = Visibility.VISIBLE, var description: String? = null) : ReadWriteProperty<Module, T> , PropertyDelegateProvider<Module, ReadWriteProperty<Module, T>>

The super class that all Module Settings for the gui and config should inherit from.

See Module for instructions on how to use settings.

This class provides support for delegation to Settings. Delegating to a Setting will register it to the Module from which you are delegating a property to the Setting. If you do not want this to happen use the DoNotRegister annotation.

To avoid nullability you can use DummySetting instead of null.

Author

Aton

Constructors

Link copied to clipboard
fun Setting(name: String, visibility: Visibility = Visibility.VISIBLE, description: String? = null)

Types

Link copied to clipboard
object Companion

This companion object provides extension functions for the Setting classes.

Functions

Link copied to clipboard
open operator override fun getValue(thisRef: Module, property: KProperty<*>): T

This method acts as the getter for the property delegated to this class.

Link copied to clipboard
open operator override fun provideDelegate(thisRef: Module, property: KProperty<*>): ReadWriteProperty<Module, T>

This operator provides the Delegate to the Setting.

Link copied to clipboard
open fun reset()

Sets value to default.

Link copied to clipboard
open operator override fun setValue(thisRef: Module, property: KProperty<*>, value: T)

This method acts as the setter for the property delegated to this class.

Properties

Link copied to clipboard
abstract val default: T

The default for value.

Link copied to clipboard
var description: String? = null
Link copied to clipboard
Link copied to clipboard
var processInput: (T) -> T

Can be set to add a setting specific restraint / extra action when setting the new value.

Link copied to clipboard

Returns whether this setting should be visible based on visibilityDependency. Is true by default. Use withDependency to change this behavior.

Link copied to clipboard
abstract var value: T

This is the main field used to store the state of the setting. There can be additional properties for managing the state in the implementations.

Link copied to clipboard

Inheritors

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard