Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ####
- # License Terms
- ##
- # Copyright (c) 2014 Zeriab
- #
- # This software is provided 'as-is', without any express or implied warranty.
- # In no event will the authors be held liable for any damages arising from the
- # use of this software.
- #
- # Permission is granted to anyone to use this software for any purpose, including
- # commercial applications, and to alter it and redistribute it freely, subject to
- # the following restrictions:
- # 1. The origin of this software must not be misrepresented; you must not
- # claim that you wrote the original software. If you use this software in
- # a product, an acknowledgment in the product documentation would be
- # appreciated but is not required.
- # 2. Altered source versions must be plainly marked as such, and must not be
- # misrepresented as being the original software.
- # 3. This notice may not be removed or altered from any source distribution.
- #
- module DebugMode
- module_function
- def test_method
- # Example code
- $game_switches[1] = !$game_switches[1]
- $game_map.need_refresh = true
- end
- end
- #=============================================================================
- # ** Module Graphics
- #=============================================================================
- module Input
- class << self
- #-------------------------------------------------------------------------
- # * Aliases Input.update
- #-------------------------------------------------------------------------
- unless self.method_defined?(:zeriab_debug_map_update)
- alias_method(:zeriab_debug_map_update, :update)
- end
- #-------------------------------------------------------------------------
- # Change the update method so holding Z+X+C down triggers a teleport
- #-------------------------------------------------------------------------
- def update(*args)
- zeriab_debug_map_update(*args)
- return unless $DEBUG || $TEST
- @counter ||= 0
- if press?(A) && press?(B) && press?(C)
- @counter += 1
- else
- @counter = 0
- end
- if @counter >= 180
- # Teleport to special debug map
- if $game_system
- if $data_system.respond_to?(:decision_se)
- $game_system.se_play($data_system.decision_se)
- else
- Sound.play_ok
- end
- end
- @counter = 0
- DebugMode.test_method
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement