Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Screen Tint Debugger
#1
Screen Tint Debug Menu

Introduction

This is a script that lets you play with screen tint in a special debug mode.


Script

Code:
#-------------------------------------------------------------------------------
#  Screen Tint Debug Menu by Leon_Westbrooke
#-------------------------------------------------------------------------------
#  This scene allows you, in Debug mode, tamper with the map's tone until you
#  find a desired coloring.
#  It will NOT set the tone for you automatically.  Instead, record the numbers
#  and use them in a change screen tone event.  However, this should cut down
#  on countless testing of the screen's tint.
#
#  To use:
#    Plug the script into your game's script archive.
#    To access it, go into debug mode (F12) and press F8 to access the menu.
#    Use the arrow keys to change the maps tone.
#-------------------------------------------------------------------------------


#-------------------------------------------------------------------------------
#  *  Game_Temp
#-------------------------------------------------------------------------------
class Game_Temp
  alias leon_stdm_gametemp_init initialize
  
  attr_accessor :tinttest_red
  attr_accessor :tinttest_green
  attr_accessor :tinttest_blue
  attr_accessor :tinttest_gray
  
  def initialize
    leon_stdm_gametemp_init
    @tinttest_red = 0
    @tinttest_green = 0
    @tinttest_blue = 0
    @tinttest_gray = 0
  end
end
#-------------------------------------------------------------------------------
# END Game_Temp
#-------------------------------------------------------------------------------


#-------------------------------------------------------------------------------
#  *  Spriteset_Map
#-------------------------------------------------------------------------------
class Spriteset_Map
  attr_accessor :viewport1
end

class Game_Screen
  attr_accessor :tone
end
#-------------------------------------------------------------------------------
# END Spriteset_Map
#-------------------------------------------------------------------------------


#-------------------------------------------------------------------------------
#  *  Scene_Map
#-------------------------------------------------------------------------------
class Scene_Map
  
  alias leon_stdm_scenemap_update update

  def update
    leon_stdm_scenemap_update
    if $DEBUG and Input.press?(Input::F8)
      $scene = Scene_TintDebug.new
    end
  end
end
#-------------------------------------------------------------------------------
# END Scene_Map
#-------------------------------------------------------------------------------


#-------------------------------------------------------------------------------
#  *  Window_TintTest
#-------------------------------------------------------------------------------
class Window_TintTest < Window_Selectable
  def initialize
    super(0, 0, 192, 192)
    self.contents = Bitmap.new(width - 32, height - 32)
    @item_max = 5
    self.index = 0
    self.active = true
    refresh
  end
  
  def refresh
    self.contents.clear
    self.contents.draw_text(4, 0, 160, 32, "Red")
    self.contents.draw_text(4, 32, 160, 32, "Green")
    self.contents.draw_text(4, 64, 160, 32, "Blue")
    self.contents.draw_text(4, 96, 160, 32, "gray")
    self.contents.draw_text(4, 128, 160, 32, "Exit")
    self.contents.draw_text(-4, 0, 160, 32, $game_temp.tinttest_red.to_s, 2)
    self.contents.draw_text(-4, 32, 160, 32, $game_temp.tinttest_green.to_s, 2)
    self.contents.draw_text(-4, 64, 160, 32, $game_temp.tinttest_blue.to_s, 2)
    self.contents.draw_text(-4, 96, 160, 32, $game_temp.tinttest_gray.to_s, 2)
  end
end
#-------------------------------------------------------------------------------
# END Window_TintTest
#-------------------------------------------------------------------------------


#-------------------------------------------------------------------------------
#  *  Scene_TintDebug
#-------------------------------------------------------------------------------
class Scene_TintDebug
  def main
    @spriteset = Spriteset_Map.new
    $game_temp.tinttest_red = @spriteset.viewport1.tone.red.to_i
    $game_temp.tinttest_green = @spriteset.viewport1.tone.green.to_i
    $game_temp.tinttest_blue = @spriteset.viewport1.tone.blue.to_i
    $game_temp.tinttest_gray = @spriteset.viewport1.tone.gray.to_i
    @window_tint = Window_TintTest.new
    
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
    Graphics.freeze
    @window_tint.dispose
    @spriteset.dispose
  end
  
  
  def update
    if Input.trigger?(Input::B)
      $scene = Scene_Map.new
    end
    
    if @window_tint.active
      update_windowtint
      return
    end
  end
  
  def update_windowtint
    @window_tint.update
    case @window_tint.index
    when 0
      if Input.trigger?(Input::RIGHT)
        $game_temp.tinttest_red += 1
        if $game_temp.tinttest_red >= 255
          $game_temp.tinttest_red = 255
        end
      elsif Input.trigger?(Input::LEFT)
        $game_temp.tinttest_red -= 1
        if $game_temp.tinttest_red <= -255
          $game_temp.tinttest_red = -255
        end
      elsif Input.repeat?(Input::RIGHT)
        $game_temp.tinttest_red += 5
        if $game_temp.tinttest_red >= 255
          $game_temp.tinttest_red = 255
        end
      elsif Input.repeat?(Input::LEFT)
        $game_temp.tinttest_red -= 5
        if $game_temp.tinttest_red <= -255
          $game_temp.tinttest_red = -255
        end
      end
    when 1
      if Input.trigger?(Input::RIGHT)
        $game_temp.tinttest_green += 1
        if $game_temp.tinttest_green >= 255
          $game_temp.tinttest_green = 255
        end
      elsif Input.trigger?(Input::LEFT)
        $game_temp.tinttest_green -= 1
        if $game_temp.tinttest_green <= -255
          $game_temp.tinttest_green = -255
        end
      elsif Input.repeat?(Input::RIGHT)
        $game_temp.tinttest_green += 5
        if $game_temp.tinttest_green >= 255
          $game_temp.tinttest_green = 255
        end
      elsif Input.repeat?(Input::LEFT)
        $game_temp.tinttest_green -= 5
        if $game_temp.tinttest_green <= -255
          $game_temp.tinttest_green = -255
        end
      end
    when 2
      if Input.trigger?(Input::RIGHT)
        $game_temp.tinttest_blue += 1
        if $game_temp.tinttest_blue >= 255
          $game_temp.tinttest_blue = 255
        end
      elsif Input.trigger?(Input::LEFT)
        $game_temp.tinttest_blue -= 1
        if $game_temp.tinttest_blue <= -255
          $game_temp.tinttest_blue = -255
        end
      elsif Input.repeat?(Input::RIGHT)
        $game_temp.tinttest_blue += 5
        if $game_temp.tinttest_blue >= 255
          $game_temp.tinttest_blue = 255
        end
      elsif Input.repeat?(Input::LEFT)
        $game_temp.tinttest_blue -= 5
        if $game_temp.tinttest_blue <= -255
          $game_temp.tinttest_blue = -255
        end
      end
    when 3
      if Input.trigger?(Input::RIGHT)
        $game_temp.tinttest_gray += 1
        if $game_temp.tinttest_gray >= 255
          $game_temp.tinttest_gray = 255
        end
      elsif Input.trigger?(Input::LEFT)
        $game_temp.tinttest_gray -= 1
        if $game_temp.tinttest_gray <= -255
          $game_temp.tinttest_gray = -255
        end
      elsif Input.repeat?(Input::RIGHT)
        $game_temp.tinttest_gray += 5
        if $game_temp.tinttest_gray >= 255
          $game_temp.tinttest_gray = 255
        end
      elsif Input.repeat?(Input::LEFT)
        $game_temp.tinttest_gray -= 5
        if $game_temp.tinttest_gray <= -255
          $game_temp.tinttest_gray = -255
        end
      end
    when 4
      if Input.trigger?(Input::C)
        $scene = Scene_Map.new
      end
    end
    red = $game_temp.tinttest_red
    green = $game_temp.tinttest_green
    blue = $game_temp.tinttest_blue
    gray = $game_temp.tinttest_gray
    @spriteset.viewport1.tone = Tone.new(red, green, blue, gray)
    $game_screen.tone = Tone.new(red, green, blue, gray)
    @window_tint.refresh
    @spriteset.update
  end
end
#-------------------------------------------------------------------------------
#  *  Scene_TintDebug
#-------------------------------------------------------------------------------

Instructions

Put this script in your game, and press f8.

Credits and Thanks
100% borrowed without permission from http://www.gdunlimited.net/forums/topic/...tone-test/ I am tired of useful scripts going missing, and having it two places means less chance of the script dissappearing without a trace!

Author's Notes

Since this overrides the default (and useful) debug menu, it might make sense to change it to a different key.

Terms and Conditions
I didn't make this! some person named Leon_Westbrooke did.
Reply }


Possibly Related Threads…
Thread Author Replies Views Last Post
   Sharina's Screen-Saves DerVVulfman 5 1,012 08-22-2023, 05:05 PM
Last Post: DerVVulfman
Smile  Soul's Better Status Screen SoulZetaformGames 7 8,766 11-11-2021, 09:20 AM
Last Post: kyonides
   Sarah's Configuration Screen DerVVulfman 3 8,248 08-10-2014, 03:38 PM
Last Post: firestalker
   Calypso Battle-Tint Control DerVVulfman 0 4,109 06-07-2012, 03:48 AM
Last Post: DerVVulfman
   Full-Screen Toggle Helladen 0 4,546 07-10-2010, 01:00 AM
Last Post: Helladen
   Main Character Select Screen Raziel 4 10,598 05-27-2010, 04:48 PM
Last Post: sakhawat21
   Screen Shake Extended DerVVulfman 0 5,409 12-31-2009, 05:16 AM
Last Post: DerVVulfman
   Title Screen Replacer + Enhancer v1.0.1 [Exclusive] PK8 1 6,152 07-03-2009, 04:19 AM
Last Post: Hsia_Nu
   Miss Laura's Transparent GameOver Screen DerVVulfman 0 4,843 03-05-2008, 06:25 PM
Last Post: DerVVulfman
   Title Screen Edit ParaDog 0 3,957 03-04-2008, 05:10 AM
Last Post: ParaDog



Users browsing this thread: