예제 #1
0
파일: Personal.py 프로젝트: Hoikas/Plasma
    def OnFirstUpdate(self):
        # test for first time to play the intro movie
        vault = ptVault()
        entry = vault.findChronicleEntry(kIntroPlayedChronicle)
        if entry is not None:
            # already played intro sometime in the past... just let 'em play
            # enable twice because if we came from the ACA (closet->ACA->personal) it was disabled twice
            PtSendKIMessage(kEnableKIandBB,0)
            PtSendKIMessage(kEnableKIandBB,0)
            # enable yeesha book in case we came from the bahro cave
            PtSendKIMessage(kEnableYeeshaBook,0)
        else:
            # make sure the KI and blackbar is still diabled
            PtSendKIMessage(kDisableKIandBB,0)
            # It's the first time... start the intro movie, just by loading the movie dialog
            PtLoadDialog("IntroMovieGUI")

        # turn off sound log tracks
        import xSndLogTracks
        xSndLogTracks.UnsetLogMode()

        # make sure we have at least the micro-ki (and therefore a Relto book)
        # this does not downgrade us if we have a normal KI :)
        PtSendKIMessageInt(kUpgradeKILevel, kMicroKI)

        vault = ptVault()
        l = ptAgeInfoStruct()
        l.setAgeFilename('city')
        myCity = vault.getOwnedAgeLink(l)
        if myCity:
            cityInfo = myCity.getAgeInfo()
            if cityInfo:
                if cityInfo.getAgeInstanceGuid()==kEmptyGuid:
                    # we don't have it yet, so make it! (the callback will make it for us)
                    PtGetPublicAgeList('city',self)
            else:
                PtDebugPrint("hmm. city link has no age info node")
        else:
            PtDebugPrint("hmm. player has no city link")

        #~ # record our visit in player's chronicle
        #~ kModuleName = "Personal"
        #~ kChronicleVarName = "LinksIntoPersonalAge"
        #~ kChronicleVarType = 0
        #~ vault = ptVault()
        #~ if vault is not None:
            #~ entry = vault.findChronicleEntry(kChronicleVarName)
            #~ if entry is None:
                #~ # not found... add current level chronicle
                #~ vault.addChronicleEntry(kChronicleVarName,kChronicleVarType,"%d" %(1))
                #~ PtDebugPrint("%s:\tentered new chronicle counter %s" % (kModuleName,kChronicleVarName))
            #~ else:
                #~ count = int(entry.chronicleGetValue())
                #~ count = count + 1
                #~ entry.chronicleSetValue("%d" % (count))
                #~ entry.save()
                #~ PtDebugPrint("%s:\tyour current count for %s is %s" % (kModuleName,kChronicleVarName,entry.chronicleGetValue()))
        #~ else:
            #~ PtDebugPrint("%s:\tERROR trying to access vault -- can't update %s variable in chronicle." % (kModuleName,kChronicleVarName))
        pass
예제 #2
0
 def OnFirstUpdate(self):
     import xSndLogTracks
     xSndLogTracks.UnsetLogMode()
     vault = ptVault()
     l = ptAgeInfoStruct()
     l.setAgeFilename('city')
     myCity = vault.getOwnedAgeLink(l)
     if myCity:
         cityInfo = myCity.getAgeInfo()
         if cityInfo:
             if (cityInfo.getAgeInstanceGuid() == kEmptyGuid):
                 PtGetPublicAgeList('city', self)
         else:
             PtDebugPrint('hmm. city link has no age info node')
     else:
         PtDebugPrint('hmm. player has no city link')
예제 #3
0
def SndUnsetLogMode(args):
    import xSndLogTracks
    xSndLogTracks.UnsetLogMode()