Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module DSIVER144
- module PATCH_SYSTEM
- PATCH_DIR = "Patches"
- def self.dump_patch_test
- array = ["A","B","C"]
- header = {}
- header[:data] = array
- File.open("Test.patch", "wb") do |file|
- Marshal.dump(header, file)
- end
- end
- def self.get_patch_file
- files = Dir["*.txt"]
- end
- def self.get_data(type)
- case type
- when :item
- return $data_items
- when :weapon
- return $data_weapons
- when :armor
- return $data_armors
- end
- end
- def self.create_patch(type,*args)
- @patch = []
- @data_array = get_data(type)
- args.each do |i|
- @patch << @data_array[i]
- end
- p @patch
- end
- end
- end
- #DSIVER144::PATCH_SYSTEM.dump_patch_test
- #a = load_data("Test.patch")
- module DataManager
- class << self
- alias_method(:dsi_load_database_patch_system, :load_database)
- end
- #--------------------------------------------------------------------------
- # * Load Database
- #--------------------------------------------------------------------------
- def self.load_database
- dsi_load_database_patch_system
- DSIVER144::PATCH_SYSTEM.create_patch(:item,1,2,3)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement