aboutsummaryrefslogtreecommitdiff
path: root/NeoRuntime
diff options
context:
space:
mode:
authorJakob Stendahl <jakob.stendahl@outlook.com>2021-10-13 08:13:31 +0200
committerJakob Stendahl <jakob.stendahl@outlook.com>2021-10-13 08:13:31 +0200
commit2e26cd607285bcfe1299a690efe37b30fa2c2690 (patch)
treefda46423cf7a1116732674700228e49fbf0f2b4d /NeoRuntime
parentb07bd26f46e756c3fcf5eea676e8a5a52f169a92 (diff)
parent07a899ad61e292260bd8aff4ca73217662a323d6 (diff)
downloadLuxcena-Neo-2e26cd607285bcfe1299a690efe37b30fa2c2690.tar.gz
Luxcena-Neo-2e26cd607285bcfe1299a690efe37b30fa2c2690.zip
:twisted_rightwards_arrows: Merge UI bug fix and new Variable type
Diffstat (limited to 'NeoRuntime')
-rw-r--r--NeoRuntime/Runtime/luxcena_neo/neo_behaviour.py15
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