Skip to content

Mode Config

Each mode is described by a config.jsonc file at the root of the mode directory. The file uses JSON with Comments (JSONC) syntax. A JSON Schema is available at https://lewdware.github.com/mode.schema.json for editor autocompletion.

{
"$schema": "https://lewdware.github.com/mode.schema.json",
"name": "My Mode",
"version": "1.0.0",
"author": "your-name",
"modes": {
"default": {
"name": "Default",
"entrypoint": "src/main.lua",
"options": {
"popup_frequency": {
"label": "Popup frequency (seconds)",
"description": "How often popups appear",
"type": "number",
"default": 1,
"min": 0.1,
"max": 10,
"step": 0.1
}
}
}
}
}
FieldTypeRequiredDescription
namestringYesThe display name of the mode file.
versionstringNoVersion string, e.g. "1.0.0".
authorstringNoAuthor name.
includestring[]NoPaths of additional directories or files to bundle (e.g. ["src"]).
modesobjectYesMap of mode keys to mode definitions.

Each key in modes is an arbitrary identifier (used internally). The value is a mode object:

FieldTypeRequiredDescription
namestringYesThe display name shown to the user in the config app.
entrypointstringYesPath to the main Lua file, relative to the config file.
optionsobjectNoMap of option keys to option definitions.

A mode file can define multiple modes in a single modes map. Lewdware will present each to the user as a separate selectable mode.

Options expose configurable values to the user. At runtime, each option’s current value is accessible in Lua as lewdware.config["key"], where "key" is the option’s key in the options map.

All option types share these base fields:

FieldTypeRequiredDescription
labelstringYesLabel shown to the user in the config app.
descriptionstringNoOptional explanation shown below the label.
typestringYesOne of "integer", "number", "string", "boolean", "enum".

The remaining fields depend on type:

FieldTypeRequiredDescription
defaultintegerYesDefault value.
minintegerNoMinimum allowed value.
maxintegerNoMaximum allowed value.
stepintegerNoIncrement step.
clampbooleanNoWhether to clamp the value to [min, max].
sliderbooleanNoWhether to show a slider in the UI.