AccueilAccueil  PortailPortail  RechercherRechercher  Dernières imagesDernières images  S'enregistrerS'enregistrer  ConnexionConnexion  



Le Deal du moment :
Cartes Pokémon 151 : où trouver le ...
Voir le deal

Partagez
 

 [VXAce] Script menu bidouiller [Résolue]

Voir le sujet précédent Voir le sujet suivant Aller en bas 
AuteurMessage
Jodge65
Habitant Lv.6
Habitant Lv.6
Jodge65


Masculin Age : 28
Inscrit le : 05/04/2011
Messages : 110

[VXAce] Script menu bidouiller [Résolue] Empty
MessageSujet: [VXAce] Script menu bidouiller [Résolue]   [VXAce] Script menu bidouiller [Résolue] Icon_minitimeJeu 25 Juil 2013 - 21:41

Finalement résolu, a déplacé!



Bonjours! J'ai longuement hésité a poster, mais en fin de compte, le bidouillage sa vas un temps ^^'

Voici ma demande :

Demande prioritaire :
- Faire fonctionner les variable (qui affiche 0 au lieu de la valeur ...)
- Rajoute d'un moyen de gérer l'opacité de la fenêtre des commandes à gauches (gérable via une variable in game, comme pour les autres fenêtre, variable modifier par le joueur dans le menu 'option' de yanfly)
- Ajustage de la "window_selectable" de la fenêtre de statue  ( pour le moment elle ne fait que la moitier de la zone du héro :/)

Secondaire (si possible) :
- Ajout d'une fenêtre 'info' paramétrable au centre (dans le vide actuelle)
- Ré ajustage du perso dans la window statue (limiter à 1 perso, centrer le perso, etc vraiment pour donner un style supplémentaire)
- Ajout d'une ligne pour gérer le volume dans le menu, et la désactiver quand on quitte le menu.

Gadget (si vraiment vous avez du temps à perdre XD):
- Ajouter une case en bas à a droite : musique en cours, ainsi qu'un lecture aléatoire de musique (parmi une liste prédéfinis), et ajout d'une ligne pour gérer le niveau du son.
Voila le screen de ce à quoi sa ressemble pour le moment :

[VXAce] Script menu bidouiller [Résolue] Sans_t17
Une image montrant les 3/4s des problèmes actuelles

Et voila le script totalement bidouiller :

Code:
#==============================================================================
#
# ▼ Yanfly Engine Ace - Ace Menu Engine v1.07
# ▼ Blodangan - Temps, or, argent
#
#==============================================================================

$imported = {} if $imported.nil?
$imported["YEA-AceMenuEngine"] = true

module YEA
  module MENU
   
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    # - General Menu Settings -
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    # This changes the way menus appear in your game. You can change their
    # alignment, and the location of the help window, Note that any non-Yanfly
    # Engine Ace scripts may not conform to these menu styles.
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    HELP_WINDOW_LOCATION = 0    # 0-Top, 1-Middle, 2-Bottom.
    COMMAND_WINDOW_ALIGN = 0    # 0-Left, 1-Middle, 2-Right.
   
    # These settings below adjust the visual appearance of the main menu.
    # Change the settings as you see fit.
    MAIN_MENU_ALIGN = 0          # 0-Left, 1-Middle, 2-Right.
    MAIN_MENU_RIGHT = false      # false-Left, true-Right.
    MAIN_MENU_ROWS  = 10        # Maximum number of rows for main menu.
    DRAW_TP_GAUGE  = false      # If true, draws TP in the main menu.
   
    COMMANDS =[
      :item,        # Opens up the item menu. Default menu item.
      :equip,        # Opens up the equip menu. Default menu item.
      :class,        # Requires YEA - Class System.
      :status,      # Opens up the status menu. Default menu item.
      :event_1,      # Launches Common Event 1. Common Event Command.
      :event_3,
      :save,        # Opens up the save menu. Default menu item.
      :game_end,    # Opens up the shutdown menu. Default menu item.
      :event_2,      # Launches Common Event 2. Common Event Command.
    ] # Do not remove this.
   
    #--------------------------------------------------------------------------
    # - Common Event Commands -
    # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    # If you insert one of the following commands into the COMMANDS array, the
    # player can trigger a common event to launch. You can disable certain
    # commands in the menu by binding them to a switch. If you don't want to
    # disable them, set the switch to 0 and it will always be enabled. The
    # ShowSwitch will prevent a command from appear if that switch is false.
    # Set it to 0 for it to have no impact.
    #--------------------------------------------------------------------------
    COMMON_EVENT_COMMANDS ={
    # :command => ["Display Name", EnableSwitch, ShowSwitch, Event ID],
      :event_1 => [        "Crédit",          0,          0,        8],
      :event_2 => [  "Quitter",            0,          0,        9],
      :event_3 => [  "Aide",            0,          0,        10]
    } # Do not remove this.
   
    CUSTOM_COMMANDS ={
    # :command => ["Display Name", EnableSwitch, ShowSwitch, Handler Method],
      :debug  => [      "Debug",            0,          0, :command_debug],
      :shop    => [        "Shop",          12,          0,  :command_shop],
      :gogototori => ["Synthesis",            0,        0,  :command_totori],
      :grathnode => [ "Grathnode",            0,        0, :command_install],
    } # Do not remove this.
   
  end # MENU
end # YEA


module Blodangan
  module Menu_1
   
    # Nom du premier fond dans le dossier ...\Graphics\Titles1
    FOND1 = "Night"
   
    # Nom du deuxième fond dans le dossier ...\Graphics\Titles1 pour ne pas
    # avoir de deuxième fond ne rien mettre.
    FOND2 = "Mountains"
   
    # Mettre une musique ? true = oui, false = non
    MUSIQUE = true
   
    # Volume de la musique 0..100
    MUSIC_VOLUME = 100
   
    # Si oui, nom de la musique dans le dossier ...\Audio\BGM
    MUSICS = ["Theme1", "Theme2", "Theme3", "Theme4"]
   
    # Variable d'opacité du menu sur la gauche
    WINDOW_MENU_COMMAND_OPACITY_VAR = 50
   
    # Variable d'opacité de la fenetre d'info
    WINDOW_INFO_OPACITY_VAR = 51
   
    # Texte d'information
    INFO = {:item => "Menu d'inventaire",        # Opens up the item menu. Default menu item.
            :equip => "Equipement du personnage",        # Opens up the equip menu. Default menu item.
            :class => "Gestion de la classe",        # Requires YEA - Class System.
            :status => "Etat du héros" ,      # Opens up the status menu. Default menu item.
      :event_1 => "Crédits du jeu",      # Launches Common Event 1. Common Event Command.
      :event_3 => "Aide du jeu, à feuilleter d'urgence",
      :save => "Sauvegarder la partie",        # Opens up the save menu. Default menu item.
      :game_end => "Quitter la partie en cours",    # Opens up the shutdown menu. Default menu item.
      :event_2 => "Quitter la partie en cours"}      # Launches Common Event 2. Common Event Command.
  end
end

#==============================================================================
#  Window_Or_Localisation_Temps_Jeu
#==============================================================================
class Window_Or_Localisation_Temps_Jeu < Window_Base
  #--------------------------------------------------------------------------
  # Initialize
  #--------------------------------------------------------------------------
  def initialize(x, y)
    super(x, (y-45), 543, 150)
    self.back_opacity = $game_variables[106]
    refresh
  end
  #--------------------------------------------------------------------------
  # Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    aff_or
    aff_temps_de_jeu
    aff_localisation
    aff_nb_carte
    aff_nb_quete_annexe
  end
 
  #--------------------------------------------------------------------------
  # Affiche une varibale
  #--------------------------------------------------------------------------
  def aff_nb_carte
    draw_icon(3501, 10, 0)
    draw_text_ex(40, 0, "Nombre de carte trouvé : #{$game_variables[37]}")
  end
 
  #--------------------------------------------------------------------------
  # Affiche une varibale
  #--------------------------------------------------------------------------
  def aff_nb_quete_annexe
    draw_icon(1809, 10, 25)
    draw_text_ex(40, 25, "Nombre de quète annexe réussie : #{$game_variables[38]}")
  end

  #--------------------------------------------------------------------------
  # Affiche l'or
  #--------------------------------------------------------------------------
  def aff_or
    draw_icon(3481, 10, 50)
    draw_text_ex(40, 50, "Points : ")
    draw_currency_value($game_party.gold, Vocab::currency_unit, 100, 50, 160)
  end
  #--------------------------------------------------------------------------
  # Affiche le temps de jeu
  #--------------------------------------------------------------------------
  def aff_temps_de_jeu
    draw_icon(188, 10, 75)
    draw_text_ex(40, 75, "Temps de jeu : #{$game_system.playtime_s}")
  end
  #--------------------------------------------------------------------------
  # Affiche la localisation
  #--------------------------------------------------------------------------
  def aff_localisation
    draw_icon(153, 10, 100)
    draw_text_ex(40, 100, "Localisation : #{$game_map.display_name}")
  end
end


#==============================================================================
# ■ Window_MenuCommand
#------------------------------------------------------------------------------
# This class is kept towards the top of the script to provide easier access.
#==============================================================================

class Window_MenuCommand < Window_Command
 
  #--------------------------------------------------------------------------
  # Aliased method: initialize
  #--------------------------------------------------------------------------
  alias old_init initialize
  def initialize
    old_init
    self.back_opacity = $game_variables[Blodangan::Menu_1::WINDOW_MENU_COMMAND_OPACITY_VAR]
  end
   
  #--------------------------------------------------------------------------
  # overwrite method: make_command_list
  #--------------------------------------------------------------------------
  def make_command_list
    for command in YEA::MENU::COMMANDS
      case command
      #--- Default Commands ---
      when :item
        add_command(Vocab::item,  :item,  main_commands_enabled)
      when :skill
        add_command(Vocab::skill,  :skill,  main_commands_enabled)
      when :equip
        add_command(Vocab::equip,  :equip,  main_commands_enabled)
      when :status
        add_command(Vocab::status, :status, main_commands_enabled)
      when :formation
        add_formation_command
      when :save
        add_original_commands
        add_save_command
      when :game_end
        add_game_end_command
      #--- Yanfly Engine Ace Commands ---
      when :class
        next unless $imported["YEA-ClassSystem"]
        add_class_command
      #--- Imported Commands ---
      when :sslots
        next unless $imported["YSA-SlotBattle"]
        add_sslots_command
      when :grathnode
        next unless $imported["KRX-GrathnodeInstall"]
        process_custom_command(command)
      when :gogototori
        next unless $imported["KRX-AlchemicSynthesis"]
        process_custom_command(command)
      #--- Imported Commands ---
      else
        process_common_event_command(command)
        process_custom_command(command)
      end
    end
  end
 
  #--------------------------------------------------------------------------
  # new method: process_common_event_command
  #--------------------------------------------------------------------------
  def process_common_event_command(command)
    return unless YEA::MENU::COMMON_EVENT_COMMANDS.include?(command)
    show = YEA::MENU::COMMON_EVENT_COMMANDS[command][2]
    continue = show <= 0 ? true : $game_switches[show]
    return unless continue
    text = YEA::MENU::COMMON_EVENT_COMMANDS[command][0]
    switch = YEA::MENU::COMMON_EVENT_COMMANDS[command][1]
    ext = YEA::MENU::COMMON_EVENT_COMMANDS[command][3]
    enabled = switch <= 0 ? true : $game_switches[switch]
    add_command(text, command, enabled, ext)
  end
 
  #--------------------------------------------------------------------------
  # new method: process_custom_command
  #--------------------------------------------------------------------------
  def process_custom_command(command)
    return unless YEA::MENU::CUSTOM_COMMANDS.include?(command)
    show = YEA::MENU::CUSTOM_COMMANDS[command][2]
    continue = show <= 0 ? true : $game_switches[show]
    return unless continue
    text = YEA::MENU::CUSTOM_COMMANDS[command][0]
    switch = YEA::MENU::CUSTOM_COMMANDS[command][1]
    enabled = switch <= 0 ? true : $game_switches[switch]
    add_command(text, command, enabled)
  end
 
end # Window_MenuCommand

#==============================================================================
# ■ Menu
#==============================================================================

module Menu
 
  #--------------------------------------------------------------------------
  # self.help_window_location
  #--------------------------------------------------------------------------
  def self.help_window_location
    return YEA::MENU::HELP_WINDOW_LOCATION
  end
 
  #--------------------------------------------------------------------------
  # self.command_window_align
  #--------------------------------------------------------------------------
  def self.command_window_align
    return YEA::MENU::COMMAND_WINDOW_ALIGN
  end
 
  #--------------------------------------------------------------------------
  # self.main_menu_align
  #--------------------------------------------------------------------------
  def self.main_menu_align
    return YEA::MENU::MAIN_MENU_ALIGN
  end
 
  #--------------------------------------------------------------------------
  # self.main_menu_right
  #--------------------------------------------------------------------------
  def self.main_menu_right
    return YEA::MENU::MAIN_MENU_RIGHT
  end
 
end # Menu

#==============================================================================
# ■ Game_Actor
#==============================================================================

class Game_Actor < Game_Battler
 
  #--------------------------------------------------------------------------
  # new method: draw_mp?
  #--------------------------------------------------------------------------
  def draw_mp?
    return true unless draw_tp?
    for skill in skills
      next unless added_skill_types.include?(skill.stype_id)
      return true if skill.mp_cost > 0
    end
    return false
  end
 
  #--------------------------------------------------------------------------
  # new method: draw_tp?
  #--------------------------------------------------------------------------
  def draw_tp?
    return false unless $data_system.opt_display_tp
    for skill in skills
      next unless added_skill_types.include?(skill.stype_id)
      return true if skill.tp_cost > 0
    end
    return false
  end
 
end # Game_Actor

#==============================================================================
# ■ Window_Base
#==============================================================================

class Window_Base < Window
 
  #--------------------------------------------------------------------------
  # overwrite method: draw_actor_simple_status
  #--------------------------------------------------------------------------
  def draw_actor_simple_status(actor, dx, dy)
    dy -= line_height / 2
    draw_actor_name(actor, dx, dy)
    draw_actor_level(actor, dx, dy + line_height * 1)
    draw_actor_icons(actor, dx, dy + line_height * 2)
    dw = contents.width - dx - 124
    draw_actor_class(actor, dx + 120, dy, dw)
    draw_actor_hp(actor, dx + 120, dy + line_height * 1, dw)
    if YEA::MENU::DRAW_TP_GAUGE && actor.draw_tp? && !actor.draw_mp?
      draw_actor_tp(actor, dx + 120, dy + line_height * 2, dw)
    elsif YEA::MENU::DRAW_TP_GAUGE && actor.draw_tp? && actor.draw_mp?
      if $imported["YEA-BattleEngine"]
        draw_actor_tp(actor, dx + 120, dy + line_height * 2, dw/2 + 1)
        draw_actor_mp(actor, dx + 120 + dw/2, dy + line_height * 2, dw/2)
      else
        draw_actor_mp(actor, dx + 120, dy + line_height * 2, dw/2 + 1)
        draw_actor_tp(actor, dx + 120 + dw/2, dy + line_height * 2, dw/2)
      end
    else
      draw_actor_mp(actor, dx + 120, dy + line_height * 2, dw)
    end
  end
 
end # Window_Base

#==============================================================================
# ■ Window_Command
#==============================================================================

class Window_Command < Window_Selectable
 
  #--------------------------------------------------------------------------
  # overwrite method: alignment
  #--------------------------------------------------------------------------
  def alignment
    return Menu.command_window_align
  end
 
end # Window_Command

#==============================================================================
# ■ Window_MenuCommand
#==============================================================================

class Window_MenuCommand < Window_Command
 
  #--------------------------------------------------------------------------
  # alias method: init_command_position
  #--------------------------------------------------------------------------
  class <<self; alias init_command_position_ame init_command_position; end
  def self.init_command_position
    init_command_position_ame
    @@last_command_oy = nil
  end
 
  #--------------------------------------------------------------------------
  # overwrite method: visible_line_number
  #--------------------------------------------------------------------------
  def visible_line_number
    return [[item_max, YEA::MENU::MAIN_MENU_ROWS].min, 1].max
  end
 
  #--------------------------------------------------------------------------
  # overwrite method: alignment
  #--------------------------------------------------------------------------
  def alignment
    return Menu.main_menu_align
  end
 
  #--------------------------------------------------------------------------
  # alias method: process_ok
  #--------------------------------------------------------------------------
  alias window_menucommand_process_ok_ame process_ok
  def process_ok
    @@last_command_oy = self.oy
    window_menucommand_process_ok_ame
  end
 
  #--------------------------------------------------------------------------
  # alias method: select_last
  #--------------------------------------------------------------------------
  alias window_menucommand_select_last_ame select_last
  def select_last
    window_menucommand_select_last_ame
    self.oy = @@last_command_oy unless @@last_command_oy.nil?
    @@last_command_oy = nil
  end
 
end # Window_MenuCommand

#==============================================================================
# ■ Scene_Menu
#==============================================================================

class Scene_Menu < Scene_MenuBase
 
  #--------------------------------------------------------------------------
  # alias method: start
  #--------------------------------------------------------------------------
  alias scene_menu_start_ame start
  def start
    scene_menu_start_ame
    create_or_localisation_temps_jeu_window
    relocate_windows
  end
 
  #--------------------------------------------------------------------------
  # new method: relocate_windows
  #--------------------------------------------------------------------------
  def relocate_windows
    return unless Menu.main_menu_right
    @command_window.x = Graphics.width - @command_window.width
    @status_window.x = 0
  end
  #--------------------------------------------------------------------------
  # ● Terminate
  #--------------------------------------------------------------------------
  def terminate
    super
    dispose_fond
  end

  #--------------------------------------------------------------------------
  # ● Update
  #--------------------------------------------------------------------------
  def update
    super
    @or_localisation_temps_jeu_window.refresh
    @help_window.set_text(Blodangan::Menu_1::INFO[@command_window.current_symbol])
  end
  #--------------------------------------------------------------------------
  # ● Create Or Localisation Temps Jeu Window
  #--------------------------------------------------------------------------
  def create_or_localisation_temps_jeu_window
    x = 0
    y = 311
    @or_localisation_temps_jeu_window = Window_Or_Localisation_Temps_Jeu.new(x,y)
  end
end # Scene_Menu

#==============================================================================
# ■ Scene_Item
#==============================================================================

class Scene_Item < Scene_ItemBase
 
  #--------------------------------------------------------------------------
  # alias method: start
  #--------------------------------------------------------------------------
  alias scene_item_start_ame start
  def start
    scene_item_start_ame
    return if $imported["YEA-ItemMenu"]
    relocate_windows
  end
end

#==============================================================================
# ■ Scene_Skill
#==============================================================================

class Scene_Skill < Scene_ItemBase
 
  #--------------------------------------------------------------------------
  # alias method: start
  #--------------------------------------------------------------------------
  alias scene_skill_start_ame start
  def start
    scene_skill_start_ame
    relocate_windows
  end
 
end # Scene_Skill

#==============================================================================
# ■ Scene_Equip
#==============================================================================

class Scene_Equip < Scene_MenuBase
 
  #--------------------------------------------------------------------------
  # alias method: start
  #--------------------------------------------------------------------------
  alias scene_equip_start_ame start
  def start
    scene_equip_start_ame
  end
end # Scene_Equip

#==============================================================================
# ■ Scene_Menu
#==============================================================================

class Scene_Menu < Scene_MenuBase
 
  #--------------------------------------------------------------------------
  # ● Create Status Window
  #--------------------------------------------------------------------------
  def create_status_window
    @status_window = Window_MenuStatus_UniqHero.new(160, 0, @command_window.height)
  end
  #--------------------------------------------------------------------------
  # alias method: create_command_window
  #--------------------------------------------------------------------------
  alias scene_menu_create_command_window_ame create_command_window
  def create_command_window
    scene_menu_create_command_window_ame
    process_common_event_commands
    process_custom_commands
  end
 
  #--------------------------------------------------------------------------
  # new method: process_common_event_commands
  #--------------------------------------------------------------------------
  def process_common_event_commands
    for command in YEA::MENU::COMMANDS
      next unless YEA::MENU::COMMON_EVENT_COMMANDS.include?(command)
      @command_window.set_handler(command, method(:command_common_event))
    end
  end
 
  #--------------------------------------------------------------------------
  # new method: command_common_event
  #--------------------------------------------------------------------------
  def command_common_event
    event_id = @command_window.current_ext
    return return_scene if event_id.nil?
    return return_scene if $data_common_events[event_id].nil?
    $game_temp.reserve_common_event(event_id)
    return_scene
  end
 
  #--------------------------------------------------------------------------
  # new method: process_custom_commands
  #--------------------------------------------------------------------------
  def process_custom_commands
    for command in YEA::MENU::COMMANDS
      next unless YEA::MENU::CUSTOM_COMMANDS.include?(command)
      called_method = YEA::MENU::CUSTOM_COMMANDS[command][3]
      @command_window.set_handler(command, method(called_method))
    end
  end
 
  #--------------------------------------------------------------------------
  # new method: command_debug
  #--------------------------------------------------------------------------
  def command_debug
    SceneManager.call(Scene_Debug)
  end
 
  #--------------------------------------------------------------------------
  # new method: command_shop
  #--------------------------------------------------------------------------
  def command_shop
    goods = []
    SceneManager.call(Scene_Shop)
    SceneManager.scene.prepare(goods, false)
  end
 
  #--------------------------------------------------------------------------
  # new method: command_totori
  #--------------------------------------------------------------------------
  def command_totori
    return unless $imported['KRX-AlchemicSynthesis']
    SceneManager.call(Scene_Alchemy)
  end
 
  #--------------------------------------------------------------------------
  # ● Start
  #--------------------------------------------------------------------------
  def start
    super
    create_fond
    create_command_window
    create_or_localisation_temps_jeu_window
    create_status_window
    @help_window = Window_Help.new(1)
    @help_window.y = @command_window.height
    @help_window.height += 2
    @help_window.back_opacity = $game_variables[Blodangan::Menu_1::WINDOW_INFO_OPACITY_VAR]
    @music_window = Window_MenuMusic.new
    play_menu_musique
  end
  #--------------------------------------------------------------------------
  # ● Terminate
  #--------------------------------------------------------------------------
  def terminate
    super
    dispose_fond
  end
  #--------------------------------------------------------------------------
  # ● Return scene
  #--------------------------------------------------------------------------
  def return_scene
    super
    $game_map.autoplay
  end
  #--------------------------------------------------------------------------
  # ● Create Fond
  #--------------------------------------------------------------------------
  def create_fond
    @fond1 = Sprite.new
    @fond1.bitmap = Cache.title1(Blodangan::Menu_1::FOND1)
    @fond2 = Sprite.new
    @fond2.bitmap = Cache.title2(Blodangan::Menu_1::FOND2)
  end
  #--------------------------------------------------------------------------
  # ● Dispose Fond
  #--------------------------------------------------------------------------
  def dispose_fond
    @fond1.bitmap.dispose
    @fond1.dispose
    @fond2.bitmap.dispose
    @fond2.dispose
  end
  #--------------------------------------------------------------------------
  # ● Play Menu Musique
  #--------------------------------------------------------------------------
  def play_menu_musique
    if Blodangan::Menu_1::MUSIQUE
      RPG::BGS.stop
      RPG::ME.stop
      size = Blodangan::Menu_1::MUSICS.length
      chosen = Random.rand(size)
      Audio.bgm_play('Audio/BGM/' + Blodangan::Menu_1::MUSICS[chosen], Blodangan::Menu_1::MUSIC_VOLUME, 100, 0)
      @music_window.set_text("♫ "+Blodangan::Menu_1::MUSICS[chosen])
    end
  end
end
#==============================================================================
# ** Window_MenuStatus_UniqHero
#------------------------------------------------------------------------------
#  This window displays thze unique member's status on the menu screen.
#==============================================================================

class Window_MenuStatus_UniqHero < Window_MenuStatus
  #--------------------------------------------------------------------------
  # * Hack
  #--------------------------------------------------------------------------
  def initialize(x, y, height)
    @true_height = height
    super(x,y)
    self.back_opacity = $game_variables[Blodangan::Menu_1::WINDOW_MENU_COMMAND_OPACITY_VAR]
  end
  #--------------------------------------------------------------------------
  # * Hacks
  #--------------------------------------------------------------------------
  def window_height; @true_height; end
  def item_max; 1; end
  def item_height; 96; end
  #--------------------------------------------------------------------------
  # * Moar hack
  #--------------------------------------------------------------------------
  def item_rect(index)
    rect = super
    rect.x = index * (item_width + spacing)
    rect.y = window_height / 2 - 76
    rect.height += 2
    rect
  end
end

#==============================================================================
# ** Window_MenuMusic
#------------------------------------------------------------------------------
#  Display a text
#==============================================================================

class Window_MenuMusic < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(Graphics.width - 200, Graphics.height - fitting_height(1), 200, fitting_height(1))
    self.back_opacity = 0
  end
  #--------------------------------------------------------------------------
  # * Set Text
  #--------------------------------------------------------------------------
  def set_text(text)
    if text != @text
      @text = text
      refresh
    end
  end
  #--------------------------------------------------------------------------
  # * Clear
  #--------------------------------------------------------------------------
  def clear
    set_text("")
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    contents.clear
    draw_text_ex(4, 0, @text)
  end
end

#==============================================================================
#
# ▼ End of File
#
#==============================================================================


Oui quand je dis bidouiller, c'est bidouiller! ^^

Voila le script réparer par Zangther, si vous voulez l'utiliser aussi (crédit obligatoire, écrit en haut du script)


p.s les icônes sont gérer par un script indépendant sans aucun problème de compatibilité notable mais le voici quand même au cas ou...  :

Code:
#==============================================================================
#
# ▼ Yanfly Engine Ace - Command Window Icons v1.00
# -- Last Updated: 2011.12.11
# -- Level: Normal
# -- Requires: n/a
#
#==============================================================================

$imported = {} if $imported.nil?
$imported["YEA-CommandWindowIcons"] = true

#==============================================================================
# ▼ Updates
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# 2011.12.11 - Started Script and Finished.
#
#==============================================================================
# ▼ Introduction
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# Here's a script that allows you to allocate icons to each of your commands
# provided that the text for the command matches the icon in the script. There
# are, however, some scripts that this won't be compatible with and it's due
# to them using unique way of drawing out their commands. This script does not
# maintain compatibility for those specific scripts.
#
#==============================================================================
# ▼ Instructions
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# To install this script, open up your script editor and copy/paste this script
# to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save.
#
# Go to the module and match the text under ICON_HASH with a proper Icon ID.
# You can find an icon's ID by opening up the icon select window in the RPG
# Maker VX Ace database and look in the lower left corner.
#
#==============================================================================
# ▼ Compatibility
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
# it will run with RPG Maker VX without adjusting.
#
#==============================================================================

module YEA
  module COMMAND_WINDOW_ICONS
    
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    # - Icon Hash -
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    # This hash controls all of the icon data for what's used with each text
    # item. Any text items without icons won't display icons. The text has to
    # match with the hash (case sensitive) to display icons.
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    ICON_HASH ={
    # Matching Text   => Icon ID,
      "Nouveau"         => 2199,    # Title scene.
      "Charger"         => 2176,    # Title scene.
      "Quitter"         => 2179,    # Title scene. Game End scene.
      "Sauvegarder"     => 2177,    # Title scene. Game End scene.
      "Supprimer"       => 2208,    # Title scene. Game End scene.
          
     "Objets"          => 2178,    # Menu scene. Item scene. Battle scene.
      "Compétences"     => 2197,    # Menu scene.
      "Equipement"      => 2180,    # Menu scene.
      "Statut"          => 2198,    # Menu scene.
      "Crédit"          => 2195,   #crédit
      "Sauver"          => 2177,    # Menu scene.
      "Option"          => 2194,    # Menu scene.
      "Aide"            => 2196,    # Menu scene.
      
      "Tout"            => 366,    
      "Acheter"         => 2212,
      "Vendre"          => 2211,
      "Carte"           => 3498,
      "Bas"             => 2224,    
      "Haut"            => 2225,    
      "Tête"            => 2226,  
     "Accessoire"      => 2227,
      "Passe-muraille"  => 2228,
      "Autre"           => 2213,
      "Basique"         => 2229,
      "Incarnation"     => 2230,

      "Armures"         => 2180,    # Item scene.
      "Bonus"           => 204,    # Item scene.
      "Général"         => 137,    # Item scene.
      "Biographie"      => 133,    # Item scene.
      "Objets clés"     => 85,    # Item scene.
      "Armure normale"  => 41,    # Item scene.
      "Armure magique"  => 6231,    # Item scene.
      "Armure ultime"   => 220,    # Item scene
      "Ecran Titre"     => 103,    # Game End scene.
      "Annuler"         => 99,    
      "Armure"          => 1,

    } # Do not remove this.
    
  end # COMMAND_WINDOW_ICONS
end # YEA

#==============================================================================
# ▼ Editting anything past this point may potentially result in causing
# computer damage, incontinence, explosion of user's head, coma, death, and/or
# halitosis so edit at your own risk.
#==============================================================================

#==============================================================================
# ■ Window_Command
#==============================================================================

class Window_Command < Window_Selectable
  
  #--------------------------------------------------------------------------
  # new method: use_icon?
  #--------------------------------------------------------------------------
  def use_icon?(text)
    return YEA::COMMAND_WINDOW_ICONS::ICON_HASH.include?(text)
  end
  
  #--------------------------------------------------------------------------
  # new method: command_icon
  #--------------------------------------------------------------------------
  def command_icon(text)
    return YEA::COMMAND_WINDOW_ICONS::ICON_HASH[text]
  end
  
  #--------------------------------------------------------------------------
  # overwrite method: draw_item
  #--------------------------------------------------------------------------
  def draw_item(index)
    enabled = command_enabled?(index)
    change_color(normal_color, enabled)
    rect = item_rect_for_text(index)
    text = command_name(index)
    if use_icon?(text)
      draw_icon_text(rect.clone, text, alignment, enabled)
    else
      draw_text(rect, text, alignment)
    end
  end
  
  #--------------------------------------------------------------------------
  # new method: draw_icon_text
  #--------------------------------------------------------------------------
  def draw_icon_text(rect, text, alignment, enabled)
    cw = text_size(text).width
    icon = command_icon(text)
    draw_icon(icon, rect.x, rect.y, enabled)
    rect.x += 24
    rect.width -= 24
    draw_text(rect, text, alignment)
  end
  
end # Window_Command

#==============================================================================
#
# ▼ End of File
#
#==============================================================================


Dernière édition par Jodge65 le Dim 28 Juil 2013 - 14:03, édité 1 fois
Revenir en haut Aller en bas
Zangther
Maître des Duels
Maître des Duels
Zangther


Masculin Age : 31
Inscrit le : 29/07/2009
Messages : 7840

[VXAce] Script menu bidouiller [Résolue] Empty
MessageSujet: Re: [VXAce] Script menu bidouiller [Résolue]   [VXAce] Script menu bidouiller [Résolue] Icon_minitimeDim 28 Juil 2013 - 13:26

Petite précision, je n'exige rien en ce qui concerne les crédits Wink
Revenir en haut Aller en bas
 

[VXAce] Script menu bidouiller [Résolue]

Voir le sujet précédent Voir le sujet suivant Revenir en haut 
Page 1 sur 1

 Sujets similaires

-
» [Resolue !]Script Quizz
»  [RESOLUE] [VXAce] désactivateur d'auto-tiles
» [Menu]Demande de script pour un Menu "Aide"
» [VXace] Ring Menu
» [VXAce] Menu Personnalisable

Permission de ce forum:Vous ne pouvez pas répondre aux sujets dans ce forum
RPG Maker VX :: Entraide :: Scripts :: Requêtes :: Archives-
Créer un forum | ©phpBB | Forum gratuit d'entraide | Signaler un abus | Forum gratuit