diff --git a/core/src/commonMain/kotlin/cn/rdlevel/rdkt/core/data/action/VFXPreset.kt b/core/src/commonMain/kotlin/cn/rdlevel/rdkt/core/data/action/VFXPreset.kt index 03a9670..00b0e2f 100644 --- a/core/src/commonMain/kotlin/cn/rdlevel/rdkt/core/data/action/VFXPreset.kt +++ b/core/src/commonMain/kotlin/cn/rdlevel/rdkt/core/data/action/VFXPreset.kt @@ -339,7 +339,7 @@ public sealed interface VFXPreset { } @Serializable - @SerialName("Blur") + @SerialName("RadialBlur") public class RadialBlur( override var enable: Boolean, override var rooms: Rooms, diff --git a/core/src/commonTest/kotlin/cn/rdlevel/rdkt/core/test/SetVFXPresetEventTest.kt b/core/src/commonTest/kotlin/cn/rdlevel/rdkt/core/test/SetVFXPresetEventTest.kt new file mode 100644 index 0000000..35eb066 --- /dev/null +++ b/core/src/commonTest/kotlin/cn/rdlevel/rdkt/core/test/SetVFXPresetEventTest.kt @@ -0,0 +1,27 @@ +package cn.rdlevel.rdkt.core.test + +import cn.rdlevel.rdkt.core.data.ROOM1 +import cn.rdlevel.rdkt.core.data.action.VFXPreset +import cn.rdlevel.rdkt.core.data.roomsOf +import cn.rdlevel.rdkt.core.events.Event +import cn.rdlevel.rdkt.core.events.SetVFXPresetEvent +import kotlinx.serialization.ExperimentalSerializationApi +import kotlinx.serialization.json.Json +import kotlin.test.Test + +class SetVFXPresetEventTest { + @OptIn(ExperimentalSerializationApi::class) + @Test + fun test() { + val json = Json { + isLenient = true + allowTrailingComma = true + encodeDefaults = true + } + val event: Event = SetVFXPresetEvent(VFXPreset.Embers(true, roomsOf(ROOM1))) + val text = json.encodeToString(event) + println(text) + val event2: Event = json.decodeFromString(text) + println(event2) + } +} \ No newline at end of file