03-24-2010, 08:53 PM
(This post was last modified: 09-02-2024, 05:38 PM by DerVVulfman.)
WizMenu V0.4
computerwizoo7
Rafidelis is the man!!!!!
thought me RGSS2
This is my first CMS, its meant to be a simple CMS for small pac-man like or arcade games. well you can do it for oher stuff as well...
Note: i used copies of Scene_File, Scene_End and Scene_Item...
Screen Shots: (Done in Paint, too lazy to use PS)
Script:
Content Hidden
Code:
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
# WIZMENU
# Author: computerwizoo7
# Special Thanks to Rafidelis!!!!
#Free for commercial/non-commercial rpg maker xp/vx games
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
# Rafidelis IS THE MAN!!!!!! #
# #
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
# Window Hud One # #
# Gold Window #
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
class Window_Hud1 < Window_Base
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
# #
# Def Initialize #
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
def initialize
super(544 - 180,416 - 64,180,64)
self.contents = Bitmap.new(width - 32,height - 32)
self.opacity = 100
refresh
end
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
# #
# Def Refresh #
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
def refresh
self.contents.clear
draw_currency_value($game_party.gold, 4, 0, 120)
end
end
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
#END
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
# Window Hud Two # #
# Character Name Window #
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
class Window_Hud2 < Window_Base
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
# #
# Def Initialize #
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
def initialize
super(0,0,120,150)
self.contents = Bitmap.new(width - 32, height - 32)
self.opacity = 100
refresh
end
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
# #
# Def Refresh #
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
def refresh
self.contents.clear
actor = $game_actors[1]
draw_icon(32,0,0,enabled = true)
draw_actor_name(actor,35,0)
draw_face("Actor1", 0, 0, 32, size = 96)
end
end
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
#END
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
# Window Hud Three # #
# Character Info Window #
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
class Window_Hud3 < Window_Base
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
# #
# Def Initialize #
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
def initialize
super(380,0,164,150)
self.contents = Bitmap.new(width - 32, height - 32)
self.opacity = 100
refresh
end
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
# #
# Def Refresh #
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
def refresh
self.contents.clear
actor = $game_actors[1]
draw_icon(32,0,0,enabled = true)
draw_actor_class(actor, 32, 0)
draw_actor_level(actor, 0, 32)
draw_actor_hp(actor, 0, 64, width = 120)
draw_actor_mp(actor, 0, 96, width = 120)
end
end
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
#END
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
# Scene Image #
# Start #
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
class Scene_Image < Scene_Base
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
# #
# Def Start #
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
def start
create_menu_background
@win = Window_Hud1.new
@win2 = Window_Hud2.new
@win3 = Window_Hud3.new
@win.z = 3
@win2.z = 3
@win3.z = 3
@op1 = Sprite.new
@op2 = Sprite.new
@op3 = Sprite.new
@op4 = Sprite.new
@bg = Plane.new
@text = Sprite.new
@hero = Sprite.new
@op1.bitmap = Cache.picture("op1")
@op2.bitmap = Cache.picture("op2")
@op3.bitmap = Cache.picture("op3")
@op4.bitmap = Cache.picture("op4")
@bg.bitmap = Cache.picture("bg")
@text.bitmap = Cache.picture("text")
@hero.bitmap = Cache.picture("hero")
@op1.x = (544 - @op1.width - @op2.width - @op3.width)/2
@op2.x = @op1.x + @op2.width
@op2.tone = Tone.new(0,0,0,255)
@op3.x = @op2.x + @op3.width
@op3.tone = Tone.new(0,0,0,255)
@op4.x = @op2.x
@op4.tone = Tone.new(0,0,0,255)
@op1.y = (416 - @op1.width)/2
@op2.y = (416 - @op2.width)/2
@op3.y = (416 - @op3.width)/2
@op4.y = @op1.y + 50
@text.y = 285
@text.x = -496
@hero.y = 215
@text.z = 1
@hero.z = 2
@op1.z = 1
@op2.z = 1
@op3.z = 1
@bg.z = 0
@counter = 0
@op1.opacity = 0
@op2.opacity = 0
@op3.opacity = 0
@op4.opacity = 0
@prev_bgm = RPG::BGM.last
Audio.bgm_stop
Audio.bgm_play("Audio/BGM/Scene4",100,100)
end
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
#END
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
# #
# Def Update #
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
def update
if @op1.opacity < 255
@op1.opacity += 5
end
if @op1.opacity > 150 and @op2.opacity < 255
@op2.opacity += 5
end
if @op2.opacity > 150 and @op3.opacity < 255
@op3.opacity += 5
end
if @op3.opacity > 150 and @op4.opacity < 255
@op4.opacity += 5
end
if @text.x < 0
@text.x += 8
end
@bg.ox += 1
@bg.oy += 1
@op1.update
@op2.update
@op3.update
@op4.update
@text.update
@hero.update
@win.update
@win2.update
@win3.update
if Input.trigger?(Input::B)
Sound.play_cancel
@prev_bgm.play
$scene = Scene_Map.new
elsif Input.trigger?(Input::RIGHT) and @counter == 0
Sound.play_cursor
@counter = 1
@op1.tone = Tone.new(0,0,0,255)
@op2.tone = Tone.new(0,0,0)
@op3.tone = Tone.new(0,0,0,255)
@op4.tone = Tone.new(0,0,0,255)
elsif Input.trigger?(Input::LEFT) and @counter == 0
Sound.play_cursor
@counter = 3
@op1.tone = Tone.new(0,0,0,255)
@op2.tone = Tone.new(0,0,0,255)
@op3.tone = Tone.new(0,0,0,255)
@op4.tone = Tone.new(0,0,0)
elsif Input.trigger?(Input::LEFT) and @counter == 1
Sound.play_cursor
@counter = 0
@op1.tone = Tone.new(0,0,0)
@op2.tone = Tone.new(0,0,0,255)
@op3.tone = Tone.new(0,0,0,255)
@op4.tone = Tone.new(0,0,0,255)
elsif Input.trigger?(Input::RIGHT) and @counter == 1
Sound.play_cursor
@counter = 2
@op1.tone = Tone.new(0,0,0,255)
@op2.tone = Tone.new(0,0,0,255)
@op3.tone = Tone.new(0,0,0)
@op4.tone = Tone.new(0,0,0,255)
elsif Input.trigger?(Input::LEFT) and @counter == 2
Sound.play_cursor
@counter = 1
@op1.tone = Tone.new(0,0,0,255)
@op2.tone = Tone.new(0,0,0)
@op3.tone = Tone.new(0,0,0,255)
@op4.tone = Tone.new(0,0,0,255)
elsif Input.trigger?(Input::RIGHT) and @counter == 2
Sound.play_cursor
@counter = 3
@op1.tone = Tone.new(0,0,0,255)
@op2.tone = Tone.new(0,0,0,255)
@op3.tone = Tone.new(0,0,0,255)
@op4.tone = Tone.new(0,0,0)
elsif Input.trigger?(Input::RIGHT) and @counter == 3
Sound.play_cursor
@counter = 0
@op1.tone = Tone.new(0,0,0)
@op2.tone = Tone.new(0,0,0,255)
@op3.tone = Tone.new(0,0,0,255)
@op4.tone = Tone.new(0,0,0,255)
elsif Input.trigger?(Input::LEFT) and @counter == 3
Sound.play_cursor
@counter = 2
@op1.tone = Tone.new(0,0,0,255)
@op2.tone = Tone.new(0,0,0,255)
@op3.tone = Tone.new(0,0,0)
@op4.tone = Tone.new(0,0,0,255)
elsif Input.trigger?(Input::DOWN)
Sound.play_cursor
@counter = 3
@op1.tone = Tone.new(0,0,0,255)
@op2.tone = Tone.new(0,0,0,255)
@op3.tone = Tone.new(0,0,0,255)
@op4.tone = Tone.new(0,0,0)
elsif Input.trigger?(Input::UP)
Sound.play_cursor
@counter = 0
@op1.tone = Tone.new(0,0,0)
@op2.tone = Tone.new(0,0,0,255)
@op3.tone = Tone.new(0,0,0,255)
@op4.tone = Tone.new(0,0,0,255)
end
if Input.trigger?(Input::C)
case @counter
when 0
Sound.play_decision
$scene = Scene_Image_File.new(true,false,false)
when 1
Sound.play_decision
$scene = Scene_Image_Item.new
when 2
Sound.play_decision
@prev_bgm.play
$scene = Scene_Map.new
when 3
Sound.play_decision
$scene = Scene_Image_End.new
end
end
end
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
#END
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
# #
# Def Terminate #
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
def terminate
@op1.dispose
@op2.dispose
@op3.dispose
@op4.dispose
@text.dispose
@hero.dispose
@win.dispose
@win2.dispose
@win3.dispose
end
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
#END
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
end
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
#END Scene
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
#==============================================================================
# ** Scene_Item
#------------------------------------------------------------------------------
# This class performs the item screen processing.
#==============================================================================
class Scene_Image_Item < Scene_Base
#--------------------------------------------------------------------------
# * Start processing
#--------------------------------------------------------------------------
def start
super
create_menu_background
@bg = Plane.new#Edit
@bg.bitmap = Cache.picture("bg_item")#Edit
@viewport = Viewport.new(0, 0, 544, 416)
@help_window = Window_Help.new
@help_window.viewport = @viewport
@item_window = Window_Item.new(0, 56, 544, 360)
@item_window.viewport = @viewport
@item_window.help_window = @help_window
@item_window.active = false
@target_window = Window_MenuStatus.new(0, 0)
@target_window.opacity = 100#Edit
@help_window.opacity = 100#Edit
@item_window.opacity = 100#Edit
hide_target_window
end
#--------------------------------------------------------------------------
# * Termination Processing
#--------------------------------------------------------------------------
def terminate
super
dispose_menu_background
@viewport.dispose
@help_window.dispose
@item_window.dispose
@target_window.dispose
@bg.dispose#Edit
end
#--------------------------------------------------------------------------
# * Return to Original Screen
#--------------------------------------------------------------------------
def return_scene
$scene = Scene_Image.new
end
#--------------------------------------------------------------------------
# * Update Frame
#--------------------------------------------------------------------------
def update
super
update_menu_background
@help_window.update
@item_window.update
@target_window.update
@bg.ox += 1#Edit
@bg.oy += 1#Edit
if @item_window.active
update_item_selection
elsif @target_window.active
update_target_selection
end
end
#--------------------------------------------------------------------------
# * Update Item Selection
#--------------------------------------------------------------------------
def update_item_selection
if Input.trigger?(Input::B)
Sound.play_cancel
return_scene
elsif Input.trigger?(Input::C)
@item = @item_window.item
if @item != nil
$game_party.last_item_id = @item.id
end
if $game_party.item_can_use?(@item)
Sound.play_decision
determine_item
else
Sound.play_buzzer
end
end
end
#--------------------------------------------------------------------------
# * Confirm Item
#--------------------------------------------------------------------------
def determine_item
if @item.for_friend?
show_target_window(@item_window.index % 2 == 0)
if @item.for_all?
@target_window.index = 99
else
if $game_party.last_target_index < @target_window.item_max
@target_window.index = $game_party.last_target_index
else
@target_window.index = 0
end
end
else
use_item_nontarget
end
end
#--------------------------------------------------------------------------
# * Update Target Selection
#--------------------------------------------------------------------------
def update_target_selection
if Input.trigger?(Input::B)
Sound.play_cancel
if $game_party.item_number(@item) == 0 # If item is used up
@item_window.refresh # Recreate the window contents
end
hide_target_window
elsif Input.trigger?(Input::C)
if not $game_party.item_can_use?(@item)
Sound.play_buzzer
else
determine_target
end
end
end
#--------------------------------------------------------------------------
# * Confirm Target
# If there is no effect (such as using a potion on an incapacitated
# character), play a buzzer SE.
#--------------------------------------------------------------------------
def determine_target
used = false
if @item.for_all?
for target in $game_party.members
target.item_effect(target, @item)
used = true unless target.skipped
end
else
$game_party.last_target_index = @target_window.index
target = $game_party.members[@target_window.index]
target.item_effect(target, @item)
used = true unless target.skipped
end
if used
use_item_nontarget
else
Sound.play_buzzer
end
end
#--------------------------------------------------------------------------
# * Show Target Window
# right : Right justification flag (if false, left justification)
#--------------------------------------------------------------------------
def show_target_window(right)
@item_window.active = false
width_remain = 544 - @target_window.width
@target_window.x = right ? width_remain : 0
@target_window.visible = true
@target_window.active = true
if right
@viewport.rect.set(0, 0, width_remain, 416)
@viewport.ox = 0
else
@viewport.rect.set(@target_window.width, 0, width_remain, 416)
@viewport.ox = @target_window.width
end
end
#--------------------------------------------------------------------------
# * Hide Target Window
#--------------------------------------------------------------------------
def hide_target_window
@item_window.active = true
@target_window.visible = false
@target_window.active = false
@viewport.rect.set(0, 0, 544, 416)
@viewport.ox = 0
end
#--------------------------------------------------------------------------
# * Use Item (apply effects to non-ally targets)
#--------------------------------------------------------------------------
def use_item_nontarget
Sound.play_use_item
$game_party.consume_item(@item)
@item_window.draw_item(@item_window.index)
@target_window.refresh
if $game_party.all_dead?
$scene = Scene_Gameover.new
elsif @item.common_event_id > 0
$game_temp.common_event_id = @item.common_event_id
$scene = Scene_Map.new
end
end
end
#==============================================================================
# ** Scene_File
#------------------------------------------------------------------------------
# This class performs the save and load screen processing.
#==============================================================================
class Scene_Image_File < Scene_Base
#--------------------------------------------------------------------------
# * Object Initialization
# saving : save flag (if false, load screen)
# from_title : flag: it was called from "Continue" on the title screen
# from_event : flag: it was called from the "Call Save Screen" event
#--------------------------------------------------------------------------
def initialize(saving, from_title, from_event)
@saving = saving
@from_title = from_title
@from_event = from_event
end
#--------------------------------------------------------------------------
# * Start processing
#--------------------------------------------------------------------------
def start
super
create_menu_background
@bg = Plane.new#Edit
@bg.bitmap = Cache.picture("bg_file")#Edit
@help_window = Window_Help.new
@help_window.opacity = 100#Edit
create_savefile_windows
if @saving
@index = $game_temp.last_file_index
@help_window.set_text(Vocab::SaveMessage)
else
@index = self.latest_file_index
@help_window.set_text(Vocab::LoadMessage)
end
@savefile_windows[@index].selected = true
end
#--------------------------------------------------------------------------
# * Termination Processing
#--------------------------------------------------------------------------
def terminate
super
dispose_menu_background
@help_window.dispose
@bg.dispose#Edit
dispose_item_windows
end
#--------------------------------------------------------------------------
# * Return to Original Screen
#--------------------------------------------------------------------------
def return_scene
if @from_title
$scene = Scene_Title.new
elsif @from_event
$scene = Scene_Map.new
else
$scene = Scene_Image.new
end
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
super
update_menu_background
@bg.ox += 1#Edit
@bg.oy += 1#Edit
@help_window.update
update_savefile_windows
update_savefile_selection
end
#--------------------------------------------------------------------------
# * Create Save File Window
#--------------------------------------------------------------------------
def create_savefile_windows
@savefile_windows = []
for i in 0..3
@savefile_windows.push(Window_SaveFile.new(i, make_filename(i)))
end
@item_max = 4
for n in 0..3
@savefile_windows[n].opacity = 100#Edit
end
end
#--------------------------------------------------------------------------
# * Dispose of Save File Window
#--------------------------------------------------------------------------
def dispose_item_windows
for window in @savefile_windows
window.dispose
end
end
#--------------------------------------------------------------------------
# * Update Save File Window
#--------------------------------------------------------------------------
def update_savefile_windows
for window in @savefile_windows
window.update
end
end
#--------------------------------------------------------------------------
# * Update Save File Selection
#--------------------------------------------------------------------------
def update_savefile_selection
if Input.trigger?(Input::C)
determine_savefile
elsif Input.trigger?(Input::B)
Sound.play_cancel
return_scene
else
last_index = @index
if Input.repeat?(Input::DOWN)
cursor_down(Input.trigger?(Input::DOWN))
end
if Input.repeat?(Input::UP)
cursor_up(Input.trigger?(Input::UP))
end
if @index != last_index
Sound.play_cursor
@savefile_windows[last_index].selected = false
@savefile_windows[@index].selected = true
end
end
end
#--------------------------------------------------------------------------
# * Confirm Save File
#--------------------------------------------------------------------------
def determine_savefile
if @saving
Sound.play_save
do_save
else
if @savefile_windows[@index].file_exist
Sound.play_load
do_load
else
Sound.play_buzzer
return
end
end
$game_temp.last_file_index = @index
end
#--------------------------------------------------------------------------
# * Move cursor down
# wrap : Wraparound allowed
#--------------------------------------------------------------------------
def cursor_down(wrap)
if @index < @item_max - 1 or wrap
@index = (@index + 1) % @item_max
end
end
#--------------------------------------------------------------------------
# * Move cursor up
# wrap : Wraparound allowed
#--------------------------------------------------------------------------
def cursor_up(wrap)
if @index > 0 or wrap
@index = (@index - 1 + @item_max) % @item_max
end
end
#--------------------------------------------------------------------------
# * Create Filename
# file_index : save file index (0-3)
#--------------------------------------------------------------------------
def make_filename(file_index)
return "Save#{file_index + 1}.rvdata"
end
#--------------------------------------------------------------------------
# * Select File With Newest Timestamp
#--------------------------------------------------------------------------
def latest_file_index
index = 0
latest_time = Time.at(0)
for i in 0...@savefile_windows.size
if @savefile_windows[i].time_stamp > latest_time
latest_time = @savefile_windows[i].time_stamp
index = i
end
end
return index
end
#--------------------------------------------------------------------------
# * Execute Save
#--------------------------------------------------------------------------
def do_save
file = File.open(@savefile_windows[@index].filename, "wb")
write_save_data(file)
file.close
return_scene
end
#--------------------------------------------------------------------------
# * Execute Load
#--------------------------------------------------------------------------
def do_load
file = File.open(@savefile_windows[@index].filename, "rb")
read_save_data(file)
file.close
$scene = Scene_Map.new
RPG::BGM.fade(1500)
Graphics.fadeout(60)
Graphics.wait(40)
@last_bgm.play
@last_bgs.play
end
#--------------------------------------------------------------------------
# * Write Save Data
# file : write file object (opened)
#--------------------------------------------------------------------------
def write_save_data(file)
characters = []
for actor in $game_party.members
characters.push([actor.character_name, actor.character_index])
end
$game_system.save_count += 1
$game_system.version_id = $data_system.version_id
@last_bgm = RPG::BGM::last
@last_bgs = RPG::BGS::last
Marshal.dump(characters, file)
Marshal.dump(Graphics.frame_count, file)
Marshal.dump(@last_bgm, file)
Marshal.dump(@last_bgs, file)
Marshal.dump($game_system, file)
Marshal.dump($game_message, file)
Marshal.dump($game_switches, file)
Marshal.dump($game_variables, file)
Marshal.dump($game_self_switches, file)
Marshal.dump($game_actors, file)
Marshal.dump($game_party, file)
Marshal.dump($game_troop, file)
Marshal.dump($game_map, file)
Marshal.dump($game_player, file)
end
#--------------------------------------------------------------------------
# * Read Save Data
# file : file object for reading (opened)
#--------------------------------------------------------------------------
def read_save_data(file)
characters = Marshal.load(file)
Graphics.frame_count = Marshal.load(file)
@last_bgm = Marshal.load(file)
@last_bgs = Marshal.load(file)
$game_system = Marshal.load(file)
$game_message = Marshal.load(file)
$game_switches = Marshal.load(file)
$game_variables = Marshal.load(file)
$game_self_switches = Marshal.load(file)
$game_actors = Marshal.load(file)
$game_party = Marshal.load(file)
$game_troop = Marshal.load(file)
$game_map = Marshal.load(file)
$game_player = Marshal.load(file)
if $game_system.version_id != $data_system.version_id
$game_map.setup($game_map.map_id)
$game_player.center($game_player.x, $game_player.y)
end
end
end
#==============================================================================
# ** Scene_End
#------------------------------------------------------------------------------
# This class performs game end screen processing.
#==============================================================================
class Scene_Image_End < Scene_Base
#--------------------------------------------------------------------------
# * Start processing
#--------------------------------------------------------------------------
def start
super
create_menu_background
create_command_window
@bg = Plane.new#Edit
@bg.bitmap = Cache.picture("bg_end")#Edit
end
#--------------------------------------------------------------------------
# * Post-Start Processing
#--------------------------------------------------------------------------
def post_start
super
open_command_window
end
#--------------------------------------------------------------------------
# * Pre-termination Processing
#--------------------------------------------------------------------------
def pre_terminate
super
close_command_window
end
#--------------------------------------------------------------------------
# * Termination Processing
#--------------------------------------------------------------------------
def terminate
super
@bg.dispose#Edit
dispose_command_window
dispose_menu_background
end
#--------------------------------------------------------------------------
# * Return to Original Screen
#--------------------------------------------------------------------------
def return_scene
$scene = Scene_Image.new
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
super
update_menu_background
@command_window.update
@bg.ox += 1#Edit
@bg.oy += 1#Edit
if Input.trigger?(Input::B)
Sound.play_cancel
return_scene
elsif Input.trigger?(Input::C)
case @command_window.index
when 0 # to title
command_to_title
when 1 # shutdown
command_shutdown
when 2 # quit
command_cancel
end
end
end
#--------------------------------------------------------------------------
# * Update Background for Menu Screen
#--------------------------------------------------------------------------
def update_menu_background
super
@menuback_sprite.tone.set(0, 0, 0, 128)
end
#--------------------------------------------------------------------------
# * Create Command Window
#--------------------------------------------------------------------------
def create_command_window
s1 = Vocab::to_title
s2 = Vocab::shutdown
s3 = Vocab::cancel
@command_window = Window_Command.new(172, [s1, s2, s3])
@command_window.x = (544 - @command_window.width) / 2
@command_window.y = (416 - @command_window.height) / 2
@command_window.openness = 0
@command_window.opacity = 100#Edit
end
#--------------------------------------------------------------------------
# * Dispose of Command Window
#--------------------------------------------------------------------------
def dispose_command_window
@command_window.dispose
end
#--------------------------------------------------------------------------
# * Open Command Window
#--------------------------------------------------------------------------
def open_command_window
@command_window.open
begin
@command_window.update
Graphics.update
end until @command_window.openness == 255
end
#--------------------------------------------------------------------------
# * Close Command Window
#--------------------------------------------------------------------------
def close_command_window
@command_window.close
begin
@command_window.update
Graphics.update
end until @command_window.openness == 0
end
#--------------------------------------------------------------------------
# * Process When Choosing [To Title] Command
#--------------------------------------------------------------------------
def command_to_title
Sound.play_decision
RPG::BGM.fade(800)
RPG::BGS.fade(800)
RPG::ME.fade(800)
$scene = Scene_Title.new
close_command_window
Graphics.fadeout(60)
end
#--------------------------------------------------------------------------
# * Process When Choosing [Shutdown] Command
#--------------------------------------------------------------------------
def command_shutdown
Sound.play_decision
RPG::BGM.fade(800)
RPG::BGS.fade(800)
RPG::ME.fade(800)
$scene = nil
end
#--------------------------------------------------------------------------
# * Process When Choosing [Cancel] Command
#--------------------------------------------------------------------------
def command_cancel
Sound.play_decision
return_scene
end
end
Demo:
Download
Author's Comments:
Free for Commercial/Non-Commercial use in Rpg Maker VX.