04-07-2010, 08:04 AM
Or you can try this:
Code:
#==============================================================================
# ? Scene_Map
#------------------------------------------------------------------------------
#==============================================================================
class Scene_Map
#--------------------------------------------------------------------------
#
#--------------------------------------------------------------------------
alias main_level_up main
def main
@level_up_window = Window_Level_Up.new
#original call
main_level_up
@level_up_window.dispose
end
#--------------------------------------------------------------------------
#
#--------------------------------------------------------------------------
alias update_level_up update
def update
@level_up_window.update
# original call
update_level_up
end
end
#==============================================================================
# ? Window_Level_Up
#------------------------------------------------------------------------------
#==============================================================================
class Window_Level_Up < Window_Base
#--------------------------------------------------------------------------
#
#--------------------------------------------------------------------------
def initialize
super(160, 416, 320, 64)
self.contents = Bitmap.new(width - 32, height - 32)
self.visible = false
@wait_count = 0
end
#--------------------------------------------------------------------------
#
#--------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.draw_text(self.contents.rect, $game_party.actors[0].name +
" reached level " + $game_party.actors[0].level.to_s, 1)
end
#--------------------------------------------------------------------------
#
#--------------------------------------------------------------------------
def update
if $game_system.old_level < $game_party.actors[0].level
$game_system.old_level = $game_party.actors[0].level
refresh
# Play decision SE
$game_system.se_play($data_system.decision_se)
self.visible = true
self.opacity = 255
self.contents_opacity = 255
@wait_count = 40
else
if @wait_count > 0
@wait_count -= 1
else
if self.opacity > 0
self.opacity -= 4
self.contents_opacity -= 4
else
self.visible = false
end
end
end
end
end
#==============================================================================
# ? Game_System
#------------------------------------------------------------------------------
#==============================================================================
class Game_System
#--------------------------------------------------------------------------
#
#--------------------------------------------------------------------------
attr_accessor :old_level
#--------------------------------------------------------------------------
#
#--------------------------------------------------------------------------
alias initialize_level_up initialize
def initialize
@old_level = 1
# original call
initialize_level_up
end
end