|
@@ -12,6 +12,8 @@ STORY_TITLE = 'Volleyball'
|
|
STORY_FORMAT = 'SugarCube'
|
|
STORY_FORMAT = 'SugarCube'
|
|
STORY_FORMAT_PATH = "story_formats/sugarcube-2.28.2-for-twine-2.1-local/sugarcube-2"
|
|
STORY_FORMAT_PATH = "story_formats/sugarcube-2.28.2-for-twine-2.1-local/sugarcube-2"
|
|
STORY_FORMAT_VERSION = '2.28.2'
|
|
STORY_FORMAT_VERSION = '2.28.2'
|
|
|
|
+STORY_RELEASE_TITLE = 'Volleyball Chapter 1 v0.5'
|
|
|
|
+
|
|
FILES = {
|
|
FILES = {
|
|
'01_intro' => '01 Intro',
|
|
'01_intro' => '01 Intro',
|
|
'02_transform' => '02 Transform',
|
|
'02_transform' => '02 Transform',
|
|
@@ -32,16 +34,16 @@ def files
|
|
end
|
|
end
|
|
end
|
|
end
|
|
|
|
|
|
-task develop: %w(bundle_install storyjs) do
|
|
|
|
|
|
+task develop: %w(bundle_install storyjs story.tw2 story_title.tw2) do
|
|
sh "bundle exec twee2 build '--format=#{STORY_FORMAT_PATH}' main.tw2 develop.html"
|
|
sh "bundle exec twee2 build '--format=#{STORY_FORMAT_PATH}' main.tw2 develop.html"
|
|
end
|
|
end
|
|
|
|
|
|
-task watch: %w(bundle_install storyjs) do
|
|
|
|
|
|
+task watch: %w(bundle_install storyjs story.tw2 story_title.tw2) do
|
|
sh 'start watch.html' # FIXME non-windows
|
|
sh 'start watch.html' # FIXME non-windows
|
|
sh "bundle exec twee2 watch '--format=#{STORY_FORMAT_PATH}' main.tw2 watch.html"
|
|
sh "bundle exec twee2 watch '--format=#{STORY_FORMAT_PATH}' main.tw2 watch.html"
|
|
end
|
|
end
|
|
|
|
|
|
-task release: %w(bundle_install storyjs) do
|
|
|
|
|
|
+task release: %w(bundle_install storyjs story.tw2 story_title.tw2) do
|
|
sh "bundle exec twee2 build '--format=#{STORY_FORMAT_PATH}' main.tw2 release.html"
|
|
sh "bundle exec twee2 build '--format=#{STORY_FORMAT_PATH}' main.tw2 release.html"
|
|
end
|
|
end
|
|
|
|
|
|
@@ -53,8 +55,24 @@ task :storyjs do
|
|
)
|
|
)
|
|
end
|
|
end
|
|
|
|
|
|
|
|
+file 'story.tw2' do
|
|
|
|
+ File.open('story.tw2', 'w') do |f|
|
|
|
|
+ f.puts('::StoryIncludes')
|
|
|
|
+ files.each do |file|
|
|
|
|
+ f.puts(file.source_file)
|
|
|
|
+ end
|
|
|
|
+ end
|
|
|
|
+end
|
|
|
|
+
|
|
|
|
+file 'story_title.tw2' do
|
|
|
|
+ File.open('story_title.tw2', 'w') do |f|
|
|
|
|
+ f.puts('::StoryTitle')
|
|
|
|
+ f.puts("#{STORY_RELEASE_TITLE}")
|
|
|
|
+ end
|
|
|
|
+end
|
|
|
|
+
|
|
desc 'export sub files to Twine 2'
|
|
desc 'export sub files to Twine 2'
|
|
-task export: %w(bundle_install storyjs) do
|
|
|
|
|
|
+task export: %w(bundle_install storyjs story.tw2) do
|
|
files.each do |file|
|
|
files.each do |file|
|
|
IO.write file.wrapper_file, <<~EOF
|
|
IO.write file.wrapper_file, <<~EOF
|
|
::StoryTitle
|
|
::StoryTitle
|
|
@@ -64,6 +82,7 @@ task export: %w(bundle_install storyjs) do
|
|
@story_start_name = 'Start #{file.long_name}'
|
|
@story_start_name = 'Start #{file.long_name}'
|
|
Twee2::build_config.story_format = '#{STORY_FORMAT}'
|
|
Twee2::build_config.story_format = '#{STORY_FORMAT}'
|
|
Twee2::build_config.story_format_version = '#{STORY_FORMAT_VERSION}'
|
|
Twee2::build_config.story_format_version = '#{STORY_FORMAT_VERSION}'
|
|
|
|
+ Twee2::build_config.story_ifid = ''
|
|
|
|
|
|
::StoryIncludes
|
|
::StoryIncludes
|
|
images.tw2
|
|
images.tw2
|