From c3626e01e7c351651b9d09b3d8ed95f13703c3ed Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Fri, 21 Jul 2023 00:33:44 -0300 Subject: Ensure all maps have a background on empty mode. --- client/mapbgfix.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 client/mapbgfix.py (limited to 'client') 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 '' in l and not HASBG: + n=f.write(' \n') + HASBG=True -- cgit v1.2.3-70-g09d2