diff options
author | Jesusaves <cpntb1@ymail.com> | 2023-07-21 00:33:44 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2023-07-21 00:33:44 -0300 |
commit | c3626e01e7c351651b9d09b3d8ed95f13703c3ed (patch) | |
tree | f5bdd59201b27e75cc31cae7c30c0956a252abda | |
parent | 4e23e96e1a302df42e2c791b862d7b5444f58253 (diff) | |
download | tools-c3626e01e7c351651b9d09b3d8ed95f13703c3ed.tar.gz tools-c3626e01e7c351651b9d09b3d8ed95f13703c3ed.tar.bz2 tools-c3626e01e7c351651b9d09b3d8ed95f13703c3ed.tar.xz tools-c3626e01e7c351651b9d09b3d8ed95f13703c3ed.zip |
Ensure all maps have a background on empty mode.
-rw-r--r-- | Makefile | 4 | ||||
-rw-r--r-- | client/mapbgfix.py | 25 |
2 files changed, 28 insertions, 1 deletions
@@ -23,11 +23,12 @@ testxml: .PHONY: wiki wiki: - cd wiki ; ./tmw_deploy.py cd wiki ; ./wikigen.py cd wiki ; mv *.md ../../wiki/ @cd contrib_xsl ; make wiki @echo "Wiki files updated, please commit the result on wiki." + cd wiki ; ./tmw_deploy.py + @echo "TMW Wiki updated." .PHONY: maps maps: @@ -65,6 +66,7 @@ news: .PHONY: client client: + @cd client ; ./mapbgfix.py @cd client ; ./minimap-render.py all @cd client ; ./minimap-dyecmd.py ; ./minimap-dyecmd.sh cp client/minimap-override/* ../client-data/graphics/minimaps/ diff --git a/client/mapbgfix.py b/client/mapbgfix.py new file mode 100644 index 0000000..8f31915 --- /dev/null +++ b/client/mapbgfix.py @@ -0,0 +1,25 @@ +#!/usr/bin/python3 +## This makes sure all maps have a background (required by 4144 on empty map view) + +import os +PATH='../../client-data/maps' +for mp in os.listdir(PATH): + map = '%s/%s' % (PATH, mp) + if not map.endswith('.tmx'): + continue + HASBG=False + bf=[] + with open(map) as f: + for l in f: + if "background" in l: + HASBG=True + break + bf.append(l) + if HASBG: + continue + with open(map, 'w') as f: + for l in bf: + n=f.write(l) + if '<properties>' in l and not HASBG: + n=f.write(' <property name="background0image" value="graphics/images/spit23loginwallpaper_800x600.png"/>\n') + HASBG=True |