module YEA
module COMMAND_WINDOW_ICONS
ICON_HASH ={
"Items" => 260, # Menu scene. Item scene. Battle scene.
"Equipment" => 436, # Menu scene.
"Status" => 122, # Menu scene.
"Save" => 286, # Menu scene.
"Relations" => 122, # Menu scene.
} # Do not remove this.
end # COMMAND_WINDOW_ICONS
end # YEA
class Window_Command < Window_Selectable
def use_icon?(text)
return YEA::COMMAND_WINDOW_ICONS::ICON_HASH.include?(text)
end
def command_icon(text)
return YEA::COMMAND_WINDOW_ICONS::ICON_HASH[text]
end
def draw_item(index)
enabled = command_enabled?(index)
change_color(normal_color, enabled)
rect = item_rect_for_text(index)
text = command_name(index)
if use_icon?(text)
draw_icon_text(rect.clone, text, alignment, enabled)
else
draw_text(rect, text, alignment)
end
end
def draw_icon_text(rect, text, alignment, enabled)
cw = text_size(text).width
icon = command_icon(text)
draw_icon(icon, rect.x, rect.y, enabled)
rect.x += 24
rect.width -= 24
draw_text(rect, text, alignment)
end
end # Window_Command
class Window_Base < Window
def draw_actor_simple_status(actor, x, y)
draw_actor_hp(actor, x, y)
draw_actor_mp(actor, x, y + line_height * 1)
end
end
class Window_MenuStatus < Window_Selectable
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_reader :pending_index # Pending position (for formation)
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize(x, y)
super(x, y, window_width, window_height)
@pending_index = -1
refresh
end
#--------------------------------------------------------------------------
# * Get Window Width
#--------------------------------------------------------------------------
def window_width
Graphics.width - 0
end
#--------------------------------------------------------------------------
# * Get Window Height
#--------------------------------------------------------------------------
def window_height
Graphics.height - 160
end
#--------------------------------------------------------------------------
# * Get Number of Items
#--------------------------------------------------------------------------
def item_max
$game_party.members.size
end
#--------------------------------------------------------------------------
# * Get Item Height
#--------------------------------------------------------------------------
def item_height
(height - 16 * 2) / 2
end
#--------------------------------------------------------------------------
# * Get Item Width
#--------------------------------------------------------------------------
def item_width
(width - 16 * 2) / 2
end
#--------------------------------------------------------------------------
# * Draw Item
#--------------------------------------------------------------------------
def draw_item(index)
actor = $game_party.members[index]
enabled = $game_party.battle_members.include?(actor)
rect = item_rect(index)
draw_item_background(index)
# calculate grid
x = (index.even?) ? 0 : 288
y = (index / 2).to_i
y = (128) * y
draw_actor_face(actor, x + 1, y + 1, true)
draw_actor_simple_status(actor, x + 108, y)
draw_item_name(actor.equips[0], x + 108, y + 48, true)
draw_item_name(actor.equips[1], x + 108, y + 72, true)
end
#--------------------------------------------------------------------------
# * Draw Background for Item
#--------------------------------------------------------------------------
def draw_item_background(index)
if index == @pending_index
contents.fill_rect(item_rect(index), pending_color)
end
end
#--------------------------------------------------------------------------
# * Processing When OK Button Is Pressed
#--------------------------------------------------------------------------
def process_ok
super
$game_party.menu_actor = $game_party.members[index]
end
#--------------------------------------------------------------------------
# * Restore Previous Selection Position
#--------------------------------------------------------------------------
def select_last
select($game_party.menu_actor.index || 0)
end
#--------------------------------------------------------------------------
# * Set Pending Position (for Formation)
#--------------------------------------------------------------------------
def pending_index=(index)
last_pending_index = @pending_index
@pending_index = index
redraw_item(@pending_index)
redraw_item(last_pending_index)
end
end
#==============================================================================
# ** Window_MenuCommand
#------------------------------------------------------------------------------
# This command window appears on the menu screen.
#==============================================================================
class Window_MenuCommand < Window_Command
#--------------------------------------------------------------------------
# * Initialize Command Selection Position (Class Method)
#--------------------------------------------------------------------------
def self.init_command_position
@@last_command_symbol = nil
end
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super(0, 0)
select_last
end
#--------------------------------------------------------------------------
# * Get Window Width
#--------------------------------------------------------------------------
def window_width
return 544
end
#--------------------------------------------------------------------------
# * Get Number of Lines to Show
#--------------------------------------------------------------------------
def visible_line_number
item_max
end
#--------------------------------------------------------------------------
# * Create Command List
#--------------------------------------------------------------------------
def make_command_list
add_main_commands
add_formation_command
add_original_commands
add_save_command
add_game_end_command
end
#--------------------------------------------------------------------------
# * Add Main Commands to List
#--------------------------------------------------------------------------
def add_main_commands
add_command(Vocab::item, :item, main_commands_enabled)
add_command(Vocab::equip, :equip, main_commands_enabled)
add_command(Vocab::status, :status, main_commands_enabled)
end
#--------------------------------------------------------------------------
# * Add Formation to Command List
#--------------------------------------------------------------------------
def add_formation_command
end
#--------------------------------------------------------------------------
# * For Adding Original Commands
#--------------------------------------------------------------------------
def add_original_commands
end
#--------------------------------------------------------------------------
# * Add Save to Command List
#--------------------------------------------------------------------------
def add_save_command
add_command(Vocab::save, :save, save_enabled)
end
#--------------------------------------------------------------------------
# * Add Exit Game to Command List
#--------------------------------------------------------------------------
def add_game_end_command
end
#--------------------------------------------------------------------------
# * Add Save to Command List
#--------------------------------------------------------------------------
def add_save_command
add_command(Vocab::save, :save, save_enabled)
end
#--------------------------------------------------------------------------
# * Get Activation State of Main Commands
#--------------------------------------------------------------------------
def main_commands_enabled
$game_party.exists
end
#--------------------------------------------------------------------------
# * Get Activation State of Formation
#--------------------------------------------------------------------------
def formation_enabled
$game_party.members.size >= 2 && !$game_system.formation_disabled
end
#--------------------------------------------------------------------------
# * Get Activation State of Save
#--------------------------------------------------------------------------
def save_enabled
!$game_system.save_disabled
end
#--------------------------------------------------------------------------
# * Processing When OK Button Is Pressed
#--------------------------------------------------------------------------
def process_ok
@@last_command_symbol = current_symbol
super
end
#--------------------------------------------------------------------------
# * Restore Previous Selection Position
#--------------------------------------------------------------------------
def select_last
select_symbol(@@last_command_symbol)
end
# =-=-=-=-
#--------------------------------------------------------------------------
# * Get Number of Lines to Show
#--------------------------------------------------------------------------
def visible_line_number
return 1
end
#--------------------------------------------------------------------------
# * Get Digit Count
#--------------------------------------------------------------------------
def col_max
return 4
end
#--------------------------------------------------------------------------
# * Get Spacing for Items Arranged Side by Side
#--------------------------------------------------------------------------
def spacing
return 8
end
#--------------------------------------------------------------------------
# * Calculate Width of Window Contents
#--------------------------------------------------------------------------
def contents_width
(item_width + spacing) * item_max - spacing
end
#--------------------------------------------------------------------------
# * Calculate Height of Window Contents
#--------------------------------------------------------------------------
def contents_height
item_height
end
#--------------------------------------------------------------------------
# * Get Leading Digits
#--------------------------------------------------------------------------
def top_col
ox / (item_width + spacing)
end
#--------------------------------------------------------------------------
# * Set Leading Digits
#--------------------------------------------------------------------------
def top_col=(col)
col = 0 if col < 0
col = col_max - 1 if col > col_max - 1
self.ox = col * (item_width + spacing)
end
#--------------------------------------------------------------------------
# * Get Trailing Digits
#--------------------------------------------------------------------------
def bottom_col
top_col + col_max - 1
end
#--------------------------------------------------------------------------
# * Set Trailing Digits
#--------------------------------------------------------------------------
def bottom_col=(col)
self.top_col = col - (col_max - 1)
end
#--------------------------------------------------------------------------
# * Scroll Cursor to Position Within Screen
#--------------------------------------------------------------------------
def ensure_cursor_visible
self.top_col = index if index < top_col
self.bottom_col = index if index > bottom_col
end
#--------------------------------------------------------------------------
# * Get Rectangle for Displaying Items
#--------------------------------------------------------------------------
def item_rect(index)
rect = super
rect.x = index * (item_width + spacing)
rect.y = 0
rect
end
#--------------------------------------------------------------------------
# * Get Alignment
#--------------------------------------------------------------------------
def alignment
return 1
end
#--------------------------------------------------------------------------
# * Move Cursor Down
#--------------------------------------------------------------------------
def cursor_down(wrap = false)
end
#--------------------------------------------------------------------------
# * Move Cursor Up
#--------------------------------------------------------------------------
def cursor_up(wrap = false)
end
#--------------------------------------------------------------------------
# * Move Cursor One Page Down
#--------------------------------------------------------------------------
def cursor_pagedown
end
#--------------------------------------------------------------------------
# * Move Cursor One Page Up
#--------------------------------------------------------------------------
def cursor_pageup
end
#-=-=-=-=-=-=-=-=
end
#==============================================================================
# ** Scene_Menu
#------------------------------------------------------------------------------
# This class performs the menu screen processing.
#==============================================================================
class Scene_Menu < Scene_MenuBase
#--------------------------------------------------------------------------
# * Start Processing
#--------------------------------------------------------------------------
def start
super
create_command_window
create_gold_window
create_status_window
end
#--------------------------------------------------------------------------
# * Create Command Window
#--------------------------------------------------------------------------
def create_command_window
@command_window = Window_MenuCommand.new
@command_window.y = 32
@command_window.set_handler(:item, method(:command_item))
@command_window.set_handler(:equip, method(:command_personal))
@command_window.set_handler(:status, method(:command_personal))
@command_window.set_handler(:save, method(:command_save))
@command_window.set_handler(:cancel, method(:return_scene))
end
#--------------------------------------------------------------------------
# * Create Gold Window
#--------------------------------------------------------------------------
def create_gold_window
end
#--------------------------------------------------------------------------
# * Create Status Window
#--------------------------------------------------------------------------
def create_status_window
@status_window = Window_MenuStatus.new(@command_window.width, 0)
@status_window.x = 0
@status_window.y = 128
end
#--------------------------------------------------------------------------
# * [Item] Command
#--------------------------------------------------------------------------
def command_item
SceneManager.call(Scene_Item)
end
#--------------------------------------------------------------------------
# * [Skill], [Equipment] and [Status] Commands
#--------------------------------------------------------------------------
def command_personal
@status_window.select_last
@status_window.activate
@status_window.set_handler(:ok, method(:on_personal_ok))
@status_window.set_handler(:cancel, method(:on_personal_cancel))
end
#--------------------------------------------------------------------------
# * [Formation] Command
#--------------------------------------------------------------------------
def command_formation
@status_window.select_last
@status_window.activate
@status_window.set_handler(:ok, method(:on_formation_ok))
@status_window.set_handler(:cancel, method(:on_formation_cancel))
end
#--------------------------------------------------------------------------
# * [Save] Command
#--------------------------------------------------------------------------
def command_save
SceneManager.call(Scene_Save)
end
#--------------------------------------------------------------------------
# * [Exit Game] Command
#--------------------------------------------------------------------------
def command_game_end
SceneManager.call(Scene_End)
end
#--------------------------------------------------------------------------
# * [OK] Personal Command
#--------------------------------------------------------------------------
def on_personal_ok
case @command_window.current_symbol
when :skill
SceneManager.call(Scene_Skill)
when :equip
SceneManager.call(Scene_Equip)
when :status
SceneManager.call(Scene_Status)
end
end
#--------------------------------------------------------------------------
# * [Cancel] Personal Command
#--------------------------------------------------------------------------
def on_personal_cancel
@status_window.unselect
@command_window.activate
end
#--------------------------------------------------------------------------
# * Formation [OK]
#--------------------------------------------------------------------------
def on_formation_ok
if @status_window.pending_index >= 0
$game_party.swap_order(@status_window.index,
@status_window.pending_index)
@status_window.pending_index = -1
@status_window.redraw_item(@status_window.index)
else
@status_window.pending_index = @status_window.index
end
@status_window.activate
end
#--------------------------------------------------------------------------
# * Formation [Cancel]
#--------------------------------------------------------------------------
def on_formation_cancel
if @status_window.pending_index >= 0
@status_window.pending_index = -1
@status_window.activate
else
@status_window.unselect
@command_window.activate
end
end
end
module DataManager
def self.savefile_max
return 10
end
end
#--------------------------------------------------------------------------
# * Create Help Window
#--------------------------------------------------------------------------
class Scene_File < Scene_MenuBase
def create_help_window
@help_window = Window_Help.new(1)
@help_window.set_text(help_window_text)
@help_window.x = 136
@help_window.width = 288
end
end
#==============================================================================
# ** Window_SaveFile
#------------------------------------------------------------------------------
# This window displays save files on the save and load screens.
#==============================================================================
class Window_SaveFile < Window_Base
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_reader :selected # selected
#--------------------------------------------------------------------------
# * Object Initialization
# index : index of save files
#--------------------------------------------------------------------------
def initialize(height, index)
super(136, index * height, Graphics.width - 256, height)
@file_index = index
refresh
@selected = false
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
contents.clear
change_color(normal_color)
name = Vocab::File + " #{@file_index + 1}"
draw_text(4, 0, 200, line_height, name)
@name_width = text_size(name).width
draw_party_characters(64, 64)
draw_playtime(0, 0, contents.width, 0)
end
#--------------------------------------------------------------------------
# * Draw Party Characters
#--------------------------------------------------------------------------
def draw_party_characters(x, y)
header = DataManager.load_header(@file_index)
return unless header
header[:characters].each_with_index do |data, i|
draw_character(data[0], data[1], x + i * 48, y)
end
end
#--------------------------------------------------------------------------
# * Draw Play Time
#--------------------------------------------------------------------------
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
#--------------------------------------------------------------------------
# * Set Selected
#--------------------------------------------------------------------------
def selected=(selected)
@selected = selected
update_cursor
end
#--------------------------------------------------------------------------
# * Update Cursor
#--------------------------------------------------------------------------
def update_cursor
if @selected
cursor_rect.set(0, 0, 264, 68)
else
cursor_rect.empty
end
end
end
module YEA
module COMMAND_WINDOW_ICONS
ICON_HASH ={
"Items" => 260, # Menu scene. Item scene. Battle scene.
"Equipment" => 436, # Menu scene.
"Status" => 122, # Menu scene.
"Save" => 286, # Menu scene.
"Relations" => 122, # Menu scene.
} # Do not remove this.
end # COMMAND_WINDOW_ICONS
end # YEA
class Window_Command < Window_Selectable
def use_icon?(text)
return YEA::COMMAND_WINDOW_ICONS::ICON_HASH.include?(text)
end
def command_icon(text)
return YEA::COMMAND_WINDOW_ICONS::ICON_HASH[text]
end
def draw_item(index)
enabled = command_enabled?(index)
change_color(normal_color, enabled)
rect = item_rect_for_text(index)
text = command_name(index)
if use_icon?(text)
draw_icon_text(rect.clone, text, alignment, enabled)
else
draw_text(rect, text, alignment)
end
end
def draw_icon_text(rect, text, alignment, enabled)
cw = text_size(text).width
icon = command_icon(text)
draw_icon(icon, rect.x, rect.y, enabled)
rect.x += 24
rect.width -= 24
draw_text(rect, text, alignment)
end
end # Window_Command
class Window_Base < Window
def draw_actor_simple_status(actor, x, y)
draw_actor_hp(actor, x, y)
draw_actor_mp(actor, x, y + line_height * 1)
end
end
class Window_MenuStatus < Window_Selectable
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_reader :pending_index # Pending position (for formation)
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize(x, y)
super(x, y, window_width, window_height)
@pending_index = -1
refresh
end
#--------------------------------------------------------------------------
# * Get Window Width
#--------------------------------------------------------------------------
def window_width
Graphics.width - 0
end
#--------------------------------------------------------------------------
# * Get Window Height
#--------------------------------------------------------------------------
def window_height
Graphics.height - 160
end
#███████████████████████████████████████████████████████████████████████████████
#███████████████████████████████Euphoria Was Here███████████████████████████████
def col_max
return 2
end
#███████████████████████████████████████████████████████████████████████████████
#--------------------------------------------------------------------------
# * Get Number of Items
#--------------------------------------------------------------------------
def item_max
$game_party.members.size
end
#--------------------------------------------------------------------------
# * Get Item Height
#--------------------------------------------------------------------------
def item_height
(height - 16 * 2) / 2
end
#--------------------------------------------------------------------------
# * Get Item Width
#--------------------------------------------------------------------------
def item_width
(width - 16 * 2) / 2
end
#--------------------------------------------------------------------------
# * Draw Item
#--------------------------------------------------------------------------
def draw_item(index)
actor = $game_party.members[index]
enabled = $game_party.battle_members.include?(actor)
rect = item_rect(index)
draw_item_background(index)
# calculate grid
x = (index.even?) ? 0 : 288
y = (index / 2).to_i
y = (128) * y
draw_actor_face(actor, x + 1, y + 1, true)
draw_actor_simple_status(actor, x + 108, y)
draw_item_name(actor.equips[0], x + 108, y + 48, true)
draw_item_name(actor.equips[1], x + 108, y + 72, true)
end
#--------------------------------------------------------------------------
# * Draw Background for Item
#--------------------------------------------------------------------------
def draw_item_background(index)
if index == @pending_index
contents.fill_rect(item_rect(index), pending_color)
end
end
#--------------------------------------------------------------------------
# * Processing When OK Button Is Pressed
#--------------------------------------------------------------------------
def process_ok
super
$game_party.menu_actor = $game_party.members[index]
end
#--------------------------------------------------------------------------
# * Restore Previous Selection Position
#--------------------------------------------------------------------------
def select_last
select($game_party.menu_actor.index || 0)
end
#--------------------------------------------------------------------------
# * Set Pending Position (for Formation)
#--------------------------------------------------------------------------
def pending_index=(index)
last_pending_index = @pending_index
@pending_index = index
redraw_item(@pending_index)
redraw_item(last_pending_index)
end
end
#==============================================================================
# ** Window_MenuCommand
#------------------------------------------------------------------------------
# This command window appears on the menu screen.
#==============================================================================
class Window_MenuCommand < Window_Command
#--------------------------------------------------------------------------
# * Initialize Command Selection Position (Class Method)
#--------------------------------------------------------------------------
def self.init_command_position
@@last_command_symbol = nil
end
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super(0, 0)
select_last
end
#--------------------------------------------------------------------------
# * Get Window Width
#--------------------------------------------------------------------------
def window_width
return 544
end
#--------------------------------------------------------------------------
# * Get Number of Lines to Show
#--------------------------------------------------------------------------
def visible_line_number
item_max
end
#--------------------------------------------------------------------------
# * Create Command List
#--------------------------------------------------------------------------
def make_command_list
add_main_commands
add_formation_command
add_original_commands
add_save_command
add_game_end_command
end
#--------------------------------------------------------------------------
# * Add Main Commands to List
#--------------------------------------------------------------------------
def add_main_commands
add_command(Vocab::item, :item, main_commands_enabled)
add_command(Vocab::equip, :equip, main_commands_enabled)
add_command(Vocab::status, :status, main_commands_enabled)
end
#--------------------------------------------------------------------------
# * Add Formation to Command List
#--------------------------------------------------------------------------
def add_formation_command
end
#--------------------------------------------------------------------------
# * For Adding Original Commands
#--------------------------------------------------------------------------
def add_original_commands
end
#--------------------------------------------------------------------------
# * Add Save to Command List
#--------------------------------------------------------------------------
def add_save_command
add_command(Vocab::save, :save, save_enabled)
end
#--------------------------------------------------------------------------
# * Add Exit Game to Command List
#--------------------------------------------------------------------------
def add_game_end_command
end
#--------------------------------------------------------------------------
# * Add Save to Command List
#--------------------------------------------------------------------------
def add_save_command
add_command(Vocab::save, :save, save_enabled)
end
#--------------------------------------------------------------------------
# * Get Activation State of Main Commands
#--------------------------------------------------------------------------
def main_commands_enabled
$game_party.exists
end
#--------------------------------------------------------------------------
# * Get Activation State of Formation
#--------------------------------------------------------------------------
def formation_enabled
$game_party.members.size >= 2 && !$game_system.formation_disabled
end
#--------------------------------------------------------------------------
# * Get Activation State of Save
#--------------------------------------------------------------------------
def save_enabled
!$game_system.save_disabled
end
#--------------------------------------------------------------------------
# * Processing When OK Button Is Pressed
#--------------------------------------------------------------------------
def process_ok
@@last_command_symbol = current_symbol
super
end
#--------------------------------------------------------------------------
# * Restore Previous Selection Position
#--------------------------------------------------------------------------
def select_last
select_symbol(@@last_command_symbol)
end
# =-=-=-=-
#--------------------------------------------------------------------------
# * Get Number of Lines to Show
#--------------------------------------------------------------------------
def visible_line_number
return 1
end
#--------------------------------------------------------------------------
# * Get Digit Count
#--------------------------------------------------------------------------
def col_max
return 4
end
#--------------------------------------------------------------------------
# * Get Spacing for Items Arranged Side by Side
#--------------------------------------------------------------------------
def spacing
return 8
end
#--------------------------------------------------------------------------
# * Calculate Width of Window Contents
#--------------------------------------------------------------------------
def contents_width
(item_width + spacing) * item_max - spacing
end
#--------------------------------------------------------------------------
# * Calculate Height of Window Contents
#--------------------------------------------------------------------------
def contents_height
item_height
end
#--------------------------------------------------------------------------
# * Get Leading Digits
#--------------------------------------------------------------------------
def top_col
ox / (item_width + spacing)
end
#--------------------------------------------------------------------------
# * Set Leading Digits
#--------------------------------------------------------------------------
def top_col=(col)
col = 0 if col < 0
col = col_max - 1 if col > col_max - 1
self.ox = col * (item_width + spacing)
end
#--------------------------------------------------------------------------
# * Get Trailing Digits
#--------------------------------------------------------------------------
def bottom_col
top_col + col_max - 1
end
#--------------------------------------------------------------------------
# * Set Trailing Digits
#--------------------------------------------------------------------------
def bottom_col=(col)
self.top_col = col - (col_max - 1)
end
#--------------------------------------------------------------------------
# * Scroll Cursor to Position Within Screen
#--------------------------------------------------------------------------
def ensure_cursor_visible
self.top_col = index if index < top_col
self.bottom_col = index if index > bottom_col
end
#--------------------------------------------------------------------------
# * Get Rectangle for Displaying Items
#--------------------------------------------------------------------------
def item_rect(index)
rect = super
rect.x = index * (item_width + spacing)
rect.y = 0
rect
end
#--------------------------------------------------------------------------
# * Get Alignment
#--------------------------------------------------------------------------
def alignment
return 1
end
#--------------------------------------------------------------------------
# * Move Cursor Down
#--------------------------------------------------------------------------
def cursor_down(wrap = false)
end
#--------------------------------------------------------------------------
# * Move Cursor Up
#--------------------------------------------------------------------------
def cursor_up(wrap = false)
end
#--------------------------------------------------------------------------
# * Move Cursor One Page Down
#--------------------------------------------------------------------------
def cursor_pagedown
end
#--------------------------------------------------------------------------
# * Move Cursor One Page Up
#--------------------------------------------------------------------------
def cursor_pageup
end
#-=-=-=-=-=-=-=-=
end
#==============================================================================
# ** Scene_Menu
#------------------------------------------------------------------------------
# This class performs the menu screen processing.
#==============================================================================
class Scene_Menu < Scene_MenuBase
#--------------------------------------------------------------------------
# * Start Processing
#--------------------------------------------------------------------------
def start
super
create_command_window
create_gold_window
create_status_window
end
#--------------------------------------------------------------------------
# * Create Command Window
#--------------------------------------------------------------------------
def create_command_window
@command_window = Window_MenuCommand.new
@command_window.y = 32
@command_window.set_handler(:item, method(:command_item))
@command_window.set_handler(:equip, method(:command_personal))
@command_window.set_handler(:status, method(:command_personal))
@command_window.set_handler(:save, method(:command_save))
@command_window.set_handler(:cancel, method(:return_scene))
end
#--------------------------------------------------------------------------
# * Create Gold Window
#--------------------------------------------------------------------------
def create_gold_window
end
#--------------------------------------------------------------------------
# * Create Status Window
#--------------------------------------------------------------------------
def create_status_window
@status_window = Window_MenuStatus.new(@command_window.width, 0)
@status_window.x = 0
@status_window.y = 128
end
#--------------------------------------------------------------------------
# * [Item] Command
#--------------------------------------------------------------------------
def command_item
SceneManager.call(Scene_Item)
end
#--------------------------------------------------------------------------
# * [Skill], [Equipment] and [Status] Commands
#--------------------------------------------------------------------------
def command_personal
@status_window.select_last
@status_window.activate
@status_window.set_handler(:ok, method(:on_personal_ok))
@status_window.set_handler(:cancel, method(:on_personal_cancel))
end
#--------------------------------------------------------------------------
# * [Formation] Command
#--------------------------------------------------------------------------
def command_formation
@status_window.select_last
@status_window.activate
@status_window.set_handler(:ok, method(:on_formation_ok))
@status_window.set_handler(:cancel, method(:on_formation_cancel))
end
#--------------------------------------------------------------------------
# * [Save] Command
#--------------------------------------------------------------------------
def command_save
SceneManager.call(Scene_Save)
end
#--------------------------------------------------------------------------
# * [Exit Game] Command
#--------------------------------------------------------------------------
def command_game_end
SceneManager.call(Scene_End)
end
#--------------------------------------------------------------------------
# * [OK] Personal Command
#--------------------------------------------------------------------------
def on_personal_ok
case @command_window.current_symbol
when :skill
SceneManager.call(Scene_Skill)
when :equip
SceneManager.call(Scene_Equip)
when :status
SceneManager.call(Scene_Status)
end
end
#--------------------------------------------------------------------------
# * [Cancel] Personal Command
#--------------------------------------------------------------------------
def on_personal_cancel
@status_window.unselect
@command_window.activate
end
#--------------------------------------------------------------------------
# * Formation [OK]
#--------------------------------------------------------------------------
def on_formation_ok
if @status_window.pending_index >= 0
$game_party.swap_order(@status_window.index,
@status_window.pending_index)
@status_window.pending_index = -1
@status_window.redraw_item(@status_window.index)
else
@status_window.pending_index = @status_window.index
end
@status_window.activate
end
#--------------------------------------------------------------------------
# * Formation [Cancel]
#--------------------------------------------------------------------------
def on_formation_cancel
if @status_window.pending_index >= 0
@status_window.pending_index = -1
@status_window.activate
else
@status_window.unselect
@command_window.activate
end
end
end
module YEA
module COMMAND_WINDOW_ICONS
ICON_HASH ={
"Items" => 260, # Menu scene. Item scene. Battle scene.
"Equipment" => 436, # Menu scene.
"Status" => 122, # Menu scene.
"Save" => 286, # Menu scene.
"Relations" => 122, # Menu scene.
} # Do not remove this.
end # COMMAND_WINDOW_ICONS
end # YEA
class Window_Command < Window_Selectable
def use_icon?(text)
return YEA::COMMAND_WINDOW_ICONS::ICON_HASH.include?(text)
end
def command_icon(text)
return YEA::COMMAND_WINDOW_ICONS::ICON_HASH[text]
end
def draw_item(index)
enabled = command_enabled?(index)
change_color(normal_color, enabled)
rect = item_rect_for_text(index)
text = command_name(index)
if use_icon?(text)
draw_icon_text(rect.clone, text, alignment, enabled)
else
draw_text(rect, text, alignment)
end
end
def draw_icon_text(rect, text, alignment, enabled)
cw = text_size(text).width
icon = command_icon(text)
draw_icon(icon, rect.x, rect.y, enabled)
rect.x += 24
rect.width -= 24
draw_text(rect, text, alignment)
end
end # Window_Command
class Window_Base < Window
def draw_actor_simple_status(actor, x, y)
draw_actor_hp(actor, x, y)
draw_actor_mp(actor, x, y + line_height * 1)
end
end
class Window_MenuStatus < Window_Selectable
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_reader :pending_index # Pending position (for formation)
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize(x, y)
super(x, y, window_width, window_height)
@pending_index = -1
refresh
end
#--------------------------------------------------------------------------
# * Get Window Width
#--------------------------------------------------------------------------
def window_width
Graphics.width - 0
end
#--------------------------------------------------------------------------
# * Get Window Height
#--------------------------------------------------------------------------
def window_height
Graphics.height - 160
end
#███████████████████████████████████████████████████████████████████████████████
#███████████████████████████████Euphoria Was Here███████████████████████████████
def col_max
return 2
end
#███████████████████████████████████████████████████████████████████████████████
#--------------------------------------------------------------------------
# * Get Number of Items
#--------------------------------------------------------------------------
def item_max
$game_party.members.size
end
#--------------------------------------------------------------------------
# * Get Item Height
#--------------------------------------------------------------------------
def item_height
(height - 16 * 2) / 2
end
#--------------------------------------------------------------------------
# * Get Item Width
#--------------------------------------------------------------------------
def item_width
(width - 16 * 2) / 2
end
#--------------------------------------------------------------------------
# * Draw Item
#--------------------------------------------------------------------------
def draw_item(index)
actor = $game_party.members[index]
enabled = $game_party.battle_members.include?(actor)
rect = item_rect(index)
draw_item_background(index)
# calculate grid
#███████████████████████████████████████████████████████████████████████████████
#███████████████████████████████████And Here████████████████████████████████████
x = (index.even?) ? 0 : 280
#███████████████████████████████████████████████████████████████████████████████
y = (index / 2).to_i
y = (128) * y
draw_actor_face(actor, x + 1, y + 1, true)
draw_actor_simple_status(actor, x + 108, y)
draw_item_name(actor.equips[0], x + 108, y + 48, true)
draw_item_name(actor.equips[1], x + 108, y + 72, true)
end
#--------------------------------------------------------------------------
# * Draw Background for Item
#--------------------------------------------------------------------------
def draw_item_background(index)
if index == @pending_index
contents.fill_rect(item_rect(index), pending_color)
end
end
#--------------------------------------------------------------------------
# * Processing When OK Button Is Pressed
#--------------------------------------------------------------------------
def process_ok
super
$game_party.menu_actor = $game_party.members[index]
end
#--------------------------------------------------------------------------
# * Restore Previous Selection Position
#--------------------------------------------------------------------------
def select_last
select($game_party.menu_actor.index || 0)
end
#--------------------------------------------------------------------------
# * Set Pending Position (for Formation)
#--------------------------------------------------------------------------
def pending_index=(index)
last_pending_index = @pending_index
@pending_index = index
redraw_item(@pending_index)
redraw_item(last_pending_index)
end
end
#==============================================================================
# ** Window_MenuCommand
#------------------------------------------------------------------------------
# This command window appears on the menu screen.
#==============================================================================
class Window_MenuCommand < Window_Command
#--------------------------------------------------------------------------
# * Initialize Command Selection Position (Class Method)
#--------------------------------------------------------------------------
def self.init_command_position
@@last_command_symbol = nil
end
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super(0, 0)
select_last
end
#--------------------------------------------------------------------------
# * Get Window Width
#--------------------------------------------------------------------------
def window_width
return 544
end
#--------------------------------------------------------------------------
# * Get Number of Lines to Show
#--------------------------------------------------------------------------
def visible_line_number
item_max
end
#--------------------------------------------------------------------------
# * Create Command List
#--------------------------------------------------------------------------
def make_command_list
add_main_commands
add_formation_command
add_original_commands
add_save_command
add_game_end_command
end
#--------------------------------------------------------------------------
# * Add Main Commands to List
#--------------------------------------------------------------------------
def add_main_commands
add_command(Vocab::item, :item, main_commands_enabled)
add_command(Vocab::equip, :equip, main_commands_enabled)
add_command(Vocab::status, :status, main_commands_enabled)
end
#--------------------------------------------------------------------------
# * Add Formation to Command List
#--------------------------------------------------------------------------
def add_formation_command
end
#--------------------------------------------------------------------------
# * For Adding Original Commands
#--------------------------------------------------------------------------
def add_original_commands
end
#--------------------------------------------------------------------------
# * Add Save to Command List
#--------------------------------------------------------------------------
def add_save_command
add_command(Vocab::save, :save, save_enabled)
end
#--------------------------------------------------------------------------
# * Add Exit Game to Command List
#--------------------------------------------------------------------------
def add_game_end_command
end
#--------------------------------------------------------------------------
# * Add Save to Command List
#--------------------------------------------------------------------------
def add_save_command
add_command(Vocab::save, :save, save_enabled)
end
#--------------------------------------------------------------------------
# * Get Activation State of Main Commands
#--------------------------------------------------------------------------
def main_commands_enabled
$game_party.exists
end
#--------------------------------------------------------------------------
# * Get Activation State of Formation
#--------------------------------------------------------------------------
def formation_enabled
$game_party.members.size >= 2 && !$game_system.formation_disabled
end
#--------------------------------------------------------------------------
# * Get Activation State of Save
#--------------------------------------------------------------------------
def save_enabled
!$game_system.save_disabled
end
#--------------------------------------------------------------------------
# * Processing When OK Button Is Pressed
#--------------------------------------------------------------------------
def process_ok
@@last_command_symbol = current_symbol
super
end
#--------------------------------------------------------------------------
# * Restore Previous Selection Position
#--------------------------------------------------------------------------
def select_last
select_symbol(@@last_command_symbol)
end
# =-=-=-=-
#--------------------------------------------------------------------------
# * Get Number of Lines to Show
#--------------------------------------------------------------------------
def visible_line_number
return 1
end
#--------------------------------------------------------------------------
# * Get Digit Count
#--------------------------------------------------------------------------
def col_max
return 4
end
#--------------------------------------------------------------------------
# * Get Spacing for Items Arranged Side by Side
#--------------------------------------------------------------------------
def spacing
return 8
end
#--------------------------------------------------------------------------
# * Calculate Width of Window Contents
#--------------------------------------------------------------------------
def contents_width
(item_width + spacing) * item_max - spacing
end
#--------------------------------------------------------------------------
# * Calculate Height of Window Contents
#--------------------------------------------------------------------------
def contents_height
item_height
end
#--------------------------------------------------------------------------
# * Get Leading Digits
#--------------------------------------------------------------------------
def top_col
ox / (item_width + spacing)
end
#--------------------------------------------------------------------------
# * Set Leading Digits
#--------------------------------------------------------------------------
def top_col=(col)
col = 0 if col < 0
col = col_max - 1 if col > col_max - 1
self.ox = col * (item_width + spacing)
end
#--------------------------------------------------------------------------
# * Get Trailing Digits
#--------------------------------------------------------------------------
def bottom_col
top_col + col_max - 1
end
#--------------------------------------------------------------------------
# * Set Trailing Digits
#--------------------------------------------------------------------------
def bottom_col=(col)
self.top_col = col - (col_max - 1)
end
#--------------------------------------------------------------------------
# * Scroll Cursor to Position Within Screen
#--------------------------------------------------------------------------
def ensure_cursor_visible
self.top_col = index if index < top_col
self.bottom_col = index if index > bottom_col
end
#--------------------------------------------------------------------------
# * Get Rectangle for Displaying Items
#--------------------------------------------------------------------------
def item_rect(index)
rect = super
rect.x = index * (item_width + spacing)
rect.y = 0
rect
end
#--------------------------------------------------------------------------
# * Get Alignment
#--------------------------------------------------------------------------
def alignment
return 1
end
#--------------------------------------------------------------------------
# * Move Cursor Down
#--------------------------------------------------------------------------
def cursor_down(wrap = false)
end
#--------------------------------------------------------------------------
# * Move Cursor Up
#--------------------------------------------------------------------------
def cursor_up(wrap = false)
end
#--------------------------------------------------------------------------
# * Move Cursor One Page Down
#--------------------------------------------------------------------------
def cursor_pagedown
end
#--------------------------------------------------------------------------
# * Move Cursor One Page Up
#--------------------------------------------------------------------------
def cursor_pageup
end
#-=-=-=-=-=-=-=-=
end
#==============================================================================
# ** Scene_Menu
#------------------------------------------------------------------------------
# This class performs the menu screen processing.
#==============================================================================
class Scene_Menu < Scene_MenuBase
#--------------------------------------------------------------------------
# * Start Processing
#--------------------------------------------------------------------------
def start
super
create_command_window
create_gold_window
create_status_window
end
#--------------------------------------------------------------------------
# * Create Command Window
#--------------------------------------------------------------------------
def create_command_window
@command_window = Window_MenuCommand.new
@command_window.y = 32
@command_window.set_handler(:item, method(:command_item))
@command_window.set_handler(:equip, method(:command_personal))
@command_window.set_handler(:status, method(:command_personal))
@command_window.set_handler(:save, method(:command_save))
@command_window.set_handler(:cancel, method(:return_scene))
end
#--------------------------------------------------------------------------
# * Create Gold Window
#--------------------------------------------------------------------------
def create_gold_window
end
#--------------------------------------------------------------------------
# * Create Status Window
#--------------------------------------------------------------------------
def create_status_window
@status_window = Window_MenuStatus.new(@command_window.width, 0)
@status_window.x = 0
@status_window.y = 128
end
#--------------------------------------------------------------------------
# * [Item] Command
#--------------------------------------------------------------------------
def command_item
SceneManager.call(Scene_Item)
end
#--------------------------------------------------------------------------
# * [Skill], [Equipment] and [Status] Commands
#--------------------------------------------------------------------------
def command_personal
@status_window.select_last
@status_window.activate
@status_window.set_handler(:ok, method(:on_personal_ok))
@status_window.set_handler(:cancel, method(:on_personal_cancel))
end
#--------------------------------------------------------------------------
# * [Formation] Command
#--------------------------------------------------------------------------
def command_formation
@status_window.select_last
@status_window.activate
@status_window.set_handler(:ok, method(:on_formation_ok))
@status_window.set_handler(:cancel, method(:on_formation_cancel))
end
#--------------------------------------------------------------------------
# * [Save] Command
#--------------------------------------------------------------------------
def command_save
SceneManager.call(Scene_Save)
end
#--------------------------------------------------------------------------
# * [Exit Game] Command
#--------------------------------------------------------------------------
def command_game_end
SceneManager.call(Scene_End)
end
#--------------------------------------------------------------------------
# * [OK] Personal Command
#--------------------------------------------------------------------------
def on_personal_ok
case @command_window.current_symbol
when :skill
SceneManager.call(Scene_Skill)
when :equip
SceneManager.call(Scene_Equip)
when :status
SceneManager.call(Scene_Status)
end
end
#--------------------------------------------------------------------------
# * [Cancel] Personal Command
#--------------------------------------------------------------------------
def on_personal_cancel
@status_window.unselect
@command_window.activate
end
#--------------------------------------------------------------------------
# * Formation [OK]
#--------------------------------------------------------------------------
def on_formation_ok
if @status_window.pending_index >= 0
$game_party.swap_order(@status_window.index,
@status_window.pending_index)
@status_window.pending_index = -1
@status_window.redraw_item(@status_window.index)
else
@status_window.pending_index = @status_window.index
end
@status_window.activate
end
#--------------------------------------------------------------------------
# * Formation [Cancel]
#--------------------------------------------------------------------------
def on_formation_cancel
if @status_window.pending_index >= 0
@status_window.pending_index = -1
@status_window.activate
else
@status_window.unselect
@command_window.activate
end
end
end
module DataManager
def self.savefile_max
return 10
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
#███████████████████████████████████████████████████████████████████████████████
#██████████████████████████████Euphy Quick-Fix██████████████████████████████████
class Window_Base < Window
def draw_icon_face(actor, dest_rect, enabled)
bitmap = Cache.face(actor.face_name)
rect = Rect.new(actor.face_index % 4 * 96, actor.face_index / 4 * 96, 96, 96)
bitmap.blur if dest_rect.width < 96/2
cache = Bitmap.new(dest_rect.width, dest_rect.height)
cache.stretch_blt(Rect.new(0,0,48, 48), bitmap, rect)
bitmap.dispose
contents.stretch_blt(dest_rect, cache, Rect.new(0,0,cache.width,cache.height), enabled ? 255 : translucent_alpha)
end
end
#███████████████████████████████████████████████████████████████████████████████
#==============================================================================
# ** Window_SaveFile
#------------------------------------------------------------------------------
# This window displays save files on the save and load screens.
#==============================================================================
class Window_SaveFile < Window_Base
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_reader :selected # selected
#--------------------------------------------------------------------------
# * Object Initialization
# index : index of save files
#--------------------------------------------------------------------------
def initialize(height, index)
super(136, index * height, Graphics.width - 256, height)
@file_index = index
refresh
@selected = false
self.arrows_visible = false
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
contents.clear
change_color(normal_color)
name = Vocab::File + " #{@file_index + 1}"
draw_text(182, 20, 200, line_height, name)
@name_width = text_size(name).width
#███████████████████████████████████████████████████████████████████████████████
#██████████████████████████████Euphy Quick-Fix██████████████████████████████████
image_rect = Rect.new(25, 10, 48, 48)
enabled = true
draw_icon_face($game_party.battle_members[0], image_rect, enabled)
#███████████████████████████████████████████████████████████████████████████████
draw_playtime(0, 0, contents.width, 0)
end
#--------------------------------------------------------------------------
# * Draw Party Characters
#--------------------------------------------------------------------------
def draw_party_characters(x, y)
header = DataManager.load_header(@file_index)
return unless header
header[:characters].each_with_index do |data, i|
draw_character(data[0], data[1], x + i * 48, y)
end
end
#--------------------------------------------------------------------------
# * Draw Play Time
#--------------------------------------------------------------------------
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
#--------------------------------------------------------------------------
# * Set Selected
#--------------------------------------------------------------------------
def selected=(selected)
@selected = selected
update_cursor
end
#--------------------------------------------------------------------------
# * Update Cursor
#--------------------------------------------------------------------------
def update_cursor
if @selected
cursor_rect.set(0, 0, 264, 68)
else
cursor_rect.empty
end
end
end
module YEA
module COMMAND_WINDOW_ICONS
ICON_HASH ={
"Items" => 260, # Menu scene. Item scene. Battle scene.
"Equipment" => 436, # Menu scene.
"Status" => 122, # Menu scene.
"Save" => 286, # Menu scene.
"Relations" => 122, # Menu scene.
} # Do not remove this.
end # COMMAND_WINDOW_ICONS
end # YEA
class Window_Command < Window_Selectable
def use_icon?(text)
return YEA::COMMAND_WINDOW_ICONS::ICON_HASH.include?(text)
end
def command_icon(text)
return YEA::COMMAND_WINDOW_ICONS::ICON_HASH[text]
end
def draw_item(index)
enabled = command_enabled?(index)
change_color(normal_color, enabled)
rect = item_rect_for_text(index)
text = command_name(index)
if use_icon?(text)
draw_icon_text(rect.clone, text, alignment, enabled)
else
draw_text(rect, text, alignment)
end
end
def draw_icon_text(rect, text, alignment, enabled)
cw = text_size(text).width
icon = command_icon(text)
draw_icon(icon, rect.x, rect.y, enabled)
rect.x += 24
rect.width -= 24
draw_text(rect, text, alignment)
end
end # Window_Command
class Window_Base < Window
def draw_actor_simple_status(actor, x, y)
draw_actor_hp(actor, x, y)
draw_actor_mp(actor, x, y + line_height * 1)
end
end
class Window_MenuStatus < Window_Selectable
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_reader :pending_index # Pending position (for formation)
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize(x, y)
super(x, y, window_width, window_height)
@pending_index = -1
refresh
end
#--------------------------------------------------------------------------
# * Get Window Width
#--------------------------------------------------------------------------
def window_width
Graphics.width - 0
end
#--------------------------------------------------------------------------
# * Get Window Height
#--------------------------------------------------------------------------
def window_height
Graphics.height - 160
end
#███████████████████████████████████████████████████████████████████████████████
#███████████████████████████████Euphoria Was Here███████████████████████████████
def col_max
return 2
end
#███████████████████████████████████████████████████████████████████████████████
#--------------------------------------------------------------------------
# * Get Number of Items
#--------------------------------------------------------------------------
def item_max
$game_party.members.size
end
#--------------------------------------------------------------------------
# * Get Item Height
#--------------------------------------------------------------------------
def item_height
(height - 16 * 2) / 2
end
#--------------------------------------------------------------------------
# * Get Item Width
#--------------------------------------------------------------------------
def item_width
(width - 16 * 2) / 2
end
#--------------------------------------------------------------------------
# * Draw Item
#--------------------------------------------------------------------------
def draw_item(index)
actor = $game_party.members[index]
enabled = $game_party.battle_members.include?(actor)
rect = item_rect(index)
draw_item_background(index)
# calculate grid
#███████████████████████████████████████████████████████████████████████████████
#███████████████████████████████████And Here████████████████████████████████████
x = (index.even?) ? 0 : 276
#███████████████████████████████████████████████████████████████████████████████
y = (index / 2).to_i
y = (128) * y
draw_actor_face(actor, x + 1, y + 1, true)
draw_actor_simple_status(actor, x + 108, y)
draw_item_name(actor.equips[0], x + 108, y + 48, true)
draw_item_name(actor.equips[1], x + 108, y + 72, true)
end
#███████████████████████████████████████████████████████████████████████████████
#███████████████████████████████████And Here████████████████████████████████████
def item_rect(index)
rect = Rect.new
rect.width = 244
rect.height = item_height
if index == 1 #This
rect.x = index % col_max * (item_width + spacing) - 12 #Was
elsif index == 3 #Kind
rect.x = index % col_max * (item_width + spacing) - 12 #Of
else #Sloppy
rect.x = index % col_max * (item_width + spacing) #Coding,
end #Sorry!
rect.y = index / col_max * item_height
rect
end
#███████████████████████████████████████████████████████████████████████████████
#--------------------------------------------------------------------------
# * Draw Background for Item
#--------------------------------------------------------------------------
def draw_item_background(index)
if index == @pending_index
contents.fill_rect(item_rect(index), pending_color)
end
end
#--------------------------------------------------------------------------
# * Processing When OK Button Is Pressed
#--------------------------------------------------------------------------
def process_ok
super
$game_party.menu_actor = $game_party.members[index]
end
#--------------------------------------------------------------------------
# * Restore Previous Selection Position
#--------------------------------------------------------------------------
def select_last
select($game_party.menu_actor.index || 0)
end
#--------------------------------------------------------------------------
# * Set Pending Position (for Formation)
#--------------------------------------------------------------------------
def pending_index=(index)
last_pending_index = @pending_index
@pending_index = index
redraw_item(@pending_index)
redraw_item(last_pending_index)
end
end
#==============================================================================
# ** Window_MenuCommand
#------------------------------------------------------------------------------
# This command window appears on the menu screen.
#==============================================================================
class Window_MenuCommand < Window_Command
#--------------------------------------------------------------------------
# * Initialize Command Selection Position (Class Method)
#--------------------------------------------------------------------------
def self.init_command_position
@@last_command_symbol = nil
end
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super(0, 0)
select_last
end
#--------------------------------------------------------------------------
# * Get Window Width
#--------------------------------------------------------------------------
def window_width
return 544
end
#--------------------------------------------------------------------------
# * Get Number of Lines to Show
#--------------------------------------------------------------------------
def visible_line_number
item_max
end
#--------------------------------------------------------------------------
# * Create Command List
#--------------------------------------------------------------------------
def make_command_list
add_main_commands
add_formation_command
add_original_commands
add_save_command
add_game_end_command
end
#--------------------------------------------------------------------------
# * Add Main Commands to List
#--------------------------------------------------------------------------
def add_main_commands
add_command(Vocab::item, :item, main_commands_enabled)
add_command(Vocab::equip, :equip, main_commands_enabled)
add_command(Vocab::status, :status, main_commands_enabled)
end
#--------------------------------------------------------------------------
# * Add Formation to Command List
#--------------------------------------------------------------------------
def add_formation_command
end
#--------------------------------------------------------------------------
# * For Adding Original Commands
#--------------------------------------------------------------------------
def add_original_commands
end
#--------------------------------------------------------------------------
# * Add Save to Command List
#--------------------------------------------------------------------------
def add_save_command
add_command(Vocab::save, :save, save_enabled)
end
#--------------------------------------------------------------------------
# * Add Exit Game to Command List
#--------------------------------------------------------------------------
def add_game_end_command
end
#--------------------------------------------------------------------------
# * Add Save to Command List
#--------------------------------------------------------------------------
def add_save_command
add_command(Vocab::save, :save, save_enabled)
end
#--------------------------------------------------------------------------
# * Get Activation State of Main Commands
#--------------------------------------------------------------------------
def main_commands_enabled
$game_party.exists
end
#--------------------------------------------------------------------------
# * Get Activation State of Formation
#--------------------------------------------------------------------------
def formation_enabled
$game_party.members.size >= 2 && !$game_system.formation_disabled
end
#--------------------------------------------------------------------------
# * Get Activation State of Save
#--------------------------------------------------------------------------
def save_enabled
!$game_system.save_disabled
end
#--------------------------------------------------------------------------
# * Processing When OK Button Is Pressed
#--------------------------------------------------------------------------
def process_ok
@@last_command_symbol = current_symbol
super
end
#--------------------------------------------------------------------------
# * Restore Previous Selection Position
#--------------------------------------------------------------------------
def select_last
select_symbol(@@last_command_symbol)
end
# =-=-=-=-
#--------------------------------------------------------------------------
# * Get Number of Lines to Show
#--------------------------------------------------------------------------
def visible_line_number
return 1
end
#--------------------------------------------------------------------------
# * Get Digit Count
#--------------------------------------------------------------------------
def col_max
return 4
end
#--------------------------------------------------------------------------
# * Get Spacing for Items Arranged Side by Side
#--------------------------------------------------------------------------
def spacing
return 8
end
#--------------------------------------------------------------------------
# * Calculate Width of Window Contents
#--------------------------------------------------------------------------
def contents_width
(item_width + spacing) * item_max - spacing
end
#--------------------------------------------------------------------------
# * Calculate Height of Window Contents
#--------------------------------------------------------------------------
def contents_height
item_height
end
#--------------------------------------------------------------------------
# * Get Leading Digits
#--------------------------------------------------------------------------
def top_col
ox / (item_width + spacing)
end
#--------------------------------------------------------------------------
# * Set Leading Digits
#--------------------------------------------------------------------------
def top_col=(col)
col = 0 if col < 0
col = col_max - 1 if col > col_max - 1
self.ox = col * (item_width + spacing)
end
#--------------------------------------------------------------------------
# * Get Trailing Digits
#--------------------------------------------------------------------------
def bottom_col
top_col + col_max - 1
end
#--------------------------------------------------------------------------
# * Set Trailing Digits
#--------------------------------------------------------------------------
def bottom_col=(col)
self.top_col = col - (col_max - 1)
end
#--------------------------------------------------------------------------
# * Scroll Cursor to Position Within Screen
#--------------------------------------------------------------------------
def ensure_cursor_visible
self.top_col = index if index < top_col
self.bottom_col = index if index > bottom_col
end
#--------------------------------------------------------------------------
# * Get Rectangle for Displaying Items
#--------------------------------------------------------------------------
def item_rect(index)
rect = super
rect.x = index * (item_width + spacing)
rect.y = 0
rect
end
#--------------------------------------------------------------------------
# * Get Alignment
#--------------------------------------------------------------------------
def alignment
return 1
end
#--------------------------------------------------------------------------
# * Move Cursor Down
#--------------------------------------------------------------------------
def cursor_down(wrap = false)
end
#--------------------------------------------------------------------------
# * Move Cursor Up
#--------------------------------------------------------------------------
def cursor_up(wrap = false)
end
#--------------------------------------------------------------------------
# * Move Cursor One Page Down
#--------------------------------------------------------------------------
def cursor_pagedown
end
#--------------------------------------------------------------------------
# * Move Cursor One Page Up
#--------------------------------------------------------------------------
def cursor_pageup
end
#-=-=-=-=-=-=-=-=
end
#==============================================================================
# ** Scene_Menu
#------------------------------------------------------------------------------
# This class performs the menu screen processing.
#==============================================================================
class Scene_Menu < Scene_MenuBase
#--------------------------------------------------------------------------
# * Start Processing
#--------------------------------------------------------------------------
def start
super
create_command_window
create_gold_window
create_status_window
end
#--------------------------------------------------------------------------
# * Create Command Window
#--------------------------------------------------------------------------
def create_command_window
@command_window = Window_MenuCommand.new
@command_window.y = 32
@command_window.set_handler(:item, method(:command_item))
@command_window.set_handler(:equip, method(:command_personal))
@command_window.set_handler(:status, method(:command_personal))
@command_window.set_handler(:save, method(:command_save))
@command_window.set_handler(:cancel, method(:return_scene))
end
#--------------------------------------------------------------------------
# * Create Gold Window
#--------------------------------------------------------------------------
def create_gold_window
end
#--------------------------------------------------------------------------
# * Create Status Window
#--------------------------------------------------------------------------
def create_status_window
@status_window = Window_MenuStatus.new(@command_window.width, 0)
@status_window.x = 0
@status_window.y = 128
end
#--------------------------------------------------------------------------
# * [Item] Command
#--------------------------------------------------------------------------
def command_item
SceneManager.call(Scene_Item)
end
#--------------------------------------------------------------------------
# * [Skill], [Equipment] and [Status] Commands
#--------------------------------------------------------------------------
def command_personal
@status_window.select_last
@status_window.activate
@status_window.set_handler(:ok, method(:on_personal_ok))
@status_window.set_handler(:cancel, method(:on_personal_cancel))
end
#--------------------------------------------------------------------------
# * [Formation] Command
#--------------------------------------------------------------------------
def command_formation
@status_window.select_last
@status_window.activate
@status_window.set_handler(:ok, method(:on_formation_ok))
@status_window.set_handler(:cancel, method(:on_formation_cancel))
end
#--------------------------------------------------------------------------
# * [Save] Command
#--------------------------------------------------------------------------
def command_save
SceneManager.call(Scene_Save)
end
#--------------------------------------------------------------------------
# * [Exit Game] Command
#--------------------------------------------------------------------------
def command_game_end
SceneManager.call(Scene_End)
end
#--------------------------------------------------------------------------
# * [OK] Personal Command
#--------------------------------------------------------------------------
def on_personal_ok
case @command_window.current_symbol
when :skill
SceneManager.call(Scene_Skill)
when :equip
SceneManager.call(Scene_Equip)
when :status
SceneManager.call(Scene_Status)
end
end
#--------------------------------------------------------------------------
# * [Cancel] Personal Command
#--------------------------------------------------------------------------
def on_personal_cancel
@status_window.unselect
@command_window.activate
end
#--------------------------------------------------------------------------
# * Formation [OK]
#--------------------------------------------------------------------------
def on_formation_ok
if @status_window.pending_index >= 0
$game_party.swap_order(@status_window.index,
@status_window.pending_index)
@status_window.pending_index = -1
@status_window.redraw_item(@status_window.index)
else
@status_window.pending_index = @status_window.index
end
@status_window.activate
end
#--------------------------------------------------------------------------
# * Formation [Cancel]
#--------------------------------------------------------------------------
def on_formation_cancel
if @status_window.pending_index >= 0
@status_window.pending_index = -1
@status_window.activate
else
@status_window.unselect
@command_window.activate
end
end
end
module DataManager
def self.savefile_max
return 10
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
#███████████████████████████████████████████████████████████████████████████████
#██████████████████████████████Euphy Quick-Fix██████████████████████████████████
class Window_Base < Window
def draw_icon_face(actor, dest_rect, enable)
bitmap = Cache.face(actor.face_name)
rect = Rect.new(actor.face_index % 4 * 96, actor.face_index / 4 * 96, 96, 96)
bitmap.blur if dest_rect.width < 96/2
cache = Bitmap.new(dest_rect.width, dest_rect.height)
cache.stretch_blt(Rect.new(0,0,48, 48), bitmap, rect)
bitmap.dispose
contents.stretch_blt(dest_rect, cache, Rect.new(0,0,cache.width,cache.height), enable ? 255 : translucent_alpha)
end
end
#███████████████████████████████████████████████████████████████████████████████
#==============================================================================
# ** Window_SaveFile
#------------------------------------------------------------------------------
# This window displays save files on the save and load screens.
#==============================================================================
class Window_SaveFile < Window_Base
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_reader :selected # selected
#--------------------------------------------------------------------------
# * Object Initialization
# index : index of save files
#--------------------------------------------------------------------------
def initialize(height, index)
super(136, index * height, Graphics.width - 256, height)
@file_index = index
refresh
@selected = false
self.arrows_visible = false
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
contents.clear
change_color(normal_color)
name = Vocab::File + " #{@file_index + 1}"
draw_text(182, 20, 200, line_height, name)
@name_width = text_size(name).width
draw_main_actor
draw_main_name
draw_playtime(0, 0, contents.width, 0)
end
#███████████████████████████████████████████████████████████████████████████████
#██████████████████████████████Euphy Quick-Fix██████████████████████████████████
def draw_main_actor
header = DataManager.load_header(@file_index)
return unless header
image_rect = Rect.new(25, 10, 48, 48)
enable = true
draw_icon_face($game_party.battle_members[0], image_rect, enable)
end
def draw_main_name
header = DataManager.load_header(@file_index)
return unless header
draw_actor_name($game_party.battle_members[0], 182, 40, width = 112)
end
#███████████████████████████████████████████████████████████████████████████████
#--------------------------------------------------------------------------
# * Draw Party Characters
#--------------------------------------------------------------------------
def draw_party_characters(x, y)
header = DataManager.load_header(@file_index)
return unless header
header[:characters].each_with_index do |data, i|
draw_character(data[0], data[1], x + i * 48, y)
end
end
#--------------------------------------------------------------------------
# * Draw Play Time
#--------------------------------------------------------------------------
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
#--------------------------------------------------------------------------
# * Set Selected
#--------------------------------------------------------------------------
def selected=(selected)
@selected = selected
update_cursor
end
#--------------------------------------------------------------------------
# * Update Cursor
#--------------------------------------------------------------------------
def update_cursor
if @selected
cursor_rect.set(0, 0, 264, 68)
else
cursor_rect.empty
end
end
end
module DataManager
def self.savefile_max
return 10
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
#==============================================================================
# ** Window_SaveFile
#------------------------------------------------------------------------------
# This window displays save files on the save and load screens.
#==============================================================================
class Window_SaveFile < Window_Base
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_reader :selected # selected
#--------------------------------------------------------------------------
# * Object Initialization
# index : index of save files
#--------------------------------------------------------------------------
def initialize(height, index)
super(136, index * height, Graphics.width - 256, height)
@file_index = index
refresh
@selected = false
self.arrows_visible = false
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
contents.clear
change_color(normal_color)
name = Vocab::File + " #{@file_index + 1}"
draw_text(182, 20, 200, line_height, name)
@name_width = text_size(name).width
draw_party_characters(20, 58)
#draw_main_actor
#draw_main_name
draw_playtime(0, 0, contents.width, 0)
end
#--------------------------------------------------------------------------
# * Draw Party Characters
#--------------------------------------------------------------------------
def draw_party_characters(x, y)
header = DataManager.load_header(@file_index)
return unless header
header[:characters].each_with_index do |data, i|
draw_character(data[0], data[1], x + i * 48, y)
end
end
#--------------------------------------------------------------------------
# * Draw Play Time
#--------------------------------------------------------------------------
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
#--------------------------------------------------------------------------
# * Set Selected
#--------------------------------------------------------------------------
def selected=(selected)
@selected = selected
update_cursor
end
#--------------------------------------------------------------------------
# * Update Cursor
#--------------------------------------------------------------------------
def update_cursor
if @selected
cursor_rect.set(0, 0, 264, 68)
else
cursor_rect.empty
end
end
end
=begin
=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
=*=*=*=*=*=*=*=*=*=*=*=* [LDS] Save Screen =*=*=*=*=*=*=*=*=*=*=*=*
=*=*=*=*=*=*=*=*=*=*=*=* Date Created: 1/5/2013 =*=*=*=*=*=*=*=*=*=*=*=*
=*=*=*=*=*=*=*=*=*=*=*=* Last Updated: 1/5/2013 =*=*=*=*=*=*=*=*=*=*=*=*
=*=*=*=*=*=*=*=*=*=*=*=* Created by: Levi Stepp =*=*=*=*=*=*=*=*=*=*=*=*
=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
__________________________________________________________________________
/ \
| This save script allows you to view images on current saved files. |
| ~Up to 6 actors can be viewed~ |
| This may be used in commercial projects, as long as you give credit. |
\__________________________________________________________________________/
◆ There is no configuration. ◆
◆ PLUG N' PLAY ◆
=end
#==============================================================================
# ■ LDS_SAVE : Do not remove!
#==============================================================================
class LDS_SAVE
#--------------------------------------------------------------------------
# ● Variables
#--------------------------------------------------------------------------
attr_reader :name
attr_reader :level
attr_reader :hp
attr_reader :mp
attr_reader :mhp
attr_reader :mmp
attr_reader :face_name
attr_reader :face_index
#--------------------------------------------------------------------------
# ● Object Initialization
#--------------------------------------------------------------------------
def initialize(actor)
@name = actor.name
@level = actor.level
@hp = actor.hp; @mhp = actor.mhp
@mp = actor.mp; @mmp = actor.mmp
@face_name = actor.face_name
@face_index = actor.face_index
@dead = actor.dead?
end
#--------------------------------------------------------------------------
# ● Non-Combat Check
#--------------------------------------------------------------------------
def dead?
@dead
end
#--------------------------------------------------------------------------
# ● HP Set
#--------------------------------------------------------------------------
def hp_rate
@hp.to_f / @mhp
end
#--------------------------------------------------------------------------
# ● MP Set
#--------------------------------------------------------------------------
def mp_rate
@mmp > 0 ? @mp.to_f / @mmp : 0
end
end
#==============================================================================
# ■ Game_Party
#==============================================================================
class Game_Party < Game_Unit
#--------------------------------------------------------------------------
# ● Party Member Graphics
#--------------------------------------------------------------------------
def member_for_savefile
members.collect { |actor| LDS_SAVE.new(actor) }
end
end
#==============================================================================
# ■ DataManager
#==============================================================================
class << DataManager
#--------------------------------------------------------------------------
# ● Create Location / Actors
#--------------------------------------------------------------------------
alias make_save_header_faces make_save_header
def make_save_header
header = make_save_header_faces
header[:map_name] = $game_map.display_name
header[:actors] = $game_party.member_for_savefile
header
end
end
#==============================================================================
# ■ Window_SaveFile
#==============================================================================
class Window_SaveFile < Window_Base
#--------------------------------------------------------------------------
# ● Object Initialization
# Index: Saved Files
#--------------------------------------------------------------------------
def initialize(height, index)
super(0, index * height, window_width, height)
@file_index = index
refresh
@selected = false
end
#--------------------------------------------------------------------------
# ● Window Width
#--------------------------------------------------------------------------
def window_width
return 134
end
#--------------------------------------------------------------------------
# ● Refresh
#--------------------------------------------------------------------------
def refresh
contents.clear
change_color(normal_color)
name = Vocab::File + " #{@file_index + 1}"
draw_text(4, 0, 200, line_height, name)
@name_width = text_size(name).width
end
end
#==============================================================================
# ■ Window_SaveFile
#==============================================================================
class Window_SaveInfo < Window_Selectable
#--------------------------------------------------------------------------
# ● Object Initialization
#--------------------------------------------------------------------------
def initialize(x, h)
@actors = []
super(x, h, Graphics.width - x, Graphics.height - h)
self.file_index = index
end
#--------------------------------------------------------------------------
# ● Capture Height
#--------------------------------------------------------------------------
def item_height
(contents_height - (line_height * 2)) / row_num
end
#--------------------------------------------------------------------------
# ● Calculate Height of the Window
#--------------------------------------------------------------------------
def contents_height
height - standard_padding * 2
end
#--------------------------------------------------------------------------
# ● Rows
#--------------------------------------------------------------------------
def row_num
return 3
end
#--------------------------------------------------------------------------
# ● Getting Digits
#--------------------------------------------------------------------------
def col_max
return 2
end
#--------------------------------------------------------------------------
# ● Update the Bottom Padding
#--------------------------------------------------------------------------
def update_padding_bottom
end
#--------------------------------------------------------------------------
# ● Gets the width of the blanks
#--------------------------------------------------------------------------
def spacing
return 16
end
#--------------------------------------------------------------------------
# ● Actor Limit
#--------------------------------------------------------------------------
def item_max
return [@actors.size, 6].min
end
#--------------------------------------------------------------------------
# ● File changes
#--------------------------------------------------------------------------
def file_index=(index)
return if @file_index == index
@file_index = index
header = DataManager.load_header(@file_index)
@actors = !header.nil? ? header[:actors] : []
@map_name = !header.nil? ? header[:map_name] : ""
@playtime = !header.nil? ? header[:playtime_s] : ""
create_contents
refresh
end
#--------------------------------------------------------------------------
# ● Refresh
#--------------------------------------------------------------------------
def refresh
super
if @actors.empty? or @actors.nil?
draw_text(0, 0, contents_width, contents_height, "- empty -", 1)
return
end
draw_text(0, 0, contents_width, line_height, @map_name)
draw_playtime(200, 0, contents_width - 200)
draw_horz_line(line_height)
end
#--------------------------------------------------------------------------
# ● Draw Item
#--------------------------------------------------------------------------
def draw_item(index)
return if @actors.empty? or @actors.nil?
actor = @actors[index]
rect = item_rect(index)
rect.y += line_height * 2
draw_actor_face(actor, rect.x, rect.y, !actor.dead?)
draw_actor_name(actor, rect.x + 100, rect.y+line_height*0)
draw_actor_level(actor, rect.x + 100, rect.y+line_height*1)
w = [124, rect.width - 100].min
draw_actor_hp(actor, rect.x + 100, rect.y+line_height*2, w)
draw_actor_mp(actor, rect.x + 100, rect.y+line_height*3, w)
end
#--------------------------------------------------------------------------
# ● Draw Playtime
#--------------------------------------------------------------------------
def draw_playtime(x, y, width)
draw_text(x, y, width, line_height, @playtime, 2)
end
#--------------------------------------------------------------------------
# ● Draw a horizontal line
#--------------------------------------------------------------------------
def draw_horz_line(y)
line_y = y + line_height / 2 - 1
contents.fill_rect(0, line_y, contents_width, 2, line_color)
end
#--------------------------------------------------------------------------
# ● Gets the color of the horizontal line
#--------------------------------------------------------------------------
def line_color
color = normal_color
color.alpha = 48
color
end
end
#==============================================================================
# ■ Scene_File
#==============================================================================
class Scene_File < Scene_MenuBase
#--------------------------------------------------------------------------
# ● Create a save file window
#--------------------------------------------------------------------------
alias create_savefile_windows_save create_savefile_windows
def create_savefile_windows
create_savefile_windows_save
@info_window = Window_SaveInfo.new(@savefile_windows[0].window_width, @help_window.height)
end
#--------------------------------------------------------------------------
# ● Initialization of Selected State
#--------------------------------------------------------------------------
alias init_selection_save init_selection
def init_selection
init_selection_save
@info_window.file_index = @index
end
#--------------------------------------------------------------------------
# ● Get the number of save files that are displayed in the screen
#--------------------------------------------------------------------------
def visible_max
return @savefile_viewport.rect.height / @help_window.height
end
#--------------------------------------------------------------------------
# ● Cursor updates
#--------------------------------------------------------------------------
alias update_cursor_save update_cursor
def update_cursor
update_cursor_save
@info_window.file_index = @index
end
end
=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 -------------------------------------------------------------------
#===============================================================================