Advertisement
GlitchyPSIX

GlitchyPSIX's Variable WinTone Script

Feb 26th, 2015
363
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 2.40 KB | None | 0 0
  1. #----------------------------------------------------------------------------
  2. # [<-|->] GlitchyPSIX's Variable Window Tone Changing Script
  3. #----------------------------------------------------------------------------
  4. # Yes, this is my first script seeing what I can do with my first Ruby notions.
  5. # Using the values from the variables defined in the setup, you can set
  6. # Window_Tone (Window Color) easily without the default events...
  7. # and the best thing of it is that is pretty enjoyable
  8. # by the end-user as it looks like he can edit
  9. # the game in a way like Mother 3's Window Flavor System. But this one is
  10. # more customizable :3
  11. #----------------------------------------------------------------------------
  12. # My next goal for this script is making also a Color Selector for newbie-
  13. # friendly engine... :D
  14. # I feel good with this because it does not override over 255.
  15. # If it detects over 255 value, it sets it to fixed 255 xD
  16. #----------------------------------------------------------------------------
  17. module GLITCHYSCOLOR
  18.   REDVAR = 10 #10 by default
  19.   BLUVAR = 11 #11 by default
  20.   GRNVAR = 12 #12 by default
  21. end
  22. #----------------------------------------------------------------------------
  23. # <-> Editing anything past this point may result in... Wait, I'm not
  24. #     Yanfly! xD
  25. #----------------------------------------------------------------------------
  26. $imported = {} if $imported.nil?
  27. $imported[:glitchyscolor] = true
  28.  
  29. #----------------------------------------------------------------------------
  30. # Window_Base
  31. #----------------------------------------------------------------------------
  32. class Window_Base < Window
  33.   #--------------------------------------------------------------------------
  34.   # * Update Tone
  35.   #--------------------------------------------------------------------------
  36.  
  37.   def update_tone
  38.     if $game_variables[GLITCHYSCOLOR::REDVAR] > 254
  39.       then $game_variables[GLITCHYSCOLOR::REDVAR] = 255
  40.       end
  41.     if $game_variables[GLITCHYSCOLOR::BLUVAR] > 254
  42.       then $game_variables[GLITCHYSCOLOR::BLUVAR] = 255
  43.       end
  44.     if $game_variables[GLITCHYSCOLOR::GRNVAR] > 254
  45.       then $game_variables[GLITCHYSCOLOR::GRNVAR] = 255
  46.       end
  47.     red = $game_variables[GLITCHYSCOLOR::REDVAR]
  48.     blue = $game_variables[GLITCHYSCOLOR::BLUVAR]
  49.     green = $game_variables[GLITCHYSCOLOR::GRNVAR]
  50.     tone = Tone.new(red, green, blue, 0)
  51.     self.tone.set(tone)
  52.   end
  53. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement