예제 #1
0
def inSceneButtonPanel():
    inputs = CmdButtonQueue.optionint(cmdList=CmdButtonQueue.inscenelist1,
                                      cmdColumn=9,
                                      askfor=False,
                                      cmdSize='center')
    EraPrint.plittleline()
    return inputs
예제 #2
0
def seeAttrInEveryTime_func():
    playerId = CacheContorl.playObject['objectId']
    showAttrHandle = CacheContorl.panelState['AttrShowHandlePanel']
    inputS = []
    playerMainAttrPanelAsk = SeePlayerAttrPanel.seePlayerMainAttrPanel(playerId)
    inputS.append(playerMainAttrPanelAsk)
    if showAttrHandle == '0':
        playerEquipmentPanelAsk = SeePlayerAttrPanel.seePlayerEquipmentPanel(playerId)
        inputS.append(playerEquipmentPanelAsk)
        playerItemPanelAsk = SeePlayerAttrPanel.seePlayerItemPanel(playerId)
        inputS.append(playerItemPanelAsk)
        pass
    elif showAttrHandle == '1':
        playerExperiencePanelAsk = SeePlayerAttrPanel.seePlayerExperiencePanel(playerId)
        inputS.append(playerExperiencePanelAsk)
        playerLevelPanelAsk = SeePlayerAttrPanel.seePlayerLevelPanel(playerId)
        inputS.append(playerLevelPanelAsk)
    elif showAttrHandle == '2':
        playerFeaturesPanelAsk = SeePlayerAttrPanel.seePlayerFeaturesPanel(playerId)
        inputS.append(playerFeaturesPanelAsk)
        playerEngravingPanelAsk = SeePlayerAttrPanel.seePlayerEngravingPanel(playerId)
        inputS.append(playerEngravingPanelAsk)
    EraPrint.pline()
    seeAttrPanelHandleAsk = SeePlayerAttrPanel.seeAttrShowHandlePanel()
    inputS = ValueHandle.listAppendToList(seeAttrPanelHandleAsk,inputS)
    return inputS
예제 #3
0
def acknowledgmentAttributeAns(inputList):
    playerId = CacheContorl.playObject['objectId']
    yrn = GameInit.askfor_All(inputList)
    showAttrHandleData = TextLoading.getTextData(TextLoading.cmdId,'seeAttrPanelHandle')
    PyCmd.clr_cmd()
    if yrn in panelList:
        PanelStateHandle.panelStateChange(yrn)
        acknowledgmentAttribute_func()
    elif yrn == '0':
        GameTime.initTime()
        AttrCalculation.setAttrOver(playerId)
        CharacterHandle.initCharacterList()
        SeePlayerAttrPanel.initShowAttrPanelList()
        playerPosition = CacheContorl.playObject['object'][playerId]['Position']
        MapHandle.playerMoveScene('0', playerPosition, playerId)
        import script.Flow.Main as mainframe
        mainframe.mainFrame_func()
    elif yrn == '1':
        CacheContorl.wframeMouse['wFrameRePrint'] = 1
        EraPrint.pnextscreen()
        SeePlayerAttrPanel.initShowAttrPanelList()
        import Design.StartFlow as mainflow
        mainflow.main_func()
    elif yrn in showAttrHandleData:
        index = showAttrHandleData.index(yrn)
        index = str(index)
        CacheContorl.panelState['AttrShowHandlePanel'] = index
        acknowledgmentAttribute_func()
예제 #4
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
예제 #5
0
def removeSave(saveId):
    savePath = getSavefilePath(saveId)
    if os.path.isfile(savePath):
        os.remove(savePath)
    else:
        errorText = TextLoading.getTextData(TextLoading.errorId,
                                            'notSaveError')
        EraPrint.pl(errorText)
예제 #6
0
def seeMapPanel():
    inputS = []
    titleText = TextLoading.getTextData(TextLoading.stageWordId, '78')
    EraPrint.plt(titleText)
    sceneId = CacheContorl.playObject['object']['0']['Position']
    mapId = MapHandle.getMapIdForScene(sceneId)
    inputS = inputS + MapHandle.printMap(mapId)
    return inputS
예제 #7
0
def attributeGenerationBranchPanel():
    playerId = CacheContorl.playObject['objectId']
    AttrCalculation.setAttrDefault(playerId)
    PyCmd.clr_cmd()
    EraPrint.pline()
    EraPrint.pl(TextLoading.getTextData(TextLoading.messageId, '9'))
    yrn = CmdButtonQueue.optionint(CmdButtonQueue.currencymenu, 1)
    return yrn
예제 #8
0
def loadSave(filename):
    filepath = getSavefilePath(filename)
    data = {}
    try:
        with open(filepath, 'rb') as f:
            data = pickle.load(f)
    except FileNotFoundError:
        EraPrint.p(TextLoading.getTextData(TextLoading.errorId,
                                           'notSaveError'))
    return data
예제 #9
0
def seeScenePanel():
    sceneData = CacheContorl.sceneData.copy()
    titleText = TextLoading.getTextData(TextLoading.stageWordId, '75')
    EraPrint.plt(titleText)
    timeText = GameTime.getDateText()
    EraPrint.p(timeText)
    EraPrint.p(' ')
    sceneId = CacheContorl.playObject['object']['0']['Position']
    sceneName = sceneData['SceneData'][sceneId]['SceneName']
    sceneInfoHead = TextLoading.getTextData(TextLoading.stageWordId, '76')
    sceneInfo = sceneInfoHead + sceneName
    EraPrint.p(sceneInfo)
    EraPrint.plittleline()
예제 #10
0
def seeMovePathPanel():
    inputS = []
    sceneId = CacheContorl.playObject['object']['0']['Position']
    mapId = MapHandle.getMapIdForScene(sceneId)
    mapData = CacheContorl.mapData['MapData'][mapId]
    movePathInfo = TextLoading.getTextData(TextLoading.messageId, '27')
    EraPrint.p(movePathInfo)
    EraPrint.p('\n')
    pathEdge = mapData['PathEdge']
    mapSceneId = str(MapHandle.getMapSceneIdForSceneId(mapId, sceneId))
    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(mapId, 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.messageId, '28')
        EraPrint.p(errorMoveText)
    EraPrint.pline()
    return {'inputS': inputS, 'scenePathList': scenePathList}
예제 #11
0
def askForChangeSavePagePanel(startId):
    cmdList = TextLoading.getTextData(TextLoading.cmdId, "changeSavePage")
    savePanelPage = str(CacheContorl.panelState['SeeSaveListPanel'])
    maxSavePanelPage = str(CacheContorl.maxSavePage)
    savePageText = '(' + savePanelPage + '/' + maxSavePanelPage + ')'
    EraPrint.printPageLine(sample='-', string=savePageText)
    EraPrint.p('\n')
    yrn = CmdButtonQueue.optionint(None,
                                   3,
                                   askfor=False,
                                   cmdSize='center',
                                   startId=startId,
                                   cmdListData=cmdList)
    return yrn
예제 #12
0
def inputSelfName_func():
    flowReturn = CreatorPlayerPanel.inputSelfNamePanel()
    if flowReturn == 0:
        PyCmd.clr_cmd()
        inputSexConfirm_func()
    elif flowReturn == 1:
        PyCmd.clr_cmd()
        CreatorPlayerPanel.startInputSelfName()
        PyCmd.clr_cmd()
        inputSelfName_func()
    elif flowReturn == 2:
        EraPrint.p('\n')
        PyCmd.clr_cmd()
        inputNickName_func()
    pass
예제 #13
0
def startInputSelfName():
    EraPrint.pline()
    EraPrint.pl(TextLoading.getTextData(TextLoading.messageId, '15'))
    inputState = 0
    while inputState == 0:
        playerSelfName = GameInit.askfor_str()
        EraPrint.pl(playerSelfName)
        if TextHandle.getTextIndex(playerSelfName) > 10:
            EraPrint.pl(
                TextLoading.getTextData(TextLoading.errorId,
                                        'inputSelfNameTooLongError'))
        else:
            inputState = 1
            CacheContorl.temporaryObject['SelfName'] = playerSelfName
    EraPrint.p('\n')
예제 #14
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'
예제 #15
0
def askLoadSavePanel():
    EraPrint.p('\n')
    cmdList = TextLoading.getTextData(TextLoading.cmdId, "loadSaveAsk")
    messageText = TextLoading.getTextData(TextLoading.messageId, '23')
    EraPrint.pline()
    EraPrint.p(messageText)
    EraPrint.p('\n')
    yrn = CmdButtonQueue.optionint(None, 1, askfor=False, cmdListData=cmdList)
    return yrn
예제 #16
0
def inputName_func():
    CacheContorl.playObject['objectId'] = playerId
    flowReturn = CreatorPlayerPanel.inputNamePanel()
    if flowReturn == 0:
        PyCmd.clr_cmd()
        inputNickName_func()
    elif flowReturn == 1:
        PyCmd.clr_cmd()
        CreatorPlayerPanel.startInputNamePanel()
        PyCmd.clr_cmd()
        inputName_func()
    elif flowReturn == 2:
        CacheContorl.wframeMouse['wFrameRePrint'] = 1
        EraPrint.pnextscreen()
        import Design.StartFlow as mainflow
        mainflow.main_func()
    pass
예제 #17
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
예제 #18
0
def confirmationRemoveSavePanel():
    EraPrint.p('\n')
    cmdList = TextLoading.getTextData(TextLoading.cmdId,
                                      "confirmationRemoveSave")
    messageText = TextLoading.getTextData(TextLoading.messageId, '25')
    EraPrint.pline()
    EraPrint.p(messageText)
    EraPrint.p('\n')
    yrn = CmdButtonQueue.optionint(None, 1, askfor=False, cmdListData=cmdList)
    return yrn
예제 #19
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'
예제 #20
0
def inputNamePanel():
    playerId = CacheContorl.playObject['objectId']
    CacheContorl.playObject['object'][
        playerId] = CacheContorl.temporaryObject.copy()
    AttrCalculation.setDefaultCache()
    EraPrint.p('\n')
    EraPrint.pline()
    EraPrint.pl(TextLoading.getTextData(TextLoading.messageId, '4'))
    yrn = CmdButtonQueue.optionint(CmdButtonQueue.currencymenu, 1)
    EraPrint.p('\n')
    return yrn
예제 #21
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
예제 #22
0
def inputNickName_func():
    flowReturn = CreatorPlayerPanel.inputNickNamePanel()
    if flowReturn == 0:
        PyCmd.clr_cmd()
        inputSelfName_func()
    elif flowReturn == 1:
        PyCmd.clr_cmd()
        CreatorPlayerPanel.startInputNickNamePanel()
        PyCmd.clr_cmd()
        inputNickName_func()
    elif flowReturn == 2:
        PyCmd.clr_cmd()
        CacheContorl.temporaryObject[
            'NickName'] = CacheContorl.temporaryObject['Name']
        inputNickName_func()
    elif flowReturn == 3:
        EraPrint.p('\n')
        PyCmd.clr_cmd()
        inputName_func()
    pass
예제 #23
0
def detailedSetting2Panel():
    EraPrint.p('\n')
    EraPrint.pline()
    EraPrint.pl(TextLoading.getTextData(TextLoading.messageId, '11'))
    yrn = CmdButtonQueue.optionstr(CmdButtonQueue.detailedsetting2, 5,
                                   'center', True)
    return yrn
예제 #24
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
예제 #25
0
def inputSexPanel():
    playerId = CacheContorl.playObject['objectId']
    sexId = CacheContorl.playObject['object'][playerId]['Sex']
    EraPrint.pline()
    EraPrint.pl(TextLoading.getTextData(TextLoading.messageId, '8')[sexId])
    yrn = CmdButtonQueue.optionint(CmdButtonQueue.currencymenu, 1)
    EraPrint.p('\n')
    return yrn
예제 #26
0
def inputSexChoice_func():
    sex = TextLoading.getTextData(TextLoading.roleId, 'Sex')
    sexMax = len(sex)
    flowReturn = CreatorPlayerPanel.inputSexChoicePanel()
    if flowReturn in range(0, sexMax):
        sexAtr = sex[flowReturn]
        CacheContorl.temporaryObject['Sex'] = sexAtr
        CacheContorl.playObject['object'][
            playerId] = CacheContorl.temporaryObject.copy()
        PyCmd.clr_cmd()
        inputSexConfirm_func()
    elif flowReturn == 4:
        rand = random.randint(0, len(sex) - 1)
        sexAtr = sex[rand]
        CacheContorl.temporaryObject['Sex'] = sexAtr
        CacheContorl.playObject['object'][
            playerId] = CacheContorl.temporaryObject.copy()
        PyCmd.clr_cmd()
        inputSexConfirm_func()
    elif flowReturn == 5:
        EraPrint.p('\n')
        PyCmd.clr_cmd()
        inputSexConfirm_func()
예제 #27
0
def inputNickNamePanel():
    playerId = CacheContorl.playObject['objectId']
    CacheContorl.playObject['object'][
        playerId] = CacheContorl.temporaryObject.copy()
    EraPrint.pline()
    EraPrint.pl(TextLoading.getTextData(TextLoading.messageId, '6'))
    yrn = CmdButtonQueue.optionint(CmdButtonQueue.inputnickname, 1)
    EraPrint.p('\n')
    return yrn
예제 #28
0
def inputSelfNamePanel():
    playerId = CacheContorl.playObject['objectId']
    PyCmd.clr_cmd()
    CacheContorl.playObject['object'][
        playerId] = CacheContorl.temporaryObject.copy()
    EraPrint.pline()
    EraPrint.pl(TextLoading.getTextData(TextLoading.messageId, '14'))
    yrn = CmdButtonQueue.optionint(CmdButtonQueue.inputselfname, 1)
    EraPrint.p('\n')
    return yrn
예제 #29
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
예제 #30
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)