summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2022-10-24 10:38:44 -0300
committerJesusaves <cpntb1@ymail.com>2022-10-24 10:38:44 -0300
commitc83a17446c9ffd7f78ac748b75ce13dd8dd60967 (patch)
tree252be238e7af853000de4fcf349ccfc3bb86efcb
parenta19801b6dfbf62e5f962c9aed7574ac961c2c165 (diff)
downloadtools-c83a17446c9ffd7f78ac748b75ce13dd8dd60967.tar.gz
tools-c83a17446c9ffd7f78ac748b75ce13dd8dd60967.tar.bz2
tools-c83a17446c9ffd7f78ac748b75ce13dd8dd60967.tar.xz
tools-c83a17446c9ffd7f78ac748b75ce13dd8dd60967.zip
Merge rEvolt client data as well
-rwxr-xr-xmerge-client.py55
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: