=begin ************************************************************************
Alternate Save Layout Ver.1.01
---------------------------------------------------------------------------
Changes the layout of the save and load screen.
Source: http://neomemo.web.fc2.com [Neo Memo] (defunct)
=end # ************************************************************************
#-information------------------------------------------------------------------
$ziifee ||= {}
$ziifee[:SaveLayout] = :TypeA
#------------------------------------------------------------------------------
#-memo-------------------------------------------------------------------------
#
#
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#
#
#------------------------------------------------------------------------------
module ZiifSaveLayoutA
#
#
File_column = 3 # number of columns
File_row = 6 # number of rows
D_LineNumber = 6 # draw line number
File_Align = 1 # Test position (0:left, 1:center, 2:right)
D_StoryList = false # Draw story list? ( true / false )
V_None = "No Data" # Message for none
#
WindowMargin = 8 # Window margin by (px)
WindowLineNumber = 7 # Window line number limit
WindowTransparency = false # Set window transparency ( true / false )
#
HelpWTransparency = false # Use help transparency ( true / false )
#
SaveConfirm = true # Save confirmation? ( true / false )
SConfirmationDefault = 0 # Set default cursor ( 0:Yes / 1:No )
V_SConfirmation = "Do you want to save?" # Message prompt
V_SConfirmationYes = "Yes" # Message for yes
V_SConfirmationNo = "No" # Message for no
#
LoadConfirm = true # Load confirmation? ( true / false )
LConfirmationDefault = 0 # Set default cursor ( 0:Yes / 1:No )
V_LConfirmation = "Do you want to load?" # Message prompt
V_LConfirmationYes = "Yes" # Message for yes
V_LConfirmationNo = "No" # Message for no
# Set picture background ( "" : put the image in Graphics/Pictures folder)
SaveBackground = "" # picture for Save Background
LoadBackground = "" # picture for Load Background
#
# Display settings ( true : display / false : don't display )
#
D_File = true # Show file?
D_Story = true # Show story?
D_Playtime = true # Show playtime?
#
D_Area = true # Show area?
D_Gold = true # Show gold?
D_AG_Line = false # Adjust sprite on facesets?
#
D_PartyFaces = false # Show party face? (false, due to clutter)
D_Characters = true # Show characters?
#
D_LeaderInfo = true # Show leader info? (true, to show stats)
D_Face = true # Show face?
D_Name = true # Show name?
D_Level = true # Show level?
D_Class = true # Show class?
D_Nickname = true # Show nickname?
D_HPMP = true # Show hp/mp?
D_UnderName = :level # Show something under name? ( :level / :class / nil )
D_Param = true # Show param/ stats?
D_Equip = false # Show equip?
#
end
module ZiifManager
# [ 2 ]
# Texts : Color.new (R, G, B)
Story_Color = Color.new(255, 255, 128) # Texts for story
Area_Color = Color.new(128, 255, 0) # Area text body
#
Story_VarID = 0 # ID
StorySet ||= Hash.new("")
StorySet[1] = "" # ID:01
StorySet[2] = "l" # ID:02
StorySet[3] = "" # ID:03
#-memo---------------------------------------------------------------------
# StorySet[l] = "" #
#--------------------------------------------------------------------------
#
AreaSet ||= Hash.new(Hash.new(nil))
AreaSet[1] = Hash.new(nil) #
AreaSet[1][1] = "" #
AreaSet[1][2] = "" #
AreaSet[2] = Hash.new(nil) #
AreaSet[2][1] = "" #
#-memo---------------------------------------------------------------------
# AreaSet[vID] = Hash.new(nil) #
# AreaSet[vID][[ID] = "" #
#
#--------------------------------------------------------------------------
end
#******************************************************************************
#
#******************************************************************************
#==============================================================================
# ZiifSaveLayoutA
#==============================================================================
module ZiifSaveLayoutA
#--------------------------------------------------------------------------
# self.savefile_max
#--------------------------------------------------------------------------
def self.savefile_max
File_column * File_row
end
#--------------------------------------------------------------------------
# self.save_background?
#--------------------------------------------------------------------------
def self.save_background?
SaveBackground != ""
end
#--------------------------------------------------------------------------
# self.save_background_bitmap
#--------------------------------------------------------------------------
def self.save_background_bitmap
Cache.picture(SaveBackground)
end
#--------------------------------------------------------------------------
# self.load_background?
#--------------------------------------------------------------------------
def self.load_background?
LoadBackground != ""
end
#--------------------------------------------------------------------------
# self.load_background_bitmap
#--------------------------------------------------------------------------
def self.load_background_bitmap
Cache.picture(LoadBackground)
end
end
#==============================================================================
# ZiifManager
#==============================================================================
module ZiifManager
#--------------------------------------------------------------------------
# self.story_name
#--------------------------------------------------------------------------
def self.story_name(story_id)
StorySet[story_id]
end
#--------------------------------------------------------------------------
# self.area_name
#--------------------------------------------------------------------------
def self.area_name(map_id, region_id = nil)
AreaSet[map_id][region_id] || map_name(map_id)
end
#--------------------------------------------------------------------------
# self.map_name
#--------------------------------------------------------------------------
def self.map_name(map_id)
@map_name_cache ||= {}
unless @map_name_cache[map_id]
map = load_data(sprintf("Data/Map%03d.rvdata2", map_id)) rescue nil
@map_name_cache[map_id] = (map ? map.display_name : "No MapData")
end
@map_name_cache[map_id]
end
end
#==============================================================================
# ZiifManager::DrawingModule
#==============================================================================
module ZiifManager::DrawingModule
#--------------------------------------------------------------------------
# story_color
#--------------------------------------------------------------------------
def story_color
ZiifManager::Story_Color
end
#--------------------------------------------------------------------------
# area_color
#--------------------------------------------------------------------------
def area_color
ZiifManager::Area_Color
end
#--------------------------------------------------------------------------
# draw_file_number
#--------------------------------------------------------------------------
def draw_file_number(index, x, y, enabled = true, width = 120, align = 0)
change_color(normal_color, enabled)
draw_text(x, y, width, line_height, Vocab::File + " #{index + 1}", align)
end
#--------------------------------------------------------------------------
# draw_story_name
#--------------------------------------------------------------------------
def draw_story_name(story_id, x, y, width = 256, align = 0)
change_color(story_color)
text = ZiifManager.story_name(story_id)
draw_text(x, y, width, line_height, text, align)
end
#--------------------------------------------------------------------------
# draw_area_map
#--------------------------------------------------------------------------
def draw_area_map(map_id, region_id, x, y, width = 256, align = 0)
change_color(area_color)
text = ZiifManager.area_name(map_id, region_id)
draw_text(x, y, width, line_height, text, align)
end
end
#==============================================================================
# �� DataManager
#==============================================================================
class << DataManager
#--------------------------------------------------------------------------
# savefile_max
#--------------------------------------------------------------------------
def savefile_max
return ZiifSaveLayoutA.savefile_max
end
#--------------------------------------------------------------------------
# make_save_header
#--------------------------------------------------------------------------
alias :ziif_save_layout_01_make_save_header :make_save_header
def make_save_header
header = ziif_save_layout_01_make_save_header
header[:story_id] = $game_system.ziif_story_id
header[:map_id] = $game_map.map_id
header[:region_id] = $game_player.region_id
header[:gold] = $game_party.gold
header[:faces] = $game_party.ziif_faces_for_savefile
header[:leader] = $game_party.ziif_leader_for_savefile
header
end
end
#******************************************************************************
#
#******************************************************************************
#==============================================================================
# Game_System
#==============================================================================
class Game_System
#--------------------------------------------------------------------------
# ziif_story_id
#--------------------------------------------------------------------------
def ziif_story_id
$game_variables[ZiifManager::Story_VarID]
end
end
#==============================================================================
# Game_Party
#==============================================================================
class Game_Party
#--------------------------------------------------------------------------
# ziif_faces_for_savefile
#--------------------------------------------------------------------------
def ziif_faces_for_savefile
battle_members.collect do |actor|
[actor.face_name, actor.face_index]
end
end
#--------------------------------------------------------------------------
# ziif_leader_for_savefile
#--------------------------------------------------------------------------
def ziif_leader_for_savefile
return leader
end
end
#******************************************************************************
#
#******************************************************************************
#==============================================================================
# Window_ZiifFileList
#------------------------------------------------------------------------------
#
#==============================================================================
class Window_ZiifFileList < Window_Selectable
#--------------------------------------------------------------------------
# Mix-In
#--------------------------------------------------------------------------
include ZiifManager::DrawingModule #
#--------------------------------------------------------------------------
# initialize
#--------------------------------------------------------------------------
def initialize
rect = window_rect
super(rect.x, rect.y, rect.width, rect.height)
self.opacity = 0
refresh
activate
end
#--------------------------------------------------------------------------
# window_rect
#--------------------------------------------------------------------------
def window_rect
rect = Rect.new
rect.x = 4
rect.y = 48
rect.width = Graphics.width-8
rect.height = fitting_height(ZiifSaveLayoutA::D_LineNumber)
rect
end
#--------------------------------------------------------------------------
# column_max
#--------------------------------------------------------------------------
def col_max
ZiifSaveLayoutA::File_column
end
#--------------------------------------------------------------------------
# item_max
#--------------------------------------------------------------------------
def item_max
DataManager.savefile_max
end
#--------------------------------------------------------------------------
# alignment
#--------------------------------------------------------------------------
def alignment
return ZiifSaveLayoutA::File_Align
end
#--------------------------------------------------------------------------
# file_number_draw
#--------------------------------------------------------------------------
def file_number_draw?
!ZiifSaveLayoutA::D_StoryList
end
#--------------------------------------------------------------------------
# story_name_draw
#--------------------------------------------------------------------------
def story_name_draw?
ZiifSaveLayoutA::D_StoryList
end
#--------------------------------------------------------------------------
# header
#--------------------------------------------------------------------------
def header(index)
DataManager.load_header(index)
end
#--------------------------------------------------------------------------
# enable
#--------------------------------------------------------------------------
def enable?(index)
header(index)
end
#--------------------------------------------------------------------------
# process_ok
#--------------------------------------------------------------------------
def process_ok
if current_item_enabled?
Input.update
deactivate
call_ok_handler
else
Sound.play_buzzer
end
end
#--------------------------------------------------------------------------
#
#--------------------------------------------------------------------------
def current_item_enabled?
!SceneManager.scene_is?(Scene_Load) || enable?(self.index)
end
#--------------------------------------------------------------------------
#
#--------------------------------------------------------------------------
def draw_item(index)
rect = item_rect(index)
#
if file_number_draw?
draw_file_number(index,rect.x,rect.y,enable?(index),rect.width,alignment)
end
#
if story_name_draw?
header = header(index)
if header && header[:story_id]
draw_story_name(header[:story_id],rect.x,rect.y,rect.width,alignment)
else
change_color(normal_color, false)
draw_text(rect, ZiifSaveLayoutA::V_None, alignment)
end
end
end
end
#==============================================================================
# Window_ZiifSaveFile
#------------------------------------------------------------------------------
#
#==============================================================================
class Window_ZiifSaveFile < Window_Base
#--------------------------------------------------------------------------
# Mix-In
#--------------------------------------------------------------------------
include ZiifManager::DrawingModule #
#--------------------------------------------------------------------------
#
#--------------------------------------------------------------------------
attr_reader :selected #
attr_reader :header #
#--------------------------------------------------------------------------
# initialize
# index :
#--------------------------------------------------------------------------
def initialize(dummy_height, index)
rect = window_rect
super(rect.x, rect.y, rect.width, rect.height)
self.opacity = 0 if ZiifSaveLayoutA::WindowTransparency
@file_index = index
clear_header
refresh
self.visible = false
@selected = false
end
#--------------------------------------------------------------------------
# window_rect
#--------------------------------------------------------------------------
def window_rect
rect = Rect.new
rect.x = ZiifSaveLayoutA::WindowMargin
rect.y = Graphics.height - ZiifSaveLayoutA::WindowMargin
rect.width = Graphics.width - ZiifSaveLayoutA::WindowMargin * 2
rect.height = fitting_height(ZiifSaveLayoutA::WindowLineNumber)
rect.y -= rect.height
rect
end
#--------------------------------------------------------------------------
# selected
#--------------------------------------------------------------------------
def selected=(selected)
@selected = selected
update_select
end
#--------------------------------------------------------------------------
# update_select
#--------------------------------------------------------------------------
def update_select
self.visible = self.selected
update
end
#--------------------------------------------------------------------------
# icon_header
#--------------------------------------------------------------------------
def load_header
@header = DataManager.load_header(@file_index)
end
#--------------------------------------------------------------------------
# clear_header
#--------------------------------------------------------------------------
def clear_header
@header = nil
end
#--------------------------------------------------------------------------
# header
#--------------------------------------------------------------------------
def header?(symbol)
@header && @header[symbol]
end
#--------------------------------------------------------------------------
# refresh
#--------------------------------------------------------------------------
def refresh
contents.clear
load_header
draw_file_contents
draw_no_file unless @header
clear_header
end
#--------------------------------------------------------------------------
# draw_file_contents
#--------------------------------------------------------------------------
def draw_file_contents
end
#--------------------------------------------------------------------------
# draw_no_file
#--------------------------------------------------------------------------
def draw_no_file
rect = Rect.new(0, 0, contents.width, line_height)
rect.y = (contents.height - rect.height) / 2
change_color(normal_color, false)
draw_text(rect, ZiifSaveLayoutA::V_None, 1)
end
end
#==============================================================================
# Window_ZiifFileConfirmation
#------------------------------------------------------------------------------
#
#==============================================================================
class Window_ZiifFileConfirmation < Window_Command
#--------------------------------------------------------------------------
# initialize
#--------------------------------------------------------------------------
def initialize
super(window_x, window_y)
self.z = 200
self.openness = 0
deactivate
end
#--------------------------------------------------------------------------
# window_x
#--------------------------------------------------------------------------
def window_x
return (Graphics.width-window_width) / 2
end
#--------------------------------------------------------------------------
# window_y
#--------------------------------------------------------------------------
def window_y
return (Graphics.height-window_height) / 2
end
#--------------------------------------------------------------------------
# window_width
#--------------------------------------------------------------------------
def window_width
return 128
end
#--------------------------------------------------------------------------
# visible_line_number
#--------------------------------------------------------------------------
def visible_line_number
return 2
end
#--------------------------------------------------------------------------
# select_default
#--------------------------------------------------------------------------
def select_default
end
end
#==============================================================================
# �� Window_ZiifSaveConfirmation
#------------------------------------------------------------------------------
#
#==============================================================================
class Window_ZiifSaveConfirmation < Window_ZiifFileConfirmation
#--------------------------------------------------------------------------
# make_command_list
#--------------------------------------------------------------------------
def make_command_list
add_command(ZiifSaveLayoutA::V_SConfirmationYes, :save)
add_command(ZiifSaveLayoutA::V_SConfirmationNo, :cancel)
end
#--------------------------------------------------------------------------
# update_help
#--------------------------------------------------------------------------
def update_help
@help_window.set_text(ZiifSaveLayoutA::V_SConfirmation)
end
#--------------------------------------------------------------------------
# select_default
#--------------------------------------------------------------------------
def select_default
select(ZiifSaveLayoutA::SConfirmationDefault)
end
#--------------------------------------------------------------------------
# process_ok
#--------------------------------------------------------------------------
def process_ok
return super if current_symbol != :save
if current_item_enabled?
Input.update
deactivate
call_ok_handler
else
Sound.play_buzzer
end
end
end
#==============================================================================
# �� Window_ZiifLoadConfirmation
#------------------------------------------------------------------------------
#
#==============================================================================
class Window_ZiifLoadConfirmation < Window_ZiifFileConfirmation
#--------------------------------------------------------------------------
# make_command_list
#--------------------------------------------------------------------------
def make_command_list
add_command(ZiifSaveLayoutA::V_LConfirmationYes, :load)
add_command(ZiifSaveLayoutA::V_LConfirmationNo, :cancel)
end
#--------------------------------------------------------------------------
# update_help
#--------------------------------------------------------------------------
def update_help
@help_window.set_text(ZiifSaveLayoutA::V_LConfirmation)
end
#--------------------------------------------------------------------------
# select_default
#--------------------------------------------------------------------------
def select_default
select(ZiifSaveLayoutA::LConfirmationDefault)
end
#--------------------------------------------------------------------------
# process_ok
#--------------------------------------------------------------------------
def process_ok
return super if current_symbol != :load
if current_item_enabled?
Input.update
deactivate
call_ok_handler
else
Sound.play_buzzer
end
end
end
#******************************************************************************
#
#******************************************************************************
#==============================================================================
# Scene_File
#==============================================================================
class Scene_File
#--------------------------------------------------------------------------
# ziif_file_background
#--------------------------------------------------------------------------
def ziif_file_background?
return false
end
#--------------------------------------------------------------------------
# ziif_file_background_bitmap
#--------------------------------------------------------------------------
def ziif_file_background_bitmap
SceneManager.background_bitmap
end
#--------------------------------------------------------------------------
# file_confirm
#--------------------------------------------------------------------------
def file_confirm?
return false
end
#--------------------------------------------------------------------------
# confirmation_window
#--------------------------------------------------------------------------
def confirmation_window
return Window_ZiifFileConfirmation
end
#--------------------------------------------------------------------------
# create_background
#--------------------------------------------------------------------------
alias :ziif_save_layout_01_create_background :create_background
def create_background
if ziif_file_background?
create_ziif_file_background
else
ziif_save_layout_01_create_background
end
end
#--------------------------------------------------------------------------
# create_ziif_file_background
#--------------------------------------------------------------------------
def create_ziif_file_background
@background_sprite = Sprite.new
@background_sprite.bitmap = ziif_file_background_bitmap
end
#--------------------------------------------------------------------------
# create_help_window
#--------------------------------------------------------------------------
alias :ziif_save_layout_01_create_help_window :create_help_window
def create_help_window
ziif_save_layout_01_create_help_window
@help_window.opacity = 0 if ZiifSaveLayoutA::HelpWTransparency
end
#--------------------------------------------------------------------------
# create_savefile_windows
#--------------------------------------------------------------------------
def create_savefile_windows
create_filelist_window
create_savefile_windows_sub
create_confirmation_window
end
#--------------------------------------------------------------------------
# create_filelist_window
#--------------------------------------------------------------------------
def create_filelist_window
@filelist_window = Window_ZiifFileList.new
@filelist_window.set_handler(:ok, method(:on_filelist_ok))
@filelist_window.set_handler(:cancel, method(:return_scene))
end
#--------------------------------------------------------------------------
# create_savefile_windows_sub
#--------------------------------------------------------------------------
def create_savefile_windows_sub
@savefile_windows = Array.new(item_max) do |i|
Window_ZiifSaveFile.new(0, i)
end
end
#--------------------------------------------------------------------------
# create_confirmation_window
#--------------------------------------------------------------------------
def create_confirmation_window
@confirmation_window = confirmation_window.new
@confirmation_window.help_window = @help_window
@confirmation_window.set_handler(:ok, method(:on_confirmation_ok))
@confirmation_window.set_handler(:cancel, method(:on_confirmation_cancel))
@confirmation_window.select_default
end
#--------------------------------------------------------------------------
# init_selection
#--------------------------------------------------------------------------
def init_selection
@filelist_window.select(first_savefile_index)
@savefile_windows[index].selected = true
@last_index = index
set_file_index
end
#--------------------------------------------------------------------------
# index
#--------------------------------------------------------------------------
def index
@filelist_window.index
end
#--------------------------------------------------------------------------
# set_file_index
#--------------------------------------------------------------------------
def set_file_index
@index = index
end
#--------------------------------------------------------------------------
# update_savefile_selection
#--------------------------------------------------------------------------
def update_savefile_selection
if index != @last_index
set_file_index
@savefile_windows[@last_index].selected = false
@savefile_windows[index].selected = true
@last_index = index
end
end
#--------------------------------------------------------------------------
# on_filelist_ok
#--------------------------------------------------------------------------
def on_filelist_ok
set_file_index
if file_confirm?
Sound.play_ok
activate_confirmation_window
else
on_savefile_ok
end
end
#--------------------------------------------------------------------------
# activate_confirmation_window
#--------------------------------------------------------------------------
def activate_confirmation_window
@confirmation_window.activate
@confirmation_window.open
end
#--------------------------------------------------------------------------
# on_confirmation_ok
#--------------------------------------------------------------------------
def on_confirmation_ok
on_savefile_ok
end
#--------------------------------------------------------------------------
# on_confirmation_cancel
#--------------------------------------------------------------------------
def on_confirmation_cancel
@help_window.set_text(help_window_text)
@confirmation_window.select_default
@confirmation_window.close
@filelist_window.activate
end
end
#==============================================================================
# Scene_Save
#==============================================================================
class Scene_Save
#--------------------------------------------------------------------------
# ziif_file_background
#--------------------------------------------------------------------------
def ziif_file_background?
ZiifSaveLayoutA.save_background?
end
#--------------------------------------------------------------------------
# ziif_file_background_bitmap
#--------------------------------------------------------------------------
def ziif_file_background_bitmap
ZiifSaveLayoutA.save_background_bitmap
end
#--------------------------------------------------------------------------
# file_confirm
#--------------------------------------------------------------------------
def file_confirm?
ZiifSaveLayoutA::SaveConfirm
end
#--------------------------------------------------------------------------
# confirmation_window
#--------------------------------------------------------------------------
def confirmation_window
return Window_ZiifSaveConfirmation
end
#--------------------------------------------------------------------------
# on_savefile_ok
#--------------------------------------------------------------------------
alias :ziif_save_layout_01_save_on_savefile_ok :on_savefile_ok
def on_savefile_ok
ziif_save_layout_01_save_on_savefile_ok
@confirmation_window.close
@filelist_window.activate
end
end
#==============================================================================
# Scene_Load
#==============================================================================
class Scene_Load
#--------------------------------------------------------------------------
# ziif_file_background
#--------------------------------------------------------------------------
def ziif_file_background?
ZiifSaveLayoutA.load_background?
end
#--------------------------------------------------------------------------
# ziif_file_background_bitmap
#--------------------------------------------------------------------------
def ziif_file_background_bitmap
ZiifSaveLayoutA.load_background_bitmap
end
#--------------------------------------------------------------------------
# file_confirm
#--------------------------------------------------------------------------
def file_confirm?
ZiifSaveLayoutA::LoadConfirm
end
#--------------------------------------------------------------------------
# confirmation_window
#--------------------------------------------------------------------------
def confirmation_window
return Window_ZiifLoadConfirmation
end
#--------------------------------------------------------------------------
# on_savefile_ok
#--------------------------------------------------------------------------
alias :ziif_save_layout_01_load_on_savefile_ok :on_savefile_ok
def on_savefile_ok
ziif_save_layout_01_load_on_savefile_ok
@confirmation_window.close
@filelist_window.activate
end
end
#******************************************************************************
#
#******************************************************************************
#-memo-------------------------------------------------------------------------
#
#------------------------------------------------------------------------------
#==============================================================================
# Window_ZiifFileList
#==============================================================================
class Window_ZiifFileList < Window_Selectable
#--------------------------------------------------------------------------
# window_rect
#--------------------------------------------------------------------------
alias :ziif_line_help_file_window_rect :window_rect
def window_rect
rect = ziif_line_help_file_window_rect
rect.y -= 6 if $ziifee[:LineHelp]
rect
end
end
#==============================================================================
# Scene_File
#==============================================================================
class Scene_File
#--------------------------------------------------------------------------
# create_help_window
#--------------------------------------------------------------------------
alias :ziif_line_help_file_create_help_window :create_help_window
def create_help_window
return ziif_line_help_file_create_help_window unless $ziifee[:LineHelp]
@help_window = Window_ZiifLineHelp.new(1)
@help_window.set_text(help_window_text)
end
end
#******************************************************************************
#
#******************************************************************************
#-memo-------------------------------------------------------------------------
# For Window_ZiifSaveFile
#------------------------------------------------------------------------------
#==============================================================================
# Window_ZiifSaveFile
#==============================================================================
class Window_ZiifSaveFile
#--------------------------------------------------------------------------
# draw_file_contents
#--------------------------------------------------------------------------
def draw_file_contents
draw_file_info
draw_party_info
draw_leader_info
draw_party_faces
draw_party_characters
end
#--------------------------------------------------------------------------
# draw_file_info
#--------------------------------------------------------------------------
def draw_file_info
draw_x = 4
#
if ZiifSaveLayoutA::D_File
draw_file_number(@file_index, draw_x, 0)
draw_x += 128
end
#
if ZiifSaveLayoutA::D_Story && header?(:story_id)
draw_story_name(@header[:story_id], draw_x, 0)
end
#
if ZiifSaveLayoutA::D_Playtime && header?(:playtime_s)
change_color(normal_color)
draw_text(4, 0, contents.width - 8, line_height, @header[:playtime_s], 2)
end
end
#--------------------------------------------------------------------------
# currency_unit
#--------------------------------------------------------------------------
def currency_unit
Vocab::currency_unit
end
#--------------------------------------------------------------------------
# draw_party_info
#--------------------------------------------------------------------------
def draw_party_info
draw_y = contents.height - line_height
#
if ZiifSaveLayoutA::D_Area && header?(:map_id)
map_align = (ZiifSaveLayoutA::D_AG_Line ? 0 : 2)
map_id = @header[:map_id]
region_id = @header[:region_id]
draw_area_map(map_id, region_id, 4, draw_y, contents.width-8, map_align)
draw_y -= line_height unless ZiifSaveLayoutA::D_AG_Line
end
#
if ZiifSaveLayoutA::D_Gold && header?(:gold)
gold = @header[:gold]
draw_currency_value(gold, currency_unit, 4, draw_y, contents.width - 8)
end
end
#--------------------------------------------------------------------------
# file_info_draw
#--------------------------------------------------------------------------
def file_info_draw?
ZiifSaveLayoutA::D_File || ZiifSaveLayoutA::D_Story ||
ZiifSaveLayoutA::D_Playtime
end
#--------------------------------------------------------------------------
# draw_leader_info
#--------------------------------------------------------------------------
def draw_leader_info
return 0, 0 unless ZiifSaveLayoutA::D_LeaderInfo && header?(:leader)
actor = @header[:leader]
draw_x = 4
draw_y = (file_info_draw? ? line_height : 0)
#
if ZiifSaveLayoutA::D_Face
draw_actor_face(actor, draw_x, draw_y)
draw_x += 100
end
bw = draw_leader_base_info(actor, draw_x, draw_y + line_height)
nw = draw_leader_name_info(actor, draw_x, draw_y) - draw_x
#
if nw <= bw && bw > 0
draw_x += bw + 8
elsif nw > 0 && bw == 0
draw_y += line_height
elsif nw > bw && bw > 0
draw_x += bw + 8
draw_y += line_height
end
#
param_width = contents.width - draw_x
line = draw_leader_parameters(actor, draw_x, draw_y, param_width)
draw_y += line * line_height
#
line = draw_leader_equipments(actor, draw_x + 16, draw_y)
draw_y += line * line_height
return draw_x, draw_y
end
#--------------------------------------------------------------------------
# draw_leader_base_info
#--------------------------------------------------------------------------
def draw_leader_base_info(actor, x, y)
draw_width = 0
#
if ZiifSaveLayoutA::D_Level && ZiifSaveLayoutA::D_UnderName == :level
draw_actor_level(actor, x, y)
draw_width = [draw_width, 96].max
end
#
if ZiifSaveLayoutA::D_Class && ZiifSaveLayoutA::D_UnderName == :class
draw_actor_class(actor, x, y)
draw_width = [draw_width, 112].max
end
#
if ZiifSaveLayoutA::D_HPMP
draw_actor_hp(actor, x, y + line_height * 1)
draw_actor_mp(actor, x, y + line_height * 2)
draw_width = [draw_width, 124].max
end
return draw_width
end
#--------------------------------------------------------------------------
# draw_leader_name_info
#--------------------------------------------------------------------------
def draw_leader_name_info(actor, x, y)
draw_x = x
#
if ZiifSaveLayoutA::D_Name
draw_actor_name(actor, draw_x, y)
draw_x += 126
end
#
if ZiifSaveLayoutA::D_Level && ZiifSaveLayoutA::D_UnderName != :level
draw_actor_level(actor, draw_x, y)
draw_x += 80
end
#
if ZiifSaveLayoutA::D_Class && ZiifSaveLayoutA::D_UnderName != :class
draw_actor_class(actor, draw_x, y)
draw_x += 110
end
#
if ZiifSaveLayoutA::D_Nickname
draw_actor_nickname(actor, draw_x, y)
draw_x += 180
end
return draw_x
end
#--------------------------------------------------------------------------
# draw_leader_parameters
#--------------------------------------------------------------------------
def draw_leader_parameters(actor, x, y, width = 120)
return 0 unless ZiifSaveLayoutA::D_Param
col_num = [width / 128, 1].max
draw_width = width / col_num
6.times do |i|
draw_x = x + draw_width * (i % col_num) + 4
draw_y = y + line_height * (i / col_num)
draw_actor_param_with_width(actor, draw_x, draw_y, i + 2, draw_width - 8)
end
return (5 + col_num) / col_num
end
#--------------------------------------------------------------------------
# draw_actor_param_with_width
#--------------------------------------------------------------------------
def draw_actor_param_with_width(actor, x, y, param_id, width)
change_color(system_color)
draw_text(x, y, width - 36, line_height, Vocab::param(param_id))
change_color(normal_color)
draw_text(x + width - 36, y, 36, line_height, actor.param(param_id), 2)
end
#--------------------------------------------------------------------------
# draw_leader_equipments
#--------------------------------------------------------------------------
def draw_leader_equipments(actor, x, y)
return 0 unless ZiifSaveLayoutA::D_Equip
actor.equips.each_with_index do |item, i|
draw_item_name(item, x, y + line_height * i)
end
return actor.equips.size
end
#--------------------------------------------------------------------------
# leader_face_draw
#--------------------------------------------------------------------------
def leader_face_draw?
header?(:leader) &&
ZiifSaveLayoutA::D_LeaderInfo && ZiifSaveLayoutA::D_Face
end
#--------------------------------------------------------------------------
# draw_party_faces
#--------------------------------------------------------------------------
def draw_party_faces
return unless ZiifSaveLayoutA::D_PartyFaces && header?(:faces)
draw_y = (file_info_draw? ? line_height : 0)
draw_y += [96, line_height * 4].max if ZiifSaveLayoutA::D_LeaderInfo
draw_x = 4
@header[:faces].each_with_index do |data, i|
next if i == 0 && leader_face_draw?
draw_face_height88(data[0], data[1], draw_x, draw_y)
draw_x += 100
end
end
#--------------------------------------------------------------------------
# draw_party_characters
#--------------------------------------------------------------------------
def draw_party_characters
return unless ZiifSaveLayoutA::D_Characters && header?(:characters)
draw_y = contents.height - 8
draw_y -= line_height if ZiifSaveLayoutA::D_AG_Line
draw_x = 28
@header[:characters].each_with_index do |data, i|
draw_character(data[0], data[1], draw_x, draw_y)
draw_x += 48
end
end
#--------------------------------------------------------------------------
# draw_face_height (88px)
#--------------------------------------------------------------------------
def draw_face_height88(face_name, face_index, x, y, enabled = true)
bitmap = Cache.face(face_name)
rect = Rect.new(face_index % 4 * 96, face_index / 4 * 96 + 4, 96, 88)
contents.blt(x, y + 4, bitmap, rect, enabled ? 255 : translucent_alpha)
end
end