def seeAttrShowHandlePanel(): ansListData = TextLoading.getTextData(TextLoading.cmdPath, 'seeAttrPanelHandle') seeAttrPanelHandleCache = CacheContorl.panelState['AttrShowHandlePanel'] inputS = [] if seeAttrPanelHandleCache == '0': inputS.append(ansListData[2]) inputS.append(ansListData[1]) elif seeAttrPanelHandleCache == '1': inputS.append(ansListData[0]) inputS.append(ansListData[2]) elif seeAttrPanelHandleCache == '2': inputS.append(ansListData[1]) inputS.append(ansListData[0]) yrn = CmdButtonQueue.optionstr(CmdButtonQueue.seeattrpanelmenu, 2, cmdSize='center', askfor=False, cmdListData=inputS) return yrn
def seeCharacterItemPanel(characterId: int) -> list: ''' 查看角色背包道具列表面板 Keyword arguments: characterId -- 角色Id ''' EraPrint.p(AttrText.getSeeAttrPanelHeadCharacterInfo(characterId)) EraPrint.pline('.') if characterId != '0': EraPrint.pl(TextLoading.getTextData(TextLoading.messagePath, '37')) return [] characterItemData = CacheContorl.characterData['character'][ characterId].Item if len(characterItemData) == 0: EraPrint.pl(TextLoading.getTextData(TextLoading.messagePath, '36')) return [] nowPageId = int(CacheContorl.panelState['SeeCharacterItemListPanel']) nowPageMax = GameConfig.see_character_item_max nowPageStartId = nowPageId * nowPageMax nowPageEndId = nowPageStartId + nowPageMax if nowPageEndId > len(characterItemData.keys()): nowPageEndId = len(characterItemData.keys()) inputS = [] index = 0 for i in range(nowPageStartId, nowPageEndId): itemId = list(characterItemData.keys())[i] itemData = characterItemData[itemId] itemText = itemData['ItemName'] + ' ' + TextLoading.getTextData( TextLoading.stageWordPath, '136') + str(itemData['ItemNum']) if characterId == '0': idInfo = CmdButtonQueue.idIndex(index) cmdText = idInfo + drawText PyCmd.pcmd(cmdText, index, None) else: EraPrint.p(drawText) index += 1 inputS.append(str(index)) EraPrint.p('\n') return inputS
def seeSceneCharacterListPanel() -> list: ''' 当前场景角色列表面板 ''' inputS = [] seeCharacterText = TextLoading.getTextData(TextLoading.messagePath, '26') EraPrint.p(seeCharacterText) EraPrint.p('\n') scenePath = CacheContorl.characterData['character']['0']['Position'] scenePathStr = MapHandle.getMapSystemPathStrForList(scenePath) nameList = MapHandle.getSceneCharacterNameList(scenePathStr, True) nameList = getNowPageNameList(nameList) characterId = CacheContorl.characterData['characterId'] characterData = CacheContorl.characterData['character'][characterId] characterName = characterData['Name'] inputS = CmdButtonQueue.optionstr('', cmdColumn=10, cmdSize='center', askfor=False, cmdListData=nameList, nullCmd=characterName) return inputS
def seeCharacterClothesCmd(startId:int,nowClothingType:str) -> str: ''' 用于控制查看角色服装列表面板的命令菜单 Keyword arguments: startId -- cmd命令的初始Id nowClothingType -- 当前列表的服装类型 ''' EraPrint.pline() clothingTypeList = list(Clothing.clothingTypeTextList.keys()) cmdList = TextLoading.getTextData(TextLoading.cmdPath,CmdButtonQueue.seecharacterclothes) nowClothingTypeIndex = clothingTypeList.index(nowClothingType) upTypeId = nowClothingTypeIndex - 1 if nowClothingTypeIndex == 0: upTypeId = len(clothingTypeList) - 1 nextTypeId = nowClothingTypeIndex + 1 if nowClothingTypeIndex == len(clothingTypeList) - 1: nextTypeId = 0 upTypeText = [Clothing.clothingTypeTextList[clothingTypeList[upTypeId]]] nextTypeText = [Clothing.clothingTypeTextList[clothingTypeList[nextTypeId]]] cmdList = upTypeText + cmdList + nextTypeText yrn = CmdButtonQueue.optionint(None,5,cmdSize='center',askfor=False,startId=startId,cmdListData=cmdList) return yrn
def backScenePanel(startId: str) -> list: ''' 查看场景页面基础命令绘制面板 Keyword arguments: startId -- 面板命令起始id ''' seeMapCmd = [] nowPosition = CacheContorl.characterData['character']['0']['Position'] nowMap = MapHandle.getMapForPath(nowPosition) cmdData = TextLoading.getTextData(TextLoading.cmdPath, CmdButtonQueue.seemap) seeMapCmd.append(cmdData[0]) if nowMap != [] and CacheContorl.nowMap != []: seeMapCmd.append(cmdData[1]) if nowMap != CacheContorl.nowMap: seeMapCmd.append(cmdData[2]) mapCmdList = CmdButtonQueue.optionint(cmdList=None, cmdListData=seeMapCmd, cmdColumn=3, askfor=False, cmdSize='center', startId=startId) return mapCmdList
def seeCharacterListPanel(maxPage: int) -> list: ''' 查看角色列表面板 Keyword arguments: maxPage -- 最大角色列表页数 ''' titleText = TextLoading.getTextData(TextLoading.stageWordPath, '74') EraPrint.plt(titleText) inputS = [] pageId = int(CacheContorl.panelState['SeeCharacterListPanel']) pageShow = int(GameConfig.characterlist_show) characterMax = CharacterHandle.getCharacterIndexMax() if pageId == maxPage: showPageStart = pageShow * pageId showPageOver = showPageStart + (characterMax + 1 - showPageStart) else: showPageOver = pageShow * (pageId + 1) showPageStart = showPageOver - pageShow for i in range(showPageStart, showPageOver): characterId = str(i) cmdId = i - showPageStart cmdIdText = CmdButtonQueue.idIndex(cmdId) cmdText = AttrText.getCharacterAbbreviationsInfo(characterId) 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 seeMovePathPanel() -> dict: ''' 当前场景可直接通往的移动路径绘制面板 ''' inputS = [] nowScene = CacheContorl.characterData['character']['0']['Position'] nowMap = CacheContorl.nowMap nowMapStr = MapHandle.getMapSystemPathStrForList(nowMap) mapData = CacheContorl.mapData[nowMapStr] movePathInfo = TextLoading.getTextData(TextLoading.messagePath, '27') EraPrint.p(movePathInfo) EraPrint.p('\n') pathEdge = mapData['PathEdge'] mapSceneId = str(MapHandle.getMapSceneIdForScenePath(nowMap, nowScene)) scenePath = pathEdge[mapSceneId] scenePathList = list(scenePath.keys()) if mapSceneId in scenePathList: remove(mapSceneId) if len(scenePathList) > 0: sceneCmd = [] for scene in scenePathList: nowMapStr = MapHandle.getMapSystemPathStrForList(nowMap) loadSceneData = MapHandle.getSceneDataForMap(nowMapStr, scene) sceneName = loadSceneData['SceneName'] sceneCmd.append(sceneName) yrn = CmdButtonQueue.optionstr(cmdList=None, cmdListData=sceneCmd, cmdColumn=4, askfor=False, cmdSize='center') inputS = inputS + yrn else: errorMoveText = TextLoading.getTextData(TextLoading.messagePath, '28') EraPrint.p(errorMoveText) EraPrint.pline() return {'inputS': inputS, 'scenePathList': scenePathList}
def seeCharacterClothesPanel(characterId: str, clothingType: str, maxPage: int): ''' 用于查看角色服装列表的面板 Keyword arguments: characterId -- 角色id clothingType -- 服装类型 maxPage -- 服装列表最大页数 ''' EraPrint.p('\n') characterClothingData = CacheContorl.characterData['character'][ characterId].Clothing[clothingType] characterPutOnList = CacheContorl.characterData['character'][ characterId].PutOn clothingTextData = {} tagTextIndex = 0 nowPageId = int(CacheContorl.panelState["SeeCharacterClothesPanel"]) nowPageMax = GameConfig.see_character_clothes_max nowPageStartId = nowPageId * nowPageMax nowPageEndId = nowPageStartId + nowPageMax if characterClothingData == {}: EraPrint.p(TextLoading.getTextData(TextLoading.messagePath, '34')) EraPrint.p('\n') return [] if nowPageEndId > len(characterClothingData.keys()): nowPageEndId = len(characterClothingData.keys()) passId = None for i in range(nowPageStartId, nowPageEndId): clothingId = list(characterClothingData.keys())[i] if clothingId == CacheContorl.characterData['character'][ characterId].PutOn[clothingType]: passId = i - nowPageStartId clothingData = characterClothingData[clothingId] clothingText = clothingData['Evaluation'] + clothingData[ 'Tag'] + clothingData['Name'] clothingTextData[clothingText] = {} for tag in Clothing.clothingTagTextList: tagText = Clothing.clothingTagTextList[tag] + str( clothingData[tag]) clothingTextData[clothingText][tagText] = 0 nowTagTextIndex = TextHandle.getTextIndex(tagText) if nowTagTextIndex == nowTagTextIndex: tagTextIndex = nowTagTextIndex longClothingTextIndex = TextHandle.getTextIndex( max(clothingTextData.keys(), key=TextHandle.getTextIndex)) i = 0 inputS = [] for clothingText in clothingTextData: drawText = '' EraPrint.plittleline() nowClothingTextIndex = TextHandle.getTextIndex(clothingText) drawText += clothingText + ' ' if nowClothingTextIndex < longClothingTextIndex: drawText += ' ' * (longClothingTextIndex - nowClothingTextIndex) for tagText in clothingTextData[clothingText]: nowTagTextIndex = TextHandle.getTextIndex(tagText) if nowTagTextIndex < tagTextIndex: drawText += ' ' + tagText + ' ' * (tagTextIndex - nowTagTextIndex) else: drawText += ' ' + tagText if i == passId: drawText += ' ' + TextLoading.getTextData( TextLoading.stageWordPath, '125') idInfo = CmdButtonQueue.idIndex(i) cmdText = idInfo + drawText inputS.append(f'{i}') PyCmd.pcmd(cmdText, i, None) i += 1 EraPrint.p('\n') pageText = '(' + str(nowPageId) + '/' + str(maxPage) + ')' EraPrint.printPageLine(sample='-', string=pageText) EraPrint.p('\n') return inputS
def seeCharacterWearClothes(characterId: str, changeButton: bool): ''' 查看角色穿戴服装列表面板 Keyword arguments: characterId -- 角色id changeButton -- 将服装列表绘制成按钮的开关 ''' characterClothingData = CacheContorl.characterData['character'][ characterId].Clothing characterPutOnList = CacheContorl.characterData['character'][ characterId].PutOn clothingTextData = {} tagTextIndex = 0 for i in range(len(Clothing.clothingTypeTextList.keys())): clothingType = list(Clothing.clothingTypeTextList.keys())[i] clothingId = characterPutOnList[clothingType] if clothingId == '': clothingTextData[clothingType] = 'None' else: clothingData = characterClothingData[clothingType][clothingId] clothingText = Clothing.clothingTypeTextList[ clothingType] + ':' + clothingData[ 'Evaluation'] + clothingData['Tag'] + clothingData['Name'] clothingTextData[clothingText] = {} for tag in Clothing.clothingTagTextList: tagText = Clothing.clothingTagTextList[tag] + str( clothingData[tag]) clothingTextData[clothingText][tagText] = 0 nowTagTextIndex = TextHandle.getTextIndex(tagText) if nowTagTextIndex > tagTextIndex: tagTextIndex = nowTagTextIndex longClothingTextIndex = TextHandle.getTextIndex( max(clothingTextData.keys(), key=TextHandle.getTextIndex)) i = 0 inputS = [] for clothingText in clothingTextData: drawText = '' EraPrint.plittleline() if clothingTextData[clothingText] == 'None': drawText = Clothing.clothingTypeTextList[ clothingText] + ':' + TextLoading.getTextData( TextLoading.stageWordPath, '117') else: nowClothingTextIndex = TextHandle.getTextIndex(clothingText) drawText += clothingText + ' ' if nowClothingTextIndex < longClothingTextIndex: drawText += ' ' * (longClothingTextIndex - nowClothingTextIndex) for tagText in clothingTextData[clothingText]: nowTagTextIndex = TextHandle.getTextIndex(tagText) if nowTagTextIndex < tagTextIndex: drawText += ' ' + tagText + ' ' * (tagTextIndex - nowTagTextIndex) else: drawText += ' ' + tagText if changeButton: idInfo = CmdButtonQueue.idIndex(i) cmdText = idInfo + drawText PyCmd.pcmd(cmdText, i, None) else: EraPrint.p(drawText) inputS.append(f'{i}') i += 1 EraPrint.p('\n') return inputS
def askForSeeCharacterListPanel(startId): yrn = CmdButtonQueue.optionint(CmdButtonQueue.seecharacterlist, 3, 'left', askfor=False, cmdSize='center', startId=startId) return yrn
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
def detailedSetting8Panel(): EraPrint.p('\n') EraPrint.pline() EraPrint.pl(TextLoading.getTextData(TextLoading.messagePath, '29')) yrn = CmdButtonQueue.optionint(CmdButtonQueue.detailedsetting8) return yrn
def inputAttrOverPanel(): ''' 创建角色完成时确认角色属性输入处理面板 ''' yrn = CmdButtonQueue.optionint(CmdButtonQueue.acknowledgmentAttribute, askfor=False) return yrn
def seeCharacterWearClothesCmd(): EraPrint.pline() yrn = CmdButtonQueue.optionint(CmdButtonQueue.seecharacterwearclothes, idSize='center', askfor=False) return yrn
def inputSexChoicePanel(): EraPrint.pline() EraPrint.pl(TextLoading.getTextData(TextLoading.messagePath, '7')) yrn = CmdButtonQueue.optionint(CmdButtonQueue.sexmenu, 1) EraPrint.p('\n') return yrn
def inSceneButtonPanel(): inputs = CmdButtonQueue.optionint(cmdList=CmdButtonQueue.inscenelist1, cmdColumn=9, askfor=False, cmdSize='center') EraPrint.plittleline() return inputs
def inputAttrOverPanel(): yrn = CmdButtonQueue.optionint(CmdButtonQueue.acknowledgmentAttribute, 1, askfor=False) return yrn
def askForSeeAttr(): yrn = CmdButtonQueue.optionint(CmdButtonQueue.seeattronrverytime, 3, cmdSize='center', askfor=False) return yrn