Partagez
Aller en bas
KyoMaudit
KyoMaudit
Membre

Nombre de messages : 236
Age : 22
Localisation : Pas de Calais
Distinction : aucune
Date d'inscription : 19/10/2014

Menu d'option Empty Menu d'option

le Sam 25 Oct 2014 - 19:27
Salut !
J'ai un petit problème dans mon projet.
Donc j'ai installé un Scripts qui rajoute dans l'écran en titre un "Options"
Menu d'option Rmvxa-vga-title-41a61e9
Et comme je le fais d'habitude, je me créer un écran en titre personnalisé en Event.
Et j'aimerai dans cette écran en titre personnalisé en Event ajouté l'onglet "Options"
Mais je ne connais pas ce qu'il faut mettre sur cet onglet pour l'ouvrir
Par exemple pour lancé l'onglet Charger j'utilise ce script :
Code:
SceneManager.call(Scene_Load)
Pour quitter j'utilise :
Code:
SceneManager.exit
Mais je ne sais pas ce qu'il faut mettre pour Options :/

Voici le script du fullscreen que j'utilise :
Code:

# ==============================================================================
# ■ VGA_SCRIPT
# ------------------------------------------------------------------------------
#   Name     : VGA Display for VX Ace
#   Type     : RGSS3 Script
#   Version  : 1.04
#   Author   : Chon
#
# This script provides a full screen support as well as a max resolution mode.
# It is also possible to define some graphics replacement for most backgrounds.
# The code includes a display informations head-up-display and a FPS counter.
# Most of features are easily switchable by the user via an options menu.
# ------------------------------------------------------------------------------
# 2013/10/19 : 1.00 - First release
# 2013/10/20 : 1.01 - Add a FPS counter
# 2013/10/22 : 1.02 - Add an options menu
# 2013/10/23 : 1.03 - Correct some constant misspelling and leftovers
# 2013/10/26 : 1.04 - Display aspect ratio support
# ------------------------------------------------------------------------------
# Place this file under the Materials section and above the Main Processs of
# your RPG Maker VX Ace for it to work properly. The lower is the better.
# ------------------------------------------------------------------------------
# ● Module                : Cache
#   ♦ Overwritten method  : system
#   ♦ Overwritten method  : title1
#   ♦ Overwritten method  : title2
#   ♦ Overwritten method  : battleback1
#   ♦ Overwritten method  : battleback2
#
# ► Built-in Class        : Graphics
#   ◊ Aliased method      : update
#
# ► Class                 : Sprite_Battler
#   ◊ Aliased method      : update_position
#
# ► Class                 : Window_TitleCommand
#   ♦ Overwritten method  : window_width
#   ♦ Overwritten method  : make_command_list
#
# ► Class                 : Scene_Map
#   ♦ Overwritten method  : perform_battle_transition
#
# ► Class                 : Scene_Title
#   ◊ Aliased method      : start
#   ◊ Aliased method      : create_command_window
#   ◊ Aliased method      : command_shutdown
#
# ► Class                 : Scene_End
#   ◊ Aliased method      : command_shutdown
# ==============================================================================

$imported ||= {}
$imported["VGA_Display_for_VX_Ace"] = 1.04

module VGA # The VGA Display for VX Ace module

  # Resolutions configuration
  LOWRES_WIDTH          = 544      # Set the low resolution width. Default = 544 (can be reduced -- but untested, use with caution)
  LOWRES_HEIGHT         = 416      # Set the low resolution height. Default = 416 (can be reduced -- but untested, use with caution)
  HIGHRES_WIDTH         = 640      # Set the high resolution width. Maximum = 640
  HIGHRES_HEIGHT        = 480      # Set the high resolution height. Maximum = 480
  KEEP_ASPECT_RATIO     = true     # Adjust high resolution to fit to user display aspect ratio. Will display black bars instead of stretching the screen.

  # Output configuration
  CONFIG_FILE_SECTION   = "VGA"    # Set the header of the Game.ini under wich the display configuration values will be put.

  # Highres files configuration
  USE_HIGHRES_FILES     = true     # Replace standard bitmap backgrounds with size increased ones.
  HIGHRES_FILES_FOLDER  = "VGA/"   # Set the location of high resolution bitmaps. Default = "Graphics/"
  HIGHRES_FILES_PREFIX  = "VGA_"   # Set the prefix of high resolution bitmap files. Default = ""

  # Default display configuration (mostly for the user's very first first boot, then Game.ini should be use).
  LAUNCH_IN_FULLSCREEN  = false    # Launch the game in fullscreen. Default = false
  LAUNCH_AT_HIGHRES     = true    # Launch the game at high resolution. Default = false
  SHOW_INFOS            = false    # Display resolution and screen mode at the top left corner of the screen. Default = false
  SHOW_FPS              = false    # Display FPS at the top right corner of the screen. Default = false

  # User display configuration
  LOAD_USER_CONFIG      = true     # Restore user display configuration from Game.ini. The constant values will be used at each game boot if this is set to false. Default = true
  SAVE_USER_CONFIG      = false    # Store user display configuration in Game.ini at shutdown and not only from options menu. This will not work if the game is shutdown with Alt+F4 shortcut or closed with window exit icon. Default = false

  # Options menu
  OPTION_CHANGE_SCR     = true     # Enable the change screen size option (i.e. switch between fullscreen and window). Default = true
  OPTION_CHANGE_RES     = true     # Enable the change resolution option (i.e. switch between high and low resolution). Default = true
  OPTION_ASPECT_RATIO   = true     # Enable the keep aspect ratio option. Default = true
  OPTION_SHOW_INFOS     = true     # Enable the show display informations option. Default = true
  OPTION_SHOW_FPS       = true     # Enable the show fps option. Default = true

  # Language
  LANG = {
  # Variable name          Localization

    # Title menu
    "go_to_options"     => "Options",
    "exit_game"         => "Quitter",

    # Options menu
    "lowres"            => "Basse résolution",
    "highres"           => "Haute résolution",
    "window"            => "Fenêtre",
    "fullscreen"        => "Plein écran",
    "aspect_ratio"      => "Format d'écran",
    "show_infos"        => "Afficher la résolution",
    "show_fps"          => "Afficher les FPS",
    "back_to_title"     => "Retour au titre",

    # Options stat
    "option_on"         => "Activé",
    "option_off"        => "Désactivé",

    # Other
    "fps"               => "FPS"
  }

# ==============================================================================
# ● VGA Display for VX Ace
# ------------------------------------------------------------------------------
# Editing anything past this title may result in heavy computer damages, death,
# stomach gases or user transformation into a gremlin. So edit at your own risk.
# ==============================================================================

  # ----------------------------------------------------------------------------
  # ♦ Constant API declarations
  # ----------------------------------------------------------------------------
  User32DLL = DL.dlopen("user32")
  User32DLL__keybd_event = DL::CFunc.new(User32DLL.sym("keybd_event"), DL::TYPE_VOID, "keybd_event", :stdcall)
  GetPrivateProfileString = Win32API.new("kernel32", "GetPrivateProfileString", "ppppip", "i")
  WritePrivateProfileString = Win32API.new("kernel32", "WritePrivateProfileString", "pppp", "i")
  GetSystemMetrics = Win32API.new("user32", "GetSystemMetrics", "i", "i")
  GetAsyncKeyState = Win32API.new("user32", "GetAsyncKeyState", "i", "i")

  # ----------------------------------------------------------------------------
  # ♦ Instance variables declarations
  # ----------------------------------------------------------------------------
  @aspect_ratio = GetSystemMetrics.call(0).to_f / GetSystemMetrics.call(1).to_f

  # ----------------------------------------------------------------------------
  # ♦ New method : i_to_bool
  #   Convert binary values into boolean values
  # ----------------------------------------------------------------------------
  def self.i_to_bool(i)
    if i == 1; i = true; elsif i == 0; i = false; else; i = nil; end
  end

  # ----------------------------------------------------------------------------
  # ♦ New method : load_vga_config
  # ----------------------------------------------------------------------------
  def self.load_vga_config
    buffer = [].pack('x256')
    section = CONFIG_FILE_SECTION
    filename = "./Game.ini"
    get_option = Proc.new do |key, default_value|
      l = GetPrivateProfileString.call(section, key, default_value, buffer, buffer.size, filename)
      buffer[0, l]
    end
    @files_folder = get_option.call("FilesFolder", "nil").to_s
    @files_prefix = get_option.call("FilesPrefix", "nil").to_s
    @files_folder = HIGHRES_FILES_FOLDER if @files_folder == "nil"
    @files_prefix = HIGHRES_FILES_PREFIX if @files_prefix == "nil"
    @files_folder.gsub!(/\\/) {|match| "/" }
    LOAD_USER_CONFIG ? @fullscreen = i_to_bool(get_option.call("Fullscreen", nil).to_i) : @fullscreen = LAUNCH_IN_FULLSCREEN
    LOAD_USER_CONFIG ? @highres = i_to_bool(get_option.call("Highres", nil).to_i) : @highres = LAUNCH_AT_HIGHRES
    LOAD_USER_CONFIG ? @keep_aspect_ratio = i_to_bool(get_option.call("AspectRatio", nil).to_i) : @keep_aspect_ratio = KEEP_ASPECT_RATIO
    LOAD_USER_CONFIG ? @show_infos = i_to_bool(get_option.call("ShowInfos", nil).to_i) : @show_infos = SHOW_INFOS
    LOAD_USER_CONFIG ? @show_fps = i_to_bool(get_option.call("ShowFPS", nil).to_i) : @show_fps = SHOW_FPS
  end

  # ----------------------------------------------------------------------------
  # ♦ New method : write_vga_config
  # ----------------------------------------------------------------------------
  def self.write_vga_config
    section = CONFIG_FILE_SECTION
    filename = "./Game.ini"
    set_option = Proc.new do |key, value|
      WritePrivateProfileString.call(section, key, value.to_s, filename)
    end
    set_option.call("FilesFolder", @files_folder)
    set_option.call("FilesPrefix", @files_prefix)
    set_option.call("Fullscreen", @fullscreen ? 1 : 0)
    set_option.call("Highres", @highres ? 1 : 0)
    set_option.call("AspectRatio", @keep_aspect_ratio ? 1 : 0)
    set_option.call("ShowInfos", @show_infos ? 1 : 0)
    set_option.call("ShowFPS", @show_fps ? 1 : 0)
  end

  # ----------------------------------------------------------------------------
  # ♦ New method : get_files_folder
  # ----------------------------------------------------------------------------
  def self.get_files_folder
    @files_folder != nil && USE_HIGHRES_FILES and @highres ? @files_folder : "Graphics/"
  end

  # ----------------------------------------------------------------------------
  # ♦ New method : get_files_prefix
  # ----------------------------------------------------------------------------
  def self.get_files_prefix
    @files_prefix != nil && USE_HIGHRES_FILES and @highres ? @files_prefix : ""
  end

  # ----------------------------------------------------------------------------
  # ♦ New method : get_fullscreen
  # ----------------------------------------------------------------------------
  def self.get_fullscreen
    @fullscreen == nil ? LAUNCH_IN_FULLSCREEN : @fullscreen
  end

  # ----------------------------------------------------------------------------
  # ♦ New method : get_highres
  # ----------------------------------------------------------------------------
  def self.get_highres
    @highres == nil ? LAUNCH_AT_HIGHRES : @highres
  end

  # ----------------------------------------------------------------------------
  # ♦ New methods : get_highres_width
  # ----------------------------------------------------------------------------
  def self.get_highres_width
    if @keep_aspect_ratio == true
      @aspect_ratio >= HIGHRES_WIDTH.to_f / HIGHRES_HEIGHT.to_f ? @highres_width = HIGHRES_WIDTH : @highres_width = (HIGHRES_HEIGHT.to_f * @aspect_ratio).to_i
    else
      @highres_width = HIGHRES_WIDTH
    end
    return @highres_width
  end

  # ----------------------------------------------------------------------------
  # ♦ New methods : get_highres_height
  # ----------------------------------------------------------------------------
  def self.get_highres_height
    if @keep_aspect_ratio == true
      @aspect_ratio >= HIGHRES_WIDTH.to_f / HIGHRES_HEIGHT.to_f ? @highres_height = (HIGHRES_WIDTH.to_f / @aspect_ratio).to_i : @highres_height = HIGHRES_HEIGHT
    else
      @highres_height = HIGHRES_HEIGHT
    end
    return @highres_height
  end

  # ----------------------------------------------------------------------------
  # ♦ New method : get_aspect_ratio
  # ----------------------------------------------------------------------------
  def self.get_aspect_ratio
    @keep_aspect_ratio == nil ? KEEP_ASPECT_RATIO : @keep_aspect_ratio
  end

  # ----------------------------------------------------------------------------
  # ♦ New method : get_show_infos
  # ----------------------------------------------------------------------------
  def self.get_show_infos
    @show_infos == nil ? SHOW_INFOS : @show_infos
  end

  # ----------------------------------------------------------------------------
  # ♦ New method : get_show_fps
  # ----------------------------------------------------------------------------
  def self.get_show_fps
    @show_fps == nil ? SHOW_FPS : @show_fps
  end

  # ----------------------------------------------------------------------------
  # ♦ New method : switch_fullscreen
  # ----------------------------------------------------------------------------
  def self.switch_fullscreen
    @fullscreen == true ? @fullscreen = false : @fullscreen = true
  end

  # ----------------------------------------------------------------------------
  # ♦ New method : toggle_fullscreen
  # ----------------------------------------------------------------------------
  def self.toggle_fullscreen
    User32DLL__keybd_event.call([0xA4, 0, 0, 0])
    User32DLL__keybd_event.call([0x0D, 0, 0, 0])
    User32DLL__keybd_event.call([0x0D, 0, 0x0002, 0])
    User32DLL__keybd_event.call([0xA4, 0, 0x0002, 0])
  end

  # ----------------------------------------------------------------------------
  # ♦ New method : switch_to_highres
  # ----------------------------------------------------------------------------
  def self.switch_to_highres
    Graphics.resize_screen(get_highres_width, get_highres_height)
    @highres = true
  end

  # ----------------------------------------------------------------------------
  # ♦ New method : switch_to_lowres
  # ----------------------------------------------------------------------------
  def self.switch_to_lowres
    Graphics.resize_screen(LOWRES_WIDTH, LOWRES_HEIGHT)
    @highres = false
  end

  # ----------------------------------------------------------------------------
  # ♦ New method : toggle_highres
  # ----------------------------------------------------------------------------
  def self.toggle_highres
    Graphics.width == LOWRES_WIDTH && Graphics.height == LOWRES_HEIGHT ? switch_to_highres : switch_to_lowres
    SceneManager.scene.reload
  end

  # ----------------------------------------------------------------------------
  # ♦ New method : toggle_aspect_ratio
  # ----------------------------------------------------------------------------
  def self.toggle_aspect_ratio
    @keep_aspect_ratio == true ? @keep_aspect_ratio = false : @keep_aspect_ratio = true
    Graphics.resize_screen(get_highres_width, get_highres_height)
    SceneManager.scene.reload
  end

  # ----------------------------------------------------------------------------
  # ♦ New method : toggle_show_infos
  # ----------------------------------------------------------------------------
  def self.toggle_show_infos
    get_show_infos == true ? @show_infos = false : @show_infos = true
  end

  # ----------------------------------------------------------------------------
  # ♦ New method : toggle_show_fps
  # ----------------------------------------------------------------------------
  def self.toggle_show_fps
    get_show_fps == true  ? @show_fps = false : @show_fps = true
  end

  # ----------------------------------------------------------------------------
  # ♦ New method : get_input_kbd
  # ----------------------------------------------------------------------------
  def self.get_input_kbd(key)
    return GetAsyncKeyState.call(key)
  end

  # ----------------------------------------------------------------------------
  # ♦ Game Loaders
  # ----------------------------------------------------------------------------
  load_vga_config
  write_vga_config
  switch_to_highres if get_highres
  toggle_fullscreen if get_fullscreen

end # VGA

# ==============================================================================
# ● Cache
# ------------------------------------------------------------------------------
# This module loads graphics, creates bitmap objects, and retains them.
# To speed up load times and conserve memory, this module holds the
# created bitmap object in the internal hash, allowing the program to
# return preexisting objects when the same bitmap is requested again.
# ==============================================================================

module Cache

  # ----------------------------------------------------------------------------
  # ♦ New method : prefix
  # ----------------------------------------------------------------------------
  def self.prefix
    return if !VGA::USE_HIGHRES_FILES
    VGA.get_highres ? VGA.get_files_prefix : ""
  end

  # ----------------------------------------------------------------------------
  # ♦ New method : load_prefixed_bitmap
  # ----------------------------------------------------------------------------
  def self.load_prefixed_bitmap(folder, filename)
    bitmap = load_bitmap(VGA.get_files_folder + folder, prefix + filename) rescue nil
    bitmap == nil ? load_bitmap("Graphics/" + folder, filename) : bitmap
  end

  # ----------------------------------------------------------------------------
  # ♦ Overwritten method : system
  # ----------------------------------------------------------------------------
  def self.system(filename)
    if filename == "GameOver" and VGA.get_highres && VGA::USE_HIGHRES_FILES
      load_prefixed_bitmap("System/", filename)
    else
      load_bitmap("Graphics/System/", filename)
    end
  end

  # ----------------------------------------------------------------------------
  # ♦ Overwritten methods : title1, title2, battleback1, battleback2
  # ----------------------------------------------------------------------------
  def self.title1(filename);      load_prefixed_bitmap("Titles1/", filename);      end
  def self.title2(filename);      load_prefixed_bitmap("Titles2/", filename);      end
  def self.battleback1(filename); load_prefixed_bitmap("Battlebacks1/", filename); end
  def self.battleback2(filename); load_prefixed_bitmap("Battlebacks2/", filename); end

end # Cache

# ==============================================================================
# ► Graphics
# ------------------------------------------------------------------------------
#  Add some methods to built-in class Graphics.
# ==============================================================================

class << Graphics

  # ----------------------------------------------------------------------------
  # ♦ New method : setup_infos
  #   Create the display informations sprite and put it at the uppermost layer.
  # ----------------------------------------------------------------------------
  def setup_infos
    @infos_sprite, @infos_sprite.z = Sprite.new, 0x7FFFFFFF
    draw_infos
  end

  # ----------------------------------------------------------------------------
  # ♦ New method : setup_fps
  #   Create the FPS sprite and put it at the uppermost layer.
  # ----------------------------------------------------------------------------
  def setup_fps
    @fps, @fps_count = 0, []
    @fps_sprite, @fps_sprite.z = Sprite.new, 0x7FFFFFFF
  end

  # ----------------------------------------------------------------------------
  # ♦ New method : get_infos
  #   Retrieve screen resolution and screen mode.
  # ----------------------------------------------------------------------------
  def get_infos
    VGA.get_fullscreen ? display_mode = VGA::LANG["fullscreen"] : display_mode = VGA::LANG["window"]
    return width.to_s + "x" + height.to_s + " @ " + display_mode
  end

  # ----------------------------------------------------------------------------
  # ♦ New method : get_fps
  #   Calculate number of frames per second.
  # ----------------------------------------------------------------------------
  def get_fps(time)
    @fps_count[frame_count % frame_rate] = Time.now != time
    @fps = 0
    frame_rate.times {|i| @fps += 1 if @fps_count[i]}
  end

  # ----------------------------------------------------------------------------
  # ♦ New method : draw_infos
  #   Draw the display informations sprite.
  # ----------------------------------------------------------------------------
  def draw_infos
    @infos_sprite.bitmap = Bitmap.new(width, 24)
    @infos_sprite.bitmap.draw_text(8, 0, width, 24, get_infos)
  end

  # ----------------------------------------------------------------------------
  # ♦ New method : draw_fps
  #   Draw the FPS sprite.
  # ----------------------------------------------------------------------------
  def draw_fps
    @fps_sprite.bitmap = Bitmap.new(width, 24)
    size = @fps_sprite.bitmap.text_size("000" + " " + VGA::LANG["fps"]).width
    @fps_sprite.bitmap.draw_text(width - size, 0, size, 24, @fps.to_s + " " + VGA::LANG["fps"])
  end

  # ----------------------------------------------------------------------------
  # ◊ Aliased method : update
  #   Refresh FPS at every frame and update display informations if necessary.
  # ----------------------------------------------------------------------------
  alias :vga_alias_update :update
  def update
    time = Time.now
    vga_alias_update
    kbd_enter = 0x0D # 0x0D = VK_RETURN = ENTER Key
    kbd_alt = 0x12 # 0x12 = VK_MENU = ALT Key
    if VGA.get_input_kbd(kbd_enter) != 0 && VGA.get_input_kbd(kbd_alt) != 0
      VGA.switch_fullscreen if frame_count > 30 # Fullscreen loader preventer ; no kbd_input check during the first 0.5 sec
      if SceneManager.scene_is?(Scene_Title)
        SceneManager.scene.instance_variables.each do |var_name|
          var = SceneManager.scene.instance_variable_get(var_name)
          var.refresh if var_name.to_s == "@options_window"
        end
      end
    end
    if VGA.get_show_fps
      setup_fps if !@fps_sprite or @fps_sprite.disposed?
      get_fps(time)
      draw_fps
    else
      @fps_sprite.dispose unless !@fps_sprite
    end
    if VGA.get_show_infos
      setup_infos if !@infos_sprite or @infos_sprite.disposed?
      draw_infos if VGA.get_fullscreen != @last_fullscreen || VGA.get_highres != @last_highres || width != @last_width || height != @last_height
      @last_fullscreen, @last_highres, @last_width, @last_height = VGA.get_fullscreen, VGA.get_highres, width, height
    else
      @infos_sprite.dispose unless !@infos_sprite
    end
  end

end # Graphics

# ==============================================================================
# ► Sprite_Battler
# ------------------------------------------------------------------------------
# This sprite is used to display battlers. It observes an instance of the
# Game_Battler class and automatically changes sprite states.
# ==============================================================================

class Sprite_Battler

  # ----------------------------------------------------------------------------
  # ◊ Aliased method : update_position
  #   Center the enemies on battle ground if the screen size has changed.
  # ----------------------------------------------------------------------------
  alias :vga_alias_update_position :update_position
  def update_position
    vga_alias_update_position
    if VGA.get_highres
      self.x += (VGA.get_highres_width - VGA::LOWRES_WIDTH) / 2
      self.y += (VGA.get_highres_height - VGA::LOWRES_HEIGHT) / 2
    end
  end

end # Sprite_Battler

# ==============================================================================
# ► Window_Selectable
# ------------------------------------------------------------------------------
# This window class contains cursor movement and scroll functions.
# ==============================================================================

class Window_Selectable < Window_Base

  # ----------------------------------------------------------------------------
  # ♦ New method : get_index
  #   Get Cursor Position
  # ----------------------------------------------------------------------------
  def get_index
    @index
  end

end # Window_Selectable

# ==============================================================================
# ► Window_TitleCommand
# ------------------------------------------------------------------------------
# This window is for selecting New Game/Continue on the title screen.
# ==============================================================================

class Window_TitleCommand < Window_Command

  # ----------------------------------------------------------------------------
  # ♦ Overwritten method : window_width
  #   Get Window Width
  # ----------------------------------------------------------------------------
  def window_width
    return 192
  end

  # ----------------------------------------------------------------------------
  # ♦ Overwritten method : make_command_list
  #   Create Command List
  # ----------------------------------------------------------------------------
  def make_command_list
    add_command(Vocab::new_game, :new_game)
    add_command(Vocab::continue, :continue, continue_enabled)
    add_command(VGA::LANG["go_to_options"], :options) # NEW
    add_command(VGA::LANG["exit_game"], :shutdown) # NEW
  end

end # Window_TitleCommand

# ==============================================================================
# ► Window_Options
# ------------------------------------------------------------------------------
# This window is for selecting display options.
# ==============================================================================

class Window_Options < Window_Command
  # ----------------------------------------------------------------------------
  # ♦ New method : initialize
  #   Object Initialization
  # ----------------------------------------------------------------------------
  def initialize
    super(0, 0)
    update_placement
    select_symbol(:cancel)
    self.openness = 0
    open
  end

  # ----------------------------------------------------------------------------
  # ♦ New method : window_width
  #   Get Window Width
  # ----------------------------------------------------------------------------
  def window_width
    return 384
  end

  # ----------------------------------------------------------------------------
  # ♦ New method : update_placement
  #   Update Window Position
  # ----------------------------------------------------------------------------
  def update_placement
    self.x = (Graphics.width - width) / 2
    self.y = (Graphics.height * 1.6 - height) / 2
  end

  # ----------------------------------------------------------------------------
  # ♦ New method : make_command_list
  #   Create Command List
  # ----------------------------------------------------------------------------
  def make_command_list
    add_command(VGA::LANG["fullscreen"], :fullscreen, VGA::OPTION_CHANGE_SCR, VGA.get_fullscreen ? true : false)
    add_command(VGA::LANG["highres"], :highres, VGA::OPTION_CHANGE_RES, VGA.get_highres ? true : false)
    add_command(VGA::LANG["aspect_ratio"], :aspect_ratio, VGA::OPTION_ASPECT_RATIO, VGA.get_aspect_ratio ? true : false)
    add_command(VGA::LANG["show_infos"], :show_infos, VGA::OPTION_SHOW_INFOS, VGA.get_show_infos ? true : false)
    add_command(VGA::LANG["show_fps"], :show_fps, VGA::OPTION_SHOW_FPS, VGA.get_show_fps ? true : false)
    add_command(VGA::LANG["back_to_title"], :cancel)
  end

  # ----------------------------------------------------------------------------
  # ♦ New method : draw_item
  #   Draw Item
  # ----------------------------------------------------------------------------
  def draw_item(index)
    change_color(normal_color, command_enabled?(index))
    draw_text(item_rect_for_text(index), command_name(index), alignment)
    if !@list[index][:ext].nil?
      change_color(crisis_color) if @list[index][:ext] == true
      draw_text(item_rect_for_text(index), @list[index][:ext] == true ? VGA::LANG["option_on"] : VGA::LANG["option_off"], 2)
    end
  end

  # ----------------------------------------------------------------------------
  # ♦ New method : process_cancel
  #   Processing When Cancel Button Is Pressed
  # ----------------------------------------------------------------------------
  def process_cancel
    super
  end

end # Window_Options

# ==============================================================================
# ► Scene_Base
# ------------------------------------------------------------------------------
#  This is a super class of all scenes within the game.
# ==============================================================================

class Scene_Base

  # ----------------------------------------------------------------------------
  # ♦ New method : reload
  #   Just a simple trick to refresh all windows without updating each position
  #   and size. But I have to admit this is a very awfull way to do things ...
  # ----------------------------------------------------------------------------
  def reload
    pre_terminate
    terminate
    start
    post_start
  end

end # Scene_Base

# ==============================================================================
# ► Scene_Map
# ------------------------------------------------------------------------------
#  This class performs the map screen processing.
# ==============================================================================

class Scene_Map

  # ----------------------------------------------------------------------------
  # ♦ Overwritten method : perform_battle_transition
  #   Execute Pre-Battle Transition.
  # ----------------------------------------------------------------------------
  def perform_battle_transition
    file = Cache.prefix + "BattleStart" if VGA.get_highres and VGA::USE_HIGHRES_FILES
    dummy = Cache.load_bitmap(VGA.get_files_folder + "System/", file) rescue nil
    dummy == nil ? file = "Graphics/System/BattleStart" : file = VGA.get_files_folder + "System/" + file
    Graphics.transition(60, file, 100)
    Graphics.freeze
  end

end # Scene_Map

# ==============================================================================
# ► Scene_Title
# ------------------------------------------------------------------------------
# This class performs the title screen processing.
# ==============================================================================

class Scene_Title < Scene_Base

  # ----------------------------------------------------------------------------
  # ◊ Aliased method : start
  #   Start Processing
  # ----------------------------------------------------------------------------
  alias :vga_alias_start :start
  def start
    vga_alias_start
    create_options_window
    close_options_window
  end

  # ----------------------------------------------------------------------------
  # ◊ Aliased method : create_command_window
  #   Create Command Window
  # ----------------------------------------------------------------------------
  alias :vga_alias_create_command_window :create_command_window
  def create_command_window
    vga_alias_create_command_window
    @command_window.set_handler(:options, method(:command_options))
  end

  # ----------------------------------------------------------------------------
  # ♦ New method : create_options_window
  #   Create Options Window
  # ----------------------------------------------------------------------------
  def create_options_window
    @options_window = Window_Options.new
    @options_window.set_handler(:fullscreen, method(:command_fullscreen))
    @options_window.set_handler(:highres, method(:command_highres))
    @options_window.set_handler(:aspect_ratio, method(:command_aspect_ratio))
    @options_window.set_handler(:show_infos, method(:command_show_infos))
    @options_window.set_handler(:show_fps, method(:command_show_fps))
    @options_window.set_handler(:cancel, method(:command_back))
  end

  # ----------------------------------------------------------------------------
  # ♦ New method : open_command_window
  #   Open Command Window
  # ----------------------------------------------------------------------------
  def open_command_window
    @command_window.open
    update until @command_window.open?
    @command_window.refresh
    @command_window.activate
  end

  # ----------------------------------------------------------------------------
  # ♦ New method : open_options_window
  #   Open Options Window
  # ----------------------------------------------------------------------------
  def open_options_window
    @options_window.open
    update until @options_window.open?
    @options_window.refresh
    @options_window.activate
  end

  # ----------------------------------------------------------------------------
  # ♦ New method : close_options_window
  #   Close Options Window
  # ----------------------------------------------------------------------------
  def close_options_window
    @options_window.close
    update until @options_window.close?
  end

  # ----------------------------------------------------------------------------
  # ◊ Aliased method : command_shutdown
  #   [Shut Down] Command
  # ----------------------------------------------------------------------------
  alias :vga_alias_command_shutdown :command_shutdown
  def command_shutdown
    VGA.write_vga_config if VGA::SAVE_USER_CONFIG
    vga_alias_command_shutdown
  end

  # ----------------------------------------------------------------------------
  # ♦ New method : command_options
  #   [Go to Options] Command
  # ----------------------------------------------------------------------------
  def command_options
    close_command_window
    open_options_window
    @command_window.refresh
    @command_window.activate
  end

  # ----------------------------------------------------------------------------
  # ♦ New method : command_fullscreen
  #   [Fullscreen] Command
  # ----------------------------------------------------------------------------
  def command_fullscreen
    VGA.toggle_fullscreen
    @options_window.refresh
    @options_window.activate
  end

  # ----------------------------------------------------------------------------
  # ♦ New method : command_highres
  #   [Highres] Command
  # ----------------------------------------------------------------------------
  def command_highres
    index = @options_window.get_index
    VGA.toggle_highres
    close_command_window
    open_options_window
    @options_window.select(index)
    @options_window.refresh
    @options_window.activate
  end

  # ----------------------------------------------------------------------------
  # ♦ New method : command_aspect_ratio
  #   [Highres] Command
  # ----------------------------------------------------------------------------
  def command_aspect_ratio
    index = @options_window.get_index
    VGA.toggle_aspect_ratio
    close_command_window
    open_options_window
    @options_window.select(index)
    @options_window.refresh
    @options_window.activate
  end

  # ----------------------------------------------------------------------------
  # ♦ New method : command_show_infos
  #   [Show Infos] Command
  # ----------------------------------------------------------------------------
  def command_show_infos
    VGA.toggle_show_infos
    @options_window.refresh
    @options_window.activate
  end

  # ----------------------------------------------------------------------------
  # ♦ New method : command_show_fps
  #   [Show FPS] Command
  # ----------------------------------------------------------------------------
  def command_show_fps
    VGA.toggle_show_fps
    @options_window.refresh
    @options_window.activate
  end

  # ----------------------------------------------------------------------------
  # ♦ New method : command_back
  #   [Back] Command
  # ----------------------------------------------------------------------------
  def command_back
    VGA.write_vga_config
    close_options_window
    open_command_window
  end

end # SceneTitle

# ==============================================================================
# ► Scene_End
# ------------------------------------------------------------------------------
# This class performs game over screen processing.
# ==============================================================================

class Scene_End < Scene_MenuBase

  # ----------------------------------------------------------------------------
  # ◊ Aliased method : command_shutdown
  #   [Shut Down] Command.
  # ----------------------------------------------------------------------------
  alias :vga_alias_command_shutdown :command_shutdown
  def command_shutdown
    VGA.write_vga_config if VGA::SAVE_USER_CONFIG
    vga_alias_command_shutdown
  end

end # Scene_End
KyoMaudit
KyoMaudit
Membre

Nombre de messages : 236
Age : 22
Localisation : Pas de Calais
Distinction : aucune
Date d'inscription : 19/10/2014

Menu d'option Empty Re: Menu d'option

le Sam 25 Oct 2014 - 22:15
Je pense que cela ce trouve dans :
Code:
 # ----------------------------------------------------------------------------
  # ♦ New method : open_options_window
  #  Open Options Window
  # ----------------------------------------------------------------------------
  def open_options_window
    @options_window.open
    update until @options_window.open?
    @options_window.refresh
    @options_window.activate
  end

Mais avec les scripts j'y arrive vraiment pas.. :/
Help please !
Zangther
Zangther
Membre

Nombre de messages : 913
Distinction : aucune
Date d'inscription : 06/02/2013

Menu d'option Empty Re: Menu d'option

le Dim 26 Oct 2014 - 10:56
En fait le problème c'est qu'ici le menu d'options est directement intégré dans l'écran titre à l'inverse des autres commandes (Nouveau jeu et Charger) qui sont indépendants.
Donc désolé mais tu ne pourras pas avoir ce script d'options là dans ton menu d'évent.
Par contre, essaye de trouver un script de menu d'option sans l'intégration dans l'écran titre et que l'on peut appeler avec la commande SceneManager.load(quelquechose) et là tu pourras l'insérer dans ton écran titre en event.
KyoMaudit
KyoMaudit
Membre

Nombre de messages : 236
Age : 22
Localisation : Pas de Calais
Distinction : aucune
Date d'inscription : 19/10/2014

Menu d'option Empty Re: Menu d'option

le Dim 26 Oct 2014 - 12:14
Je te remercie de ta réponse
Je vais donc chercher ce type de scripts
Merci
Heaven
Heaven
Staffeux retraité

Nombre de messages : 2451
Age : 18
Localisation : Alpes-Maritimes VIRILITÉ OLALA
Distinction : Aucune
Date d'inscription : 18/10/2012

Menu d'option Empty Re: Menu d'option

le Lun 27 Oct 2014 - 22:15
Problème résolu en quelque sorte ou tu as besoin d'autre chose ?



Heav'n
KyoMaudit
KyoMaudit
Membre

Nombre de messages : 236
Age : 22
Localisation : Pas de Calais
Distinction : aucune
Date d'inscription : 19/10/2014

Menu d'option Empty Re: Menu d'option

le Mar 28 Oct 2014 - 11:19
Problème résolu ^^
Revenir en haut
Permission de ce forum:
Vous ne pouvez pas répondre aux sujets dans ce forum