Exemplo n.º 1
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'
Exemplo n.º 2
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()
Exemplo n.º 3
0
def seeCharacterWearClothes(characterId:str,changeButton:bool):
    '''
    查看角色穿戴服装列表面板
    Keyword arguments:
    characterId -- 角色id
    changeButton -- 将服装列表绘制成按钮的开关
    '''
    EraPrint.p('\n')
    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)
        i += 1
        inputS.append(str(i))
        EraPrint.p('\n')
    return inputS
Exemplo n.º 4
0
def cmdSizePrint(cmdText,
                 cmdTextBak,
                 cmdEvent=None,
                 textWidth=0,
                 cmdSize='left',
                 noNullCmd=True,
                 normalStyle='standard',
                 onStyle='onbutton'):
    '''
    计算命令对齐方式,补全文本并绘制
    Keyword arguments:
    cmdText -- 命令文本
    cmdTextBak -- 命令被触发时返回的文本
    cmdEvent -- 命令绑定的事件 (default None)
    textWidth -- 文本对齐时补全空间宽度
    cmdSize -- 命令对齐方式(left/center/right) (default 'left')
    noNullCmd -- 绘制命令而非null命令样式的文本 (default False)
    normalStyle -- 按钮通常样式 (default 'standard')
    onStyle -- 按钮被按下时样式 (default 'onbutton')
    '''
    if noNullCmd == False:
        cmdText = '<nullcmd>' + cmdText + '</nullcmd>'
    if cmdSize == 'left':
        cmdWidth = TextHandle.getTextIndex(cmdText)
        cmdTextFix = ' ' * (textWidth - cmdWidth)
        if noNullCmd:
            PyCmd.pcmd(cmdText,
                       cmdTextBak,
                       cmdEvent,
                       normal_style=normalStyle,
                       on_style=onStyle)
        else:
            EraPrint.p(cmdText)
        EraPrint.p(cmdTextFix)
    elif cmdSize == 'center':
        cmdWidth = TextHandle.getTextIndex(cmdText)
        cmdTextFix = ' ' * (int(textWidth / 2) - int(cmdWidth / 2))
        EraPrint.p(cmdTextFix)
        if noNullCmd:
            PyCmd.pcmd(cmdText,
                       cmdTextBak,
                       cmdEvent,
                       normal_style=normalStyle,
                       on_style=onStyle)
        else:
            EraPrint.p(cmdText)
        EraPrint.p(cmdTextFix)
    elif cmdSize == 'right':
        cmdWidth = TextHandle.getTextIndex(cmdText)
        cmdTextFix = ' ' * (textWidth - cmdWidth)
        if noNullCmd:
            PyCmd.pcmd(cmdText,
                       cmdTextBak,
                       cmdEvent,
                       normal_style=normalStyle,
                       on_style=onStyle)
        else:
            EraPrint.p(cmdText)
        EraPrint.p(cmdTextFix)