aboutsummaryrefslogtreecommitdiff
path: root/src/compat/configured/java/ConfigValueNode.kt
blob: df597399b005694ab62909a66278428661a7d439 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package moe.nea.firmament.compat.configured

import com.mrcrayfish.configured.api.IConfigEntry
import com.mrcrayfish.configured.api.IConfigValue
import net.minecraft.text.Text
import moe.nea.firmament.gui.config.ManagedOption

class ConfigValueNode(val option: ManagedOption<*>) : IConfigEntry {
    override fun getChildren(): List<IConfigEntry> {
        return listOf()
    }

    override fun isRoot(): Boolean {
        return false
    }

    override fun isLeaf(): Boolean {
        return true
    }

    val value = ConfigValue(option)
    override fun getValue(): IConfigValue<*>? {
        return value
    }

    override fun getEntryName(): String {
        return option.propertyName
    }

    override fun getTooltip(): Text? {
        return null
    }

    override fun getTranslationKey(): String? {
        return option.rawLabelText
    }
}