Show short profile name in graphs
This commit is contained in:
@@ -32,7 +32,7 @@ class ChangeDamagePattern(ContextMenuUnconditional):
|
||||
# Order here is important: patterns with duplicate names from the latter will overwrite
|
||||
# patterns from the former
|
||||
self.patterns = list(chain(sDP.getBuiltinDamagePatternList(), sDP.getUserDamagePatternList()))
|
||||
self.patterns.sort(key=lambda p: (p.name not in ["Uniform", "Selected Ammo"], p.name))
|
||||
self.patterns.sort(key=lambda p: (p.fullName not in ["Uniform", "Selected Ammo"], p.fullName))
|
||||
|
||||
self.patternEventMap = {}
|
||||
|
||||
|
||||
@@ -48,21 +48,10 @@ class TargetProfileAdder(ContextMenuUnconditional):
|
||||
self.callingWindow = callingWindow
|
||||
sTR = svc_TargetProfile.getInstance()
|
||||
profiles = list(chain(sTR.getBuiltinTargetProfileList(), sTR.getUserTargetProfileList()))
|
||||
profiles.sort(key=lambda p: (p.name in ['None'], p.name))
|
||||
profiles.sort(key=lambda p: p.fullName)
|
||||
|
||||
self.profileEventMap = {}
|
||||
items = (OrderedDict(), OrderedDict())
|
||||
for profile in profiles:
|
||||
remainingName = profile.name.strip()
|
||||
container = items
|
||||
while True:
|
||||
start, end = remainingName.find('['), remainingName.find(']')
|
||||
if start == -1 or end == -1:
|
||||
container[0][remainingName] = profile
|
||||
break
|
||||
container = container[1].setdefault(remainingName[start + 1:end], (OrderedDict(), OrderedDict()))
|
||||
remainingName = remainingName[end + 1:].strip()
|
||||
items = (OrderedDict(), OrderedDict())
|
||||
for profile in profiles:
|
||||
container = items
|
||||
for categoryName in profile.hierarchy:
|
||||
@@ -76,7 +65,7 @@ class TargetProfileAdder(ContextMenuUnconditional):
|
||||
menu = wx.Menu()
|
||||
if first:
|
||||
idealProfile = TargetProfile.getIdeal()
|
||||
mitem = self._addProfile(rootMenu if msw else parentMenu, idealProfile, idealProfile.name)
|
||||
mitem = self._addProfile(rootMenu if msw else parentMenu, idealProfile, idealProfile.fullName)
|
||||
menu.Append(mitem)
|
||||
for name, pattern in container[0].items():
|
||||
menuItem = self._addProfile(rootMenu if msw else parentMenu, pattern, name)
|
||||
|
||||
@@ -60,7 +60,7 @@ class TargetProfileSwitcher(ContextMenuUnconditional):
|
||||
def getSubMenu(self, callingWindow, context, rootMenu, i, pitem):
|
||||
sTR = svc_TargetProfile.getInstance()
|
||||
profiles = list(chain(sTR.getBuiltinTargetProfileList(), sTR.getUserTargetProfileList()))
|
||||
profiles.sort(key=lambda p: (p.name in ['None'], p.name))
|
||||
profiles.sort(key=lambda p: p.fullName)
|
||||
|
||||
self.profileEventMap = {}
|
||||
items = (OrderedDict(), OrderedDict())
|
||||
|
||||
@@ -111,7 +111,7 @@ class BaseName(ViewColumn):
|
||||
elif isinstance(stuff, Implant):
|
||||
return stuff.item.name
|
||||
elif isinstance(stuff, TargetProfile):
|
||||
return stuff.name
|
||||
return stuff.shortName
|
||||
else:
|
||||
item = getattr(stuff, "item", stuff)
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ class DmgPatternNameValidator(BaseValidator):
|
||||
try:
|
||||
if len(text) == 0:
|
||||
raise ValueError("You must supply a name for your Damage Profile!")
|
||||
elif text in [x.name for x in entityEditor.choices]:
|
||||
elif text in [x.rawName for x in entityEditor.choices]:
|
||||
raise ValueError("Damage Profile name already in use, please choose another.")
|
||||
|
||||
return True
|
||||
@@ -66,8 +66,8 @@ class DmgPatternEntityEditor(EntityEditor):
|
||||
|
||||
def getEntitiesFromContext(self):
|
||||
sDP = DamagePattern.getInstance()
|
||||
choices = sorted(sDP.getUserDamagePatternList(), key=lambda p: p.name)
|
||||
return [c for c in choices if c.name != "Selected Ammo"]
|
||||
choices = sorted(sDP.getUserDamagePatternList(), key=lambda p: p.rawName)
|
||||
return [c for c in choices if c.rawName != "Selected Ammo"]
|
||||
|
||||
def DoNew(self, name):
|
||||
sDP = DamagePattern.getInstance()
|
||||
@@ -237,7 +237,7 @@ class DmgPatternEditor(AuxiliaryFrame):
|
||||
if p is None:
|
||||
return
|
||||
|
||||
if p.name == "Uniform" or p.name == "Selected Ammo":
|
||||
if p.rawName == "Uniform" or p.rawName == "Selected Ammo":
|
||||
self.restrict()
|
||||
else:
|
||||
self.unrestrict()
|
||||
|
||||
@@ -68,7 +68,7 @@ class TargetProfileNameValidator(BaseValidator):
|
||||
try:
|
||||
if len(text) == 0:
|
||||
raise ValueError("You must supply a name for your Target Profile!")
|
||||
elif text in [x.name for x in entityEditor.choices]:
|
||||
elif text in [x.rawName for x in entityEditor.choices]:
|
||||
raise ValueError("Target Profile name already in use, please choose another.")
|
||||
|
||||
return True
|
||||
@@ -88,7 +88,7 @@ class TargetProfileEntityEditor(EntityEditor):
|
||||
|
||||
def getEntitiesFromContext(self):
|
||||
sTR = TargetProfile.getInstance()
|
||||
choices = sorted(sTR.getUserTargetProfileList(), key=lambda p: p.name)
|
||||
choices = sorted(sTR.getUserTargetProfileList(), key=lambda p: p.rawName)
|
||||
return choices
|
||||
|
||||
def DoNew(self, name):
|
||||
|
||||
Reference in New Issue
Block a user