查看: 5002|回复: 14

[已经解决] 不知道怎么修改菜单。

[复制链接]
梦石
0
星屑
50
在线时间
11 小时
注册时间
2012-8-16
回帖
8
发表于 2013-2-8 17:10:17 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有账号?注册会员

×
想把菜单修改成特别简易的那种,不知道该怎么修改,放了一张图。

点评

岚少吧来的孩子吗wwwwwww  发表于 2013-2-8 20:57
梦石
0
星屑
618
在线时间
2656 小时
注册时间
2010-6-28
回帖
1227

开拓者

发表于 2013-2-11 01:01:19 | 显示全部楼层
等,我了了,你用的是ace是吧?原先我写的那份是vx用的,现在做了个ACE版的,不过因为水平问题目前还没弄出原来VX版的滑动效果,见谅见谅。
  1. =begin
  2. #############################################################################
  3. 单人简易滑动菜单(ACE) v1.0 by 我的米呀

  4. 说明:把本脚本插在Main上方即可。
  5. #############################################################################
  6. =end
  7. class Window_Base < Window
  8.   def draw_actor_simple_status(actor, x, y)
  9.     draw_actor_name(actor, x, y)
  10.     draw_actor_level(actor, x, y + line_height * 1)
  11.     draw_actor_icons(actor, x, y + line_height * 2)
  12.     draw_actor_class(actor, x + 120, y)
  13.     draw_actor_hp(actor, x + 80, y + line_height * 1)
  14.     draw_actor_mp(actor, x + 80, y + line_height * 2)
  15.   end
  16. end
  17. class Window_MenuCommand < Window_Command
  18.   def window_width
  19.     return 90
  20.   end
  21. end
  22. class Window_MenuStatus < Window_Selectable
  23.   def initialize(x, y)
  24.     super(x, y, 350, 120)
  25.     @pending_index = -1
  26.     refresh
  27.   end
  28.   def draw_item(index)
  29.     actor = $game_party.members[index]
  30.     enabled = $game_party.battle_members.include?(actor)
  31.     rect = item_rect(index)
  32.     draw_item_background(index)
  33.     draw_actor_face(actor, rect.x + 1, rect.y + 1, enabled)
  34.     draw_actor_simple_status(actor, rect.x + 108, rect.y + line_height / 2)
  35.   end
  36. end
  37. class Window_MenuCommand < Window_Command
  38.   def add_main_commands
  39.     add_command(Vocab::item,   :item,   main_commands_enabled)
  40.     add_command("读取",  :continue,  main_commands_enabled)
  41.   end
  42.   def add_save_command
  43.   end
  44.   def add_game_end_command
  45.   end
  46.   def add_formation_command
  47.   end
  48. end
  49. class Scene_Menu < Scene_MenuBase
  50.   def start
  51.     super
  52.     create_command_window
  53.     create_status_window
  54.   end
  55.   def create_command_window
  56.     @command_window = Window_MenuCommand.new
  57.     @command_window.set_handler(:item,      method(:command_item))
  58.     @command_window.set_handler(:continue,      method(:command_continue))
  59.     @command_window.set_handler(:cancel,    method(:return_scene))
  60.     @command_window.x = 50
  61.     @command_window.y = 300
  62.   end
  63.   def create_status_window
  64.     @status_window = Window_MenuStatus.new(@command_window.width, 0)
  65.     @status_window.x = 150
  66.     @status_window.y = 280
  67.   end
  68.   def command_continue
  69.     SceneManager.call(Scene_Load)
  70.   end
  71. end
复制代码

点评

吓尿了。。  发表于 2013-2-12 13:34

评分

参与人数 1星屑 +100 梦石 +1 收起 理由
怪蜀黍 + 100 + 1 认可答案

查看全部评分


                 无从有中来,有从无中生。
回复

使用道具 举报

梦石
0
星屑
663
在线时间
750 小时
注册时间
2012-11-10
回帖
903
发表于 2013-2-8 19:41:36 | 显示全部楼层

评分

参与人数 1星屑 +30 收起 理由
Luciffer + 30 我很赞同

查看全部评分

有本事就来阻止我啊,主体单元『天照』!
回复

使用道具 举报

梦石
0
星屑
618
在线时间
2656 小时
注册时间
2010-6-28
回帖
1227

开拓者

发表于 2013-2-8 22:53:57 | 显示全部楼层
本帖最后由 我的米呀 于 2013-2-11 01:02 编辑

简单写了一个,顺便加了个滑动效果。
  1. =begin
  2. #############################################################################
  3. 单人简易滑动菜单(VX) v1.0 by 我的米呀

  4. 说明:把本脚本插在Main上方即可。
  5. #############################################################################
  6. =end


  7. #==============================================================================
  8. # ■ Window_MenuStatus
  9. #------------------------------------------------------------------------------
  10. #  显示菜单画面和同伴状态的窗口。
  11. #==============================================================================

  12. class Window_MenuStatus < Window_Selectable
  13.   #--------------------------------------------------------------------------
  14.   # ● 初始化对像
  15.   #     x      : 窗口 X 座标
  16.   #     y      : 窗口 Y 座标
  17.   #--------------------------------------------------------------------------

  18.   def initialize(x, y)
  19.     super(x, y, 350, 120)
  20.     refresh
  21.     self.active = false
  22.     self.index = -1
  23.   end
  24.   #--------------------------------------------------------------------------
  25.   # ● 刷新
  26.   #--------------------------------------------------------------------------
  27.   def refresh
  28.     self.contents.clear
  29.     @item_max = $game_party.members.size
  30.     for actor in $game_party.members
  31.       draw_actor_face(actor, 2, actor.index * 96 + 2, 92)
  32.       x = 104
  33.       y = actor.index * 96 + WLH / 2
  34.       draw_actor_name(actor, x, y)
  35.       draw_actor_class(actor, x + 120, y)
  36.       draw_actor_level(actor, x, y + WLH * 1)
  37.       draw_actor_state(actor, x, y + WLH * 2)
  38.       draw_actor_hp(actor, x + 60, y + WLH * 1)
  39.       draw_actor_mp(actor, x + 60, y + WLH * 2)
  40.     end
  41.   end

  42. end
  43. #==============================================================================
  44. # ■ Scene_File
  45. #------------------------------------------------------------------------------
  46. #  存档画面及读档画面的类。
  47. #==============================================================================

  48. class Scene_File_1 < Scene_Base
  49.   #--------------------------------------------------------------------------
  50.   # ● 初始化对像
  51.   #     saving     : 存档标志(false则为读档)
  52.   #     from_title : 标志:是由标题画面的「继续游戏」调用的
  53.   #     from_event : 标志:是由事件「呼叫存档画面」命令调用的
  54.   #--------------------------------------------------------------------------
  55.   def initialize(saving, from_title, from_event)
  56.     @saving = saving
  57.     @from_title = from_title
  58.     @from_event = from_event
  59.   end
  60.   #--------------------------------------------------------------------------
  61.   # ● 开始处理
  62.   #--------------------------------------------------------------------------
  63.   def start
  64.     super
  65.     create_menu_background
  66.     @help_window = Window_Help.new
  67.     create_savefile_windows
  68.     if @saving
  69.       @index = $game_temp.last_file_index
  70.       @help_window.set_text(Vocab::SaveMessage)
  71.     else
  72.       @index = self.latest_file_index
  73.       @help_window.set_text(Vocab::LoadMessage)
  74.     end
  75.     @savefile_windows[@index].selected = true
  76.   end
  77.   #--------------------------------------------------------------------------
  78.   # ● 结束处理
  79.   #--------------------------------------------------------------------------
  80.   def terminate
  81.     super
  82.     dispose_menu_background
  83.     @help_window.dispose
  84.     dispose_item_windows
  85.   end
  86.   #--------------------------------------------------------------------------
  87.   # ● 回到原画面
  88.   #--------------------------------------------------------------------------
  89.   def return_scene
  90.       $scene = Scene_Menu.new(1)
  91.   end
  92.   #--------------------------------------------------------------------------
  93.   # ● 更新画面
  94.   #--------------------------------------------------------------------------
  95.   def update
  96.     super
  97.     update_menu_background
  98.     @help_window.update
  99.     update_savefile_windows
  100.     update_savefile_selection
  101.   end
  102.   #--------------------------------------------------------------------------
  103.   # ● 生成存档窗口
  104.   #--------------------------------------------------------------------------
  105.   def create_savefile_windows
  106.     @savefile_windows = []
  107.     for i in 0..3
  108.       @savefile_windows.push(Window_SaveFile.new(i, make_filename(i)))
  109.     end
  110.     @item_max = 4
  111.   end
  112.   #--------------------------------------------------------------------------
  113.   # ● 释放存档窗口
  114.   #--------------------------------------------------------------------------
  115.   def dispose_item_windows
  116.     for window in @savefile_windows
  117.       window.dispose
  118.     end
  119.   end
  120.   #--------------------------------------------------------------------------
  121.   # ● 更新存档窗口
  122.   #--------------------------------------------------------------------------
  123.   def update_savefile_windows
  124.     for window in @savefile_windows
  125.       window.update
  126.     end
  127.   end
  128.   #--------------------------------------------------------------------------
  129.   # ● 更新存档文件选择
  130.   #--------------------------------------------------------------------------
  131.   def update_savefile_selection
  132.     if Input.trigger?(Input::C)
  133.       determine_savefile
  134.     elsif Input.trigger?(Input::B)
  135.       Sound.play_cancel
  136.       return_scene
  137.     else
  138.       last_index = @index
  139.       if Input.repeat?(Input::DOWN)
  140.         cursor_down(Input.trigger?(Input::DOWN))
  141.       end
  142.       if Input.repeat?(Input::UP)
  143.         cursor_up(Input.trigger?(Input::UP))
  144.       end
  145.       if @index != last_index
  146.         Sound.play_cursor
  147.         @savefile_windows[last_index].selected = false
  148.         @savefile_windows[@index].selected = true
  149.       end
  150.     end
  151.   end
  152.   #--------------------------------------------------------------------------
  153.   # ● 确认存档文件
  154.   #--------------------------------------------------------------------------
  155.   def determine_savefile
  156.     if @saving
  157.       Sound.play_save
  158.       do_save
  159.     else
  160.       if @savefile_windows[@index].file_exist
  161.         Sound.play_load
  162.         do_load
  163.       else
  164.         Sound.play_buzzer
  165.         return
  166.       end
  167.     end
  168.     $game_temp.last_file_index = @index
  169.   end
  170.   #--------------------------------------------------------------------------
  171.   # ● 光标下移
  172.   #     wrap : 允许循环
  173.   #--------------------------------------------------------------------------
  174.   def cursor_down(wrap)
  175.     if @index < @item_max - 1 or wrap
  176.       @index = (@index + 1) % @item_max
  177.     end
  178.   end
  179.   #--------------------------------------------------------------------------
  180.   # ● 光标上移
  181.   #     wrap : 允许循环
  182.   #--------------------------------------------------------------------------
  183.   def cursor_up(wrap)
  184.     if @index > 0 or wrap
  185.       @index = (@index - 1 + @item_max) % @item_max
  186.     end
  187.   end
  188.   #--------------------------------------------------------------------------
  189.   # ● 生成文件名称
  190.   #     file_index : 存档位置(0~3)
  191.   #--------------------------------------------------------------------------
  192.   def make_filename(file_index)
  193.     return "Save#{file_index + 1}.rvdata"
  194.   end
  195.   #--------------------------------------------------------------------------
  196.   # ● 选择最近存档的文件
  197.   #--------------------------------------------------------------------------
  198.   def latest_file_index
  199.     index = 0
  200.     latest_time = Time.at(0)
  201.     for i in [email]0...@savefile_windows.size[/email]
  202.       if @savefile_windows[i].time_stamp > latest_time
  203.         latest_time = @savefile_windows[i].time_stamp
  204.         index = i
  205.       end
  206.     end
  207.     return index
  208.   end
  209.   #--------------------------------------------------------------------------
  210.   # ● 执行存档
  211.   #--------------------------------------------------------------------------
  212.   def do_save
  213.     file = File.open(@savefile_windows[@index].filename, "wb")
  214.     write_save_data(file)
  215.     file.close
  216.     return_scene
  217.   end
  218.   #--------------------------------------------------------------------------
  219.   # ● 执行读档
  220.   #--------------------------------------------------------------------------
  221.   def do_load
  222.     file = File.open(@savefile_windows[@index].filename, "rb")
  223.     read_save_data(file)
  224.     file.close
  225.     $scene = Scene_Map.new
  226.     RPG::BGM.fade(1500)
  227.     Graphics.fadeout(60)
  228.     Graphics.wait(40)
  229.     @last_bgm.play
  230.     @last_bgs.play
  231.   end
  232.   #--------------------------------------------------------------------------
  233.   # ● 写入存档数据
  234.   #     file : 写入存档对象(已开启)
  235.   #--------------------------------------------------------------------------
  236.   def write_save_data(file)
  237.     characters = []
  238.     for actor in $game_party.members
  239.       characters.push([actor.character_name, actor.character_index])
  240.     end
  241.     $game_system.save_count += 1
  242.     $game_system.version_id = $data_system.version_id
  243.     @last_bgm = RPG::BGM::last
  244.     @last_bgs = RPG::BGS::last
  245.     Marshal.dump(characters,           file)
  246.     Marshal.dump(Graphics.frame_count, file)
  247.     Marshal.dump(@last_bgm,            file)
  248.     Marshal.dump(@last_bgs,            file)
  249.     Marshal.dump($game_system,         file)
  250.     Marshal.dump($game_message,        file)
  251.     Marshal.dump($game_switches,       file)
  252.     Marshal.dump($game_variables,      file)
  253.     Marshal.dump($game_self_switches,  file)
  254.     Marshal.dump($game_actors,         file)
  255.     Marshal.dump($game_party,          file)
  256.     Marshal.dump($game_troop,          file)
  257.     Marshal.dump($game_map,            file)
  258.     Marshal.dump($game_player,         file)
  259.   end
  260.   #--------------------------------------------------------------------------
  261.   # ● 读出存档数据
  262.   #     file : 读出存档对象(已开启)
  263.   #--------------------------------------------------------------------------
  264.   def read_save_data(file)
  265.     characters           = Marshal.load(file)
  266.     Graphics.frame_count = Marshal.load(file)
  267.     @last_bgm            = Marshal.load(file)
  268.     @last_bgs            = Marshal.load(file)
  269.     $game_system         = Marshal.load(file)
  270.     $game_message        = Marshal.load(file)
  271.     $game_switches       = Marshal.load(file)
  272.     $game_variables      = Marshal.load(file)
  273.     $game_self_switches  = Marshal.load(file)
  274.     $game_actors         = Marshal.load(file)
  275.     $game_party          = Marshal.load(file)
  276.     $game_troop          = Marshal.load(file)
  277.     $game_map            = Marshal.load(file)
  278.     $game_player         = Marshal.load(file)
  279.     if $game_system.version_id != $data_system.version_id
  280.       $game_map.setup($game_map.map_id)
  281.       $game_player.center($game_player.x, $game_player.y)
  282.     end
  283.   end
  284. end

  285. #==============================================================================
  286. # ■ Scene_Menu
  287. #------------------------------------------------------------------------------
  288. #  处理菜单画面的类。
  289. #==============================================================================

  290. class Scene_Menu < Scene_Base
  291.   #--------------------------------------------------------------------------
  292.   # ● 初始化对像
  293.   #     menu_index : 命令窗口光标初始位置
  294.   #--------------------------------------------------------------------------
  295.   def initialize(menu_index = 0)
  296.     @menu_index = menu_index
  297.   end
  298.   #--------------------------------------------------------------------------
  299.   # ● 开始处理
  300.   #--------------------------------------------------------------------------
  301.   def start
  302.     super
  303.     create_menu_background
  304.     create_command_window
  305.     @status_window = Window_MenuStatus.new(160, 0)
  306.     @status_window.x = 650
  307.     @status_window.y = 280
  308.     @slide = false
  309.   end
  310.   #--------------------------------------------------------------------------
  311.   # ● 结束处理
  312.   #--------------------------------------------------------------------------
  313.   def terminate
  314.     super
  315.     dispose_menu_background
  316.     @command_window.dispose
  317.     @status_window.dispose
  318.   end
  319.   #--------------------------------------------------------------------------
  320.   # ● 更新画面
  321.   #--------------------------------------------------------------------------
  322.   def update
  323.     super
  324.     if @slide == false
  325.     @command_window.x += 50 unless @command_window.x == 50
  326.     @status_window.x -= 50 unless @status_window.x == 150
  327.   else
  328.     @command_window.x -= 50 unless @command_window.x == -550
  329.     @status_window.x += 50 unless @status_window.x == 650
  330.     end
  331.     update_menu_background
  332.     @command_window.update
  333.     @status_window.update
  334.     if @command_window.active
  335.       update_command_selection
  336.     elsif @status_window.active
  337.       update_actor_selection
  338.     end
  339.   end
  340.   #--------------------------------------------------------------------------
  341.   # ● 生成命令窗口
  342.   #--------------------------------------------------------------------------
  343.   def create_command_window
  344.     s1 = Vocab::item
  345.     s2 = "读取"
  346.     @command_window = Window_Command.new(90, [s1, s2])
  347.     @command_window.index = @menu_index
  348.     @command_window.x = -550
  349.     @command_window.y = 300
  350.     if $game_party.members.size == 0          # 如果队伍为空
  351.       @command_window.draw_item(0, false)     # 无效化物品选项
  352.       @command_window.draw_item(1, false)     # 无效化技能选项
  353.     end
  354.   end
  355.   #--------------------------------------------------------------------------
  356.   # ● 更新命令窗口
  357.   #--------------------------------------------------------------------------
  358.   def update_command_selection
  359.     $scene = Scene_Map.new if @command_window.x <= -550 and @slide == true
  360.     if Input.trigger?(Input::B)
  361.       @slide = true
  362.       Sound.play_cancel
  363.     elsif Input.trigger?(Input::C)
  364.       @slide = true
  365.       if $game_party.members.size == 0 and @command_window.index < 4
  366.         Sound.play_buzzer
  367.         return
  368.       elsif $game_system.save_disabled and @command_window.index == 4
  369.         Sound.play_buzzer
  370.         return
  371.       end
  372.       Sound.play_decision
  373.       case @command_window.index
  374.       when 0      # 物品
  375.         $scene = Scene_Item.new
  376.       when 1      # 读档
  377.         $scene = Scene_File_1.new(false, true, false)
  378.       end
  379.     end
  380.   end
  381. end
复制代码

效果就是这图
1.PNG

点评

大神好~向大触致敬~  发表于 2013-2-12 13:34
状态栏没变- -......  发表于 2013-2-9 18:15
流逼~  发表于 2013-2-9 12:32
大神..  发表于 2013-2-8 23:37

                 无从有中来,有从无中生。
回复

使用道具 举报

梦石
0
星屑
50
在线时间
11 小时
注册时间
2012-8-16
回帖
8
 楼主| 发表于 2013-2-9 07:13:13 | 显示全部楼层
本帖最后由 向日葵丶 于 2013-2-9 07:18 编辑
我的米呀 发表于 2013-2-8 22:53
简单写了一个,顺便加了个滑动效果。
=begin
########################################################## ...


谢谢,但是总说有错误是什么情况?

点评

你是不是有用别的脚本?  发表于 2013-2-9 10:22
回复

使用道具 举报

梦石
0
星屑
50
在线时间
11 小时
注册时间
2012-8-16
回帖
8
 楼主| 发表于 2013-2-9 12:45:45 | 显示全部楼层
向日葵丶 发表于 2013-2-9 07:13
谢谢,但是总说有错误是什么情况?

没有,就是按照你说的把这个脚本放到main的前面。
回复

使用道具 举报

梦石
0
星屑
50
在线时间
11 小时
注册时间
2012-8-16
回帖
8
 楼主| 发表于 2013-2-9 12:57:21 | 显示全部楼层
我的米呀 发表于 2013-2-8 22:53
简单写了一个,顺便加了个滑动效果。
=begin
########################################################## ...

我没有使用其他的脚本。
回复

使用道具 举报

梦石
0
星屑
100
在线时间
211 小时
注册时间
2011-8-16
回帖
246
发表于 2013-2-9 18:15:36 | 显示全部楼层
向日葵丶 发表于 2013-2-9 12:57
我没有使用其他的脚本。

出的错误截图上来。
RPGMaker 脚本/学习交流群:143356012
回复

使用道具 举报

梦石
0
星屑
50
在线时间
11 小时
注册时间
2012-8-16
回帖
8
 楼主| 发表于 2013-2-9 18:29:28 | 显示全部楼层
774741359 发表于 2013-2-9 18:15
出的错误截图上来。

就是进入之后选择读档的时候就出现错误提示窗口。
回复

使用道具 举报

梦石
0
星屑
100
在线时间
211 小时
注册时间
2011-8-16
回帖
246
发表于 2013-2-9 20:50:09 | 显示全部楼层
向日葵丶 发表于 2013-2-9 18:29
就是进入之后选择读档的时候就出现错误提示窗口。

就要你提示框上的内容
RPGMaker 脚本/学习交流群:143356012
回复

使用道具 举报

梦石
0
星屑
618
在线时间
2656 小时
注册时间
2010-6-28
回帖
1227

开拓者

发表于 2013-2-10 01:27:28 | 显示全部楼层
不介意的话把data文件夹打包下上传附件吧,这样看起问题来方便点。

                 无从有中来,有从无中生。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部