[VX Ace]Screen stays tinted during battle

So, several of my maps are set in caves or basements.  As such, I evented it up to where the screen would tint "Dark" while in these maps.


Then I went to start putting in random battles, and the battles are Dark-tinted too.  This isn't good.


Is there a way to make it so maps are Dark, but battles aren't?
The only way I know is with this script


Code:
#=================================================
# No battle Screen Tint
#--------------------------------------------

class Spriteset_Battle
  TINT_SWITCH = 0      #<--- Switch ID

  # If switch is ON, the battle will use the map's tint
  # If switch is OFF, the battle will not use a tint
  # You can also leave the switch ID at 0 to disable battle tints altogether.

  def update_viewports
          unless $game_switches[TINT_SWITCH]
          @viewport1.tone.set(0, 0, 0, 0)
          else
          @viewport1.tone.set($game_troop.screen.tone)
          end
        @viewport1.ox = $game_troop.screen.shake
        @viewport2.color.set($game_troop.screen.flash_color)
        @viewport3.color.set(0, 0, 0, 255 - $game_troop.screen.brightness)
        @viewport1.update
        @viewport2.update
        @viewport3.update
  end
end

Author: Snow who said no credit was necessary, but you might want to anyway.


To use, do the usual - put below Materials and below any other battle scripts and above Main in the script editor. Choose a switch (and Name It) and change the TINT_SWITCH = 0 to that switch number.


At the beginning of your game turn the switch ON. Then, when you want to disable tints in battles, turn it OFF on the appropriate map(s). Don't forget to turn it back ON again when you leave that area. This does not affect the tint on the map(s) outside of battle.


Hmm, can't think of anything else.
This seems to have worked.  Rad. 😀
Oh wow. Thanks for that!

Original thread: https://forums.rpgmakerweb.com/threads/vx-ace-screen-stays-tinted-during-battle.74157/