Gather data on damage patterns into single object

This commit is contained in:
DarkPhoenix
2019-12-05 10:44:26 +03:00
parent a15896044d
commit e386232de1
2 changed files with 14 additions and 2 deletions

View File

@@ -34,6 +34,18 @@ class ChangeDamagePattern(ContextMenuUnconditional):
self.patternIds = {}
self.subMenus = OrderedDict()
self.singles = []
self.items = OrderedDict()
for pattern in self.patterns:
remainingName = pattern.name.strip()
container = self.items
while True:
start, end = remainingName.find('['), remainingName.find(']')
if start == -1 or end == -1:
container[remainingName] = pattern
break
container = container.setdefault(remainingName[start + 1:end], OrderedDict())
remainingName = remainingName[end + 1:].strip()
# iterate and separate damage patterns based on "[Parent] Child"
for pattern in self.patterns:

View File

@@ -182,12 +182,12 @@ class ContextMenu(metaclass=ABCMeta):
return ContextMenu._ids[ContextMenu._idxid]
def isChecked(self, i):
'''If menu item is toggleable, this should return bool value'''
"""If menu item is toggleable, this should return bool value"""
return None
@property
def enabled(self):
'''If menu item is enabled. Allows an item to display, but not be selected'''
"""If menu item is enabled. Allows an item to display, but not be selected"""
return True
@abstractmethod