查看: 1604|回复: 1

[已经解决] 关于鼠标脚本,在使用目标为全体的特技或者物品时的bug

  [复制链接]
梦石
0
星屑
1325
在线时间
19 小时
注册时间
2010-10-2
回帖
1
发表于 2011-4-30 09:30:23 | 显示全部楼层 |阅读模式

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

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

×
一直觉得奇怪,难道大家都没有发现鼠标的这个巨大bug吗。似乎站上的几个鼠标脚本都有这个问题。
在使用目标为全体的物品时,也能通过鼠标选取对象,但这样目标就变成了一个人。用全体特技的时候更糟糕,如果不用鼠标选取对象,还会弹出错误的对话框。
请问怎么解决。谢谢。

綾川司の姫様<

梦石
0
星屑
50
在线时间
796 小时
注册时间
2007-12-20
回帖
4461

贵宾第3届短篇游戏大赛R剧及RMTV组亚军

发表于 2011-4-30 11:38:06 | 显示全部楼层
= =我已经搞不清自家的鼠标脚本修改了多少处了……不过应该就只有这一段而已。
找到你鼠标脚本的Window_Selectable部分,拿如下内容替换:
  1. class Window_Selectable
  2. if @self_alias == nil
  3.    alias self_update update
  4.    @self_alias = true
  5. end
  6. def update
  7.    self_update
  8.    if self.active and @item_max > 0
  9.      index_var = @index
  10.      tp_index = @index
  11.      mouse_x, mouse_y = Mouse.get_mouse_pos
  12.      mouse_not_in_rect = true
  13.     unless @index == -1 and self.is_a?(Window_Target)
  14.      for i in (top_row * @column_max)...[@item_max ,top_row * @column_max + page_item_max].min
  15.        @index = i
  16.        update_cursor_rect
  17.        top_x = self.cursor_rect.x + self.x + 16
  18.        top_y = self.cursor_rect.y + self.y + 16
  19.        bottom_x = top_x + self.cursor_rect.width
  20.        bottom_y = top_y + self.cursor_rect.height
  21.        if (mouse_x > top_x) and (mouse_y > top_y) and
  22.           (mouse_x < bottom_x) and (mouse_y < bottom_y)
  23.          mouse_not_in_rect = false
  24.          if tp_index != @index
  25.            tp_index = @index
  26.            $game_system.se_play($data_system.cursor_se)
  27.          end
  28.          break
  29.        end
  30.      end
  31.     else
  32.        top_x = self.cursor_rect.x + self.x + 16
  33.        top_y = self.cursor_rect.y + self.y + 16
  34.        bottom_x = top_x + self.cursor_rect.width
  35.        bottom_y = top_y + self.cursor_rect.height
  36.        if (mouse_x > top_x) and (mouse_y > top_y) and
  37.           (mouse_x < bottom_x) and (mouse_y < bottom_y)
  38.          mouse_not_in_rect = false
  39.          if tp_index != @index
  40.            tp_index = @index
  41.            $game_system.se_play($data_system.cursor_se)
  42.          end
  43.          end
  44.       end
  45.      if mouse_not_in_rect
  46.        @index = index_var
  47.        update_cursor_rect
  48.        Mouse.click_lock
  49.      else
  50.        Mouse.click_unlock               
  51.      end
  52.    end
  53. end
  54. end
复制代码

评分

参与人数 1星屑 +400 梦石 +2 收起 理由
fux2 + 400 + 2 认可答案~

查看全部评分


生命即是责任。自己即是世界。
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部