Skip to content

Commit

Permalink
fix TeaVM trigger conditions reflection issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Quillraven committed Oct 20, 2024
1 parent 2c5382f commit ab655b5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit ab655b5

Please sign in to comment.