Advertisement
TheoAllen

Theo - Hide Weather by Tileset (ENG)

Jun 14th, 2013
415
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 1.92 KB | None | 0 0
  1. # =============================================================================
  2. # TheoAllen - Hide weather by Tileset id
  3. # Version : 1.0
  4. # Contact : www.rpgmakerid.com (or) http://theolized.blogspot.com
  5. # (English documentation)
  6. # =============================================================================
  7. ($imported ||= {})[:Theo_HideWeather] = true
  8. # =============================================================================
  9. # CHANGE LOGS:
  10. # -----------------------------------------------------------------------------
  11. # 2013.06.14 - Finished snippet
  12. # =============================================================================
  13. =begin
  14.  
  15.   Introduction :
  16.   This script allow you to hide the weather sprites when player entered map
  17.   with specified tileset id. For example, tileset ID for indoor by default is
  18.   3 (interior) and 4 (dungeon).
  19.  
  20.   How to use :
  21.   Puts this script below material but above main.
  22.   Edit the little configuration if neccessary.
  23.  
  24.   Terms of use :
  25.   You're free to edit by your own or even use in commercial game. Credit isn't
  26.   neccessary. But, I'll be glad if you put my name in your credit list.
  27.  
  28. =end
  29. # =============================================================================
  30. # Configuration :
  31. # =============================================================================
  32. module THEO
  33.   module MAP
  34.    
  35.     WEATHER_DISABLE = [3,4] # <-- Record Tileset ID here.
  36.    
  37.   end
  38. end
  39. # =============================================================================
  40. # Just that ~
  41. # =============================================================================
  42. class Spriteset_Weather
  43.  
  44.   alias pre_disable_update update
  45.   def update
  46.     pre_disable_update
  47.     update_visibility
  48.   end
  49.  
  50.   def update_visibility
  51.     @sprites.each do |spr|
  52.       spr.visible = !THEO::MAP::WEATHER_DISABLE.any? do |id|
  53.         $game_map.tileset.id == id
  54.       end
  55.     end
  56.   end
  57.  
  58. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement