Settings Configuration Guide
Configuration File Structure
The default settings configuration file is located at res://addons/konado_settings/resources/default_settings.json and uses JSON format to define setting items.
Basic Structure
json
{
"categories": [
{
"id": "audio",
"display_name": "Audio",
"items": [
{
"key": "master_volume",
"label": "Master Volume",
"type": 0,
"min_value": 0.0,
"max_value": 1.0,
"step": 0.01,
"default_value": 1.0,
"platforms": ["all"]
}
]
}
]
}Configuration Reference
Top-Level Structure
- categories: Array of setting categories, containing all setting categories
Category Properties
- id: Unique category identifier, used for programmatic access
- display_name: Category display name, shown in the settings panel
- items: Array of setting items under this category
Setting Item Properties
- key: Unique setting item identifier, must be unique within its category
- label: Setting item display label, shown in the settings panel
- type: Setting type
0: Slider1: Toggle2: Option
Slider-Specific Properties
- min_value: Minimum value
- max_value: Maximum value
- step: Step size
- default_value: Default value (float)
Toggle-Specific Properties
- default_value: Default value (bool)
Option-Specific Properties
- options: List of options (Array[String])
- default_value: Default value (String, must be in the options list)
Common Properties
- platforms: Platform list; an empty array or
["all"]means all platforms
Supported Platform Identifiers
all— All platformsandroid— Androidbsd— BSDlinux— Linuxmacos— macOSios— iOSvisionos— visionOSwindows— Windowslinuxbsd— Linux or BSDdebug— Debug buildsrelease— Release buildseditor— Editor builds
Platform Filtering Rules
- Empty array: Visible on all platforms
- Contains "all": Visible on all platforms
- Specific platforms: Only visible on the specified platforms
- Platform aliases:
linuxbsdmatches Linux or BSD platforms - Build type:
debugandreleasefilter by build type
Example Configuration
Complete Configuration Example
json
{
"categories": [
{
"id": "audio",
"display_name": "Audio",
"items": [
{
"key": "master_volume",
"label": "Master Volume",
"type": 0,
"min_value": 0.0,
"max_value": 1.0,
"step": 0.01,
"default_value": 1.0,
"platforms": ["all"]
},
{
"key": "music_volume",
"label": "Music Volume",
"type": 0,
"min_value": 0.0,
"max_value": 1.0,
"step": 0.01,
"default_value": 0.8
}
]
},
{
"id": "display",
"display_name": "Display",
"items": [
{
"key": "fullscreen",
"label": "Fullscreen",
"type": 1,
"default_value": false
},
{
"key": "language",
"label": "Language",
"type": 2,
"options": ["zh", "en", "ja"],
"default_value": "zh"
},
{
"key": "debug_mode",
"label": "Debug Mode",
"type": 1,
"default_value": false,
"platforms": ["debug"]
},
{
"key": "windows_only",
"label": "Windows Only",
"type": 1,
"default_value": false,
"platforms": ["windows"]
}
]
}
]
}Different Setting Type Examples
Slider Type
json
{
"key": "text_speed",
"label": "Text Speed",
"type": 0,
"min_value": 0.01,
"max_value": 0.2,
"step": 0.005,
"default_value": 0.05
}Toggle Type
json
{
"key": "auto_mode",
"label": "Auto Mode",
"type": 1,
"default_value": false
}Option Type
json
{
"key": "quality",
"label": "Quality",
"type": 2,
"options": ["Low", "Medium", "High", "Ultra"],
"default_value": "Medium"
}Configuration Best Practices
Naming Conventions
- Use lowercase letters and underscores for
idandkey - Use user-friendly names for
display_name
- Use lowercase letters and underscores for
Platform Configuration
- For general settings, use
"platforms": ["all"] - For platform-specific settings, specify the platform explicitly
- For general settings, use
Default Values
- Provide reasonable default values for all settings
- Ensure the default value type matches the setting type
Organisation
- Group related settings into categories by function
- Keep the number of categories reasonable
Validation
- Use a JSON validation tool to check the configuration file format
- Ensure all required properties are set
Notes
- Ensure that each setting item's
keyis unique within its category - For slider types, ensure
min_value<max_value - For option types, ensure the
optionsarray is not empty - After changing the configuration file, restart the game or call the
rebuild()method to update the settings panel