#==============================================================================
# ** Window_Travel_Command
#------------------------------------------------------------------------------
# This window deals with the travel command choices.
#==============================================================================
class Window_Travel_Command < Window_Command
#--------------------------------------------------------------------------
# * Draw Item
# index : item number
# color : text color
#--------------------------------------------------------------------------
def draw_item(index, color)
self.contents.font.color = color
rect = Rect.new(4, 32 * index, self.contents.width - 8, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
if $game_switches[index+1] == false && Travel::Kind == 1
self.contents.draw_text(rect, Travel::No_Name)
else
self.contents.draw_text(rect, @commands[index])
end
end
#--------------------------------------------------------------------------
# * Command Count : Retrives the number of commands.
#--------------------------------------------------------------------------
def command_count
return @commands.size
end
end
#==============================================================================
# ** Module Travel By MephistoX
#------------------------------------------------------------------------------
# This module keep several methods and constants for teh Travel Menu
#==============================================================================
module Travel
#--------------------------------------------------------------------------
# * Travel Destiny : Keep the choices for travel(Use hashes or arrays)
#--------------------------------------------------------------------------
Travel_Destiny = {0 => 'Forest', 1 => 'Beach', 2 => "Your Sister's House",
3 => 'Desert', 4 => "Meph's Lair", 5 => "Twin Matrix's House",
6 => 'Space', 7 => 'Abyss', 8 => 'Streets of Simcity',
9 => 'Neverland', 10 => "Seph's House", 11 => 'Detroit',
12 => 'Spain', 13 => 'Rmxp.org', 14 => 'E-Bay'}
#--------------------------------------------------------------------------
# * Destiny Icons : Icons for each destiny
#--------------------------------------------------------------------------
Destiny_Icons = {}
Destiny_Icons.default = '001-Weapon01'
No_Icon = ''
#--------------------------------------------------------------------------
# * Show Icons?
#--------------------------------------------------------------------------
Show_Icons = true
#--------------------------------------------------------------------------
# * Index Variable : Keep the variable where menu Index value is stored.
#--------------------------------------------------------------------------
Index_Variable = 1
#--------------------------------------------------------------------------
# * No Name : When the Switch is off, show this name.
#--------------------------------------------------------------------------
No_Name = '?????'
#--------------------------------------------------------------------------
# * No Name Kind : 0 = Show disable name - 1 = Show No_Name
#--------------------------------------------------------------------------
Kind = 1
#--------------------------------------------------------------------------
# * Command Opacity : Back opacity for command
#--------------------------------------------------------------------------
Command_Opacity = 160
end
#==============================================================================
# ** Scene_Travel(Basis from Menu's Index and Variables) By MephistoX
#------------------------------------------------------------------------------
# This class performs menu screen processing.
#==============================================================================
class Scene_Travel
#--------------------------------------------------------------------------
# * Main Processing : Main Command Window
#--------------------------------------------------------------------------
def main_command_window
@command_window = Window_Travel_Command.new(320, Travel::Travel_Destiny)
@command_window.height = 400
@command_window.x, @command_window.y = 160 ,45
@command_window.back_opacity = Travel::Command_Opacity
end
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
def main
@spriteset = Spriteset_Map.new
# Make command window
main_command_window
# Check for the switches
for i in 0...@command_window.command_count
if $game_switches[i+1] == false
@command_window.disable_item(i)
end
end
# 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
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
# Update windows
@command_window.update
# If command window is active: call update_command
if @command_window.active
update_command
return
end
end
#--------------------------------------------------------------------------
# * Frame Update (when command window is active)
#--------------------------------------------------------------------------
def update_command
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 B button was pressed
if Input.trigger?(Input::C)
# Check if Switch that belongs to the Index is false
if $game_switches[@command_window.index+1] == false
# Play Buzzer SE
$game_system.se_play($data_system.buzzer_se)
else
# If switch is on, play decision SE
$game_system.se_play($data_system.decision_se)
# Change Variable to Index
$game_variables[Travel::Index_Variable] = @command_window.index
# Return to the Map
$scene = Scene_Map.new
end
return
end
end
end