mirror of
https://github.com/RDCN-Community-Developers/rdkt.git
synced 2026-09-04 17:25:33 +08:00
Added FlashEvent.
This commit is contained in:
@@ -6,7 +6,7 @@ import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
/**
|
||||
* Emits a flash with custom settings.
|
||||
* Emits a flash with custom settings. For more simplified one, see [FlashEvent].
|
||||
* @property startColor The start color of the flash.
|
||||
* @property startOpacity The start opacity of the flash.
|
||||
* @property endColor The end color of the flash.
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
package cn.rdlevel.rdkt.core.events
|
||||
|
||||
|
||||
import cn.rdlevel.rdkt.core.data.ROOM1
|
||||
import cn.rdlevel.rdkt.core.data.RoomsOrTopLayer
|
||||
import cn.rdlevel.rdkt.core.data.roomsOf
|
||||
import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
||||
import kotlin.jvm.JvmOverloads
|
||||
|
||||
/**
|
||||
* Emits a white flash with a specified duration. For more advanced one, see [CustomFlashEvent].
|
||||
* @property duration The duration of the flash.
|
||||
*/
|
||||
@Serializable
|
||||
@SerialName("Flash")
|
||||
public data class FlashEvent @JvmOverloads constructor(
|
||||
var duration: Duration,
|
||||
override var rooms: RoomsOrTopLayer = roomsOf(ROOM1),
|
||||
) : ActionEvent(), MutableRoomsOrTopLayerSpecificEvent {
|
||||
/**
|
||||
* Represent the duration of the flash.
|
||||
* @property beats The time corresponding to the duration in beats.
|
||||
*/
|
||||
@Serializable
|
||||
public enum class Duration(public val beats: Double) {
|
||||
@SerialName("Short")
|
||||
SHORT(1.0),
|
||||
|
||||
@SerialName("Medium")
|
||||
MEDIUM(2.0),
|
||||
|
||||
@SerialName("Long")
|
||||
LONG(4.0)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user