Code: |
#----------------------------------------------------------------------------- # draw_choice_plus3 # Fenêtre de choix 1 / 2 / 3 récupéré dans une variable # Par TouzaxA, à partir du travail de Krosk #----------------------------------------------------------------------------- def draw_choice_plus3(arg1 = "", arg2 = "", arg3 = "", text1 = "", text2 = "", value = ["1","2","3"]) window = Window_Command.new(1, [arg1, arg2, arg3], $fontsizebig) width = [window.contents.text_size(arg1).width, window.contents.text_size(arg2).width, window.contents.text_size(arg3).width].max + 12 window.dispose @command = Window_Command.new(width + 27, [arg1, arg2, arg3], $fontsizebig) @command.x = 363 - 123 - width @command.y = 94 @command.z = 10000 @command.visible = false $textAffichage = false if text1 != "" || text2 != "" @dummy = Sprite.new @dummy.bitmap = RPG::Cache.picture($options[5]) @dummy.x = 15 @dummy.y = 158 @dummy.z = 9999 $textAffichage = true end @background = Sprite.new @background.bitmap = RPG::Cache.picture("draw_choice3") @background.x = 13 @background.y = 227 @background.z = 10001 @curseur = Sprite.new @curseur.bitmap = RPG::Cache.picture("cursor_choice") @curseur.x = 13 @curseur.y = 277 @curseur.z = 10002 @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_contour(19, 112, 212, 32, arg1, 1) @texte.draw_text_contour(19, 160, 212, 32, arg2, 1) @texte.draw_text_contour(19, 207, 212, 32, arg3, 1) @texte.draw_text(13, 8, 218, 32, text1) @texte.draw_text(13, 24, 218, 32, text2) $game_variables[15] = 1 $game_variables[14] = 2 loop do Graphics.update Input.update @command.update if @command.index == 0 @curseur.x = 13 @curseur.y = 253 elsif @command.index == 1 @curseur.x = 13 @curseur.y = 299 elsif @command.index == 2 @curseur.x = 13 @curseur.y = 347 end if Input.trigger?(Input::C) and @command.index == 0 @command.dispose @background.dispose @curseur.dispose @texte.dispose if $textAffichage @dummy.dispose @dummy = nil end $game_variables[15] = 0 if not $game_variables[15] == 2 @command = nil @background = nil @curseur = nil @texte = nil @wait_count = 2 return value[0] end if Input.trigger?(Input::C) and @command.index == 1 @command.dispose @background.dispose @curseur.dispose @texte.dispose if $textAffichage @dummy.dispose @dummy = nil end $game_variables[15] = 0 if not $game_variables[15] == 2 @command = nil @background = nil @curseur = nil @texte = nil @wait_count = 2 return value[1] end if Input.trigger?(Input::C) and @command.index == 2 @command.dispose @background.dispose @curseur.dispose @texte.dispose if $textAffichage @dummy.dispose @dummy = nil end $game_variables[15] = 0 if not $game_variables[15] == 2 @command = nil @background = nil @curseur = nil @texte = nil @wait_count = 2 return value[2] end end end |
Code: |
$game_variables[NumeroDeVariable] = draw_choice_plus3("Choix 1", "Choix 2", "Choix 3") |
Code: |
$game_variables[NumeroDeVariable] = draw_choice_plus3("Choix 1", "Choix 2", "Choix 3", "Ligne 1 description", "Ligne 2 description") |
Code: |
$game_variables[NumeroDeVariable] = draw_choice_plus3("Choix 1", "Choix 2", "Choix 3", "Ligne 1 description", "Ligne 2 description", ["Valeur 1", "Valeur 2", "Valeur 3"]) |
Code: |
class Game_Variable def void initialize() int* data=(int*)calloc($data_system->variables.size,4) malloc_error(data) end def int Game_Variables::operator[] (const int index) return data[index] end def int Game_Variables::operator[]= (const int index,int value) return data[index]=value end end |
Code: |
$game_variables[200] = draw_choice_plus3("Choix 1", "Choix 2", "Choix 3") |