예제 #1
0
def seeScene_func(judge):
    inputS = []
    InScenePanel.seeScenePanel()
    if judge == '0':
        inputS = inputS + InScenePanel.seeSceneCharacterListPanel()
    InScenePanel.changeSceneCharacterListPanel()
    scenePath = CacheContorl.characterData['character']['0']['Position']
    sceneCharacterNameList = MapHandle.getSceneCharacterNameList(scenePath)
    if len(sceneCharacterNameList) == 1:
        CacheContorl.characterData['characterId'] = '0'
    InScenePanel.seeCharacterInfoPanel()
    inSceneCmdList1 = InScenePanel.inSceneButtonPanel()
    inputS = inputS + inSceneCmdList1
    startId1 = len(inSceneCmdList1)
    yrn = GameInit.askfor_All(inputS)
    PyCmd.clr_cmd()
    if yrn in sceneCharacterNameList:
        CacheContorl.characterData[
            'characterId'] = MapHandle.getCharacterIdByCharacterName(
                yrn, scenePath)
        seeScene_func(judge)
    elif yrn == '0':
        from script.Flow import SeeMap
        nowMap = MapHandle.getMapForPath(
            CacheContorl.characterData['character']['0']['Position'])
        CacheContorl.nowMap = nowMap
        SeeMap.seeMapFlow()
    elif yrn == '1':
        SeeCharacterAttr.seeAttrOnEveryTime_func('InScenePanel')
    elif yrn == '2':
        CacheContorl.characterData['characterId'] = '0'
        SeeCharacterAttr.seeAttrOnEveryTime_func('InScenePanel')
예제 #2
0
def enterCharacterNature_func():
    '''
    请求玩家确认性格流程
    '''
    CacheContorl.characterData['character'][0].initAttr()
    while 1:
        PyCmd.clr_cmd()
        CreatorCharacterPanel.enterCharacterNatureHead()
        inputS = SeeNaturePanel.seeCharacterNatureChangePanel(0)
        inputS += CreatorCharacterPanel.enterCharacterNatureEnd()
        yrn = GameInit.askfor_All(inputS)
        if yrn in CacheContorl.characterData['character'][0].Nature:
            if CacheContorl.characterData['character'][0].Nature[yrn] < 50:
                CacheContorl.characterData['character'][0].Nature[
                    yrn] = random.uniform(50, 100)
            else:
                CacheContorl.characterData['character'][0].Nature[
                    yrn] = random.uniform(0, 50)
        elif int(yrn) == 0:
            CacheContorl.characterData['character'][0].initAttr()
            CacheContorl.nowFlowId = 'acknowledgment_attribute'
            break
        elif int(yrn) == 1:
            CacheContorl.characterData['character'][
                0].Nature = Nature.getRandomNature()
예제 #3
0
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()
예제 #4
0
def seeAttrOnEveryTime_func(oldPanel, tooOldFlow=None):
    characterId = CacheContorl.characterData['characterId']
    if oldPanel == 'InScenePanel':
        sceneId = CacheContorl.characterData['character']['0']['Position']
        characterIdList = MapHandle.getSceneCharacterIdList(sceneId)
    else:
        characterIdList = ValueHandle.dictKeysToList(
            CacheContorl.characterData['character'])
    characterIdIndex = characterIdList.index(characterId)
    inputS = []
    seeAttrList = seeAttrInEveryTime_func()
    inputS = inputS + seeAttrList
    askSeeAttr = SeeCharacterAttrPanel.askForSeeAttr()
    inputS = inputS + askSeeAttr
    yrn = GameInit.askfor_All(inputS)
    PyCmd.clr_cmd()
    showAttrHandleData = TextLoading.getTextData(TextLoading.cmdPath,
                                                 'seeAttrPanelHandle')
    characterMax = characterIdList[len(characterIdList) - 1]
    if yrn in showAttrHandleData:
        index = showAttrHandleData.index(yrn)
        index = str(index)
        CacheContorl.panelState['AttrShowHandlePanel'] = index
        seeAttrOnEveryTime_func(oldPanel, tooOldFlow)
    elif yrn in panelList:
        PanelStateHandle.panelStateChange(yrn)
        seeAttrOnEveryTime_func(oldPanel, tooOldFlow)
    elif yrn == '0':
        if characterIdIndex == 0:
            CacheContorl.characterData['characterId'] = characterMax
            seeAttrOnEveryTime_func(oldPanel, tooOldFlow)
        else:
            characterId = characterIdList[characterIdIndex - 1]
            CacheContorl.characterData['characterId'] = characterId
            seeAttrOnEveryTime_func(oldPanel, tooOldFlow)
    elif yrn == '1':
        from script.Flow import Main, SeeCharacterList, InScene
        if oldPanel == 'MainFramePanel':
            SeeCharacterAttrPanel.initShowAttrPanelList()
            CacheContorl.characterData['characterId'] = '0'
            Main.mainFrame_func()
        elif oldPanel == 'SeeCharacterListPanel':
            characterListShow = int(GameConfig.characterlist_show)
            nowPageId = characterIdIndex / characterListShow
            CacheContorl.panelState['SeeCharacterListPanel'] = nowPageId
            SeeCharacterAttrPanel.initShowAttrPanelList()
            SeeCharacterList.seeCharacterList_func(tooOldFlow)
        elif oldPanel == 'InScenePanel':
            SeeCharacterAttrPanel.initShowAttrPanelList()
            CacheContorl.characterData['characterId'] = '0'
            InScene.getInScene_func()
    elif yrn == '2':
        if characterId == characterMax:
            characterId = characterIdList[0]
            CacheContorl.characterData['characterId'] = characterId
            seeAttrOnEveryTime_func(oldPanel, tooOldFlow)
        else:
            characterId = characterIdList[characterIdIndex + 1]
            CacheContorl.characterData['characterId'] = characterId
            seeAttrOnEveryTime_func(oldPanel, tooOldFlow)
예제 #5
0
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))
예제 #6
0
파일: Main.py 프로젝트: watry/dieloli
def askForMainFrame(ansList):
    characterId = CacheContorl.characterData['characterId']
    characterData = AttrHandle.getAttrData(characterId)
    characterName = characterData['Name']
    ans = GameInit.askfor_All(ansList)
    PyCmd.clr_cmd()
    if ans == characterName:
        mainFrameSeeAttrPanel()
    elif ans == '0':
        InScene.getInScene_func()
    elif ans == '1':
        SeeCharacterList.seeCharacterList_func('MainFramePanel')
    elif ans == '2':
        ChangeClothes.changeCharacterClothes(characterId)
    elif ans == '3':
        Shop.shopMainFrame_func()
    elif ans == '4':
        GameSetting.changeGameSetting_func()
    elif ans == '5':
        GameHelp.gameHelp_func()
    elif ans == '6':
        SaveHandleFrame.establishSave_func('MainFramePanel')
    elif ans == '7':
        SaveHandleFrame.loadSave_func('MainFramePanel')
        pass
예제 #7
0
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)
예제 #8
0
def askForLoadSave_func(oldPanel, saveId):
    cmdList = SaveHandleFramePanel.askLoadSavePanel()
    yrn = GameInit.askfor_All(cmdList)
    PyCmd.clr_cmd()
    if yrn == '0':
        confirmationLoadSave_func(oldPanel, saveId)
    elif yrn == '1':
        confirmationRemoveSave_func(saveId, 'LoadSavePanel', oldPanel)
    elif yrn == '2':
        loadSave_func(oldPanel)
예제 #9
0
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)
예제 #10
0
def askForOverlaySave_func(oldPanel, saveId):
    cmdList = SaveHandleFramePanel.askForOverlaySavePanel()
    yrn = GameInit.askfor_All(cmdList)
    yrn = str(yrn)
    PyCmd.clr_cmd()
    if yrn == '0':
        confirmationOverlaySave_func(oldPanel, saveId)
    elif yrn == '1':
        confirmationRemoveSave_func(saveId, 'EstablishSavePanel', oldPanel)
    elif yrn == '2':
        establishSave_func(oldPanel)
예제 #11
0
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)
예제 #12
0
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()
예제 #13
0
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)
예제 #14
0
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
예제 #15
0
def askForLoadSave_func(saveId:str):
    '''
    读档处理询问流程
    玩家输入0:进入读取存档询问流程
    玩家输入1:进入删除存档询问流程
    Keyword arguments:
    saveId -- 存档id
    '''
    cmdList = SaveHandleFramePanel.askLoadSavePanel()
    yrn = GameInit.askfor_All(cmdList)
    PyCmd.clr_cmd()
    if yrn == '0':
        return confirmationLoadSave_func(saveId)
    elif yrn == '1':
        confirmationRemoveSave_func(saveId)
    return False
예제 #16
0
def askForOverlaySave_func(saveId:str):
    '''
    存档处理询问流程
    玩家输入0:进入覆盖存档询问流程
    玩家输入1:进入删除存档询问流程
    Keyword arguments:
    saveId -- 存档id
    '''
    cmdList = SaveHandleFramePanel.askForOverlaySavePanel()
    yrn = GameInit.askfor_All(cmdList)
    yrn = str(yrn)
    PyCmd.clr_cmd()
    if yrn == '0':
        confirmationOverlaySave_func(saveId)
    elif yrn == '1':
        confirmationRemoveSave_func(saveId)
예제 #17
0
def mainFrame_func():
    '''
    游戏主页控制流程
    '''
    inputS = []
    flowReturn = MainFramePanel.mainFramePanel()
    inputS = inputS + flowReturn
    characterId = CacheContorl.characterData['characterId']
    characterData = AttrHandle.getAttrData(characterId)
    characterName = characterData['Name']
    ans = GameInit.askfor_All(inputS)
    PyCmd.clr_cmd()
    CacheContorl.oldFlowId = 'main'
    if ans == characterName:
        CacheContorl.nowFlowId = 'see_character_attr'
    else:
        CacheContorl.nowFlowId = mainFrameGotoData[ans]
예제 #18
0
def seeCharacterList_func(oldPanel):
    maxPage = getCharacterListPageMax()
    inputS = []
    seeCharacterListPanelInput = SeeCharacterListPanel.seeCharacterListPanel(
        maxPage)
    startId = len(seeCharacterListPanelInput)
    inputS = inputS + seeCharacterListPanelInput
    askForSeeCharacterListPanelInput = SeeCharacterListPanel.askForSeeCharacterListPanel(
        startId)
    inputS = inputS + askForSeeCharacterListPanelInput
    yrn = GameInit.askfor_All(inputS)
    yrn = str(yrn)
    characterIdList = CharacterHandle.getCharacterIdList()
    pageId = int(CacheContorl.panelState['SeeCharacterListPanel'])
    if yrn == str(startId):
        if pageId == 0:
            CacheContorl.panelState['SeeCharacterListPanel'] = str(maxPage)
            seeCharacterList_func(oldPanel)
        else:
            pageId = str(pageId - 1)
            CacheContorl.panelState['SeeCharacterListPanel'] = pageId
            seeCharacterList_func(oldPanel)
    elif yrn == str(startId + 1):
        if oldPanel == 'MainFramePanel':
            import script.Flow.Main as mainframe
            CacheContorl.characterData['characterId'] = '0'
            CacheContorl.panelState['SeeCharacterListPanel'] = '0'
            mainframe.mainFrame_func()
        else:
            pass
    elif yrn == str(startId + 2):
        if pageId == maxPage:
            CacheContorl.panelState['SeeCharacterListPanel'] = '0'
            seeCharacterList_func(oldPanel)
        else:
            pageId = str(pageId + 1)
            CacheContorl.panelState['SeeCharacterListPanel'] = pageId
            seeCharacterList_func(oldPanel)
    elif yrn in characterIdList:
        yrn = str(int(yrn) + characterPageShow * pageId)
        CacheContorl.characterData['characterId'] = yrn
        from script.Flow import SeeCharacterAttr
        SeeCharacterAttr.seeAttrOnEveryTime_func('SeeCharacterListPanel',
                                                 oldPanel)
예제 #19
0
def optionstr(cmdList,
              cmdColumn=1,
              cmdSize='left',
              lastLine=False,
              askfor=True,
              cmdListData=None):
    if cmdListData == None:
        cmdListData = TextLoading.getTextData(TextLoading.cmdPath,
                                              cmdList).copy()
    else:
        pass
    inputS = []
    textWidth = GameConfig.text_width
    if lastLine == True:
        if len(cmdListData) - 1 < cmdColumn:
            cmdColumn = len(cmdListData) - 1
    else:
        if len(cmdListData) < cmdColumn:
            cmdColumn = len(cmdListData)
    cmdIndex = int(textWidth / cmdColumn)
    for i in range(0, len(cmdListData)):
        cmdTextBak = Dictionaries.handleText(cmdListData[i])
        cmdText = '[' + cmdTextBak + ']'
        if i == 0:
            cmdSizePrint(cmdText, cmdTextBak, None, cmdIndex, cmdSize)
            inputS.append(cmdListData[i])
        elif i / cmdColumn >= 1 and i % cmdColumn == 0:
            EraPrint.p('\n')
            cmdSizePrint(cmdText, cmdTextBak, None, cmdIndex, cmdSize)
            inputS.append(cmdTextBak)
        elif i == len(cmdListData) - 1 and lastLine == True:
            EraPrint.p('\n')
            cmdSizePrint(cmdText, cmdTextBak, None, cmdIndex, cmdSize)
            inputS.append(cmdTextBak)
        else:
            cmdSizePrint(cmdText, cmdTextBak, None, cmdIndex, cmdSize)
            inputS.append(cmdTextBak)
    EraPrint.p('\n')
    if askfor == True:
        ans = GameInit.askfor_All(inputS)
        return ans
    else:
        return inputS
예제 #20
0
파일: Main.py 프로젝트: homer12/dieloli
def mainFrame_func():
    '''
    游戏主页控制流程
    '''
    inputS = []
    flowReturn = MainFramePanel.mainFramePanel()
    inputS = inputS + flowReturn
    characterId = CacheContorl.characterData['characterId']
    characterData = CacheContorl.characterData['character'][characterId]
    characterName = characterData.Name
    ans = GameInit.askfor_All(inputS)
    PyCmd.clr_cmd()
    CacheContorl.oldFlowId = 'main'
    if ans == characterName:
        CacheContorl.nowFlowId = 'see_character_attr'
    else:
        if ans == '0':
            Clothing.initCharacterClothingPutOn()
        CacheContorl.nowFlowId = mainFrameGotoData[ans]
예제 #21
0
def seeCharacterList_func():
    '''
    用于查看角色列表的流程
    '''
    while (True):
        maxPage = getCharacterListPageMax()
        inputS = []
        seeCharacterListPanelInput = SeeCharacterListPanel.seeCharacterListPanel(
            maxPage)
        startId = len(seeCharacterListPanelInput)
        inputS = inputS + seeCharacterListPanelInput
        askForSeeCharacterListPanelInput = SeeCharacterListPanel.askForSeeCharacterListPanel(
            startId)
        inputS = inputS + askForSeeCharacterListPanelInput
        yrn = GameInit.askfor_All(inputS)
        yrn = str(yrn)
        characterIdList = CacheContorl.characterData['character'].keys()
        pageId = int(CacheContorl.panelState['SeeCharacterListPanel'])
        if yrn == str(startId):
            if pageId == 0:
                CacheContorl.panelState['SeeCharacterListPanel'] = str(maxPage)
            else:
                pageId = str(pageId - 1)
                CacheContorl.panelState['SeeCharacterListPanel'] = pageId
        elif yrn == str(startId + 1):
            CacheContorl.characterData['characterId'] = 0
            CacheContorl.panelState['SeeCharacterListPanel'] = '0'
            CacheContorl.nowFlowId = CacheContorl.oldFlowId
            break
        elif yrn == str(startId + 2):
            if pageId == maxPage:
                CacheContorl.panelState['SeeCharacterListPanel'] = '0'
            else:
                pageId = str(pageId + 1)
                CacheContorl.panelState['SeeCharacterListPanel'] = pageId
        elif int(yrn) + characterPageShow * pageId in characterIdList:
            yrn = int(yrn) + characterPageShow * pageId
            CacheContorl.characterData['characterId'] = yrn
            CacheContorl.nowFlowId = 'see_character_attr'
            CacheContorl.tooOldFlowId = CacheContorl.oldFlowId
            CacheContorl.oldFlowId = 'see_character_list'
            break
예제 #22
0
def seeAttrOnEveryTime_func():
    '''
    通用用于查看角色属性的流程
    '''
    while (True):
        characterId = CacheContorl.characterData['characterId']
        if CacheContorl.oldFlowId == 'in_scene':
            nowScene = CacheContorl.characterData['character'][0].Position
            nowSceneStr = MapHandle.getMapSystemPathStrForList(nowScene)
            characterIdList = MapHandle.getSceneCharacterIdList(nowSceneStr)
        else:
            characterIdList = list(
                CacheContorl.characterData['character'].keys())
        characterIdIndex = characterIdList.index(characterId)
        inputS = []
        seeAttrInEveryTime_func()
        askSeeAttr = SeeCharacterAttrPanel.askForSeeAttr()
        inputS += askSeeAttr
        inputs1 = SeeCharacterAttrPanel.askForSeeAttrCmd()
        inputS += inputs1
        yrn = GameInit.askfor_All(inputS)
        PyCmd.clr_cmd()
        showAttrHandleData = TextLoading.getTextData(TextLoading.cmdPath,
                                                     'seeAttrPanelHandle')
        characterMax = characterIdList[len(characterIdList) - 1]
        if yrn in showAttrHandleData:
            CacheContorl.panelState['AttrShowHandlePanel'] = yrn
        elif yrn == '0':
            if characterIdIndex == 0:
                CacheContorl.characterData['characterId'] = characterMax
            else:
                characterId = characterIdList[characterIdIndex - 1]
                CacheContorl.characterData['characterId'] = characterId
        elif yrn == '1':
            if CacheContorl.oldFlowId == 'main':
                CacheContorl.characterData['characterId'] = 0
            elif CacheContorl.oldFlowId == 'see_character_list':
                characterListShow = int(GameConfig.characterlist_show)
                nowPageId = characterIdIndex / characterListShow
                CacheContorl.panelState['SeeCharacterListPanel'] = nowPageId
            elif CacheContorl.oldFlowId == 'in_scene':
                scenePath = CacheContorl.characterData['character'][0].Position
                scenePathStr = MapHandle.getMapSystemPathStrForList(scenePath)
                nameList = MapHandle.getSceneCharacterNameList(
                    scenePathStr, True)
                nowCharacterName = CacheContorl.characterData['character'][
                    CacheContorl.characterData['characterId']].Name
                try:
                    nowCharacterIndex = nameList.index(nowCharacterName)
                except ValueError:
                    nowCharacterIndex = 0
                nameListMax = int(GameConfig.in_scene_see_player_max)
                nowSceneCharacterListPage = math.floor(nowCharacterIndex /
                                                       nameListMax)
                CacheContorl.panelState[
                    'SeeSceneCharacterListPanel'] = nowSceneCharacterListPage
            CacheContorl.panelState['AttrShowHandlePanel'] = 'MainAttr'
            CacheContorl.nowFlowId = CacheContorl.oldFlowId
            CacheContorl.oldFlowId = CacheContorl.tooOldFlowId
            break
        elif yrn == '2':
            if characterId == characterMax:
                characterId = characterIdList[0]
                CacheContorl.characterData['characterId'] = characterId
            else:
                characterId = characterIdList[characterIdIndex + 1]
                CacheContorl.characterData['characterId'] = characterId
예제 #23
0
def seeScene_func(judge: bool):
    '''
    用于查看当前场景界面的流程
    Keyword argument:
    judge -- 判断是否绘制角色列表界面的开关
    '''
    while (True):
        inputS = []
        InScenePanel.seeScenePanel()
        scenePath = CacheContorl.characterData['character'][0].Position
        scenePathStr = MapHandle.getMapSystemPathStrForList(scenePath)
        sceneCharacterNameList = MapHandle.getSceneCharacterNameList(
            scenePathStr)
        nameListMax = int(GameConfig.in_scene_see_player_max)
        changePageJudge = False
        if len(sceneCharacterNameList) == 1:
            CacheContorl.characterData['characterId'] = 0
        inSceneCmdList1 = []
        if judge:
            if CacheContorl.panelState['SeeSceneCharacterListPage'] == '0':
                inputS = inputS + InScenePanel.seeSceneCharacterListPanel()
                if len(sceneCharacterNameList) > nameListMax:
                    inSceneCmdList1 = InScenePanel.changeSceneCharacterListPanel(
                    )
                    changePageJudge = True
            inputS.append('SeeSceneCharacterListPage')
        startId1 = len(inSceneCmdList1)
        InScenePanel.seeCharacterInfoPanel()
        SeeCharacterAttrPanel.seeCharacterHPAndMPInSence(
            CacheContorl.characterData['characterId'])
        SeeCharacterAttrPanel.seeCharacterStatusPanel(
            CacheContorl.characterData['characterId'])
        instructHead = InstructPanel.seeInstructHeadPanel()
        inSceneCmdList2 = InScenePanel.inSceneButtonPanel(startId1)
        if changePageJudge:
            inputS += inSceneCmdList1 + instructHead + inSceneCmdList2
        else:
            inputS += instructHead + inSceneCmdList2
        yrn = GameInit.askfor_All(inputS)
        PyCmd.clr_cmd()
        nowPage = int(CacheContorl.panelState['SeeSceneCharacterListPanel'])
        characterMax = len(CacheContorl.characterData['character']) - 1
        pageMax = math.floor(characterMax / nameListMax)
        if yrn in sceneCharacterNameList:
            CacheContorl.characterData[
                'characterId'] = MapHandle.getCharacterIdByCharacterName(
                    yrn, scenePathStr)
        elif judge and yrn not in inSceneCmdList2 and yrn != 'SeeSceneCharacterListPage' and changePageJudge:
            if yrn == inSceneCmdList1[0]:
                CacheContorl.panelState['SeeSceneCharacterListPanel'] = 0
            elif yrn == inSceneCmdList1[1]:
                if int(nowPage) == 0:
                    CacheContorl.panelState[
                        'SeeSceneCharacterListPanel'] = pageMax
                else:
                    CacheContorl.panelState[
                        'SeeSceneCharacterListPanel'] = int(nowPage) - 1
            elif yrn == inSceneCmdList1[2]:
                CacheContorl.panelState[
                    'SeeSceneCharacterListPanel'] = InScenePanel.jumpCharacterListPagePanel(
                    )
            elif yrn == inSceneCmdList1[3]:
                if int(nowPage) == pageMax:
                    CacheContorl.panelState['SeeSceneCharacterListPanel'] = 0
                else:
                    CacheContorl.panelState[
                        'SeeSceneCharacterListPanel'] = int(nowPage) + 1
            elif yrn == inSceneCmdList1[4]:
                CacheContorl.panelState['SeeSceneCharacterListPanel'] = pageMax
        elif yrn == inSceneCmdList2[0]:
            CacheContorl.nowFlowId = 'see_map'
            nowMap = MapHandle.getMapForPath(
                CacheContorl.characterData['character'][0].Position)
            CacheContorl.nowMap = nowMap
            break
        elif yrn in [inSceneCmdList2[1], inSceneCmdList2[2]]:
            if yrn == inSceneCmdList2[2]:
                CacheContorl.oldCharacterId = CacheContorl.characterData[
                    'characterId']
                CacheContorl.characterData['characterId'] = 0
            CacheContorl.nowFlowId = 'see_character_attr'
            CacheContorl.oldFlowId = 'in_scene'
            break
        elif yrn == 'SeeSceneCharacterListPage':
            PanelStateHandle.panelStateChange(yrn)
        elif yrn in instructHead:
            if CacheContorl.instructFilter[yrn] == 1:
                CacheContorl.instructFilter[yrn] = 0
            else:
                CacheContorl.instructFilter[yrn] = 1
예제 #24
0
def optionstr(cmdList: str,
              cmdColumn=1,
              cmdSize='left',
              lastLine=False,
              askfor=True,
              cmdListData=None,
              nullCmd='',
              returnData=None) -> list:
    '''
    绘制无id的文本命令列表
    例:
    [长寿的青蛙]
    Keyword arguments:
    cmdList -- 命令列表id,当cmdListData为None时,根据此id调用cmdList内的命令数据
    cmdColumn -- 每行命令列数 (default 1)
    cmdSize -- 命令文本在当前列的对齐方式(left/center/right) (default 'left')
    lastLine -- 最后一个命令换行绘制 (default False)
    cmdListData -- 命令列表数据 (default None)
    nullCmd -- 在列表中按纯文本绘制,并不加入监听列表的命令文本
    returnData -- 命令返回数据 (default None)
    '''
    if cmdListData == None:
        cmdListData = TextLoading.getTextData(TextLoading.cmdPath,
                                              cmdList).copy()
    inputS = []
    textWidth = GameConfig.text_width
    if lastLine == True:
        if len(cmdListData) - 1 < cmdColumn:
            cmdColumn = len(cmdListData) - 1
    else:
        if len(cmdListData) < cmdColumn:
            cmdColumn = len(cmdListData)
    cmdIndex = int(textWidth / cmdColumn)
    nowNullCmd = nullCmd
    for i in range(0, len(cmdListData)):
        nowNullCmd = True
        if returnData == None:
            if nullCmd == cmdListData[i]:
                nowNullCmd = False
            cmdTextBak = Dictionaries.handleText(cmdListData[i])
            cmdText = '[' + cmdTextBak + ']'
        else:
            if nullCmd == returnData[i]:
                nowNullCmd = False
            cmdTextBak = returnData[i]
            cmdText = '[' + cmdListData[i] + ']'
        if i == 0:
            cmdSizePrint(cmdText,
                         cmdTextBak,
                         None,
                         cmdIndex,
                         cmdSize,
                         noNullCmd=nowNullCmd)
            if nowNullCmd:
                inputS.append(cmdListData[i])
        elif i / cmdColumn >= 1 and i % cmdColumn == 0:
            EraPrint.p('\n')
            cmdSizePrint(cmdText,
                         cmdTextBak,
                         None,
                         cmdIndex,
                         cmdSize,
                         noNullCmd=nowNullCmd)
            if nowNullCmd:
                inputS.append(cmdTextBak)
        elif i == len(cmdListData) - 1 and lastLine == True:
            EraPrint.p('\n')
            cmdSizePrint(cmdText,
                         cmdTextBak,
                         None,
                         cmdIndex,
                         cmdSize,
                         noNullCmd=nowNullCmd)
            if nowNullCmd:
                inputS.append(cmdTextBak)
        else:
            cmdSizePrint(cmdText,
                         cmdTextBak,
                         None,
                         cmdIndex,
                         cmdSize,
                         noNullCmd=nowNullCmd)
            if nowNullCmd:
                inputS.append(cmdTextBak)
    EraPrint.p('\n')
    if askfor == True:
        ans = GameInit.askfor_All(inputS)
        return ans
    else:
        return inputS