From fd1d2ef072be2cf891c3d9ae815e9141695fe3ce Mon Sep 17 00:00:00 2001 From: Kevin Cathcart Date: Sat, 27 Apr 2019 12:52:19 -0400 Subject: [PATCH] Add support for pagebreak text command --- .gitignore | 11 ++++++----- Text.py | 8 +++++++- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 04bc2055..af03169d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,10 @@ -*.pyc -dist -build .idea -*.sfc +.vscode *_Spoiler.txt -bundle/components.wxs +*.pyc +*.sfc *.wixobj +build +bundle/components.wxs +dist README.html diff --git a/Text.py b/Text.py index 669bd849..59333120 100644 --- a/Text.py +++ b/Text.py @@ -530,6 +530,7 @@ class MultiByteCoreTextMapper(object): "{NOBORDER}": [0x6B, 0x02], "{CHANGEPIC}": [0x67, 0x67], "{CHANGEMUSIC}": [0x67], + "{PAGEBREAK}" : [0x7D], "{INTRO}": [0x6E, 0x00, 0x77, 0x07, 0x7A, 0x03, 0x6B, 0x02, 0x67], "{NOTEXT}": [0x6E, 0x00, 0x6B, 0x04], "{IBOX}": [0x6B, 0x02, 0x77, 0x07, 0x7A, 0x03], @@ -548,6 +549,11 @@ class MultiByteCoreTextMapper(object): linespace = wrap line = lines.pop(0) if line.startswith('{'): + if line == '{PAGEBREAK}': + if lineindex % 3 != 0: + # insert a wait for keypress, unless we just did so + outbuf.append(0x7E) + lineindex = 0 outbuf.extend(cls.special_commands[line]) continue @@ -589,7 +595,7 @@ class MultiByteCoreTextMapper(object): lineindex += 1 if pause and lineindex % 3 == 0 and has_more_lines: outbuf.append(0x7E) - if lineindex >= 3 and has_more_lines: + if lineindex >= 3 and has_more_lines and lines[0] != '{PAGEBREAK}': outbuf.append(0x73) return outbuf