Add event flags

This commit is contained in:
2025-05-19 22:53:17 -05:00
parent 057ed10851
commit 7cd96e20d2
9 changed files with 229 additions and 7 deletions

View File

@@ -10,10 +10,54 @@ enum Action {
@export var action:Action = Action.TURN_ON;
@export var event:EventSystem.SpecialEvent;
@export_flags("1:1", "2:2", "3:4", "4:8", "5:16", "6:32", "7:64", "8:128", "9:256", "10:512", "11:1024", "12:2048", "13:4096", "14:8192", "15:16384", "16:32768")
@export_flags(
"1:1",
"2:2",
"3:4",
"4:8",
"5:16",
"6:32",
"7:64",
"8:128",
"9:256",
"10:512",
"11:1024",
"12:2048",
"13:4096",
"14:8192",
"15:16384",
"16:32768",
"17:65536",
"18:131072",
"19:262144",
"20:524288",
"21:1048576",
"22:2097152",
"23:4194304",
"24:8388608",
"25:16777216",
"26:33554432",
"27:67108864",
"28:134217728",
"29:268435456",
"30:536870912",
"31:1073741824",
"32:2147483648"
)
var eventFlag:int = 0;
func start() -> void:
super.start()
pass
# EVENT.eventFlagOn(event, eventFlag)
match action:
Action.TURN_ON:
EVENT.eventFlagOn(event, eventFlag)
Action.TURN_OFF:
EVENT.eventFlagOff(event, eventFlag)
Action.SET_TO:
EVENT.eventFlagSetTo(event, eventFlag)
Action.ALL_ON:
EVENT.eventFlagSetTo(event, 0xffffffff)
Action.ALL_OFF:
EVENT.eventFlagSetTo(event, 0)
_:
print("Invalid action: %s" % str(action))