Prettify the missing skills tooltip a bit by also displaying the item

requiring said skills
This commit is contained in:
cncfanatics
2010-11-02 10:04:21 +01:00
parent 22642957cb
commit 887ad4d9f6
4 changed files with 15 additions and 7 deletions

2
eos

Submodule eos updated: 2dc357ce1f...6f6c3b4880

View File

@@ -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

View File

@@ -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)

View File

@@ -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