#==============================================================================
# ** Grand Menu
# Version: 1.0 [Initial]
#------------------------------------------------------------------------------
# Auther - Rupam Ontherocks
#------------------------------------------------------------------------------
# Require: GUI Configuration
#------------------------------------------------------------------------------
# Description:
# This is a brand new model of main menu, nothing else.
#------------------------------------------------------------------------------
#==============================================================================
# ** Scene_Menu
#------------------------------------------------------------------------------
# Main menu process.
#==============================================================================
class Scene_Menu < Scene_MenuBase
alias grand_menu_engine start
#--------------------------------------------------------------------------
# * Start Processing
#--------------------------------------------------------------------------
def start
grand_menu_engine
create_help_window
create_menu_command_window
create_gold_window
create_location_window
create_status_window
create_progress_window
create_charisma_window
create_party_window
create_battle_window
create_save_window
create_play_time_window
end
def create_help_window
@command_help_window = Window_HelpCommand.new
@command_help_window.y = 0
end
def update
super
@command_help_window.set_helpText(@command_window.index) if @command_window
end
def create_menu_command_window
@command_window = Window_MenuCommand.new
@command_window.set_handler(:item, method(:command_item))
@command_window.set_handler(:skill, method(:command_personal))
@command_window.set_handler(:equip, method(:command_personal))
@command_window.set_handler(:status, method(:command_personal))
@command_window.set_handler(:formation, method(:command_formation))
@command_window.set_handler(:save, method(:command_save))
@command_window.set_handler(:game_end, method(:command_game_end))
@command_window.set_handler(:cancel, method(:return_scene))
@command_window.y = 48
end
def create_gold_window
@gold_window = Window_Gold.new
@gold_window.y = Graphics.height - 72
end
def create_location_window
@location_window = Window_Location.new(0, 0)
@location_window.x = 160
@location_window.y = Graphics.height - 144
end
def create_status_window
@status_window = Window_MenuStatus.new(0, 0)
@status_window.x = Graphics.width / 2
@status_window.y = 0
end
def create_progress_window
@progress_window = Window_Progress.new(0, 0)
@progress_window.x = 0
@progress_window.y = 48
end
def create_charisma_window
@charisma_window = Window_Charisma.new(0, 0)
@charisma_window.x = 0
@charisma_window.y = 120
end
def create_party_window
@party_window = Window_Party.new(0, 0)
@party_window.x = 0
@party_window.y = 192
end
def create_battle_window
@battle_window = Window_BattleCount.new(0, 0)
@battle_window.x = 0
@battle_window.y = 264
end
def create_save_window
@save_window = Window_SaveCount.new(0, 0)
@save_window.x = 0
@save_window.y = 336
end
def create_play_time_window
@play_time_window = Window_PlayTime.new(0, 0)
@play_time_window.x = 0
@play_time_window.y = 408
end
end
#==============================================================================
# ** Window_HelpCommand
#------------------------------------------------------------------------------
# This is a super class of all scenes within the game.
#==============================================================================
module Command
# this is the array of the index of the commands, so when you
# change the command index, you change the help window text
Command_HelpText = [
# Item
"Browse through items, gears and accessories.",
# Skills
"Check special abilities of team members.",
# Equip
"Equip gears and accessories.",
# Status
"View full statistics of a character.",
# Formation
"Change formation of team members.",
# Save
"Record current game progress.",
# Game End
"Stop playing and go study.",
]
end
class Window_HelpCommand < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize(line_number = 1)
super(0, 0, Graphics.width / 2, fitting_height(line_number))
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
contents.clear
end
def set_helpText(index)
refresh # refresh the content so the window will not overlap
draw_text_ex(4, 0, Command::Command_HelpText[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(160, 0)
select_last
end
#--------------------------------------------------------------------------
# * Get Window Width
#--------------------------------------------------------------------------
def window_width
return 160
end
#--------------------------------------------------------------------------
# * Get Number of Lines to Show
#--------------------------------------------------------------------------
def visible_line_number
11
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::skill, :skill, 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
add_command(Vocab::formation, :formation, formation_enabled)
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
add_command(Vocab::game_end, :game_end)
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
#--------------------------------------------------------------------------
# * Command Underline
#--------------------------------------------------------------------------
def item_rect_for_text(index)
rect = item_rect(index)
contents.fill_rect(rect.x + 28, rect.y + 19, 105, 2, normal_color)
rect
end
end
#==============================================================================
# ** Window_Location
#------------------------------------------------------------------------------
# This window displays the current map name.
#==============================================================================
class Window_Location < Window_Base
def initialize(x, y)
super(x, y, 160, 72)
refresh
end
#------------------------------------------------------------------------------
# - Refresh
#------------------------------------------------------------------------------
def refresh
self.contents.clear
@actor = $game_party.members[0]
change_color(hp_gauge_color1)
draw_text(28, 0, 160, line_height, "Location:")
change_color(system_color)
contents.font.size = 18
draw_text(0, 24, width, line_height, "#{$data_mapinfos[$game_map.map_id].name}")
contents.font.size = 20
draw_icon(231, 0, 0, true)
end
end
#==============================================================================
# ** Window_Gold
#------------------------------------------------------------------------------
# This window displays the party's gold.
#==============================================================================
class Window_Gold < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super(160, 0, window_width, fitting_height(2))
refresh
end
#--------------------------------------------------------------------------
# * Get Window Width
#--------------------------------------------------------------------------
def window_width
return 160
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
contents.clear
change_color(system_color)
draw_text(26, 0, width, line_height, "Coin:")
change_color(normal_color)
draw_currency_value(value, currency_unit, 8, 24, contents.width - 8)
end
#--------------------------------------------------------------------------
# * Get Party Gold
#--------------------------------------------------------------------------
def value
$game_party.gold
end
#--------------------------------------------------------------------------
# Get Currency Unit
#--------------------------------------------------------------------------
def currency_unit
draw_icon(361, 0, 0, true)
end
#--------------------------------------------------------------------------
# * Open Window
#--------------------------------------------------------------------------
def open
refresh
super
end
end
#==============================================================================
# ** Window_MenuStatus
#------------------------------------------------------------------------------
# This window displays party member status on the menu screen.
#==============================================================================
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 - 320
end
#--------------------------------------------------------------------------
# * Get Window Height
#--------------------------------------------------------------------------
def window_height
Graphics.height
end
#--------------------------------------------------------------------------
# * Get Number of Items
#--------------------------------------------------------------------------
def item_max
$game_party.members.size
end
#--------------------------------------------------------------------------
# * Get Item Height
#--------------------------------------------------------------------------
def item_height
(height - standard_padding * 2) / 4
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)
contents.fill_rect(rect.x + 5, rect.y + 5, 286, 104, Font.default_out_color)
# Name
draw_actor_name(actor, rect.x + 8, rect.y + 4)
contents.font.size = 18
# Class
draw_actor_class(actor, rect.x + 18, rect.y + 24)
# Level
draw_actor_level(actor, rect.x + 18, rect.y + 40)
# EXP
draw_exp(actor, rect.x + 122, rect.y - 2)
# HP
draw_actor_hp(actor, rect.x + 122, rect.y + 17)
# MP
draw_actor_mp(actor, rect.x + 122, rect.y + 36)
# States Icon
draw_actor_icons(actor, rect.x + 121, rect.y + 70)
contents.font.size = 20
# Charset
draw_actor_graphic(actor, rect.x + 30, rect.y + 104)
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_Progress
#------------------------------------------------------------------------------
# This window displays Variable 1.
#==============================================================================
class Window_Progress < Window_Base
def initialize(x, y)
super(x, y, 160, 72)
refresh
end
#------------------------------------------------------------------------------
# - Refresh
#------------------------------------------------------------------------------
def refresh
self.contents.clear
@actor = $game_party.members[0]
contents.font.size = 18
change_color(hp_gauge_color1)
draw_icon(189, 0, 0, true)
draw_text(28, 0, 250, line_height, "Game Progress:")
change_color(normal_color)
draw_text(0,24, 250, line_height, "#{$game_variables[1]}%", 0)
end
end
#==============================================================================
# ** Window_Charisma
#------------------------------------------------------------------------------
# This window displays Variable 2.
#==============================================================================
class Window_Charisma < Window_Base
def initialize(x, y)
super(x, y, 160, 72)
refresh
end
#------------------------------------------------------------------------------
# - Refresh
#------------------------------------------------------------------------------
def refresh
self.contents.clear
@actor = $game_party.members[0]
contents.font.size = 18
change_color(hp_gauge_color2)
draw_icon(189, 0, 0, true)
draw_text(28, 0, 250, line_height, "Charisma Status:")
change_color(normal_color)
draw_text(0,24, 250, line_height, "#{$game_variables[1]}", 0)
end
end
#==============================================================================
# ** Window_Party
#------------------------------------------------------------------------------
# This window displays number of party members.
#==============================================================================
class Window_Party < Window_Base
def initialize(x, y)
super(x, y, 160, 72)
refresh
end
#------------------------------------------------------------------------------
# - Refresh
#------------------------------------------------------------------------------
def refresh
self.contents.clear
@actor = $game_party.members[0]
contents.font.size = 18
change_color(tp_gauge_color2)
draw_icon(189, 0, 0, true)
draw_text(28, 0, 250, line_height, "Team Members:")
change_color(normal_color)
draw_text(0,24, 250, line_height, "#{$game_party.all_members.size}", 0)
end
end
#==============================================================================
# ** Window_BattleCount
#------------------------------------------------------------------------------
# This window displays number of battle encounter.
#==============================================================================
class Window_BattleCount < Window_Base
def initialize(x, y)
super(x, y, 160, 72)
refresh
end
#------------------------------------------------------------------------------
# - Refresh
#------------------------------------------------------------------------------
def refresh
self.contents.clear
@actor = $game_party.members[0]
contents.font.size = 18
change_color(mp_gauge_color2)
draw_icon(189, 0, 0, true)
draw_text(28, 0, 250, line_height, "Battles Won:")
change_color(normal_color)
draw_text(0,24, 250, line_height, "#{$game_system.battle_count}", 0)
end
end
#==============================================================================
# ** Window_Save
#------------------------------------------------------------------------------
# This window displays number of saves.
#==============================================================================
class Window_SaveCount < Window_Base
def initialize(x, y)
super(x, y, 160, 72)
refresh
end
#------------------------------------------------------------------------------
# - Refresh
#------------------------------------------------------------------------------
def refresh
self.contents.clear
@actor = $game_party.members[0]
contents.font.size = 18
change_color(crisis_color)
draw_icon(189, 0, 0, true)
draw_text(28, 0, 250, line_height, "Save Count:")
change_color(normal_color)
draw_text(0,24, 250, line_height, "#{$game_system.save_count}", 0)
end
end
#==============================================================================
# ** Window_PlayTime
#------------------------------------------------------------------------------
# This window displays number of saves.
#==============================================================================
class Window_PlayTime < Window_Base
def initialize(x, y)
super(x, y, 160, 72)
refresh
end
#------------------------------------------------------------------------------
# - Refresh
#------------------------------------------------------------------------------
def refresh
self.contents.clear
@actor = $game_party.members[0]
contents.font.size = 18
change_color(mp_cost_color)
draw_icon(189, 0, 0, true)
draw_text(28, 0, 250, line_height, "Play Time:")
change_color(normal_color)
draw_text(0,24, 250, line_height, "#{$game_system.playtime_s}", 0)
end
def update
super
@playtime = $game_system.playtime_s
refresh
end
end
![Grand Menu.png]()
![Grand Menu2.png]()
![Grand Menu3.png]()