From b0ee41b558126ae8a4037842d96c4c58ba1b6704 Mon Sep 17 00:00:00 2001 From: Zach Date: Thu, 5 Mar 2015 16:48:24 -0600 Subject: [PATCH] dual resources compatibility and shard page update --- .gitignore | 3 +++ toontown/dna/DNAParser.py | 24 ++++++++++++++++++------ toontown/makeatoon/NameGenerator.py | 1 + toontown/quest/QuestParser.py | 3 ++- toontown/shtiker/ShardPage.py | 2 +- 5 files changed, 25 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index 28d1b3c1..d695f7d1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,9 @@ # Python artifacts: *.pyc +# Windows +cmd.exe + # Eclipse IDE: .project .pydevproject diff --git a/toontown/dna/DNAParser.py b/toontown/dna/DNAParser.py index d31ff15d..7e816c4a 100644 --- a/toontown/dna/DNAParser.py +++ b/toontown/dna/DNAParser.py @@ -21,15 +21,23 @@ class DNABulkLoader: def loadDNABulk(dnaStorage, file): dnaLoader = DNALoader.DNALoader() - file = '../resources/' + file - dnaLoader.loadDNAFile(dnaStorage, file) + fileu = '../resources/' + file + fileo = 'resources/' + file + try: + dnaLoader.loadDNAFile(dnaStorage, fileu) + except: + dnaLoader.loadDNAFile(dnaStorage, fileo) dnaLoader.destroy() def loadDNAFile(dnaStorage, file): print 'Reading DNA file...', file dnaLoader = DNALoader.DNALoader() - file = '../resources/' + file - node = dnaLoader.loadDNAFile(dnaStorage, file) + fileu = '../resources/' + file + fileo = 'resources/' + file + try: + node = dnaLoader.loadDNAFile(dnaStorage, fileu) + except: + node = dnaLoader.loadDNAFile(dnaStorage, fileo) dnaLoader.destroy() if node.node().getNumChildren() > 0: return node.node() @@ -37,8 +45,12 @@ def loadDNAFile(dnaStorage, file): def loadDNAFileAI(dnaStorage, file): dnaLoader = DNALoader.DNALoader() - file = '../resources/' + file - data = dnaLoader.loadDNAFileAI(dnaStorage, file) + fileu = '../resources/' + file + fileo = 'resources/' + file + try: + data = dnaLoader.loadDNAFileAI(dnaStorage, fileu) + except: + data = dnaLoader.loadDNAFileAI(dnaStorage, fileo) dnaLoader.destroy() return data diff --git a/toontown/makeatoon/NameGenerator.py b/toontown/makeatoon/NameGenerator.py index 8bb36c7d..3325ae28 100644 --- a/toontown/makeatoon/NameGenerator.py +++ b/toontown/makeatoon/NameGenerator.py @@ -40,6 +40,7 @@ class NameGenerator: searchPath = DSearchPath() if __debug__: searchPath.appendDirectory(Filename('../resources/phase_3/etc')) + searchPath.appendDirectory(Filename('resources/phase_3/etc')) searchPath.appendDirectory(Filename('/phase_3/etc')) filename = Filename(TTLocalizer.NameShopNameMaster) found = vfs.resolveFilename(filename, searchPath) diff --git a/toontown/quest/QuestParser.py b/toontown/quest/QuestParser.py index 59d064fd..15b7ab23 100644 --- a/toontown/quest/QuestParser.py +++ b/toontown/quest/QuestParser.py @@ -1086,7 +1086,8 @@ class NPCMoviePlayer(DirectObject.DirectObject): searchPath = DSearchPath() if __debug__: - searchPath.appendDirectory(Filename('../resources/phase_3/etc')) + searchPath.appendDirectory(Filename('../resources/phase_3/etc')) +searchPath.appendDirectory(Filename('resources/phase_3/etc')) searchPath.appendDirectory(Filename('/phase_3/etc')) scriptFile = Filename('QuestScripts.txt') found = vfs.resolveFilename(scriptFile, searchPath) diff --git a/toontown/shtiker/ShardPage.py b/toontown/shtiker/ShardPage.py index 1cd01d3e..00bd8ddb 100644 --- a/toontown/shtiker/ShardPage.py +++ b/toontown/shtiker/ShardPage.py @@ -212,7 +212,7 @@ class ShardPage(ShtikerPage.ShtikerPage): tText = 'Teleport to\n%s' % shardName tImage = loader.loadModel('phase_4/models/gui/purchase_gui') tImage.setSz(1.35) - self.shardTeleportButton = DirectButton(parent=districtInfoNode, relief=None, pos=(0.4247, 0, -0.15), image=(tImage.find('**/PurchScrn_BTN_UP'), tImage.find('**/PurchScrn_BTN_DN'), tImage.find('**/PurchScrn_BTN_RLVR')), text=tText, text_scale=0.065, text_pos=(0.0, 0.015), text_fg=Vec4(0, 0, 0, 1), textMayChange=1, command=self.choseShard, extraArgs=[shardId]) + self.shardTeleportButton = DirectButton(parent=districtInfoNode, relief=None, pos=(0.4247, 0, 0.2), image=(tImage.find('**/PurchScrn_BTN_UP'), tImage.find('**/PurchScrn_BTN_DN'), tImage.find('**/PurchScrn_BTN_RLVR')), text=tText, text_scale=0.065, text_pos=(0.0, 0.015), text_fg=Vec4(0, 0, 0, 1), textMayChange=1, command=self.choseShard, extraArgs=[shardId]) self.currentBTL = buttonTuple[1] self.currentBTR = buttonTuple[2]