#============================================================================== # ■ セーブ画面背景保存 #------------------------------------------------------------------------------ # セーブ時の背景を保存したり、ロード時に背景を表示したりします # 要「共通定義」Ver1.07以降 # # *月の下の宿 # URL:http://gekkasou.shiteyattari.com/ #============================================================================== module An_BGF #背景データを保存するファイル名("名前.rvdata") FileName = "An_System.rvdata" end #============================================================================== # ■ Scene_File #============================================================================== class Scene_File < Scene_Base #-------------------------------------------------------------------------- # ● 開始処理 #-------------------------------------------------------------------------- alias an_bgf_start start def start an_bgf_start for i in @savefile_windows i.back_opacity = @help_window.back_opacity = 100 if @background_window != nil i.opacity = 0 @background_window.back_opacity = 100 break end end create_menu_background end #-------------------------------------------------------------------------- # ● セーブの実行 #-------------------------------------------------------------------------- alias an_bgf_do_save do_save def do_save if FileTest.exist?(An_BGF::FileName) file = File.open(An_BGF::FileName, "rb") background = Marshal.load(file) file.close else background = [] end background[@index] = $game_temp.background_bitmap._dump(0) file = File.open(An_BGF::FileName, "wb") Marshal.dump(background, file) file.close an_bgf_do_save end #-------------------------------------------------------------------------- # ● メニュー画面系の背景作成 #-------------------------------------------------------------------------- def create_menu_background update_menu_background end #-------------------------------------------------------------------------- # ● メニュー画面系の背景更新 #-------------------------------------------------------------------------- def update_menu_background return if @last_index == @index if @index != nil if FileTest.exist?(An_BGF::FileName) file = File.open(An_BGF::FileName, "rb") background = Marshal.load(file) file.close if @savefile_windows[@index].file_exist begin bitmap = Bitmap._load(background[@index]) rescue bitmap = nil end end end end bitmap = $game_temp.background_bitmap if bitmap.nil? @menuback_sprite = Sprite.new @menuback_sprite.bitmap = bitmap @menuback_sprite.color.set(16, 16, 16, 128) @last_index = @index end end #Ver1.01