TheoAllen

Theo - Message Wait Skip

Nov 10th, 2013
361
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 3.98 KB | None | 0 0
  1. # =============================================================================
  2. # TheoAllen - Message Wait Skip
  3. # Version : 1.0
  4. # Contact : www.rpgmakerid.com (or) http://theolized.blogspot.com
  5. # (This script documentation is written in informal indonesian language)
  6. # =============================================================================
  7. ($imported ||= {})[:Theo_MsgWaitSkip] = true
  8. # =============================================================================
  9. # Change Logs:
  10. # -----------------------------------------------------------------------------
  11. # 2013.10.24 - Finished Script
  12. # =============================================================================
  13. =begin
  14.  
  15.   Perkenalan :
  16.   Di dalam message, kita bisa skip pengetikan tulisan dengan mencet tombol
  17.   konfirm. Tapi kita ngga bisa skip message yang emang seharusnya wait seperti
  18.   kode-kode macem \. ato \|
  19.  
  20.   Nah, kalo di sebuah konversasi atau show text (macem intro) kebanyakan kode
  21.   untuk nunggu, kan ngga bisa diskip juga. Script ini ngebikin kamu bisa skip
  22.   wait biar ngga kelamaan nunggu
  23.  
  24.   Cara penggunaan :
  25.   Pasang script ini dibawah material dan diatas semua script yang berhubungan
  26.   dengan message. Kalo make script basic modul gw, taruh diatasnya juga
  27.  
  28.   Terms of use :
  29.   Credit gw, TheoAllen. Kalo semisal u bisa ngedit2 script gw trus jadi lebih
  30.   keren, terserah. Ane bebasin. Asal ngga ngeklaim aja. Kalo semisal mau
  31.   dipake buat komersil, jangan lupa, gw dibagi gratisannya.    
  32.  
  33. =end
  34. # =============================================================================
  35. class Window_Message < Window_Base # <-- Jangan disentuh
  36. # =============================================================================
  37.  
  38.   Skip_Button = :SHIFT # <-- Ganti disini buttonnya
  39.  
  40. # Kalo mau liat list buttonnya ada apa aja, coba buka helpfile
  41. # RGSS Reference > Game Library > RGSS Built-in Module > Input
  42. # Lihat paling bawah sendiri
  43.  
  44. # =============================================================================
  45. # Setelah ini jangan coba-coba ganti kecuali elu ngerti
  46. # =============================================================================
  47.   # ---------------------------------------------------------------------------
  48.   # Overwrite process escape character
  49.   # ---------------------------------------------------------------------------
  50.   def process_escape_character(code, text, pos)
  51.     case code.upcase
  52.     when '$'
  53.       @gold_window.open
  54.     when '.'
  55.       command_wait(15) unless @skip_wait
  56.     when '|'
  57.       command_wait(60) unless @skip_wait
  58.     when '!'
  59.       input_pause
  60.     when '>'
  61.       @line_show_fast = true
  62.     when '<'
  63.       @line_show_fast = false
  64.     when '^'
  65.       @pause_skip = true
  66.     else
  67.       super
  68.     end
  69.   end
  70.   # ---------------------------------------------------------------------------
  71.   # Overwrite update show fast
  72.   # ---------------------------------------------------------------------------
  73.   def update_show_fast
  74.     @show_fast = true if Input.trigger?(:C) || Input.trigger?(Skip_Button)
  75.   end
  76.   # ---------------------------------------------------------------------------
  77.   # New method. Command wait for escape code
  78.   # ---------------------------------------------------------------------------
  79.   def command_wait(duration)
  80.     duration.times do
  81.       Fiber.yield
  82.       update_skip_wait
  83.       return if @skip_wait
  84.     end
  85.   end
  86.   # ---------------------------------------------------------------------------
  87.   # New method. Skip check for escape code
  88.   # ---------------------------------------------------------------------------
  89.   def update_skip_wait
  90.     @skip_wait = true if Input.trigger?(Skip_Button)
  91.   end
  92.   # ---------------------------------------------------------------------------
  93.   # Aliased method, clear flags
  94.   # ---------------------------------------------------------------------------
  95.   alias theo_skip_wait_clear_flags clear_flags
  96.   def clear_flags
  97.     theo_skip_wait_clear_flags
  98.     @skip_wait = false
  99.   end
  100. end
Advertisement
Add Comment
Please, Sign In to add comment