#==============================================================================
# ■ Scene_Menu
#------------------------------------------------------------------------------
#==============================================================================
class Scene_Menu
#--------------------------------------------------------------------------
# menu_index
#--------------------------------------------------------------------------
def initialize(menu_index = 0)
@menu_index = menu_index
end
#--------------------------------------------------------------------------
def main
@window = Window_Command.new(90, ["Item", "Skills","Party", "Info", "Opitions", "File"])
@window2 = Window_Command.new(90, [$data_system.words.item, $data_system.words.equip])
@window3 = Window_Command.new(90, [$data_system.words.skill, "Skills"])
@window4 = Window_Command.new(90, ["Replace", "Status", "Behavior", "Triggers"])
@window5 = Window_Command.new(90, ["Bestiary", "Quest"])
@window6 = Window_Command.new(90, ["Load", "Exit"])
@window.x, @window.y, @window.back_opacity = 0, 80 , 160
@window2.x, @window2.y, @window2.back_opacity, @window2.visible, @window2.active = 90, 80 , 160, false, false
@window3.x, @window3.y, @window3.back_opacity, @window3.visible, @window3.active = 90, 80 , 160, false, false
@window4.x, @window4.y, @window4.back_opacity, @window4.visible, @window4.active = 90, 80 , 160, false, false
@window5.x, @window5.y, @window5.back_opacity, @window5.visible, @window5.active = 90, 80 , 160, false, false
@window6.x, @window6.y, @window6.back_opacity, @window6.visible, @window6.active = 90, 80 , 160, false, false
@spriteset = Spriteset_Map.new
@bwindow, @bwindow.x, @bwindow.y, @bwindow.back_opacity = Window_Bottom.new, 0, 429, 160
@swindow, @swindow.x, @swindow.y, @swindow.back_opacity = Window_my_MenuStatus.new, 180, 80, 160
@mwindow, @mwindow.x, @mwindow.y, @mwindow.opacity = Window_Main_Menu.new, 0, 0, 0
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@window.dispose
@window2.dispose
@window3.dispose
@window4.dispose
@window5.dispose
@window6.dispose
@mwindow.dispose
@bwindow.dispose
@swindow.dispose
end
#--------------------------------------------------------------------------
def update
@window.update
@window2.update
@window3.update
@window4.update
@window5.update
@window6.update
@bwindow.update
@swindow.update
@mwindow.update
if @window.active
update_command
return
end
if @window2.active
update_command2
return
end
if @window3.active
update_command3
return
end
if @window4.active
update_command4
return
end
if @window5.active
update_command5
return
end
if @window6.active
update_command6
return
end
if @swindow.active
update_status
return
end
end
#--------------------------------------------------------------------------
def update_command
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Map.new
return
end
if Input.trigger?(Input::C)
if $game_party.actors.size == 0 and @command_window.index < 4
$game_system.se_play($data_system.buzzer_se)
return
end
case @window.index
when 0
$game_system.se_play($data_system.decision_se)
@window.active, @window2.visible, @window2.active, @window2.index = false, true , true, 0
when 1
$game_system.se_play($data_system.decision_se)
@window.active, @window3.visible, @window3.active, @window3.index = false, true , true, 0
when 2
$game_system.se_play($data_system.decision_se)
@window.active, @window4.visible, @window4.active, @window2.index = false, true , true, 0
when 3
$game_system.se_play($data_system.decision_se)
@window.active, @window5.visible, @window5.active, @window5.index = false, true , true, 0
when 4
$game_system.se_play($data_system.decision_se)
$scene = Scene_Options.new
when 5
@window.active, @window6.visible, @window6.active, @window6.index = false, true , true, 0
end
return
end
end
#-------------------------------------------------------------------------------------
def update_command2
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@window2.active, @window2.visible, @window.active, @window.index = false, false , true, 0
return
end
if Input.trigger?(Input::C)
case @window2.index
when 0
$game_system.se_play($data_system.decision_se)
$scene = Scene_Item.new
when 1
$game_system.se_play($data_system.decision_se)
@window2.active, @swindow.active, @swindow.index = false, true, 0
end
return
end
end
#----------------------------------------------------------------------------------
def update_command3
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@window3.active, @window3.visible, @window.active, @window.index = false, false , true, 1
return
end
if Input.trigger?(Input::C)
case @window3.index
when 0
$game_system.se_play($data_system.decision_se)
@window3.active, @swindow.active, @swindow.index = false, true, 0
when 1
$game_system.se_play($data_system.decision_se)
#skills
end
return
end
end
#-------------------------------------------------------------------------------------------------
def update_command4
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@window4.active, @window4.visible, @window.active, @window.index = false, false , true, 2
return
end
if Input.trigger?(Input::C)
case @window4.index
when 0
$game_system.se_play($data_system.decision_se)
$scene = Scene_PartySwitcher.new(1)
when 1
$game_system.se_play($data_system.decision_se)
@window4.active, swindow.active, @swindow.index = false, true, 0
when 2
$game_system.se_play($data_system.decision_se)
$scene = Scene_AI_Behavior.new
when 3
$game_system.se_play($data_system.decision_se)
$scene = Scene_AI_Triggers.new
end
return
end
end
#--------------------------------------------------------------------------------------------------
def update_command5
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@window5.active, @window5.visible, @window.active, @window.index = false, false , true, 3
return
end
if Input.trigger?(Input::C)
if $game_party.actors.size == 0 and @command_window.index < 4
$game_system.se_play($data_system.buzzer_se)
return
end
case @window5.index
when 0
$game_system.se_play($data_system.decision_se)
$scene = Scene_Bestiary.new
when 1
$game_system.se_play($data_system.decision_se)
$scene = Scene_Questbook.new($scene)
end
return
end
end
#------------------------------------------------------------------------------------------
def update_command6
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@window6.active, @window6.visible, @window.active, @window.index = false, false , true, 5
return
end
if Input.trigger?(Input::C)
case @window6.index
when 0
$game_system.se_play($data_system.decision_se)
$scene = Scene_Load2.new
when 1
$game_system.se_play($data_system.decision_se)
$scene = Scene_End.new
end
return
end
end
#--------------------------------------------------------------------------
def update_status
if @window2.visible == true
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@window2.active, @swindow.active, @swindow.index = true, false, -1
return
end
if Input.trigger?(Input::C)
case @window2.index
when 1
$game_system.se_play($data_system.decision_se)
$scene = Scene_Equip.new(@swindow.index)
end
return
end
end
#-----------------------------------------------------------------------------------------
if @window3.visible == true
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@window3.active, @swindow.active, @swindow.index = true, false, -1
return
end
if Input.trigger?(Input::C)
case @window3.index
when 0
$game_system.se_play($data_system.decision_se)
$scene = Scene_Skill.new(@swindow.index)
when 1
$game_system.se_play($data_system.decision_se)
## skills #############
end
return
end
end
#----------------------------------------------------------------------------------------------
if @window4.visible == true
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@window4.active, @swindow.active, @swindow.index = true, false, -1
return
end
if Input.trigger?(Input::C)
case @window4.index
when 1
$game_system.se_play($data_system.decision_se)
$scene = Scene_Status.new(@swindow.index)
end
return
end
end
end
end
#==============================================================================
# ■ Window_MenuStatus
#-----------------------------------------------------------------------------
class Window_my_MenuStatus < Window_Selectable
#--------------------------------------------------------------------------
def initialize
super(0, 0, 460, 350)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $defaultfonttype
self.contents.font.size = 15
refresh
self.active = false
self.index = -1
end
#--------------------------------------------------------------------------
def refresh
self.contents.clear
@item_max = $game_party.actors.size
for i in 0...$game_party.actors.size
x = 54
y = i * 80
actor = $game_party.actors[i]
draw_actor_graphic(actor, x - 40, y + 50)
draw_actor_name(actor, x, y - 10)
draw_actor_level(actor, x, y + 10)
draw_actor_exp(actor, x, y + 34)
draw_actor_hp(actor, x + 236, y + 2)
draw_actor_sp(actor, x + 236, y + 34)
end
end
#--------------------------------------------------------------------------
def update_cursor_rect
if @index < 0
self.cursor_rect.empty
else
self.cursor_rect.set(0, @index * 80, self.width - 32, 80)
end
end
end
#==============================================================================
# ■ Window_Bottom
#------------------------------------------------------------------------------
class Window_Bottom < Window_Base
#--------------------------------------------------------------------------
def initialize
super(0, 0, 640, 50)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $defaultfonttype
self.contents.font.size = 15
refresh
end
#--------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.font.color = system_color
self.contents.draw_text(340, - 10, 120, 32, "Play Time")
@total_sec = Graphics.frame_count / Graphics.frame_rate
hour = @total_sec / 60 / 60
min = @total_sec / 60 % 60
sec = @total_sec % 60
text = sprintf("%02d:%02d:%02d", hour, min, sec)
self.contents.font.color = normal_color
self.contents.draw_text(350, -10, 120, 32, text, 2)
cx = contents.text_size($data_system.words.gold).width
self.contents.font.color = normal_color
self.contents.draw_text(480, - 10, 120-cx-2, 32, $game_party.gold.to_s, 2)
self.contents.font.color = system_color
self.contents.draw_text(600-cx, - 10, cx, 32, $data_system.words.gold, 2)
end
#--------------------------------------------------------------------------
def update
super
if Graphics.frame_count / Graphics.frame_rate != @total_sec
refresh
end
end
end
#==============================================================================
# ■ Window_Main_menu
#-----------------------------------------------------------------------------
class Window_Main_Menu < Window_Base
#--------------------------------------------------------------------------
def initialize
super(0, 0, 640, 80)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $defaultfonttype
self.contents.font.size = 40
refresh
end
#--------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.font.color = normal_color
self.contents.draw_text(40, 0, 120, 32, "Main Menu", 2)
end
end