From 80c874789e5931b9f399dc1c90bb1931768d86aa Mon Sep 17 00:00:00 2001 From: Tony Kemp Date: Wed, 2 Nov 2016 17:29:06 +1100 Subject: [PATCH] Don't ignore special passages when using SugarCube SugarCube still makes use of most of the Twine 1 special passages, so do not ignore them when using this format. --- lib/twee2/story_file.rb | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/twee2/story_file.rb b/lib/twee2/story_file.rb index d46a810..e672dd7 100644 --- a/lib/twee2/story_file.rb +++ b/lib/twee2/story_file.rb @@ -76,8 +76,13 @@ def initialize(filename) elsif k == 'StoryIncludes' @passages[k][:exclude_from_output] = true # includes should already have been handled above elsif %w{StorySubtitle StoryAuthor StoryMenu StorySettings}.include? k - puts "WARNING: ignoring passage '#{k}'" - @passages[k][:exclude_from_output] = true + # SugarCube still uses some of the Twine 1 special passages, + # so do not ignore them when using SugarCube story format + # ('StorySettings' passage is never used) + unless Twee2::build_config.story_format =~ /sugarcube/i && k != 'StorySettings' + puts "WARNING: ignoring passage '#{k}'" + @passages[k][:exclude_from_output] = true + end elsif @passages[k][:tags].include? 'stylesheet' story_css << "#{@passages[k][:content]}\n" @passages[k][:exclude_from_output] = true @@ -143,4 +148,4 @@ def run_preprocessors end end end -end \ No newline at end of file +end