mirror of
https://github.com/Sneed-Group/Poodletooth-iLand
synced 2025-01-09 17:53:50 +00:00
Fix loading
This commit is contained in:
parent
acfdd18629
commit
7065e2b06f
1 changed files with 22 additions and 18 deletions
|
@ -12,7 +12,8 @@ from toontown.suit import SuitDNA
|
||||||
from toontown.toon import ToonHeadFrame
|
from toontown.toon import ToonHeadFrame
|
||||||
from toontown.toonbase import TTLocalizer
|
from toontown.toonbase import TTLocalizer
|
||||||
from toontown.toonbase import ToontownBattleGlobals
|
from toontown.toonbase import ToontownBattleGlobals
|
||||||
import copy, os, re, sys, token, tokenize, QuestScripts, BlinkingArrows
|
from toontown.quest import QuestScripts
|
||||||
|
import copy, re, tokenize, BlinkingArrows, StringIO
|
||||||
|
|
||||||
notify = DirectNotifyGlobal.directNotify.newCategory('QuestParser')
|
notify = DirectNotifyGlobal.directNotify.newCategory('QuestParser')
|
||||||
lineDict = {}
|
lineDict = {}
|
||||||
|
@ -43,24 +44,27 @@ def clear():
|
||||||
|
|
||||||
def readFile():
|
def readFile():
|
||||||
global curId
|
global curId
|
||||||
|
script = StringIO.StringIO(QuestScripts.script)
|
||||||
for line in QuestScripts.script.split('\n'):
|
|
||||||
def readline():
|
def readLine():
|
||||||
return line
|
return script.readline().replace('\r', '')
|
||||||
gen = tokenize.generate_tokens(readline)
|
|
||||||
line = getLineOfTokens(gen)
|
gen = tokenize.generate_tokens(readLine)
|
||||||
|
line = getLineOfTokens(gen)
|
||||||
while line is not None:
|
|
||||||
if line == []:
|
while line is not None:
|
||||||
line = getLineOfTokens(gen)
|
if line == []:
|
||||||
continue
|
|
||||||
if line[0] == 'ID':
|
|
||||||
parseId(line)
|
|
||||||
elif curId is None:
|
|
||||||
notify.error('Every script must begin with an ID')
|
|
||||||
else:
|
|
||||||
lineDict[curId].append(line)
|
|
||||||
line = getLineOfTokens(gen)
|
line = getLineOfTokens(gen)
|
||||||
|
continue
|
||||||
|
if line[0] == 'ID':
|
||||||
|
parseId(line)
|
||||||
|
elif curId is None:
|
||||||
|
notify.error('A script must begin with an ID')
|
||||||
|
else:
|
||||||
|
lineDict[curId].append(line)
|
||||||
|
line = getLineOfTokens(gen)
|
||||||
|
|
||||||
|
script.close()
|
||||||
|
|
||||||
def getLineOfTokens(gen):
|
def getLineOfTokens(gen):
|
||||||
tokens = []
|
tokens = []
|
||||||
|
|
Loading…
Reference in a new issue