IceDragon200

ICS - MouseShop (MousePatch)

Nov 5th, 2011
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 2.23 KB | None | 0 0
  1. #==============================================================================#
  2. # ** ICS - Magic Shop (Mouse Patch)
  3. #==============================================================================#
  4. # ** Date Created   : 11/05/2011
  5. # ** Date Modified  : 11/05/2011
  6. # ** Created By     : IceDragon
  7. #==============================================================================#
  8. # ** Rect
  9. #==============================================================================#
  10. class Rect
  11.  
  12.   #--------------------------------------------------------------------------#
  13.   # * new-method :to_a
  14.   #--------------------------------------------------------------------------#
  15.   def to_a() ; return self.x, self.y, self.width, self.height ; end
  16.    
  17. end
  18.  
  19. #==============================================================================#
  20. # ** Window_MagicShopStatus
  21. #==============================================================================#
  22. class Window_MagicShopStatus
  23.  
  24.   #--------------------------------------------------------------------------#
  25.   # * super-method :update
  26.   #--------------------------------------------------------------------------#  
  27.   def update()
  28.     super()
  29.     for i in 0...@response_rects.size ;
  30.       rect = @response_rects[i]
  31.       if Mouse.area?( self.x+(rect.x+16), self.y+(rect.y+16),
  32.           rect.width, rect.height ) ; @index = i ; end
  33.     end if self.active
  34.   end
  35.  
  36.   #--------------------------------------------------------------------------#
  37.   # * alias-method :refresh
  38.   #--------------------------------------------------------------------------#  
  39.   alias :mgshp_mspatch_refresh :refresh unless $@
  40.   def refresh()
  41.     mgshp_mspatch_refresh()
  42.     @response_rects ||= [] ; @response_rects.clear()
  43.     for i in 0...@item_max ; @response_rects[i] = item_rect( i ) ; end
  44.   end
  45.  
  46.   #--------------------------------------------------------------------------#
  47.   # * overwrite-method :update_mouse
  48.   #--------------------------------------------------------------------------#  
  49.   def update_mouse()
  50.   end
  51.  
  52. end
  53.  
  54. #=*==========================================================================*=#
  55. # ** END OF FILE
  56. #=*==========================================================================*=#
Advertisement
Add Comment
Please, Sign In to add comment