from pandac.PandaModules import *
loadPrcFile('config/config_client.prc')
loadPrcFileData('', 'multisamples 1000')
loadPrcFileData('', 'framebuffer-multisample 1')
loadPrcFileData('', 'default-model-extension .egg')
#loadPrcFileData('', 'window-title Grand Theft Toontown')
from direct.showbase.ShowBaseWide import ShowBase
base = ShowBase()
from direct.distributed.ClientRepository import *
from direct.interval.IntervalGlobal import *
from direct.gui.DirectGui import *

base.cr = ClientRepository([])
base.cTrav = CollisionTraverser()
aspect2d.setAntialias(AntialiasAttrib.MMultisample)

vfs = VirtualFileSystem.getGlobalPtr()
vfs.mount(Filename("phase_0.mf"), ".", VirtualFileSystem.MFReadOnly)
vfs.mount(Filename("phase_3.mf"), ".", VirtualFileSystem.MFReadOnly)
vfs.mount(Filename("phase_3.5.mf"), ".", VirtualFileSystem.MFReadOnly)
vfs.mount(Filename("phase_4.mf"), ".", VirtualFileSystem.MFReadOnly)
vfs.mount(Filename("phase_5.mf"), ".", VirtualFileSystem.MFReadOnly)
vfs.mount(Filename("phase_5.5.mf"), ".", VirtualFileSystem.MFReadOnly)
vfs.mount(Filename("phase_6.mf"), ".", VirtualFileSystem.MFReadOnly)
vfs.mount(Filename("phase_7.mf"), ".", VirtualFileSystem.MFReadOnly)
vfs.mount(Filename("phase_8.mf"), ".", VirtualFileSystem.MFReadOnly)
vfs.mount(Filename("phase_9.mf"), ".", VirtualFileSystem.MFReadOnly)
vfs.mount(Filename("phase_10.mf"), ".", VirtualFileSystem.MFReadOnly)
vfs.mount(Filename("phase_11.mf"), ".", VirtualFileSystem.MFReadOnly)
vfs.mount(Filename("phase_12.mf"), ".", VirtualFileSystem.MFReadOnly)
vfs.mount(Filename("phase_13.mf"), ".", VirtualFileSystem.MFReadOnly)
class game:
    process = 'client'


__builtin__.game = game()

from lib.coginvasion.toon import LocalToon
from lib.coginvasion.login.AvChoice import AvChoice

base.cTrav = CollisionTraverser()
base.shadowTrav = CollisionTraverser()
base.lifter = CollisionHandlerFloor()
base.pusher = CollisionHandlerPusher()
base.queue = CollisionHandlerQueue()
base.cr = ClientRepository(['phase_3/etc/direct.dc', 'phase_3/etc/toon.dc'])
base.cr.isShowingPlayerIds = False
base.cr.localAvChoice = AvChoice(
    "00/08/00/10/01/12/01/10/18/18/07/00/00/00/00", "Ducky", 0, 0)

dclass = base.cr.dclassesByName['DistributedToon']
base.localAvatar = LocalToon.LocalToon(base.cr)
base.localAvatar.dclass = dclass
base.localAvatar.doId = base.cr.localAvChoice.getAvId()
base.localAvatar.generate()
base.localAvatar.setName(base.cr.localAvChoice.getName())
base.localAvatar.maxHealth = 137
base.localAvatar.health = 137
base.localAvatar.setDNAStrand(base.cr.localAvChoice.getDNA())
base.localAvatar.announceGenerate()
base.localAvatar.reparentTo(base.render)
コード例 #3
0
ファイル: StandaloneToon.py プロジェクト: coginvasion/src
base.audio3d = Audio3DManager(base.sfxManagerList[0], camera)
base.audio3d.setDistanceFactor(25)
base.audio3d.setDropOffFactor(0.025)
from direct.distributed.ClientRepository import ClientRepository
import __builtin__

class game:
    process = 'client'


__builtin__.game = game()
from lib.coginvasion.toon import LocalToon
from lib.coginvasion.login.AvChoice import AvChoice
base.cTrav = CollisionTraverser()
base.shadowTrav = CollisionTraverser()
base.cr = ClientRepository(['phase_3/etc/direct.dc', 'phase_3/etc/toon.dc'])
base.cr.isShowingPlayerIds = False
base.cr.localAvChoice = AvChoice('00/08/00/10/01/12/01/10/18/18/07/00/00/00/00', 'Ducky', 0, 0)
dclass = base.cr.dclassesByName['DistributedToon']
base.localAvatar = LocalToon.LocalToon(base.cr)
base.localAvatar.dclass = dclass
base.localAvatar.doId = base.cr.localAvChoice.getAvId()
base.localAvatar.generate()
base.localAvatar.setName(base.cr.localAvChoice.getName())
base.localAvatar.maxHealth = 137
base.localAvatar.health = 137
base.localAvatar.setDNAStrand(base.cr.localAvChoice.getDNA())
base.localAvatar.announceGenerate()
base.localAvatar.reparentTo(base.render)
base.localAvatar.enableAvatarControls()
base.enableParticles()
コード例 #4
0
vfs.mount(Filename("phase_9.mf"), ".", VirtualFileSystem.MFReadOnly)
vfs.mount(Filename("phase_10.mf"), ".", VirtualFileSystem.MFReadOnly)
vfs.mount(Filename("phase_11.mf"), ".", VirtualFileSystem.MFReadOnly)
vfs.mount(Filename("phase_12.mf"), ".", VirtualFileSystem.MFReadOnly)
vfs.mount(Filename("phase_13.mf"), ".", VirtualFileSystem.MFReadOnly)

import __builtin__

class game:
	process = 'client'
__builtin__.game = game

#from lib.toontown.makeatoon.MakeAToon import MakeAToon
#from lib.toontown.toon.Toon import Toon

base.cr = ClientRepository(['astron/direct.dc'])
base.cr.isShowingPlayerIds = False
base.cTrav = CollisionTraverser()

base.camLens.setMinFov(70.0 / (4./3.))

DGG.setDefaultRolloverSound(base.loadSfx('phase_3/audio/sfx/GUI_rollover.mp3'))
DGG.setDefaultClickSound(base.loadSfx('phase_3/audio/sfx/GUI_create_toon_fwd.mp3'))
DGG.setDefaultFont(loader.loadFont('phase_3/models/fonts/ImpressBT.ttf'))

def make_light(btn, foo):
    btn['text_fg'] = (1, 1, 1, 1)
    
def make_dark(btn, foo):
    btn['text_fg'] = (0.8, 0.8, 0.8, 1)