Forum RPG Maker XP / VX de Gladiusoft
Vous souhaitez réagir à ce message ? Créez un compte en quelques clics ou connectez-vous pour continuer.
Le Deal du moment : -39%
Ordinateur portable ASUS Chromebook Vibe CX34 Flip
Voir le deal
399 €

probleme dans mon script de menu

3 participants

Aller en bas

probleme dans mon script de menu Empty probleme dans mon script de menu

Message par Adurna1 Dim 20 Déc - 12:39

Bonjour ou bonsoir voir bonne nuit

bon bah voila j'ai commencé un joli ptit script de menu que j'ai poster sur la comun' mais j'ai un ptit problème que voici:
quand je sélectionne "compétence"
le menu de sélection actor s'affiche
on sélectionne le perso (jusque là pas de problème!!!)
la le menu compétence s'affiche mais patatra le menu de sélection actor reste affiché par dessus pas actif mais affiché ce qui fait que l'on ne vois pas la compétence que l'on veux sélectionné
screen:
probleme dans mon script de menu Captur18


et mon script:

Code:

#=================================================================#
#                      By Adurna                                                        12/12/09        maj:16/12/09        #
#                                          menu option plus version 0.5                                                        #
#=================================================================#

#==============================================================================
# ** Scene_Menu
#------------------------------------------------------------------------------
#  This class performs the menu screen processing.
#==============================================================================
module Adurna
 
 
Obj = "Objet"
Comp = "Compétence"
Equip = "Équiper"
Stat = "Statut"
Sov = "Sauvegarder"
Char = "Charger"
Fin = "Quitter"

Affiche_Icon=1 #pas encore utiliser
Icon_Or=147
Icon_Loc=153
Icon_Obj=144
Icon_Comp=128
Icon_Equip=32
Icon_Stat=118
Icon_Sov=176
Icon_Char=177
Icon_Fin=117

end

class Scene_Menu < Scene_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #    menu_index : command cursor's initial position
  #--------------------------------------------------------------------------
  def initialize(menu_index = 0)
    @menu_index = menu_index
  end
  #--------------------------------------------------------------------------
  # * Start processing
  #--------------------------------------------------------------------------
  def start
    super
  create_menu_background
    create_command_window
    @location_window = Window_location.new(0, 240)
#    @icon_window=Window_icon.new(0,0)
    @status_window=0
  end
  #--------------------------------------------------------------------------
  # * Termination Processing
  #--------------------------------------------------------------------------
  def terminate
    super
    dispose_menu_background
    @command_window.dispose
    @location_window.dispose
  # @icon_window.dispose
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    super
  update_menu_background
    @command_window.update
    if @command_window.active
      update_command_selection
    elsif @status_window.active
      update_actor_selection
    end
  end
  #--------------------------------------------------------------------------
  # * Create Command Window
  #--------------------------------------------------------------------------
  def icon_item
    self.contents.clear
    #if Adurna::Affiche_Icon >0
    draw_icon(Adurna::Icon_Obj, 2, 3, true)
  #  end
  end
 
 
 
 
 
  def create_command_window
    s1 = [Adurna::Icon_Obj, Adurna::Obj]
    s2 = [Adurna::Icon_Comp, Adurna::Comp]
    s3 = [Adurna::Icon_Equip, Adurna::Equip]
    s4 = [Adurna::Icon_Stat, Adurna::Stat]
    s5 = [Adurna::Icon_Sov, Adurna::Sov]
    s6 = [Adurna::Icon_Char, Adurna::Char]
    s7=  [Adurna::Icon_Fin, Adurna::Fin]
  # @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6,s7])
  @command_window = Window_IconCommand.new(172, [s1, s2, s3, s4, s5, s6,s7])
    @command_window.index = @menu_index
 
    if $game_party.members.size == 0          # If number of party members is 0
      @command_window.draw_item(0, false)
      @command_window.draw_item(1, false)
      @command_window.draw_item(2, false)
      @command_window.draw_item(3, false)
    end
    if $game_system.save_disabled            # If save is forbidden
      @command_window.draw_item(4,false)    # Disable save
    end
    if Dir.glob('Save*.rvdata').size <=0
      @command_window.draw_item(5,false)
    end
    if Adurna::Affiche_Icon >0
      #draw_icon(Adurna::Icon_Odj,2, 3, true)
      end
  end
  #--------------------------------------------------------------------------
  # * Update Command Selection
  #--------------------------------------------------------------------------
  def update_command_selection
    if Input.trigger?(Input::B)
      Sound.play_cancel
      $scene = Scene_Map.new
    elsif Input.trigger?(Input::C)
      if $game_party.members.size == 0 and @command_window.index < 4
        Sound.play_buzzer
        return
      elsif $game_system.save_disabled and @command_window.index == 4
        Sound.play_buzzer
        return
      end
      Sound.play_decision
      case @command_window.index
      when 0      # Item
        $scene = Scene_Item.new
      when 1,2,3  # Skill, equipment, status
        @status_window=Window_MenuStatus.new(160, 0)
        start_actor_selection
      when 4      # Save
        $scene = Scene_File.new(true, false, false)
        when 5
          $scene = Scene_File.new(false, false, false)
      when 6      # End Game
        $scene = Scene_End.new
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Start Actor Selection
  #--------------------------------------------------------------------------
  def start_actor_selection
    @command_window.active = false
    @status_window.active = true
    if $game_party.last_actor_index < @status_window.item_max
      @status_window.index = $game_party.last_actor_index
    else
      @status_window.index = 0
    end
  end
  #--------------------------------------------------------------------------
  # * End Actor Selection
  #--------------------------------------------------------------------------
  def end_actor_selection
    @command_window.active = true
    @status_window.active = false
    @status_window.index = -1
    @status_window.dispose
  end
  #--------------------------------------------------------------------------
  # * Update Actor Selection
  #--------------------------------------------------------------------------
  def update_actor_selection
      @status_window.update
    if Input.trigger?(Input::B)
      Sound.play_cancel
      end_actor_selection
    elsif Input.trigger?(Input::C)
      $game_party.last_actor_index = @status_window.index
      Sound.play_decision
      case @command_window.index
      when 1  # skill
        $scene = Scene_Skill.new(@status_window.index)
      when 2  # equipment
        $scene = Scene_Equip.new(@status_window.index)
      when 3  # status
        $scene = Scene_Status.new(@status_window.index)
      end
    end
  end
end








class Window_location < Window_Base
  def initialize(x, y)
    super(x, y, 300, (WLH*2) + 32)
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh
  end
  def refresh
    self.contents.clear
    $maps = load_data("Data/MapInfos.rvdata")
    @map_id = $game_map.map_id
    @map_name = $maps[@map_id].name
    self.contents.font.color = system_color
    self.contents.draw_text(0, -4, 128, 32, "Location :")
    self.contents.font.color = normal_color
    self.contents.draw_text(0, -4+WLH, 128, 32, @map_name, 1)
    draw_icon(Adurna::Icon_Loc,0, WLH, true)
    self.contents.font.color = system_color
    self.contents.draw_text(125, -4, 128, 32, Vocab::gold,1)
    self.contents.font.color = normal_color
    self.contents.draw_text(125, -10+WLH, 140, 42, $game_party.gold, 1)
    draw_icon(Adurna::Icon_Or,235, WLH, true)
  end
end




class Window_IconCommand < Window_Selectable
  def initialize(width, commands, column_max = 1, row_max = 7, spacing = 20)
    super(0, 0, width, row_max * WLH + 32, spacing)
    @commands = commands
    @item_max = commands.size
    @column_max = column_max
    refresh
    self.index = 0
  end
  def refresh
    self.contents.clear
    for i in 0...@item_max
      draw_item(i)
    end
  end

  def draw_item(index,enabled = true)
    rect = item_rect(index)
    rect.x += 4 + 24
    rect.width -= 8
    self.contents.clear_rect(rect)
    self.contents.font.color = normal_color
    self.contents.font.color.alpha = enabled ? 255 : 128
    draw_icon(@commands[index][0], rect.x - 24, rect.y)
    self.contents.draw_text(rect, @commands[index][1])
  end
  def draw_item_name(index, x, y,enabled = true)
    draw_icon(index, x, y, enabled)
  end
end

Merci d'avance à ce qui se pencherons sur mon problème en espérant que l'on pour résoudre ce ptit problème un peut embêtent!!!
cordialement adurna

Adurna1
Guerrier
Guerrier

Masculin Sagittaire Cheval
Niveau de Making : moyen
Points forts : maps
Messages : 45
Age : 33

Revenir en haut Aller en bas

probleme dans mon script de menu Empty Re: probleme dans mon script de menu

Message par Zeikatsu Sam 26 Déc - 5:02

Si le nom de la fenêtre que t'as utilisé est : window_actor (par exemple), tu as certainement dû mettre dans le ending de l'action :
Code:
@window_actor.active = false
pour désactiver la fenêtre.

Et ben, tout comme t'as fait pour l'activité de la fenêtre, tu fais la même chose pour la visibilité, pour ça, tu peux mettre :
Code:
@window_actor.active = false    ### pour désactiver la fenêtre
@window_actor.visible = false    ### pour la rendre invisilible

Je ne sais pas si ça va marcher (vu que je n'ai pas rmvx en main maintenant) mais c'est la méthode je penses.
Essaies la, et dis moi si ça marche Wink
Zeikatsu
Zeikatsu
Guerrier vétéran
Guerrier vétéran

Masculin Poissons Coq
Niveau de Making : Très bon
Points forts : Bon en events / scripts
Messages : 143
Age : 31
Localisation : ... plus ou moins le net...

https://rpgmvx-rz.forumgaming.fr

Revenir en haut Aller en bas

probleme dans mon script de menu Empty Re: probleme dans mon script de menu

Message par Azuma-01 Lun 11 Jan - 12:47

j'ai trouver 2 façons pour corriger ton problème.

La première:
Remplacer les méthodes start, terminate, update_command_selection, start_actor_selection et end_actor_selection
par ceux-ci...
Code:
  def start
    super
    create_menu_background
    create_command_window
    @location_window = Window_location.new(0, 240)
#    @icon_window=Window_icon.new(0,0)
    @status_window=Window_MenuStatus.new(160, 0)
  end

  def terminate
    super
    dispose_menu_background
    @status_window.dispose  # il te manque ceci
    @command_window.dispose
    @location_window.dispose
  # @icon_window.dispose
  end

  def update_command_selection
    if Input.trigger?(Input::B)
      Sound.play_cancel
      $scene = Scene_Map.new
    elsif Input.trigger?(Input::C)
      if $game_party.members.size == 0 and @command_window.index < 4
        Sound.play_buzzer
        return
      elsif $game_system.save_disabled and @command_window.index == 4
        Sound.play_buzzer
        return
      end
      Sound.play_decision
      case @command_window.index
      when 0      # Item
        $scene = Scene_Item.new
      when 1,2,3  # Skill, equipment, status
        start_actor_selection
      when 4      # Save
        $scene = Scene_File.new(true, false, false)
        when 5
          $scene = Scene_File.new(false, false, false)
      when 6      # End Game
        $scene = Scene_End.new
      end
    end
  end

  def start_actor_selection
    @command_window.active = false
    @status_window.active = true
    @status_window.visible = true
    if $game_party.last_actor_index < @status_window.item_max
      @status_window.index = $game_party.last_actor_index
    else
      @status_window.index = 0
    end
  end

  def end_actor_selection
    @command_window.active = true
    @status_window.active = false
    @status_window.visible = false
    @status_window.index = -1
    @status_window.dispose
  end

et ajoute cette classe a la fin de ton script
Code:
class Window_MenuStatus < Window_Selectable
  alias aza_MenuStatus_initialize initialize
  def initialize(x, y)
    aza_MenuStatus_initialize(x, y)
    self.visible = false
  end
end

la deusième:
Enlève la ligne "@status_window = 0" de la méthode start et ajoute cette ligne à la méthode terminate.
Code:
@status_window.dispose if !@status_window.nil?


Testé et corrige le problème 100%.
Azuma-01
Azuma-01
A l'essai
A l'essai

Masculin Taureau Singe
Niveau de Making : bon
Points forts : script
Messages : 7
Age : 31
Localisation : Amos, Québec

Revenir en haut Aller en bas

probleme dans mon script de menu Empty Re: probleme dans mon script de menu

Message par Contenu sponsorisé


Contenu sponsorisé


Revenir en haut Aller en bas

Revenir en haut

- Sujets similaires

 
Permission de ce forum:
Vous ne pouvez pas répondre aux sujets dans ce forum