Bitmap and Window objects do not have a tone attribute. Only Sprite and Viewport objects have the tone attribute. When the Game_Screen's tone changes only viewport1 of a Spriteset_Map instance is affected. The good news is that Window's can be assigned to a Viewport. If we tie your HUD to viewport1 of the Spriteset_Map object we can get the window to change tone with the rest of the screen. To do this in code is pretty simple. First we need to alter Window_Base so it takes in an extra parameter which will be the Viewport we need to assign the Window to. So let's override Window_Base's initialize:
#==============================================================================
# ** Window_Base
#------------------------------------------------------------------------------
# This class is for all in-game windows.
#==============================================================================
class Window_Base < Window
#--------------------------------------------------------------------------
# * Object Initialization !OVERRIDE!
# x : window x-coordinate
# y : window y-coordinate
# width : window width
# height : window height
#--------------------------------------------------------------------------
def initialize(x, y, width, height, viewport = nil)
viewport.nil? ? super() : super(viewport)
@windowskin_name = $game_system.windowskin_name
self.windowskin = RPG::Cache.windowskin(@windowskin_name)
self.x = x
self.y = y
self.width = width
self.height = height
self.z = 100
end
end
This will not break any existing code it only allows for the specification of an additional parameter. If the viewport is given, great the window will use it. If not the window will function like it always did. Next we need access to the viewport1 object inside Spriteset_Map. As that is the Viewport affected by $game_screen.tone.
#==============================================================================
# ** Spriteset_Map
#------------------------------------------------------------------------------
# This class brings together map screen sprites, tilemaps, etc.
# It's used within the Scene_Map class.
#==============================================================================
class Spriteset_Map
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_reader :viewport1
end
Next you will need to change the way you initialize Window_HUD. We need it to take in one single argument. That being a Viewport object. I don't know your code so forgive me on this next part. Change the method definition line from:
to:
def initialize(viewport = nil)
Then change the call from something like this:
super(x, y, width, height)
to:
super(x, y, width, height, viewport)
The final result of modifying your HUD's initialize will resemble something like this:
class Window_HUD < Window_Base
def initialize(viewport = nil)
super(x, y, width, height, viewport)
... # Other code
end
end
Finally we need to make sure the HUD object when its created uses the viewport. Sadly we need to override Scene_Map's main. There's no other way around it. If we alias main like I assume is how you are doing it currently the Spriteset_Map object doesn't exist when we need it. Thus its viewport won't exist. So now we need to create our HUD after the Spriteset_Map object is created.
#==============================================================================
# ** Scene_Map
#------------------------------------------------------------------------------
# This class performs map screen processing.
#==============================================================================
class Scene_Map
#--------------------------------------------------------------------------
# * Main Processing !OVERRIDE!
#--------------------------------------------------------------------------
def main
# Make sprite set
@spriteset = Spriteset_Map.new
# Create our HUD object
@hud = Window_HUD.new(@spriteset.viewport1)
# Make message window
@message_window = Window_Message.new
# Transition run
Graphics.transition
# Main loop
loop do
# Update game screen
Graphics.update
# Update input information
Input.update
# Frame update
update
# Abort loop if screen is changed
if $scene != self
break
end
end
# Prepare for transition
Graphics.freeze
# Dispose of sprite set
@spriteset.dispose
# Dispose of message window
@message_window.dispose
# Dispose of the HUD.
@hud.dispose
# If switching to title screen
if $scene.is_a?(Scene_Title)
# Fade out screen
Graphics.transition
Graphics.freeze
end
end
end
Hope that helps. If you need further assistance just let me know.
Good luck with it Fallen! :thumb: