Sorry about all the script goofs lately, guys ;_; Stark has been really cool lately with helping me out with making my menu and save screen look more unique, but we've encountered a couple of problems that we're both not quite sure how to fix. ;9
Menu Script
I think he made a post about it already, but I wanted to go ahead and include it in here to keep things fairly together (I gues?). We've got it all working out fabulously, except for one little issue...we can't seem to get the character selection to go left-right and up-down, instead of just going up and down. Here's a picture:
[Spoiler=Picture](https://rmrk.net/proxy.php?request=http%3A%2F%2Fi.imgur.com%2FUdbslKY.png%3F1&hash=10cd185b2b50df6fec6e8bfb02d7db5cd5b8f584)[/Spoiler]
^ The problem is you can't go over to the two on the right, and the cursor wants to only move down instead. ;_; The two on the right are also squished and have a bit less room, but I'm not quite sure how to move them to the left, either. ;9 *We're using an edited version of one of Yanfly's scripts. We're also using a relationship script that gets called through the menu, so hopefully it doesn't freak out when that script isn't added?
[Spoiler=Menu Script]
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
[/Spoiler]
Save screen
For the most part, our issues with the save screen are mostly cosmetic. ^^; For some reason, this little arrow keeps appearing at the top, with the text, and we don't quite have any idea how to remove it. ;_; Also, we were trying to use a face where the sprite is, instead - specifically, the party leader's face only, and move the "File" text over. Here's another picture:
[Spoiler=Picture](https://rmrk.net/proxy.php?request=http%3A%2F%2Fi.imgur.com%2FJ0bzb2g.png%3F2&hash=3e45e2f451e75d38ec0d3d4673a31eeac7892eff)[/Spoiler]
[Spoiler= Save Script]
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
[/Spoiler]
Sorry about this, guys! ;_; We're a little new to scripting (I say "we", but I can't even begin to script :V)
I'm no scripting wizard, but why are there two commands for up and down and none for left and right? Maybe that is interfering with the program's ability to recognize up and down presses?
Left, right, up, down. Enabled! What else needed fixing?
[spoiler]
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
[/spoiler]
Edit: OH! Re-position stuff, got it! Give me one minute...
Thanks for the quick replies, you guys!! ;o;
Woah, that worked perfectly!! :tpg: That was fast! O_O
[spoiler]
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
[/spoiler]
Annnnddddd now the actors on the right are shifted 8 pixels to the left, if you want them moved further left, just let me know ;)
That looks much better, thank you!! ;_;
There is just a little tiny problem - for some reason, the box isn't fitting them. O.O my non-scripting brain is confused haha
(https://rmrk.net/proxy.php?request=http%3A%2F%2Fi.imgur.com%2FfKISGW2.png%3F1&hash=a96493a743ad6ea4c3e8e7a8ce0d4012620fcee7)
Maybe just a couple more pixel shifts to the left? :) Either way, it looks a lot better already!
Oops! I'll see what I can do! Almost done with the save menu, I'll fix up the menu menu after that!
Edit: Save menu! Let me know if this is okay :)
[spoiler]
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
[/spoiler]
It's looking pretty good so far! ;o; For some reason, the current party leader face is appearing over all save data, even ones that aren't used yet ;_;
(https://rmrk.net/proxy.php?request=http%3A%2F%2Fi.imgur.com%2F4vgDZ8F.png%3F1&hash=a257004d6f131ba5be32ba1f57b15bda29b74d5c)
I know I've already asked so much of you, but is it possible to also add the actor's name above the playtime stuff or around there somewhere? Totally not necessary, but just curious. :)
Thank you again for everything! ;_; You're definitely getting credit in my game!
Don't worry about it, these are just small edits, I'm happy to help with them!
Here's the fixed menu, I also made the rectangle-end show when selecting actors on the right, so the cursor doesn't look cut-off
[spoiler]
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
[/spoiler]
Edit: Working on stupid save menu mistake now! :p
Edit Edit:
Save Menu:
[spoiler]
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
[/spoiler]
And do you plan on having more than 4 actors in the menu at a time? If so does the menu scroll down?
Also if you need anything else fixed, just ask!
Edit Edit Edit: Is the code box all black for you too?! If so the code's still there, just highlight it.
The menu is working perfectly now!! ;_; Thank you so much! Nah, I only want 4 actors at a time. :-) Thanks, though!
By the way: if you're still using our Pokemon system, I would be happy to give you any pokemon of your choosing for your efforts. :) I'm going to try to start giving more of those out as rewards~
*edit* Uh oh ;_; I got a little warning message when I tried to load (though saving works perfectly)? o.o
(https://rmrk.net/proxy.php?request=http%3A%2F%2Fi.imgur.com%2Fjd6xe3C.png%3F1&hash=910c7587c6b5c3bd830fe8253fce1e65b2df914a)
Damn it! Sorry, I'm not that great with scripting :( I'll fix it real quick, without messing anything else up, hopefully!
And I may take a pokemon from you :p I'll let you know if I decide to charge you! xD
It's okay! :) You're still way better at scripting than I am! B) Bugs are part of the learning process, amirite?
Actually, I did encounter another little bug haha ;_; If I go to save as another character, it sets the character above to show their name/face:
(https://rmrk.net/proxy.php?request=http%3A%2F%2Fi.imgur.com%2FKgAsGFx.png%3F1&hash=4d537c350d69972aa921ab6b5fc98e927ac02441)
*The top saved file was saved with a totally different character. ;9 Very odd...
Also, you can have literally any Pokemon you want - you won't be taking them from me! :) I'm an admin of the Pokemon system, too, so I can make any of those little monsters appear out of thin air and send it to you! ;o
I had it set to save the first party members face :/ is that not what happened?
I need to look into this more, I'm sorry about the bugs!
And in that case I will take one! :D
.....OHHHHHHHHH, duh! ;_; I made it where the player can choose between 10 different characters at the start of the game, but when you pick them, all it does is change the face of Actor 1 to look like them (and lets you set the name). I honestly don't know a way around that. The only thing specific to those actors is a variable that numbers them. Haha, wow, I feel dumb now. If I use ten different actors, I think it'll work just fine. :-)
Sorry...I can't believe I forgot that... ;_; That was my bad, haha.
Just let me know what pokemon you'd like, and I'll send it right out! :]
*edit*
Actually, I tried switching party leaders to another actor and still had the problem...oh noes... ;_; (although I'm sure what I was doing earlier would goof it anyways ;9 haha)
Yeah I've never messed with the save file script before. This is kinda tough, you can use this for now, it's just the same old thing with the actors moved to the left a bit and the arrow gone. I'll be working on the name and face though!
[spoiler]
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
[/spoiler]
Can my pokemon be shiny? :o
Haha, sorry about everything getting kinda crazy. :) Of course you can have a shiny Pokemon! ^_^
I was looking around more into it and may have found something useful. I found a script that you may be able to use as a reference, and it somehow even was able to save the different faces of the same actor. o.o I have no idea how that happened, but it might help? Maybe?
[Spoiler]
=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
[/Spoiler]
I can totally understand if you don't want to work on this anymore, though. :) You've really helped me out a ton and I don't want to take up too much of your time with this thing! ;] Honestly, if the save script wants to be a pain in the butt for everyone, I can figure out other things to do with it - either replace it or leave it like the last edit. Either way, I don't want this thing to be a huge inconvenience, okay? :-)
It's no inconvenience. I'm glad to help, I'll see if this script can shed some light on our problem.
Can I get a Shiny Suicune?! If that's too much, I would like a shiny ninetales, or shiny delcatty! You decide!
I gave you a Shiny Suicune and Shiny Delcatty :-) You've been at this for hours, I only wish I could do more :(
I wish I could get this code right!!! >:(
I have an exam tomorrow morning, so I need to go to sleep, but I'll work on it right after my exam!!
I'll get it to work somehow :)
Thanks for everything, Euphoria! :tpg:
Good luck on your exam!!!
Thanks, I definitely need it! :(
Goodnight, I'll finish your script tomorrow!
Currently, the name works, and now changes for the characters, but this face thing is being a pain in the ass!
I'll figure it out though, no worries.
I'm sorry about that... ;_; It's no big deal if you can't figure it out, though! :) The name add-on will help the players figure out what character is on that file, so its a tremendous help already! The face thing is mostly cosmetic. ^^;
After hours of "hard work" :p
(https://rmrk.net/proxy.php?request=http%3A%2F%2Fs27.postimg.org%2Fumpvgk7g3%2FUntitled_3.png&hash=99324f684f3545b89e1c51d19ec8a31bf5a2c360)
Save, Load, and Different actors on save are now working!
Just finishing up some small stuff.
;__________; !! That looks incredible!!
Shiny Ninetales was gifted to User Euphoria
:D <3
I'm adding some customize-able stuff so you can tweak it if you need to, then I'm done!
I can manage a bit of tweaking, but I'm overall really bad with scripts, so that should come in handy! *_* Man, you've really gone above and beyond!! ;o;
I'm just glad I can help! Plus it doesn't hurt to get some of my RGSS3 skills back...
It's fun! Except the god damn face part... that was hell... :p
I'm kinda going options crazy... It should be very "customize-able" and I'm writing notes so you know what to change and all!
DOUBLE POST!
:p
Done! It's configured to how you originally described it, but has options to change stuff, if you want to add in the changes, I added instructions. I hope they aren't too confusing...
[spoiler]
=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 -------------------------------------------------------------------
#===============================================================================
[/spoiler]
If you want the window sizes to be adjustable as well let me know, it would be very simple to do.
Also, I have a small request if you don't mind, and it's possible :p
That's awesome!!! ;_; The save menu looks fabulous and the options are an awesome addition!! ;o;
What's the request? :-)
Glad you like it! :)
Need anything else scripted? I'm le bored.
As for my request:
I posted this in the thread for making/editing trainers already but no one replied yet, could you give me my prize (whatever this is worth) and put my trainer into the database? I wanna use him :)
(https://rmrk.net/proxy.php?request=http%3A%2F%2Fs14.postimg.org%2Fxzb6zu925%2FEuphoria.gif&hash=6d3ec5a7d8d3997de3ec7e477784402a67adc0a5)
Ohh! Gotcha! :) I can award you a shiny, but I don't think I can add it. ;_; Only Roph can do that, so I'll send him a message and let him know! ^_^
I'd say that one can beeeeeeeeeee...how about a regular shiny (31% + encounter rate)? ^_^
Also, I'll try to think of something that needs teh scripts! :-) I might have some little silly script edits on the backburner if you're bored, haha. Hopefully ones that won't be a pain in the butt this time. ;_;
In that case, I'd like a shiny Alakazam, if you don't mind :tinysmile:
And yeah, anything you need done works, pain-in-the-butt or not, I'm willing to try!
Shiny Alakazam was gifted to User Euphoria ! :-)
Also, I sent you a pm. :)
Thank you so much!