TheoAllen

Theo - Hide Weather by Tileset

Jun 14th, 2013
292
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 1.77 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. # (This script documentation is written in informal indonesian language)
  6. # =============================================================================
  7. ($imported ||= {})[:Theo_HideWeather] = true
  8. # =============================================================================
  9. # CHANGE LOGS:
  10. # -----------------------------------------------------------------------------
  11. # 2013.06.14 - Finished snippet
  12. # =============================================================================
  13. =begin
  14.  
  15.   Perkenalan :
  16.   Script ini untuk sembunyiin weather pas lagi dalam tileset id tertentu
  17.  
  18.   Cara pakai :
  19.   Taruh dibawah material namun diatas main
  20.   Edit konfigurasi kecilnya
  21.  
  22.   Terms of use :
  23.   Credit gw, sebagai penemu idenya mwahahahaha .....
  24.   feel free buat diapa-apain
  25.  
  26. =end
  27. # =============================================================================
  28. # Konfigurasi :
  29. # =============================================================================
  30. module THEO
  31.   module MAP
  32.    
  33.     # Tileset id untuk ngedisable weather.
  34.     WEATHER_DISABLE = [3,4]
  35.    
  36.   end
  37. end
  38. # =============================================================================
  39. # Itu aja :v
  40. # =============================================================================
  41. class Spriteset_Weather
  42.  
  43.   alias pre_disable_update update
  44.   def update
  45.     pre_disable_update
  46.     update_visibility
  47.   end
  48.  
  49.   def update_visibility
  50.     @sprites.each do |spr|
  51.       spr.visible = !THEO::MAP::WEATHER_DISABLE.any? do |id|
  52.         $game_map.tileset.id == id
  53.       end
  54.     end
  55.   end
  56.  
  57. end
Advertisement
Add Comment
Please, Sign In to add comment