rvpacker-txt 1.5.1 → 1.5.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: e3cdabd3e6867b3a5736a998345b2df35273565179c720c03acfb294bb121644
4
- data.tar.gz: dd8ebfa554210a573d6aceef337ae4009759828a6fa53f5d19ad412c936165d0
3
+ metadata.gz: 7f8d16cb7960ca2c4494b2b2e1c414114404403dac94acd7a7adeac4e7c24e12
4
+ data.tar.gz: dc10d4e2abdcbd70b8f4af452215d1540a5e7ab0775202fdca04ee28726c1e7c
5
5
  SHA512:
6
- metadata.gz: 6146633f8ac594f5db5cdc7b9fd1914c3e011e242531f943c2dbcad48c00ee8bda79f06511db125e588be4cc6c6869e3c9bfccc24a7c1820418d4cd7688f5c6d
7
- data.tar.gz: db7a233da1abe10a24c0c5180a06f022f46cf07685e33e3a7081ac8dc5082210c14042f7605482c7d5ad99a4efabad870a01c55e0efac3f3ec8249aec998d888
6
+ metadata.gz: 9921e7a66d63e4784b5679329b0c7d02112396976c2ea9febbae7b21eff78e951dcb47f4ecf4eddc8b133af0790005f7acd50ccb49c1a1663662daa4b71eb7a2
7
+ data.tar.gz: 823cfe0171387ff3001b7bc6876fac636817d1b67cf6b0d5b23afe860b69635c7e2fe796ae24e7e1da7b7816c3e51daf4098cbb13a16b07801f99640bcd7c131
data/bin/rvpacker-txt CHANGED
@@ -23,7 +23,7 @@ def self.parse_options
23
23
  options[:output_dir] = File.exist?(dir) ? File.realpath(dir) : (raise "#{dir} not found")
24
24
  end
25
25
 
26
- cmd.on('--disable-processing FILES', Array, 'Don\'t process specified files (maps, other, system, plugins)') do |files|
26
+ cmd.on('--disable-processing FILES', Array, "Don't process specified files (maps, other, system, plugins)") do |files|
27
27
  files.each do |file|
28
28
  index = %w[maps other system scripts].index(file)
29
29
  options[:disable_processing][index] = true if index
@@ -34,7 +34,7 @@ def self.parse_options
34
34
  options[:shuffle_level] = num
35
35
  end
36
36
 
37
- cmd.on('--disable_custom_processing', 'Disables built-in custom parsing/writing for some games') do
37
+ cmd.on('--disable-custom-processing', 'Disables built-in custom parsing/writing for some games') do
38
38
  options[:disable_custom_processing] = true
39
39
  end
40
40
 
@@ -42,11 +42,11 @@ def self.parse_options
42
42
  options[:logging] = true
43
43
  end
44
44
 
45
- cmd.on('-f', '--force', 'Force rewrite all files. Cannot be used with --append.', 'USE WITH CAUTION!') do
45
+ cmd.on('-f', '--force', 'Force rewrite all files. Cannot be used with --append', 'USE WITH CAUTION!') do
46
46
  options[:force] = true
47
47
  end
48
48
 
49
- cmd.on('-a', '--append', 'When you update the rvpacker-txt, you probably should re-read your files with append, as some new text might be added to parser.', 'Cannot be used with --force') do
49
+ cmd.on('-a', '--append', 'When you update the rvpacker-txt, you probably should re-read', 'your files with append, as some new text might be added to parser', 'Cannot be used with --force') do
50
50
  raise '--append cannot be used beside --force.' if options[:force]
51
51
  options[:append] = true
52
52
  end
@@ -156,4 +156,4 @@ end
156
156
  $wait_time = 0 if $wait_time.nil?
157
157
  end_time = Time.now - start_time - wait_time - $wait_time
158
158
 
159
- puts "Done in #{end_time}"
159
+ puts "Done in #{end_time}"
data/lib/read.rb CHANGED
@@ -392,7 +392,7 @@ def self.read_system(system_file_path, ini_file_path, output_path, logging, proc
392
392
  system_trans_output_path = File.join(output_path, "#{system_basename}_trans.txt")
393
393
 
394
394
  if processing_type == 'default' && File.exist?(system_trans_output_path)
395
- puts "system_trans.txt file already exists. If you want to forcefully re-read all files, use --force flag, or --append if you want append new text to already existing files."
395
+ puts 'system_trans.txt file already exists. If you want to forcefully re-read all files, use --force flag, or --append if you want append new text to already existing files.'
396
396
  return
397
397
  end
398
398
 
@@ -416,7 +416,6 @@ def self.read_system(system_file_path, ini_file_path, output_path, logging, proc
416
416
  armor_types = system_object.instance_variable_get(:@armor_types)
417
417
  currency_unit = system_object.instance_variable_get(:@currency_unit)
418
418
  terms = system_object.instance_variable_get(:@terms) || system_object.instance_variable_get(:@words)
419
- game_title = system_object.instance_variable_get(:@game_title)
420
419
 
421
420
  [elements, skill_types, weapon_types, armor_types].each do |array|
422
421
  next if array.nil?
@@ -466,41 +465,17 @@ def self.read_system(system_file_path, ini_file_path, output_path, logging, proc
466
465
  end
467
466
  end
468
467
 
468
+ # Game title from System file and ini file may differ, but requesting user request to determine which line do they want is LAME
469
+ # So just throw that ini ass and continue
470
+ _game_title = system_object.instance_variable_get(:@game_title)
469
471
  ini_game_title = read_ini_title(ini_file_path)
470
472
 
471
- $wait_time = 0
472
-
473
- if ini_game_title != game_title
474
- if game_title.is_a?(String) && !game_title.empty?
475
- wait_time_start = Time.now
476
-
477
- puts "Game title from the Game.ini file and game title from the System file are different.\nWhich game title would you like to parse?\n(That doesn't affect anything major, just when you'll write the game back, translated game title will be applied both to the .ini and System file.)\n0, System title - #{game_title}\n1, Game.ini title - #{ini_game_title}"
478
- choice = gets.chomp.to_i
479
-
480
- $wait_time = Time.now - wait_time_start
481
-
482
- if choice == 0
483
- if processing_type == 'append' && !system_translation_map.include?(game_title)
484
- insert_at_index(system_translation_map, system_lines.length, game_title, '')
485
- end
486
-
487
- system_lines.add(game_title)
488
- else
489
- if processing_type == 'append' && !system_translation_map.include?(ini_game_title)
490
- insert_at_index(system_translation_map, system_lines.length, ini_game_title, '')
491
- end
492
-
493
- system_lines.add(ini_game_title)
494
- end
495
- else
496
- if processing_type == 'append' && !system_translation_map.include?(ini_game_title)
497
- insert_at_index(system_translation_map, system_lines.length, ini_game_title, '')
498
- end
499
-
500
- system_lines.add(ini_game_title)
501
- end
473
+ if processing_type == 'append' && !system_translation_map.include?(ini_game_title)
474
+ insert_at_index(system_translation_map, system_lines.length, ini_game_title, '')
502
475
  end
503
476
 
477
+ system_lines.add(ini_game_title)
478
+
504
479
  puts "Parsed #{system_filename}" if logging
505
480
 
506
481
  original_content, translated_content = if processing_type == 'append'
@@ -522,7 +497,7 @@ def self.read_scripts(scripts_file_path, output_path, logging, processing_type)
522
497
  scripts_trans_output_path = File.join(output_path, "#{scripts_basename}_trans.txt")
523
498
 
524
499
  if processing_type == 'default' && File.exist?(scripts_trans_output_path)
525
- puts "scripts_trans.txt file already exists. If you want to forcefully re-read all files, use --force flag, or --append if you want append new text to already existing files."
500
+ puts 'scripts_trans.txt file already exists. If you want to forcefully re-read all files, use --force flag, or --append if you want append new text to already existing files.'
526
501
  return
527
502
  end
528
503
 
@@ -546,7 +521,7 @@ def self.read_scripts(scripts_file_path, output_path, logging, processing_type)
546
521
  code = Zlib::Inflate.inflate(script[2]).force_encoding('UTF-8')
547
522
  codes_content.push(code)
548
523
 
549
- extract_quoted_strings(code).keys.each do |string|
524
+ extract_quoted_strings(code).each_key do |string|
550
525
  string.strip!
551
526
 
552
527
  # Removes the U+3000 Japanese typographical space to check if string, when stripped, is truly empty
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.5.1'
5
+ spec.version = '1.5.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.5.1
4
+ version: 1.5.2
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-13 00:00:00.000000000 Z
15
+ date: 2024-07-14 00:00:00.000000000 Z
16
16
  dependencies: []
17
17
  description:
18
18
  email: