Project1

标题: 话说,鼠标系统的俩问题 [打印本页]

作者: 幽月    时间: 2008-7-3 04:46
提示: 作者被禁止或删除 内容自动屏蔽
作者: 幽月    时间: 2008-7-3 21:14
提示: 作者被禁止或删除 内容自动屏蔽
作者: jackxiao    时间: 2008-7-3 21:24
提示: 作者被禁止或删除 内容自动屏蔽
作者: 幽月    时间: 2008-7-3 21:56
提示: 作者被禁止或删除 内容自动屏蔽
作者: ★_茄孓    时间: 2008-7-4 02:41
第一个问题还是把图给放上去吧
第二个问题将该脚本放Main前
  1. #==============================================================================
  2. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  3. #==============================================================================

  4. class Window_Selectable
  5.   if @self_alias == nil
  6.     alias self_update update
  7.     @self_alias = true
  8.   end
  9.   def update
  10.     #self.cursor_rect.empty
  11.     self_update
  12.     if self.active and @item_max > 0
  13.       index_var = @index
  14.       tp_index = @index
  15.       mouse_x, mouse_y = Mouse.get_mouse_pos
  16.       mouse_not_in_rect = true
  17.       for i in 0...@item_max
  18.         @index = i
  19.         update_cursor_rect
  20.         top_x = self.cursor_rect.x + self.x + 16
  21.         top_y = self.cursor_rect.y + self.y + 16
  22.         bottom_x = top_x + self.cursor_rect.width
  23.         bottom_y = top_y + self.cursor_rect.height
  24.         if (mouse_x > top_x) and (mouse_y > top_y) and
  25.            (mouse_x < bottom_x) and (mouse_y < bottom_y)
  26.           mouse_not_in_rect = false
  27.           if tp_index != @index
  28.             tp_index = @index
  29.             $game_system.se_play($data_system.cursor_se)
  30.           end
  31.           break
  32.         end
  33.       end
  34.       if mouse_not_in_rect
  35.         #  row = @index / @column_max
  36.           # 当前行被显示开头行前面的情况下
  37.           if self.top_row < row_max-page_row_max and Mouse.press?(Mouse::LEFT) and mouse_y>self.y+self.height/2
  38.             self.top_row +=1
  39.           end
  40.           # 当前行被显示末尾行之后的情况下
  41.           if self.top_row > 0 and Mouse.press?(Mouse::LEFT) and mouse_y<=self.y+self.height/2#self.top_row + (self.page_row_max - 1)
  42.             # 从当前行向末尾滚动
  43.             self.top_row -=1
  44.           end
  45.         @index = index_var
  46.         if self.is_a?(Window_Target)
  47.           @index=-3
  48.         end
  49.         update_cursor_rect
  50.         Mouse.click_lock
  51.       else
  52.         Mouse.click_unlock               
  53.       end
  54.     end
  55.   end
  56.   def update_cursor_rect
  57.     # 光标位置不满 0 的情况下
  58.     if @index < 0
  59.       self.cursor_rect.empty
  60.       return
  61.     end
  62.     # 获取当前的行
  63.     row = @index / @column_max
  64.     # 当前行被显示开头行前面的情况下
  65.     if row < self.top_row
  66.       # 从当前行向开头行滚动
  67.       self.cursor_rect.empty
  68.       return
  69.     end
  70.     # 当前行被显示末尾行之后的情况下
  71.     if row > self.top_row + (self.page_row_max - 1)
  72.       # 从当前行向末尾滚动
  73.       self.cursor_rect.empty
  74.       return
  75.     end
  76.     # 计算光标的宽
  77.     cursor_width = self.width / @column_max - 32
  78.     # 计算光标坐标
  79.     x = @index % @column_max * (cursor_width + 32)
  80.     y = @index / @column_max * 32 - self.oy
  81.     # 更新光标矩形
  82.     self.cursor_rect.set(x, y, cursor_width, 32)
  83.   end
  84. end



  85. #==============================================================================
  86. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  87. #==============================================================================

复制代码

作者: 幽月    时间: 2008-7-4 03:24
提示: 作者被禁止或删除 内容自动屏蔽
作者: 菜刀代替品    时间: 2008-7-4 03:27
提示: 作者被禁止或删除 内容自动屏蔽
作者: 幽月    时间: 2008-7-4 03:29
提示: 作者被禁止或删除 内容自动屏蔽
作者: 菜刀代替品    时间: 2008-7-4 03:41
提示: 作者被禁止或删除 内容自动屏蔽
作者: 幽月    时间: 2008-7-4 03:57
提示: 作者被禁止或删除 内容自动屏蔽
作者: 灯笼菜刀王    时间: 2008-7-4 09:36
囧,是明灭没效果还是什么没效果~~

如果你有用别的战斗脚本,就搜索下,在那脚本上替换掉同样的句子才行。
作者: 幽月    时间: 2008-7-4 17:11
提示: 作者被禁止或删除 内容自动屏蔽




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1