def loadGame(tkRoot):
print("loadGame")
#so we need to open a file select menu, filtering for .wwr
#then we just parse the string to our dict.
loadFileName = filedialog.askopenfilename(title = "Select file",filetypes = (("warpWar files","*.wwr"),("all files","*.*")))
print (loadFileName)
loadFile = open(loadFileName, 'r')
gameString = loadFile.read()
loadFile.close()
gameDict = json.loads(gameString)
#send the game to the server.
sendJson = warpWarCmds().restoreGame(tkRoot.cfg.Profile.plid, gameDict)
print (sendJson)
tkRoot.hCon.sendCmd(sendJson)
# I don't like these. They don't seem very objecty
评论列表
文章目录