Code: |
#--------------------------------------------------------------------------- # draw_choice_plus # Fenêtre de choix améliorée # Créé par Sphinx et modifié par Palbolsky #--------------------------------------------------------------------------- def draw_choice_plus(text1="",text2 ="",args=["OUI","NON"],index_cancel=-1) if $game_temp.message_text != nil return false end if args.size > 7 and $DEBUG print("La commande draw_choice_plus ne peut contenir que 7 arguments maximum. Les arguments 8 à #{args.size} sont donc effacés.") for i in 7...args.size args[i] = nil end args.compact! end window = Window_Command.new(1, args, $fontsizebig) width = [] for i in 0...args.size width.push(window.contents.text_size(args[i]).width) end width = width.max + 16 window.dispose @dummy = Sprite.new @dummy.bitmap = RPG::Cache.picture($options[5]) @dummy.x = 15 @dummy.y = 158 @dummy.z = 9999 @command = Window_Command.new(width + 32, args, $fontsizebig) @command.x = 235 - width @command.y = 124 - (15 * args.size) @command.z = 10000 @texte = Window_Base.new(0, 132, 250, 400) @texte.z = 10002 @texte.opacity = 0 @texte.contents = Bitmap.new(608, 412) @texte.contents.font.name = "Pokemon Emerald" @texte.contents.font.size = $fontsize @texte.draw_text(13, 8, 212, 32, text1) @texte.draw_text(13, 24, 212, 32, text2) $game_variables[15] = 1 $game_variables[14] = 2 loop do Graphics.update Input.update @command.update if Input.trigger?(Input::C) and @command.index != index_cancel $draw_choice_plus = @command.index @command.dispose @texte.dispose @dummy.dispose $game_variables[15] = 0 if not $game_variables[15] == 2 @command = nil @dummy = nil @texte = nil @wait_count = 2 return $draw_choice_plus elsif Input.trigger?(Input::B) and index_cancel == -1 $game_system.se_play($data_system.buzzer_se) @wait_count = 2 elsif Input.trigger?(Input::B) or (Input.trigger?(Input::C) and @command.index == index_cancel) $draw_choice_plus = index_cancel @command.dispose @texte.dispose @dummy.dispose $game_variables[15] = 0 if not $game_variables[15] == 2 @command = nil @dummy = nil @texte = nil @wait_count = 2 return $draw_choice_plus end end end |
Code: |
window = Window_Base(160, 120, 320, 240) file = File.open("MaSauvegarde.rxdata", "wb") Marshal.dump(window, file) # <= Erreur : "no marshal_dump is defined for class Window_Base" file.close # Ne sera jamais exécuté, puisque la ligne précédente aura planté |