Advertisement
Zouzaka

Crédits dans le Menu

Feb 9th, 2014
245
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 1.28 KB | None | 0 0
  1. #================================================================
  2. #Astuce Menu by Zouzaka
  3. #================================================================
  4. #Nom de la nouvelle commande
  5. New_Cmd = "Crédits"
  6. #Position X de la fenetre
  7. PosX = 0
  8. #Position Y de la fenetre
  9. PosY = 0
  10. #Pour ajouter un text
  11. Text = ["Ligne 1","Ligne 2"]
  12. class Window_TitleCommand
  13.   def update_placement
  14.     self.x = PosX
  15.     self.y = PosY
  16.   end
  17.   alias :old_make_command_list :make_command_list
  18.   def make_command_list
  19.     old_make_command_list
  20.     add_command(New_Cmd, :astuce)
  21.   end
  22. end
  23. class Scene_Title
  24.   alias :old_create_command_window :create_command_window
  25.   def create_command_window
  26.     old_create_command_window
  27.     @command_window.set_handler(:astuce, method(:command_astuce))
  28.     @window_credit = Window_Base.new(Graphics.width/4,0,Graphics.width/2,Graphics.height)
  29.     @window_credit.openness = 0
  30.   end
  31.   def command_astuce
  32.     close_command_window
  33.     @window_credit.open
  34.     Text.each{|t| @window_credit.contents.draw_text(0, 25*Text.index(t), 190, 25, t)}
  35.   end
  36.   def update
  37.     super
  38.     if @window_credit.open? && (Input.press?(:C) or Input.press?(:B))
  39.       Sound.play_cancel
  40.       @window_credit.close
  41.       @command_window.open ; @command_window.activate
  42.     end
  43.   end
  44. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement