When opening the character editor, always select the currently used
character by default
This commit is contained in:
@@ -49,6 +49,7 @@ class CharacterEditor(wx.Frame):
|
||||
|
||||
cChar = service.Character.getInstance()
|
||||
charList = cChar.getCharacterList()
|
||||
charList.sort(key=lambda t: t[1])
|
||||
|
||||
self.btnSave = wx.Button(self, wx.ID_SAVE)
|
||||
self.btnSave.Hide()
|
||||
@@ -60,14 +61,17 @@ class CharacterEditor(wx.Frame):
|
||||
|
||||
self.skillTreeChoice = wx.Choice(self, wx.ID_ANY, style=0)
|
||||
|
||||
for id, name in charList:
|
||||
self.skillTreeChoice.Append(name, id)
|
||||
|
||||
self.skillTreeChoice.SetSelection(0)
|
||||
for id, name, active in charList:
|
||||
i = self.skillTreeChoice.Append(name, id)
|
||||
if active:
|
||||
self.skillTreeChoice.SetSelection(i)
|
||||
|
||||
self.navSizer.Add(self.skillTreeChoice, 1, wx.ALL | wx.EXPAND, 5)
|
||||
|
||||
buttons = (("new", wx.ART_NEW), (("rename", bitmapLoader.getBitmap("rename", "icons")), "copy", wx.ART_COPY), ("delete", wx.ART_DELETE))
|
||||
buttons = (("new", wx.ART_NEW),
|
||||
("rename", bitmapLoader.getBitmap("rename", "icons")),
|
||||
("copy", wx.ART_COPY),
|
||||
("delete", wx.ART_DELETE))
|
||||
|
||||
size = None
|
||||
for name, art in buttons:
|
||||
|
||||
@@ -58,7 +58,9 @@ class CharacterSelection(wx.Panel):
|
||||
activeChar = self.getActiveCharacter()
|
||||
|
||||
choice.Clear()
|
||||
for id, name in cChar.getCharacterList():
|
||||
charList = cChar.getCharacterList()
|
||||
cChar.getCharacterList()
|
||||
for id, name, active in charList:
|
||||
currId = choice.Append(name, id)
|
||||
if id == activeChar:
|
||||
choice.SetSelection(currId)
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
import eos.db
|
||||
import eos.types
|
||||
import copy
|
||||
import service
|
||||
|
||||
class Character():
|
||||
instance = None
|
||||
@@ -42,7 +43,8 @@ class Character():
|
||||
baseChars = [eos.types.Character.getAll0(), eos.types.Character.getAll5()]
|
||||
# Flush incase all0 & all5 weren't in the db yet
|
||||
eos.db.commit()
|
||||
return map(lambda c: (c.ID, c.name), eos.db.getCharacterList())
|
||||
sFit = service.Fit.getInstance()
|
||||
return map(lambda c: (c.ID, c.name, c == sFit.character), eos.db.getCharacterList())
|
||||
|
||||
def getSkillGroups(self):
|
||||
cat = eos.db.getCategory(16)
|
||||
|
||||
Reference in New Issue
Block a user