Skip to content

Commit

Permalink
Gather data on damage patterns into single object
Browse files Browse the repository at this point in the history
  • Loading branch information
DarkFenX committed Dec 5, 2019
1 parent a158960 commit e386232
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
12 changes: 12 additions & 0 deletions gui/builtinContextMenus/damagePatternChange.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,18 @@ def getText(self, callingWindow, itmContext):
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:
Expand Down
4 changes: 2 additions & 2 deletions gui/contextMenu.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,12 +182,12 @@ def nextID():
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
Expand Down

0 comments on commit e386232

Please sign in to comment.