Example #1
0
def seePlayerListPanel(maxPage):
    titleText = TextLoading.getTextData(TextLoading.stageWordId, '74')
    EraPrint.plt(titleText)
    inputS = []
    pageId = int(CacheContorl.panelState['SeePlayerListPanel'])
    pageShow = int(GameConfig.playerlist_show)
    maxPage = int(maxPage)
    playerMax = CharacterHandle.getCharacterIndexMax()
    if pageId == maxPage:
        showPageStart = pageShow * (pageId)
        showPageOver = showPageStart + (playerMax - showPageStart)
    else:
        showPageOver = pageShow * pageId
        showPageStart = showPageOver - pageShow
    for i in range(showPageStart, showPageOver + 1):
        playerId = str(i)
        cmdId = i - showPageStart
        cmdIdText = CmdButtonQueue.idIndex(cmdId)
        cmdText = AttrText.getPlayerAbbreviationsInfo(playerId)
        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
Example #2
0
def seePlayerItemPanel(playerId):
    EraPrint.plittleline()
    EraPrint.p(TextLoading.getTextData(TextLoading.stageWordId, '38'))
    panelState = CacheContorl.panelState['PlayerItemPanel']
    if panelState == "0":
        PyCmd.pcmd(panelStateOffText, 'PlayerItemPanel')
        EraPrint.p('\n')
        return 'PlayerItemPanel'
    else:
        PyCmd.pcmd(panelStateOnText, 'PlayerItemPanel')
        EraPrint.p('\n')
        return 'PlayerItemPanel'
    pass
Example #3
0
def seePlayerEngravingPanel(playerId):
    EraPrint.plittleline()
    EraPrint.p(TextLoading.getTextData(TextLoading.stageWordId, '7'))
    panelState = CacheContorl.panelState['PlayerEngravingPanel']
    if panelState == "0":
        PyCmd.pcmd(panelStateOffText, 'PlayerEngravingPanel')
        EraPrint.p('\n')
        playerData = AttrHandle.getAttrData(playerId)
        playerEngraving = playerData['Engraving']
        playerEngravingText = AttrText.getEngravingText(playerEngraving)
        EraPrint.plist(playerEngravingText, 3, 'center')
        return 'PlayerEngravingPanel'
    else:
        PyCmd.pcmd(panelStateOnText, 'PlayerEngravingPanel')
        EraPrint.p('\n')
        return 'PlayerEngravingPanel'
Example #4
0
def seePlayerFeaturesPanel(playerId):
    EraPrint.plittleline()
    EraPrint.p(TextLoading.getTextData(TextLoading.stageWordId, '6'))
    panelState = CacheContorl.panelState['PlayerFeaturesPanel']
    if panelState == "0":
        PyCmd.pcmd(panelStateOffText, 'PlayerFeaturesPanel')
        EraPrint.p('\n')
        playerData = AttrHandle.getAttrData(playerId)
        playerFeatures = playerData['Features']
        playerFeaturesStr = AttrText.getFeaturesStr(playerFeatures)
        EraPrint.p(playerFeaturesStr)
        return 'PlayerFeaturesPanel'
    else:
        PyCmd.pcmd(panelStateOnText, 'PlayerFeaturesPanel')
        EraPrint.p('\n')
        return 'PlayerFeaturesPanel'
    pass
Example #5
0
def seePlayerExperiencePanel(playerId):
    EraPrint.plittleline()
    EraPrint.p(TextLoading.getTextData(TextLoading.stageWordId, '18'))
    panelState = CacheContorl.panelState['PlayerExperiencePanel']
    if panelState == "0":
        PyCmd.pcmd(panelStateOffText, 'PlayerExperiencePanel')
        playerData = AttrHandle.getAttrData(playerId)
        EraPrint.p('\n')
        playerSexExperienceList = playerData['SexExperience']
        playerSex = CacheContorl.playObject['object'][playerId]['Sex']
        playerSexTextList = AttrText.getSexExperienceText(
            playerSexExperienceList, playerSex)
        EraPrint.plist(playerSexTextList, 4, 'center')
        return 'PlayerExperiencePanel'
    else:
        PyCmd.pcmd(panelStateOnText, 'PlayerExperiencePanel')
        EraPrint.p('\n')
        return 'PlayerExperiencePanel'
Example #6
0
def seeScenePlayerListPanel():
    inputS = []
    sceneData = CacheContorl.sceneData.copy()
    seePlayerText = TextLoading.getTextData(TextLoading.messageId, '26')
    EraPrint.p(seePlayerText)
    EraPrint.p('\n')
    sceneId = CacheContorl.playObject['object']['0']['Position']
    scenePlayerList = sceneData['ScenePlayerData'][sceneId]
    for playerId in scenePlayerList:
        if playerId == '0':
            pass
        else:
            playerName = CacheContorl.playObject['object'][str(
                playerId)]['Name']
            PyCmd.pcmd(playerName, playerName, None)
            inputS.append(playerName)
            EraPrint.p(' ')
    EraPrint.plittleline()
    return inputS
Example #7
0
def mainFramePanel():
    cmdList = []
    playerId = CacheContorl.playObject['objectId']
    playerData = AttrHandle.getAttrData(playerId)
    titleText = TextLoading.getTextData(TextLoading.stageWordId, '64')
    EraPrint.plt(titleText)
    dateText = GameTime.getDateText()
    EraPrint.p(dateText)
    EraPrint.p(' ')
    weekDateText = GameTime.getWeekDayText()
    EraPrint.p(weekDateText)
    EraPrint.p(' ')
    playerName = playerData['Name']
    PyCmd.pcmd(playerName, playerName, None)
    cmdList.append(playerName)
    EraPrint.p(' ')
    goldText = AttrText.getGoldText(playerId)
    EraPrint.p(goldText)
    EraPrint.p('\n')
    AttrPrint.printHpAndMpBar(playerId)
    mainMenuText = TextLoading.getTextData(TextLoading.stageWordId, '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.stageWordId, '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
Example #8
0
def printMap(mapId):
    mapText = CacheContorl.mapData['MapTextData'][mapId]
    playerNowSceneId = CacheContorl.playObject['object']['0']['Position']
    playerNowSceneId = getMapSceneIdForSceneId(mapId,playerNowSceneId)
    playerNowSceneId = str(playerNowSceneId)
    sceneList = getSceneListForMap(mapId)
    inputS = []
    inputCmd = ''
    passList = []
    mapYList = mapText.split('\n')
    for mapXList in mapYList:
        mapXListStyle = RichText.setRichTextPrint(mapXList,'standard')
        mapXList = RichText.removeRichCache(mapXList)
        mapXFix = TextHandle.align(mapXList,'center',True)
        EraPrint.p(mapXFix)
        for i in range(0, len(mapXList)):
            if str(i) not in passList:
                if mapXListStyle[i] == 'mapbutton':
                    inputCmd = inputCmd + mapXList[i]
                    for n in range(i + 1,len(mapXList)):
                        if mapXListStyle[n] == 'mapbutton':
                            inputCmd = inputCmd + mapXList[n]
                            passList.append(str(n))
                        else:
                            break
                    if inputCmd in sceneList:
                        if inputCmd == playerNowSceneId:
                            EraPrint.p(inputCmd,'nowmap')
                            inputS.append(None)
                        else:
                            PyCmd.pcmd(inputCmd, inputCmd, None)
                            inputS.append(inputCmd)
                    else:
                        EraPrint.p(inputCmd,'standard')
                    inputCmd = ''
                else:
                    EraPrint.p(mapXList[i], mapXListStyle[i])
        EraPrint.p('\n')
    return inputS
Example #9
0
def seePlayerEquipmentPanel(playerId):
    EraPrint.plittleline()
    EraPrint.p(TextLoading.getTextData(TextLoading.stageWordId, '37'))
    panelState = CacheContorl.panelState['PlayerEquipmentPanel']
    if panelState == "0":
        PyCmd.pcmd(panelStateOffText, 'PlayerEquipmentPanel')
        playerData = AttrHandle.getAttrData(playerId)
        EraPrint.p('\n')
        EraPrint.p(TextLoading.getTextData(TextLoading.stageWordId, '39'))
        EraPrint.p('\n')
        playerClothingList = playerData['Clothing']
        playerClothingText = AttrText.getClothingText(playerClothingList)
        EraPrint.plist(playerClothingText, 4, 'center')
        EraPrint.p('\n')
        EraPrint.p(TextLoading.getTextData(TextLoading.stageWordId, '40'))
        EraPrint.p('\n')
        playerSexItemList = playerData['SexItem']
        playerSexItemText = AttrText.getSexItemText(playerSexItemList)
        EraPrint.plist(playerSexItemText, 5, 'center')
        return 'PlayerEquipmentPanel'
    else:
        PyCmd.pcmd(panelStateOnText, 'PlayerEquipmentPanel', None)
        EraPrint.p('\n')
        return 'PlayerEquipmentPanel'
Example #10
0
def cmdSizePrint(cmdText,
                 cmdTextBak,
                 cmdEvent=None,
                 textWidth=0,
                 cmdSize='left'):
    if cmdSize == 'left':
        cmdWidth = TextHandle.getTextIndex(cmdText)
        cmdTextFix = ' ' * (textWidth - cmdWidth)
        PyCmd.pcmd(cmdText, cmdTextBak, cmdEvent)
        EraPrint.p(cmdTextFix)
    elif cmdSize == 'center':
        cmdWidth = TextHandle.getTextIndex(cmdText)
        cmdTextFix = ' ' * (int(textWidth / 2) - int(cmdWidth / 2))
        EraPrint.p(cmdTextFix)
        PyCmd.pcmd(cmdText, cmdTextBak, cmdEvent)
        EraPrint.p(cmdTextFix)
    elif cmdSize == 'right':
        cmdWidth = TextHandle.getTextIndex(cmdText)
        cmdTextFix = ' ' * (textWidth - cmdWidth)
        EraPrint.p(cmdTextFix)
        PyCmd.pcmd(cmdText, cmdTextBak, cmdEvent)
Example #11
0
def seePlayerMainAttrPanel(playerId):
    title1 = TextLoading.getTextData(TextLoading.stageWordId, '1')
    EraPrint.plt(title1)
    playeridText = TextLoading.getTextData(TextLoading.stageWordId,
                                           '0') + playerId
    EraPrint.p(playeridText)
    panelState = CacheContorl.panelState['PlayerMainAttrPanel']
    if panelState == "0":
        PyCmd.pcmd(panelStateOffText, 'PlayerMainAttrPanel', None)
        EraPrint.p('\n')
        attrListString = []
        playerData = AttrHandle.getAttrData(playerId)
        playerSex = playerData['Sex']
        playerAge = playerData['Age']
        playerName = playerData['Name']
        fixPlayerName = TextLoading.getTextData(TextLoading.stageWordId, '13')
        playerName = fixPlayerName + playerName
        attrListString.append(playerName)
        playerSelfName = playerData['SelfName']
        fixPlayerSelfName = TextLoading.getTextData(TextLoading.stageWordId,
                                                    '11')
        playerSelfName = fixPlayerSelfName + playerSelfName
        attrListString.append(playerSelfName)
        playerNickName = playerData['NickName']
        playerNickName = TextLoading.getTextData(TextLoading.stageWordId,
                                                 '12') + playerNickName
        attrListString.append(playerNickName)
        relationship = playerData['Relationship']
        relationship = TextLoading.getTextData(TextLoading.stageWordId,
                                               '14') + relationship
        attrListString.append(relationship)
        playerSpecies = playerData['Species']
        playerSpecies = TextLoading.getTextData(TextLoading.stageWordId,
                                                '15') + playerSpecies
        attrListString.append(playerSpecies)
        playerSex = TextLoading.getTextData(TextLoading.stageWordId,
                                            '2') + playerSex
        attrListString.append(playerSex)
        playerAge = TextLoading.getTextData(TextLoading.stageWordId,
                                            '3') + str(playerAge)
        attrListString.append(playerAge)
        EraPrint.p('\n')
        playerSan = playerData['San']
        playerSan = TextLoading.getTextData(TextLoading.stageWordId,
                                            '10') + playerSan
        attrListString.append(playerSan)
        playerHeight = playerData['Height']['NowHeight']
        playerWeight = playerData['Weight']
        playerMeasurements = playerData['Measurements']
        playerHeightText = str(round(playerHeight, 2))
        playerWeightText = str(round(playerWeight, 2))
        playerBust = str(round(playerMeasurements['Bust'], 2))
        playerWaist = str(round(playerMeasurements['Waist'], 2))
        playerHip = str(round(playerMeasurements['Hip'], 2))
        playerHeightInfo = TextLoading.getTextData(TextLoading.stageWordId,
                                                   '80') + playerHeightText
        attrListString.append(playerHeightInfo)
        playerWeightInfo = TextLoading.getTextData(TextLoading.stageWordId,
                                                   '81') + playerWeightText
        attrListString.append(playerWeightInfo)
        playerBWHInfo = TextLoading.getTextData(
            TextLoading.stageWordId,
            '82') + playerBust + ',' + playerWaist + ',' + playerHip
        playerIntimate = playerData['Intimate']
        playerIntimate = TextLoading.getTextData(TextLoading.stageWordId,
                                                 '16') + playerIntimate
        attrListString.append(playerIntimate)
        playerGraces = playerData['Graces']
        playerGraces = TextLoading.getTextData(TextLoading.stageWordId,
                                               '17') + playerGraces
        attrListString.append(playerGraces)
        attrListString.append(playerBWHInfo)
        EraPrint.plist(attrListString, 4, 'center')
        EraPrint.p('\n')
        AttrPrint.printHpAndMpBar(playerId)
        return 'PlayerMainAttrPanel'
    else:
        PyCmd.pcmd(panelStateOnText, 'PlayerMainAttrPanel', None)
        EraPrint.p('\n')
        return 'PlayerMainAttrPanel'
Example #12
0
def seeSaveListPanel(pageSaveValue, lastSavePageValue, autoSave=False):
    savePanelPage = int(CacheContorl.panelState['SeeSaveListPanel']) + 1
    inputS = []
    idTextList = []
    idInfoText = TextLoading.getTextData(TextLoading.stageWordId, '72')
    textWidth = int(GameConfig.text_width)
    saveNoneText = TextLoading.getTextData(TextLoading.messageId, '20')
    if savePanelPage == int(GameConfig.save_page) + 1:
        startSaveId = int(pageSaveValue) * (savePanelPage - 1)
        overSaveId = startSaveId + lastSavePageValue
    else:
        overSaveId = int(pageSaveValue) * savePanelPage
        startSaveId = overSaveId - int(pageSaveValue)
    for i in range(0, overSaveId - startSaveId):
        id = CmdButtonQueue.idIndex(i)
        saveId = startSaveId + i
        if autoSave == True and SaveHandle.judgeSaveFileExist(saveId) != '1':
            idText = idInfoText + " " + str(saveId) + ":"
            idTextList.append(idText)
        else:
            idText = id + idInfoText + " " + str(saveId) + ":"
            idTextList.append(idText)
    for i in range(0, overSaveId - startSaveId):
        id = str(i)
        idText = idTextList[i]
        EraPrint.plittleline()
        saveid = SaveHandle.getSavePageSaveId(pageSaveValue, i)
        if SaveHandle.judgeSaveFileExist(saveid) == '1':
            saveData = SaveHandle.loadSave(saveid)
            playerData = saveData['playerData']
            gameTimeData = saveData['gameTime']
            gameTimeText = GameTime.getDateText(gameTimeData)
            playerName = playerData['object']['0']['Name']
            saveVerson = saveData['gameVerson']
            saveText = playerName + ' ' + gameTimeText + ' ' + saveVerson
            idTextIndex = int(TextHandle.getTextIndex(idText))
            fixIdWidth = textWidth - idTextIndex
            saveAlign = TextHandle.align(saveText,
                                         'center',
                                         textWidth=fixIdWidth)
            idText = idText + saveAlign
            PyCmd.pcmd(idText, id, None)
            EraPrint.p('\n')
            inputS.append(id)
        else:
            idTextIndex = int(TextHandle.getTextIndex(idText))
            fixIdWidth = textWidth - idTextIndex
            saveNoneAlign = TextHandle.align(saveNoneText,
                                             'center',
                                             textWidth=fixIdWidth)
            idText = idText + saveNoneAlign
            if autoSave == True:
                EraPrint.p(idText)
                EraPrint.p('\n')
            else:
                PyCmd.pcmd(idText, id, None)
                inputS.append(id)
                EraPrint.p('\n')
    if autoSave == True:
        autoInfoText = TextLoading.getTextData(TextLoading.stageWordId, "73")
        i = pageSaveValue
        id = CmdButtonQueue.idIndex(i)
        EraPrint.plittleline()
        if SaveHandle.judgeSaveFileExist('auto') == '1':
            saveData = SaveHandle.loadSave('auto')
            playerData = saveData['playerData']
            gameTimeData = saveData['gameTime']
            gameTimeText = GameTime.getDateText(gameTimeData)
            saveVerson = saveData['gameVerson']
            playerName = playerData['object']['0']['Name']
            saveText = playerName + ' ' + gameTimeText + ' ' + saveVerson
            idText = id + autoInfoText
            idTextIndex = int(TextHandle.getTextIndex(idText))
            fixIdWidth = textWidth - idTextIndex
            saveTextAlign = TextHandle.align(saveText,
                                             'center',
                                             textWidth=fixIdWidth)
            idText = idText + saveTextAlign
            PyCmd.pcmd(idText, id, None)
            inputS.append(id)
            EraPrint.p('\n')
        else:
            idTextIndex = int(TextHandle.getTextIndex(autoInfoText))
            fixIdWidth = textWidth - idTextIndex
            saveNoneAlign = TextHandle.align(saveNoneText,
                                             'center',
                                             textWidth=fixIdWidth)
            idText = autoInfoText + saveNoneAlign
            EraPrint.p(idText)
            EraPrint.p('\n')
    else:
        pass
    return inputS