Advertisement
LiTTleDRAgo

[RGSS] Drago - Translucent Menu

Jan 23rd, 2014
470
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 3.14 KB | None | 0 0
  1. #==============================================================================
  2. # ** [XP] Drago - Translucent Menu
  3. # Version : 2.00
  4. # Contact : littledrago.blogspot.com / forum.chaos-project.com
  5. #==============================================================================
  6.  
  7. module Transparency
  8.  
  9.   Scene = [Scene_Menu, Scene_Item, Scene_Skill, Scene_Equip, Scene_Status,
  10.            Scene_Save, Scene_End,  Scene_Shop,  Scene_Name,  Scene_Debug]
  11.            
  12.   No_Pause_Menu = true
  13.            
  14. end
  15.  
  16. ($imported ||= {})[:drg_translucent_menu] = 2.00
  17. #==============================================================================
  18. # ** Object
  19. #------------------------------------------------------------------------------
  20. #  This class is superclass for all class
  21. #==============================================================================
  22. class Object
  23.   #--------------------------------------------------------------------------
  24.   # * self.menu_transparency
  25.   #--------------------------------------------------------------------------
  26.   def self.menu_transparency
  27.     unless method_defined?(:menu_transparency_update)
  28.       send(:alias_method, :menu_transparency_main,   :main)
  29.       send(:alias_method, :menu_transparency_update, :update)
  30.     end
  31.     send(:define_method, :main) do |*args|
  32.       @spriteset = Spriteset_Map.new if $game_map && $game_map.map_id != 0
  33.       @menu_transparency = !@spriteset.nil?
  34.       menu_transparency_main(*args)
  35.       @spriteset && @spriteset.dispose
  36.     end
  37.     send(:define_method, :update) do |*args|
  38.       menu_transparency_update(*args)
  39.       return unless $game_temp
  40.       return unless Transparency::No_Pause_Menu
  41.       return if $game_temp.player_transferring
  42.       return if $game_temp.transition_processing
  43.       message = $game_temp.message_window_showing
  44.       @spriteset   && @spriteset.update
  45.       $game_map    && $game_map.update
  46.       $game_system && $game_system.update
  47.       $game_system && (sys = $game_system.map_interpreter) && sys.update
  48.       $game_screen && $game_screen.update
  49.       $game_temp.message_window_showing = true
  50.       $game_player && $game_player.update
  51.       $game_temp.message_window_showing = message
  52.     end
  53.   end
  54. end
  55. #==============================================================================
  56. # ** Window_Base
  57. #------------------------------------------------------------------------------
  58. #  This class is for all in-game windows.
  59. #==============================================================================
  60. class Window_Base
  61.   #--------------------------------------------------------------------------
  62.   # * Alias Listing
  63.   #--------------------------------------------------------------------------
  64.   alias_method :menu_transparency_main, :initialize
  65.   #--------------------------------------------------------------------------
  66.   # * Aliased method: initialize
  67.   #--------------------------------------------------------------------------
  68.   def initialize(*args)
  69.     menu_transparency_main(*args)
  70.     self.opacity = 180 if $scene.instance_variable_get(:@menu_transparency)
  71.   end
  72. end
  73.  
  74. Transparency::Scene.each {|scene| scene.menu_transparency }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement