Connexion automatique

Pas encore membre ? Inscrivez-vous ici !
Vous avez oublié votre mot de passe ? On vous aide ici

AccueilPage d'accueilFAQRechercherS'enregistrerConnexion

Sélecteur de thème :


Partagez | .
-----Menu option plus V2.0----- By Adurna

Dudu'
Staffieux retraité

Staffieux retraité
avatar

Nombre de messages : 2060
Age : 26
Capacités : bon
Distinction : Apprenti KGB-boy en avenir
[Coco' Smile]
Hamsterphile de service ^^
[Balby' le Fake]
Grand prof de la MA
[Skillo]
Ce grand programmateur, mon coeur, ma vie ! [Hamu']
Date d'inscription : 22/06/2009

MessageSujet: -----Menu option plus V2.0----- By Adurna   Lun 28 Juin 2010 - 9:37

Menu Option Plus V 2.0



Author: Adurna
Version: 2.0
Date: 11/03/10
Description: A menu different from the original with more options!
Directions for use: Paste the script above Main in appointing him: Scene_Menu.
resource is added Sel1, SEL2, Sel3, and Sel4 Sel00 in Graphics / System
Code:


#=================================================================#
#                      By Adurna                                                        11/03/10                                                              #
#                                          menu option plus version 2.0                                                                                    #
#=================================================================#
module Cache
  def self.menu(filename)
    load_bitmap("Graphics/System/",filename)
  end
end


module Adurna
Obj = "Item"
Comp = "Skill"
Equip = "Equir"
Stat = "Status"
Sov = "Save"
Char = "Load"
Fin = "Exit"
Or = "Gold"
Location ="Location :"
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
      @menu_select = Sprite.new
    @menu_select.bitmap = Cache.menu("Sel00")
    @status_window=Window_MenuStatus2.new(220, 58)
    @status_window.opacity = 0
    @location_window = Window_location.new(190, 0)
  #  @location_window.opacity = 0
  @gold = Window_gold.new(0,245)
  #@gold.opacity = 0
    @win_actor =  Window_Vide.new
  #  @win_actor.opacity = 0
  end
  #--------------------------------------------------------------------------
  # * Termination Processing
  #--------------------------------------------------------------------------
  def terminate
    super
    dispose_menu_background
    @command_window.dispose
    @location_window.dispose
    @menu_select.dispose
    @status_window.dispose
    @win_actor.dispose
    @gold.dispose
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    super
  update_menu_background
  @menu_select.update
  @win_actor.update
  @gold.update
  @status_window.update
    @command_window.update
    if @command_window.active
      update_command_selection
    elsif @status_window.active
      update_actor_selection
      @win_actor.update
    end
  end
  #--------------------------------------------------------------------------
  # * Create Command Window
  #--------------------------------------------------------------------------
  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_IconCommand.new(172, [s1, s2, s3, s4, s5, s6,s7])
    @command_window.index = @menu_index
    #@command_window.opacity = 0
 
    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
  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
      elsif Dir.glob('Save*.rvdata').size <=0 and @command_window.index == 5
        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
  #--------------------------------------------------------------------------
  # * 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
  end
  #--------------------------------------------------------------------------
  # * Update Actor Selection
  #--------------------------------------------------------------------------
def update_actor_selection
    @status_window.update
  case @status_window.index
  when 0
    @win_actor.dispose
    @win_actor =  Window_Actor1.new(0)
    when 1
      @win_actor.dispose
      @win_actor =  Window_Actor1.new(1)
    when 2
      @win_actor.dispose
      @win_actor =  Window_Actor1.new(2)
    when 3
      @win_actor.dispose
      @win_actor =  Window_Actor1.new(3)
    end
  @status_window.update
  case @status_window.index
    when 0
    @menu_select.bitmap = Cache.menu("Sel1")
    when 1
    @menu_select.bitmap = Cache.menu("Sel2")
    when 2
    @menu_select.bitmap = Cache.menu("Sel3")
    when 3
      @menu_select.bitmap = Cache.menu("Sel4")
    end
    @menu_select.z = 10

  #@win_actor.opacity = 0
    if Input.trigger?(Input::B)
      @win_actor.dispose
      @win_actor =  Window_Vide.new
      @menu_select.bitmap = Cache.menu("Sel00")
      Sound.play_cancel
      end_actor_selection
    elsif Input.trigger?(Input::C)
      @win_actor = Window_Vide.new
      $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+28)
    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(35, -8, 280, 32, Adurna::Location)
    self.contents.font.color = normal_color
    self.contents.draw_text(0, -8, 360, 32, @map_name, 1)
    draw_icon(Adurna::Icon_Loc,8, -4, 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

class Window_Vide< Window_Base
  def initialize
    super(-544,-416,544,416)
    self.contents = Bitmap.new(width, height)
  end
  def refresh
    self.contents.clear
    end
  end

class Window_Actor1< Window_Base
  def initialize(actor_id)
    super(135,286, 375, 125)
    self.contents = Bitmap.new(width - 32, height - 32)
    @actor = $game_party.members[actor_id]
    refresh
  end
  def refresh
    self.contents.clear
    if @actor != -1
    draw_actor_face(@actor, 0, 0)
    draw_actor_name(@actor, 100, 10)
    draw_actor_class(@actor, 100, 35)
      draw_actor_level(@actor, 100, 60) 
      draw_actor_state(@actor, 200, 60)   
      draw_actor_hp(@actor,  200, 10)
      draw_actor_mp(@actor, 200, 35)   
      end
    end
end

  class Window_MenuStatus2< Window_Selectable
  def initialize(x, y)
    super(x, y, 220, 220)
    self.contents.font.bold = true
    self.contents.font.shadow = true
    self.contents.font.size = 16
    refresh
    self.active = false
    self.index = -1
  end
  def refresh
    self.contents.clear
    @item_max = $game_party.members.size
    for actor in $game_party.members
      if actor.index == 0
      draw_actor_graphic(actor, 25, 110)
      elsif actor.index == 1
      draw_actor_graphic(actor, 95, 30)
      elsif actor.index == 2
      draw_actor_graphic(actor, 165, 110)
      elsif actor.index == 3
      draw_actor_graphic(actor,95,  190)
      end
    end
  end
  def update_cursor
  end
end

class Window_gold < Window_Base
  def initialize(x, y)
    super(x, y, 130, (WLH*2) + 32)
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh
  end
  def refresh
    self.contents.clear
    self.contents.font.color = system_color
    self.contents.draw_text(-15, -4, 128, 32, Adurna::Or,1)
    self.contents.font.color = normal_color
    self.contents.draw_text(-25, -10+WLH, 140, 42, $game_party.gold, 1)
    draw_icon(Adurna::Icon_Or,0, 0, true)
  end
end

resources:
Sel1
Spoiler:
 
Sel2
Spoiler:
 
Sel3
Spoiler:
 
Sel4
Spoiler:
 
Sel00
Spoiler:
 
screen:

And a big thank you to Mist' for helping me to debug my script ^ ^