def showSceneNameListPanel() -> str: ''' 地图下场景名称绘制面板 ''' titleText = TextLoading.getTextData(TextLoading.stageWordPath, '86') EraPrint.p(titleText) panelState = CacheContorl.panelState['SeeSceneNameListPanel'] if panelState == '0': PyCmd.pcmd(panelStateOffText, "SeeSceneNameListPanel") EraPrint.p('\n') nowMap = CacheContorl.nowMap nowPosition = CacheContorl.characterData['character']['0']['Position'] nowScene = MapHandle.getSceneIdInMapForScenePathOnMapPath( nowPosition, nowMap) nowMapMapSystemStr = MapHandle.getMapSystemPathStrForList(nowMap) sceneNameData = MapHandle.getSceneNameListForMapPath( nowMapMapSystemStr) sceneNameList = {} nullScene = nowScene for scene in sceneNameData: sceneNameList[scene] = scene + ':' + sceneNameData[scene] CmdButtonQueue.optionstr(None, 4, 'center', False, False, list(sceneNameList.values()), nullScene, list(sceneNameList.keys())) else: PyCmd.pcmd(panelStateOnText, 'SeeSceneNameListPanel') EraPrint.p('\n') EraPrint.plittleline() return 'SeeSceneNameListPanel'
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())
def detailedSetting2Panel(): EraPrint.p('\n') EraPrint.pline() EraPrint.pl(TextLoading.getTextData(TextLoading.messagePath, '11')) yrn = CmdButtonQueue.optionstr(CmdButtonQueue.detailedsetting2, 5, 'center', True) return yrn
def seeMovePathPanel(): 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 = ValueHandle.dictKeysToList(scenePath) try: scenePathList.remove(mapSceneId) except ValueError: pass if len(scenePathList) > 0: sceneCmd = [] for scene in scenePathList: loadSceneData = MapHandle.getSceneDataForMap(nowMap, 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 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 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 seeCharacter(characterId: str, judge: bool) -> list: ''' 用于任何时候查看角色性格信息面板 Keyword arguments: characterId -- 角色Id judge -- 绘制按钮校验 Return arguments: list -- 按钮列表 ''' natureTextData = TextLoading.getGameData(TextLoading.naturePath) characterNature = CacheContorl.characterData['character'][ characterId].Nature cmdList = [] for nature in natureTextData: natureText = natureTextData[nature]['Name'] if 'Good' in natureText: nowNatureValues = [ characterNature[sonNature] for sonNature in natureTextData[nature]['Factor'] ] nowNatureValue = sum(nowNatureValues) nowNatureMax = len(nowNatureValues) * 100 if nowNatureValue < nowNatureMax / 2: natureText = natureText['Bad'] else: natureText = natureText['Good'] EraPrint.sontitleprint(natureText) infoList = [ natureTextData[nature]['Factor'][sonNature][judgeNatureGood( characterNature[sonNature])] for sonNature in natureTextData[nature]['Factor'] ] if judge: nowSonList = [son for son in natureTextData[nature]['Factor']] cmdList += nowSonList CmdButtonQueue.optionstr(None, len(nowSonList), 'center', False, False, infoList, '', nowSonList) else: EraPrint.plist(infoList, len(infoList), 'center') return cmdList
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 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 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}