rvpacker-txt 1.8.0 → 1.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2668e8728bac13732103b447b33f2a3e3b699f408e6e214255abb7a0fa4718c1
4
- data.tar.gz: 9214274068189272243df485f52d0d53063316a749590e7f1e708f05613cfeca
3
+ metadata.gz: fa47130be6188bd6cc7e662a705d3967640b9c20d359d6f1004cd8f87567c6fa
4
+ data.tar.gz: 73107db4657b4f2790c6b1bbcbec6784c244729218eb9b0a26565a2371b3f985
5
5
  SHA512:
6
- metadata.gz: 9c646537c1a24ee6341e3d2904c952644bd78054f17d624d21c69627b3972c9741a3989bf8b4ae711f8ebb592ddadfc1d52da3b52faacecd875f031fc1f839f3
7
- data.tar.gz: 480402b6423c51245cb431f7fba7324f2895b79f5c3d13ab8f38614a1d3aad026e3f6eabe74b0d2a2992df3f695f81bf91a5f05c93c2566d3f480111a4bdcdf9
6
+ metadata.gz: 1ca284ed2546b82c36113e324c246af68d3f61f7365ee8a37dd6559dba81ef612027160e957935435e20532c36fe184ad4cb791bc389fb8f6a607f84eb489537
7
+ data.tar.gz: 578030edf1a599864badba6f4ae5ba889d721aa5644731a7a462c438023fb5f5795543c7ccafd3468e8140243767523eb0dad8fecbfe5eafc42dae3fbaaa5f87
data/lib/read.rb CHANGED
@@ -26,7 +26,7 @@ def self.extract_quoted_strings(string)
26
26
  stripped = line.strip
27
27
 
28
28
  next if stripped[0] == '#' ||
29
- !stripped.match?(/["']/) ||
29
+ (!in_quotes && !stripped.match?(/["']/)) ||
30
30
  stripped.start_with?(/(Win|Lose)|_Fanfare/) ||
31
31
  stripped.match?(/eval\(/)
32
32
 
@@ -35,8 +35,6 @@ def self.extract_quoted_strings(string)
35
35
 
36
36
  next if skip_block
37
37
 
38
- buffer.push('\#') if in_quotes
39
-
40
38
  line.each_char do |char|
41
39
  if %w[' "].include?(char)
42
40
  unless quote_type.nil? || char == quote_type
@@ -51,7 +49,16 @@ def self.extract_quoted_strings(string)
51
49
  next
52
50
  end
53
51
 
54
- buffer.push(char) if in_quotes
52
+ if in_quotes
53
+ if char == "\r"
54
+ next
55
+ elsif char == "\n"
56
+ buffer.push('\#')
57
+ next
58
+ end
59
+
60
+ buffer.push(char)
61
+ end
55
62
  end
56
63
  end
57
64
 
@@ -147,9 +154,8 @@ def self.read_map(maps_files_paths, output_path, logging, game_type, processing_
147
154
 
148
155
  # 401 - dialogue lines
149
156
  # 102 - dialogue choices array
150
- # 402 - one of the dialogue choices from the array
151
157
  # 356 - system lines/special texts (do they even exist before mv?)
152
- allowed_codes = [401, 102, 402, 356].freeze
158
+ allowed_codes = [401, 102, 356].freeze
153
159
 
154
160
  maps_object_map.each do |filename, object|
155
161
  display_name = object.display_name
@@ -276,9 +282,8 @@ def self.read_other(other_files_paths, output_path, logging, game_type, processi
276
282
  # 401 - dialogue lines
277
283
  # 405 - credits lines
278
284
  # 102 - dialogue choices array
279
- # 402 - one of the dialogue choices from the array
280
285
  # 356 - system lines/special texts (do they even exist before mv?)
281
- allowed_codes = [401, 405, 102, 402, 356].freeze
286
+ allowed_codes = [401, 405, 102, 356].freeze
282
287
 
283
288
  other_object_array_map.each do |filename, other_object_array|
284
289
  processed_filename = File.basename(filename, '.*').downcase
@@ -310,7 +315,7 @@ def self.read_other(other_files_paths, output_path, logging, game_type, processi
310
315
  next if object.nil?
311
316
 
312
317
  name = object.name
313
- nickname = object.nickname
318
+ nickname = object.nickname if object.is_a?(RPG::Actor)
314
319
  description = object.description
315
320
  note = object.note
316
321
 
data/lib/write.rb CHANGED
@@ -300,7 +300,7 @@ def self.write_other(original_files_paths, other_path, output_path, shuffle_leve
300
300
  next if object.nil?
301
301
 
302
302
  name = object.name
303
- nickname = object.nickname
303
+ nickname = object.nickname if object.is_a?(RPG::Actor)
304
304
  description = object.description
305
305
  note = object.note
306
306
 
@@ -317,7 +317,7 @@ def self.write_other(original_files_paths, other_path, output_path, shuffle_leve
317
317
  if i.zero?
318
318
  object.name = translated
319
319
  elsif i == 1
320
- object.nickname = translated
320
+ object.nickname = translated if object.is_a?(RPG::Actor)
321
321
  elsif i == 2
322
322
  object.description = translated
323
323
  else
data/rvpacker-txt.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = 'rvpacker-txt'
5
- spec.version = '1.8.0'
5
+ spec.version = '1.8.2'
6
6
  spec.authors = ['Howard Jeng', 'Andrew Kesterson', 'Solistra', 'Darkness9724', 'savannstm']
7
7
  spec.email = ['savannstm@gmail.com']
8
8
  spec.summary = 'Reads or writes RPG Maker XP/VX/VXAce game text to .txt files'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rvpacker-txt
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.0
4
+ version: 1.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Howard Jeng