chuni: fix ultimate/worlds end chart reading, closes #63
This commit is contained in:
parent
73dda06413
commit
944b80129b
@ -36,10 +36,14 @@ class ChuniReader(BaseReader):
|
|||||||
if self.opt_dir is not None:
|
if self.opt_dir is not None:
|
||||||
data_dirs += self.get_data_directories(self.opt_dir)
|
data_dirs += self.get_data_directories(self.opt_dir)
|
||||||
|
|
||||||
|
we_diff = "4"
|
||||||
|
if self.version >= ChuniConstants.VER_CHUNITHM_NEW:
|
||||||
|
we_diff = "5"
|
||||||
|
|
||||||
for dir in data_dirs:
|
for dir in data_dirs:
|
||||||
self.logger.info(f"Read from {dir}")
|
self.logger.info(f"Read from {dir}")
|
||||||
await self.read_events(f"{dir}/event")
|
await self.read_events(f"{dir}/event")
|
||||||
await self.read_music(f"{dir}/music")
|
await self.read_music(f"{dir}/music", we_diff)
|
||||||
await self.read_charges(f"{dir}/chargeItem")
|
await self.read_charges(f"{dir}/chargeItem")
|
||||||
await self.read_avatar(f"{dir}/avatarAccessory")
|
await self.read_avatar(f"{dir}/avatarAccessory")
|
||||||
await self.read_login_bonus(f"{dir}/")
|
await self.read_login_bonus(f"{dir}/")
|
||||||
@ -138,7 +142,7 @@ class ChuniReader(BaseReader):
|
|||||||
else:
|
else:
|
||||||
self.logger.warning(f"Failed to insert event {id}")
|
self.logger.warning(f"Failed to insert event {id}")
|
||||||
|
|
||||||
async def read_music(self, music_dir: str) -> None:
|
async def read_music(self, music_dir: str, we_diff: str = "4") -> None:
|
||||||
for root, dirs, files in walk(music_dir):
|
for root, dirs, files in walk(music_dir):
|
||||||
for dir in dirs:
|
for dir in dirs:
|
||||||
if path.exists(f"{root}/{dir}/Music.xml"):
|
if path.exists(f"{root}/{dir}/Music.xml"):
|
||||||
@ -169,7 +173,7 @@ class ChuniReader(BaseReader):
|
|||||||
chart_type = MusicFumenData.find("type")
|
chart_type = MusicFumenData.find("type")
|
||||||
chart_id = chart_type.find("id").text
|
chart_id = chart_type.find("id").text
|
||||||
chart_diff = chart_type.find("str").text
|
chart_diff = chart_type.find("str").text
|
||||||
if chart_diff == "WorldsEnd" and (chart_id == "4" or chart_id == "5"): # 4 in SDBT, 5 in SDHD
|
if chart_diff == "WorldsEnd" and chart_id == we_diff: # 4 in SDBT, 5 in SDHD
|
||||||
level = float(xml_root.find("starDifType").text)
|
level = float(xml_root.find("starDifType").text)
|
||||||
we_chara = (
|
we_chara = (
|
||||||
xml_root.find("worldsEndTagName")
|
xml_root.find("worldsEndTagName")
|
||||||
|
Loading…
Reference in New Issue
Block a user