~cadence/PE-DIA

c8c8df4ae3f2cd424346c317d6ea3cfa125d1175 — Cadence Ember 1 year, 11 months ago 0d2c8c1
Display error message if dialog has too many lines
1 files changed, 9 insertions(+), 0 deletions(-)

M processor.js
M processor.js => processor.js +9 -0
@@ 211,6 211,15 @@ class Interchange {
		text = text.trimEnd()
		let lines = text.split("\n")
		lines = lines.map(line => wordwrap(line, 38))
		if (lines.length > 7) {
			console.error(`Error: Too many text lines in interchange.
This interchange has ${lines.length} lines, but WA's maximum is 7.
Note that PE-DIA wraps long lines in your text file to fit WA's width.

${lines.map((l, i) => (i >= 7 ? "XX " : "   ") + String(i+1).padStart(2, "0") + " | " + l).join("\n")}
`)
			Deno.exit(1)
		}
		text = lines.join("\n")

		let choices = []