Advertisement
Black_Mage

Skip Message Feature RMVXA Script

Apr 23rd, 2015 (edited)
814
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 4.27 KB | None | 0 0
  1. #==============================================================================
  2. # ** Skip Message Script by Black Mage
  3. # Version: 1.5
  4. #
  5. # https://burningwizard.wordpress.com/2015/04/23/skip-message-feature-script-rmvxace-rgss3/
  6. #
  7. #==============================================================================
  8. # With this you can skip messages by pressing CTRL.
  9. #==============================================================================
  10.  
  11. =begin
  12. #==============================================================================
  13. # MIT License
  14. #==============================================================================
  15. Copyright 2015-2023 Black Mage
  16.  
  17. Permission is hereby granted, free of charge, to any person obtaining a copy of
  18. this software and associated documentation files (the “Software”), to deal in
  19. the Software without restriction, including without limitation the rights to use,
  20. copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
  21. Software, and to permit persons to whom the Software is furnished to do so,
  22. subject to the following conditions:
  23.  
  24. The above copyright notice and this permission notice shall be included in all
  25. copies or substantial portions of the Software.
  26.  
  27. THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  28. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
  29. FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
  30. COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
  31. IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  32. CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  33. #==============================================================================
  34. =end
  35.  
  36. #==============================================================================
  37. # Changelog
  38. #==============================================================================
  39. # Version 1.5
  40. #   - Add compatibility with Regendo's Menu While Message.
  41. #   - Add compatibility with MKXP.
  42. #
  43. # Version 1.4
  44. #   - Integrate the script to $imported.
  45. #
  46. # Version 1.3
  47. #   - Add compatibility with Vlue's Basic Mouse System.
  48. #
  49. # Version 1.2
  50. #   - Simplify the codes.
  51. #
  52. # Version 1.1
  53. #   - Gave the script some enhanced performance.
  54. #
  55. # Version 1.0
  56. #   - Initial version.
  57. #==============================================================================
  58.  
  59. #==============================================================================
  60. # Notes
  61. #==============================================================================
  62. # 1. If you're using Vlue's Basic Mouse System, put this script below it.
  63. # 2. If you're using Regendo's Menu While Message, put this script below it.
  64. #==============================================================================
  65.  
  66. #------------------------------------------------------------------------------
  67. # * Beyond this is the sacred land of code. You need programming qualification
  68. #   to dwelve deeper, or it'll cause many unnecessary problems. Proceed on your
  69. #   own risk.
  70. #------------------------------------------------------------------------------
  71.  
  72. $imported = {} if $imported.nil?
  73. $imported["BLACK_MAGE-SkipMessage"] = true
  74.  
  75. class Window_Message < Window_Base
  76.   # Redefine input_pause method.
  77.   def input_pause
  78.     self.pause = true; wait(10)
  79.     # Check if Regendo's module is defined.
  80.     if defined?(Regendo)
  81.       case BUTTON
  82.       when Input::B
  83.         Fiber.yield until Input.trigger?(:C) || Input.press?(:CTRL)
  84.       when Input::C
  85.         Fiber.yield until Input.trigger?(:B)|| Input.press?(:CTRL)
  86.       else
  87.         Fiber.yield until Input.trigger?(:B) || Input.trigger?(:C)|| Input.press?(:CTRL)
  88.       end
  89.     #check if Vlue's Mouse module is defined.
  90.     elsif defined?(Mouse)
  91.       Fiber.yield until Input.trigger?(:B) || Input.trigger?(:C) || Input.press?(:CTRL) || Mouse.lclick?
  92.     else
  93.       Fiber.yield until Input.trigger?(:B) || Input.trigger?(:C) || Input.press?(:CTRL)
  94.     end
  95.     Input.update; self.pause = false
  96.   end
  97.   alias skip_u_s_f update_show_fast
  98.   def update_show_fast; Input.press?(:CTRL) ? @show_fast = true : skip_u_s_f; end
  99.   alias skip_wait wait
  100.   def wait(duration); return if Input.press?(:CTRL); skip_wait(duration); end
  101. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement