fusionpacker 0.1.2 → 0.1.3

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: f0efb4ba8b97e800b96361ab2c6cbc485e5fe5cd0a65e1244e8f46e5c9b2e084
4
- data.tar.gz: e7016cfdd36f5641a7ecbe42106a60568f8e96c8594630967cdcbf4c77159bc1
3
+ metadata.gz: b7f5e7542c392e7f45369bb7489f51c13f291e3e54485a35b109b752857bb379
4
+ data.tar.gz: 88c8c07d3185c7bcf3790dace0dfe0ba31812ac65686a3c77087fa0629ae14da
5
5
  SHA512:
6
- metadata.gz: 602735078d4d947b299bcfceb7552c410c2172ded4bac8d20eb42db3d3b46dedc32e29f03e350d3fb7d38da49b2d0b5cc86f42d3aa06bedc8cb4fb609a6eba87
7
- data.tar.gz: bc7ebe2928d9760d8f2d7430f87ca75d9b860f169c5995d68f0ff968fe0db2d332dd2d35cc0c248c4be97ff828749ebf46e76026413339e938310c4792a788c0
6
+ metadata.gz: d34c6d93a919c5e6910532ec8ff46ed5d965f6d148032a860bc9f630755e91afcc2ae133e3e0b5241342a62866a3be061fbf6942c9b5e3011d0af802ebb7400f
7
+ data.tar.gz: e1be468b92a39089ebcef4720de7b8f19b1d82338b828cbeae6efeea56630983c981cb118cfc221d7e313a0e664083444cadfbb514f4c4c0d4c3da8858aa0bb7
data/bin/fusionpacker CHANGED
@@ -12,7 +12,7 @@ opts = Optimist::options do
12
12
  opt :verbose, "Print verbose information while processing", :short => "V"
13
13
  opt :scripts, "Convert scripts contained in /project/Scripts", :default => false
14
14
  opt :saves, "Convert saves contained in /project", :default => false
15
- opt :files, "Array of files to convert instead, delimited by spaces", :short => "l", :type => :strings
15
+ opt :files, "Array of files to convert instead, delimited by spaces. If this argument is present, paths to files are resolved from --project directory", :short => "l", :type => :strings
16
16
  end
17
17
 
18
18
  directions = {
@@ -306,7 +306,7 @@ module RGSS
306
306
 
307
307
  dirs = {
308
308
  :base => base,
309
- :data => get_data_directory(base),
309
+ :data => get_data_directory(base, options[:files]),
310
310
  :yaml => get_yaml_directory(base),
311
311
  :script => get_script_directory(base)
312
312
  }
data/lib/RGSS.rb CHANGED
@@ -43,13 +43,13 @@ class Table
43
43
  if MAX_ROW_LENGTH != -1 && stride > MAX_ROW_LENGTH
44
44
  block_length = (stride + MAX_ROW_LENGTH - 1) / MAX_ROW_LENGTH
45
45
  row_length = (stride + block_length - 1) / block_length
46
- rows = rows.collect{|x| x.each_slice(row_length).to_a}.flatten(1)
46
+ rows = rows.collect { |x| x.each_slice(row_length).to_a }.flatten(1)
47
47
  end
48
- rows = rows.collect{|x| x.collect{|y| "%04x" % y}.join(" ")}
49
- coder['data'] = rows
48
+ rows = rows.collect { |x| x.collect { |y| "%04x" % y }.join(" ") }
49
+ coder['data'] = rows
50
50
  else
51
51
  coder['data'] = []
52
- end
52
+ end
53
53
  end
54
54
 
55
55
  def init_with(coder)
@@ -57,7 +57,7 @@ class Table
57
57
  @x = coder['x']
58
58
  @y = coder['y']
59
59
  @z = coder['z']
60
- @data = coder['data'].collect{|x| x.split(" ").collect{|y| y.hex}}.flatten
60
+ @data = coder['data'].collect { |x| x.split(" ").collect { |y| y.hex } }.flatten
61
61
  items = @x * @y * @z
62
62
  raise "Size mismatch loading Table from YAML" unless items == @data.length
63
63
  end
@@ -68,7 +68,7 @@ class Table
68
68
 
69
69
  def self._load(bytes)
70
70
  Table.new(bytes)
71
- end
71
+ end
72
72
  end
73
73
 
74
74
  class Color
@@ -89,7 +89,7 @@ class Color
89
89
  end
90
90
 
91
91
  def self._load(bytes)
92
- Color.new(bytes)
92
+ Color.new(bytes)
93
93
  end
94
94
  end
95
95
 
@@ -173,33 +173,32 @@ module RGSS
173
173
 
174
174
  # Object.const_set(:PokemonDataBox, PokemonDataBox) unless Object.const_defined?(name, false)
175
175
  # other classes that don't need definitions
176
- [ # RGSS data structures
177
- [:RPG, :Actor], [:RPG, :Animation], [:RPG, :Animation, :Frame],
178
- [:RPG, :Animation, :Timing], [:RPG, :Area], [:RPG, :Armor], [:RPG, :AudioFile],
179
- [:RPG, :BaseItem], [:RPG, :BaseItem, :Feature], [:RPG, :BGM], [:RPG, :BGS],
180
- [:RPG, :Class], [:RPG, :Class, :Learning], [:RPG, :CommonEvent], [:RPG, :Enemy],
181
- [:RPG, :Enemy, :Action], [:RPG, :Enemy, :DropItem], [:RPG, :EquipItem],
182
- [:RPG, :Event], [:RPG, :Event, :Page], [:RPG, :Event, :Page, :Condition],
183
- [:RPG, :Event, :Page, :Graphic], [:RPG, :Item], [:RPG, :Map],
184
- [:RPG, :Map, :Encounter], [:RPG, :MapInfo], [:RPG, :ME], [:RPG, :MoveCommand],
185
- [:RPG, :MoveRoute], [:RPG, :SE], [:RPG, :Skill], [:RPG, :State],
186
- [:RPG, :System, :Terms], [:RPG, :System, :TestBattler], [:RPG, :System, :Vehicle],
187
- [:RPG, :System, :Words], [:RPG, :Tileset], [:RPG, :Troop], [:RPG, :Troop, :Member],
188
- [:RPG, :Troop, :Page], [:RPG, :Troop, :Page, :Condition], [:RPG, :UsableItem],
189
- [:RPG, :UsableItem, :Damage], [:RPG, :UsableItem, :Effect], [:RPG, :Weapon],
190
- # Script classes serialized in save game files
191
- [:Game_ActionResult], [:Game_Actor], [:Game_Actors], [:Game_BaseItem],
192
- [:Game_BattleAction], [:Game_CommonEvent], [:Game_Enemy], [:Game_Event],
193
- [:Game_Follower], [:Game_Followers], [:Game_Interpreter], [:Game_Map],
194
- [:Game_Message], [:Game_Party], [:Game_Picture], [:Game_Pictures], [:Game_Player],
195
- [:Game_System], [:Game_Timer], [:Game_Troop], [:Game_Screen], [:Game_Vehicle],
196
- [:Interpreter],
197
- [:PokemonDataCopy],
198
- [:PBAnimations]
199
- # coughing up classes for fusion
200
- # [:PokemonDataBox, :Graphic]
201
- ].each {|x| process(Object, *x)}
202
-
176
+ [# RGSS data structures
177
+ [:RPG, :Actor], [:RPG, :Animation], [:RPG, :Animation, :Frame],
178
+ [:RPG, :Animation, :Timing], [:RPG, :Area], [:RPG, :Armor], [:RPG, :AudioFile],
179
+ [:RPG, :BaseItem], [:RPG, :BaseItem, :Feature], [:RPG, :BGM], [:RPG, :BGS],
180
+ [:RPG, :Class], [:RPG, :Class, :Learning], [:RPG, :CommonEvent], [:RPG, :Enemy],
181
+ [:RPG, :Enemy, :Action], [:RPG, :Enemy, :DropItem], [:RPG, :EquipItem],
182
+ [:RPG, :Event], [:RPG, :Event, :Page], [:RPG, :Event, :Page, :Condition],
183
+ [:RPG, :Event, :Page, :Graphic], [:RPG, :Item], [:RPG, :Map],
184
+ [:RPG, :Map, :Encounter], [:RPG, :MapInfo], [:RPG, :ME], [:RPG, :MoveCommand],
185
+ [:RPG, :MoveRoute], [:RPG, :SE], [:RPG, :Skill], [:RPG, :State],
186
+ [:RPG, :System, :Terms], [:RPG, :System, :TestBattler], [:RPG, :System, :Vehicle],
187
+ [:RPG, :System, :Words], [:RPG, :Tileset], [:RPG, :Troop], [:RPG, :Troop, :Member],
188
+ [:RPG, :Troop, :Page], [:RPG, :Troop, :Page, :Condition], [:RPG, :UsableItem],
189
+ [:RPG, :UsableItem, :Damage], [:RPG, :UsableItem, :Effect], [:RPG, :Weapon],
190
+ # Script classes serialized in save game files
191
+ [:Game_ActionResult], [:Game_Actor], [:Game_Actors], [:Game_BaseItem],
192
+ [:Game_BattleAction], [:Game_CommonEvent], [:Game_Enemy], [:Game_Event],
193
+ [:Game_Follower], [:Game_Followers], [:Game_Interpreter], [:Game_Map],
194
+ [:Game_Message], [:Game_Party], [:Game_Picture], [:Game_Pictures], [:Game_Player],
195
+ [:Game_System], [:Game_Timer], [:Game_Troop], [:Game_Screen], [:Game_Vehicle],
196
+ [:Interpreter],
197
+ [:PokemonDataCopy],
198
+ [:PBAnimations]
199
+ # coughing up classes for fusion
200
+ # [:PokemonDataBox, :Graphic]
201
+ ].each { |x| process(Object, *x) }
203
202
 
204
203
  def self.setup_system(version, options)
205
204
  # convert variable and switch name arrays to a hash when serialized
@@ -211,10 +210,10 @@ module RGSS
211
210
  reset_method(Game_System, :map_version, iso)
212
211
  else
213
212
  reset_method(RPG::System, :reduce_string, ->(str) {
214
- return nil if str.nil?
215
- stripped = str.strip
216
- return stripped.empty? ? nil : stripped
217
- })
213
+ return nil if str.nil?
214
+ stripped = str.strip
215
+ return stripped.empty? ? nil : stripped
216
+ })
218
217
  # These magic numbers should be different. If they are the same, the saved version
219
218
  # of the map in save files will be used instead of any updated version of the map
220
219
  reset_method(RPG::System, :map_version, ->(ignored) { return 12345678 })
@@ -225,14 +224,14 @@ module RGSS
225
224
  def self.setup_interpreter(version)
226
225
  # Game_Interpreter is marshalled differently in VX Ace
227
226
  if version == :ace
228
- reset_method(Game_Interpreter, :marshal_dump, ->{
229
- return @data
230
- })
227
+ reset_method(Game_Interpreter, :marshal_dump, -> {
228
+ return @data
229
+ })
231
230
  reset_method(Game_Interpreter, :marshal_load, ->(obj) {
232
- @data = obj
233
- })
231
+ @data = obj
232
+ })
234
233
  else
235
- remove_defined_method(Game_Interpreter, :marshal_dump)
234
+ remove_defined_method(Game_Interpreter, :marshal_dump)
236
235
  remove_defined_method(Game_Interpreter, :marshal_load)
237
236
  end
238
237
  end
@@ -240,11 +239,11 @@ module RGSS
240
239
  def self.setup_event_command(version, options)
241
240
  # format event commands to flow style for the event codes that aren't move commands
242
241
  if options[:round_trip]
243
- reset_method(RPG::EventCommand, :clean, ->{})
242
+ reset_method(RPG::EventCommand, :clean, -> {})
244
243
  else
245
- reset_method(RPG::EventCommand, :clean, ->{
246
- @parameters[0].rstrip! if @code == 401
247
- })
244
+ reset_method(RPG::EventCommand, :clean, -> {
245
+ @parameters[0].rstrip! if @code == 401
246
+ })
248
247
  end
249
248
  reset_const(RPG::EventCommand, :MOVE_LIST_CODE, version == :xp ? 209 : 205)
250
249
  end
@@ -261,13 +260,13 @@ module RGSS
261
260
  SCRIPTS_BASE = 'Scripts'
262
261
 
263
262
  ACE_DATA_EXT = '.rvdata2'
264
- VX_DATA_EXT = '.rvdata'
265
- XP_DATA_EXT = '.rxdata'
266
- YAML_EXT = '.yaml'
267
- RUBY_EXT = '.rb'
263
+ VX_DATA_EXT = '.rvdata'
264
+ XP_DATA_EXT = '.rxdata'
265
+ YAML_EXT = '.yaml'
266
+ RUBY_EXT = '.rb'
268
267
 
269
- def self.get_data_directory(base)
270
- return File.join(base, 'Data')
268
+ def self.get_data_directory(base, files)
269
+ return files && base || File.join(base, 'Data')
271
270
  end
272
271
 
273
272
  def self.get_yaml_directory(base)
@@ -306,17 +305,17 @@ module RGSS
306
305
  include RGSS::BasicCoder
307
306
 
308
307
  def encode(name, value)
309
- return Hash[value.collect {|pair|
310
- key, value = pair
311
- next ["%03d %03d %s" % key, value]
312
- }]
308
+ return Hash[value.collect { |pair|
309
+ key, value = pair
310
+ next ["%03d %03d %s" % key, value]
311
+ }]
313
312
  end
314
313
 
315
314
  def decode(name, value)
316
- return Hash[value.collect {|pair|
317
- key, value = pair
318
- next [key.scanf("%d %d %s"), value]
319
- }]
315
+ return Hash[value.collect { |pair|
316
+ key, value = pair
317
+ next [key.scanf("%d %d %s"), value]
318
+ }]
320
319
  end
321
320
  end
322
321
 
@@ -1,3 +1,3 @@
1
1
  module Fusionpacker
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fusionpacker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Howard Jeng
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2023-10-03 00:00:00.000000000 Z
14
+ date: 2023-10-04 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: bundler