Gather data on damage patterns into single object
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user