Add save character as dialog

This commit is contained in:
blitzmann
2015-09-24 20:46:07 -04:00
parent 61614553a2
commit b844bdf986
3 changed files with 38 additions and 7 deletions

View File

@@ -199,11 +199,11 @@ class Character(object):
char = eos.db.getCharacter(charID)
char.saveLevels()
def saveCharacterAs(self, charID):
def saveCharacterAs(self, charID, newName):
"""Save edited skills as a new character"""
char = eos.db.getCharacter(charID)
newChar = copy.deepcopy(char)
newChar.name = newChar.name + " (saved as)"
newChar.name = newName
eos.db.save(newChar)
# revert old char
@@ -266,7 +266,7 @@ class Character(object):
def getApiDetails(self, charID):
char = eos.db.getCharacter(charID)
if char.chars is not None:
if char.chars is not None:
chars = json.loads(char.chars)
else:
chars = None