# * Custom Menu System (CMS) by mewsterus
# * To install, just insert this in a descriptive code slot right above Main
#===============================================================================
# ¦ Window_Base
#-------------------------------------------------------------------------------
#   Edited by mewsterus
#===============================================================================

class Window_Base
  #-----------------------------------------------------------------------------
  # @ Draw state
  #-----------------------------------------------------------------------------
  def draw_actor_state(actor, x, y, width = 120)
    text = make_battler_state_text(actor, width, true)
    self.contents.font.color = actor.hp == 0 ? knockout_color : normal_color
    self.contents.draw_text(x, y, width, 32, text, 2)
  end
  #-----------------------------------------------------------------------------
  # @ Draw EXP
  #-----------------------------------------------------------------------------
  def draw_actor_exp(actor, x, y, width = 144)
    self.contents.font.color = system_color
    self.contents.draw_text(x, y, 48, 32, "Exp")
    self.contents.font.color = normal_color
    self.contents.draw_text(x + width - 48, y, 48, 32, actor.exp_s, 2)
  end
end

#===============================================================================
# ¦ Window_MenuStatus
#-------------------------------------------------------------------------------
#   Edited by mewsterus
#===============================================================================

class Window_MenuStatus < Window_Selectable
  #-----------------------------------------------------------------------------
  # @ Create the window
  #-----------------------------------------------------------------------------
  def initialize
    height = ($game_party.actors.size) * 112 + 32
    super(0, 480 - height, 280, height)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.name = $fontface
    self.contents.font.size = $fontsize
    self.back_opacity = 160
    refresh
    self.active = false
    self.index = -1
  end
  #-----------------------------------------------------------------------------
  # @ Refresh the contents
  #-----------------------------------------------------------------------------
  def refresh
    self.contents.clear
    @item_max = $game_party.actors.size
    for i in 0...$game_party.actors.size
      y = i * 112
      actor = $game_party.actors[i]
      draw_actor_graphic(actor, 192, y + 96)
      draw_actor_name(actor, 4, y)
      draw_actor_state(actor, 94, y)
      draw_actor_level(actor, 4, y + 20)
      draw_actor_class(actor, 68, y + 20)
      draw_actor_hp(actor, 4, y + 40)
      draw_actor_sp(actor, 4, y + 60)
      draw_actor_exp(actor, 4, y + 80)
    end
  end
  #-----------------------------------------------------------------------------
  # @ Update the cursor
  #-----------------------------------------------------------------------------
  def update_cursor_rect
    if @index < 0
      self.cursor_rect.empty
    else
      self.cursor_rect.set(0, @index * 112, self.width - 32, 112)
    end
  end
end

#===============================================================================
# ¦ Scene_Menu
#-------------------------------------------------------------------------------
#   Edited by mewsterus
#===============================================================================

class Scene_Menu
  #-----------------------------------------------------------------------------
  # @ Create the menu
  #-----------------------------------------------------------------------------
  def initialize(menu_index = 0)
    @menu_index = menu_index
  end
  #-----------------------------------------------------------------------------
  # @ Main loop
  #-----------------------------------------------------------------------------
  def main
    s1 = $data_system.words.item
    s2 = $data_system.words.skill
    s3 = $data_system.words.equip
    s4 = "Status"
    s5 = "Save"
    s6 = "Reset Game"
    s7 = "End Game"
    @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6, s7])
    @command_window.x = 760
    @command_window.index = @menu_index
    @command_window.back_opacity = 160
    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
    @status_window = Window_MenuStatus.new
    @status_window.x = -280
    @sprite = Spriteset_Map.new
    if $itemdrop_enabled
      @itemdrop = Window_Command.new(160, ["Basic", "Equipment", "Quest"])
    else
      @itemdrop = Window_Base.new(240, 144, 160, 128)
    end
    @itemdrop.x = 320
    @itemdrop.y = -160
    @itemdrop.back_opacity = 160
    @itemdrop.active = false
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      if @command_window.x > 480
        @command_window.x -= 40
      end
      if @status_window.x < 0
        @status_window.x += 40
      else
        update
      end
      if $scene != self
        break
      end
    end
    for i in 0..7
      @command_window.x += 40
      @status_window.x -= 40
      @itemdrop.y -= 40
      Graphics.update
    end
    Graphics.freeze
    @sprite.dispose
    @command_window.dispose
    @status_window.dispose
    @itemdrop.dispose
  end
  #-----------------------------------------------------------------------------
  # @ Update the scene
  #-----------------------------------------------------------------------------
  def update
    @sprite.update
    @command_window.update
    @status_window.update
    @itemdrop.update
    if @command_window.active
      update_command
      return
    end
    if @status_window.active
      update_status
      return
    end
    if @itemdrop.active
      update_itemdrop
      return
    end
  end
  #-----------------------------------------------------------------------------
  # @ Update the command window
  #-----------------------------------------------------------------------------
  def update_command
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      $scene = Scene_Map.new
      return
    end
    if Input.trigger?(Input::C)
      if $game_party.actors.size == 0 and @command_window.index < 4
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      case @command_window.index
      when 0
        $game_system.se_play($data_system.decision_se)
        if $itemdrop_enabled
          loop do
            if @itemdrop.y < 0
              @itemdrop.y += 40
            else
              break
            end
            Graphics.update
          end
          @command_window.active = false
          @itemdrop.active = true
          return
        end
        $scene = Scene_Item.new
      when 1
        $game_system.se_play($data_system.decision_se)
        @command_window.active = false
        @status_window.active = true
        @status_window.index = 0
      when 2
        $game_system.se_play($data_system.decision_se)
        @command_window.active = false
        @status_window.active = true
        @status_window.index = 0
      when 3
        $game_system.se_play($data_system.decision_se)
        @command_window.active = false
        @status_window.active = true
        @status_window.index = 0
      when 4
        if $game_system.save_disabled
          $game_system.se_play($data_system.buzzer_se)
          return
        end
        $game_system.se_play($data_system.decision_se)
        $scene = Scene_Save.new
      when 5
        $game_system.se_play($data_system.decision_se)
        Audio.bgm_fade(800)
        Audio.bgs_fade(800)
        Audio.me_fade(800)
        $scene = Scene_Title.new
      when 6
        $game_system.se_play($data_system.decision_se)
        Audio.bgm_fade(800)
        Audio.bgs_fade(800)
        Audio.me_fade(800)
        $scene = nil
      end
      return
    end
  end
  #-----------------------------------------------------------------------------
  # @ Update the itemdrop window
  #-----------------------------------------------------------------------------
  def update_itemdrop
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      loop do
        if @itemdrop.y > -160
          @itemdrop.y -= 40
        else
          break
        end
        Graphics.update
      end
      @itemdrop.active = false
      @command_window.active = true
      return
    end
    if Input.trigger?(Input::C)
      $game_system.se_play($data_system.decision_se)
      $scene = Scene_Item.new(@itemdrop.index + 20)
    end
  end
end

    Source: geocities.com/mewsterus/scripts

               ( geocities.com/mewsterus)