=begin
大家好我是有丘直方啦!叫我“有丘”就好啦。
虽然是这里的新人,但是接触RMVX也有好几个月了吧。
嗯哼,是不是觉得我发个脚本啰嗦那么多?
这是我第一个在技术区发布的脚本,十分激动因此啰嗦那么多啊!
作为一个才学RGSS2大约才2个星期的人能做出这个脚本我也是很激动啊。
一个初中生难得寒假能有时间学学RGSS2……
(好像真的啰嗦多了。)
好吧那就这样……
啰嗦完毕……
=end
 
#==============================================================================
# 在标题画面和菜单插入另外内容的脚本  by 有丘直方
#------------------------------------------------------------------------------
# 使用方法:1.导入一幅图片到Graphics/Pictures/下,命名为Introduction。
#           2.将本脚本插入到main前。
#           3.设置下面的这个常量。
# 本脚本仅支持在标题画面和菜单增加选项并进入选项后居中显示图片的功能。
#==============================================================================
 
#--------------------------------------------------------------------------
# ● 常量
#--------------------------------------------------------------------------
TITLE = "游戏介绍"    # 标题画面和菜单额外的选项的内容
 
#==============================================================================
# ■ Scene_IntroductionTitle
#------------------------------------------------------------------------------
#  处理在标题画面游戏介绍画面的类。
#==============================================================================
class Scene_IntroductionTitle < Scene_Base
  #--------------------------------------------------------------------------
  # ● 开始处理
  #--------------------------------------------------------------------------
  def start
    super
    create_introduction_graphic
  end
  #--------------------------------------------------------------------------
  # ● 执行渐变
  #--------------------------------------------------------------------------
  def perform_transition
    Graphics.transition(20)
  end
  #--------------------------------------------------------------------------
  # ● 结束处理
  #--------------------------------------------------------------------------
  def terminate
    super
    dispose_introduction_graphic
  end
  #--------------------------------------------------------------------------
  # ● 更新画面
  #--------------------------------------------------------------------------
  def update
    super
    if Input.trigger?(Input::B)
      title
    end
  end
  #--------------------------------------------------------------------------
  # ● 生成图形
  #--------------------------------------------------------------------------
  def create_introduction_graphic
    @sprite = Sprite.new
    @sprite.bitmap = Bitmap.new("Graphics/Pictures/Introduction")
  end
  #--------------------------------------------------------------------------
  # ● 释放图形
  #--------------------------------------------------------------------------
  def dispose_introduction_graphic
    @sprite.bitmap.dispose
    @sprite.dispose
  end
  #--------------------------------------------------------------------------
  # ● 命令:返回标题画面
  #--------------------------------------------------------------------------
  def title
    Sound.play_cancel
    $scene = Scene_Title.new
  end
end
 
#==============================================================================
# ■ Scene_IntroductionMenu
#------------------------------------------------------------------------------
#  处理菜单的游戏介绍画面的类。
#==============================================================================
class Scene_IntroductionMenu < Scene_Base
  #--------------------------------------------------------------------------
  # ● 开始处理
  #--------------------------------------------------------------------------
  def start
    super
    create_introduction_graphic
  end
  #--------------------------------------------------------------------------
  # ● 执行渐变
  #--------------------------------------------------------------------------
  def perform_transition
    Graphics.transition(20)
  end
  #--------------------------------------------------------------------------
  # ● 结束处理
  #--------------------------------------------------------------------------
  def terminate
    super
    dispose_introduction_graphic
  end
  #--------------------------------------------------------------------------
  # ● 更新画面
  #--------------------------------------------------------------------------
  def update
    super
    if Input.trigger?(Input::B)
      menu
    end
  end
  #--------------------------------------------------------------------------
  # ● 生成图形
  #--------------------------------------------------------------------------
  def create_introduction_graphic
    @sprite = Sprite.new
    @sprite.bitmap = Bitmap.new("Graphics/Pictures/Introduction")
  end
  #--------------------------------------------------------------------------
  # ● 释放图形
  #--------------------------------------------------------------------------
  def dispose_introduction_graphic
    @sprite.bitmap.dispose
    @sprite.dispose
  end
  #--------------------------------------------------------------------------
  # ● 命令:返回菜单
  #--------------------------------------------------------------------------
  def menu
    Sound.play_cancel
    $scene = Scene_Menu.new(8)
  end
end
 
#==============================================================================
# ■ Scene_Title
#------------------------------------------------------------------------------
#  处理标题画面的类。
#==============================================================================
class Scene_Title < Scene_Base
  #--------------------------------------------------------------------------
  # ● 更新画面
  #--------------------------------------------------------------------------
  def update
    super
    @command_window.update
    if Input.trigger?(Input::C)
      case @command_window.index
      when 0    # 新的开始
        command_new_game
      when 1    # 继续游戏
        command_continue
      when 2    # 退出游戏
        command_shutdown
      when 3    # 另外选项
        $scene = Scene_IntroductionTitle.new
      end
    end
  end
  #--------------------------------------------------------------------------
  # ● 生成命令窗口
  #--------------------------------------------------------------------------
  def create_command_window
    s1 = Vocab::new_game
    s2 = Vocab::continue
    s3 = Vocab::shutdown
    s4 = TITLE
    @command_window = Window_Command.new(172, [s1, s2, s3, s4])
    @command_window.x = (544 - @command_window.width) / 2
    @command_window.y = 264
    if @continue_enabled                    # 如果「继续」有效
      @command_window.index = 1             # 将光标移至「继续游戏」
    else                                    # 否则则将「继续游戏」半透明化
      @command_window.draw_item(1, false)
    end
    @command_window.openness = 0
    @command_window.open
  end
  #--------------------------------------------------------------------------
  # ● 命令:游戏介绍
  #--------------------------------------------------------------------------
  def command_introduction
    Sound.play_decision
    $scene = Scene_Introduction.new
  end
end
 
class Scene_Menu < Scene_Base
  #--------------------------------------------------------------------------
  # ● 生成命令窗口
  #--------------------------------------------------------------------------
  def create_command_window
    s1  = Vocab::item
    s2  = Vocab::skill
    s3  = Vocab::equip
    s4  = Vocab::status
    s5  = Vocab::save
    s6  = TITLE
    s7 = Vocab::game_end
    @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6, s7])
    @command_window.index = @menu_index
    if $game_party.members.size == 0          # 如果队伍为空
      @command_window.draw_item(0, false)     # 无效化物品选项
      @command_window.draw_item(1, false)     # 无效化技能选项
      @command_window.draw_item(2, false)     # 无效化装备选项
      @command_window.draw_item(3, false)     # 无效化状态选项
    end
    if $game_system.save_disabled             # 如果禁止存档
      @command_window.draw_item(4, false)     # 无效化存档选项
    end
  end
  #--------------------------------------------------------------------------
  # ● 更新命令窗口
  #--------------------------------------------------------------------------
  def update_command_selection
    if Input.trigger?(Input::B)
      Sound.play_cancel
      $scene = Scene_Map.new
    elsif Input.trigger?(Input::C)
      if $game_party.members.size == 0 and @command_window.index < 4
        Sound.play_buzzer
        return
      elsif $game_system.save_disabled and @command_window.index == 4
        Sound.play_buzzer
        return
      end
      Sound.play_decision
      case @command_window.index
      when 0        # 物品
        $scene = Scene_Item.new
      when 1, 2, 3  # 技能、装备、状态
        start_actor_selection
      when 4        # 存档
        $scene = Scene_File.new(true, false, false)
      when 5        # 介绍
        $scene = Scene_IntroductionMenu.new
      when 6        # 结束游戏
        $scene = Scene_End.new
      end
    end
  end
end