diff options
-rwxr-xr-x | merge-client.py | 55 |
1 files changed, 52 insertions, 3 deletions
diff --git a/merge-client.py b/merge-client.py index a960fe0..45cf149 100755 --- a/merge-client.py +++ b/merge-client.py @@ -37,6 +37,7 @@ def hp(l): elif e.endswith(".ogg"): paths.append(e) elif e.endswith(".xml"): + ## TODO: We must also open the XML and extract paths from it paths.append(e) return @@ -103,7 +104,7 @@ with open("%s/items.xml" % MOUBOO, "r") as f: item_db.append("<!-- This file is generated automatically. -->\n") item_db.append("<!-- Please do not edit it directly. -->\n") item_db.append("<!-- ************************************************************************ -->\n") - ## TODO: Follow includes instead of saving them + ## Follow includes instead of saving them if "<include" in l: tmp=l.split("\"") if not "name" in tmp[0]: @@ -134,6 +135,7 @@ print("\033[32;1mMoubootaur Legends OK\033[0m") ## Handle copy pastes unify(MOUBOO) +################################################################################ ## Legacy/Evolved has an offset of 10k with open("%s/items.xml" % EVOLVED, "r") as f: saving=False @@ -142,7 +144,7 @@ with open("%s/items.xml" % EVOLVED, "r") as f: #l=l.replace(" ", "\t") ## Fix ID offset l=fix_id(l, 10000) - ## TODO: Follow includes instead of saving them + ## Follow includes instead of saving them if "<include" in l: tmp=l.split("\"") if not "name" in tmp[0]: @@ -171,7 +173,7 @@ with open("%s/items.xml" % EVOLVED, "r") as f: hp(l) while not "</items>" in item_db[-1]: item_db=item_db[:-1] -#item_db=item_db[:-1] +item_db=item_db[:-1] print("\033[32;1mLegacy/Evolved OK\033[0m") @@ -179,10 +181,57 @@ print("\033[32;1mLegacy/Evolved OK\033[0m") ## Handle copy pastes unify(EVOLVED) +################################################################################ +## rEvolt has an offset of 20k +with open("%s/items.xml" % REVOLT, "r") as f: + saving=False + for l in f: + ## FIXME: RACESPRITE + #l=l.replace(" ", "\t") + ## Fix ID offset + l=fix_id(l, 10000) + ## Follow includes instead of saving them + if "<include" in l: + tmp=l.split("\"") + if not "name" in tmp[0]: + print("\033[31mIllegal include: %s" % l) + continue + with open("%s/%s" % (REVOLT, tmp[1]), "r") as k: + save=False + for j in k: + if not save: + if "<items>" in j: + save=True + continue + if "</items>" in j: + break + j=fix_id(j, 10000) + item_db.append(j) + hp(j) + continue + + ## Save the line + if not saving: + if "<items>" in l: + saving=True + continue + item_db.append(l) + hp(l) + while not "</items>" in item_db[-1]: + item_db=item_db[:-1] +#item_db=item_db[:-1] +print("\033[32;1mrEvolt OK\033[0m") + + + +## Handle copy pastes +unify(REVOLT) + +################################################################################ ## Save the final item database with open(MYSELF+"items.xml", "w") as f: for l in item_db: |