def seePlayerListPanel(maxPage): titleText = TextLoading.getTextData(TextLoading.stageWordId, '74') EraPrint.plt(titleText) inputS = [] pageId = int(CacheContorl.panelState['SeePlayerListPanel']) pageShow = int(GameConfig.playerlist_show) maxPage = int(maxPage) playerMax = CharacterHandle.getCharacterIndexMax() if pageId == maxPage: showPageStart = pageShow * (pageId) showPageOver = showPageStart + (playerMax - showPageStart) else: showPageOver = pageShow * pageId showPageStart = showPageOver - pageShow for i in range(showPageStart, showPageOver + 1): playerId = str(i) cmdId = i - showPageStart cmdIdText = CmdButtonQueue.idIndex(cmdId) cmdText = AttrText.getPlayerAbbreviationsInfo(playerId) cmdIdTextIndex = TextHandle.getTextIndex(cmdIdText) windowWidth = int(GameConfig.text_width) textWidth = windowWidth - cmdIdTextIndex cmdText = TextHandle.align(cmdText, 'center', textWidth=textWidth) cmdText = cmdIdText + ' ' + cmdText cmdId = str(cmdId) EraPrint.plittleline() PyCmd.pcmd(cmdText, cmdId, None) inputS.append(cmdId) EraPrint.p('\n') pageText = '(' + str(pageId) + '/' + str(maxPage) + ')' EraPrint.printPageLine(sample='-', string=pageText) EraPrint.p('\n') return inputS
def seeSaveListPanel(pageSaveValue, lastSavePageValue, autoSave=False): savePanelPage = int(CacheContorl.panelState['SeeSaveListPanel']) + 1 inputS = [] idTextList = [] idInfoText = TextLoading.getTextData(TextLoading.stageWordId, '72') textWidth = int(GameConfig.text_width) saveNoneText = TextLoading.getTextData(TextLoading.messageId, '20') if savePanelPage == int(GameConfig.save_page) + 1: startSaveId = int(pageSaveValue) * (savePanelPage - 1) overSaveId = startSaveId + lastSavePageValue else: overSaveId = int(pageSaveValue) * savePanelPage startSaveId = overSaveId - int(pageSaveValue) for i in range(0, overSaveId - startSaveId): id = CmdButtonQueue.idIndex(i) saveId = startSaveId + i if autoSave == True and SaveHandle.judgeSaveFileExist(saveId) != '1': idText = idInfoText + " " + str(saveId) + ":" idTextList.append(idText) else: idText = id + idInfoText + " " + str(saveId) + ":" idTextList.append(idText) for i in range(0, overSaveId - startSaveId): id = str(i) idText = idTextList[i] EraPrint.plittleline() saveid = SaveHandle.getSavePageSaveId(pageSaveValue, i) if SaveHandle.judgeSaveFileExist(saveid) == '1': saveData = SaveHandle.loadSave(saveid) playerData = saveData['playerData'] gameTimeData = saveData['gameTime'] gameTimeText = GameTime.getDateText(gameTimeData) playerName = playerData['object']['0']['Name'] saveVerson = saveData['gameVerson'] saveText = playerName + ' ' + gameTimeText + ' ' + saveVerson idTextIndex = int(TextHandle.getTextIndex(idText)) fixIdWidth = textWidth - idTextIndex saveAlign = TextHandle.align(saveText, 'center', textWidth=fixIdWidth) idText = idText + saveAlign PyCmd.pcmd(idText, id, None) EraPrint.p('\n') inputS.append(id) else: idTextIndex = int(TextHandle.getTextIndex(idText)) fixIdWidth = textWidth - idTextIndex saveNoneAlign = TextHandle.align(saveNoneText, 'center', textWidth=fixIdWidth) idText = idText + saveNoneAlign if autoSave == True: EraPrint.p(idText) EraPrint.p('\n') else: PyCmd.pcmd(idText, id, None) inputS.append(id) EraPrint.p('\n') if autoSave == True: autoInfoText = TextLoading.getTextData(TextLoading.stageWordId, "73") i = pageSaveValue id = CmdButtonQueue.idIndex(i) EraPrint.plittleline() if SaveHandle.judgeSaveFileExist('auto') == '1': saveData = SaveHandle.loadSave('auto') playerData = saveData['playerData'] gameTimeData = saveData['gameTime'] gameTimeText = GameTime.getDateText(gameTimeData) saveVerson = saveData['gameVerson'] playerName = playerData['object']['0']['Name'] saveText = playerName + ' ' + gameTimeText + ' ' + saveVerson idText = id + autoInfoText idTextIndex = int(TextHandle.getTextIndex(idText)) fixIdWidth = textWidth - idTextIndex saveTextAlign = TextHandle.align(saveText, 'center', textWidth=fixIdWidth) idText = idText + saveTextAlign PyCmd.pcmd(idText, id, None) inputS.append(id) EraPrint.p('\n') else: idTextIndex = int(TextHandle.getTextIndex(autoInfoText)) fixIdWidth = textWidth - idTextIndex saveNoneAlign = TextHandle.align(saveNoneText, 'center', textWidth=fixIdWidth) idText = autoInfoText + saveNoneAlign EraPrint.p(idText) EraPrint.p('\n') else: pass return inputS