Code: |
#----------------------------------------------------------------------------- # draw_choice # Fenêtre de choix Oui, non #----------------------------------------------------------------------------- def draw_choice(arg1 = "OUI", arg2 = "NON") window = Window_Command.new(1, [arg1, arg2], $fontsizebig) width = [window.contents.text_size(arg1).width, window.contents.text_size(arg2).width].max + 16 window.dispose @command = Window_Command.new(width + 32, [arg1, arg2], $fontsizebig) @command.x = 605 - width @command.y = 215 @command.z = 10000 loop do Graphics.update Input.update @command.update if Input.trigger?(Input::C) and @command.index == 0 @command.dispose @command = nil #Input.update @wait_count = 2 return true elsif Input.trigger?(Input::C) and @command.index == 1 @command.dispose @command = nil #Input.update @wait_count = 2 return false elsif Input.trigger?(Input::B) @command.dispose @command = nil #Input.update @wait_count = 2 return false end end end |
Code: |
def marchand_pco_ct(arg1 = "CT85 10PCo", arg2 = "CT44 20PCo", arg3 = "CT61 20PCo", arg4 = "CT38 30PCo", arg5 = "Quitter") window = Window_Command.new(1, [arg1, arg2, arg3, arg4, arg5], $fontsizebig) width = [window.contents.text_size(arg1).width, window.contents.text_size(arg2).width, window.contents.text_size(arg3).width, window.contents.text_size(arg4).width, window.contents.text_size(arg5).width].max + 16 window.dispose @command = Window_Command.new(width + 32, [arg1, arg2, arg3, arg4, arg5], $fontsizebig) @command.x = 605 - width @command.y = 86 loop do Graphics.update Input.update @command.update if Input.trigger?(Input::C) and @command.index == 0 $game_variables[516] = 1 @command.dispose @command = nil #Input.update @wait_count = 2 return true end if Input.trigger?(Input::C) and @command.index == 1 $game_variables[516] = 2 @command.dispose @command = nil #Input.update @wait_count = 2 return true end if Input.trigger?(Input::C) and @command.index == 2 $game_variables[516] = 3 @command.dispose @command = nil #Input.update @wait_count = 2 return true end if Input.trigger?(Input::C) and @command.index == 3 $game_variables[516] = 4 @command.dispose @command = nil #Input.update @wait_count = 2 return true end if Input.trigger?(Input::C) and @command.index == 4 @command.dispose @command = nil #Input.update @wait_count = 2 return false end end end |