module BI
module SaveAuto
#
##
###
####
#####
####################################### BIWARD
# Script d'Auto Sauvegarde par Biward##################################
# Inspiré de Solstice ########################################
####################################### AUTOSAVE
#####
####
###
##
#
#===============================
# Config
#===============================
# Texte qui s'affiche dans la fenêtre
Text = "Sauvegarde Instantané"
# Texte dans la barre du haut, pour le choix du fichier
Text_Help = "Choix du Fichier pour la Sauvegarde Instantané !"
# Dans le choix du Numéro de la Sauvegarde, voici le texte qui s'affiche :
File = "Fichier"
# ID de la variable qui stocke le n° du fichier
Variable = 1
#Temps en seconde !
Temps = 4
# Pour appeller le choix des fichiers, faîtes ceci :
# Appel de script : $scene = Scene_Choix.new
# Vous pouvez par exemple le demander au début du jeu ou etc...
#===============================
# Fin de La Config
#===============================
end
end
class Scene_Map
alias update2 update
alias terminate2 terminate
def update
update2
if @win
@shutdown = @shutdown.to_i - 1
affiche
if @shutdown < 95
@win.opacity -= 3
affiche
if @shutdown == 0
@shutdown = nil
@win.dispose
@win = nil
end
end
else
if Input.trigger?(Input::F6)
saveauto
temp = Scene_File.new(true,true,true)
@var = BI::SaveAuto::Variable.to_i
filename = temp.make_filename($game_variables[@var])
file = File.open(filename, "wb")
temp.write_save_data(file)
file.close
temp = nil
end
end
end
def affiche
@win.contents.clear
@win.contents.font.color = Color.new(255, 255, 255, @shutdown.to_i)
@win.contents.draw_text(0, -35, 544, 100, BI::SaveAuto::Text, 0)
end
def saveauto
@shutdown = BI::SaveAuto::Temps.to_i * 60
@win = Window_Base.new(0, 0, 250, 65)
@win.x = (Graphics.width / 2) - (250 / 2)
@win.y = 12
@win.contents.draw_text(0, -35, 544, 100, BI::SaveAuto::Text, 0)
end
end
class Scene_Choix < Scene_Base
def start
create_menu_background
@choix, @commands = Array.new(2){[]}
4.times { |i| @commands << (BI::SaveAuto::File.to_s + " " + (i + 1).to_s) }
@choix = Window_Command.new(250, @commands, 2, 2)
@choix.x = 544/2 - 250/2
@choix.y = 150
@choix.index = $game_variables[BI::SaveAuto::Variable]
@windooo = Window_Haut.new
end
def terminate
dispose_menu_background
@choix.dispose
@windooo.dispose
end
def update
@choix.update
if Input.trigger?(Input::C)
$game_variables[BI::SaveAuto::Variable.to_i] = @choix.index
$scene = Scene_Map.new
elsif Input.trigger?(Input::B)
Sound.play_cancel
$scene = Scene_Map.new
end
end
end
class Window_Haut < Window_Base
def initialize
super(0, 0, 544, 56)
refresh
end
def refresh
self.contents.clear
self.contents.draw_text(50, -200, 544, 416, BI::SaveAuto::Text_Help, 0)
end
end