#==============================================================================
# ** CreditsInTitleCommand
#==============================================================================
module CreditsInTitleCommand
# 按钮名
CommandName = "制作名单"
# 内容
Credits = <<Orz
编剧……………………A
图像……………………B
脚本……………………C
音效……………………D
随你发挥了
下面这个Orz不要删
Orz
end
#==============================================================================
# ** Window_Credits
#==============================================================================
class Window_Credits < Window_Base
attr_accessor :to_active
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
bitmap = Bitmap.new Graphics.width, Graphics.height
width = height = 0
CreditsInTitleCommand::Credits.each_line do |line|
line.chomp!
rect = bitmap.text_size(line).tap{|r|
r.y = height
width = [width, r.width += 2].max
height += r.height += 2
}
end
width += standard_padding * 2
height += standard_padding * 2
x = (Graphics.width - width) / 2
y = (Graphics.height - height) / 2
super x, y, width, height
width -= standard_padding * 2
height = 0
CreditsInTitleCommand::Credits.each_line do |line|
line.chomp!
rect = bitmap.text_size(line).tap{|r|
r.y = height
r.width = width
height += r.height += 2
}
contents.draw_text rect, line, 1
end
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
super
process_handling
end
#--------------------------------------------------------------------------
# * Handling Processing for OK and Cancel Etc.
#--------------------------------------------------------------------------
def process_handling
return unless open? && active
return on_exit if Input.trigger?(:C) || Input.trigger?(:B)
end
#--------------------------------------------------------------------------
# * On Exit
#--------------------------------------------------------------------------
def on_exit
Sound.play_ok
Input.update
close
deactivate
to_active.activate
end
end
#==============================================================================
# ** Window_TitleCommand
#==============================================================================
class Window_TitleCommand
#--------------------------------------------------------------------------
# * Create Command List
#--------------------------------------------------------------------------
alias :make_command_list_20140907_M :make_command_list
def make_command_list
make_command_list_20140907_M
add_command(CreditsInTitleCommand::CommandName, :credits)
end
end
#==============================================================================
# ** Scene_Title
#==============================================================================
class Scene_Title
#--------------------------------------------------------------------------
# * Create Command Window
#--------------------------------------------------------------------------
alias :create_command_window_20140907_M :create_command_window
def create_command_window
create_command_window_20140907_M
@command_window.set_handler(:credits, method(:command_credits))
@credits_window = Window_Credits.new
@credits_window.to_active = @command_window
@credits_window.openness = 0
end
#--------------------------------------------------------------------------
# * [Credit] Command
#--------------------------------------------------------------------------
def command_credits
@credits_window.open
@credits_window.activate
end
end