[M] Move setting descriptions to i18n

This commit is contained in:
Azalea
2024-04-02 00:16:34 -04:00
parent 6a475434ad
commit 7728b4b1ab
6 changed files with 20 additions and 21 deletions

View File

@@ -47,7 +47,7 @@ annotation class Doc(
@Target(AnnotationTarget.PROPERTY)
@Retention(AnnotationRetention.RUNTIME)
annotation class SettingField(val name: Str, val desc: Str)
annotation class SettingField
// Reflection
@Suppress("UNCHECKED_CAST")

View File

@@ -20,11 +20,8 @@ class SettingsApi(
val fields = AquaGameOptions::class.vars()
.mapNotNull { it.findAnnotation<SettingField>()?.let { an -> it to an } }
val fieldMap = fields.associate { (f, _) -> f.name to f }
val fieldDesc = fields.map { (f, an) -> mapOf(
"key" to f.name,
"name" to an.name,
"desc" to an.desc,
"type" to f.returnType.jvmErasure.simpleName
val fieldDesc = fields.map { (f, _) -> mapOf(
"key" to f.name, "type" to f.returnType.jvmErasure.simpleName
) }
@API("get")

View File

@@ -14,21 +14,16 @@ class AquaGameOptions(
@GeneratedValue(strategy = GenerationType.IDENTITY)
var id: Long = 0,
@SettingField("Unlock All Music",
"Unlock all music and master difficulty in game")
@SettingField
var unlockMusic: Boolean = false,
@SettingField("Unlock All Chara",
"Unlock all characters and partners in game")
@SettingField
var unlockChara: Boolean = false,
@SettingField("Unlock All Collectables",
"Unlock all collectables (nameplate, title, icon, frame) in game. " +
"This setting is not relevant in chusan because in-game user box is disabled in chusan.")
@SettingField
var unlockCollectables: Boolean = false,
@SettingField("Unlock All Tickets" ,
"Unlock all map tickets (the game still limits which tickets can be used)")
@SettingField
var unlockTickets: Boolean = false,
)