| 
 
| 赞 | 0 |  
| VIP | 35 |  
| 好人卡 | 0 |  
| 积分 | 1 |  
| 经验 | 96121 |  
| 最后登录 | 2020-2-15 |  
| 在线时间 | 22 小时 |  
 Lv1.梦旅人 
	梦石0 星屑55 在线时间22 小时注册时间2006-4-22帖子370 | 
| 
这个菜单是我看到了亿万星辰的签名后试着做的,当时它让我想起多年以前打过的金庸群侠传,于是我就尝试看自己能不能做一个类似的....我脚本不是很好,所以可能写的不够简洁,而且这个菜单还比不上默认的华丽,就是一个彻头彻尾的文字版 =_=~~这个东西我想应该有bug,如果发现了请不吝指出~~谢谢~~(里面的"遣散"功能需10号开关打开时才能用)
x
加入我们,或者,欢迎回来。您需要 登录 才可以下载或查看,没有帐号?注册会员  截图:
 ![]() 
 范例:http://rpg.blue/upload_program/files/文字主菜单.rar
 
 里面的主要脚本是这个,不过直接放到游戏去会出错,还要在其他脚本做一些简单调整,具体看范例..
 
 复制代码#==============================================================================
# ■ Scene_Menu
#------------------------------------------------------------------------------
#  处理菜单画面的类。
#==============================================================================
class Scene_Menu
  #--------------------------------------------------------------------------
  # ● 初始化对像
  #     menu_index : 命令光标的初期位置
  #--------------------------------------------------------------------------
  def initialize(menu_index = 0)
    @menu_index = menu_index
  end
  #--------------------------------------------------------------------------
  # ● 主处理
  #--------------------------------------------------------------------------
  def main
  ######################################################################
     @switches = 10 #控制是否启用队伍遣散的开关
  ######################################################################
    
    # 生成命令窗口
    s1 = $data_system.words.item
    s2 = $data_system.words.skill
    s3 = $data_system.words.equip
    s4 = "状态"
    s5 = "遣散"
    s6 = "系统"
    @command_window = Window_Command.new(80, [s1, s2, s3, s4, s5,s6])
    @command_window.index = @menu_index
    @command_window.opacity = 150
    @command_window.y =30
    @command_window.x =30 
    #窗口在角色位置附近
    #@command_window.x = $game_player.screen_x - 90
    #@command_window.y = $game_player.screen_y - 200
    #生成地图背景,透明窗口用
    @spriteset = Spriteset_Map.new
    # 同伴人数为 0 的情况下
    if $game_party.actors.size == 0
      # 物品、特技、装备、状态无效化
      @command_window.disable_item(0)
      @command_window.disable_item(1)
      @command_window.disable_item(2)
      @command_window.disable_item(3)
    end
    
    # 执行过渡
    Graphics.transition
    # 主循环
    loop do
      # 刷新游戏画面
      Graphics.update
      # 刷新输入信息
      Input.update
      # 刷新画面
      update
      # 如果切换画面就中断循环
      if $scene != self
        break
      end
    end
    # 准备过渡
    Graphics.freeze
    # 释放窗口
    @command_window.dispose
    
  end
  #--------------------------------------------------------------------------
  # ● 刷新画面
  #--------------------------------------------------------------------------
  def update
    # 刷新窗口
    @command_window.update
    
    # 命令窗口被激活的情况下: 调用 update_command
    if @command_window.active
      update_command
      return
    end
  end
  #--------------------------------------------------------------------------
  # ● 刷新画面 (命令窗口被激活的情况下)
  #--------------------------------------------------------------------------
  def update_command
    #定义储存角色名字的数组,用以制作动态选择框
    @a_name = []
       for i in 0...$game_party.actors.size
       actor = $game_party.actors[i]
       @a_name.push(actor.name)
     end  
     
    # 按下 B 键的情况下
    if Input.trigger?(Input::B)
      # 演奏取消 SE
      $game_system.se_play($data_system.cancel_se)
      # 切换的地图画面
      $scene = Scene_Map.new
      
      return
    end
    # 按下 C 键的情况下
    if Input.trigger?(Input::C)
      # 同伴人数为 0、存档、游戏结束以外的场合
      if $game_party.actors.size == 0 and @command_window.index < 4
        # 演奏冻结 SE
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      # 命令窗口的光标位置分支
      case @command_window.index
      when 0  # 物品
        # 演奏确定 SE
        $game_system.se_play($data_system.decision_se)
        # 切换到物品画面
        $scene = Scene_Item.new
      when 1  # 特技
        # 演奏确定 SE
        $game_system.se_play($data_system.decision_se)
        @command_actor = Window_Command.new(160,@a_name)#生成角色选择窗口
        @command_actor.opacity = 150
        @command_actor.x = 110
        @command_actor.y = 45
        # 激活角色选择窗口窗口
        @command_window.active = false
        @command_actor.active = true
       #角色名字窗口被激活时
        if@command_actor.active
         update_command_actor
         return
        end 
      when 2  # 装备
        # 演奏确定 SE
        $game_system.se_play($data_system.decision_se)
        @command_actor = Window_Command.new(160,@a_name)#生成角色选择窗口
        @command_actor.opacity = 150
        @command_actor.x =110
        @command_actor.y = 77
         # 激活角色选择窗口窗口
        @command_window.active = false
        @command_actor.active = true
        #角色名字窗口被激活时
       if  @command_actor.active
         update_command_actor
        return
       end 
      when 3  # 状态
        # 演奏确定 SE
        $game_system.se_play($data_system.decision_se)
         @command_actor = Window_Command.new(160,@a_name)#生成角色选择窗口
         @command_actor.opacity = 150
         @command_actor.x = 110
         @command_actor.y = 109
        # 激活角色选择窗口窗口
         @command_window.active = false
         @command_actor.active = true
        #角色名字窗口被激活时
        if@command_actor.active
         update_command_actor
         return
        end 
      when 4 #遣散
        # 开关关闭时和队伍人数小于1时的情况下
        if  $game_switches[@switches] == false 
          # 演奏冻结 SE
          $game_system.se_play($data_system.buzzer_se)
          return
        end
       @l_name = []
       for i in 1...$game_party.actors.size
       actor = $game_party.actors[i]
       @l_name.push(actor.name)
       end  
       if @l_name == [] #如果只有1号角色时
         # 演奏冻结 SE
          $game_system.se_play($data_system.buzzer_se)
        else
          # 演奏确定 SE
         $game_system.se_play($data_system.decision_se)
         @command_actor = Window_Command.new(160,@l_name)#生成角色选择窗口
         @command_actor.opacity = 150
         @command_actor.x = 110
         @command_actor.y = 141
         #激活遣散角色窗口
         @command_window.active = false
         @command_actor.active = true
        if@command_actor.active
         update_command_actor
         return
        end 
       end 
        
      when 5  # 系统
        # 演奏确定 SE
        $game_system.se_play($data_system.decision_se)
        @command_actor = Window_Command.new(160,["存档","读档","退出"])#生成系统窗口
        @command_actor.opacity = 150
        @command_actor.x = 110
        @command_actor.y = 173
         #激活遣散角色窗口
         @command_window.active = false
         @command_actor.active = true
        if @command_actor.active
         update_command_actor
         return
        end 
      end
      return
    end
  end 
####################################################################
#●第二级窗口循环
####################################################################
  def update_command_actor
    # 执行过渡
    Graphics.transition
    loop do
      # 刷新游戏画面
      Graphics.update
      # 刷新输入信息
      Input.update
      # 刷新画面
      a_update
      # 如果切换画面就中断循环
      if $scene != self
        break
      end
    end
    # 准备过渡
    Graphics.freeze
    # 释放窗口
     @command_actor.dispose 
  end
#############################################################################
#●第二级窗口刷新
#############################################################################
 def a_update
   #刷新 
   @command_actor.update
  # 按下 B 键的情况下
    if Input.trigger?(Input::B)
      # 演奏取消 SE
      $game_system.se_play($data_system.cancel_se)
      case @command_window.index
       when 1 #特技
          $scene = Scene_Menu.new(1)#切到文字菜单窗口的第2行(特技窗口)
       when 2 #装备   
         $scene = Scene_Menu.new(2)#切到文字菜单窗口的第3行(装备窗口)
       when 3 #状态
         $scene = Scene_Menu.new(3)# 切换到状态框
       when 4 #遣散
         $scene = Scene_Menu.new(4)# 切换到遣散那行
       when 5 #系统
        $scene = Scene_Menu.new(5)#切换到系统那行
      end 
    end
    # 按下 C 键的情况下
    if Input.trigger?(Input::C)
       # 同伴人数为 0的场合
       if $game_party.actors.size == 0 
         # 演奏冻结 SE
         $game_system.se_play($data_system.buzzer_se)
         return
       end
         #状态窗口被激活的情况下: 调用 update_status
          if @status = true
            update_status
           return
          end
           # 演奏确定 SE
           $game_system.se_play($data_system.decision_se)
           @command_actor.active = false
           @status = true
           
      return
    end 
  end  
  #--------------------------------------------------------------------------
  # ● 刷新画面 (状态窗口被激活的情况下)
  #--------------------------------------------------------------------------
  def update_status
    # 按下 B 键的情况下
    if Input.trigger?(Input::B)
      # 演奏取消 SE
      $game_system.se_play($data_system.cancel_se)
      # 激活命令窗口
      @command_window.active = true
      @command_actor.active = false
     return
    end
    # 按下 C 键的情况下
    if Input.trigger?(Input::C)
      # 命令窗口的光标位置分支
      case @command_window.index
      when 1  # 特技
        # 本角色的行动限制在 2 以上的情况下
        if $game_party.actors[@command_actor.index].restriction >= 2
          # 演奏冻结 SE
          $game_system.se_play($data_system.buzzer_se)
          return
        end
        # 演奏确定 SE
        $game_system.se_play($data_system.decision_se)
        # 切换到特技画面
        $scene = Scene_Skill.new(@command_actor.index)
      when 2  # 装备
        # 演奏确定 SE
        $game_system.se_play($data_system.decision_se)
        # 切换的装备画面
        $scene = Scene_Equip.new(@command_actor.index)
      when 3  # 状态
        # 演奏确定 SE
        $game_system.se_play($data_system.decision_se)
        # 切换到状态画面
        $scene = Scene_Status.new(@command_actor.index)
      when 4 #遣散
        # 演奏确定 SE
        $game_system.se_play($data_system.decision_se)
        b =  @command_actor.index + 1
        #获取选框中角色的id
        n = $game_party.actors[b].id 
        $game_party.remove_actor(n)
        Audio.se_play("Audio/SE/013-Move01", 100, 100)#播放走的声效
        $scene = Scene_Menu.new(4)
      when 5 #系统
         case @command_actor.index
         when 0 #存档
      # 禁止存档的情况下
        if $game_system.save_disabled
          # 演奏冻结 SE
          $game_system.se_play($data_system.buzzer_se)
          return
         end
        # 演奏确定 SE
         $game_system.se_play($data_system.decision_se)
        # 切换到存档画面
        $scene = Scene_Save.new
        
        when 1 #读档
         # 演奏确定 SE
         $game_system.se_play($data_system.decision_se)
         # 切换到存档画面
         $scene = Scene_Load2.new
        when 2 #退出
         # 演奏确定 SE
         $game_system.se_play($data_system.decision_se)
         # 切换到游戏结束画面
         $scene = Scene_End.new
       end
      end
      return
    end 
  end
end
 | 
 |