TheoAllen

Theo - Typing Help Window

May 31st, 2014
541
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 2.06 KB | None | 0 0
  1. # =============================================================================
  2. # TheoAllen - Typing Help Window
  3. # Version : 1.0
  4. # Contact : www.rpgmakerid.com (or) http://theolized.blogspot.com
  5. # (English Documentation)
  6. # =============================================================================
  7. ($imported ||= {})[:Theo_TypingHelp] = true
  8. # =============================================================================
  9. # Change Logs :
  10. # -----------------------------------------------------------------------------
  11. # 2014.03.30 - Finished script
  12. # =============================================================================
  13. =begin
  14.  
  15.   Introduction :
  16.   This script give you typing effect on help window just like message window
  17.  
  18.   How to use :
  19.   Put this script below material but above main. It's plug and play
  20.  
  21.   Terms of use :
  22.   Credit me, TheoAllen. You are free to edit this script by your own. As long
  23.   as you don't claim it yours. For commercial purpose, don't forget to give me
  24.   a free copy of the game.
  25.  
  26. =end
  27. # =============================================================================
  28. # No config ~
  29. # =============================================================================
  30. class Window_Help
  31.  
  32.   def refresh
  33.     contents.clear
  34.     @fiber = Fiber.new { update_typing }
  35.   end
  36.  
  37.   alias theo_typinghelp_update update
  38.   def update
  39.     theo_typinghelp_update
  40.     @fiber.resume if @fiber
  41.   end
  42.  
  43.   alias theo_typinghelp_process_char process_character
  44.   def process_character(*args)
  45.     theo_typinghelp_process_char(*args)
  46.     Fiber.yield
  47.   end
  48.  
  49.   def update_typing
  50.     draw_text_ex(4, 0, @text)
  51.     @fiber = nil
  52.   end
  53.  
  54. end
  55.  
  56. if $imported["YEA-BattleEngine"]
  57. class Window_BattleHelp
  58.  
  59.   alias theo_yea_ref_battlername refresh_battler_name
  60.   def refresh_battler_name(battler)
  61.     @fiber = nil
  62.     theo_yea_ref_battlername(battler)
  63.   end
  64.  
  65.   alias theo_yea_ref_special_case refresh_special_case
  66.   def refresh_special_case(battler)
  67.     @fiber = nil
  68.     theo_yea_ref_special_case(battler)
  69.   end
  70.  
  71. end
  72. end
Advertisement
Add Comment
Please, Sign In to add comment