Advertisement
Black_Mage

Skip Message Feature RMXP Script

Apr 23rd, 2015
1,583
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 2.57 KB | None | 0 0
  1. class Window_Message < Window_Selectable
  2.   def update
  3.     super
  4.     # If fade in
  5.     if @fade_in
  6.       self.contents_opacity += 24
  7.       if @input_number_window != nil
  8.         @input_number_window.contents_opacity += 24
  9.       end
  10.       if self.contents_opacity == 255
  11.         @fade_in = false
  12.       end
  13.       return
  14.     end
  15.     # If inputting number
  16.     if @input_number_window != nil
  17.       @input_number_window.update
  18.       # Confirm
  19.       if Input.trigger?(Input::C)
  20.         $game_system.se_play($data_system.decision_se)
  21.         $game_variables[$game_temp.num_input_variable_id] =
  22.           @input_number_window.number
  23.         $game_map.need_refresh = true
  24.         # Dispose of number input window
  25.         @input_number_window.dispose
  26.         @input_number_window = nil
  27.         terminate_message
  28.       end
  29.       return
  30.     end
  31.     # If message is being displayed
  32.     if @contents_showing
  33.       # If choice isn't being displayed, show pause sign
  34.       if $game_temp.choice_max == 0
  35.         self.pause = true
  36.       end
  37.       # Skip feature added by Fatra
  38.       if Input.press?(Input::CTRL)
  39.         if $game_temp.choice_max > 0
  40.         else
  41.           terminate_message
  42.         end
  43.       end
  44.       # Cancel
  45.       if Input.trigger?(Input::B)
  46.         if $game_temp.choice_max > 0 and $game_temp.choice_cancel_type > 0
  47.           $game_system.se_play($data_system.cancel_se)
  48.           $game_temp.choice_proc.call($game_temp.choice_cancel_type - 1)
  49.           terminate_message
  50.         end
  51.       end
  52.       # Confirm
  53.       if Input.trigger?(Input::C)
  54.         if $game_temp.choice_max > 0
  55.           $game_system.se_play($data_system.decision_se)
  56.           $game_temp.choice_proc.call(self.index)
  57.         end
  58.         terminate_message
  59.       end
  60.       return
  61.     end
  62.     # If display wait message or choice exists when not fading out
  63.     if @fade_out == false and $game_temp.message_text != nil
  64.       @contents_showing = true
  65.       $game_temp.message_window_showing = true
  66.       reset_window
  67.       refresh
  68.       Graphics.frame_reset
  69.       self.visible = true
  70.       self.contents_opacity = 0
  71.       if @input_number_window != nil
  72.         @input_number_window.contents_opacity = 0
  73.       end
  74.       @fade_in = true
  75.       return
  76.     end
  77.     # If message which should be displayed is not shown, but window is visible
  78.     if self.visible
  79.       @fade_out = true
  80.       self.opacity -= 48
  81.       if self.opacity == 0
  82.         self.visible = false
  83.         @fade_out = false
  84.         $game_temp.message_window_showing = false
  85.       end
  86.       return
  87.     end
  88.   end
  89. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement