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

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)