Sfoglia il codice sorgente

bugfixes/cleanup include STORY_FORMAT_VERSION in third party software page

Ruduki2 5 anni fa
parent
commit
269db0ddaf
3 ha cambiato i file con 20 aggiunte e 9 eliminazioni
  1. 15 7
      Rakefile
  2. 3 2
      main.tw2
  3. 2 0
      storyjs.tw2

+ 15 - 7
Rakefile

@@ -24,21 +24,29 @@ def files
   end
 end
 
-task develop: %w(bundle_install) do
+task develop: %w(bundle_install storyjs) do
   sh "bundle exec twee2 build '--format=#{STORY_FORMAT_PATH}' main.tw2 develop.html"
 end
 
-task watch: %w(bundle_install) do
+task watch: %w(bundle_install storyjs) do
   sh 'start watch.html'  # FIXME non-windows
-  sh "bundle exec twee2 watch main.tw2 watch.html"
+  sh "bundle exec twee2 watch '--format=#{STORY_FORMAT_PATH}'  main.tw2 watch.html"
 end
 
-task release: %w(bundle_install) do
-  sh "bundle exec twee2 build main.tw2 release.html"
+task release: %w(bundle_install storyjs) do
+  sh "bundle exec twee2 build '--format=#{STORY_FORMAT_PATH}' main.tw2 release.html"
+end
+
+task :storyjs do
+  File.write(
+    'storyjs.tw2', 
+    File.read('storyjs.tw2')\
+      .sub(/\$STORY_FORMAT_VERSION = '[^']*'/, "$STORY_FORMAT_VERSION = '#{STORY_FORMAT_VERSION}'")
+  )
 end
 
 desc 'export sub files to Twine 2'
-task export: %w(bundle_install) do
+task export: %w(bundle_install storyjs) do
   files.each do |file|
     IO.write file.wrapper_file, <<~EOF
       ::StoryTitle
@@ -48,7 +56,7 @@ task export: %w(bundle_install) do
       @story_start_name = 'Start #{file.long_name}'
       Twee2::build_config.story_format = '#{STORY_FORMAT}'
       Twee2::build_config.story_format_version = '#{STORY_FORMAT_VERSION}'
-
+      
       ::StoryIncludes
       images.tw2
       stylesheet.tw2

+ 3 - 2
main.tw2

@@ -128,7 +128,8 @@ This license does not apply to [[Third-Party Software]]
 ::Third-Party Software <801,199>
 This Interactive Story was created with Twine 2.x
 
-The Story format used was Sugarcube 2.x
+The Story format used was <a href="https://www.motoslave.net/sugarcube/2/">Sugarcube 2.x</a>
+SugarCube 2 version: $STORY_FORMAT_VERSION
 
 Several 3rd-party Sugarcube 2.x plugins were used:
 
@@ -137,8 +138,8 @@ Several 3rd-party Sugarcube 2.x plugins were used:
 - Bleached Stylesheet
 - &lt;&lt;cyclinklink>> macro (also variants &lt;&lt;cyclinklinka>> and  &lt;&lt;cyclinklinkd>>)
 
+Other Javascript
 - isEquivelant function taken from  http://adripofjavascript.com/blog/drips/object-equality-in-javascript.html
-- &lt;&lt;cyclinklink>> macro (also variants &lt;&lt;cyclinklinka>> and  <<cyclinklinkd>>)
 
 Graphics Used
 - Pink Bikini favicon by Flaticon.

+ 2 - 0
storyjs.tw2

@@ -201,6 +201,8 @@ window.myutils.isEqual = function isEqual(a, b) {
 
 ::StoryInit <1304,233>
 <<set
+	$STORY_FORMAT_VERSION = '2.28.2'
+	
 	//Clothing
 	$current_top = 't-shirt'
 	$current_bottom = 'jeans'