Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1.     module BI
  2.       module SaveAuto
  3.        
  4.        
  5.         #
  6.         ##
  7.         ###
  8.         ####
  9.         #####
  10.         #######################################                BIWARD
  11.         # Script d'Auto Sauvegarde par Biward##################################
  12.         # Inspiré de Solstice ########################################
  13.         #######################################          AUTOSAVE
  14.         #####
  15.         ####
  16.         ###
  17.         ##
  18.         #
  19.        
  20.        
  21.         #===============================
  22.         # Config
  23.         #===============================
  24.        
  25.         # Texte qui s'affiche dans la fenêtre
  26.         Text = "Sauvegarde Instantané"
  27.        
  28.         # Texte dans la barre du haut, pour le choix du fichier
  29.         Text_Help = "Choix du Fichier pour la Sauvegarde Instantané !"
  30.        
  31.         # Dans le choix du Numéro de la Sauvegarde, voici le texte qui s'affiche :
  32.         File = "Fichier"
  33.        
  34.         # ID de la variable qui stocke le n° du fichier
  35.         Variable = 1
  36.        
  37.         #Temps en seconde !
  38.         Temps = 4
  39.        
  40.        
  41.         # Pour appeller le choix des fichiers, faîtes ceci :
  42.         #               Appel de script : $scene = Scene_Choix.new
  43.         # Vous pouvez par exemple le demander au début du jeu ou etc...
  44.         #===============================
  45.         # Fin de La Config
  46.         #===============================
  47.       end
  48.     end
  49.  
  50.  
  51.     class Scene_Map
  52.      
  53.       alias update2 update
  54.       alias terminate2 terminate
  55.      
  56.       def update
  57.         update2
  58.        
  59.         if @win
  60.           @shutdown = @shutdown.to_i - 1
  61.           affiche
  62.         if @shutdown < 95
  63.           @win.opacity -= 3
  64.           affiche
  65.         if @shutdown == 0
  66.           @shutdown = nil
  67.           @win.dispose
  68.           @win = nil
  69.         end
  70.         end
  71.       else
  72.         if Input.trigger?(Input::F6)
  73.           saveauto
  74.           temp = Scene_File.new(true,true,true)
  75.           @var = BI::SaveAuto::Variable.to_i
  76.           filename = temp.make_filename($game_variables[@var])
  77.           file = File.open(filename, "wb")
  78.           temp.write_save_data(file)
  79.           file.close
  80.           temp = nil
  81.         end
  82.       end
  83.     end
  84.  
  85.       def affiche
  86.       @win.contents.clear
  87.       @win.contents.font.color = Color.new(255, 255, 255, @shutdown.to_i)
  88.       @win.contents.draw_text(0, -35, 544, 100, BI::SaveAuto::Text, 0)  
  89.       end
  90.      
  91.       def saveauto
  92.         @shutdown = BI::SaveAuto::Temps.to_i * 60
  93.         @win = Window_Base.new(0, 0, 250, 65)
  94.         @win.x = (Graphics.width / 2) - (250 / 2)
  95.         @win.y = 12
  96.         @win.contents.draw_text(0, -35, 544, 100, BI::SaveAuto::Text, 0)
  97.       end
  98.     end
  99.  
  100.     class Scene_Choix < Scene_Base
  101.      
  102.       def start
  103.         create_menu_background
  104.         @choix, @commands = Array.new(2){[]}
  105.        
  106.         4.times { |i| @commands << (BI::SaveAuto::File.to_s + " " + (i + 1).to_s) }
  107.        
  108.         @choix = Window_Command.new(250, @commands, 2, 2)
  109.         @choix.x = 544/2 - 250/2
  110.         @choix.y = 150  
  111.         @choix.index = $game_variables[BI::SaveAuto::Variable]
  112.         @windooo = Window_Haut.new
  113.       end
  114.      
  115.       def terminate
  116.         dispose_menu_background
  117.         @choix.dispose
  118.         @windooo.dispose
  119.       end
  120.      
  121.       def update
  122.         @choix.update
  123.         if Input.trigger?(Input::C)
  124.           $game_variables[BI::SaveAuto::Variable.to_i] =  @choix.index
  125.           $scene = Scene_Map.new
  126.         elsif Input.trigger?(Input::B)
  127.           Sound.play_cancel
  128.           $scene = Scene_Map.new
  129.         end
  130.       end
  131.     end
  132.  
  133.     class Window_Haut < Window_Base
  134.       def initialize
  135.         super(0, 0, 544, 56)
  136.         refresh
  137.       end
  138.      
  139.       def refresh
  140.         self.contents.clear
  141.         self.contents.draw_text(50,  -200, 544, 416, BI::SaveAuto::Text_Help, 0)
  142.       end
  143.     end