def set_graphics(bust_graphics)
self.bitmap=Cache.busts(bust_graphics)
end
def update
super
case @status
when :nothing
# Do Nothing
when :sliding_in
#Slide In
self.x+=12
if self.x>=0
self.x=0
@status=:slided_in
end
when :sliding_out
self.x-=12
if self.x<= -self.bitmap.width
self.x= -self.bitmap.width
@status=:slided_out
end
#Slide Out
when :slided_in
#Slided in
when :slided_out
#Sliede out
end
end
end
class Game_Message
attr_accessor :bust_name
attr_accessor :bust
attr_accessor :have_bust
attr_accessor :do_not_slide_out
alias lbq_bust_shot_game_message_init initialize
def initialize
lbq_bust_shot_game_message_init
@bust_name=""
@bust=nil
@have_bust=false
@do_not_slide_out=false
end
#--------------------------------------------------------------------------
# ● 添加内容
#--------------------------------------------------------------------------
def add(text)
new_text=text.gsub(LBQ::Bust::SUB1[0],LBQ::Bust::SUB1[1])
new_text2=new_text.gsub(LBQ::Bust::SUB2[0],LBQ::Bust::SUB2[1])
if new_text2.include? LBQ::Bust::TEXT_FOR_NEXT
new_text2.delete!(LBQ::Bust::TEXT_FOR_NEXT)
$game_message.do_not_slide_out=true
end
if new_text2.include? LBQ::Bust::TEXT_FOR_END
new_text2.delete!(LBQ::Bust::TEXT_FOR_END)
$game_message.do_not_slide_out=false
end
@texts.push(new_text2)
end
end
class Game_Interpreter
alias lbq_bust_shot_command_101 command_101
#--------------------------------------------------------------------------
# ● 显示文字
#--------------------------------------------------------------------------
def command_101
$game_message.bust=nil
unless @params[0].empty?
if File.exist?("Graphics/#{LBQ::Bust::FOLDER}/#{@params[0]}_#{@params[1]}.png")
$game_message.have_bust=true
else
$game_message.have_bust=false
$game_message.bust_name=""
end
end
unless @params[3] == 2
$game_message.have_bust=false
end
if $game_message.have_bust
$game_message.bust_name="#{@params[0]}_#{@params[1]}"
$game_message.bust=nil
$game_message.bust=Sprite_Bust.new
$game_message.bust.set_graphics($game_message.bust_name)
$game_message.bust.z=99999
unless $game_message.do_not_slide_out
$game_message.bust.set_pos
$game_message.bust.slide_in
else
$game_message.bust.set_pos(false)
$game_message.bust.slide_in
end
end
lbq_bust_shot_command_101
if $game_message.have_bust
$game_message.bust.slide_out
Fiber.yield until $game_message.bust.status==:slided_out
end
$game_message.have_bust=false
$game_message.bust_name=""
end
alias lbq_bust_int_update update
def update
lbq_bust_int_update
$game_message.bust.update unless $game_message.bust.nil?
end
end
class Window_Message
#--------------------------------------------------------------------------
# ● 获取换行位置
#--------------------------------------------------------------------------
def new_line_x
value=0
value=112 unless $game_message.face_name.empty?
unless $game_message.face_name.empty? && $game_message.bust_name.empty?
value=LBQ::Bust::INDENT
end