#===============================================================================
# ** Simple Menu Edit
#-------------------------------------------------------------------------------
# With this script you can easly make your own menu!
# Helping commands :
#
# run items window : Scene_Item.new
# run skills window : Scene_Skill.new
# run Equip window : Scene_Equip.new
# Scene_Save.new : run save window
# Scene_Load.new : run load window
#
# Credits : kRECKER
#===============================================================================
SDK.log("Simple Menu", "kRECKER", 1, "4.4.2007")
#===============================================================================
#===============================================================================
# To use menu? Yes = True //\\ No = False
if SDK.state("Simple Menu") == true
#===============================================================================
class Scene_Menu
#--------------------------------------------------------------------------
# * Object Initialization
# menu_index : command cursor's initial position
#--------------------------------------------------------------------------
def initialize(menu_index = 0)
@menu_index = menu_index
end
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
def main
s1 = $data_system.words.item
s2 = $data_system.words.skill
s3 = $data_system.words.equip
s4 = "Status"
s5 = "Save"
s6 = "Exit"
s7 = "Limit"
# how many Windows? 1, 2, 3, 4, 5, 6 and so on
@command_window = Window_Command.new(160, [s1, s2, s3, s4, s7, s5, s6])
@command_window.height = 224 # Add on scriplet from http://www.creationasylum.net/index.php?showtopic=13597&hl= Credit: Leon
@command_window.index = @menu_index
# If number of party members is 0
# if party size = 0
if $game_party.actors.size == 0
# Disable items, skills, equipment, and status
# disable those windows delete # from the windows that wont be disable
@command_window.disable_item(0)
@command_window.disable_item(1)
@command_window.disable_item(2)
@command_window.disable_item(3)
@command_window.disable_item(4)
# @command_window.disable_item(5)
# @command_window.disable_item(6)
#end condition
end
# If save is forbidden
if $game_system.save_disabled
# Disable save
@command_window.disable_item(5) #@command_window.disable_item(4)
end
# Make play time window
@playtime_window = Window_PlayTime.new
@playtime_window.x = 0
@playtime_window.y = 224 # @playtime_window.y = 320
# Make steps window
@steps_window = Window_Steps.new
@steps_window.x = 0
@steps_window.y = 320
# Make gold window
@gold_window = Window_Gold.new
@gold_window.x = 0
@gold_window.y = 416
#-------------------------------------------------------------------------------
# Make status window
# show status on the middle of the screen
@status_window = Window_MenuStatus.new
@status_window.x = 160
@status_window.y = 0
# Execute transition
Graphics.transition
# Main loop
loop do
# Update game screen
Graphics.update
# Update input information
Input.update
# Frame update
update
# Abort loop if screen is changed
if $scene != self
break
end
end
# Prepare for transition
Graphics.freeze
# Dispose of windows
@command_window.dispose
@playtime_window.dispose
@steps_window.dispose
@gold_window.dispose
@status_window.dispose
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
# Update windows
@command_window.update
@playtime_window.update
@steps_window.update
@gold_window.update
@status_window.update
# If command window is active: call update_command
if @command_window.active
update_command
return
end
# If status window is active: call update_status
if @status_window.active
update_status
return
end
end
#--------------------------------------------------------------------------
# * Frame Update (when command window is active)
#--------------------------------------------------------------------------
def update_command
# If B button was pressed
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Switch to map screen
$scene = Scene_Map.new
return
end
# If C button was pressed
if Input.trigger?(Input::C)
# If command other than save or end game, and party members = 0
if $game_party.actors.size == 0 and @command_window.index < 5 #if $game_party.actors.size == 0 and @command_window.index < 4
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
#-------------------------------------------------------------------------------
#
#-------------------------------------------------------------------------------
# Branch by command window cursor position
case @command_window.index
# when index = 1
when 0 # item
$game_system.se_play($data_system.decision_se)
#Scene_Status.new
# Switch to item screen
$scene = Scene_Item.new
#-------------------------------------------------------------------------------
# when index = 2
when 1 # skill
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Make status window active
@command_window.active = false
@status_window.active = true
@status_window.index = 0
#-------------------------------------------------------------------------------
# when index = 3
when 2 # equipment
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Make status window active
@command_window.active = false
@status_window.active = true
@status_window.index = 0
#-------------------------------------------------------------------------------
# when index = 4
when 3 # status
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Make status window active
@command_window.active = false
@status_window.active = true
@status_window.index = 0
#-------------------------------------------------------------------------------
when 4 # limit
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Make status window active
@command_window.active = false
@status_window.active = true
@status_window.index = 0
#-------------------------------------------------------------------------------
# when index = 5
when 5 # save
# If saving is forbidden
if $game_system.save_disabled
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Switch to save screen
$scene = Scene_Save.new
#-------------------------------------------------------------------------------
# when index = 6
when 6
# play decision_se
$game_system.se_play($data_system.decision_se)
# run Scene_End (end titles)
$scene = Scene_End.new
end
return
end
end
# end class
end
#===============================================================================
# ** End SDK enable Test
#===============================================================================
end