Advertisement
Vlue

Adafadqw dw qac

Jan 10th, 2015
405
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.87 KB | None | 0 0
  1. class Scene_Battle
  2.   alias skill_win_start start
  3.   def start(*args)
  4.     skill_win_start(*args)
  5.     @skill_note_window = Window_BattleSkillNote.new
  6.   end
  7.   alias blahblah_use_item
  8.   def use_item
  9.     item = @subject.current_action.item
  10.     return unless item
  11.     @skill_note_window.set_text(@subject.name + ": " + item.name)
  12.     blahblah_use_item
  13.   end
  14. end
  15.  
  16. class Window_BattleSkillNote < Window_Base
  17.   def initialize
  18.     super(0,12,100,48)
  19.     self.openness = 0
  20.   end
  21.   def set_text(text)
  22.     activate
  23.     self.width = text_size(text).width * 1.5 + 48
  24.     self.x = (Graphics.width - self.width) / 2
  25.     create_contents
  26.     contents.clear
  27.     draw_text(0,0,contents.width,24,text,1)
  28.     open
  29.     @timer = 60
  30.   end
  31.   def update
  32.     super
  33.     deactivate if close?
  34.     return unless open?
  35.     @timer -= 1 if @timer > 0
  36.     close if @timer == 0
  37.   end
  38. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement