=begin
*Yuyu Save Menu*
by
Euphoria
I used some code from Yanfly, so you might want to credit him as well...
Most likely he's already in your credits, so this is irrelevant. He's in
everyone's credits. It's crazy...
If you want to display the map name and save count, two features I threw in for
fun, go into the "Other Options" and set the variables to these values for the
best look:
NAME_SPOT = 1
MAP_NAME = true
SAVE_COUNT = true
OH! And change X_OFF to 100!
There ya go! Now you can see how many times you've saved, and what map you saved
on! How cool is that?! Alright, it's not that cool... whatever...
Thanks for the pokemanz! Enjoy!
=end
#===============================================================================
# Configuration ----------------------------------------------------------------
#===============================================================================
module Euphoria
module Savemenu
#============================= System Settings =================================
#Edit this ~ if you want to... (number of save files)
SAVE_FILES = 10
#============================= Graphic Settings ================================
#X-Offset of the actor's face, default = 2, Set to 100, if name spot is 1
#or if map name is on
X_OFF = 2
#Y-Offset of the actor's face, default = 2 (you only need to edit this if
Y_OFF = 2 # you change the face size)
#Width of the face graphic (in pixelz), default = 64
FACE_X = 64
#Height of the face graphic (in pixelz), default = 64
FACE_Y = 64
#It's probably best to keep the FACE_X and FACE_Y the same size, but go
#ahead and fuck the face up by changing them, it might be fun...
#Set to true to blur the face, default = false, this really only helps if
#you change the face size to something weird, play with it if you want, it
#may look better blurred to you :p
BLUR_FACE = false
#====== Other Options - Don't Touch Unless You REALLY Wanna Change Stuff =======
#The word that appears before the save file number, it's "File" by default
#but you can change it to something else; "Save", "Game", "Penis", ya know
#whatever...
SAVE_PREFIX = "File: "
#Change the area the name is drawn in, 1 means it will be drawn on the left,
#2 means it will be drawn on the right, beneath playtime. Default = 2
NAME_SPOT = 2
#True to draw map name on save file, false to exclude it
MAP_NAME = false
#If map name is on, change this to whatever you want to display directly
#above the map name, default = "Location: "
MAP_NAME_PREFIX = "Location: "
#If true, the number of times saved will be drawn on each file
#CAUTION: this will overlap with name spot 2, so don't use name spot 2 while
#this is true
SAVE_COUNT = false
#Text to show directly before the save count
SAVE_C_PREFIX = "Saves: "
#X-Offset for the save count number, used to make room for the save count
#prefix
SAVE_C_P_OFF = 60
end
end
#===============================================================================
# END Configuration ------------------------------------------------------------
#===============================================================================
#===============================================================================
# Begin Core Code --------------------------------------------------------------
#===============================================================================
module DataManager
def self.savefile_max
return Euphoria::Savemenu::SAVE_FILES
end
def self.make_save_header
header = {}
header[:face] = $game_party.leader
header[:playtime_s] = $game_system.playtime_s
header[:mainname] = $game_party.leader
header[:system] = Marshal.load(Marshal.dump($game_system))
header[:timer] = Marshal.load(Marshal.dump($game_timer))
header[:message] = Marshal.load(Marshal.dump($game_message))
header[:switches] = Marshal.load(Marshal.dump($game_switches))
header[:variables] = Marshal.load(Marshal.dump($game_variables))
header[:self_switches] = Marshal.load(Marshal.dump($game_self_switches))
header[:actors] = Marshal.load(Marshal.dump($game_actors))
header[:party] = Marshal.load(Marshal.dump($game_party))
header[:troop] = Marshal.load(Marshal.dump($game_troop))
header[:map] = Marshal.load(Marshal.dump($game_map))
header[:player] = Marshal.load(Marshal.dump($game_player))
header
end
end
#===============================================================================
# Create Help Window -----------------------------------------------------------
#===============================================================================
class Scene_File < Scene_MenuBase
def create_help_window
@help_window = Window_Help.new(1)
@help_window.arrows_visible = false
@help_window.set_text(help_window_text)
@help_window.x = 136
@help_window.width = 288
end
end
#===============================================================================
# Create Save File Contents ----------------------------------------------------
#===============================================================================
class Window_SaveFile < Window_Base
attr_reader :selected # selected
def initialize(height, index)
super(136, index * height, Graphics.width - 256, height)
@file_index = index
refresh
@selected = false
self.arrows_visible = false
end
def refresh
contents.clear
change_color(normal_color)
name = Euphoria::Savemenu::SAVE_PREFIX + " #{@file_index + 1}"
draw_text(182, 20, 200, line_height, name)
@name_width = text_size(name).width
draw_main_face
draw_main_name
draw_playtime(0, 0, contents.width, 0)
draw_map_name
draw_save_count
end
def draw_main_face
header = DataManager.load_header(@file_index)
return unless header
draw_actor_mini_face(header[:party].leader, 0, 0, enabled = true)
end
def draw_actor_mini_face(actor, x, y, enabled = true)
draw_actor_mini_face2(actor.face_name, actor.face_index, x, y, enabled)
end
def draw_actor_mini_face2(face_name, face_index, x, y, enabled = true)
bitmap = Cache.face(face_name)
rect = Rect.new(face_index % 4 * 96, face_index / 4 * 96, 96, 96)
dest_rect = Rect.new(Euphoria::Savemenu::X_OFF, Euphoria::Savemenu::Y_OFF, Euphoria::Savemenu::FACE_X, Euphoria::Savemenu::FACE_Y)
bitmap.blur if dest_rect.width < 96/2
cache = Bitmap.new(dest_rect.width, dest_rect.height)
cache.stretch_blt(Rect.new(0,0,dest_rect.width, dest_rect.height), bitmap, rect)
bitmap.dispose
contents.stretch_blt(dest_rect, cache, Rect.new(0,0,cache.width,cache.height), enabled ? 255 : translucent_alpha)
contents.blur if Euphoria::Savemenu::BLUR_FACE == true
end
def draw_main_name
header = DataManager.load_header(@file_index)
return unless header
aname = header[:party].leader
if Euphoria::Savemenu::NAME_SPOT == 1
draw_actor_name(aname, 2, 0, width = 112)
elsif Euphoria::Savemenu::NAME_SPOT == 2
draw_actor_name(aname, 182, 40, width = 112)
else
draw_text(0, 0, 112, line_height, "FUCK ;)")
end
end
def draw_playtime(x, y, width, align)
header = DataManager.load_header(@file_index)
return unless header
draw_text(x, y, width, line_height, header[:playtime_s], 2)
end
def draw_map_name
if Euphoria::Savemenu::MAP_NAME == true
header = DataManager.load_header(@file_index)
return unless header
draw_text(0, 20, 112, line_height, Euphoria::Savemenu::MAP_NAME_PREFIX)
draw_text(0, 40, 112, line_height, header[:map].display_name)
end
end
def draw_save_count
if Euphoria::Savemenu::SAVE_COUNT == true
header = DataManager.load_header(@file_index)
return unless header
draw_text(182, 40, 112, line_height, Euphoria::Savemenu::SAVE_C_PREFIX)
draw_text(182 + Euphoria::Savemenu::SAVE_C_P_OFF, 40, 112, line_height, header[:system].save_count)
end
end
def selected=(selected)
@selected = selected
update_cursor
end
def update_cursor
if @selected
cursor_rect.set(0, 0, 264, 68)
else
cursor_rect.empty
end
end
end
#===============================================================================
# END Script -------------------------------------------------------------------
#===============================================================================