def confirmationOverlaySave_func(oldPanel, saveId): cmdList = SaveHandleFramePanel.confirmationOverlaySavePanel() yrn = GameInit.askfor_All(cmdList) PyCmd.clr_cmd() if yrn == '0': SaveHandle.establishSave(saveId) establishSave_func(oldPanel) else: establishSave_func(oldPanel)
def confirmationLoadSave_func(oldPanel, saveId): cmdList = SaveHandleFramePanel.confirmationLoadSavePanel() yrn = GameInit.askfor_All(cmdList) PyCmd.clr_cmd() if yrn == '0': SaveHandle.inputLoadSave(saveId) import script.Flow.Main as mainframe mainframe.mainFrame_func() else: loadSave_func(oldPanel)
def confirmationRemoveSave_func(saveId:str): ''' 覆盖存档询问流程 玩家输入0:删除指定存档 Keyword arguments: saveId -- 存档id ''' cmdList = SaveHandleFramePanel.confirmationRemoveSavePanel() yrn = GameInit.askfor_All(cmdList) if yrn == '0': SaveHandle.removeSave(saveId) PyCmd.clr_cmd()
def confirmationOverlaySave_func(saveId:str): ''' 覆盖存档询问流程 玩家输入0:对存档进行覆盖 Keyword arguments: saveId -- 存档id ''' cmdList = SaveHandleFramePanel.confirmationOverlaySavePanel() yrn = GameInit.askfor_All(cmdList) PyCmd.clr_cmd() if yrn == '0': SaveHandle.establishSave(saveId)
def confirmationRemoveSave_func(saveId, oldPanel, tooOldPanel): cmdList = SaveHandleFramePanel.confirmationRemoveSavePanel() yrn = GameInit.askfor_All(cmdList) if yrn == '0': SaveHandle.removeSave(saveId) else: pass PyCmd.clr_cmd() if oldPanel == 'LoadSavePanel': loadSave_func(tooOldPanel) elif oldPanel == 'EstablishSavePanel': establishSave_func(tooOldPanel)
def confirmationLoadSave_func(saveId:str): ''' 读取存档询问流程 玩家输入0:读取指定存档 Keyword arguments: saveId -- 存档id ''' cmdList = SaveHandleFramePanel.confirmationLoadSavePanel() yrn = GameInit.askfor_All(cmdList) PyCmd.clr_cmd() if yrn == '0': SaveHandle.inputLoadSave(saveId) CacheContorl.nowFlowId = 'main' return True return False
def establishSave_func(oldPanel): inputS = [] savePage = savePageIndex() showSaveValue = savePage[0] lastSavePageValue = savePage[1] SaveHandleFramePanel.establishSaveInfoHeadPanel() flowReturn = SaveHandleFramePanel.seeSaveListPanel(showSaveValue, lastSavePageValue) inputS = inputS + flowReturn startId = len(inputS) flowReturn = SaveHandleFramePanel.askForChangeSavePagePanel(startId) inputS = inputS + flowReturn yrn = GameInit.askfor_Int(inputS) PyCmd.clr_cmd() if yrn == str(startId): savePanelPage = int(CacheContorl.panelState['SeeSaveListPanel']) if savePanelPage == 0: CacheContorl.panelState[ 'SeeSaveListPanel'] = CacheContorl.maxSavePage else: CacheContorl.panelState['SeeSaveListPanel'] = savePanelPage - 1 establishSave_func(oldPanel) elif yrn == str(startId + 1): if oldPanel == 'MainFramePanel': CacheContorl.panelState['SeeSaveListPanel'] = 0 import script.Flow.Main as mainframe mainframe.mainFrame_func() else: pass elif yrn == str(startId + 2): savePanelPage = int(CacheContorl.panelState['SeeSaveListPanel']) if savePanelPage == CacheContorl.maxSavePage: CacheContorl.panelState['SeeSaveListPanel'] = 0 else: CacheContorl.panelState['SeeSaveListPanel'] = savePanelPage + 1 establishSave_func(oldPanel) else: ansReturn = int(yrn) saveId = SaveHandle.getSavePageSaveId(showSaveValue, ansReturn) if SaveHandle.judgeSaveFileExist(saveId) == '1': askForOverlaySave_func(oldPanel, saveId) else: SaveHandle.establishSave(saveId) establishSave_func(oldPanel)
def establishSave_func(): ''' 绘制保存存档界面流程 ''' while (True): inputS = [] savePage = savePageIndex() showSaveValue = savePage[0] lastSavePageValue = savePage[1] SaveHandleFramePanel.establishSaveInfoHeadPanel() flowReturn = SaveHandleFramePanel.seeSaveListPanel( showSaveValue, lastSavePageValue) inputS = inputS + flowReturn startId = len(inputS) flowReturn = SaveHandleFramePanel.askForChangeSavePagePanel(startId) inputS = inputS + flowReturn yrn = GameInit.askfor_Int(inputS) PyCmd.clr_cmd() if yrn == str(startId): savePanelPage = int(CacheContorl.panelState['SeeSaveListPanel']) if savePanelPage == 0: CacheContorl.panelState[ 'SeeSaveListPanel'] = CacheContorl.maxSavePage else: CacheContorl.panelState['SeeSaveListPanel'] = savePanelPage - 1 elif yrn == str(startId + 1): CacheContorl.panelState['SeeSaveListPanel'] = 0 CacheContorl.nowFlowId = CacheContorl.oldFlowId break elif yrn == str(startId + 2): savePanelPage = int(CacheContorl.panelState['SeeSaveListPanel']) if savePanelPage == CacheContorl.maxSavePage: CacheContorl.panelState['SeeSaveListPanel'] = 0 else: CacheContorl.panelState['SeeSaveListPanel'] = savePanelPage + 1 else: ansReturn = int(yrn) saveId = SaveHandle.getSavePageSaveId(showSaveValue, ansReturn) if SaveHandle.judgeSaveFileExist(saveId) == '1': askForOverlaySave_func(saveId) else: SaveHandle.establishSave(saveId)
def loadSave_func(oldPanel): inputS = [] savePage = savePageIndex() showSaveValue = savePage[0] lastSavePageValue = savePage[1] SaveHandleFramePanel.loadSaveInfoHeadPanel() flowReturn = SaveHandleFramePanel.seeSaveListPanel(showSaveValue, lastSavePageValue, True) inputS = inputS + flowReturn startId = len(inputS) flowReturn = SaveHandleFramePanel.askForChangeSavePagePanel(startId) inputS = inputS + flowReturn yrn = GameInit.askfor_Int(inputS) PyCmd.clr_cmd() if yrn == str(startId): savePanelPage = int(CacheContorl.panelState['SeeSaveListPanel']) if savePanelPage == 0: CacheContorl.panelState[ 'SeeSaveListPanel'] = CacheContorl.maxSavePage else: CacheContorl.panelState['SeeSaveListPanel'] = savePanelPage - 1 loadSave_func(oldPanel) elif yrn == str(startId + 1): if oldPanel == 'MainFlowPanel': CacheContorl.wframeMouse['wFrameRePrint'] = 1 CacheContorl.panelState['SeeSaveListPanel'] = 0 import script.Design.StartFlow as mainflow mainflow.main_func() elif oldPanel == 'MainFramePanel': CacheContorl.panelState['SeeSaveListPanel'] = 0 import script.Flow.Main as mainframe mainframe.mainFrame_func() pass elif yrn == str(startId + 2): savePanelPage = int(CacheContorl.panelState['SeeSaveListPanel']) if savePanelPage == CacheContorl.maxSavePage: CacheContorl.panelState['SeeSaveListPanel'] = 0 else: CacheContorl.panelState['SeeSaveListPanel'] = savePanelPage + 1 loadSave_func(oldPanel) else: ansReturn = int(yrn) saveId = SaveHandle.getSavePageSaveId(showSaveValue, ansReturn) askForLoadSave_func(oldPanel, saveId)
def seeSaveListPanel(pageSaveValue: int, lastSavePageValue: int, autoSave=False) -> list: ''' 查看存档页面面板 Keyword arguments: pageSaveValue -- 单页最大存档显示数量 lastSavePageValue -- 最后一页存档显示数量 autoSave -- 自动存档显示开关 (default False) ''' savePanelPage = int(CacheContorl.panelState['SeeSaveListPanel']) + 1 inputS = [] idTextList = [] idInfoText = TextLoading.getTextData(TextLoading.stageWordPath, '72') textWidth = int(GameConfig.text_width) saveNoneText = TextLoading.getTextData(TextLoading.messagePath, '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': saveInfoHead = SaveHandle.loadSaveInfoHead(saveId) gameTimeData = saveInfoHead['gameTime'] gameTimeText = GameTime.getDateText(gameTimeData) characterName = saveInfoHead['characterName'] saveVerson = saveInfoHead['gameVerson'] saveText = characterName + ' ' + 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.stageWordPath, "73") i = pageSaveValue id = CmdButtonQueue.idIndex(i) EraPrint.plittleline() if SaveHandle.judgeSaveFileExist('auto') == '1': saveInfoHead = SaveHandle.loadSaveInfoHead('auto') gameTimeData = saveInfoHead['gameTime'] gameTimeText = GameTime.getDateText(gameTimeData) characterName = saveInfoHead['characterName'] saveVerson = saveInfoHead['gameVerson'] saveText = characterName + ' ' + 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') return inputS