From ab655b591950ffb0e442ca2a0e0829e425c8b154 Mon Sep 17 00:00:00 2001 From: Quillraven Date: Sun, 20 Oct 2024 20:31:22 +0200 Subject: [PATCH] fix TeaVM trigger conditions reflection issues --- .../quillysadventure/trigger/condition/TriggerConditions.kt | 4 +++- .../github/quillraven/quillysadventure/teavm/TeaVMBuilder.kt | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/core/src/main/kotlin/com/github/quillraven/quillysadventure/trigger/condition/TriggerConditions.kt b/core/src/main/kotlin/com/github/quillraven/quillysadventure/trigger/condition/TriggerConditions.kt index b702f1c..dccf43d 100644 --- a/core/src/main/kotlin/com/github/quillraven/quillysadventure/trigger/condition/TriggerConditions.kt +++ b/core/src/main/kotlin/com/github/quillraven/quillysadventure/trigger/condition/TriggerConditions.kt @@ -12,7 +12,9 @@ interface TriggerCondition : Pool.Poolable { override fun reset() = Unit } -data class TriggerConditionIsEntityAlive(var tmxMapID: Int = -1, var checkAlive: Boolean = true) : TriggerCondition { +class TriggerConditionIsEntityAlive : TriggerCondition { + var tmxMapID: Int = -1 + var checkAlive: Boolean = true private val engine = Gdx.app.ecsEngine /** diff --git a/teavm/src/main/kotlin/com/github/quillraven/quillysadventure/teavm/TeaVMBuilder.kt b/teavm/src/main/kotlin/com/github/quillraven/quillysadventure/teavm/TeaVMBuilder.kt index 3dca888..b10d3fa 100644 --- a/teavm/src/main/kotlin/com/github/quillraven/quillysadventure/teavm/TeaVMBuilder.kt +++ b/teavm/src/main/kotlin/com/github/quillraven/quillysadventure/teavm/TeaVMBuilder.kt @@ -3,6 +3,7 @@ package com.github.quillraven.quillysadventure.teavm import com.github.quillraven.quillysadventure.VIRTUAL_H import com.github.quillraven.quillysadventure.VIRTUAL_W import com.github.quillraven.quillysadventure.ability.Ability +import com.github.quillraven.quillysadventure.ability.FireballEffect import com.github.quillraven.quillysadventure.ecs.system.SaveState import com.github.quillraven.quillysadventure.trigger.Trigger import com.github.quillraven.quillysadventure.trigger.action.TriggerActionCreateCharacter @@ -20,6 +21,7 @@ import com.github.quillraven.quillysadventure.trigger.action.TriggerActionSelect import com.github.quillraven.quillysadventure.trigger.action.TriggerActionSetPlayerInput import com.github.quillraven.quillysadventure.trigger.action.TriggerActionShowDialog import com.github.quillraven.quillysadventure.trigger.action.TriggerActionWaitCreatedCharacterDeath +import com.github.quillraven.quillysadventure.trigger.condition.TriggerConditionIsEntityAlive import com.github.quillraven.quillysadventure.ui.action.ScaleToRegionWidth import com.github.xpenatan.gdx.backends.teavm.config.AssetFileHandle import com.github.xpenatan.gdx.backends.teavm.config.TeaBuildConfiguration @@ -65,6 +67,8 @@ object TeaVMBuilder { TeaReflectionSupplier.addReflectionClass(TriggerActionMoveOrderCharacter::class.java) TeaReflectionSupplier.addReflectionClass(TriggerActionPlayAnimationCharacter::class.java) TeaReflectionSupplier.addReflectionClass(SaveState::class.java) + TeaReflectionSupplier.addReflectionClass(FireballEffect::class.java) + TeaReflectionSupplier.addReflectionClass(TriggerConditionIsEntityAlive::class.java) val tool = TeaBuilder.config(teaBuildConfiguration) tool.mainClass = "com.github.quillraven.quillysadventure.teavm.TeaVMLauncher"