设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 4425|回复: 14
打印 上一主题 下一主题

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

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
11 小时
注册时间
2012-8-16
帖子
9
跳转到指定楼层
1
 楼主| 发表于 2013-2-8 17:10:17 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

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

点评

岚少吧来的孩子吗wwwwwww  发表于 2013-2-8 20:57

Lv2.观梦者

梦石
0
星屑
628
在线时间
2656 小时
注册时间
2010-6-28
帖子
1361

开拓者

来自 2楼
发表于 2013-2-11 01:01:19 | 只看该作者
等,我了了,你用的是ace是吧?原先我写的那份是vx用的,现在做了个ACE版的,不过因为水平问题目前还没弄出原来VX版的滑动效果,见谅见谅。
RUBY 代码复制
  1. =begin
  2. #############################################################################
  3.  单人简易滑动菜单(ACE) v1.0 by 我的米呀
  4.  
  5.  说明:把本脚本插在Main上方即可。
  6. #############################################################################
  7. =end
  8. class Window_Base < Window
  9.   def draw_actor_simple_status(actor, x, y)
  10.     draw_actor_name(actor, x, y)
  11.     draw_actor_level(actor, x, y + line_height * 1)
  12.     draw_actor_icons(actor, x, y + line_height * 2)
  13.     draw_actor_class(actor, x + 120, y)
  14.     draw_actor_hp(actor, x + 80, y + line_height * 1)
  15.     draw_actor_mp(actor, x + 80, y + line_height * 2)
  16.   end
  17. end
  18. class Window_MenuCommand < Window_Command
  19.   def window_width
  20.     return 90
  21.   end
  22. end
  23. class Window_MenuStatus < Window_Selectable
  24.   def initialize(x, y)
  25.     super(x, y, 350, 120)
  26.     @pending_index = -1
  27.     refresh
  28.   end
  29.   def draw_item(index)
  30.     actor = $game_party.members[index]
  31.     enabled = $game_party.battle_members.include?(actor)
  32.     rect = item_rect(index)
  33.     draw_item_background(index)
  34.     draw_actor_face(actor, rect.x + 1, rect.y + 1, enabled)
  35.     draw_actor_simple_status(actor, rect.x + 108, rect.y + line_height / 2)
  36.   end
  37. end
  38. class Window_MenuCommand < Window_Command
  39.   def add_main_commands
  40.     add_command(Vocab::item,   :item,   main_commands_enabled)
  41.     add_command("读取",  :continue,  main_commands_enabled)
  42.   end
  43.   def add_save_command
  44.   end
  45.   def add_game_end_command
  46.   end
  47.   def add_formation_command
  48.   end
  49. end
  50. class Scene_Menu < Scene_MenuBase
  51.   def start
  52.     super
  53.     create_command_window
  54.     create_status_window
  55.   end
  56.   def create_command_window
  57.     @command_window = Window_MenuCommand.new
  58.     @command_window.set_handler(:item,      method(:command_item))
  59.     @command_window.set_handler(:continue,      method(:command_continue))
  60.     @command_window.set_handler(:cancel,    method(:return_scene))
  61.     @command_window.x = 50
  62.     @command_window.y = 300
  63.   end
  64.   def create_status_window
  65.     @status_window = Window_MenuStatus.new(@command_window.width, 0)
  66.     @status_window.x = 150
  67.     @status_window.y = 280
  68.   end
  69.   def command_continue
  70.     SceneManager.call(Scene_Load)
  71.   end
  72. end

点评

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

评分

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

查看全部评分


                 无从有中来,有从无中生。
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
478
在线时间
750 小时
注册时间
2012-11-10
帖子
924
3
发表于 2013-2-8 19:41:36 | 只看该作者

评分

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

查看全部评分

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

使用道具 举报

Lv2.观梦者

梦石
0
星屑
628
在线时间
2656 小时
注册时间
2010-6-28
帖子
1361

开拓者

4
发表于 2013-2-8 22:53:57 | 只看该作者
本帖最后由 我的米呀 于 2013-2-11 01:02 编辑

简单写了一个,顺便加了个滑动效果。
RUBY 代码复制
  1. =begin
  2. #############################################################################
  3.  单人简易滑动菜单(VX) v1.0 by 我的米呀
  4.  
  5.  说明:把本脚本插在Main上方即可。
  6. #############################################################################
  7. =end
  8.  
  9.  
  10. #==============================================================================
  11. # ■ Window_MenuStatus
  12. #------------------------------------------------------------------------------
  13. #  显示菜单画面和同伴状态的窗口。
  14. #==============================================================================
  15.  
  16. class Window_MenuStatus < Window_Selectable
  17.   #--------------------------------------------------------------------------
  18.   # ● 初始化对像
  19.   #     x      : 窗口 X 座标
  20.   #     y      : 窗口 Y 座标
  21.   #--------------------------------------------------------------------------
  22.  
  23.   def initialize(x, y)
  24.     super(x, y, 350, 120)
  25.     refresh
  26.     self.active = false
  27.     self.index = -1
  28.   end
  29.   #--------------------------------------------------------------------------
  30.   # ● 刷新
  31.   #--------------------------------------------------------------------------
  32.   def refresh
  33.     self.contents.clear
  34.     @item_max = $game_party.members.size
  35.     for actor in $game_party.members
  36.       draw_actor_face(actor, 2, actor.index * 96 + 2, 92)
  37.       x = 104
  38.       y = actor.index * 96 + WLH / 2
  39.       draw_actor_name(actor, x, y)
  40.       draw_actor_class(actor, x + 120, y)
  41.       draw_actor_level(actor, x, y + WLH * 1)
  42.       draw_actor_state(actor, x, y + WLH * 2)
  43.       draw_actor_hp(actor, x + 60, y + WLH * 1)
  44.       draw_actor_mp(actor, x + 60, y + WLH * 2)
  45.     end
  46.   end
  47.  
  48. end
  49. #==============================================================================
  50. # ■ Scene_File
  51. #------------------------------------------------------------------------------
  52. #  存档画面及读档画面的类。
  53. #==============================================================================
  54.  
  55. class Scene_File_1 < Scene_Base
  56.   #--------------------------------------------------------------------------
  57.   # ● 初始化对像
  58.   #     saving     : 存档标志(false则为读档)
  59.   #     from_title : 标志:是由标题画面的「继续游戏」调用的
  60.   #     from_event : 标志:是由事件「呼叫存档画面」命令调用的
  61.   #--------------------------------------------------------------------------
  62.   def initialize(saving, from_title, from_event)
  63.     @saving = saving
  64.     @from_title = from_title
  65.     @from_event = from_event
  66.   end
  67.   #--------------------------------------------------------------------------
  68.   # ● 开始处理
  69.   #--------------------------------------------------------------------------
  70.   def start
  71.     super
  72.     create_menu_background
  73.     @help_window = Window_Help.new
  74.     create_savefile_windows
  75.     if @saving
  76.       @index = $game_temp.last_file_index
  77.       @help_window.set_text(Vocab::SaveMessage)
  78.     else
  79.       @index = self.latest_file_index
  80.       @help_window.set_text(Vocab::LoadMessage)
  81.     end
  82.     @savefile_windows[@index].selected = true
  83.   end
  84.   #--------------------------------------------------------------------------
  85.   # ● 结束处理
  86.   #--------------------------------------------------------------------------
  87.   def terminate
  88.     super
  89.     dispose_menu_background
  90.     @help_window.dispose
  91.     dispose_item_windows
  92.   end
  93.   #--------------------------------------------------------------------------
  94.   # ● 回到原画面
  95.   #--------------------------------------------------------------------------
  96.   def return_scene
  97.       $scene = Scene_Menu.new(1)
  98.   end
  99.   #--------------------------------------------------------------------------
  100.   # ● 更新画面
  101.   #--------------------------------------------------------------------------
  102.   def update
  103.     super
  104.     update_menu_background
  105.     @help_window.update
  106.     update_savefile_windows
  107.     update_savefile_selection
  108.   end
  109.   #--------------------------------------------------------------------------
  110.   # ● 生成存档窗口
  111.   #--------------------------------------------------------------------------
  112.   def create_savefile_windows
  113.     @savefile_windows = []
  114.     for i in 0..3
  115.       @savefile_windows.push(Window_SaveFile.new(i, make_filename(i)))
  116.     end
  117.     @item_max = 4
  118.   end
  119.   #--------------------------------------------------------------------------
  120.   # ● 释放存档窗口
  121.   #--------------------------------------------------------------------------
  122.   def dispose_item_windows
  123.     for window in @savefile_windows
  124.       window.dispose
  125.     end
  126.   end
  127.   #--------------------------------------------------------------------------
  128.   # ● 更新存档窗口
  129.   #--------------------------------------------------------------------------
  130.   def update_savefile_windows
  131.     for window in @savefile_windows
  132.       window.update
  133.     end
  134.   end
  135.   #--------------------------------------------------------------------------
  136.   # ● 更新存档文件选择
  137.   #--------------------------------------------------------------------------
  138.   def update_savefile_selection
  139.     if Input.trigger?(Input::C)
  140.       determine_savefile
  141.     elsif Input.trigger?(Input::B)
  142.       Sound.play_cancel
  143.       return_scene
  144.     else
  145.       last_index = @index
  146.       if Input.repeat?(Input::DOWN)
  147.         cursor_down(Input.trigger?(Input::DOWN))
  148.       end
  149.       if Input.repeat?(Input::UP)
  150.         cursor_up(Input.trigger?(Input::UP))
  151.       end
  152.       if @index != last_index
  153.         Sound.play_cursor
  154.         @savefile_windows[last_index].selected = false
  155.         @savefile_windows[@index].selected = true
  156.       end
  157.     end
  158.   end
  159.   #--------------------------------------------------------------------------
  160.   # ● 确认存档文件
  161.   #--------------------------------------------------------------------------
  162.   def determine_savefile
  163.     if @saving
  164.       Sound.play_save
  165.       do_save
  166.     else
  167.       if @savefile_windows[@index].file_exist
  168.         Sound.play_load
  169.         do_load
  170.       else
  171.         Sound.play_buzzer
  172.         return
  173.       end
  174.     end
  175.     $game_temp.last_file_index = @index
  176.   end
  177.   #--------------------------------------------------------------------------
  178.   # ● 光标下移
  179.   #     wrap : 允许循环
  180.   #--------------------------------------------------------------------------
  181.   def cursor_down(wrap)
  182.     if @index < @item_max - 1 or wrap
  183.       @index = (@index + 1) % @item_max
  184.     end
  185.   end
  186.   #--------------------------------------------------------------------------
  187.   # ● 光标上移
  188.   #     wrap : 允许循环
  189.   #--------------------------------------------------------------------------
  190.   def cursor_up(wrap)
  191.     if @index > 0 or wrap
  192.       @index = (@index - 1 + @item_max) % @item_max
  193.     end
  194.   end
  195.   #--------------------------------------------------------------------------
  196.   # ● 生成文件名称
  197.   #     file_index : 存档位置(0~3)
  198.   #--------------------------------------------------------------------------
  199.   def make_filename(file_index)
  200.     return "Save#{file_index + 1}.rvdata"
  201.   end
  202.   #--------------------------------------------------------------------------
  203.   # ● 选择最近存档的文件
  204.   #--------------------------------------------------------------------------
  205.   def latest_file_index
  206.     index = 0
  207.     latest_time = Time.at(0)
  208.     for i in [email]0...@savefile_windows.size[/email]
  209.       if @savefile_windows[i].time_stamp > latest_time
  210.         latest_time = @savefile_windows[i].time_stamp
  211.         index = i
  212.       end
  213.     end
  214.     return index
  215.   end
  216.   #--------------------------------------------------------------------------
  217.   # ● 执行存档
  218.   #--------------------------------------------------------------------------
  219.   def do_save
  220.     file = File.open(@savefile_windows[@index].filename, "wb")
  221.     write_save_data(file)
  222.     file.close
  223.     return_scene
  224.   end
  225.   #--------------------------------------------------------------------------
  226.   # ● 执行读档
  227.   #--------------------------------------------------------------------------
  228.   def do_load
  229.     file = File.open(@savefile_windows[@index].filename, "rb")
  230.     read_save_data(file)
  231.     file.close
  232.     $scene = Scene_Map.new
  233.     RPG::BGM.fade(1500)
  234.     Graphics.fadeout(60)
  235.     Graphics.wait(40)
  236.     @last_bgm.play
  237.     @last_bgs.play
  238.   end
  239.   #--------------------------------------------------------------------------
  240.   # ● 写入存档数据
  241.   #     file : 写入存档对象(已开启)
  242.   #--------------------------------------------------------------------------
  243.   def write_save_data(file)
  244.     characters = []
  245.     for actor in $game_party.members
  246.       characters.push([actor.character_name, actor.character_index])
  247.     end
  248.     $game_system.save_count += 1
  249.     $game_system.version_id = $data_system.version_id
  250.     @last_bgm = RPG::BGM::last
  251.     @last_bgs = RPG::BGS::last
  252.     Marshal.dump(characters,           file)
  253.     Marshal.dump(Graphics.frame_count, file)
  254.     Marshal.dump(@last_bgm,            file)
  255.     Marshal.dump(@last_bgs,            file)
  256.     Marshal.dump($game_system,         file)
  257.     Marshal.dump($game_message,        file)
  258.     Marshal.dump($game_switches,       file)
  259.     Marshal.dump($game_variables,      file)
  260.     Marshal.dump($game_self_switches,  file)
  261.     Marshal.dump($game_actors,         file)
  262.     Marshal.dump($game_party,          file)
  263.     Marshal.dump($game_troop,          file)
  264.     Marshal.dump($game_map,            file)
  265.     Marshal.dump($game_player,         file)
  266.   end
  267.   #--------------------------------------------------------------------------
  268.   # ● 读出存档数据
  269.   #     file : 读出存档对象(已开启)
  270.   #--------------------------------------------------------------------------
  271.   def read_save_data(file)
  272.     characters           = Marshal.load(file)
  273.     Graphics.frame_count = Marshal.load(file)
  274.     @last_bgm            = Marshal.load(file)
  275.     @last_bgs            = Marshal.load(file)
  276.     $game_system         = Marshal.load(file)
  277.     $game_message        = Marshal.load(file)
  278.     $game_switches       = Marshal.load(file)
  279.     $game_variables      = Marshal.load(file)
  280.     $game_self_switches  = Marshal.load(file)
  281.     $game_actors         = Marshal.load(file)
  282.     $game_party          = Marshal.load(file)
  283.     $game_troop          = Marshal.load(file)
  284.     $game_map            = Marshal.load(file)
  285.     $game_player         = Marshal.load(file)
  286.     if $game_system.version_id != $data_system.version_id
  287.       $game_map.setup($game_map.map_id)
  288.       $game_player.center($game_player.x, $game_player.y)
  289.     end
  290.   end
  291. end
  292.  
  293. #==============================================================================
  294. # ■ Scene_Menu
  295. #------------------------------------------------------------------------------
  296. #  处理菜单画面的类。
  297. #==============================================================================
  298.  
  299. class Scene_Menu < Scene_Base
  300.   #--------------------------------------------------------------------------
  301.   # ● 初始化对像
  302.   #     menu_index : 命令窗口光标初始位置
  303.   #--------------------------------------------------------------------------
  304.   def initialize(menu_index = 0)
  305.     @menu_index = menu_index
  306.   end
  307.   #--------------------------------------------------------------------------
  308.   # ● 开始处理
  309.   #--------------------------------------------------------------------------
  310.   def start
  311.     super
  312.     create_menu_background
  313.     create_command_window
  314.     @status_window = Window_MenuStatus.new(160, 0)
  315.     @status_window.x = 650
  316.     @status_window.y = 280
  317.     @slide = false
  318.   end
  319.   #--------------------------------------------------------------------------
  320.   # ● 结束处理
  321.   #--------------------------------------------------------------------------
  322.   def terminate
  323.     super
  324.     dispose_menu_background
  325.     @command_window.dispose
  326.     @status_window.dispose
  327.   end
  328.   #--------------------------------------------------------------------------
  329.   # ● 更新画面
  330.   #--------------------------------------------------------------------------
  331.   def update
  332.     super
  333.     if @slide == false
  334.     @command_window.x += 50 unless @command_window.x == 50
  335.     @status_window.x -= 50 unless @status_window.x == 150
  336.   else
  337.     @command_window.x -= 50 unless @command_window.x == -550
  338.     @status_window.x += 50 unless @status_window.x == 650
  339.     end
  340.     update_menu_background
  341.     @command_window.update
  342.     @status_window.update
  343.     if @command_window.active
  344.       update_command_selection
  345.     elsif @status_window.active
  346.       update_actor_selection
  347.     end
  348.   end
  349.   #--------------------------------------------------------------------------
  350.   # ● 生成命令窗口
  351.   #--------------------------------------------------------------------------
  352.   def create_command_window
  353.     s1 = Vocab::item
  354.     s2 = "读取"
  355.     @command_window = Window_Command.new(90, [s1, s2])
  356.     @command_window.index = @menu_index
  357.     @command_window.x = -550
  358.     @command_window.y = 300
  359.     if $game_party.members.size == 0          # 如果队伍为空
  360.       @command_window.draw_item(0, false)     # 无效化物品选项
  361.       @command_window.draw_item(1, false)     # 无效化技能选项
  362.     end
  363.   end
  364.   #--------------------------------------------------------------------------
  365.   # ● 更新命令窗口
  366.   #--------------------------------------------------------------------------
  367.   def update_command_selection
  368.     $scene = Scene_Map.new if @command_window.x <= -550 and @slide == true
  369.     if Input.trigger?(Input::B)
  370.       @slide = true
  371.       Sound.play_cancel
  372.     elsif Input.trigger?(Input::C)
  373.       @slide = true
  374.       if $game_party.members.size == 0 and @command_window.index < 4
  375.         Sound.play_buzzer
  376.         return
  377.       elsif $game_system.save_disabled and @command_window.index == 4
  378.         Sound.play_buzzer
  379.         return
  380.       end
  381.       Sound.play_decision
  382.       case @command_window.index
  383.       when 0      # 物品
  384.         $scene = Scene_Item.new
  385.       when 1      # 读档
  386.         $scene = Scene_File_1.new(false, true, false)
  387.       end
  388.     end
  389.   end
  390. end

效果就是这图

点评

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

                 无从有中来,有从无中生。
回复 支持 反对

使用道具 举报

Lv1.梦旅人

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


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

点评

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

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
11 小时
注册时间
2012-8-16
帖子
9
6
 楼主| 发表于 2013-2-9 12:45:45 | 只看该作者
向日葵丶 发表于 2013-2-9 07:13
谢谢,但是总说有错误是什么情况?

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

使用道具 举报

Lv1.梦旅人

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

我没有使用其他的脚本。
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
100
在线时间
211 小时
注册时间
2011-8-16
帖子
300
8
发表于 2013-2-9 18:15:36 | 只看该作者
向日葵丶 发表于 2013-2-9 12:57
我没有使用其他的脚本。

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

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
11 小时
注册时间
2012-8-16
帖子
9
9
 楼主| 发表于 2013-2-9 18:29:28 | 只看该作者
774741359 发表于 2013-2-9 18:15
出的错误截图上来。

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

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
100
在线时间
211 小时
注册时间
2011-8-16
帖子
300
10
发表于 2013-2-9 20:50:09 | 只看该作者
向日葵丶 发表于 2013-2-9 18:29
就是进入之后选择读档的时候就出现错误提示窗口。

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

使用道具 举报

Lv2.观梦者

梦石
0
星屑
628
在线时间
2656 小时
注册时间
2010-6-28
帖子
1361

开拓者

11
发表于 2013-2-10 01:27:28 | 只看该作者
不介意的话把data文件夹打包下上传附件吧,这样看起问题来方便点。

                 无从有中来,有从无中生。
回复 支持 反对

使用道具 举报

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

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-9-28 00:20

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表