IceDragon200

RestoreCharacters

May 14th, 2011
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.69 KB | None | 0 0
  1. class Scene_Battle < Scene_Base
  2.  
  3.   def store_character_data( actor )
  4.     @character_stored_data = {} if @character_stored_data.nil?()
  5.     @character_stored_data[actor] = [ actor.character_name, actor.character_index,
  6.       actor.face_name, actor.face_index ]
  7.   end
  8.  
  9.   alias cg_rest_battle_end battle_end unless $@
  10.   def battle_end( result )
  11.     cg_rest_battle_end( result )
  12.     restore_graphics()
  13.   end
  14.  
  15.   def restore_graphics()
  16.     @character_stored_data = {} if @character_stored_data.nil?()
  17.     @character_stored_data.keys.each { |a|
  18.       cn, ci, fn, fi = *@character_stored_data[a]
  19.       a.set_graphic( cn, ci, fn, fi )
  20.     }
  21.     @character_stored_data.clear
  22.   end
  23.  
  24. end
Advertisement
Add Comment
Please, Sign In to add comment