Fix content pack support.

This commit is contained in:
Loudrob 2015-08-22 08:50:02 -04:00
parent fef0e0678e
commit a31c46f29a
2 changed files with 20 additions and 11 deletions

View file

@ -1,5 +1,5 @@
from panda3d.core import *
import __builtin__, os, sys
import __builtin__, os, sys, glob
import aes
import niraidata
@ -30,11 +30,19 @@ del dc
del iv
del key
# 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:
#from panda3d.core import VirtualFileSystem, ConfigVariableList, Filename
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)
# Resources
# TO DO: Sign and verify the phases to prevent edition
abort = False
# Packs
pack = os.environ.get('TT_STRIDE_CONTENT_PACK')
if pack and pack != 'default':
@ -50,7 +58,7 @@ if pack and pack != 'default':
mf.flush()
if not vfs.mount(mf, '../resources', 0):
if not vfs.mount(mf, '/', 0):
print 'Unable to mount %s' % filename
abort = True
break

View file

@ -69,12 +69,13 @@ from direct.directnotify.DirectNotifyGlobal import directNotify
notify = directNotify.newCategory('ToontownStart')
notify.setInfo(True)
# 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:
from panda3d.core import VirtualFileSystem, ConfigVariableList, Filename
vfs = VirtualFileSystem.getGlobalPtr()
mounts = ConfigVariableList('vfs-mount')
for mount in mounts:
if __debug__:
# 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:
from panda3d.core import VirtualFileSystem, ConfigVariableList, Filename
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)