Prettify the missing skills tooltip a bit by also displaying the item
requiring said skills
This commit is contained in:
2
eos
2
eos
Submodule eos updated: 2dc357ce1f...6f6c3b4880
@@ -132,9 +132,14 @@ class CharacterSelection(wx.Panel):
|
||||
|
||||
def _buildSkillsTooltip(self, reqs, tabulationLevel = 0):
|
||||
tip = ""
|
||||
for name, info in reqs.iteritems():
|
||||
level, more = info
|
||||
tip += "%s%s: %d\n" % (" " * tabulationLevel, name, level)
|
||||
tip += self._buildSkillsTooltip(more, tabulationLevel + 1)
|
||||
if tabulationLevel == 0:
|
||||
for item, subReqs in reqs.iteritems():
|
||||
tip += "%s:\n" % item.name
|
||||
tip += self._buildSkillsTooltip(subReqs, 1)
|
||||
else:
|
||||
for name, info in reqs.iteritems():
|
||||
level, more = info
|
||||
tip += "%s%s: %d\n" % (" " * tabulationLevel, name, level)
|
||||
tip += self._buildSkillsTooltip(more, tabulationLevel + 1)
|
||||
|
||||
return tip
|
||||
|
||||
@@ -33,7 +33,7 @@ class ProjectedView(d.Display):
|
||||
"Projected Ammo"]
|
||||
|
||||
def __init__(self, parent):
|
||||
d.Display.__init__(self, parent)
|
||||
d.Display.__init__(self, parent, style = wx.LC_SINGLE_SEL)
|
||||
self.mainFrame.Bind(fv.FIT_CHANGED, self.fitChanged)
|
||||
self.Bind(wx.EVT_LEFT_DOWN, self.click)
|
||||
self.Bind(wx.EVT_RIGHT_DOWN, self.click)
|
||||
|
||||
@@ -146,8 +146,11 @@ class Character():
|
||||
for thing in itertools.chain(fit.modules, fit.drones, (fit.ship,)):
|
||||
for attr in ("item", "charge"):
|
||||
subThing = getattr(thing, attr, None)
|
||||
subReqs = {}
|
||||
if subThing is not None:
|
||||
self._checkRequirements(fit, fit.character, subThing, reqs)
|
||||
self._checkRequirements(fit, fit.character, subThing, subReqs)
|
||||
if subReqs:
|
||||
reqs[subThing] = subReqs
|
||||
|
||||
return reqs
|
||||
|
||||
|
||||
Reference in New Issue
Block a user