Le Deal du moment : -20%
Ecran PC GIGABYTE 28″ LED M28U 4K ( IPS, 1 ms, ...
Voir le deal
399 €

Aller en bas
Korndor
Korndor
Staffeux retraité

Nombre de messages : 4959
Age : 110
Localisation : Erem Vehyx
Distinction : Champion de boxe et au lit ! :O [Wax]
Être Mythique [Mister]
Papi Korndor qui a l'ostéoporose [Skillo]
Soldat Ikéa [Coco']
Un bonhomme, un vrai ! [Neresis]
Vieillard acariâtre [Didier Gustin]
Date d'inscription : 16/12/2007
https://www.rpgmakervx-fr.com/

Confirmation de Sauvegarde Empty Confirmation de Sauvegarde

Mar 26 Fév 2008 - 10:31
Auteur Waratana
Nom du script Save File Confirmation (Confirmation de sauvegarde)

Script à placer au dessus du script main.
Avant que la partie soit sauvegardée, il faut confirmer.




Code:
#==============================================================================
# [VX] Save File Confirmation
#------------------------------------------------------------------------------
# by Woratana
# Released on: 15/02/2008
#
# Make a Confirmation Window before save file...
#==============================================================================

#===============================================================
#                         
#                rpgmakervx.1fr1.net                                         
#     
#===============================================================

module Worale
  SFC_Text_Confirm = 'Sauvegarder...' # Text to confirm to save file
  SFC_Text_Cancel = 'Annuler' # Text to cancel to save

  SFC_Window_Width = 200 # Width of Confirmation Window
  SFC_Window_X_Offset = 0 # Move Confirmation Window horizontally
  SFC_Window_Y_Offset = 0 # Move Confirmation Window vertically
end


class Scene_File < Scene_Base
  def update
    super
    if !@confirm_window.nil?
      @confirm_window.update
      if Input.trigger?(Input::C)
        if @confirm_window.index == 0
          determine_savefile
          @confirm_window.dispose
          @confirm_window = nil
        else
          Sound.play_cancel
          @confirm_window.dispose
          @confirm_window = nil
        end
      elsif Input.trigger?(Input::B)
      Sound.play_cancel
      @confirm_window.dispose
      @confirm_window = nil
      end
    else
    update_menu_background
    @help_window.update
    update_savefile_windows
    update_savefile_selection
    end
  end
 
  def update_savefile_selection
    if Input.trigger?(Input::C)
      if @saving
      text1 = Worale::SFC_Text_Confirm
      text2 = Worale::SFC_Text_Cancel
      @confirm_window = Window_Command.new(Worale::SFC_Window_Width,[text1,text2])
      @confirm_window.x = ((544 - @confirm_window.width) / 2) + Worale::SFC_Window_X_Offset
      @confirm_window.y = ((416 - @confirm_window.height) / 2) + Worale::SFC_Window_Y_Offset
      else
      determine_savefile
      end
    elsif Input.trigger?(Input::B)
      Sound.play_cancel
      return_scene
    else
      last_index = @index
      if Input.repeat?(Input::DOWN)
        cursor_down(Input.trigger?(Input::DOWN))
      end
      if Input.repeat?(Input::UP)
        cursor_up(Input.trigger?(Input::UP))
      end
      if @index != last_index
        Sound.play_cursor
        @savefile_windows[last_index].selected = false
        @savefile_windows[@index].selected = true
      end
    end
  end
end
Revenir en haut
Permission de ce forum:
Vous ne pouvez pas répondre aux sujets dans ce forum