Sha256: 82648f30dd12c6a77b5ec21829f7044f8f671502884edd102f724de6d1c0b978

Contents?: true

Size: 1.4 KB

Versions: 1

Compression:

Stored size: 1.4 KB

Contents

#!/usr/bin/env ruby
# -*- coding: utf-8 -*-

require 'optimist'
require 'RGSS'

opts = Optimist::options do
  opt :action, "Action to perform on project (unpack|pack)", :short => "a", :type => String
  opt :project, "RPG Maker Project directory", :short => "d", :type => String
  opt :force, "Update target even when source is older than target", :short => "f"
  opt :project_type, "Project type (vx|ace|xp)", :short => "t", :type => String
  opt :verbose, "Print verbose information while processing", :short => "V"
  opt :scripts, "Convert scripts contained in /project/Scripts", :default => false
  opt :saves, "Convert saves contained in /project", :default => false
  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
end

directions = {
  "unpack" => :all_bin_to_text,
  "pack" => :all_text_to_bin
}
projecttypes = {
  "vx" => :vx,
  "ace" => :ace,
  "xp" => :xp
}
$VERBOSE = opts[:verbose]

RGSS.serialize(projecttypes[opts[:project_type]],
               directions[opts[:action]],
               opts[:project],
               { :force => (opts[:force] ? true : false),
                 :line_width => -1,
                 :table_width => -1,
                 :database => { :saves => opts[:saves], :scripts => opts[:scripts] },
                 :files => opts[:files]
               }
)

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fusionpacker-0.1.3 bin/fusionpacker