查看: 3026|回复: 5

[已经解决] 鼠标脚本为何不可以存档和继续游戏

[复制链接]
梦石
0
星屑
50
在线时间
117 小时
注册时间
2011-9-30
回帖
6
发表于 2012-7-28 09:13:57 | 显示全部楼层 |阅读模式

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

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

×
  1. #==============================================================================
  2. # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
  3. #==============================================================================

  4. #=================以下两个用来调整战斗时的手感问题,可以自己试试。
  5. $敌人选框扩大 = 30
  6. $角色选框扩大 = 20


  7. #==============================================================================
  8. # API调用
  9. #==============================================================================
  10. $ShowCursor = Win32API.new("user32", "ShowCursor", 'i', 'l')
  11. $GetCursorPos = Win32API.new("user32", "GetCursorPos", 'p', 'i')
  12. $ScreenToClient = Win32API.new("user32", "ScreenToClient", 'ip', 'i')
  13. $GetActiveWindow = Win32API.new("user32", "GetActiveWindow", nil, 'l')
  14. $Window_HWND = $GetActiveWindow.call
  15. $GetKeyState = Win32API.new("user32", "GetKeyState", 'i', 'i')
  16. #$FindWindow = Win32API.new("user32", "FindWindow", 'pp', 'i')
  17. #$HookStart  = Win32API.new("mouse_hook.dll", "HookStart", 'i', nil)
  18. #$HookEnd  = Win32API.new("mouse_hook.dll", "HookEnd", nil, nil)
  19. #$GetMouseStatus  = Win32API.new("mouse_hook.dll", "GetMouseStatus", 'i', 'i')
  20. #$Window_HWND = $FindWindow.call(nil, 'mousetry')

  21. module Mouse  
  22.   LEFT = 0x01
  23.   RIGHT = 0x02

  24.   def self.init(sprite = nil)
  25. #   $HookStart.call($Window_HWND)
  26.     $ShowCursor.call(0)
  27.    
  28.     @show_cursor = false
  29.    
  30.     @mouse_sprite = Sprite.new
  31.     @mouse_sprite.z = 99999
  32.     @mouse_sprite.bitmap = Bitmap.new('Graphics/System/fox_cursor')
  33.     #@mouse_sprite.bitmap.fill_rect(Rect.new(0, 0, 32, 32), Color.new(0, 0, 0))

  34.     @left_press = false
  35.     @right_press = false
  36.     @left_trigger = false
  37.     @right_trigger = false
  38.     @left_repeat = false
  39.     @right_repeat = false
  40.     @click_lock = false
  41.    
  42.     update
  43.   end
  44.   def self.exit
  45.     @mouse_sprite.bitmap.dispose
  46.     @mouse_sprite.dispose
  47.     @show_cursor = true
  48. #    $HookEnd.call
  49.     $ShowCursor.call(1)
  50.   end
  51.   def self.mouse_debug
  52.     return @mouse_debug.bitmap
  53.   end
  54.   def self.update
  55.     left_down = $GetKeyState.call(0x01)
  56.     right_down = $GetKeyState.call(0x02)
  57.    
  58.     @click_lock = false
  59.     mouse_x, mouse_y = self.get_mouse_pos
  60.     if @mouse_sprite != nil
  61.       @mouse_sprite.x = mouse_x
  62.       @mouse_sprite.y = mouse_y
  63.     end
  64.     if left_down[7] == 1
  65.       @left_repeat = (not @left_repeat)
  66.       @left_trigger = (not @left_press)
  67.       @left_press = true
  68.     else
  69.       @left_press = false
  70.       @left_trigger = false
  71.       @left_repeat = false
  72.     end
  73.     if right_down[7] == 1
  74.       @right_repeat = (not @right_repeat)
  75.       @right_trigger = (not @right_press)
  76.       @right_press = true
  77.     else
  78.       @right_press = false
  79.       @right_trigger = false
  80.       @right_repeat = false
  81.     end
  82.   end
  83.   def self.get_mouse_pos
  84.     point_var = [0, 0].pack('ll')
  85.     if $GetCursorPos.call(point_var) != 0
  86.       if $ScreenToClient.call($Window_HWND, point_var) != 0
  87.         x, y = point_var.unpack('ll')
  88.         if (x < 0) or (x > 10000) then x = 0 end
  89.         if (y < 0) or (y > 10000) then y = 0 end
  90.         if x > Graphics.width then x = Graphics.width end
  91.         if y > Graphics.height then y = Graphics.height end
  92.         return x, y
  93.       else
  94.         return 0, 0
  95.       end
  96.     else
  97.       return 0, 0
  98.     end
  99.   end
  100.   def self.press?(mouse_code)
  101.     if mouse_code == LEFT
  102.       if @click_lock
  103.         return false
  104.       else
  105.         return @left_press
  106.       end
  107.     elsif mouse_code == RIGHT
  108.       return @right_press
  109.     else
  110.       return false
  111.     end
  112.   end
  113.   def self.trigger?(mouse_code)
  114.     if mouse_code == LEFT
  115.       if @click_lock
  116.         return false
  117.       else
  118.         return @left_trigger
  119.       end
  120.     elsif mouse_code == RIGHT
  121.       return @right_trigger
  122.     else
  123.       return false
  124.     end
  125.   end
  126.   def self.repeat?(mouse_code)
  127.     if mouse_code == LEFT
  128.       if @click_lock
  129.         return false
  130.       else
  131.         return @left_repeat
  132.       end
  133.     elsif mouse_code == RIGHT
  134.       return @right_repeat
  135.     else
  136.       return false
  137.     end
  138.   end
  139.   def self.click_lock?
  140.     return @click_lock
  141.   end
  142.   def self.click_lock
  143.     @click_lock = true
  144.   end
  145.   def self.click_unlock
  146.     @click_lock = false
  147.   end
  148. end
  149. module Input
  150.   if @self_update == nil
  151.     @self_update = method('update')
  152.     @self_press = method('press?')
  153.     @self_trigger = method('trigger?')
  154.     @self_repeat = method('repeat?')
  155.   end
  156.   def self.update
  157.     @self_update.call
  158.     Mouse.update
  159.   end
  160.   def self.press?(key_code)
  161.     if @self_press.call(key_code)
  162.       return true
  163.     end
  164.     if key_code == C
  165.       return Mouse.press?(Mouse::LEFT)
  166.     elsif key_code == B
  167.       return Mouse.press?(Mouse::RIGHT)
  168.     else
  169.       return @self_press.call(key_code)
  170.     end
  171.   end
  172.   def self.trigger?(key_code)
  173.     if @self_trigger.call(key_code)
  174.       return true
  175.     end
  176.     if key_code == C
  177.       return Mouse.trigger?(Mouse::LEFT)
  178.     elsif key_code == B
  179.       return Mouse.trigger?(Mouse::RIGHT)
  180.     else
  181.       return @self_trigger.call(key_code)
  182.     end
  183.   end
  184.   def self.repeat?(key_code)
  185.     if @self_repeat.call(key_code)
  186.       return true
  187.     end
  188.     if key_code == C
  189.       return Mouse.repeat?(Mouse::LEFT)
  190.     elsif key_code == B
  191.       return Mouse.repeat?(Mouse::RIGHT)
  192.     else
  193.       return @self_repeat.call(key_code)
  194.     end
  195.   end
  196. end

  197. class Window_Selectable
  198.   if @self_alias == nil
  199.     alias self_update update
  200.     @self_alias = true
  201.   end
  202.   def update
  203.     #self.cursor_rect.empty
  204.     self_update
  205.     if self.active and item_max > 0
  206.       index_var = @index
  207.       tp_index = @index
  208.       mouse_x, mouse_y = Mouse.get_mouse_pos
  209.       mouse_not_in_rect = true
  210.       for i in 0...item_max
  211.         @index = i
  212.         update_cursor
  213.         top_x = self.cursor_rect.x + self.x + 16
  214.         top_y = self.cursor_rect.y + self.y + 16
  215.         bottom_x = top_x + self.cursor_rect.width
  216.         bottom_y = top_y + self.cursor_rect.height
  217.         
  218.           top_x += self.x_mod
  219.           top_y += self.y_mod
  220.           bottom_x += self.x_mod
  221.           bottom_y += self.y_mod
  222.         
  223.         if (mouse_x > top_x) and (mouse_y > top_y) and
  224.            (mouse_x < bottom_x) and (mouse_y < bottom_y)
  225.           mouse_not_in_rect = false
  226.           if tp_index != @index
  227.             tp_index = @index
  228.             $data_system.sounds[0].play
  229.           end
  230.           break
  231.         end
  232.       end
  233.     if Input.trigger?(Input::F9)
  234.     p top_x,top_y,Mouse.get_mouse_pos
  235.     end
  236.       if mouse_not_in_rect
  237.         @index = index_var
  238.         update_cursor
  239.         Mouse.click_lock
  240.       else
  241.         Mouse.click_unlock               
  242.       end
  243.     end
  244.   end
  245. end




  246. class Window_NameInput
  247.   if @self_alias == nil
  248.     alias self_update update
  249.     @self_alias = true
  250.   end
  251.   def update
  252.     #self.cursor_rect.empty
  253.     self_update
  254.     if self.active
  255.       index_var = @index
  256.       mouse_x, mouse_y = Mouse.get_mouse_pos
  257.       mouse_not_in_rect = true
  258.       for i in (0...HIRAGANA.size).to_a.push(180)
  259.         @index = i
  260.         update_cursor
  261.         top_x = self.cursor_rect.x + self.x + 16
  262.         top_y = self.cursor_rect.y + self.y + 16
  263.         bottom_x = top_x + self.cursor_rect.width
  264.         bottom_y = top_y + self.cursor_rect.height
  265.         #
  266.         if (mouse_x > top_x) and (mouse_y > top_y) and
  267.            (mouse_x < bottom_x) and (mouse_y < bottom_y)
  268.           mouse_not_in_rect = false
  269.           break
  270.         end
  271.       end
  272.       if mouse_not_in_rect
  273.         @index = index_var
  274.         update_cursor
  275.         Mouse.click_lock
  276.       else
  277.         Mouse.click_unlock
  278.       end
  279.     end
  280.   end
  281. end
  282. =begin

  283. class Window_InputNumber
  284.   if @self_alias == nil
  285.     alias self_update update
  286.     @self_alias = true
  287.   end
  288.   def update
  289.     #self.cursor_rect.empty
  290.     self_update
  291.     mouse_x, mouse_y = Mouse.get_mouse_pos
  292.     if self.active and @digits_max > 0
  293.       index_var = @index
  294.       mouse_not_in_rect = true
  295.       for i in 0...@digits_max
  296.         @index = i
  297.         #update_cursor
  298.         top_x = self.cursor_rect.x + self.x + 16
  299.         bottom_x = top_x + self.cursor_rect.width
  300.         #
  301.         if (mouse_x > top_x) and (mouse_x < bottom_x)
  302.           mouse_not_in_rect = false
  303.           break
  304.         end
  305.       end
  306.       if mouse_not_in_rect
  307.         @index = index_var
  308.         #update_cursor
  309.         Mouse.click_lock
  310.       else
  311.         Mouse.click_unlock
  312.       end
  313.     end
  314.     if @last_mouse_y == nil
  315.       @last_mouse_y = mouse_y
  316.     end
  317.     check_pos = (@last_mouse_y - mouse_y).abs
  318.     if check_pos > 10
  319.       #$game_system.se_play($data_system.cursor_se)
  320.       place = 10 ** (@digits_max - 1 - @index)
  321.       n = @number / place % 10
  322.       @number -= n * place
  323.       n = (n + 1) % 10 if mouse_y < @last_mouse_y
  324.       n = (n + 9) % 10 if mouse_y > @last_mouse_y
  325.       @number += n * place
  326.       refresh
  327.       @last_mouse_y = mouse_y
  328.     end
  329.   end
  330. end
  331. =end

  332. class Scene_File
  333.   if @self_alias == nil
  334.     alias self_update update
  335.     @self_alias = true
  336.   end
  337.   def update
  338.     mouse_x, mouse_y = Mouse.get_mouse_pos
  339.     Mouse.click_lock
  340.     idx = 0
  341.     for i in @windows_savefile
  342.       top_x = i.x + 16
  343.       top_y = i.y + 16
  344.       bottom_x = top_x + i.width
  345.       bottom_y = top_y + i.height
  346.       if (mouse_x > top_x) and (mouse_y > top_y) and
  347.          (mouse_x < bottom_x) and (mouse_y < bottom_y)
  348.         i.selected = true
  349.         if @file_index != idx
  350.           @file_index = idx
  351.           $data_system.sounds[0].play
  352.         end            
  353.         Mouse.click_unlock
  354.       else
  355.         i.selected = false
  356.       end
  357.       idx += 1
  358.     end
  359.     self_update
  360.   end
  361. end

  362. class Game_Player
  363.   if @self_alias == nil
  364.     alias self_update update
  365.     @self_alias = true
  366.   end
  367.   def update
  368.     mouse_x, mouse_y = Mouse.get_mouse_pos
  369.     if @last_move_x == nil
  370.       @last_move_x = false
  371.     end
  372.     if Mouse.press?(Mouse::LEFT)
  373.    #for event in $game_map.events.values
  374.    #if event.screen_x/32 == mouse_x/32 and event.screen_y/32-1 == mouse_y/32
  375.    #event.start
  376.    #end
  377.    #end
  378.       last_moving = moving?
  379.       last_direction = @direction
  380.     #  return unless movable?
  381.     #  return if $game_map.interpreter.running?
  382.       unless moving? or $game_map.interpreter.running?
  383.       last_x = @x
  384.         if @last_move_x
  385.           @last_move_x = false
  386.         elsif mouse_x > screen_x + 16
  387.           move_straight(6)
  388.         elsif mouse_x < screen_x - 16
  389.           move_straight(4)
  390.         end
  391.         last_y = @y
  392.         if last_x != @x
  393.           @last_move_x = true
  394.         elsif mouse_y > screen_y
  395.           move_straight(2)
  396.         elsif mouse_y < screen_y - 32
  397.           move_straight(8)
  398.         end
  399. =begin        
  400.         if last_y != @y
  401.           @last_move_x = false
  402.         elsif not @last_move_x
  403.           case last_direction
  404.           when 2
  405.             turn_down
  406.           when 4
  407.             turn_left
  408.           when 6
  409.             turn_right
  410.           when 8
  411.             turn_up
  412.           end        
  413.         end
  414. =end         
  415.       end
  416.     end
  417.     self_update
  418.   end
  419. end

  420. Mouse.init
  421. END { Mouse.exit }


  422. class Window_Base < Window
  423.   attr_accessor :x_mod
  424.   attr_accessor :y_mod
  425.   alias ka_initialize initialize
  426.   def initialize(x, y, width, height)
  427.     ka_initialize(x, y, width, height)
  428.     self.x_mod = 0
  429.     self.y_mod = 0
  430.   end
  431. end
  432. class Window_PartyCommand < Window_Command

  433.   alias ka1_initialize initialize
  434.   def initialize
  435.     ka1_initialize
  436.     self.y_mod = Graphics.height-128
  437.   end

  438. end
  439. class Window_ActorCommand < Window_Command

  440.   alias ka2_initialize initialize
  441.   def initialize
  442.     ka2_initialize
  443.     self.x_mod = -128
  444.     self.y_mod = Graphics.height-128
  445.   end

  446. end

  447. #==============================================================================
  448. # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
  449. #==============================================================================
复制代码
未命名.jpg
梦石
0
星屑
50
在线时间
117 小时
注册时间
2011-9-30
回帖
6
 楼主| 发表于 2012-7-28 09:16:44 | 显示全部楼层
#==============================================================================
# 本脚本来自www.66RPG.com,使用和转载请保留此信息
#==============================================================================

#=================以下两个用来调整战斗时的手感问题,可以自己试试。
$敌人选框扩大 = 30
$角色选框扩大 = 20


#==============================================================================
# API调用
#==============================================================================
$ShowCursor = Win32API.new("user32", "ShowCursor", 'i', 'l')
$GetCursorPos = Win32API.new("user32", "GetCursorPos", 'p', 'i')
$ScreenToClient = Win32API.new("user32", "ScreenToClient", 'ip', 'i')
$GetActiveWindow = Win32API.new("user32", "GetActiveWindow", nil, 'l')
$Window_HWND = $GetActiveWindow.call
$GetKeyState = Win32API.new("user32", "GetKeyState", 'i', 'i')
#$FindWindow = Win32API.new("user32", "FindWindow", 'pp', 'i')
#$HookStart  = Win32API.new("mouse_hook.dll", "HookStart", 'i', nil)
#$HookEnd  = Win32API.new("mouse_hook.dll", "HookEnd", nil, nil)
#$GetMouseStatus  = Win32API.new("mouse_hook.dll", "GetMouseStatus", 'i', 'i')
#$Window_HWND = $FindWindow.call(nil, 'mousetry')

module Mouse  
  LEFT = 0x01
  RIGHT = 0x02

  def self.init(sprite = nil)
#   $HookStart.call($Window_HWND)
    $ShowCursor.call(0)
   
    @show_cursor = false
   
    @mouse_sprite = Sprite.new
    @mouse_sprite.z = 99999
    @mouse_sprite.bitmap = Bitmap.new('Graphics/System/fox_cursor')
    #@mouse_sprite.bitmap.fill_rect(Rect.new(0, 0, 32, 32), Color.new(0, 0, 0))

    @left_press = false
    @right_press = false
    @left_trigger = false
    @right_trigger = false
    @left_repeat = false
    @right_repeat = false
    @click_lock = false
   
    update
  end
  def self.exit
    @mouse_sprite.bitmap.dispose
    @mouse_sprite.dispose
    @show_cursor = true
#    $HookEnd.call
    $ShowCursor.call(1)
  end
  def self.mouse_debug
    return @mouse_debug.bitmap
  end
  def self.update
    left_down = $GetKeyState.call(0x01)
    right_down = $GetKeyState.call(0x02)
   
    @click_lock = false
    mouse_x, mouse_y = self.get_mouse_pos
    if @mouse_sprite != nil
      @mouse_sprite.x = mouse_x
      @mouse_sprite.y = mouse_y
    end
    if left_down[7] == 1
      @left_repeat = (not @left_repeat)
      @left_trigger = (not @left_press)
      @left_press = true
    else
      @left_press = false
      @left_trigger = false
      @left_repeat = false
    end
    if right_down[7] == 1
      @right_repeat = (not @right_repeat)
      @right_trigger = (not @right_press)
      @right_press = true
    else
      @right_press = false
      @right_trigger = false
      @right_repeat = false
    end
  end
  def self.get_mouse_pos
    point_var = [0, 0].pack('ll')
    if $GetCursorPos.call(point_var) != 0
      if $ScreenToClient.call($Window_HWND, point_var) != 0
        x, y = point_var.unpack('ll')
        if (x < 0) or (x > 10000) then x = 0 end
        if (y < 0) or (y > 10000) then y = 0 end
        if x > Graphics.width then x = Graphics.width end
        if y > Graphics.height then y = Graphics.height end
        return x, y
      else
        return 0, 0
      end
    else
      return 0, 0
    end
  end
  def self.press?(mouse_code)
    if mouse_code == LEFT
      if @click_lock
        return false
      else
        return @left_press
      end
    elsif mouse_code == RIGHT
      return @right_press
    else
      return false
    end
  end
  def self.trigger?(mouse_code)
    if mouse_code == LEFT
      if @click_lock
        return false
      else
        return @left_trigger
      end
    elsif mouse_code == RIGHT
      return @right_trigger
    else
      return false
    end
  end
  def self.repeat?(mouse_code)
    if mouse_code == LEFT
      if @click_lock
        return false
      else
        return @left_repeat
      end
    elsif mouse_code == RIGHT
      return @right_repeat
    else
      return false
    end
  end
  def self.click_lock?
    return @click_lock
  end
  def self.click_lock
    @click_lock = true
  end
  def self.click_unlock
    @click_lock = false
  end
end
module Input
  if @self_update == nil
    @self_update = method('update')
    @self_press = method('press?')
    @self_trigger = method('trigger?')
    @self_repeat = method('repeat?')
  end
  def self.update
    @self_update.call
    Mouse.update
  end
  def self.press?(key_code)
    if @self_press.call(key_code)
      return true
    end
    if key_code == C
      return Mouse.press?(Mouse::LEFT)
    elsif key_code == B
      return Mouse.press?(Mouse::RIGHT)
    else
      return @self_press.call(key_code)
    end
  end
  def self.trigger?(key_code)
    if @self_trigger.call(key_code)
      return true
    end
    if key_code == C
      return Mouse.trigger?(Mouse::LEFT)
    elsif key_code == B
      return Mouse.trigger?(Mouse::RIGHT)
    else
      return @self_trigger.call(key_code)
    end
  end
  def self.repeat?(key_code)
    if @self_repeat.call(key_code)
      return true
    end
    if key_code == C
      return Mouse.repeat?(Mouse::LEFT)
    elsif key_code == B
      return Mouse.repeat?(Mouse::RIGHT)
    else
      return @self_repeat.call(key_code)
    end
  end
end

class Window_Selectable
  if @self_alias == nil
    alias self_update update
    @self_alias = true
  end
  def update
    #self.cursor_rect.empty
    self_update
    if self.active and item_max > 0
      index_var = @index
      tp_index = @index
      mouse_x, mouse_y = Mouse.get_mouse_pos
      mouse_not_in_rect = true
      for i in 0...item_max
        @index = i
        update_cursor
        top_x = self.cursor_rect.x + self.x + 16
        top_y = self.cursor_rect.y + self.y + 16
        bottom_x = top_x + self.cursor_rect.width
        bottom_y = top_y + self.cursor_rect.height
        
          top_x += self.x_mod
          top_y += self.y_mod
          bottom_x += self.x_mod
          bottom_y += self.y_mod
        
        if (mouse_x > top_x) and (mouse_y > top_y) and
           (mouse_x < bottom_x) and (mouse_y < bottom_y)
          mouse_not_in_rect = false
          if tp_index != @index
            tp_index = @index
            $data_system.sounds[0].play
          end
          break
        end
      end
    if Input.trigger?(Input::F9)
    p top_x,top_y,Mouse.get_mouse_pos
    end
      if mouse_not_in_rect
        @index = index_var
        update_cursor
        Mouse.click_lock
      else
        Mouse.click_unlock               
      end
    end
  end
end




class Window_NameInput
  if @self_alias == nil
    alias self_update update
    @self_alias = true
  end
  def update
    #self.cursor_rect.empty
    self_update
    if self.active
      index_var = @index
      mouse_x, mouse_y = Mouse.get_mouse_pos
      mouse_not_in_rect = true
      for i in (0...HIRAGANA.size).to_a.push(180)
        @index = i
        update_cursor
        top_x = self.cursor_rect.x + self.x + 16
        top_y = self.cursor_rect.y + self.y + 16
        bottom_x = top_x + self.cursor_rect.width
        bottom_y = top_y + self.cursor_rect.height
        #
        if (mouse_x > top_x) and (mouse_y > top_y) and
           (mouse_x < bottom_x) and (mouse_y < bottom_y)
          mouse_not_in_rect = false
          break
        end
      end
      if mouse_not_in_rect
        @index = index_var
        update_cursor
        Mouse.click_lock
      else
        Mouse.click_unlock
      end
    end
  end
end
=begin

class Window_InputNumber
  if @self_alias == nil
    alias self_update update
    @self_alias = true
  end
  def update
    #self.cursor_rect.empty
    self_update
    mouse_x, mouse_y = Mouse.get_mouse_pos
    if self.active and @digits_max > 0
      index_var = @index
      mouse_not_in_rect = true
      for i in 0...@digits_max
        @index = i
        #update_cursor
        top_x = self.cursor_rect.x + self.x + 16
        bottom_x = top_x + self.cursor_rect.width
        #
        if (mouse_x > top_x) and (mouse_x < bottom_x)
          mouse_not_in_rect = false
          break
        end
      end
      if mouse_not_in_rect
        @index = index_var
        #update_cursor
        Mouse.click_lock
      else
        Mouse.click_unlock
      end
    end
    if @last_mouse_y == nil
      @last_mouse_y = mouse_y
    end
    check_pos = (@last_mouse_y - mouse_y).abs
    if check_pos > 10
      #$game_system.se_play($data_system.cursor_se)
      place = 10 ** (@digits_max - 1 - @index)
      n = @number / place % 10
      @number -= n * place
      n = (n + 1) % 10 if mouse_y < @last_mouse_y
      n = (n + 9) % 10 if mouse_y > @last_mouse_y
      @number += n * place
      refresh
      @last_mouse_y = mouse_y
    end
  end
end
=end

class Scene_File
  if @self_alias == nil
    alias self_update update
    @self_alias = true
  end
  def update
    mouse_x, mouse_y = Mouse.get_mouse_pos
    Mouse.click_lock
    idx = 0
    for i in @windows_savefile
      top_x = i.x + 16
      top_y = i.y + 16
      bottom_x = top_x + i.width
      bottom_y = top_y + i.height
      if (mouse_x > top_x) and (mouse_y > top_y) and
         (mouse_x < bottom_x) and (mouse_y < bottom_y)
        i.selected = true
        if @file_index != idx
          @file_index = idx
          $data_system.sounds[0].play
        end            
        Mouse.click_unlock
      else
        i.selected = false
      end
      idx += 1
    end
    self_update
  end
end

class Game_Player
  if @self_alias == nil
    alias self_update update
    @self_alias = true
  end
  def update
    mouse_x, mouse_y = Mouse.get_mouse_pos
    if @last_move_x == nil
      @last_move_x = false
    end
    if Mouse.press?(Mouse::LEFT)
   #for event in $game_map.events.values
   #if event.screen_x/32 == mouse_x/32 and event.screen_y/32-1 == mouse_y/32
   #event.start
   #end
   #end
      last_moving = moving?
      last_direction = @direction
    #  return unless movable?
    #  return if $game_map.interpreter.running?
      unless moving? or $game_map.interpreter.running?
      last_x = @x
        if @last_move_x
          @last_move_x = false
        elsif mouse_x > screen_x + 16
          move_straight(6)
        elsif mouse_x < screen_x - 16
          move_straight(4)
        end
        last_y = @y
        if last_x != @x
          @last_move_x = true
        elsif mouse_y > screen_y
          move_straight(2)
        elsif mouse_y < screen_y - 32
          move_straight(8)
        end
=begin        
        if last_y != @y
          @last_move_x = false
        elsif not @last_move_x
          case last_direction
          when 2
            turn_down
          when 4
            turn_left
          when 6
            turn_right
          when 8
            turn_up
          end        
        end
=end         
      end
    end
    self_update
  end
end

Mouse.init
END { Mouse.exit }


class Window_Base < Window
  attr_accessor :x_mod
  attr_accessor :y_mod
  alias ka_initialize initialize
  def initialize(x, y, width, height)
    ka_initialize(x, y, width, height)
    self.x_mod = 0
    self.y_mod = 0
  end
end
class Window_PartyCommand < Window_Command

  alias ka1_initialize initialize
  def initialize
    ka1_initialize
    self.y_mod = Graphics.height-128
  end

end
class Window_ActorCommand < Window_Command

  alias ka2_initialize initialize
  def initialize
    ka2_initialize
    self.x_mod = -128
    self.y_mod = Graphics.height-128
  end

end

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

使用道具 举报

梦石
0
星屑
50
在线时间
48 小时
注册时间
2012-2-29
回帖
35
发表于 2012-7-29 12:39:54 | 显示全部楼层
我就行啊,鼠标系统和截图存档系统都是图书馆里面的,你试试把它们两个在脚本编辑器里面的位置换换
回复

使用道具 举报

梦石
0
星屑
50
在线时间
117 小时
注册时间
2011-9-30
回帖
6
 楼主| 发表于 2012-7-30 08:52:16 | 显示全部楼层
星雨空也 发表于 2012-7-29 12:39
我就行啊,鼠标系统和截图存档系统都是图书馆里面的,你试试把它们两个在脚本编辑器里面的位置换换 ...

非常感谢!
但我用的不是那个鼠标系统,那个系统经常会出现 鼠标在左上角无法摇动,我用的是另一个鼠标修改版鼠标系统修改版鼠标系统(VX-》VA) [url]http://rpg.blue/thread-225459-1-1.html [/url]   
这个基本还行,但就是存档,读档不好,你看你能解决下不。

修改版鼠标系统(VX-》VA)
http://rpg.blue/thread-225459-1-1.html
回复

使用道具 举报

梦石
0
星屑
50
在线时间
48 小时
注册时间
2012-2-29
回帖
35
发表于 2012-8-1 16:49:50 | 显示全部楼层
xxyyyqq 发表于 2012-7-30 08:52
非常感谢!
但我用的不是那个鼠标系统,那个系统经常会出现 鼠标在左上角无法摇动,我用的是另一个鼠标修 ...

呵呵,我是菜鸟中的菜鸟耶,你看看这个行不,就是我用的那两个系统,平时不卡不死机,存档读档时光标不准,有点卡,建议那时候把光标拖走(拖出那个选择框),用键盘选择
http://115.com/file/c267nayb
回复

使用道具 举报

梦石
0
星屑
50
在线时间
117 小时
注册时间
2011-9-30
回帖
6
 楼主| 发表于 2012-8-2 08:48:52 | 显示全部楼层
谢谢,已经解决了
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部