From 2b49e3eabc5ed87567cf15930694d6477d8963d7 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Sat, 14 Dec 2013 20:14:20 -0500 Subject: [PATCH] textgen: Strip map number from level name graphics. The level name shown in the automap should be in the form: "ExMy: Level Name" but for the intermission screen graphics we just want "Level Name". Strip the leading level name if it is present. --- graphics/text/config.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/graphics/text/config.py b/graphics/text/config.py index 5bea930a..9d3099d6 100644 --- a/graphics/text/config.py +++ b/graphics/text/config.py @@ -33,6 +33,8 @@ # that are generated, and the text to show in each one. # +import re + # Adjustments for character position based on character pairs. Some # pairs of characters can fit more snugly together, which looks more # visually appealing. This is highly dependent on the font graphics, @@ -227,7 +229,9 @@ def update_from_bex(config, bexdata): if bexname not in bexdata: raise Exception('Level name %s not defined in ' 'DEHACKED lump!' % bexname) - config[lumpname] = bexdata[bexname] + # Strip "MAP01: " or "E1M2: " etc. from start, if present: + levelname = re.sub('^\w*\d:\s*', '', bexdata[bexname]) + config[lumpname] = levelname for e in range(4): for m in range(9):