Archeia

Sabakan Log Fix

Feb 17th, 2015
277
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class Scene_Map
  2.   alias_method :cp_02132015_update, :update
  3.   def update
  4.     create_log_window if @log_window.nil? || @log_window.disposed?
  5.     if @log_window && @log_window.visible
  6.       Graphics.update
  7.       Input.update
  8.       @log_window.update
  9.     else
  10.       cp_02132015_update
  11.     end
  12.   end
  13.  
  14.   def create_log_window
  15.     @log_window = Window_MessageLog.new
  16.     @log_window.set_handler(:cancel,    method(:deactivate_log_window))
  17.     @log_window.z = 10000
  18.     @log_window.hide
  19.   end
  20.  
  21.   def update_call_msg_log
  22.     return unless @log_window
  23.     call_msglog if Input.trigger?(Saba::MessageLog::LOG_BUTTON)
  24.   end
  25.  
  26.   def deactivate_log_window
  27.     @log_window.hide.deactivate
  28.   end
  29.  
  30.   def call_msglog
  31.     Sound.play_ok
  32.     @log_window.create_contents
  33.     @log_window.refresh
  34.     @log_window.show.activate
  35.   end
  36. end
  37.  
  38.  
  39. class Window_MessageLog < Window_Selectable
  40.   alias_method :cp_02132015_update, :update
  41.   def update
  42.     @back_sprite.visible = self.visible
  43.     @back_sprite.z = self.z - 1
  44.     cp_02132015_update
  45.   end
  46.  
  47.   def dispose
  48.     @back_sprite.dispose
  49.     super
  50.   end
  51. end
RAW Paste Data