Add support for IFS external reference
This commit is contained in:
parent
aaa6e5231f
commit
bb11f32bf5
@ -2113,6 +2113,15 @@ class ImportIIDX(ImportBase):
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
if sound_files is not None:
|
if sound_files is not None:
|
||||||
|
|
||||||
|
def load_ifs(fname: str) -> Optional[IFS]:
|
||||||
|
fname = os.path.join(os.path.abspath(assets_dir), fname)
|
||||||
|
fp = open(fname, "rb")
|
||||||
|
data = fp.read()
|
||||||
|
fp.close()
|
||||||
|
|
||||||
|
return IFS(data, reference_loader=load_ifs)
|
||||||
|
|
||||||
if song.id in sound_files:
|
if song.id in sound_files:
|
||||||
# Look up chart info!
|
# Look up chart info!
|
||||||
filename = sound_files[song.id]
|
filename = sound_files[song.id]
|
||||||
@ -2124,10 +2133,7 @@ class ImportIIDX(ImportBase):
|
|||||||
data = fp.read()
|
data = fp.read()
|
||||||
fp.close()
|
fp.close()
|
||||||
else:
|
else:
|
||||||
fp = open(filename, "rb")
|
ifs = load_ifs(filename)
|
||||||
ifsdata = fp.read()
|
|
||||||
fp.close()
|
|
||||||
ifs = IFS(ifsdata)
|
|
||||||
for fn in ifs.filenames:
|
for fn in ifs.filenames:
|
||||||
_, extension = os.path.splitext(fn)
|
_, extension = os.path.splitext(fn)
|
||||||
if extension == ".1":
|
if extension == ".1":
|
||||||
|
Loading…
x
Reference in New Issue
Block a user