#===========================================================================
#
# Sky Script Revolution : Main Menu (SSR) (SSR/MM)
# Version 1.0
# September 28, 2011 Started
# September 28, 2011 Completed
#
#===========================================================================
#
# What is Sky Script Revolution (SSR)?
# It is a revamp of Sky's previous scripts.
# Is that all?
# No, that is only the beginning. Look for
# New Scripts as well. Also look forward to
# the reopenning of script request hall soon.
# What kind of scripts are you planning?
# I am starting to get into battle system
# scripting so look for edits.
# Are you supporting old scripts?
# Some scripts don't need revamping as they
# work beautifully, so I will update those
# scripts.
#
#===========================================================================
#
# Features :
# Version 1.0 - September 28, 2011
# - Setup your menu anyway you want
# - Set it up easily.
# - Learning curve minimal even moreso if you used My Scene Menu Edit.
# - Add Remove and/or Disable Menu Options during actual gameplay.
# * The order they come in after adding is up to you as well.
#
#===========================================================================
#
# Credit
# Sky00Valentine :creator and editor
# Jasonater :unintentionally requesting
# Yanfly :used a method of coding, makes things neat...
#
#===========================================================================
#
# Terms of Use
# ------------
#
# Crediting Rpgmakervx.net is the only thing I ask.
# However feel free to credit Sky00Valentine if you
# see fit.
#
#===========================================================================
#
# Future improvement
# ------------------
#
# - Unknown
#
#===========================================================================
#
# Instructions & Installation
# ---------------------------
# - plug & play
#
# - First things first
# edit @menu hash in the Main_Menu module.
# to do this you can edit an existing one such as
# :equips => ["Equip","Scene_Equip.new",true],
#
# or you can add a new one like this.
# :name => [Display_Name,Scene,Actor_select],
# 1. name means a name you want to use so you know what command you are
# adding or editing later.
# 2. Display_Name means what do you want it to say when you see this
# on the main menu.
# 3. Scene is where you want to go if this option is selected on the
# menu. Usually scripts you have will let you know how to do this
#
# EXAMPLE The script SSR Party Management Tells you to use
# Scene_Party.new
# 4. Actor_select means do you want to select a character before
# going to the next scene. Usually this is used so you can
# look at a specific party member first. Like if I wanted
# to go equip something but only to my 3rd character I can
# select the character before going to the next scene.
#
# Thats it for that section
#
# - Now Edit @commands
# by default Commands has 3 values in it. :item :equips, :end(Excluding Demo)
#
# what that means is that only those three options will appear in the
# menu if we open it at the beginning of the game. And they will be
# in that order on the menu.
#
# So edit it with all commands you want to start off with in your game
# and order them the way you want them ordered.
#
# You could put all your commands in if you want. But if you want
# to use some of the added features you may not want to.
#
# - Extra Features
#
# Here are the script commands for the extra features.
#
# 1. add_button(:name)
# just as when you edited the @menu hash name is the
# name of the Menu option you used.
#
# add_button(:status) would work. By default
# it would add the menu option "Status" to the bottom
# of the menu after :end.
#
# 2. add_button(:name,index)
# just as above name works the same way.
#
# index can be considered where you want to add the option.
# If you want the option to be first then make index 0.
# For anything else if you want it after the 3rd option
# make index 3.
#
# *Note This option may come in handy if you remove any
# menu options during gameply.
#
# 3. remove_button(:name)
# just as above name works the same way.
# this will remove the menu option from the menu.
#
# *As noted above this otption can work with add_button(:name,index)
# In depth (You can remove an option from the menu instead
# of disabling it as well only allow certain
# options to appear only at certain times. Like maybe
# only on certain maps.)
#
# 4. disable_command(:name)
# just as above name works the same way.
# this will disable the menu option and grey it out when
# you look at the main menu.
#
# 5. enable_command(:name)
# just as above name works the same way.
# this will reenable the menu option when you look at the main
# menu.
#
#===========================================================================
$imported = {} if $imported == nil
$imported["SSRMainMenu"] = true
module Sky
module Main_Menu
GAME_SAVE = "Speichern" #What you want the Save Command to say
GAME_END = "Optionen" #What you want the exit menu Command to say.
@menu = { #include all possible buttons even if you don't start with them
#in game you can make them available later.
# :name => [Name,Scene,I want the actor selection to pop up(true/false)],
# :item(the item menu) => ["Items"(I want it to say this in the menu),
# "Scene_Item.new"(This is the script line command),
# false(I do not need to select an actor before continuing to the menu.)
:item => ["Tasche","Scene_Item.new",false],
:skills => ["Fähigkeiten","Scene_Skill.new",true],
:equips => ["Ausrüstung","Scene_Equip.new",true],
:status => ["Status","Scene_Status.new",true],
:save => [GAME_SAVE,"Scene_File.new(true,false,false)",false],
:end => [GAME_END,"Scene_End.new",false],
#:party is an example. If you have my Party Management script or
#possibly another party script you could use it if you so wished.
}
@commands = [:item,:skills,:equips,:status,:save,:end,] #Be sure to place them in order
# and adding/leaving out any
# options you may or may not
# want.
#------------------------------------------------------------------------
# No Editing past this line unless you know what your doing.
#------------------------------------------------------------------------
@disabled = []
@total_information = [@commands,@disabled]
def self.menu
return @menu
end
def self.commands
return @commands
end
def self.disabled
return @disabled
end
def self.save_info
@total_information = [@commands,@disabled]
$game_system.menu = @total_information
end
def self.load_info
@commands = $game_system.menu[0]
@disabled = $game_system.menu[1]
end
def load_save_data(slot_id)
file_name = make_filename(slot_id)
@total_information = [@commands,@disabled]
$game_system.menu = @total_information
end
def self.disable(item)
unless @disabled.include?(item)
@disabled.push(item)
end
end
def self.enable(item)
@disabled.delete(item) if @disabled.include?(item)
end
def self.add(item)
@commands.push(item)
end
def self.remove(item)
@commands.delete(item) if @commands.include?(item)
enable(item)
end
def self.insert(item,index)
@commands.insert(index,item)
end
end
end
class Scene_Menu
def initialize(menu_index = 0)
@menu_index = [(Sky::Main_Menu.commands.size - 1),menu_index].min
end
def create_command_window
menu_options = []
for i in Sky::Main_Menu.commands
menu_options.push(Sky::Main_Menu.menu[i][0])
end
@command_window = Window_Command.new(160,menu_options)
@command_window.index = @menu_index
if $game_party.members.size == 0
for i in 0...menu_options.size
unless Sky::Main_Menu.commands[i] == :end
@command_window.draw_item(i,false)
end
end
end
for i in 0...menu_options.size
if Sky::Main_Menu.disabled.include?(Sky::Main_Menu.commands[i])
@command_window.draw_item(i,false)
end
end
if $game_system.save_disabled
@command_window.draw_item(Sky::Main_Menu.commands.index(:save), false) if Sky::Main_Menu.commands.include?(:save)
end
end
def update_command_selection
if Input.trigger?(Input::B )
Sound.play_cancel
$scene = Scene_Map.new
elsif Input.trigger?(Input::C)
if $game_party.members.size == 0 and @command_window.index < 4
Sound.play_buzzer
return
elsif $game_system.save_disabled and @command_window.index == 4
Sound.play_buzzer
return
end
case Sky::Main_Menu.commands[@command_window.index]
when Sky::Main_Menu.commands[@command_window.index]
if Sky::Main_Menu.disabled.include?(Sky::Main_Menu.commands[@command_window.index])
Sound.play_buzzer
elsif Sky::Main_Menu.menu[Sky::Main_Menu.commands[@command_window.index]][2]
Sound.play_decision
start_actor_selection
else
Sound.play_decision
$scene = eval(Sky::Main_Menu.menu[Sky::Main_Menu.commands[@command_window.index]][1])
end
end
end
end
def update_actor_selection
if Input.trigger?(Input::B )
Sound.play_cancel
end_actor_selection
elsif Input.trigger?(Input::C)
$game_party.last_actor_index = @status_window.index
Sound.play_decision
case Sky::Main_Menu.commands[@command_window.index]
when Sky::Main_Menu.commands[@command_window.index]
$scene = eval(Sky::Main_Menu.menu[Sky::Main_Menu.commands[@command_window.index]][1].to_s + "(#{@status_window.index})")
end
end
end
end
class Game_Interpreter
def add_button(command, index = -1)
unless Sky::Main_Menu.commands.include?(command)
if index == -1
Sky::Main_Menu.add(command)
else
Sky::Main_Menu.insert(command,[[index,0].max,Sky::Main_Menu.commands.size - 1].min)
end
Sky::Main_Menu.save_info
end
end
def disable_command(command)
Sky::Main_Menu.disable(command)
Sky::Main_Menu.save_info
end
def remove_button(command)
Sky::Main_Menu.remove(command)
Sky::Main_Menu.save_info
end
end
class Game_System
attr_accessor :menu
alias ssr_mm_initialize initialize
def initialize
@menu = []
ssr_mm_initialize
end
end
class Scene_File
alias ssr_mm_read_s_data read_save_data
def load_save_data(slot_id)
file_name = make_filename(slot_id)
end
end