#==============================================================================
# ** Scene_Menu
#------------------------------------------------------------------------------
# This class performs menu screen processing.
#==============================================================================
#==============================================================================
# â– Window_Selectable2
#------------------------------------------------------------------------------
#  * The window selectable edit
#==============================================================================
class Window_Selectable2 < Window_Base
attr_reader :index
attr_reader :help_window
def initialize(x, y, width, height)
super(x, y, width, height)
@item_max = 1
@column_max = 1
@index = -1
end
def index=(index)
@index = index
if self.active and @help_window != nil
update_help
end
update_cursor_rect
end
def row_max
return (@item_max + @column_max - 1) / @column_max
end
def top_row
return self.oy / 32
end
def top_row=(row)
if row < 0
row = 0
end
if row > row_max - 1
row = row_max - 1
end
self.oy = row * 32
end
def page_row_max
return (self.height - 32) / 32
end
def page_item_max
return page_row_max * @column_max
end
def help_window=(help_window)
@help_window = help_window
if self.active and @help_window != nil
update_help
end
end
def update_cursor_rect
# do nothing
end
def update
super
if self.active and @help_window != nil
update_help
end
update_cursor_rect
end
end
#==============================================================================
# â– Window_Command
#------------------------------------------------------------------------------
#  一The second command window
#==============================================================================
class Window_Command2 < Window_Selectable2
def initialize(width, commands)
super(0, 0, width, commands.size * 32 + 32)
@item_max = commands.size
@commands = commands
self.contents = Bitmap.new(width - 32, @item_max * 32)
refresh
self.index = 0
end
def refresh
self.contents.clear
for i in 0...@item_max
draw_item(i, Color.new(255,255,255,255))
end
end
def draw_item(index, color)
self.contents.font.color = color
rect = Rect.new(4, 32 * index, self.contents.width - 8, 32)
self.contents.draw_text(rect, @commands[index])
end
def disable_item(index)
draw_item(index, disabled_color)
end
end
#------------------------------------------------------------------------------
# Transition
#------------------------------------------------------------------------------
module MOG
#Transition Time.
MNTT = 20
#Transition Type (Name)
MNTP = "006-Stripe02"
end
$mogscript = {} if $mogscript == nil
$mogscript["menu_itigo"] = true
#------------------------------------------------------------------------------
# Get actor Exp
#------------------------------------------------------------------------------
class Game_Actor < Game_Battler
def now_exp
return @exp - @exp_list[@level]
end
def next_exp
return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0
end
end
#------------------------------------------------------------------------------
# Window Base Overide
#------------------------------------------------------------------------------
class Window_Base < Window
def nada
face = RPG::Cache.picture("")
end
def drw_face(actor,x,y)
face = RPG::Cache.picture(actor.name + "_fc") rescue nada
face_width = face.width
face_height = face.height
src_rect = Rect.new(0, 0, face_width, face_height)
self.contents.blt(x , y - face_height, face, src_rect)
end
#------------------------------------------------------------------------------
# Make HP Bars
#------------------------------------------------------------------------------
def draw_maphp3(actor, x, y)
back = RPG::Cache.picture("BAR0")
face_width = back.width
face_height = back.height
src_rect = Rect.new(0, 0, face_width, face_height)
self.contents.blt(x + 65, y - face_height + 30, back, src_rect)
meter = RPG::Cache.picture("HP_Bar")
face_width = meter.width * actor.hp / actor.maxhp
face_height = meter.height
src_rect = Rect.new(0, 0, face_width, face_height)
self.contents.blt(x + 65, y - face_height + 30, meter, src_rect)
text = RPG::Cache.picture("HP_Tx")
face_width = text.width
face_height = text.height
src_rect = Rect.new(0, 0, face_width, face_height)
self.contents.blt(x + 35, y - face_height + 30, text, src_rect)
self.contents.font.color = Color.new(0,0,0,255)
self.contents.draw_text(x + 81, y - 1, 48, 32, actor.hp.to_s, 2)
self.contents.font.color = Color.new(255,255,255,255)
self.contents.draw_text(x + 80, y - 2, 48, 32, actor.hp.to_s, 2)
end
#------------------------------------------------------------------------------
# Make SP Bars
#------------------------------------------------------------------------------
def draw_mapsp3(actor, x, y)
back = RPG::Cache.picture("BAR0")
face_width = back.width
face_height = back.height
src_rect = Rect.new(0, 0, face_width, face_height)
self.contents.blt(x + 65, y - face_height + 30, back, src_rect)
meter = RPG::Cache.picture("SP_Bar")
face_width = meter.width * actor.sp / actor.maxsp
face_height = meter.height
src_rect = Rect.new(0, 0, face_width, face_height)
self.contents.blt(x + 65, y - face_height + 30, meter, src_rect)
text = RPG::Cache.picture("SP_Tx")
face_width = text.width
face_height = text.height
src_rect = Rect.new(0, 0, face_width, face_height)
self.contents.blt(x + 35, y - face_height + 30, text, src_rect)
self.contents.font.color = Color.new(0,0,0,255)
self.contents.draw_text(x + 81, y - 1, 48, 32, actor.sp.to_s, 2)
self.contents.font.color = Color.new(255,255,255,255)
self.contents.draw_text(x + 80, y - 2, 48, 32, actor.sp.to_s, 2)
end
#------------------------------------------------------------------------------
# Make EXP Bars
#------------------------------------------------------------------------------
def draw_mexp2(actor, x, y)
bitmap2 = RPG::Cache.picture("Exp_Back")
face_width = bitmap2.width
face_height = bitmap2.height
src_rect = Rect.new(0, 0, face_width, face_height)
self.contents.blt(x + 60 , y - face_height + 30, bitmap2, src_rect)
if actor.next_exp != 0
rate = actor.now_exp.to_f / actor.next_exp
else
rate = 1
end
bitmap = RPG::Cache.picture("Exp_Meter")
if actor.level < 99
face_width = bitmap.width * rate
else
face_width = bitmap.width
end
face_height = bitmap.height
src_rect = Rect.new(0, 0, face_width, face_height)
self.contents.blt(x + 60 , y - face_height + 30, bitmap, src_rect)
exp_tx = RPG::Cache.picture("Exp_tx")
face_width = exp_tx.width
face_height = exp_tx.height
src_rect = Rect.new(0, 0, face_width, face_height)
self.contents.blt(x + 55 , y - face_height + 30, exp_tx, src_rect)
lv_tx = RPG::Cache.picture("LV_tx")
face_width = lv_tx.width
face_height = lv_tx.height
src_rect = Rect.new(0, 0, face_width, face_height)
self.contents.blt(x + 125 , y - face_height + 35, lv_tx, src_rect)
self.contents.font.color = Color.new(0,0,0,255)
self.contents.draw_text(x + 161, y + 7, 24, 32, actor.level.to_s, 1)
self.contents.font.color = Color.new(255,255,255,255)
self.contents.draw_text(x + 160, y + 6, 24, 32, actor.level.to_s, 1)
end
#------------------------------------------------------------------------------
# Make Character State Text
#------------------------------------------------------------------------------
def draw_actor_state2(actor, x, y, width = 80)
text = make_battler_state_text(actor, width, true)
self.contents.font.color = actor.hp == 0 ? knockout_color : normal_color
self.contents.draw_text(x, y, width, 32, text,2)
end
end
#-----------------------------------------------------------------------------
# Status
#-----------------------------------------------------------------------------
class Window_MenuStatus2 < Window_Selectable2
def initialize
super(0, 0, 640, 289)
self.contents = Bitmap.new(width - 32, height - 32)
refresh
self.active = false
self.opacity = 0
self.index = -1
end
def refresh
self.contents.clear
@item_max = $game_party.actors.size
for i in 0...$game_party.actors.size
x = 20
y = i * 62
actor = $game_party.actors[i]
self.contents.font.name = "Georgia"
if $mogscript["TP_System"] == true
draw_actor_tp(actor ,x + 285, y - 5,4)
draw_actor_state2(actor ,x + 190, y - 5)
else
draw_actor_state2(actor ,x + 220, y - 5)
end
drw_face(actor,x,y + 50)
draw_maphp3(actor,x + 40, y - 5)
draw_mapsp3(actor,x + 40, y + 20 )
draw_mexp2(actor,x + 140, y + 15 )
end
end
def update_cursor_rect
if @index < 0
self.cursor_rect.empty
else
self.cursor_rect.set(5, @index * 62, self.width - 32, 50)
end
end
end
#------------------------------------------------------------------------------
# Gold Window
#------------------------------------------------------------------------------
class Window_Gold2 < Window_Base
def initialize
super(0, 0, 160, 64)
self.contents = Bitmap.new(width - 32, height - 32)
refresh
end
def refresh
self.contents.clear
cx = contents.text_size($data_system.words.gold).width
self.contents.font.color = normal_color
self.contents.draw_text(4, 0, 120-cx-2, 32, $game_party.gold.to_s, 1)
self.contents.font.color = system_color
self.contents.draw_text(124-cx, 0, cx, 32, $data_system.words.gold, 1)
end
end
#-----------------------------------------------------------------------------
# Play Time Window
#-----------------------------------------------------------------------------
class Window_PlayTime2 < Window_Base
def initialize
super(0, 0, 160, 96)
self.contents = Bitmap.new(width - 32, height - 32)
refresh
end
def refresh
self.contents.clear
@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(4, 32, 120, 32, text, 2)
end
def update
super
if Graphics.frame_count / Graphics.frame_rate != @total_sec
refresh
end
end
end
#------------------------------------------------------------------------------
# Scene Menu
#------------------------------------------------------------------------------
class Scene_Menu
def initialize(menu_index = 0)
@menu_index = menu_index
end
def main
s1 = ""
s2 = ""
s3 = ""
s4 = ""
s5 = ""
s6 = ""
@command_window = Window_Command2.new(160, [s1, s2, s3, s4, s5, s6])
@command_window.index = @menu_index
if $game_party.actors.size == 0
@command_window.disable_item(0)
@command_window.disable_item(1)
@command_window.disable_item(2)
@command_window.disable_item(3)
end
@command_window.visible = false
@command_window.x = -640
@overlay = Sprite.new
@overlay.bitmap = RPG::Cache.picture("Overlay")
@overlay.z = 10
@bkground = Plane.new
@bkground.bitmap = RPG::Cache.picture("Dark Background")
@bkground.blend_type = 0
@bkground.z = 5
@bkground2 = Plane.new
@bkground2.bitmap = RPG::Cache.picture("RainFall-Fog")
@bkground2.blend_type = 0
@bkground2.z = 5
@bkground2.opacity = 60
@selector = Sprite.new
@selector.bitmap = RPG::Cache.picture("Mn_Sel")
@selector.z = 20
@selector.x = -22
@selector.y = 400
@mnop = 150
if $game_system.save_disabled
@command_window.disable_item(4)
end
@playtime_window = Window_PlayTime2.new
@playtime_window.x = 1
@playtime_window.y = -20
@playtime_window.opacity = 0
@playtime_window.z = 15
@gold_window = Window_Gold2.new
@gold_window.x = 450
@gold_window.y = 10
@gold_window.opacity = 0
@gold_window.z = 15
@status_window = Window_MenuStatus2.new
@status_window.x = 0
@status_window.y = 105
@status_window.opacity = 0
@status_window.z = 15
Graphics.transition(MOG::MNTT, "Graphics/Transitions/" + MOG::MNTP)
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@command_window.dispose
@playtime_window.dispose
@gold_window.dispose
@status_window.dispose
@overlay.dispose
@bkground.dispose
@bkground2.dispose
@selector.dispose
Graphics.update
end
def update
@command_window.update
@playtime_window.update
@gold_window.update
@status_window.update
@bkground2.oy += 1
@bkground2.ox -= 1
@mnop += 5
if @command_window.active == true
@selector.bitmap = RPG::Cache.picture("Mn_Sel")
else
@selector.bitmap = RPG::Cache.picture("Mn_Sel_off")
@selector.zoom_x = 1
@selector.opacity = 255
end
if @mnop >= 255
@mnop = 120
end
if @command_window.active
update_command
return
end
if @status_window.active
update_status
return
end
end
def update_command
if Input.repeat?(Input::LEFT)
@menu_index -= 1
if @menu_index < 0
@menu_index = 6
end
end
if Input.repeat?(Input::RIGHT)
@menu_index += 1
if @menu_index > 6
@menu_index = 0
end
end
if @selector.zoom_x <= 1.6
@selector.zoom_x += 0.03
@selector.opacity -= 10
elsif @selector.zoom_x > 1.6
@selector.zoom_x = 1.0
@selector.opacity = 255
end
@command_window.index = @menu_index
case @command_window.index
when 0
@selector.x = -22
@selector.y = 400
when 1
@selector.x = 60
@selector.y = 435
when 2
@selector.x = 150
@selector.y = 400
when 3
@selector.x = 270
@selector.y = 435
when 4
@selector.x = 375
@selector.y = 400
when 5
@selector.x = 475
@selector.y = 430
end
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 @command_window.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)
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 2
$game_system.se_play($data_system.decision_se)
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 3
$game_system.se_play($data_system.decision_se)
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 4
if $game_system.save_disabled
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
$scene = Scene_Save.new
when 5
$game_system.se_play($data_system.decision_se)
$scene = Scene_End.new
end
return
end
end
def update_status
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@command_window.active = true
@status_window.active = false
@status_window.index = -1
return
end
if Input.trigger?(Input::C)
case @command_window.index
when 1
if $game_party.actors[@status_window.index].restriction >= 2
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
$scene = Scene_Skill.new(@status_window.index)
when 2
$game_system.se_play($data_system.decision_se)
$scene = Scene_Equip.new(@status_window.index)
when 3
$game_system.se_play($data_system.decision_se)
$scene = Scene_Status.new(@status_window.index)
end
return
end
end
end