def changeSceneCharacterListPanel(): nameListMax = int(GameConfig.in_scene_see_player_max) nowPage = int(CacheContorl.panelState['SeeSceneCharacterListPanel']) characterMax = CharacterHandle.getCharacterIndexMax() pageMax = math.floor(characterMax / nameListMax) pageText = '(' + str(nowPage) + '/' + str(pageMax) + ')' EraPrint.printPageLine(sample = '-',string = pageText)
def seeCharacterWearClothesCmd(startId:int) -> str: ''' 用于控制查看角色服装列表面板的命令菜单 ''' EraPrint.pline() yrn = CmdButtonQueue.optionint(CmdButtonQueue.seecharacterwearclothes,cmdSize='center',askfor=False,startId=startId) return yrn
def inputName_func(): ''' 请求玩家输入姓名流程 输入0:进入请求玩家输入昵称流程(玩家姓名为默认或输入姓名流程结果) 输入1:进入输入姓名流程 输入2:返回标题菜单 ''' GameTime.initTime() CacheContorl.characterData['characterId'] = 0 CacheContorl.characterData['character'][0] = Character.Character() flowReturn = 0 while 1: flowReturn = CreatorCharacterPanel.inputNamePanel() if flowReturn == 0: PyCmd.clr_cmd() break elif flowReturn == 1: PyCmd.clr_cmd() CreatorCharacterPanel.startInputNamePanel() PyCmd.clr_cmd() else: break if flowReturn == 0: inputNickName_func() else: EraPrint.pnextscreen() CacheContorl.nowFlowId = 'title_frame'
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 seeCharacterListPanel(maxPage): titleText = TextLoading.getTextData(TextLoading.stageWordPath,'74') EraPrint.plt(titleText) inputS = [] pageId = int(CacheContorl.panelState['SeeCharacterListPanel']) pageShow = int(GameConfig.characterlist_show) maxPage = int(maxPage) 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 acknowledgmentAttributeAns(inputList): characterId = CacheContorl.characterData['characterId'] yrn = GameInit.askfor_All(inputList) showAttrHandleData = TextLoading.getTextData(TextLoading.cmdPath, 'seeAttrPanelHandle') PyCmd.clr_cmd() if yrn in panelList: PanelStateHandle.panelStateChange(yrn) acknowledgmentAttribute_func() elif yrn == '0': GameTime.initTime() AttrCalculation.setAttrOver(characterId) CharacterHandle.initCharacterList() SeeCharacterAttrPanel.initShowAttrPanelList() characterPosition = CacheContorl.characterData['character'][ characterId]['Position'] MapHandle.characterMoveScene(['0'], characterPosition, characterId) from script.Flow import Main Main.mainFrame_func() elif yrn == '1': CacheContorl.wframeMouse['wFrameRePrint'] = 1 EraPrint.pnextscreen() SeeCharacterAttrPanel.initShowAttrPanelList() from script.Design import StartFlow StartFlow.main_func() elif yrn in showAttrHandleData: index = showAttrHandleData.index(yrn) index = str(index) CacheContorl.panelState['AttrShowHandlePanel'] = index acknowledgmentAttribute_func()
def inputSexChoice_func(): ''' 玩家选择性别流程 输入0-3:选择对应性别(Man/Woman/Futa/Asexual) 输入4:随机选择一个性别 输入5:返回请求输入性别流程 ''' sex = list(TextLoading.getTextData(TextLoading.rolePath, 'Sex').keys()) sexMax = len(sex) flowReturn = CreatorCharacterPanel.inputSexChoicePanel() if flowReturn in range(0,sexMax): sexAtr = sex[flowReturn] CacheContorl.characterData['character'][0].Sex = sexAtr PyCmd.clr_cmd() inputSexConfirm_func() elif flowReturn == 4: rand = random.randint(0, len(sex) - 1) sexAtr = sex[rand] CacheContorl.characterData.characterData['character'][0].Sex = sexAtr PyCmd.clr_cmd() inputSexConfirm_func() elif flowReturn == 5: EraPrint.p('\n') PyCmd.clr_cmd() inputSexConfirm_func()
def askForSeeAttrCmd() -> list: ''' 查看属性页显示控制 ''' EraPrint.pline('~') yrn = CmdButtonQueue.optionint(CmdButtonQueue.seeattronrverytime, 3, cmdSize='center', askfor=False) return yrn
def acknowledgmentAttribute_func(): ''' 创建角色时用于查看角色属性的流程 ''' while (True): characterId = CacheContorl.characterData['characterId'] CharacterHandle.initCharacterList() inputS = [] seeAttrInEveryTime_func() flowReturn = SeeCharacterAttrPanel.inputAttrOverPanel() inputS = flowReturn + inputS characterId = CacheContorl.characterData['characterId'] yrn = GameInit.askfor_All(inputS) showAttrHandleData = TextLoading.getTextData(TextLoading.cmdPath, 'seeAttrPanelHandle') PyCmd.clr_cmd() if yrn in panelList: PanelStateHandle.panelStateChange(yrn) elif yrn == '0': GameStartFlow.initGameStart() break elif yrn == '1': CacheContorl.wframeMouse['wFrameRePrint'] = 1 EraPrint.pnextscreen() CacheContorl.nowFlowId = 'title_frame' break elif yrn in showAttrHandleData: CacheContorl.panelState['AttrShowHandlePanel'] = str( showAttrHandleData.index(yrn))
def seeMapPanel(): inputS = [] titleText = TextLoading.getTextData(TextLoading.stageWordPath, '78') EraPrint.plt(titleText) nowMap = CacheContorl.nowMap inputS = inputS + MapHandle.printMap(nowMap) return inputS
def seeCharacterWearClothesCmd() -> str: ''' 用于控制查看角色已装备服装列表面板的命令菜单 ''' EraPrint.pline() yrn = CmdButtonQueue.optionint(CmdButtonQueue.seecharacterwearclothes,idSize='center',askfor=False) return yrn
def seeInstructHeadPanel() -> list: ''' 绘制指令面板的头部过滤器面板 Return arguments: list -- 绘制的按钮列表 ''' EraPrint.plt(TextLoading.getTextData(TextLoading.stageWordPath, '146')) instructData = TextLoading.getTextData(TextLoading.cmdPath, CmdButtonQueue.instructheadpanel) if CacheContorl.instructFilter == {}: CacheContorl.instructFilter = { instruct: 0 for instruct in instructData } CacheContorl.instructFilter['Dialogue'] = 1 styleData = { instructData[instruct]: "selectmenu" for instruct in instructData if CacheContorl.instructFilter[instruct] == 0 } onStyleData = { instructData[instruct]: "onselectmenu" for instruct in instructData if CacheContorl.instructFilter[instruct] == 0 } EraPrint.p(TextLoading.getTextData(TextLoading.stageWordPath, '147')) return CmdButtonQueue.optionstr(None, len(instructData), 'center', False, False, list(instructData.values()), '', list(instructData.keys()), styleData, onStyleData)
def seeAttrInEveryTime_func(): characterId = CacheContorl.characterData['characterId'] showAttrHandle = CacheContorl.panelState['AttrShowHandlePanel'] inputS = [] characterMainAttrPanelAsk = SeeCharacterAttrPanel.seeCharacterMainAttrPanel( characterId) inputS.append(characterMainAttrPanelAsk) if showAttrHandle == '0': characterEquipmentPanelAsk = SeeCharacterAttrPanel.seeCharacterEquipmentPanel( characterId) inputS.append(characterEquipmentPanelAsk) characterItemPanelAsk = SeeCharacterAttrPanel.seeCharacterItemPanel( characterId) inputS.append(characterItemPanelAsk) elif showAttrHandle == '1': characterExperiencePanelAsk = SeeCharacterAttrPanel.seeCharacterExperiencePanel( characterId) inputS.append(characterExperiencePanelAsk) characterLevelPanelAsk = SeeCharacterAttrPanel.seeCharacterLevelPanel( characterId) inputS.append(characterLevelPanelAsk) elif showAttrHandle == '2': characterFeaturesPanelAsk = SeeCharacterAttrPanel.seeCharacterFeaturesPanel( characterId) inputS.append(characterFeaturesPanelAsk) characterEngravingPanelAsk = SeeCharacterAttrPanel.seeCharacterEngravingPanel( characterId) inputS.append(characterEngravingPanelAsk) EraPrint.pline() seeAttrPanelHandleAsk = SeeCharacterAttrPanel.seeAttrShowHandlePanel() inputS = ValueHandle.listAppendToList(seeAttrPanelHandleAsk, inputS) return inputS
def attributeGenerationBranchPanel(): characterId = CacheContorl.characterData['characterId'] AttrCalculation.setAttrDefault(characterId) PyCmd.clr_cmd() EraPrint.pline() EraPrint.pl(TextLoading.getTextData(TextLoading.messagePath, '9')) yrn = CmdButtonQueue.optionint(CmdButtonQueue.currencymenu, 1) return yrn
def enterCharacterNatureEnd() -> list: ''' 用户确认角色性格的尾部面板 Return arguments: list -- 按钮列表 ''' EraPrint.pline() return CmdButtonQueue.optionint(CmdButtonQueue.entercharacternaturepanel,1,'left',True,False)
def seeCharacterWearItemPanel(characterId:int): ''' 查看角色穿戴道具面板 Keyword arguments: characterId -- 角色Id ''' EraPrint.plt(TextLoading.getTextData(TextLoading.stageWordPath, '40')) EraPrint.pl(AttrText.getSeeAttrPanelHeadCharacterInfo(characterId)) WearItemPanel.seeCharacterWearItemPanel(characterId,False)
def seeCharacterNaturePanel(characterId:int): ''' 查看角色性格面板 Keyword arguments: characterId -- 角色Id ''' EraPrint.plt(TextLoading.getTextData(TextLoading.stageWordPath,'139')) EraPrint.pl(AttrText.getSeeAttrPanelHeadCharacterInfo(characterId)) SeeNaturePanel.seeCharacterNaturePanel(characterId)
def seeCharacterSocialContactPanel(characterId:int): ''' 查看角色社交面板 Keyword arguments: characterId -- 角色Id ''' EraPrint.plt(TextLoading.getTextData(TextLoading.stageWordPath,'145')) EraPrint.pl(AttrText.getSeeAttrPanelHeadCharacterInfo(characterId)) SeeSocialContactPanel.seeCharacterSocialContactPanel(characterId)
def main_func(): ans = MainPanel.gameMainPanel() if ans == 0: EraPrint.p('\n') newgame_func() elif ans == 1: loadgame_func() elif ans == 2: quitgame_func()
def attributeGenerationBranchPanel() -> str: ''' 玩家确认进行详细设置面板 ''' PyCmd.clr_cmd() EraPrint.pline() EraPrint.pl(TextLoading.getTextData(TextLoading.messagePath, '9')) yrn = CmdButtonQueue.optionint(CmdButtonQueue.currencymenu) return yrn
def seeCharacterEquipmentPanel(characterId:int): ''' 查看角色装备面板 Keyword arguments: characterId -- 角色Id ''' EraPrint.plt(TextLoading.getTextData(TextLoading.stageWordPath, '37')) EraPrint.p(AttrText.getSeeAttrPanelHeadCharacterInfo(characterId)) ChangeClothesPanel.seeCharacterWearClothes(characterId,False)
def seeCharacterStatusHeadPanel(characterId:str) -> str: ''' 查看角色状态面板头部面板 Keyword arguments: characterId -- 角色Id ''' EraPrint.plt(TextLoading.getTextData(TextLoading.stageWordPath, '135')) EraPrint.pl(AttrText.getSeeAttrPanelHeadCharacterInfo(characterId)) seeCharacterStatusPanel(characterId)
def seeCharacterWearClothes(characterId:str): ''' 查看角色已穿戴服装列表面板 Keyword arguments: characterId -- 角色id ''' sceneInfo = TextLoading.getTextData(TextLoading.stageWordPath,'79') EraPrint.plt(sceneInfo) characterInfo = AttrText.getCharacterAbbreviationsInfo(characterId) EraPrint.p(characterInfo)
def seeSceneCharacterListPanel(): inputS = [] seeCharacterText = TextLoading.getTextData(TextLoading.messagePath,'26') EraPrint.p(seeCharacterText) EraPrint.p('\n') scenePath = CacheContorl.characterData['character']['0']['Position'] nameList = MapHandle.getSceneCharacterNameList(scenePath,True) nameList = getNowPageNameList(nameList) inputS = CmdButtonQueue.optionstr('',cmdColumn=10,cmdSize='center',askfor=False,cmdListData=nameList) return inputS
def ownCharcterMove(targetScene): moveNow = characterMove('0', targetScene) if moveNow == 'Null': nullMessage = TextLoading.getTextData(TextLoading.messagePath, '30') EraPrint.p(nullMessage) Update.gameUpdateFlow() InScene.getInScene_func() elif moveNow == 'End': Update.gameUpdateFlow() InScene.getInScene_func() else: ownCharcterMove(targetScene)
def seeMapPanel() -> list: ''' 地图绘制面板 ''' inputS = [] titleText = TextLoading.getTextData(TextLoading.stageWordPath, '78') nowMap = CacheContorl.nowMap nowMapMapSystemStr = MapHandle.getMapSystemPathStrForList(nowMap) mapName = CacheContorl.mapData[nowMapMapSystemStr]['MapName'] EraPrint.plt(titleText + ': ' + mapName + ' ') inputS = inputS + MapHandle.printMap(nowMap) return inputS
def seeCharacterWearItemCmdPanel(startId: int) -> list: ''' 查看角色已穿戴道具列表的控制面板 Keyword arguments: startId -- 命令起始Id ''' EraPrint.pline() yrn = CmdButtonQueue.optionint(CmdButtonQueue.seecharacterwearclothes, cmdSize='center', askfor=False, startId=startId) return yrn
def removeSave(saveId:str): ''' 删除存档id对应存档 Keyword arguments: saveId -- 存档id ''' savePath = getSaveDirPath(saveId) if os.path.isdir(savePath): shutil.rmtree(savePath) else: errorText = TextLoading.getTextData(TextLoading.errorPath,'notSaveError') EraPrint.pl(errorText)
def jumpCharacterListPagePanel() -> str: ''' 角色列表页面跳转控制面板 ''' messageText = TextLoading.getTextData(TextLoading.messagePath, '32') nameListMax = int(GameConfig.in_scene_see_player_max) characterMax = CharacterHandle.getCharacterIndexMax() pageMax = math.floor(characterMax / nameListMax) EraPrint.p('\n' + messageText + '(0-' + str(pageMax) + ')') ans = InputQueue.waitInput(0, pageMax) EraPrint.p(ans) return ans
def askForSeeAttr() -> list: ''' 查看角色属性时输入处理面板 ''' EraPrint.pline() askData = TextLoading.getTextData(TextLoading.cmdPath,CmdButtonQueue.seeattrpanelmenu).copy() nowPanelId = CacheContorl.panelState['AttrShowHandlePanel'] nullCmd = askData[nowPanelId] askList = list(askData.values()) CmdButtonQueue.optionstr(None,5,'center',False,False,askList,nowPanelId,list(askData.keys())) del askData[nowPanelId] return list(askData.keys())