Add "starting cap" parameter to cap graph

This commit is contained in:
DarkPhoenix
2019-08-19 13:10:28 +03:00
parent 9494885f45
commit 348c4d71df
5 changed files with 36 additions and 7 deletions

View File

@@ -22,7 +22,6 @@ from collections import namedtuple
VectorDef = namedtuple('VectorDef', ('lengthHandle', 'lengthUnit', 'angleHandle', 'angleUnit', 'label'))
InputCheckbox = namedtuple('InputCheckbox', ('handle', 'label', 'defaultValue'))
class YDef:
@@ -111,3 +110,25 @@ class Input:
self.mainTooltip == other.mainTooltip,
self.secondaryTooltip == other.secondaryTooltip,
self.conditions == other.conditions))
class InputCheckbox:
def __init__(self, handle, label, defaultValue, conditions=()):
self.handle = handle
self.label = label
self.defaultValue = defaultValue
# Format: ((x condition, y condition), (x condition, y condition), ...)
self.conditions = tuple(conditions)
def __hash__(self):
return hash((self.handle, self.label, self.defaultValue, self.conditions))
def __eq__(self, other):
if not isinstance(other, Input):
return False
return all((
self.handle == other.handle,
self.label == other.label,
self.defaultValue == other.defaultValue,
self.conditions == other.conditions))