diff options
author | Jesusaves <cpntb1@ymail.com> | 2022-10-24 11:33:30 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2022-10-24 11:33:30 -0300 |
commit | b9ac8ed0dc8eabe11616596c5f17fd2ce4156127 (patch) | |
tree | 6c017113552608845ea8bb9c90078460a6113652 | |
parent | 1dbac488c2018f9fcc5c677fecbc81f47bda6920 (diff) | |
download | tools-b9ac8ed0dc8eabe11616596c5f17fd2ce4156127.tar.gz tools-b9ac8ed0dc8eabe11616596c5f17fd2ce4156127.tar.bz2 tools-b9ac8ed0dc8eabe11616596c5f17fd2ce4156127.tar.xz tools-b9ac8ed0dc8eabe11616596c5f17fd2ce4156127.zip |
Bugfixes and minor refactoring
-rwxr-xr-x | merge-client.py | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/merge-client.py b/merge-client.py index 10c8083..50c0a45 100755 --- a/merge-client.py +++ b/merge-client.py @@ -25,10 +25,12 @@ def fix_id(l, offset): l="\"".join(tmp) return l +## This is to find misc files and copy them over, but +## We probably could just c/p one over the other >.> def hp(l, WHERE): global paths if "<include" in l: - return + return l if ".png" in l or ".ogg" in l or ".xml" in l: tmpi=l.split("\"") if len(tmpi) == 1: @@ -60,7 +62,8 @@ def hp(l, WHERE): for n in i: if n.endswith(".png"): paths.append(n) - return + # TODO: Update the line with a prefix + return l def unify(YESELF): global paths @@ -140,12 +143,12 @@ with open("%s/items.xml" % MOUBOO, "r") as f: continue if "</items>" in j: break - hp(j, MOUBOO) + j=hp(j, MOUBOO) item_db.append(j) continue ## Save the line - hp(l, MOUBOO) + l=hp(l, MOUBOO) item_db.append(l) while not "</items>" in item_db[-1]: item_db=item_db[:-1] @@ -181,8 +184,8 @@ with open("%s/items.xml" % EVOLVED, "r") as f: if "</items>" in j: break j=fix_id(j, 10000) + j=hp(j, EVOLVED) item_db.append(j) - hp(j, EVOLVED) continue ## Save the line @@ -190,8 +193,8 @@ with open("%s/items.xml" % EVOLVED, "r") as f: if "<items>" in l: saving=True continue + l=hp(l, EVOLVED) item_db.append(l) - hp(l, EVOLVED) while not "</items>" in item_db[-1]: item_db=item_db[:-1] item_db=item_db[:-1] @@ -210,7 +213,7 @@ with open("%s/items.xml" % REVOLT, "r") as f: ## FIXME: RACESPRITE #l=l.replace(" ", "\t") ## Fix ID offset - l=fix_id(l, 10000) + l=fix_id(l, 20000) ## Follow includes instead of saving them if "<include" in l: tmp=l.split("\"") @@ -226,9 +229,9 @@ with open("%s/items.xml" % REVOLT, "r") as f: continue if "</items>" in j: break - j=fix_id(j, 10000) + j=fix_id(j, 20000) + j=hp(j, REVOLT) item_db.append(j) - hp(j, REVOLT) continue ## Save the line @@ -236,8 +239,8 @@ with open("%s/items.xml" % REVOLT, "r") as f: if "<items>" in l: saving=True continue + l=hp(l, REVOLT) item_db.append(l) - hp(l, REVOLT) while not "</items>" in item_db[-1]: item_db=item_db[:-1] #item_db=item_db[:-1] |