rvpacker-txt 1.9.4 → 1.10.0

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: c57413528c8aa902963d9df851562c6dab33d8edbcdd8e19ef2c5dd0a3f5fbf0
4
- data.tar.gz: 0aec862409028ee0f116a2ea98d08104c97bd3027969dd3ac830dbdbcf576c88
3
+ metadata.gz: 5d581405430f6d78e8269bc9f3310903bdc76e889d38c59a67ec6726a6927d33
4
+ data.tar.gz: 8492c8a320492902c0d8696dfcdf9bb1b2191fb6567c92e6086ee143ea6c25a5
5
5
  SHA512:
6
- metadata.gz: 7a31f9ba7db0bd30345637c7701282191d842d053ccf38355331e1375f270fb6558fbfae4b2378174655c8968f5edba97354c2cee05ff580760c260db149c8e9
7
- data.tar.gz: 2af993afb94e8d29705014bba95f655c26eec161da56f5715f9e7a069231e57456cd37b01678bd8de1148ac5f2d5858ff6c5b759902916eeb151569c2de9cc41
6
+ metadata.gz: 3b1cdf8a790a950a7669206356542f41697d3c0389df088ba1482fdd4fa83051c15be5883520d5c26a12f0098563545abc4af3e36970e1c5760d63abda493177
7
+ data.tar.gz: 13a78b005d438e8c3d67543de90bb1c5fccb7bfd7845b7b81f10d7487fcad43d71a61588e494e53e3ce8a4a4f4804f92a95f42932a502ab9129c6b22ec5376d0
data/README.md CHANGED
@@ -37,9 +37,7 @@ OPTIONS:
37
37
  Example: --disable-processing=maps,other,system.
38
38
  [Allowed values: maps, other, system, scripts]
39
39
  --disable-custom-processing Disables built-in custom parsing/writing for some games.
40
- -r, --romanize When reading: If you parsing text from a Japanese game, that contains symbols like 「」,
41
- which are just the Japanese quotation marks, it automatically replaces these symbols by their roman equivalents.
42
- When writing: Use to correctly write files back if you have parsed them with --romanize flag.
40
+ This flag will automatically be used when writing if you parsed game text with it.
43
41
  -l, --log Enables logging.
44
42
  -h, --help Prints the program's help message or for the entered subcommand.
45
43
  ```
data/bin/rvpacker-txt CHANGED
@@ -43,29 +43,22 @@ def self.parse_options
43
43
 
44
44
  banner,
45
45
  input_dir_description,
46
- output_dir_description,
47
- romanize_description =
46
+ output_dir_description, =
48
47
  case options[:action]
49
48
  when 'read'
50
49
  ["#{read_command_description}\n\nOPTIONS:\n",
51
50
  ['Input directory, containing folders "original" or "data" with original game files.'],
52
- ['Output directory, where a "translation" folder will be created, containing parsed .txt files with the text from the game.'],
53
- ['If you parsing text from a Japanese game, that contains symbols like 「」, which are just the Japanese quotation marks,',
54
- 'it automatically replaces these symbols by their roman equivalents.']]
51
+ ['Output directory, where a "translation" folder will be created, containing parsed .txt files with the text from the game.']]
55
52
  when 'write'
56
53
  ["#{write_command_description}\n\nOPTIONS:\n",
57
54
  ['Input directory, containing folders "original" or "data" and "translation" with original game files and .txt files with translation respectively.'],
58
- ['Output directory, where an "output" folder will be created, containing compiled RPG Maker files with your translation.'],
59
- ['Use to correctly write files back if you have parsed them with --romanize flag.']]
55
+ ['Output directory, where an "output" folder will be created, containing compiled RPG Maker files with your translation.']]
60
56
  else
61
57
  [banner_text,
62
58
  ['When reading: Input directory, containing folders "original" or "data" with original game files.',
63
59
  'When writing: Input directory, containing folders "original" or "data" and "translation" with original game files and .txt files with translation respectively.'],
64
60
  ['When reading: Output directory, where a "translation" folder will be created, containing parsed .txt files with the text from the game.',
65
- 'When writing: Output directory, where an "output" folder will be created, containing compiled RPG Maker files with your translation.'],
66
- ['When reading: If you parsing text from a Japanese game, that contains symbols like 「」,',
67
- 'which are just the Japanese quotation marks, it automatically replaces these symbols by their roman equivalents.',
68
- 'When writing: Use to correctly write files back if you have parsed them with --romanize flag.']]
61
+ 'When writing: Output directory, where an "output" folder will be created, containing compiled RPG Maker files with your translation.']]
69
62
  end
70
63
 
71
64
  OptionParser.new(banner) do |cmd|
@@ -92,16 +85,19 @@ def self.parse_options
92
85
  end
93
86
 
94
87
  cmd.on('--disable-custom-processing',
95
- 'Disables built-in custom parsing/writing for some games.') do
88
+ 'Disables built-in custom parsing/writing for some games.',
89
+ 'This flag will automatically be used when writing if you parsed game text with it.') do
96
90
  options[:disable_custom_processing] = true
97
91
  end
98
92
 
99
- cmd.on('-r', '--romanize',
100
- *romanize_description) do
101
- options[:romanize] = true
102
- end
103
-
104
93
  if options[:action] == 'read'
94
+ cmd.on('-r', '--romanize',
95
+ 'If you parsing text from a Japanese game, that contains symbols like 「」,',
96
+ 'which are just the Japanese quotation marks, it automatically replaces these symbols by their roman equivalents.',
97
+ 'This flag will automatically be used when writing if you parsed game text with it.') do
98
+ options[:romanize] = true
99
+ end
100
+
105
101
  cmd.on('-f', '--force',
106
102
  'Force rewrite all files. Cannot be used with --append.',
107
103
  'USE WITH CAUTION!') do
@@ -110,7 +106,7 @@ def self.parse_options
110
106
 
111
107
  cmd.on('-a', '--append',
112
108
  "When the rvpacker-txt or the game which files you've parsed receives an update, you probably should re-read game files with --append,",
113
- ' which will append any new text to your files without overwriting the progress.',
109
+ 'which will append any new text to your files without overwriting the progress.',
114
110
  'Cannot be used with --force.') do
115
111
  raise '--append cannot be used with --force.' if options[:force]
116
112
  options[:append] = true
@@ -170,6 +166,7 @@ force = options[:force]
170
166
  append = options[:append]
171
167
  # @type [Boolean]
172
168
  romanize = options[:romanize]
169
+ # @type [Boolean]
173
170
  silent = options[:silent]
174
171
 
175
172
  extensions = { xp: 'rxdata', vx: 'rvdata', ace: 'rvdata2' }
@@ -179,6 +176,7 @@ raise '"Data" or "original" directory not found within input directory.' unless
179
176
 
180
177
  maps_path = File.join(input_path, 'translation', 'maps')
181
178
  other_path = File.join(input_path, 'translation', 'other')
179
+ metadata_file_path = File.join(input_path, 'translation', '.rvpacker-txt-metadata.marshal')
182
180
 
183
181
  FileUtils.mkdir_p(maps_path)
184
182
  FileUtils.mkdir_p(other_path)
@@ -220,7 +218,7 @@ if options[:action] == 'read'
220
218
  require 'read'
221
219
 
222
220
  processing_mode = if force
223
- unless options[:silent]
221
+ unless silent
224
222
  wait_time_start = Time.now
225
223
 
226
224
  puts "WARNING! You're about to forcefully rewrite all your translation files, including _trans files.",
@@ -237,6 +235,8 @@ if options[:action] == 'read'
237
235
  :default
238
236
  end
239
237
 
238
+ File.binwrite(metadata_file_path, Marshal.dump({ romanize: romanize, disable_custom_processing: disable_custom_processing }))
239
+
240
240
  read_map(maps_files_paths, maps_path, romanize, logging, game_type, processing_mode) unless disable_processing[:maps]
241
241
  read_other(other_files_paths, other_path, romanize, logging, game_type, processing_mode) unless disable_processing[:other]
242
242
  read_system(system_file_path, ini_file_path, other_path, romanize, logging, processing_mode) unless disable_processing[:system]
@@ -247,6 +247,20 @@ else
247
247
  output_path = File.join(output_path, 'output')
248
248
  FileUtils.mkdir_p(output_path)
249
249
 
250
+ if File.exist?(metadata_file_path)
251
+ metadata = Marshal.load(File.binread(metadata_file_path))
252
+
253
+ if metadata[:romanize]
254
+ puts 'Enabling romanize according to the metadata from previous read.'
255
+ romanize = metadata[:romanize]
256
+ end
257
+
258
+ if metadata[:disable_custom_processing] && !game_type.nil?
259
+ puts 'Disabling custom parsing according to the metadata from previous read.'
260
+ game_type = nil
261
+ end
262
+ end
263
+
250
264
  write_map(maps_files_paths, maps_path, output_path, shuffle_level, romanize, logging, game_type) unless disable_processing[:maps]
251
265
  write_other(other_files_paths, other_path, output_path, shuffle_level, romanize, logging, game_type) unless disable_processing[:other]
252
266
  write_system(system_file_path, ini_file_path, other_path, output_path, shuffle_level, romanize, logging) unless disable_processing[:system]
data/lib/extensions.rb CHANGED
@@ -7,13 +7,13 @@ def self.romanize_string(string)
7
7
  case char
8
8
  when '。'
9
9
  string[i] = '.'
10
- when '、'
10
+ when '、', ','
11
11
  string[i] = ','
12
12
  when '・'
13
13
  string[i] = '·'
14
14
  when '゠'
15
15
  string[i] = '–'
16
- when '='
16
+ when '=', 'ー'
17
17
  string[i] = '—'
18
18
  when '…', '‥'
19
19
  string[i, 3] = '...'
@@ -41,6 +41,72 @@ def self.romanize_string(string)
41
41
  string[i] = ':'
42
42
  when '!'
43
43
  string[i] = '!'
44
+ when '※'
45
+ string[i] = '*'
46
+ when 'Ⅰ'
47
+ string[i] = 'I'
48
+ when 'ⅰ'
49
+ string[i] = 'i'
50
+ when 'Ⅱ'
51
+ string[i, 2] = 'II'
52
+ when 'ⅱ'
53
+ string[i, 2] = 'ii'
54
+ when 'Ⅲ'
55
+ string[i, 3] = 'III'
56
+ when 'ⅲ'
57
+ string[i, 3] = 'iii'
58
+ when 'Ⅳ'
59
+ string[i, 2] = 'IV'
60
+ when 'ⅳ'
61
+ string[i, 2] = 'iv'
62
+ when 'Ⅴ'
63
+ string[i] = 'V'
64
+ when 'ⅴ'
65
+ string[i] = 'v'
66
+ when 'Ⅵ'
67
+ string[i, 2] = 'VI'
68
+ when 'ⅵ'
69
+ string[i, 2] = 'vi'
70
+ when 'Ⅶ'
71
+ string[i, 3] = 'VII'
72
+ when 'ⅶ'
73
+ string[i, 3] = 'vii'
74
+ when 'Ⅷ'
75
+ string[i, 4] = 'VIII'
76
+ when 'ⅷ'
77
+ string[i, 4] = 'viii'
78
+ when 'Ⅸ'
79
+ string[i, 2] = 'IX'
80
+ when 'ⅸ'
81
+ string[i, 2] = 'ix'
82
+ when 'Ⅹ'
83
+ string[i] = 'X'
84
+ when 'ⅹ'
85
+ string[i] = 'x'
86
+ when 'Ⅺ'
87
+ string[i, 2] = 'XI'
88
+ when 'ⅺ'
89
+ string[i, 2] = 'xi'
90
+ when 'Ⅻ'
91
+ string[i, 3] = 'XII'
92
+ when 'ⅻ'
93
+ string[i, 3] = 'xii'
94
+ when 'Ⅼ'
95
+ string[i] = 'L'
96
+ when 'ⅼ'
97
+ string[i] = 'l'
98
+ when 'Ⅽ'
99
+ string[i] = 'C'
100
+ when 'ⅽ'
101
+ string[i] = 'c'
102
+ when 'Ⅾ'
103
+ string[i] = 'D'
104
+ when 'ⅾ'
105
+ string[i] = 'd'
106
+ when 'Ⅿ'
107
+ string[i] = 'M'
108
+ when 'ⅿ'
109
+ string[i] = 'm'
44
110
  else
45
111
  nil
46
112
  end
data/lib/read.rb CHANGED
@@ -3,7 +3,7 @@
3
3
  require 'zlib'
4
4
  require_relative 'extensions'
5
5
 
6
- STRING_IS_ONLY_SYMBOLS_RE = /^[.()+-:;\[\]^~%&!*\/→×??x%▼| ]+$/
6
+ STRING_IS_ONLY_SYMBOLS_RE = /^[.()+\-:;\[\]^~%&!№$@`*\/→×??x%▼|♥♪!:〜『』「」〽。…‥=゠、,【】[]{}()〔〕⦅⦆〘〙〈〉《》・\\#'"<>=_ー※▶ⅠⅰⅡⅱⅢⅲⅣⅳⅤⅴⅥⅵⅦⅶⅧⅷⅨⅸⅩⅹⅪⅺⅫⅻⅬⅼⅭⅽⅮⅾⅯⅿ\s]+$/
7
7
  APPEND_FLAG_OMIT_MSG = "Files aren't already parsed. Continuing as if --append flag was omitted."
8
8
 
9
9
  class Hash
@@ -76,41 +76,65 @@ end
76
76
  def self.parse_parameter(code, parameter, game_type)
77
77
  return nil if parameter.match?(STRING_IS_ONLY_SYMBOLS_RE)
78
78
 
79
+ ends_with_if = parameter[/ if\(.*\)$/]
80
+ parameter = parameter.chomp(ends_with_if) if ends_with_if
81
+
79
82
  unless game_type.nil?
80
- case code
81
- when 401, 405
82
- case game_type
83
- when 'lisa'
84
- match = parameter.scan(/^\\et\[[0-9]+\]/)
85
- match = parameter.scan(/^\\nbt/) if match.empty?
86
- parameter = parameter[match[0].length..] unless match.empty?
83
+ case game_type
84
+ when 'lisa'
85
+ case code
86
+ when 401, 405
87
+ prefix = parameter[/^(\\et\[[0-9]+\]|\\nbt)/]
88
+ parameter = parameter.sub(prefix, '') if prefix
89
+ when 102
90
+ # Implement some custom parsing
91
+ when 356
92
+ # Implement some custom parsing
87
93
  else
88
- nil
94
+ return nil
89
95
  end
90
- when 102
91
- # Implement some custom parsing
92
- when 356
93
- # Implement some custom parsing
96
+ # Implement cases for other games
94
97
  else
95
- return nil
98
+ nil
96
99
  end
100
+
97
101
  end
98
102
 
99
103
  parameter
100
104
  end
101
105
 
102
106
  # @param [String] variable
107
+ # @param [Integer] type
103
108
  # @param [String] _game_type
104
109
  # @return [String]
105
- def self.parse_variable(variable, _game_type)
106
- return nil if variable.match?(STRING_IS_ONLY_SYMBOLS_RE)
107
- variable = variable.gsub(/\r?\n/, '\#') if variable.count("\n").positive?
110
+ def self.parse_variable(variable, type, _game_type)
111
+ variable = variable.gsub(/\r?\n/, '\#')
112
+ return nil if variable.match?(STRING_IS_ONLY_SYMBOLS_RE) # for some reason it returns true if multi-line string contains carriage returns (wtf?)
113
+
114
+ only_html_elements = true
115
+
116
+ variable.split('\#').each do |line|
117
+ unless line.strip.match?(/^(#? ?<.*>\.?)$|^$/)
118
+ only_html_elements = false
119
+ break
120
+ end
121
+ end
122
+
123
+ return nil if only_html_elements
108
124
 
109
- return nil if variable.split('\#').all? { |line| line.strip.match?(/(^#? ?<.*>\.?$)|^$/) }
110
125
  return nil if variable.match?(/^[+-]?[0-9]*$/) ||
111
126
  variable.match?(/---/) ||
112
127
  variable.match?(/restrict eval/)
113
128
 
129
+ case type
130
+ when 0 # name
131
+ when 1 # nickname
132
+ when 2 # description
133
+ when 3 # note
134
+ else
135
+ nil
136
+ end
137
+
114
138
  variable
115
139
  end
116
140
 
@@ -326,13 +350,13 @@ def self.read_other(other_files_paths, output_path, romanize, logging, game_type
326
350
  description = object.description
327
351
  note = object.note
328
352
 
329
- [name, nickname, description, note].each do |variable|
353
+ [name, nickname, description, note].each_with_index do |variable, type|
330
354
  next unless variable.is_a?(String)
331
355
 
332
356
  variable = variable.strip
333
357
  next if variable.empty?
334
358
 
335
- parsed = parse_variable(variable, game_type)
359
+ parsed = parse_variable(variable, type, game_type)
336
360
  next if parsed.nil?
337
361
 
338
362
  parsed = parsed.gsub(/\r?\n/, '\#')
@@ -395,35 +419,44 @@ def self.read_other(other_files_paths, output_path, romanize, logging, game_type
395
419
  subparameter = subparameter.strip
396
420
  next if subparameter.empty?
397
421
 
398
- subparameter = romanize_string(subparameter) if romanize
422
+ parsed = parse_parameter(code, subparameter, game_type)
423
+ next if parsed.nil?
424
+
425
+ parsed = romanize_string(parsed) if romanize
399
426
 
400
- other_translation_map.insert_at_index(other_lines.length, subparameter, '') if inner_processing_type == :append &&
401
- !other_translation_map.include?(subparameter)
427
+ other_translation_map.insert_at_index(other_lines.length, parsed, '') if inner_processing_type == :append &&
428
+ !other_translation_map.include?(parsed)
402
429
 
403
- other_lines.add(subparameter)
430
+ other_lines.add(parsed)
404
431
  end
405
432
  elsif parameters[0].is_a?(String)
406
433
  parameter = parameters[0].strip
407
434
  next if parameter.empty?
408
435
 
409
- parameter = parameter.gsub(/\r?\n/, '\#')
410
- parameter = romanize_string(parameter) if romanize
436
+ parsed = parse_parameter(code, parameter, game_type)
437
+ next if parsed.nil?
411
438
 
412
- other_translation_map.insert_at_index(other_lines.length, parameter, '') if inner_processing_type == :append &&
413
- !other_translation_map.include?(parameter)
439
+ parsed = parsed.gsub(/\r?\n/, '\#')
440
+ parsed = romanize_string(parsed) if romanize
414
441
 
415
- other_lines.add(parameter)
442
+ other_translation_map.insert_at_index(other_lines.length, parsed, '') if inner_processing_type == :append &&
443
+ !other_translation_map.include?(parsed)
444
+
445
+ other_lines.add(parsed)
416
446
  elsif parameters[1].is_a?(String)
417
447
  parameter = parameters[1].strip
418
448
  next if parameter.empty?
419
449
 
420
- parameter = parameter.gsub(/\r?\n/, '\#')
421
- parameter = romanize_string(parameter) if romanize
450
+ parsed = parse_parameter(code, parameter, game_type)
451
+ next if parsed.nil?
452
+
453
+ parsed = parsed.gsub(/\r?\n/, '\#')
454
+ parsed = romanize_string(parsed) if romanize
422
455
 
423
- other_translation_map.insert_at_index(other_lines.length, parameter, '') if inner_processing_type == :append &&
424
- !other_translation_map.include?(parameter)
456
+ other_translation_map.insert_at_index(other_lines.length, parsed, '') if inner_processing_type == :append &&
457
+ !other_translation_map.include?(parsed)
425
458
 
426
- other_lines.add(parameter)
459
+ other_lines.add(parsed)
427
460
  end
428
461
  end
429
462
  end
@@ -653,7 +686,7 @@ def self.read_scripts(scripts_file_path, output_path, romanize, logging, process
653
686
  string.match?(/^(.)\1{2,}$/) ||
654
687
  string.match?(/^(false|true)$/) ||
655
688
  string.match?(/^[wr]b$/) ||
656
- string.match?(/^(?=.*\d)[A-Za-z0-9\-]+$/) ||
689
+ string.match?(/^(?=.*\d)[A-Za-z0-9-]+$/) ||
657
690
  string.match?(/^[a-z\-()\/ +'&]*$/) ||
658
691
  string.match?(/^[A-Za-z]+[+-]$/) ||
659
692
  string.match?(STRING_IS_ONLY_SYMBOLS_RE) ||
data/lib/write.rb CHANGED
@@ -74,52 +74,58 @@ end
74
74
  # @param [Hash{String => String}] hashmap Translation hashmap (as everything in Ruby passed by reference, this pass is free!)
75
75
  # @param [String] game_type
76
76
  def self.get_parameter_translated(code, parameter, hashmap, game_type)
77
+ ends_with_if = parameter[/ if\(.*\)$/]
78
+ parameter = parameter.chomp(ends_with_if) if ends_with_if
79
+
77
80
  unless game_type.nil?
78
- lisa_start = nil
79
-
80
- case code
81
- when 401, 405
82
- case game_type
83
- when 'lisa'
84
- match = parameter.scan(/^\\et\[[0-9]+\]/)
85
- match = parameter.scan(/^\\nbt/) if match.empty?
86
-
87
- unless match.empty?
88
- lisa_start = match[0]
89
- parameter = parameter.slice((match[0].length)..)
90
- end
81
+ case game_type
82
+ when 'lisa'
83
+ case code
84
+ when 401, 405
85
+ prefix = parameter[/^(\\et\[[0-9]+\]|\\nbt)/]
86
+ parameter = parameter.sub(prefix, '') if prefix
87
+
88
+ translated = hashmap[parameter]
89
+ return nil if translated.nil? || translated.empty?
90
+
91
+ translated = prefix + translated if prefix
92
+ return translated
93
+ when 102, 402
94
+ # Implement some custom parsing
95
+ when 356
96
+ # Implement some custom parsing
91
97
  else
92
98
  nil
93
99
  end
94
- when 102, 402
95
- # Implement some custom parsing
96
- when 356
97
- # Implement some custom parsing
98
- else
99
- nil
100
- end
101
-
102
- gotten = hashmap[parameter]
103
- return nil if gotten.nil?
104
-
105
- case game_type
106
- when 'lisa'
107
- gotten = lisa_start + gotten unless lisa_start.nil?
100
+ # Implement cases for other games
108
101
  else
109
102
  nil
110
103
  end
111
-
112
- return gotten
113
104
  end
114
105
 
115
- hashmap[parameter]
106
+ translated = hashmap[parameter]
107
+ return nil if translated.nil? || translated.empty?
108
+ translated += ends_with_if if ends_with_if
109
+ translated
116
110
  end
117
111
 
118
112
  # @param [String] variable
113
+ # # @param [Integer] type
119
114
  # @param [Hash{String => String}] hashmap Translation hashmap (as everything in Ruby passed by reference, this pass is free!)
120
115
  # @param [String] _game_type
121
116
  # @return [String]
122
- def self.get_variable_translated(variable, hashmap, _game_type)
117
+ def self.get_variable_translated(variable, type, hashmap, _game_type)
118
+ variable = variable.gsub(/\r?\n/, "\n")
119
+
120
+ case type
121
+ when 0 # name
122
+ when 1 # nickname
123
+ when 2 # description
124
+ when 3 # note
125
+ else
126
+ nil
127
+ end
128
+
123
129
  hashmap[variable]
124
130
  end
125
131
 
@@ -208,7 +214,9 @@ def self.write_map(original_files_paths, maps_path, output_path, shuffle_level,
208
214
  list[index].parameters[0] = i < split_length ? split[i] : ''
209
215
  end
210
216
 
211
- list[item_indices.last].parameters[0] = split[line_length..].join("\n") if split_length > line_length
217
+ if split_length > line_length
218
+ list[item_indices.last].parameters[0] = split[line_length..].join("\n")
219
+ end
212
220
  end
213
221
  end
214
222
  next
@@ -313,23 +321,21 @@ def self.write_other(original_files_paths, other_path, output_path, shuffle_leve
313
321
  description = object.description
314
322
  note = object.note
315
323
 
316
- [name, nickname, description, note].each_with_index do |variable, i|
324
+ [name, nickname, description, note].each_with_index do |variable, type|
317
325
  next unless variable.is_a?(String)
318
326
 
319
327
  variable = variable.strip
320
328
  next if variable.empty?
321
329
 
322
- variable = variable.gsub(/\r\n/, "\n")
323
330
  variable = romanize_string(variable) if romanize
324
-
325
- translated = get_variable_translated(variable, other_translation_map, game_type)
331
+ translated = get_variable_translated(variable, type, other_translation_map, game_type)
326
332
 
327
333
  unless translated.nil? || translated.empty?
328
- if i.zero?
334
+ if type.zero?
329
335
  object.name = translated
330
- elsif i == 1
336
+ elsif type == 1
331
337
  object.nickname = translated if object.is_a?(RPG::Actor)
332
- elsif i == 2
338
+ elsif type == 2
333
339
  object.description = translated
334
340
  else
335
341
  object.note = translated
@@ -372,7 +378,9 @@ def self.write_other(original_files_paths, other_path, output_path, shuffle_leve
372
378
  list[index].parameters[0] = i < split_length ? split[i] : ''
373
379
  end
374
380
 
375
- list[item_indices.last].parameters[0] = split[line_length..].join("\n") if split_length > line_length
381
+ if split_length > line_length
382
+ list[item_indices.last].parameters[0] = split[line_length..].join("\n")
383
+ end
376
384
  end
377
385
  end
378
386
  next
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.9.4'
5
+ spec.version = '1.10.0'
6
6
  spec.authors = ['Howard Jeng', 'Andrew Kesterson', 'Solistra', 'Darkness9724', 'savannstm']
7
7
  spec.email = ['savannstm@gmail.com']
8
8
  spec.summary = 'Reads RPG Maker XP/VX/VXAce game text to .txt files and writes them to their initial form.'
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.9.4
4
+ version: 1.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Howard Jeng
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2024-07-26 00:00:00.000000000 Z
15
+ date: 2024-07-27 00:00:00.000000000 Z
16
16
  dependencies: []
17
17
  description:
18
18
  email: