Пример #1
0
def inputSexConfirm_func():
    '''
    请求玩家输入性别流程
    输入0:进入询问是否进行详细设置流程(玩家性别为默认,或请求选择性别流程结果)
    输入1:进入选择性别流程
    输入2:返回请求输入自称流程
    '''
    flowReturn = CreatorCharacterPanel.inputSexPanel()
    sexId = CacheContorl.characterData['character'][characterId]['Sex']
    if flowReturn == 0:
        AttrCalculation.setSexCache(sexId)
        sexKeysList = list(TextLoading.getTextData(TextLoading.rolePath,
                                                   'Sex'))
        if sexId == sexKeysList[2]:
            CacheContorl.temporaryCharacter['Features'][
                'Sex'] = TextLoading.getTextData(TextLoading.rolePath,
                                                 'Features')['Sex'][0]
        elif sexId == sexKeysList[3]:
            CacheContorl.temporaryCharacter['Features'][
                'Sex'] = TextLoading.getTextData(TextLoading.rolePath,
                                                 'Features')['Sex'][1]
        PyCmd.clr_cmd()
        attributeGenerationBranch_func()
    elif flowReturn == 1:
        PyCmd.clr_cmd()
        inputSexChoice_func()
    elif flowReturn == 2:
        PyCmd.clr_cmd()
        inputSelfName_func()
Пример #2
0
def seeCharacterInfoPanel():
    '''
    查看当前互动对象信息面板
    '''
    characterInfo = TextLoading.getTextData(TextLoading.stageWordPath, '77')
    EraPrint.p(characterInfo)
    characterId = CacheContorl.characterData['characterId']
    characterData = CacheContorl.characterData['character'][characterId]
    characterName = characterData.Name
    EraPrint.p(characterName)
    EraPrint.p(' ')
    sex = characterData.Sex
    sexText = TextLoading.getTextData(TextLoading.stageWordPath,
                                      '2') + AttrText.getSexText(sex)
    EraPrint.p(sexText)
    EraPrint.p(' ')
    intimateInfo = TextLoading.getTextData(TextLoading.stageWordPath, '16')
    gracesInfo = TextLoading.getTextData(TextLoading.stageWordPath, '17')
    characterIntimateText = intimateInfo + f'{characterData.Intimate}'
    characterGracesText = gracesInfo + f'{characterData.Graces}'
    EraPrint.p(characterIntimateText)
    EraPrint.p(' ')
    EraPrint.p(characterGracesText)
    stateText = AttrText.getStateText(characterId)
    EraPrint.p(' ')
    EraPrint.p(stateText)
    EraPrint.plittleline()
Пример #3
0
def seeScenePanel():
    '''
    当前场景信息面板
    '''
    titleText = TextLoading.getTextData(TextLoading.stageWordPath, '75')
    EraPrint.plt(titleText)
    timeText = GameTime.getDateText()
    EraPrint.p(timeText)
    EraPrint.p(' ')
    scenePath = CacheContorl.characterData['character'][0].Position
    scenePathStr = MapHandle.getMapSystemPathStrForList(scenePath)
    mapList = MapHandle.getMapHierarchyListForScenePath(scenePath, [])
    mapPathText = ''
    mapList.reverse()
    for nowMap in mapList:
        nowMapMapSystemStr = MapHandle.getMapSystemPathStrForList(nowMap)
        mapName = CacheContorl.mapData[nowMapMapSystemStr]['MapName']
        mapPathText += mapName + '-'
    sceneData = CacheContorl.sceneData[scenePathStr].copy()
    sceneName = mapPathText + sceneData['SceneName']
    sceneInfoHead = TextLoading.getTextData(TextLoading.stageWordPath, '76')
    sceneInfo = sceneInfoHead + sceneName
    EraPrint.p(sceneInfo)
    panelState = CacheContorl.panelState['SeeSceneCharacterListPage']
    switch = panelStateOnText
    if panelState == '0':
        switch = panelStateOffText
    sceneCharacterList = sceneData['SceneCharacterData']
    if len(sceneCharacterList) > 1:
        EraPrint.p(' ')
        PyCmd.pcmd(switch, 'SeeSceneCharacterListPage')
    EraPrint.plittleline()
Пример #4
0
def p(string:str, style='standard',richTextJudge=True):
    '''
    游戏基础的文本绘制实现
    Keyword arguments:
    string -- 需要绘制的文本
    style -- 文本的默认样式 (default 'standard')
    richTextJudge -- 启用富文本的开关 (default True)
    '''
    if richTextJudge:
        barlist = TextLoading.getTextData(TextLoading.barConfigPath,'barlist')
        styleList = RichText.setRichTextPrint(string, style)
        global last_char
        if len(string) > 0:
            last_char = string[-1:]
        string = RichText.removeRichCache(string)
        string = r'' + string
        for i in range(0,len(string)):
            if styleList[i] in barlist:
                styledata = TextLoading.getTextData(TextLoading.barConfigPath,styleList[i])
                truebar = styledata['truebar']
                nullbar = styledata['nullbar']
                if string[i] == '0':
                    pimage(nullbar, 'bar')
                elif string[i] == '1':
                    pimage(truebar, 'bar')
                else:
                    IoInit.eraPrint(string[i], styleList[i])
            else:
                IoInit.eraPrint(string[i], styleList[i])
    else:
        IoInit.eraPrint(string,style)
Пример #5
0
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}
Пример #6
0
def getTextIndex(text):
    textStyleList = RichText.setRichTextPrint(text, 'standard')
    textIndex = 0
    stylewidth = 0
    barlist = TextLoading.getTextData(TextLoading.barConfigPath,'barlist')
    styleNameList = GameConfig.getFontDataList() + TextLoading.getTextData(TextLoading.barConfigPath,'barlist')
    for i in range(0, len(styleNameList)):
        styleTextHead = '<' + styleNameList[i] + '>'
        styleTextTail = '</' + styleNameList[i] + '>'
        if styleTextHead in text:
            if styleNameList[i] in TextLoading.getTextData(TextLoading.barConfigPath,'barlist'):
                text = text.replace(styleTextHead, '')
                text = text.replace(styleTextTail, '')
            else:
                text = text.replace(styleTextHead, '')
                text = text.replace(styleTextTail, '')
        else:
            pass
    count = len(text)
    for i in range(0,count):
        if textStyleList[i] in barlist:
            textwidth = TextLoading.getTextData(TextLoading.barConfigPath,textStyleList[i])['width']
            textIndex = textIndex + int(textwidth)
        else:
            textIndex = textIndex + get_width(ord(text[i]))
    return textIndex + stylewidth
Пример #7
0
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)
Пример #8
0
def getGoldText(characterId):
    goldData = CacheContorl.characterData['character'][characterId]['Gold']
    goldData = str(goldData)
    moneyText = TextLoading.getTextData(TextLoading.stageWordPath,'66')
    goldText = TextLoading.getTextData(TextLoading.stageWordPath,'67')
    goldText = goldText + goldData + moneyText
    return goldText
Пример #9
0
def mainFramePanel():
    cmdList = []
    characterId = CacheContorl.characterData['characterId']
    characterData = AttrHandle.getAttrData(characterId)
    titleText = TextLoading.getTextData(TextLoading.stageWordPath, '64')
    EraPrint.plt(titleText)
    dateText = GameTime.getDateText()
    EraPrint.p(dateText)
    EraPrint.p(' ')
    weekDateText = GameTime.getWeekDayText()
    EraPrint.p(weekDateText)
    EraPrint.p(' ')
    characterName = characterData['Name']
    PyCmd.pcmd(characterName,characterName,None)
    cmdList.append(characterName)
    EraPrint.p(' ')
    goldText = AttrText.getGoldText(characterId)
    EraPrint.p(goldText)
    EraPrint.p('\n')
    AttrPrint.printHpAndMpBar(characterId)
    mainMenuText = TextLoading.getTextData(TextLoading.stageWordPath,'68')
    EraPrint.sontitleprint(mainMenuText)
    EraPrint.p('\n')
    askForMainMenu = CmdButtonQueue.optionint(CmdButtonQueue.mainmenu, 4, 'left', askfor=False, cmdSize='center')
    cmdList = cmdList + askForMainMenu
    systemMenuText = TextLoading.getTextData(TextLoading.stageWordPath,'69')
    EraPrint.sontitleprint(systemMenuText)
    EraPrint.p('\n')
    systemMenuStartId = len(askForMainMenu)
    askForSystemMenu = CmdButtonQueue.optionint(CmdButtonQueue.systemmenu, 4, 'left', askfor=False, cmdSize='center', startId=systemMenuStartId)
    cmdList = cmdList + askForSystemMenu
    return cmdList
Пример #10
0
def getTextIndex(text: str) -> int:
    '''
    计算文本最终显示的真实长度
    Keyword arguments:
    text -- 要进行长度计算的文本
    '''
    textStyleList = RichText.setRichTextPrint(text, 'standard')
    textIndex = 0
    stylewidth = 0
    barlist = TextLoading.getTextData(TextLoading.barConfigPath, 'barlist')
    styleNameList = GameConfig.getFontDataList() + TextLoading.getTextData(
        TextLoading.barConfigPath, 'barlist')
    for i in range(0, len(styleNameList)):
        styleTextHead = '<' + styleNameList[i] + '>'
        styleTextTail = '</' + styleNameList[i] + '>'
        if styleTextHead in text:
            if styleNameList[i] in TextLoading.getTextData(
                    TextLoading.barConfigPath, 'barlist'):
                text = text.replace(styleTextHead, '')
                text = text.replace(styleTextTail, '')
            else:
                text = text.replace(styleTextHead, '')
                text = text.replace(styleTextTail, '')
    for i in range(len(text)):
        if textStyleList[i] in barlist:
            textwidth = TextLoading.getTextData(TextLoading.barConfigPath,
                                                textStyleList[i])['width']
            textIndex = textIndex + int(textwidth)
        else:
            textIndex += wcswidth(text[i])
    return textIndex + stylewidth
Пример #11
0
def seeScenePanel():
    '''
    当前场景信息面板
    '''
    titleText = TextLoading.getTextData(TextLoading.stageWordPath, '75')
    EraPrint.plt(titleText)
    timeText = GameTime.getDateText()
    EraPrint.p(timeText)
    EraPrint.p(' ')
    scenePath = CacheContorl.characterData['character']['0']['Position']
    scenePathStr = MapHandle.getMapSystemPathStrForList(scenePath)
    sceneData = CacheContorl.sceneData[scenePathStr].copy()
    sceneName = sceneData['SceneName']
    sceneInfoHead = TextLoading.getTextData(TextLoading.stageWordPath, '76')
    sceneInfo = sceneInfoHead + sceneName
    EraPrint.p(sceneInfo)
    panelState = CacheContorl.panelState['SeeSceneCharacterListPage']
    switch = panelStateOnText
    if panelState == '0':
        switch = panelStateOffText
    sceneCharacterList = sceneData['SceneCharacterData']
    if len(sceneCharacterList) > 1:
        EraPrint.p(' ')
        PyCmd.pcmd(switch, 'SeeSceneCharacterListPage')
    EraPrint.plittleline()
Пример #12
0
def seeCharacterEquipmentPanel(characterId: str) -> str:
    '''
    查看角色装备面板
    Keyword arguments:
    characterId -- 角色Id
    '''
    EraPrint.plittleline()
    EraPrint.p(TextLoading.getTextData(TextLoading.stageWordPath, '37'))
    panelState = CacheContorl.panelState['CharacterEquipmentPanel']
    if panelState == "0":
        PyCmd.pcmd(panelStateOffText, 'CharacterEquipmentPanel')
        characterData = AttrHandle.getAttrData(characterId)
        EraPrint.p('\n')
        EraPrint.p(TextLoading.getTextData(TextLoading.stageWordPath, '39'))
        EraPrint.p('\n')
        characterClothingList = characterData['Clothing']
        characterClothingText = AttrText.getClothingText(characterClothingList)
        EraPrint.plist(characterClothingText, 4, 'center')
        EraPrint.p('\n')
        EraPrint.p(TextLoading.getTextData(TextLoading.stageWordPath, '40'))
        EraPrint.p('\n')
        characterSexItemList = characterData['SexItem']
        characterSexItemText = AttrText.getSexItemText(characterSexItemList)
        EraPrint.plist(characterSexItemText, 5, 'center')
    else:
        PyCmd.pcmd(panelStateOnText, 'CharacterEquipmentPanel', None)
        EraPrint.p('\n')
    return 'CharacterEquipmentPanel'
Пример #13
0
def initPhaseCourseHour():
    '''
    初始化各班级课时
    '''
    phaseCourseTime = TextLoading.getTextData(TextLoading.phaseCourse,
                                              'CourseTime')
    primaryWeight = TextLoading.getTextData(TextLoading.phaseCourse,
                                            'PrimarySchool')
    juniorMiddleWeight = TextLoading.getTextData(TextLoading.phaseCourse,
                                                 'JuniorMiddleSchool')
    seniorHighWeight = TextLoading.getTextData(TextLoading.phaseCourse,
                                               'SeniorHighSchool')
    nowWeightList = primaryWeight + juniorMiddleWeight + seniorHighWeight
    allClassHourData = {}
    phaseIndex = 0
    for phase in nowWeightList:
        phaseWeightRegin = ValueHandle.getReginList(phase)
        weightMax = 0
        weightMax = sum(map(int, phaseWeightRegin.keys()))
        classHourData = {}
        classHourMax = 0
        if phaseIndex <= 5:
            classHourMax = phaseCourseTime['PrimarySchool']
        elif phaseIndex <= 8:
            classHourMax = phaseCourseTime['JuniorMiddleSchool']
        else:
            classHourMax = phaseCourseTime['SeniorHighSchool']
        classHourData = {
            phaseWeightRegin[region]:
            math.ceil(classHourMax * (int(region) / weightMax))
            for region in phaseWeightRegin
        }
        nowClassHourMax = sum(classHourData.values())
        while nowClassHourMax != classHourMax:
            for course in classHourData:
                if nowClassHourMax == classHourMax:
                    break
                elif classHourData[
                        course] > 1 and nowClassHourMax > classHourMax:
                    classHourData[course] -= 1
                    nowClassHourMax -= 1
                elif nowClassHourMax < classHourMax:
                    classHourData[course] += 1
                    nowClassHourMax += 1
        while 1:
            moreHour = 0
            for course in classHourData:
                if moreHour > 0 and classHourData[course] < 14:
                    classHourData[course] += 1
                    moreHour -= 1
                elif moreHour > 0 and classHourData[course] > 14:
                    moreHour += (classHourData[course] - 14)
                    classHourData[course] -= (classHourData[course] - 14)
            if moreHour == 0:
                break
        allClassHourData[phaseIndex] = classHourData
        phaseIndex += 1
    CacheContorl.courseData['ClassHour'] = allClassHourData
    initPhaseCourseHourExperience()
Пример #14
0
def askLoadSavePanel():
    EraPrint.p('\n')
    cmdList = TextLoading.getTextData(TextLoading.cmdPath, "loadSaveAsk")
    messageText = TextLoading.getTextData(TextLoading.messagePath, '23')
    EraPrint.pline()
    EraPrint.p(messageText)
    EraPrint.p('\n')
    yrn = CmdButtonQueue.optionint(None, 1, askfor=False, cmdListData=cmdList)
    return yrn
Пример #15
0
def gameHelpPanel():
    PyCmd.clr_cmd()
    titleInfo = TextLoading.getTextData(TextLoading.stageWordPath, '85')
    EraPrint.plt(titleInfo)
    EraPrint.p(TextLoading.getTextData(TextLoading.messagePath, '31'))
    EraPrint.p('\n')
    inputs = CmdButtonQueue.optionint(CmdButtonQueue.gamehelp, askfor=False)
    EraPrint.plittleline()
    return inputs
Пример #16
0
def confirmationRemoveSavePanel():
    EraPrint.p('\n')
    cmdList = TextLoading.getTextData(TextLoading.cmdPath,
                                      "confirmationRemoveSave")
    messageText = TextLoading.getTextData(TextLoading.messagePath, '25')
    EraPrint.pline()
    EraPrint.p(messageText)
    EraPrint.p('\n')
    yrn = CmdButtonQueue.optionint(None, 1, askfor=False, cmdListData=cmdList)
    return yrn
Пример #17
0
def getStateText(characterId: str) -> str:
    '''
    按角色Id获取状态描述信息
    Keyword arguments:
    characterId -- 角色Id
    '''
    state = CacheContorl.characterData['character'][characterId].State
    stateText = TextLoading.getTextData(TextLoading.stageWordPath,
                                        '132')[state]
    return TextLoading.getTextData(TextLoading.stageWordPath,
                                   '133') + stateText
Пример #18
0
def getGoldText(characterId: str) -> str:
    '''
    获取指定角色的金钱信息描述文本
    Keyword arguments:
    characterId -- 角色id
    '''
    goldData = CacheContorl.characterData['character'][characterId]['Gold']
    goldData = str(goldData)
    moneyText = TextLoading.getTextData(TextLoading.stageWordPath, '66')
    goldText = TextLoading.getTextData(TextLoading.stageWordPath, '67')
    goldText = goldText + goldData + moneyText
    return goldText
Пример #19
0
def askForOverlaySavePanel() -> list:
    '''
    询问覆盖存档面板
    '''
    EraPrint.p('\n')
    cmdList = TextLoading.getTextData(TextLoading.cmdPath, "overlaySave")
    messageText = TextLoading.getTextData(TextLoading.messagePath, '21')
    EraPrint.pline()
    EraPrint.p(messageText)
    EraPrint.p('\n')
    yrn = CmdButtonQueue.optionint(None, askfor=False, cmdListData=cmdList)
    return yrn
Пример #20
0
def getSexItemText(sexItemList: dict) -> list:
    '''
    获取性道具描述文本
    Keyword arguments:
    sexItemList -- 性道具数据
    '''
    headid = sexItemList["Head"]
    eyeid = sexItemList["Eye"]
    earid = sexItemList["Ear"]
    mouthid = sexItemList["Mouth"]
    finesseid = sexItemList["Finesse"]
    fingerid = sexItemList["Finger"]
    chestid = sexItemList["Chest"]
    privatesid = sexItemList["Privates"]
    anusid = sexItemList["Anus"]
    otherid = sexItemList["Other"]
    sexItemData = equipmentData["SexItem"]
    headText = sexItemData["Head"][headid]
    eyeText = sexItemData["Eye"][eyeid]
    earText = sexItemData["Ear"][earid]
    mouthText = sexItemData["Mouth"][mouthid]
    finesseText = sexItemData["Finesse"][finesseid]
    fingerText = sexItemData["Finger"][fingerid]
    chestText = sexItemData["Chest"][chestid]
    privatesText = sexItemData["Privates"][privatesid]
    anusText = sexItemData["Anus"][anusid]
    otherText = sexItemData["Other"][otherid]
    headText = TextLoading.getTextData(TextLoading.stageWordPath,
                                       "49") + headText
    eyeText = TextLoading.getTextData(TextLoading.stageWordPath,
                                      "50") + eyeText
    earText = TextLoading.getTextData(TextLoading.stageWordPath,
                                      "51") + earText
    mouthText = TextLoading.getTextData(TextLoading.stageWordPath,
                                        "52") + mouthText
    finesseText = TextLoading.getTextData(TextLoading.stageWordPath,
                                          "53") + finesseText
    fingerText = TextLoading.getTextData(TextLoading.stageWordPath,
                                         "54") + fingerText
    chestText = TextLoading.getTextData(TextLoading.stageWordPath,
                                        "55") + chestText
    privatesText = TextLoading.getTextData(TextLoading.stageWordPath,
                                           "56") + privatesText
    anusText = TextLoading.getTextData(TextLoading.stageWordPath,
                                       "57") + anusText
    otherText = TextLoading.getTextData(TextLoading.stageWordPath,
                                        "58") + otherText
    sexItemTextList = [
        headText, eyeText, earText, mouthText, finesseText, fingerText,
        chestText, privatesText, anusText, otherText
    ]
    return sexItemTextList
Пример #21
0
def confirmationLoadSavePanel() -> list:
    '''
    确认读取存档面板
    '''
    EraPrint.p('\n')
    cmdList = TextLoading.getTextData(TextLoading.cmdPath,
                                      "confirmationLoadSave")
    messageText = TextLoading.getTextData(TextLoading.messagePath, '24')
    EraPrint.pline()
    EraPrint.p(messageText)
    EraPrint.p('\n')
    yrn = CmdButtonQueue.optionint(None, askfor=False, cmdListData=cmdList)
    return yrn
Пример #22
0
def getClothingText(clothingList):
    coatid = int(clothingList["Coat"])
    pantsid = int(clothingList["Pants"])
    shoesid = int(clothingList["Shoes"])
    socksid = int(clothingList["Socks"])
    underwearid = int(clothingList["Underwear"])
    braid = int(clothingList["Bra"])
    underpantsid = int(clothingList["Underpants"])
    leggingsid = int(clothingList["Leggings"])
    clothingData = equipmentData["Clothing"]
    coatText = clothingData["Coat"][coatid]
    pantsText = clothingData["Pants"][pantsid]
    shoesText = clothingData["Shoes"][shoesid]
    socksText = clothingData["Socks"][socksid]
    underwearText = clothingData["Underwear"][underwearid]
    braText = clothingData["Bra"][braid]
    underpantsText = clothingData["Underpants"][underpantsid]
    leggingsText = clothingData["Leggings"][leggingsid]
    coatText = TextLoading.getTextData(TextLoading.stageWordPath,"41") + coatText
    pantsText = TextLoading.getTextData(TextLoading.stageWordPath, "42") + pantsText
    shoesText = TextLoading.getTextData(TextLoading.stageWordPath, "43") + shoesText
    socksText = TextLoading.getTextData(TextLoading.stageWordPath, "44") + socksText
    underwearText = TextLoading.getTextData(TextLoading.stageWordPath, "45") + underwearText
    braText = TextLoading.getTextData(TextLoading.stageWordPath, "46") + braText
    underpantsText = TextLoading.getTextData(TextLoading.stageWordPath, "47") + underpantsText
    leggingsText = TextLoading.getTextData(TextLoading.stageWordPath, "48") + leggingsText
    clothingTextList = [
        coatText,pantsText,shoesText,socksText,underwearText,
        braText,underpantsText,leggingsText
    ]
    return clothingTextList
Пример #23
0
def startInputNamePanel():
    '''
    玩家姓名输入处理面板
    '''
    EraPrint.pline()
    EraPrint.pl(TextLoading.getTextData(TextLoading.messagePath, '3'))
    while 1:
        characterName = GameInit.askfor_str()
        EraPrint.pl(characterName)
        if TextHandle.getTextIndex(characterName) > 10:
            EraPrint.pl(TextLoading.getTextData(TextLoading.errorPath, 'inputNameTooLongError'))
        else:
            CacheContorl.characterData['character'][0].Name = characterName
            break
Пример #24
0
def seeScenePanel():
    titleText = TextLoading.getTextData(TextLoading.stageWordPath,'75')
    EraPrint.plt(titleText)
    timeText = GameTime.getDateText()
    EraPrint.p(timeText)
    EraPrint.p(' ')
    scenePath = CacheContorl.characterData['character']['0']['Position']
    scenePathStr = MapHandle.getMapSystemPathStrForList(scenePath)
    sceneData = CacheContorl.sceneData[scenePathStr].copy()
    sceneName = sceneData['SceneName']
    sceneInfoHead = TextLoading.getTextData(TextLoading.stageWordPath, '76')
    sceneInfo = sceneInfoHead + sceneName
    EraPrint.p(sceneInfo)
    EraPrint.plittleline()
Пример #25
0
def getHpAndMpText(characterId):
    characterId = str(characterId)
    characterData = CacheContorl.characterData['character'][characterId]
    characterHitPoint = characterData['HitPoint']
    characterMaxHitPoint = characterData['HitPointMax']
    hitPointText = TextLoading.getTextData(TextLoading.stageWordPath, '8')
    hpText = hitPointText + '(' + str(characterHitPoint) + '/' + str(
        characterMaxHitPoint) + ')'
    characterManaPoint = characterData['ManaPoint']
    characterMaxManaPoint = characterData['ManaPointMax']
    manaPointText = TextLoading.getTextData(TextLoading.stageWordPath, '9')
    mpText = manaPointText + '(' + str(characterManaPoint) + '/' + str(
        characterMaxManaPoint) + ')'
    return hpText + ' ' + mpText
Пример #26
0
def startInputNamePanel():
    EraPrint.pline()
    EraPrint.pl(TextLoading.getTextData(TextLoading.messagePath, '3'))
    inputState = 0
    while inputState == 0:
        characterName = GameInit.askfor_str()
        EraPrint.pl(characterName)
        if TextHandle.getTextIndex(characterName) > 10:
            EraPrint.pl(
                TextLoading.getTextData(TextLoading.errorPath,
                                        'inputNameTooLongError'))
        else:
            inputState = 1
            CacheContorl.temporaryCharacter['Name'] = characterName
Пример #27
0
def enterCharacterNatureHead():
    '''
    用于确认角色性格的头部面板
    '''
    EraPrint.p('\n')
    EraPrint.pline()
    EraPrint.pl(TextLoading.getTextData(TextLoading.messagePath, '39'))
Пример #28
0
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
Пример #29
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))
Пример #30
0
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