Setting

@Target(allowedTargets = [AnnotationTarget.PROPERTY])
annotation class Setting(val title: String = "", val description: String = "", val category: KClass<*>, val type: KClass<*> = Toggle::class, val key: String = "", val dependsOn: String = "", val titleRes: Int = 0, val descriptionRes: Int = 0, val min: Float = 0.0f, val max: Float = 100.0f, val step: Float = 1.0f, val options: Array<String> = [], val optionsRes: Int = 0, val platforms: Array<SettingPlatform> = [SettingPlatform.ALL])

Marks a property as a UI-visible setting.

Usage:

@Setting(
title = "Dark Mode",
category = Appearance::class,
type = Toggle::class
)
val darkMode: Boolean = false

Properties

Link copied to clipboard

Category object class (must have @CategoryDefinition)

Link copied to clipboard

Property name this setting depends on. Setting is disabled when dependency is false.

Link copied to clipboard

Optional description

Link copied to clipboard

String resource ID for localized description

Link copied to clipboard
val key: String

Stable persistence key. If empty, defaults to snake_case of property name.

Link copied to clipboard
val max: Float = 100.0f
Link copied to clipboard
val min: Float = 0.0f
Link copied to clipboard
Link copied to clipboard
val optionsRes: Int = 0

Resource array for localized dropdown options

Link copied to clipboard

Platforms where this setting should be visible. Empty = ALL platforms.

Link copied to clipboard
val step: Float = 1.0f
Link copied to clipboard

Display title

Link copied to clipboard
val titleRes: Int = 0

String resource ID for localized title

Link copied to clipboard
val type: KClass<*>

UI type object class (Toggle, Slider, Dropdown, Button, or custom)