rvpacker-txt 1.7.1 → 1.8.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 +4 -4
- data/lib/classes.rb +7 -7
- data/lib/read.rb +1 -1
- data/lib/write.rb +42 -24
- data/rvpacker-txt.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2668e8728bac13732103b447b33f2a3e3b699f408e6e214255abb7a0fa4718c1
|
|
4
|
+
data.tar.gz: 9214274068189272243df485f52d0d53063316a749590e7f1e708f05613cfeca
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9c646537c1a24ee6341e3d2904c952644bd78054f17d624d21c69627b3972c9741a3989bf8b4ae711f8ebb592ddadfc1d52da3b52faacecd875f031fc1f839f3
|
|
7
|
+
data.tar.gz: 480402b6423c51245cb431f7fba7324f2895b79f5c3d13ab8f38614a1d3aad026e3f6eabe74b0d2a2992df3f695f81bf91a5f05c93c2566d3f480111a4bdcdf9
|
data/lib/classes.rb
CHANGED
|
@@ -134,31 +134,31 @@ module RPG
|
|
|
134
134
|
end
|
|
135
135
|
|
|
136
136
|
class Armor
|
|
137
|
-
attr_accessor :name, :
|
|
137
|
+
attr_accessor :name, :description, :note
|
|
138
138
|
end
|
|
139
139
|
|
|
140
140
|
class Class
|
|
141
|
-
attr_accessor :name, :
|
|
141
|
+
attr_accessor :name, :description, :note
|
|
142
142
|
end
|
|
143
143
|
|
|
144
144
|
class Enemy
|
|
145
|
-
attr_accessor :name, :
|
|
145
|
+
attr_accessor :name, :description, :note
|
|
146
146
|
end
|
|
147
147
|
|
|
148
148
|
class Item
|
|
149
|
-
attr_accessor :name, :
|
|
149
|
+
attr_accessor :name, :description, :note
|
|
150
150
|
end
|
|
151
151
|
|
|
152
152
|
class Skill
|
|
153
|
-
attr_accessor :name, :
|
|
153
|
+
attr_accessor :name, :description, :note
|
|
154
154
|
end
|
|
155
155
|
|
|
156
156
|
class State
|
|
157
|
-
attr_accessor :name, :
|
|
157
|
+
attr_accessor :name, :description, :note
|
|
158
158
|
end
|
|
159
159
|
|
|
160
160
|
class Weapon
|
|
161
|
-
attr_accessor :name, :
|
|
161
|
+
attr_accessor :name, :description, :note
|
|
162
162
|
end
|
|
163
163
|
|
|
164
164
|
class CommonEvent
|
data/lib/read.rb
CHANGED
|
@@ -13,7 +13,7 @@ class Hash
|
|
|
13
13
|
end
|
|
14
14
|
|
|
15
15
|
# @param [String] string A parsed scripts code string, containing raw Ruby code
|
|
16
|
-
# @return [IndexSet<String>]
|
|
16
|
+
# @return [IndexSet<String>] Set of extracted strings
|
|
17
17
|
def self.extract_quoted_strings(string)
|
|
18
18
|
result = IndexSet.new
|
|
19
19
|
|
data/lib/write.rb
CHANGED
|
@@ -5,7 +5,6 @@ require 'zlib'
|
|
|
5
5
|
# @param [String] string A parsed scripts code string, containing raw Ruby code
|
|
6
6
|
# @return [[Array<String>, Array<Integer>]] Hash of parsed from code strings and their start indices
|
|
7
7
|
def self.extract_quoted_strings(string)
|
|
8
|
-
# Hash of string-index key-value pairs
|
|
9
8
|
strings_array = []
|
|
10
9
|
indices_array = []
|
|
11
10
|
|
|
@@ -140,7 +139,7 @@ def self.write_map(original_files_paths, maps_path, output_path, shuffle_level,
|
|
|
140
139
|
line.gsub('\#', "\n").strip
|
|
141
140
|
end.freeze
|
|
142
141
|
|
|
143
|
-
maps_translated_text = File.readlines(File.join(maps_path, '
|
|
142
|
+
maps_translated_text = File.readlines(File.join(maps_path, 'maps_trans.txt'), encoding: 'UTF-8', chomp: true).map do |line|
|
|
144
143
|
line.gsub('\#', "\n").strip
|
|
145
144
|
end
|
|
146
145
|
|
|
@@ -175,11 +174,11 @@ def self.write_map(original_files_paths, maps_path, output_path, shuffle_level,
|
|
|
175
174
|
events = object.events
|
|
176
175
|
next if events.nil?
|
|
177
176
|
|
|
178
|
-
events.
|
|
177
|
+
events.each do |ev, event|
|
|
179
178
|
pages = event.pages
|
|
180
179
|
next if pages.nil?
|
|
181
180
|
|
|
182
|
-
pages.
|
|
181
|
+
pages.each_with_index do |page, pg|
|
|
183
182
|
list = page.list
|
|
184
183
|
next if list.nil?
|
|
185
184
|
|
|
@@ -244,13 +243,21 @@ def self.write_map(original_files_paths, maps_path, output_path, shuffle_level,
|
|
|
244
243
|
end
|
|
245
244
|
|
|
246
245
|
item.parameters = parameters
|
|
246
|
+
list[it] = item
|
|
247
247
|
end
|
|
248
|
+
|
|
249
|
+
page.list = list
|
|
250
|
+
pages[pg] = page
|
|
248
251
|
end
|
|
252
|
+
|
|
253
|
+
event.pages = pages
|
|
254
|
+
events[ev] = event
|
|
249
255
|
end
|
|
250
256
|
|
|
251
|
-
|
|
257
|
+
object.events = events
|
|
252
258
|
|
|
253
259
|
File.binwrite(File.join(output_path, filename), Marshal.dump(object))
|
|
260
|
+
puts "Written #{filename}" if logging
|
|
254
261
|
end
|
|
255
262
|
end
|
|
256
263
|
|
|
@@ -320,7 +327,7 @@ def self.write_other(original_files_paths, other_path, output_path, shuffle_leve
|
|
|
320
327
|
end
|
|
321
328
|
end
|
|
322
329
|
else
|
|
323
|
-
other_object_array.
|
|
330
|
+
other_object_array.each_with_index do |object, obj|
|
|
324
331
|
next if object.nil?
|
|
325
332
|
|
|
326
333
|
pages = object.pages
|
|
@@ -391,14 +398,23 @@ def self.write_other(original_files_paths, other_path, output_path, shuffle_leve
|
|
|
391
398
|
end
|
|
392
399
|
|
|
393
400
|
item.parameters = parameters
|
|
401
|
+
list[it] = item
|
|
402
|
+
end
|
|
403
|
+
|
|
404
|
+
if pages.nil?
|
|
405
|
+
object.list = list
|
|
406
|
+
else
|
|
407
|
+
pages[pg].instance_variable_set(:@list, list)
|
|
408
|
+
object.pages = pages
|
|
394
409
|
end
|
|
395
410
|
end
|
|
411
|
+
|
|
412
|
+
other_object_array[obj] = object
|
|
396
413
|
end
|
|
397
414
|
end
|
|
398
415
|
|
|
399
|
-
puts "Written #{filename}" if logging
|
|
400
|
-
|
|
401
416
|
File.binwrite(File.join(output_path, filename), Marshal.dump(other_object_array))
|
|
417
|
+
puts "Written #{filename}" if logging
|
|
402
418
|
end
|
|
403
419
|
end
|
|
404
420
|
|
|
@@ -445,15 +461,15 @@ def self.write_system(system_file_path, ini_file_path, other_path, output_path,
|
|
|
445
461
|
currency_unit = system_object.currency_unit
|
|
446
462
|
terms = system_object.terms || system_object.words
|
|
447
463
|
|
|
448
|
-
[elements, skill_types, weapon_types, armor_types].each_with_index
|
|
464
|
+
[elements, skill_types, weapon_types, armor_types].each_with_index do |array, i|
|
|
449
465
|
next unless array.is_a?(Array)
|
|
450
466
|
|
|
451
|
-
array.
|
|
452
|
-
|
|
453
|
-
|
|
467
|
+
array.each_with_index do |string, i|
|
|
468
|
+
string = string.strip
|
|
469
|
+
next if string.empty?
|
|
454
470
|
|
|
455
|
-
translated = system_translation_map[
|
|
456
|
-
|
|
471
|
+
translated = system_translation_map[string]
|
|
472
|
+
array[i] = translated unless translated.nil? || translated.empty?
|
|
457
473
|
end
|
|
458
474
|
|
|
459
475
|
if i.zero?
|
|
@@ -479,14 +495,14 @@ def self.write_system(system_file_path, ini_file_path, other_path, output_path,
|
|
|
479
495
|
next if value.empty?
|
|
480
496
|
|
|
481
497
|
translated = system_translation_map[stripped]
|
|
482
|
-
value =
|
|
498
|
+
value = translated unless translated.nil? || translated.empty?
|
|
483
499
|
elsif value.is_a?(Array)
|
|
484
|
-
value.
|
|
485
|
-
|
|
486
|
-
|
|
500
|
+
value.each_with_index do |string, i|
|
|
501
|
+
string = string.strip
|
|
502
|
+
next if string.empty?
|
|
487
503
|
|
|
488
|
-
translated = system_translation_map[
|
|
489
|
-
value =
|
|
504
|
+
translated = system_translation_map[string]
|
|
505
|
+
value[i] = translated unless translated.nil? || translated.empty?
|
|
490
506
|
end
|
|
491
507
|
end
|
|
492
508
|
|
|
@@ -498,8 +514,11 @@ def self.write_system(system_file_path, ini_file_path, other_path, output_path,
|
|
|
498
514
|
system_object.terms = terms
|
|
499
515
|
|
|
500
516
|
game_title_translated = system_translated_text[-1]
|
|
501
|
-
|
|
502
|
-
|
|
517
|
+
|
|
518
|
+
unless game_title_translated.nil? || game_title_translated.empty?
|
|
519
|
+
system_object.game_title = game_title_translated
|
|
520
|
+
write_ini_title(ini_file_path, game_title_translated)
|
|
521
|
+
end
|
|
503
522
|
|
|
504
523
|
puts "Written #{system_basename}" if logging
|
|
505
524
|
|
|
@@ -558,8 +577,7 @@ def self.write_scripts(scripts_file_path, other_path, output_path, logging)
|
|
|
558
577
|
script[2] = Zlib::Deflate.deflate(code, Zlib::BEST_COMPRESSION)
|
|
559
578
|
end
|
|
560
579
|
|
|
561
|
-
puts "Written #{scripts_basename}" if logging
|
|
562
|
-
|
|
563
580
|
# File.binwrite(File.join(output_path, 'scripts_plain.txt'), codes.join("\n")) - debug line
|
|
564
581
|
File.binwrite(File.join(output_path, scripts_basename), Marshal.dump(script_entries))
|
|
582
|
+
puts "Written #{scripts_basename}" if logging
|
|
565
583
|
end
|
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
|
+
spec.version = '1.8.0'
|
|
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.
|
|
4
|
+
version: 1.8.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-
|
|
15
|
+
date: 2024-07-18 00:00:00.000000000 Z
|
|
16
16
|
dependencies: []
|
|
17
17
|
description:
|
|
18
18
|
email:
|