import atexit
import random
from direct.showbase.ShowBase import ShowBase
base = ShowBase()
from direct.task import Task
import Globals
import Hood
from Toon import *
import ToonClientRepository

# The VirtualFileSystem, which has already initialized, doesn't see the mount
# directives in the config(s) yet. We have to force it to load those manually:
vfs = VirtualFileSystem.getGlobalPtr()
mounts = ConfigVariableList('vfs-mount')
for mount in mounts:
    mountfile, mountpoint = (mount.split(' ', 2) + [None, None, None])[:2]
    vfs.mount(Filename(mountfile), Filename(mountpoint), 0)

base.disableMouse()

base.cr = ToonClientRepository.ToonClientRepository()
base.cr.startConnect()
base.bgmExt = bgmExt
base.sfxExt = sfxExt
base.sfxExt2 = sfxExt2

base.hoods[Globals.ToontownCentral].load()

base.run()