mirror of
https://github.com/Sneed-Group/Poodletooth-iLand
synced 2025-01-09 17:53:50 +00:00
Fixed the missiong Icon from the game. (Can be reverted)
This commit is contained in:
parent
2f96488aec
commit
c98510471d
1 changed files with 15 additions and 16 deletions
|
@ -27,6 +27,21 @@ from toontown.toonbase import TTLocalizer
|
|||
from toontown.toonbase import ToontownBattleGlobals
|
||||
from toontown.toontowngui import TTDialog
|
||||
|
||||
tempdir = tempfile.mkdtemp()
|
||||
vfs = VirtualFileSystem.getGlobalPtr()
|
||||
searchPath = DSearchPath()
|
||||
if __debug__:
|
||||
searchPath.appendDirectory(Filename('resources/phase_3/etc'))
|
||||
searchPath.appendDirectory(Filename('/phase_3/etc'))
|
||||
|
||||
for filename in ['toonmono.cur', 'icon.ico']:
|
||||
p3filename = Filename(filename)
|
||||
found = vfs.resolveFilename(p3filename, searchPath)
|
||||
if not found:
|
||||
continue
|
||||
with open(os.path.join(tempdir, filename), 'wb') as f:
|
||||
f.write(vfs.readFile(p3filename, False))
|
||||
loadPrcFileData('Window: icon', 'icon-filename %s' % Filename.fromOsSpecific(os.path.join(tempdir, 'icon.ico')))
|
||||
|
||||
class ToonBase(OTPBase.OTPBase):
|
||||
notify = DirectNotifyGlobal.directNotify.newCategory('ToonBase')
|
||||
|
@ -148,23 +163,7 @@ class ToonBase(OTPBase.OTPBase):
|
|||
return result
|
||||
|
||||
def setCursorAndIcon(self):
|
||||
tempdir = tempfile.mkdtemp()
|
||||
atexit.register(shutil.rmtree, tempdir)
|
||||
vfs = VirtualFileSystem.getGlobalPtr()
|
||||
|
||||
searchPath = DSearchPath()
|
||||
if __debug__:
|
||||
searchPath.appendDirectory(Filename('resources/phase_3/etc'))
|
||||
searchPath.appendDirectory(Filename('/phase_3/etc'))
|
||||
|
||||
for filename in ['toonmono.cur', 'icon.ico']:
|
||||
p3filename = Filename(filename)
|
||||
found = vfs.resolveFilename(p3filename, searchPath)
|
||||
if not found:
|
||||
return # Can't do anything past this point.
|
||||
|
||||
with open(os.path.join(tempdir, filename), 'wb') as f:
|
||||
f.write(vfs.readFile(p3filename, False))
|
||||
|
||||
wp = WindowProperties()
|
||||
wp.setCursorFilename(Filename.fromOsSpecific(os.path.join(tempdir, 'toonmono.cur')))
|
||||
|
|
Loading…
Reference in a new issue