Closed GregHib closed 4 years ago
Should all suspensions should use the same method? Dialogue suspensions should use this format and worth considering switching them to scripts too. What about TickSuspension and End?
Custom suspensions are possible, albeit a bit verbosely.
lateinit var suspendingQueueMapper: ComponentMapper<SuspendingQueue>
lateinit var queue: PriorityQueue
data class CustomSuspension(var field: Int = -1) : SuspensionType
on<Command> {
where { it.prefix == "resume" }
then {
val suspension = suspendingQueueMapper.getSuspension(it.entityId)
if(suspension is CustomSuspension) {
suspension.field = 1
queue.resume(it.entityId)
}
}
}
suspend fun QueueScope.customSuspension(value: Int): Int {
val sus = CustomSuspension(value)
suspension = sus
suspend()
return sus.field
}
queue(QueuePriority.Weak) {
customSuspension(2)
}
Animation/graphic waiting not possible right now #65
Currently only dialogue messages and wait X ticks suspensions exist.
Other suspension types: