diff options
author | Jakob Stendahl <jakob.stendahl@outlook.com> | 2021-10-13 08:12:38 +0200 |
---|---|---|
committer | Jakob Stendahl <jakob.stendahl@outlook.com> | 2021-10-13 08:12:38 +0200 |
commit | 07a899ad61e292260bd8aff4ca73217662a323d6 (patch) | |
tree | e9697706d92cbd23f5c5c95c6012bf484e0c573e /NeoRuntime | |
parent | c1b6eec770b885a9829e1f62bad5cc99389ca429 (diff) | |
download | Luxcena-Neo-07a899ad61e292260bd8aff4ca73217662a323d6.tar.gz Luxcena-Neo-07a899ad61e292260bd8aff4ca73217662a323d6.zip |
:lipstick: Add Trigger variable, fix small UI bug
Diffstat (limited to 'NeoRuntime')
-rw-r--r-- | NeoRuntime/Runtime/luxcena_neo/neo_behaviour.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/NeoRuntime/Runtime/luxcena_neo/neo_behaviour.py b/NeoRuntime/Runtime/luxcena_neo/neo_behaviour.py index 4da3093..6ae58fe 100644 --- a/NeoRuntime/Runtime/luxcena_neo/neo_behaviour.py +++ b/NeoRuntime/Runtime/luxcena_neo/neo_behaviour.py @@ -56,6 +56,7 @@ class VariableType(Enum): FLOAT = 3 COLOR = 4 BOOL = 5 + TRIGGER = 6 class Variables: @@ -264,3 +265,17 @@ class BooleanVariable(Variable): super(BooleanVariable, type(self)).value.fset(self, value) except: print("Attempted to set {} to \"{}\", which is not a valid bool...".format(self.name, value)) + +class Trigger(self): + + def __init__(self, name: str, **kwargs): + super().__init__(name, False, VariableType.TRIGGER, **kwargs) + + @Variable.value.setter + def value(self, value): + try: + value = bool(value) + if value: value = False + super(BooleanVariable, type(self)).value.fset(self, value) + except: + print("Attempted to set {} to \"{}\", which is not a valid bool...".format(self.name, value))
\ No newline at end of file |