mirror of
https://github.com/Faraphel/Atlas-Install.git
synced 2025-07-03 19:28:25 +02:00
- retro track prefix wouldn't change prefix
- patch_bmg part about changing wii track name have now better variable name and more comment
This commit is contained in:
parent
1b8dc36fac
commit
cc1ee7374b
1 changed files with 15 additions and 12 deletions
|
@ -253,22 +253,25 @@ class Game:
|
||||||
if "=" in bmgtrack:
|
if "=" in bmgtrack:
|
||||||
|
|
||||||
prefix = ""
|
prefix = ""
|
||||||
|
track_name = bmgtrack[bmgtrack.find("= ") + 2:]
|
||||||
|
|
||||||
if "T" in bmgtrack[:bmgtrack.find("=")]:
|
if "T" in bmgtrack[:bmgtrack.find("=")]:
|
||||||
sTid = bmgtrack.find("T")
|
start_track_id: int = bmgtrack.find("T") # index where the bmg track definition start
|
||||||
Tid = bmgtrack[sTid:sTid + 3]
|
track_id = bmgtrack[start_track_id:start_track_id + 3]
|
||||||
if Tid[1] in "1234":
|
if track_id[1] in "1234": # if the track is a original track from the wii
|
||||||
prefix = trackname_color["Wii"] + " " # Si la course est original à la wii
|
prefix = trackname_color["Wii"] + " "
|
||||||
Tid = hex(bmgID_track_move[Tid])[2:]
|
elif track_id[1] in "5678": # if the track is a retro track from the original game
|
||||||
|
for color_prefix, rep_color_prefix in trackname_color.items(): # color retro track prefix
|
||||||
|
track_name = track_name.replace(color_prefix, rep_color_prefix)
|
||||||
|
track_id = hex(bmgID_track_move[track_id])[2:]
|
||||||
else: # Arena
|
else: # Arena
|
||||||
sTid = bmgtrack.find("U") + 1
|
start_track_id = bmgtrack.find("U") + 1 # index where the bmg arena definition start
|
||||||
Tid = bmgtrack[sTid:sTid + 2]
|
track_id = bmgtrack[start_track_id:start_track_id + 2]
|
||||||
Tid = hex((int(Tid[0]) - 1) * 5 + (int(Tid[1]) - 1) + 0x7020)[2:]
|
track_id = hex((int(track_id[0]) - 1) * 5 + (int(track_id[1]) - 1) + 0x7020)[2:]
|
||||||
|
|
||||||
Tname = bmgtrack[bmgtrack.find("= ") + 2:]
|
f.write(f" {track_id}\t= {prefix}{track_name}\n")
|
||||||
f.write(f" {Tid}\t= {prefix}{Tname}\n")
|
|
||||||
|
|
||||||
if not (os.path.exists("./file/tmp/")): os.makedirs("./file/tmp/")
|
if not os.path.exists("./file/tmp/"): os.makedirs("./file/tmp/")
|
||||||
|
|
||||||
filecopy(gamefile + ".d/message/Common.bmg", "./file/tmp/Common.bmg")
|
filecopy(gamefile + ".d/message/Common.bmg", "./file/tmp/Common.bmg")
|
||||||
bmgcommon = wszst.ctc_patch_bmg(ctfile="./file/CTFILE.txt",
|
bmgcommon = wszst.ctc_patch_bmg(ctfile="./file/CTFILE.txt",
|
||||||
|
|
Loading…
Reference in a new issue