class Scene_Menu
def create_background
@back = Spriteset_Map.new
end
Menu_Tone = Tone.new(40, 3, -10, 60)
Duration = 20
alias_method :seph_screentonechange_main, :main
def main
@map_tone = $game_screen.tone.dup
$game_screen.start_tone_change(Menu_Tone, Duration)
seph_screentonechange_main
$game_screen.start_tone_change(@map_tone, Duration)
create_background
s1 = 'Inventory'
s2 = 'Skills'
s3 = 'Equipment'
s4 = 'Status'
s5 = 'Save'
s6 = 'End Game'
@command_window = Window_Command_WcW.new(0, 0, 160, [['Item', s1], ['I_BookSmall', s2], ['Sword', s3], ['I_ScrollSmall', s4], ['I_FeatherSmall', s5], ['Escape', s6]])
@command_window.back_opacity = 125
if $game_system.save_disabled
@command_window.disable_item(4)
end
@gold_window = Window_Gold.new
@gold_window.x = 0
@gold_window.y = 320
@playtime_window = Window_PlayTime.new
@playtime_window.y = 224
@playtime_window.x = 0
@status_window = Window_MenuStatus.new
@status_window.x = 160
@status_window.y = 0
@command_window.back_opacity, @playtime_window.back_opacity, @gold_window.back_opacity, @status_window.back_opacity = 125, 125, 125, 125, 125
Graphics.transition(10)
loop do
Graphics.update
Input.update
update
$game_screen.update
if $scene != self
break
end
end
@command_window.dispose
@gold_window.dispose
@playtime_window.dispose
@back.dispose if @back != nil
@status_window.dispose
Graphics.transition(10)
end
def start_tone_change(tone, duration)
@tone_target = tone.clone
@tone_duration = duration
if @tone_duration == 0
@tone = @tone_target.clone
end
end
end
class Game_Party
def add_actor(actor_id)
actor = $game_actors[actor_id]
if @actors.size < 4 and not @actors.include?(actor)
@actors.push(actor)
$game_player.refresh
end
end
end
#----------------------------------------------------------------------------
# * Window Command (WcW)
# Displays options w/ icons. Feel free to use this in your own script.
#----------------------------------------------------------------------------
class Window_Command_WcW < Window_Selectable
#--------------------------------------------------------------------------
# * Initialize
#--------------------------------------------------------------------------
def initialize(x, y, width, commands)
# Calls original initialize method
super(x, y, width, commands.size * 32 + 32)
# Sets maximum items and commands variables
@item_max = commands.size
@commands = commands
# Initializes the @disabled array, which is used for drawing disabled items
@disabled = []; @commands.size.times { @disabled.push false }
# Creates a new bitmap for the contents
self.contents = Bitmap.new(width-32, commands.size * 32)
# Sets the index to 0
self.index = 0
# Draws contents
refresh
end
#--------------------------------------------------------------------------
# * Refreshes Contents
#--------------------------------------------------------------------------
def refresh
# Clears bitmap
self.contents.clear
# For each command in the @commands array....
@commands.size.times {|i|
# Get the icon from RPG::Cache
self.contents.blt(4, 32 * i + 4, RPG::Cache.icon(@commands[i][0]),
Rect.new(0, 0, 24, 24))
# If the disabled array has this down for this disabled, draw it as
# disabled, if not, draw it normal
self.contents.font.color = @disabled[i] ? disabled_color : normal_color
# Draw the command
self.contents.draw_text(34, 32 * i, self.contents.width - 34, 32,
@commands[i][1], 0)
}
end
#--------------------------------------------------------------------------
# * Disable Items
#--------------------------------------------------------------------------
def disable_items(*indexes)
# For each index in the given argument array,
indexes.each {|index|
# Set that index to disabled in the @disabled array
@disabled[index] = true
}
# Re-draw contents
refresh
end
#--------------------------------------------------------------------------
# * Enable Items
#--------------------------------------------------------------------------
def enable_items(*indexes)
# For each index in the given argument array,
indexes.each {|index|
# Set that index to enabled in the @disabled array
@disable[index] = false
}
# Red-draw contents
refresh
end
end
class Window_Base
def draw_actor_face(actor, x, y)
bitmap = RPG::Cache.picture(actor.character_name)
cw = bitmap.width
ch = bitmap.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect)
end
end
class Window_MenuStatus
def refresh
self.contents.clear
@item_max = $game_party.actors.size
for i in 0...$game_party.actors.size
x = 64
y = i * 116
actor = $game_party.actors[i]
draw_actor_face(actor, x, y + 95)
draw_actor_name(actor, x, y)
draw_actor_class(actor, x + 144, y + 32)
draw_actor_level(actor, x + 144, y)
draw_actor_state(actor, x + 144, y + 64)
draw_actor_exp(actor, x + 236, y + 64)
draw_actor_hp(actor, x + 236, y + 0)
draw_actor_sp(actor, x + 236, y + 32)
end
end
end
class Window_MenuStatus < Window_Selectable
def initialize
super(0, 0, 480, 480)
self.contents = Bitmap.new(width - 32, height - 32)
refresh
self.active = false
self.index = -1
end
end