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

Project1

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

[已经过期] 自己修改菜单后光标乱了

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
33 小时
注册时间
2015-7-4
帖子
27
跳转到指定楼层
1
发表于 2016-2-12 17:09:09 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
在菜单左边加了两个选项“加点”“任务”,然后点进“状态”再esc返回,光标停留在“加点”上【貌似】,点进“结束游戏”,返回后光标停在“任务”上
表示不明白问题出在哪……
脚本如下:
  1. #==============================================================================
  2. # ** Scene_Menu
  3. #------------------------------------------------------------------------------
  4. #  This class performs menu screen processing.
  5. #==============================================================================

  6. class Scene_Menu
  7.   #--------------------------------------------------------------------------
  8.   # * Object Initialization
  9.   #     menu_index : command cursor's initial position
  10.   #--------------------------------------------------------------------------
  11.   def initialize(menu_index = 0)
  12.     @menu_index = menu_index
  13.   end
  14.   #--------------------------------------------------------------------------
  15.   # * Main Processing
  16.   #--------------------------------------------------------------------------
  17.   def main
  18.     # Make command window
  19.     s1 = $data_system.words.item
  20.     s2 = $data_system.words.skill
  21.     s3 = $data_system.words.equip
  22.     s4 = "加点"
  23.     s5 = "任务"
  24.     s6 = "状态"
  25.     s7 = "保存"
  26.     s8 = "结束游戏"
  27.     @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6,s7,s8])
  28.     @command_window.index = @menu_index
  29.     # If number of party members is 0
  30.     if $game_party.actors.size == 0
  31.       # Disable items, skills, equipment, and status
  32.       @command_window.disable_item(0)
  33.       @command_window.disable_item(1)
  34.       @command_window.disable_item(2)
  35.       @command_window.disable_item(3)
  36.     end
  37.     # If save is forbidden
  38.     if $game_system.save_disabled
  39.       # Disable save
  40.       @command_window.disable_item(4)
  41.     end
  42.     # Make play time window
  43.     @playtime_window = Window_PlayTime.new
  44.     @playtime_window.x = 0
  45.     @playtime_window.y = 288
  46.     # Make steps window
  47.     #@steps_window = Window_Steps.new
  48.     #@steps_window.x = 0
  49.     #@steps_window.y = 320
  50.     # Make gold window
  51.     @gold_window = Window_Gold.new
  52.     @gold_window.x = 0
  53.     @gold_window.y = 384
  54.     # Make status window
  55.     @status_window = Window_MenuStatus.new
  56.     @status_window.x = 160
  57.     @status_window.y = 0
  58.     # Execute transition
  59.     Graphics.transition
  60.     # Main loop
  61.     loop do
  62.       # Update game screen
  63.       Graphics.update
  64.       # Update input information
  65.       Input.update
  66.       # Frame update
  67.       update
  68.       # Abort loop if screen is changed
  69.       if $scene != self
  70.         break
  71.       end
  72.     end
  73.     # Prepare for transition
  74.     Graphics.freeze
  75.     # Dispose of windows
  76.     @command_window.dispose
  77.     @playtime_window.dispose
  78. #    @steps_window.dispose
  79.     @gold_window.dispose
  80.     @status_window.dispose
  81.   end
  82.   #--------------------------------------------------------------------------
  83.   # * Frame Update
  84.   #--------------------------------------------------------------------------
  85.   def update
  86.     # Update windows
  87.     @command_window.update
  88.     @playtime_window.update
  89. #    @steps_window.update
  90.     @gold_window.update
  91.     @status_window.update
  92.     # If command window is active: call update_command
  93.     if @command_window.active
  94.       update_command
  95.       return
  96.     end
  97.     # If status window is active: call update_status
  98.     if @status_window.active
  99.       update_status
  100.       return
  101.     end
  102.   end
  103.   #--------------------------------------------------------------------------
  104.   # * Frame Update (when command window is active)
  105.   #--------------------------------------------------------------------------
  106.   def update_command
  107.     # If B button was pressed
  108.     if Input.trigger?(Input::B)
  109.       # Play cancel SE
  110.       $game_system.se_play($data_system.cancel_se)
  111.       # Switch to map screen
  112.       $scene = Scene_Map.new
  113.       return
  114.     end
  115.     # If C button was pressed
  116.     if Input.trigger?(Input::C)
  117.       # If command other than save or end game, and party members = 0
  118.       if $game_party.actors.size == 0 and @command_window.index < 4
  119.         # Play buzzer SE
  120.         $game_system.se_play($data_system.buzzer_se)
  121.         return
  122.       end
  123.       # Branch by command window cursor position
  124.       case @command_window.index
  125.       when 0  # item
  126.         # Play decision SE
  127.         $game_system.se_play($data_system.decision_se)
  128.         # Switch to item screen
  129.         $scene = Scene_Item.new
  130.       when 1  # skill
  131.         # Play decision SE
  132.         $game_system.se_play($data_system.decision_se)
  133.         # Make status window active
  134.         @command_window.active = false
  135.         @status_window.active = true
  136.         @status_window.index = 0
  137.       when 2  # equipment
  138.         # Play decision SE
  139.         $game_system.se_play($data_system.decision_se)
  140.         # Make status window active
  141.         @command_window.active = false
  142.         @status_window.active = true
  143.         @status_window.index = 0
  144.       when 3  # 加点
  145.         # 演奏确定 SE
  146.         $game_system.se_play($data_system.decision_se)
  147.         # 切换到加点画面
  148.         $scene = Scene_Lvup.new
  149.       when 4  # 任务
  150.         # 演奏确定 SE
  151.         $game_system.se_play($data_system.decision_se)
  152.         # 切换到任务画面
  153.         $scene = Scene_Task.new
  154.       when 5  # 状态
  155.         # 演奏确定 SE
  156.         $game_system.se_play($data_system.decision_se)
  157.         # 激活状态窗口
  158.         @command_window.active = false
  159.         @status_window.active = true
  160.         @status_window.index = 0
  161.       when 6  # save
  162.         # If saving is forbidden
  163.         if $game_system.save_disabled
  164.           # Play buzzer SE
  165.           $game_system.se_play($data_system.buzzer_se)
  166.           return
  167.         end
  168.         # Play decision SE
  169.         $game_system.se_play($data_system.decision_se)
  170.         # Switch to save screen
  171.         $scene = Scene_Save.new
  172.       when 7  # end game
  173.         # Play decision SE
  174.         $game_system.se_play($data_system.decision_se)
  175.         # Switch to end game screen
  176.         $scene = Scene_End.new
  177.       end
  178.       return
  179.     end
  180.   end
  181.   #--------------------------------------------------------------------------
  182.   # * Frame Update (when status window is active)
  183.   #--------------------------------------------------------------------------
  184.   def update_status
  185.     # If B button was pressed
  186.     if Input.trigger?(Input::B)
  187.       # Play cancel SE
  188.       $game_system.se_play($data_system.cancel_se)
  189.       # Make command window active
  190.       @command_window.active = true
  191.       @status_window.active = false
  192.       @status_window.index = -1
  193.       return
  194.     end
  195.     # If C button was pressed
  196.     if Input.trigger?(Input::C)
  197.       # Branch by command window cursor position
  198.       case @command_window.index
  199.       when 1  # skill
  200.         # If this actor's action limit is 2 or more
  201.         if $game_party.actors[@status_window.index].restriction >= 2
  202.           # Play buzzer SE
  203.           $game_system.se_play($data_system.buzzer_se)
  204.           return
  205.         end
  206.         # Play decision SE
  207.         $game_system.se_play($data_system.decision_se)
  208.         # Switch to skill screen
  209.         $scene = Scene_Skill.new(@status_window.index)
  210.       when 2  # equipment
  211.         # Play decision SE
  212.         $game_system.se_play($data_system.decision_se)
  213.         # Switch to equipment screen
  214.         $scene = Scene_Equip.new(@status_window.index)
  215.       when 5  # status
  216.         # Play decision SE
  217.         $game_system.se_play($data_system.decision_se)
  218.         # Switch to status screen
  219.         $scene = Scene_Status.new(@status_window.index)
  220.       end
  221.       return
  222.     end
  223.   end
  224. end
复制代码

Lv3.寻梦者

梦石
0
星屑
1358
在线时间
1295 小时
注册时间
2012-8-4
帖子
749
2
发表于 2016-2-12 17:32:09 | 只看该作者
$scene = Scene_Menu.new(0)修改括号里的数值试试
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
555
在线时间
111 小时
注册时间
2013-11-22
帖子
301
3
发表于 2016-2-12 19:24:23 | 只看该作者
跟scene_menu没关系,跟您的scene_lvup和scene_task有关系
看看这两个脚本的b键以下的内容,再按2楼那样改
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-11-23 04:06

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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