sscharter 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4e016849d4638b4a228dbefaf3d770a571c52b5d23b8a7a4e19c344f6fd91d9e
4
- data.tar.gz: 7210246753c60a6f5873ae82ba9d9abdcea3e8301b08ba92ab6231f01060ef9a
3
+ metadata.gz: e26848981238d761f60a4786887aa548f502cd3368ac7eb1f7519ce3de0c45c4
4
+ data.tar.gz: 7cc0a9f86404d13634c0cdd5c693efd70bc25da2f6683b70c8f51c304ea4254e
5
5
  SHA512:
6
- metadata.gz: d79d0dd40fa573ea967223a8e5573f48e9e019374cfc294070efff83fe71f6732fdbaa81ce3f249987a9875e41fdeb2424f5ff6eac6fb9a16ca8c8769b30cc61
7
- data.tar.gz: 87f8f7e56ef2ecc61e07fc09d35baad818b6105e5ea193766c5599c1041fd936b877f8e3f1173f0ec13f39d178bf09911893a43b958d1b21f58bebb7d1810c4a
6
+ metadata.gz: 2f63c492ff1d26eeba0b259f1e644fd5c848f1a578624198f085a142242094211d89ab91e2087466f8ee7a74093e311a73ba4d076d427830bbeffad43dbdc153
7
+ data.tar.gz: 6f80c45d548c2ad1509fd0854226343f4da2bca7f407019c517c525244b9d1ba7b0d0890bbf94938e92ecc55728dd500db828003c3668bcca80e6c1bbeca6745
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sscharter (0.3.0)
4
+ sscharter (0.4.0)
5
5
  filewatcher (~> 2.0)
6
6
  launchy (~> 2.5)
7
7
  rubyzip (~> 2.3)
data/lib/sscharter/cli.rb CHANGED
@@ -176,10 +176,11 @@ module Sunniesnow::Charter::CLI
176
176
  port = port.to_i
177
177
  config = self.config
178
178
  server = WEBrick::HTTPServer.new Port: port, DocumentRoot: config[:build_dir]
179
- server.mount_proc "/#{config[:project_name]}.ssc" do |request, response|
180
- response['Content-Type'] = 'application/zip'
179
+ def server.service request, response
180
+ super
181
181
  response['Access-Control-Allow-Origin'] = '*'
182
- response.body = File.read File.join(config[:build_dir], "#{config[:project_name]}.ssc"), binmode: true
182
+ response['Cache-Control'] = 'no-cache'
183
+ response['Content-Type'] = 'application/zip' if request.path.end_with? '.ssc'
183
184
  end
184
185
  url = CGI.escape "http://localhost:#{port}/#{config[:project_name]}.ssc"
185
186
  filewatcher = Filewatcher.new [config[:files_dir], config[:sources_dir], *config[:include]]
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Sunniesnow
4
4
  class Charter
5
- VERSION = "0.3.0"
5
+ VERSION = "0.4.0"
6
6
  end
7
7
  end
data/lib/sscharter.rb CHANGED
@@ -496,16 +496,17 @@ class Sunniesnow::Charter
496
496
  events.each { transform.apply _1 }
497
497
  end
498
498
 
499
- def duplicate events
499
+ def duplicate events, new_tip_points: true
500
500
  result = []
501
501
  events.each do |event|
502
+ next if event.type == :placeholder && !new_tip_points
502
503
  result.push event = event.dup
503
- if event[:tip_point]
504
+ if event[:tip_point] && new_tip_points
504
505
  event[:tip_point] = "#@current_duplicate #{event[:tip_point]}"
505
506
  end
506
507
  @groups.each { _1.push event }
507
508
  end
508
- @current_duplicate += 1
509
+ @current_duplicate += 1 if new_tip_points
509
510
  result
510
511
  end
511
512
 
@@ -556,7 +557,15 @@ class Sunniesnow::Charter
556
557
  end
557
558
  alias f flick
558
559
 
559
- def bg_note x, y, duration_beats = 0, text = ''
560
+ def bg_note x, y, duration_beats = 0, text = nil
561
+ if text.nil?
562
+ if duration_beats.is_a? String
563
+ text = duration_beats
564
+ duration_beats = 0
565
+ else
566
+ text = ''
567
+ end
568
+ end
560
569
  if !x.is_a?(Numeric) || !y.is_a?(Numeric) || !duration_beats.is_a?(Numeric)
561
570
  raise ArgumentError, 'x, y, and duration_beats must be numbers'
562
571
  end
data/tutorial/tutorial.md CHANGED
@@ -1009,11 +1009,21 @@ You may build the level file and play it on Sunniesnow to see what you have done
1009
1009
 
1010
1010
  ![Second chart](https://i.imgur.com/ksu5sVW.png)
1011
1011
 
1012
- *Notice*:
1013
1012
  When duplicating tip-pointed events,
1014
1013
  the duplicated events are not connected by the same tip point as the original events.
1015
1014
  However, if two original events are connected by the same tip point,
1016
1015
  their duplicates are also connected by the same tip point, too.
1016
+ If you want the duplicated events to be connected by the same tip point as the original events,
1017
+ you can add set the keyword argument `new_tip_points:` to `false` in the call of `duplicate`:
1018
+
1019
+ ```ruby
1020
+ notes = tp_chain 0, 100, speed: 100 do
1021
+ # notes...
1022
+ end
1023
+ transform duplicate notes, new_tip_points: false do
1024
+ # transforms...
1025
+ end
1026
+ ```
1017
1027
 
1018
1028
  ## Advanced charting techniques
1019
1029
 
@@ -1027,7 +1037,7 @@ TODO.
1027
1037
 
1028
1038
  ### Tip points and placeholders
1029
1039
 
1030
- ### Multiple offsets
1040
+ ### Multiple offsets and timing tweaking
1031
1041
 
1032
1042
  ### JSON post-processing
1033
1043
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sscharter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ulysses Zhan
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-09-15 00:00:00.000000000 Z
11
+ date: 2023-09-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubyzip