Make & Graph
Vous souhaitez réagir à ce message ? Créez un compte en quelques clics ou connectez-vous pour continuer.
Le deal à ne pas rater :
TCL C74 Series 55C743 – TV 55” 4K QLED 144 Hz Google TV (Via ODR ...
499 €
Voir le deal

Vous n'êtes pas connecté. Connectez-vous ou enregistrez-vous

Script option menu V3.1 par mew72

3 participants

Aller en bas  Message [Page 1 sur 1]

mew72

mew72
Super Membre
Super Membre

Voici la version 3.1 du script option pour menu
Je ne posterais pas les versions précédente

Image(cliquer pour agrandir):
Spoiler:

news:
-moin de script(3 seulement)
-choix position menu
-système de défaut
-système d'information

script:
Avant de commencer supprimer les script de la version 2 si vous les avez
puis remplacer scene_menu par celui ci:
Code:
#==============================================================================
# ■ Scene_Menu
# Modifier par mew72 (ajout optionV3)
# Credit!!!
#==============================================================================

class Scene_Menu
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #    menu_index : コマンドのカーソル初期位置
  #--------------------------------------------------------------------------
  def initialize(menu_index = 0)
    @menu_index = menu_index
  end
  #--------------------------------------------------------------------------
  # ● メイン処理
  #--------------------------------------------------------------------------
  def main
    # コマンドウィンドウを作成
    s1 = $data_system.words.item
    s2 = $data_system.words.skill
    s3 = $data_system.words.equip
    s4 = "État"
    s5 = "Sauvegarder"
    s6 = "Quitter"
    s7 = "Option"
    @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6,s7])
    if ($position == 1)
      @command_window.x = 0
          @command_window.y = 0
    else
      if ($position == 2)
        @command_window.x = 0
        @command_window.y = 224
      else
        if ($position == 3)
          @command_window.x = 480
          @command_window.y = 0
        else
          if ($position == 4)
            @command_window.x = 480
            @command_window.y = 224
          else
            $position = 1
            @command_window.x = 0
          @command_window.y = 0
          end
        end
      end
    end
    @command_window.index = @menu_index
    # パーティ人数が 0 人の場合
    if $game_party.actors.size == 0
      # アイテム、スキル、装備、ステータスを無効化
      @command_window.disable_item(0)
      @command_window.disable_item(1)
      @command_window.disable_item(2)
      @command_window.disable_item(3)
    end
    # セーブ禁止の場合
    if $game_system.save_disabled
      # セーブを無効にする
      @command_window.disable_item(4)
    end
    # プレイ時間ウィンドウを作成
    if ($tempsjeu == 1) #condition si temps jeu est activer
      if ($position == 1)
        @playtime_window = Window_PlayTime.new
        @playtime_window.x = 0
        @playtime_window.y = 255
      else
        if ($position == 2)
          @playtime_window = Window_PlayTime.new
          @playtime_window.x = 0
          @playtime_window.y = 0
        else
          if ($position == 3)
            @playtime_window = Window_PlayTime.new
            @playtime_window.x = 480
            @playtime_window.y = 255
          else
            @playtime_window = Window_PlayTime.new
            @playtime_window.x = 480
            @playtime_window.y = 0
          end
        end
      end
    end
    # 歩数ウィンドウを作成
    if ($pas == 1) #condition si pas est activer
      if ($position == 1)
        @steps_window = Window_Steps.new
        @steps_window.x = 0
        @steps_window.y = 340
      else
        if ($position == 2)
          @steps_window = Window_Steps.new
          @steps_window.x = 0
          @steps_window.y = 85
        else
          if ($position == 3)
            @steps_window = Window_Steps.new
            @steps_window.x = 480
            @steps_window.y = 340
          else
            @steps_window = Window_Steps.new
            @steps_window.x = 480
            @steps_window.y = 85
          end
        end
      end
    end
    # ゴールドウィンドウを作成
    if ($argent == 1) #condition si argent est activer
      if ($position == 1)
          @gold_window = Window_Gold.new
          @gold_window.x = 0
          @gold_window.y = 425
      else
          if ($position == 2)
          @gold_window = Window_Gold.new
          @gold_window.x = 0
          @gold_window.y = 170
          else
            if ($position == 3)
              @gold_window = Window_Gold.new
              @gold_window.x = 480
              @gold_window.y = 425
            else
              @gold_window = Window_Gold.new
              @gold_window.x = 480
              @gold_window.y = 170
            end
          end
        end
      end
    # ステータスウィンドウを作成
    @status_window = Window_MenuStatus.new
    if ($position == 1)
      @status_window.x = 160
      @status_window.y = 0
    else
      if ($position == 2)
        @status_window.x = 160
        @status_window.y = 0
      else
          @status_window.x = 0
          @status_window.y = 0
      end
    end
    # トランジション実行
    Graphics.transition
    # メインループ
    loop do
      # ゲーム画面を更新
      Graphics.update
      # 入力情報を更新
      Input.update
      # フレーム更新
      update
      # 画面が切り替わったらループを中断
      if $scene != self
        break
      end
    end
    # トランジション準備
    Graphics.freeze
    # ウィンドウを解放
    @command_window.dispose
    if ($tempsjeu == 1) #condition si temps jeu est activer
      @playtime_window.dispose
    end
    if ($pas == 1) #condition si pas est activer
      @steps_window.dispose
    end
    if ($argent == 1) #condition si argent est activer
      @gold_window.dispose
    end
    @status_window.dispose
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新
  #--------------------------------------------------------------------------
  def update
    # ウィンドウを更新
    @command_window.update
    if ($tempsjeu == 1) #condition si temps jeu est activer
        @playtime_window.update
    end
    if ($pas == 1) #condition si pas est activer
      @steps_window.update
    end
    if ($argent == 1) #condition si argent est activer
      @gold_window.update
    end
    @status_window.update
    # コマンドウィンドウがアクティブの場合: update_command を呼ぶ
    if @command_window.active
      update_command
      return
    end
    # ステータスウィンドウがアクティブの場合: update_status を呼ぶ
    if @status_window.active
      update_status
      return
    end
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新 (コマンドウィンドウがアクティブの場合)
  #--------------------------------------------------------------------------
  def update_command
    # B ボタンが押された場合
    if Input.trigger?(Input::B)
      # キャンセル SE を演奏
      $game_system.se_play($data_system.cancel_se)
      # マップ画面に切り替え
      $scene = Scene_Map.new
      return
    end
    # C ボタンが押された場合
    if Input.trigger?(Input::C)
      # パーティ人数が 0 人で、セーブ、ゲーム終了以外のコマンドの場合
      if $game_party.actors.size == 0 and @command_window.index < 4
        # ブザー SE を演奏
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      # コマンドウィンドウのカーソル位置で分岐
      case @command_window.index
      when 0  # アイテム
        # 決定  SE を演奏
        $game_system.se_play($data_system.decision_se)
        # アイテム画面に切り替え
        $scene = Scene_Item.new
      when 1  # スキル
        # 決定 SE を演奏
        $game_system.se_play($data_system.decision_se)
        # ステータスウィンドウをアクティブにする
        @command_window.active = false
        @status_window.active = true
        @status_window.index = 0
      when 2  # 装備
        # 決定 SE を演奏
        $game_system.se_play($data_system.decision_se)
        # ステータスウィンドウをアクティブにする
        @command_window.active = false
        @status_window.active = true
        @status_window.index = 0
      when 6  # ステータス
      $scene = OptionV2.new
      when 4  # セーブ
        # セーブ禁止の場合
        if $game_system.save_disabled
          # ブザー SE を演奏
          $game_system.se_play($data_system.buzzer_se)
          return
        end
        # 決定 SE を演奏
        $game_system.se_play($data_system.decision_se)
        # セーブ画面に切り替え
        $scene = Scene_Save.new
      when 5  # ゲーム終了
        # 決定 SE を演奏
        $game_system.se_play($data_system.decision_se)
        # ゲーム終了画面に切り替え
        $scene = Scene_End.new
        when 3
          # 決定 SE を演奏
        $game_system.se_play($data_system.decision_se)
        # ステータスウィンドウをアクティブにする
        @command_window.active = false
        @status_window.active = true
        @status_window.index = 0
      end
      return
    end
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新 (ステータスウィンドウがアクティブの場合)
  #--------------------------------------------------------------------------
  def update_status
    # B ボタンが押された場合
    if Input.trigger?(Input::B)
      # キャンセル SE を演奏
      $game_system.se_play($data_system.cancel_se)
      # コマンドウィンドウをアクティブにする
      @command_window.active = true
      @status_window.active = false
      @status_window.index = -1
      return
    end
    # C ボタンが押された場合
    if Input.trigger?(Input::C)
      # コマンドウィンドウのカーソル位置で分岐
      case @command_window.index
      when 1  # スキル
        # このアクターの行動制限が 2 以上の場合
        if $game_party.actors[@status_window.index].restriction >= 2
          # ブザー SE を演奏
          $game_system.se_play($data_system.buzzer_se)
          return
        end
        # 決定 SE を演奏
        $game_system.se_play($data_system.decision_se)
        # スキル画面に切り替え
        $scene = Scene_Skill.new(@status_window.index)
      when 2  # 装備
        # 決定 SE を演奏
        $game_system.se_play($data_system.decision_se)
        # 装備画面に切り替え
        $scene = Scene_Equip.new(@status_window.index)
      when 3  # ステータス
        # 決定 SE を演奏
        $game_system.se_play($data_system.decision_se)
        # ステータス画面に切り替え
        $scene = Scene_Status.new(@status_window.index)
      end
      return
    end
  end
end

Puis créer 2 script:
-Option
-Window_Option
Pour le premier placer ceci:
Code:
#========================================================================
#Option par mew72
#Version 3.1 (moin de script)
#08/02/2011
#CREDIT!!!
#========================================================================
class OptionV2
  def main
    @indication = Window_Option2.new
    @indication.x = 470
    @indication.y  = 0
    $instruction =1
    @instruction = Window_Instruction.new
    @instruction.x = 0
    @instruction.y = 290
    # Création du la fenêtre de sélection
    @select_window = Window_Command.new(192, [ "Temps jeu", "Nombre pas","Argents","Position menu","Défault","Sortir"])
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
    Graphics.freeze
    # Suppression du fenêtre à la fin de la scène
    @select_window.dispose
  end
 
  def update
    # Mise à jour de la fenêtre
    @select_window.update
    # Quand le joueur va appuyer sur Entrée
    if Input.trigger?(Input::C)
      case @select_window.index
        when 0 #Temps jeu
          $option = 1
          $scene = Option_true_false.new
          @indication.dispose
          @instruction.dispose
        when 1 #Nombre pas
          $option = 2
          $scene = Option_true_false.new
          @indication.dispose
          @instruction.dispose
        when 2 #Argent
          $option = 3 
          $scene = Option_true_false.new
          @indication.dispose
          @instruction.dispose
        when 3 #position menu
          @indication.dispose
          $scene = Position_Menu.new
          @instruction.dispose
        when 4 #défault
          @instruction.dispose
          @indication.dispose
          $scene = Option_Oui_Non.new
        when 5 #sortir
          @indication.dispose
          @instruction.dispose
          $scene = Scene_Menu.new
      end
    end
  end
end

#========================================================================

class Option_true_false
 def main
    $instruction =2
    @instruction = Window_Instruction.new
    @instruction.x = 0
    @instruction.y = 290
    @indication = Window_Option2.new
    @indication.x = 470
    @indication.y  = 0
    @Window_Option = Window_Option.new
    @Window_Option.x = 0
    @Window_Option.y = 0
    @select_window = Window_Command.new(192, [ "Activer", "Desactiver","Annuler"])
    @select_window.x = 193
    @select_window.y = 0
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
    Graphics.freeze
    # Suppression du fenêtre à la fin de la scène
    @select_window.dispose
  end
 
  def update
    # Mise à jour de la fenêtre
    @select_window.update
    # Quand le joueur va appuyer sur Entrée
    if Input.trigger?(Input::C)
      case @select_window.index
        when 0 #Activer
          if ($option == 1)
            $tempsjeu = 1 #activer temps jeu
            print "le temps est activer"
            @indication.dispose
          else
            if ($option == 2)
              $pas = 1 #activer pas
              print "le nombre de pas est activer"
              @indication.dispose
            else
              $argent = 1 #activer pas
              print " l'argent est activer"
              @indication.dispose
            end
          end
          @indication = Window_Option2.new
          @indication.x = 470
          @indication.y  = 0
          when 1 #Desactiver
            if ($option == 1)
              $tempsjeu = 0 #desactiver temps jeu
              print "le temps est desactiver"
              @indication.dispose
            else
              if ($option == 2)
                $pas = 0 #desactiver pas
                print "le nombre de pas est desactiver"
                @indication.dispose
              else
                $argent = 0 #desactiver pas
                print " l'argent est desactiver"
                @indication.dispose
              end
            end
            @indication = Window_Option2.new
            @indication.x = 470
            @indication.y  = 0
            when 2 #Annuler
              @indication.dispose
              @instruction.dispose
              $scene = OptionV2.new
              @Window_Option.dispose
        end
      end
    end
  end
 
  #=======================================================================
 
class Option_Oui_Non
 def main
    $instruction =4
    @instruction = Window_Instruction.new
    @instruction.x = 0
    @instruction.y = 290
    @indication = Window_Option2.new
    @indication.x = 470
    @indication.y  = 0
    @Window_Option = Window_Option.new
    @Window_Option.x = 0
    @Window_Option.y = 0
    @select_window = Window_Command.new(192, [ "Oui", "Non"])
    @select_window.x = 193
    @select_window.y = 0
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update
        if $scene != self
          break
        end
    end
    Graphics.freeze
      # Suppression du fenêtre à la fin de la scène
    @select_window.dispose
  end
 
  def update
    # Mise à jour de la fenêtre
    @select_window.update
      # Quand le joueur va appuyer sur Entrée
      if Input.trigger?(Input::C)
        case @select_window.index
          when 0 #Oui
            $tempsjeu = 1 #activer temps jeu
            $pas = 1 #activer pas
            $argent = 1 #activer pas
            $position = 1
            @indication.dispose
            @indication = Window_Option2.new
            @indication.x = 470
            @indication.y  = 0
            @instruction.dispose
            @indication.dispose
            $scene = OptionV2.new
            @Window_Option.dispose
          when 1 #Non
            @instruction.dispose
            @indication.dispose
            $scene = OptionV2.new
            @Window_Option.dispose
        end
      end
    end
  end
 
  #=======================================================================
 
  #==========================================================================
#Option du menu position du menu
#==========================================================================
class Position_Menu
#------------------------------------------------------------------------------------------------------------------------------------
# Valeur position menu:
# 1 = haut-gauche
# 2 = bas-gauche
# 3 = haut-droite
# 4 = bas-droite
# Par défault = 1
#------------------------------------------------------------------------------------------------------------------------------------
  def main
    $instruction =3
    @instruction = Window_Instruction.new
    @instruction.x = 0
    @instruction.y = 290
    @indication = Window_Option2.new
    @indication.x = 470
    @indication.y  = 0
    @Window_Option = Window_Option.new
    @Window_Option.x = 0
    @Window_Option.y = 0
    @select_window = Window_Command.new(192, [ "Haut-Gauche", "Bas-Gauche","Haut-Droite","Bas-Droite","Annuler"])
    @select_window.x = 193
    @select_window.y = 0
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
    Graphics.freeze
      # Suppression du fenêtre à la fin de la scène
    @select_window.dispose
  end
 
  def update
    # Mise à jour de la fenêtre
    @select_window.update
    # Quand le joueur va appuyer sur Entrée
    if Input.trigger?(Input::C)
      case @select_window.index
        when 0 #haut-gauche
          $position = 1
          print "La position du menu a été régler sur haut-gauche"
          @indication.dispose
          @indication = Window_Option2.new
          @indication.x = 470
          @indication.y  = 0
        when 1 #bas-gauche
          $position = 2
          print "La position du menu a été régler sur bas-gauche"
          @indication.dispose
          @indication = Window_Option2.new
          @indication.x = 470
          @indication.y  = 0
        when 2 #haut-droite
          $position = 3
          print "La position du menu a été régler sur haut-droite"
          @indication.dispose
          @indication = Window_Option2.new
          @indication.x = 470
          @indication.y  = 0
        when 3 #bas-droite
          $position = 4
          print "La position du menu a été régler sur bas-droite"
          @indication.dispose
          @indication = Window_Option2.new
          @indication.x = 470
          @indication.y  = 0
        when 4 #Annuler
          @instruction.dispose
          @indication.dispose
          $scene = OptionV2.new
          @Window_Option.dispose
      end
    end
  end
end
et pour le deuxième ceci:
Code:
#==============================================================================
# ■ Window_Option
# Par mew72
#==============================================================================

class Window_Option < Window_Base
  def initialize
    super(0, 0, 192, 224)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.name = $fontface
    self.contents.font.size = $fontsize
    refresh
  end
  def refresh
    self.contents.clear
    self.contents.font.color = system_color
    self.contents.draw_text(4, 0, 130, 32, "Temps jeu")
    self.contents.draw_text(4, 32, 120, 32,"Nombre pas")
    self.contents.draw_text(4, 64, 110, 32,"Argents")
    self.contents.draw_text(4, 96, 130, 32,"Position menu")
    self.contents.draw_text(4, 128, 90, 32,"Défault")
    self.contents.draw_text(4, 160, 80, 32,"Sortir")
  end
end

#==============================================================================
# ■ Window_Option_2
# Par mew72
#==============================================================================

class Window_Option2 < Window_Base
  def initialize
    super(0, 0, 210, 290)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.name = $fontface
    self.contents.font.size = $fontsize
    refresh
  end
  def refresh
    self.contents.clear
    self.contents.font.color = system_color
    self.contents.draw_text(4, 0, 130, 32, "Temps jeu")
    if ($tempsjeu == 1)
      self.contents.draw_text(10, 32, 120, 32,"Activer")
    else
      self.contents.draw_text(10, 32, 120, 32,"Desactiver")
    end
    self.contents.draw_text(4, 64, 110, 32,"Nombre pas")
    if ($pas == 1)
      self.contents.draw_text(10, 96, 100, 32,"Activer")
    else
      self.contents.draw_text(10, 96, 100, 32,"Desactiver")
    end
    self.contents.draw_text(4, 128, 90, 32,"Argents")
    if ($argent == 1)
      self.contents.draw_text(10, 160, 80, 32,"Activer")
    else
      self.contents.draw_text(10, 160, 80, 32,"Desactiver")
    end
    self.contents.draw_text(4, 192, 100, 32,"Position menu")
      if ($position == 1)
        self.contents.draw_text(10, 224, 100, 32,"haut gauche")
      else
        if ($position == 2)
          self.contents.draw_text(10, 224, 100, 32,"bas gauche")
        else
          if ($position == 3)
            self.contents.draw_text(10, 224, 100, 32,"haut droite")
          else
            self.contents.draw_text(10, 224, 100, 32,"bas droite")
          end
        end
      end
  end
end

#==============================================================================
# ■ Window_Instruction
# Par mew72
#==============================================================================

class Window_Instruction < Window_Base
  def initialize
    super(0, 0, 640, 190)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.name = $fontface
    self.contents.font.size = $fontsize
    refresh
  end
  def refresh
    if ($instruction ==1) # instruction choix option
      self.contents.clear
      self.contents.font.color = system_color
      self.contents.draw_text(130, 0, 400, 32, "Choisisez l'option du menu a changer")
    else
      if ($instruction == 2) # instruction activer ou desactiver
        self.contents.clear
        self.contents.font.color = system_color
        self.contents.draw_text(100, 0, 500, 32, "Choisisez si vous voulez activer ou desactiver l'option")
        self.contents.draw_text(120, 32, 400, 32,"Ou bien ne rien changer en choisisant annuler")
      else
        if ($instruction == 3) # instruction position menu
          self.contents.clear
          self.contents.font.color = system_color
          self.contents.draw_text(160, 0, 500, 32, "Choisisez la position du menu")
        else
          if ($instruction == 4) # instruction default
            self.contents.clear
            self.contents.font.color = system_color
            self.contents.draw_text(100, 0, 500, 32, "Voulez vous revenir en default c'est a dire:")
            self.contents.draw_text(110, 32, 400, 32,"Temps,nombre de pas et argent activer")
            self.contents.draw_text(130, 64, 400, 32,"Menu positionner en haut a gauche")
          end
        end
      end
    end
  end
end

Les fautes seront corriger

Crédit obligatoire:
-Mew72

Venox

avatar
Fondateur
Fondateur

Merci à toi mew72 pour ce précieux script :cheers: !

mew72

mew72
Super Membre
Super Membre

Ce script est assez vieux mais peu être bien quand des joueur on marre d'avoir toujours le même menu

Venox

avatar
Fondateur
Fondateur

Ouais c'est vrai ça, mais palus beaucoup de monde n'utilise ce genre de script maintenant c'est plus le moghunter ;)

mew72

mew72
Super Membre
Super Membre

oui mais je connais juste les base du rgss donc je ne peut pas faire beaucoup de chose

Sena

Sena
Membre Royal
Membre Royal

Une image ?

mew72

mew72
Super Membre
Super Membre

mew72 a écrit:
Image(cliquer pour agrandir):
Spoiler:
Il y en a déja

Contenu sponsorisé



Revenir en haut  Message [Page 1 sur 1]

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

 

Ne ratez plus aucun deal !
Abonnez-vous pour recevoir par notification une sélection des meilleurs deals chaque jour.
IgnorerAutoriser