Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

CMS Request

Okay, for this CMS, I need quite a few things.
http://img.photobucket.com/albums/v253/kaze950/CMS.png[/IMG]
For the picture thing in the left hand corner., I will be needing it so I can change the picture in game by either a variable or script command. Tell me the size of the picture when you script it.

  • For the Window that shows text, I would like it that I can set in the script what text it displays when on a certain option (For example, when highlighting "Item", it says 'View and Use all items that you have collected'.)
  • For Key Items, I need it to be like the Item window, but only shows items with a certain element (So, obviously, the regular Item window would NOT show items with that element)
  • For Monster Data, I just need that option to call
  • $scene = Scene_MonsterBook.new
  • For the satus icons, just let me set in the script what status effect goes with what icon. Let it show up to 2 icons (Since, I think their are only two icons in my game which are displayed outside of battle),with the icons going vertically on the far right side of the actor information.
  • For the faces, just let them be graphics in the picture folder, with he same name as the actor. And, if possible, make it so when ther actor is Knocked out, the face turns black and white.
  • For the bars, either create them yourselves, or allow it so I can use Cogwheel's Plug n' Play bars.0

Anyone who does this will get MAJOR credits in my game. I would be REALLY appreciative.
 
Wow, this is looking awesome so far. Thank you for doing this!

I can change what the different menu options say in the script right? Like, change 'View Important Items', to something else, right?
 
IDK all of them at the moment, but I'm pretty sure it will just be Poison and Knocked Out. They can be what ever number you make them. Same with the Key Items. The Number doesn't really matter, since I can just edit the database for different numbers.

Thanks for doing this.
 
Here ya go. If you don't like the way it is, please tell me so I can change it straight away.
Code:
#===========================================================================
#  Custom Menu Script for kaze950
#  Created my MeisMe
#  Credit to:
#             Acident Prone - Bars
#             ccoa - Icon Status
#---------------------------------------------------------------------------
#  INSTRUCTIONS
#  1) Inset this script into a new section above 'Main'
#  2) In Scene_Item, Scene_Skill, Scene_Equip, Scene_Status and Scene_End, 
#     increase the number in every $scene = Scene_Menu.new(#) by ONE.
#     The Scene_MonsterBook one should read $scene = Scene_Menu.new(5)
#  3) Change KEY_ITEM to the atribute ID of your key items. DO NOT ADD ANY 
#     ZEROS(0) TO THE FRONT!
#  4) Change the variables in the Game_System class to what you need.
#  5) Enjoy!
#===========================================================================


KEY_ITEM = 1 # This is the atribute id of key items.

#==============================================================================
# ** Game_System
#------------------------------------------------------------------------------
#  This class handles data surrounding the system. Backround music, etc.
#  is managed here as well. Refer to "$game_system" for the instance of 
#  this class.
#==============================================================================

class Game_System
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor :menu_pic
  attr_accessor :menu_help
  #--------------------------------------------------------------------------
  # * Object Aliasing
  #--------------------------------------------------------------------------
  alias old_initialize initialize
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    old_initialize
    @menu_pic = 'Menupic'
    s1 = 'View important items.'
    s2 = 'Use regular items.'
    s3 = 'Use character skills'
    s4 = 'Change character equipment.'
    s5 = 'View character status.'
    s6 = 'View enemy data.'
    s7 = 'Quit the game.'
    @menu_help = [s1, s2, s3, s4, s5, s6, s7]
  end
end


#==============================================================================
# ** Game_Actor
#------------------------------------------------------------------------------
#  This class handles the actor. It's used within the Game_Actors class
#  ($game_actors) and refers to the Game_Party class ($game_party).
#==============================================================================

class Game_Actor
  #--------------------------------------------------------------------------
  # * Get the current EXP
  #--------------------------------------------------------------------------
  def now_exp
    return @exp - @exp_list[@level]
  end
  #--------------------------------------------------------------------------
  # * Get the next level's EXP
  #--------------------------------------------------------------------------
  def next_exp
    return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0
  end
end

#==============================================================================
# ** Window_Base
#------------------------------------------------------------------------------
#  This class is for all in-game windows.
#==============================================================================

class Window_Base
  def draw_hp_bar(actor, x, y, width, height)
    c1 = Color.new(255, 0, 0)
    c2 = Color.new(155, 0, 0)
    e1 = actor.hp
    e2 = actor.maxhp
    self.contents.fill_rect(x - 1, y - 1, width + 2, height + 3,
      Color.new(0, 0, 0))
    self.contents.fill_rect(x, y, width, height + 1, Color.new(0, 0, 0))
    w = width * e1 / e2
    for i in 0..height
      r = c1.red + (c2.red - c1.red) * (height - i) / height + 0 * i /
        height
      g = c1.green + (c2.green - c1.green) * (height -i) / height + 0 * i /
        height
      b = c1.blue + (c2.blue - c1.blue) * (height - i) / height + 0 * i /
        height
      a = c1.alpha + (c2.alpha - c1.alpha) * (height - i) / height + 255 * i /
        height
      self.contents.fill_rect(x, y + i, w, 1, Color.new(r, g, b, a))
    end
  end
  def draw_sp_bar(actor, x, y, width, height)
    c1 = Color.new(0, 0, 255)
    c2 = Color.new(0, 0, 155)
    e1 = actor.hp
    e2 = actor.maxsp
    self.contents.fill_rect(x - 1, y - 1, width + 2, height + 3,
      Color.new(0, 0, 0))
    self.contents.fill_rect(x, y, width, height + 1, Color.new(0, 0, 0))
    return if e2 == 0
    w = width * e1 / e2
    for i in 0..height
      r = c1.red + (c2.red - c1.red) * (height - i) / height + 0 * i /
        height
      g = c1.green + (c2.green - c1.green) * (height -i) / height + 0 * i /
        height
      b = c1.blue + (c2.blue - c1.blue) * (height - i) / height + 0 * i /
        height
      a = c1.alpha + (c2.alpha - c1.alpha) * (height - i) / height + 255 * i /
        height
      self.contents.fill_rect(x, y + i, w, 1, Color.new(r, g, b, a))
    end
  end
  def draw_exp_bar(actor, x, y, width, height)
    c1 = Color.new(255, 255, 0)
    c2 = Color.new(155, 155, 0)
    e1 = actor.now_exp
    e2 = actor.next_exp
    self.contents.fill_rect(x - 1, y - 1, width + 2, height + 3,
      Color.new(0, 0, 0))
    self.contents.fill_rect(x, y, width, height + 1, Color.new(0, 0, 0))
    if e2 == 0
      e1 = 1
      e2 = 1
    end
    w = width * e1 / e2
    for i in 0..height
      r = c1.red + (c2.red - c1.red) * (height - i) / height + 0 * i /
        height
      g = c1.green + (c2.green - c1.green) * (height -i) / height + 0 * i /
        height
      b = c1.blue + (c2.blue - c1.blue) * (height - i) / height + 0 * i /
        height
      a = c1.alpha + (c2.alpha - c1.alpha) * (height - i) / height + 255 * i /
        height
      self.contents.fill_rect(x, y + i, w, 1, Color.new(r, g, b, a))
    end
  end
  alias old_draw_actor_hp draw_actor_hp
  alias old_draw_actor_sp draw_actor_sp
  alias old_draw_actor_exp draw_actor_exp
  #--------------------------------------------------------------------------
  # * Draw EXP
  #     actor : actor
  #     x     : draw spot x-coordinate
  #     y     : draw spot y-coordinate
  #--------------------------------------------------------------------------
  def draw_actor_exp(actor, x, y)
    draw_exp_bar(actor, x + 1, y + 16, 200, 6)
    old_draw_actor_exp(actor, x, y)
  end
  #--------------------------------------------------------------------------
  # * Draw HP
  #     actor : actor
  #     x     : draw spot x-coordinate
  #     y     : draw spot y-coordinate
  #     width : draw spot width
  #--------------------------------------------------------------------------
  def draw_actor_hp(actor, x, y, width = 144)
    draw_hp_bar(actor, x + 1, y + 16, width - 4, 6)
    old_draw_actor_hp(actor, x, y, width = 144)
  end
  #--------------------------------------------------------------------------
  # * Draw SP
  #     actor : actor
  #     x     : draw spot x-coordinate
  #     y     : draw spot y-coordinate
  #     width : draw spot width
  #--------------------------------------------------------------------------
  def draw_actor_sp(actor, x, y, width = 144)
    draw_sp_bar(actor, x + 1, y + 16, width - 4, 6)
    old_draw_actor_sp(actor, x, y, width = 144)
  end
  def make_battler_state_images(battler)
    images = []
    for i in battler.states
      images.push(RPG::Cache.icon($data_states[i].name))
    end
    return images
  end
  def draw_actor_state(actor, x, y, width = 120)
    images = make_battler_state_images(actor)
    for i in 0...images.length
      rect = Rect.new(x + (i * 26), y, self.width - 32, 24)
      self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
      self.contents.blt(x + (i * 26), y, images[i], Rect.new(0, 0, 24, 24), 255)
    end
  end
end


#==============================================================================
# ** Window_PlayTime
#------------------------------------------------------------------------------
#  This window displays play time on the menu screen.
#==============================================================================

class Window_PlayTime
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(0, 0, 160, 64)
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    self.contents.clear
    self.contents.font.color = system_color
    self.contents.draw_text(4, 0, 120, 32, "T")
    @total_sec = Graphics.frame_count / Graphics.frame_rate
    hour = @total_sec / 60 / 60
    min = @total_sec / 60 % 60
    sec = @total_sec % 60
    text = sprintf("%02d:%02d:%02d", hour, min, sec)
    self.contents.font.color = normal_color
    self.contents.draw_text(4, 0, 120, 32, text, 2)
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    super
    if Graphics.frame_count / Graphics.frame_rate != @total_sec
      refresh
    end
  end
end


#==============================================================================
# ** Window_MenuStatus
#------------------------------------------------------------------------------
#  This window displays party member status on the menu screen.
#==============================================================================

class Window_MenuStatus < Window_Selectable
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(0, 64, 480, 416)
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh
    self.active = false
    self.index = -1
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    @item_max = $game_party.actors.size
    for i in 0...$game_party.actors.size
      x = 68
      y = i * 96
      actor = $game_party.actors[i]
      bitmap = RPG::Cache.picture(actor.name)
      opacity = actor.state?(1) ? 160 : 255
      self.contents.blt(x - 64, y + 16, bitmap, Rect.new(0, 0, 64, 64), opacity)
      x = 80
      draw_actor_name(actor, x, y)
      draw_actor_level(actor, x + 144, y)
      draw_actor_state(actor, x + 144, y + 32)
      draw_actor_exp(actor, x + 144, y + 64)
      draw_actor_hp(actor, x, y + 32)
      draw_actor_sp(actor, x, y + 64)
    end
  end
  #--------------------------------------------------------------------------
  # * Cursor Rectangle Update
  #--------------------------------------------------------------------------
  def update_cursor_rect
    if @index < 0
      self.cursor_rect.empty
    else
      self.cursor_rect.set(0, @index * 116, self.width - 32, 96)
    end
  end
end


#==============================================================================
# ** Window_Help2
#------------------------------------------------------------------------------
#  This window is a copy of Window_Help
#==============================================================================

class Window_Help2 < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(0, 0, 320, 64)
    self.contents = Bitmap.new(width - 32, height - 32)
  end
  #--------------------------------------------------------------------------
  # * Set Text
  #  text  : text string displayed in window
  #  align : alignment (0..flush left, 1..center, 2..flush right)
  #--------------------------------------------------------------------------
  def set_text(text, align = 0)
    # If at least one part of text and alignment differ from last time
    if text != @text or align != @align
      # Redraw text
      self.contents.clear
      self.contents.font.color = normal_color
      self.contents.draw_text(4, 0, 280, 32, text, align)
      @text = text
      @align = align
    end
    self.visible = true
  end
end


#==============================================================================
# ** Window_KeyItem
#------------------------------------------------------------------------------
#  This window displays importan items in possession.
#==============================================================================

class Window_KeyItem < Window_Selectable
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(0, 64, 640, 416)
    @column_max = 2
    refresh
    self.index = 0
  end
  #--------------------------------------------------------------------------
  # * Get Item
  #--------------------------------------------------------------------------
  def item
    return @data[self.index]
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    if self.contents != nil
      self.contents.dispose
      self.contents = nil
    end
    @data = []
    # Add items
    for i in 1...$data_items.size
      if $game_party.item_number(i) > 0
        @data.push($data_items[i]) if 
          $data_items[i].element_set.include?(KEY_ITEM)
      end
    end
    for i in 1...$data_weapons.size
      if $game_party.weapon_number(i) > 0
        @data.push($data_weapons[i]) if 
          $data_weapons[i].element_set.include?(KEY_ITEM)
      end
    end
    for i in 1...$data_armors.size
      if $game_party.armor_number(i) > 0
        @data.push($data_armors[i]) if 
          $data_armors[i].guard_element_set.include?(KEY_ITEM)
      end
    end
    # If item count is not 0, make a bit map and draw all items
    @item_max = @data.size
    if @item_max > 0
      self.contents = Bitmap.new(width - 32, row_max * 32)
      for i in 0...@item_max
        draw_item(i)
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Draw Item
  #     index : item number
  #--------------------------------------------------------------------------
  def draw_item(index)
    item = @data[index]
    number = $game_party.item_number(item.id)
    self.contents.font.color = normal_color
    x = 4 + index % 2 * (288 + 32)
    y = index / 2 * 32
    rect = Rect.new(x, y, self.width / @column_max - 32, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    bitmap = RPG::Cache.icon(item.icon_name)
    opacity = self.contents.font.color == normal_color ? 255 : 128
    self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
    self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
    self.contents.draw_text(x + 240, y, 16, 32, "x", 1)
    self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2)
  end
  #--------------------------------------------------------------------------
  # * Help Text Update
  #--------------------------------------------------------------------------
  def update_help
    @help_window.set_text(self.item == nil ? "" : self.item.description)
  end
end


#==============================================================================
# ** Scene_KeyItem
#------------------------------------------------------------------------------
#  This class performs item screen processing.
#==============================================================================

class Scene_KeyItem
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  def main
    # Make help window, item window
    @help_window = Window_Help.new
    @item_window = Window_KeyItem.new
    # Associate help window
    @item_window.help_window = @help_window
    # Make target window (set to invisible / inactive)
    @target_window = Window_Target.new
    @target_window.visible = false
    @target_window.active = false
    # Execute transition
    Graphics.transition
    # Main loop
    loop do
      # Update game screen
      Graphics.update
      # Update input information
      Input.update
      # Frame update
      update
      # Abort loop if screen is changed
      if $scene != self
        break
      end
    end
    # Prepare for transition
    Graphics.freeze
    # Dispose of windows
    @help_window.dispose
    @item_window.dispose
    @target_window.dispose
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # Update windows
    @help_window.update
    @item_window.update
    @target_window.update
    # If item window is active: call update_item
    if @item_window.active
      update_item
      return
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update (when item window is active)
  #--------------------------------------------------------------------------
  def update_item
    # If B button was pressed
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # Switch to menu screen
      $scene = Scene_Menu.new(0)
      return
    end
    # If C button was pressed
    if Input.trigger?(Input::C)
      # Play decision SE
      $game_system.se_play($data_system.decision_se)
      return
    end
  end
end


#==============================================================================
# ** Scene_Menu
#------------------------------------------------------------------------------
#  This class performs menu screen processing.
#==============================================================================

class Scene_Menu
  #--------------------------------------------------------------------------
  # * Object Initialization
  #     menu_index : command cursor's initial position
  #--------------------------------------------------------------------------
  def initialize(menu_index = 0)
    @menu_index = menu_index
  end
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  def main
    # Make command window
    s1 = 'Key ' + $data_system.words.item
    s2 = $data_system.words.item
    s3 = $data_system.words.skill
    s4 = $data_system.words.equip
    s5 = "Status"
    s6 = "Monster Data"
    s7 = "End Game"
    @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6, s7])
    @command_window.index = @menu_index
    # If number of party members is 0
    if $game_party.actors.size == 0
      # Disable items, skills, equipment, and status
      @command_window.disable_item(0)
      @command_window.disable_item(1)
      @command_window.disable_item(2)
      @command_window.disable_item(3)
      @command_window.disable_item(4)
    end
    @command_window.x = 480
    @command_window.y = 64
    # Make play time window
    @playtime_window = Window_PlayTime.new
    @playtime_window.x = 320
    @playtime_window.y = 0
    # Make gold window
    @gold_window = Window_Gold.new
    @gold_window.x = 480
    @gold_window.y = 0
    # Make status window
    @status_window = Window_MenuStatus.new
    @status_window.x = 0
    @status_window.y = 64
    @help_window = Window_Help2.new
    update_help
    @sprite = Sprite.new
    @sprite.x = 480
    @sprite.y = 320
    @sprite.bitmap = RPG::Cache.picture($game_system.menu_pic)
    # Execute transition
    Graphics.transition
    # Main loop
    loop do
      # Update game screen
      Graphics.update
      # Update input information
      Input.update
      # Frame update
      update
      # Abort loop if screen is changed
      if $scene != self
        break
      end
    end
    # Prepare for transition
    Graphics.freeze
    # Dispose of windows
    @command_window.dispose
    @playtime_window.dispose
    @gold_window.dispose
    @status_window.dispose
    @help_window.dispose
    @sprite.dispose
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # Update windows
    @command_window.update
    @playtime_window.update
    @gold_window.update
    @status_window.update
    @help_window.update
    @sprite.update
    # If command window is active: call update_command
    if @command_window.active
      update_command
      update_help
      return
    end
    # If status window is active: call update_status
    if @status_window.active
      update_status
      return
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update (when command window is active)
  #--------------------------------------------------------------------------
  def update_command
    # If B button was pressed
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # Switch to map screen
      $scene = Scene_Map.new
      return
    end
    # If C button was pressed
    if Input.trigger?(Input::C)
      # If command other than save or end game, and party members = 0
      if $game_party.actors.size == 0 and @command_window.index < 5
        # Play buzzer SE
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      # Branch by command window cursor position
      case @command_window.index
      when 0  # key item
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to item screen
        $scene = Scene_KeyItem.new
      when 1  # item
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to item screen
        $scene = Scene_Item.new
      when 2  # skill
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Make status window active
        @command_window.active = false
        @status_window.active = true
        @status_window.index = 0
      when 3  # equipment
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Make status window active
        @command_window.active = false
        @status_window.active = true
        @status_window.index = 0
      when 4  # status
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Make status window active
        @command_window.active = false
        @status_window.active = true
        @status_window.index = 0
      when 5  # save
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to save screen
        $scene = Scene_MonsterBook.new
      when 6  # end game
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to end game screen
        $scene = Scene_End.new
      end
      return
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update (when status window is active)
  #--------------------------------------------------------------------------
  def update_status
    # If B button was pressed
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # Make command window active
      @command_window.active = true
      @status_window.active = false
      @status_window.index = -1
      return
    end
    # If C button was pressed
    if Input.trigger?(Input::C)
      # Branch by command window cursor position
      case @command_window.index
      when 2  # skill
        # If this actor's action limit is 2 or more
        if $game_party.actors[@status_window.index].restriction >= 2
          # Play buzzer SE
          $game_system.se_play($data_system.buzzer_se)
          return
        end
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to skill screen
        $scene = Scene_Skill.new(@status_window.index)
      when 3  # equipment
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to equipment screen
        $scene = Scene_Equip.new(@status_window.index)
      when 4  # status
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to status screen
        $scene = Scene_Status.new(@status_window.index)
      end
      return
    end
  end
  def update_help
    @help_window.set_text($game_system.menu_help[@command_window.index])
  end
end
 
It's Great.

There are still some errors though. I'll post them for you.

http://img.photobucket.com/albums/v253/ ... lem333.png[/IMG]

The bars are having problems. It might be best to take the bars out alltogeather, as I'm using Cogwheel's Plug n' Play Bars, and It'd be good if all my bars matched.

Also, the selection thing is messed up for every Actor besides Actor 1. You see, how in the picture?


Once again, THANK YOU for making this. You have my deepest gratitude and you'll definently get big credit for this :D
 
Interesting... The bars work fine for me.
Anyways, try this code:
Code:
#===========================================================================
#  Custom Menu Script for kaze950
#  Created my MeisMe
#  Credit to:
#             Acident Prone - Bars
#             ccoa - Icon Status
#---------------------------------------------------------------------------
#  INSTRUCTIONS
#  1) Inset this script into a new section above 'Main'
#  2) In Scene_Item, Scene_Skill, Scene_Equip, Scene_Status and Scene_End, 
#     increase the number in every $scene = Scene_Menu.new(#) by ONE.
#     The Scene_MonsterBook one should read $scene = Scene_Menu.new(5)
#  3) Change KEY_ITEM to the atribute ID of your key items. DO NOT ADD ANY 
#     ZEROS(0) TO THE FRONT!
#  4) Change the variables in the Game_System class to what you need.
#  5) Enjoy!
#===========================================================================


KEY_ITEM = 1 # This is the atribute id of key items.

#==============================================================================
# ** Game_System
#------------------------------------------------------------------------------
#  This class handles data surrounding the system. Backround music, etc.
#  is managed here as well. Refer to "$game_system" for the instance of 
#  this class.
#==============================================================================

class Game_System
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor :menu_pic
  attr_accessor :menu_help
  #--------------------------------------------------------------------------
  # * Object Aliasing
  #--------------------------------------------------------------------------
  alias old_initialize initialize
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    old_initialize
    @menu_pic = 'Menupic'
    s1 = 'View important items.'
    s2 = 'Use regular items.'
    s3 = 'Use character skills'
    s4 = 'Change character equipment.'
    s5 = 'View character status.'
    s6 = 'View enemy data.'
    s7 = 'Quit the game.'
    @menu_help = [s1, s2, s3, s4, s5, s6, s7]
  end
end


#==============================================================================
# ** Game_Actor
#------------------------------------------------------------------------------
#  This class handles the actor. It's used within the Game_Actors class
#  ($game_actors) and refers to the Game_Party class ($game_party).
#==============================================================================

class Game_Actor
  #--------------------------------------------------------------------------
  # * Get the current EXP
  #--------------------------------------------------------------------------
  def now_exp
    return @exp - @exp_list[@level]
  end
  #--------------------------------------------------------------------------
  # * Get the next level's EXP
  #--------------------------------------------------------------------------
  def next_exp
    return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0
  end
end

#==============================================================================
# ** Window_Base
#------------------------------------------------------------------------------
#  This class is for all in-game windows.
#==============================================================================

class Window_Base
  def make_battler_state_images(battler)
    images = []
    for i in battler.states
      images.push(RPG::Cache.icon($data_states[i].name))
    end
    return images
  end
  def draw_actor_state(actor, x, y, width = 120)
    images = make_battler_state_images(actor)
    for i in 0...images.length
      rect = Rect.new(x + (i * 26), y, self.width - 32, 24)
      self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
      self.contents.blt(x + (i * 26), y, images[i], Rect.new(0, 0, 24, 24), 255)
    end
  end
end


#==============================================================================
# ** Window_PlayTime
#------------------------------------------------------------------------------
#  This window displays play time on the menu screen.
#==============================================================================

class Window_PlayTime
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(0, 0, 160, 64)
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    self.contents.clear
    self.contents.font.color = system_color
    self.contents.draw_text(4, 0, 120, 32, "T")
    @total_sec = Graphics.frame_count / Graphics.frame_rate
    hour = @total_sec / 60 / 60
    min = @total_sec / 60 % 60
    sec = @total_sec % 60
    text = sprintf("%02d:%02d:%02d", hour, min, sec)
    self.contents.font.color = normal_color
    self.contents.draw_text(4, 0, 120, 32, text, 2)
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    super
    if Graphics.frame_count / Graphics.frame_rate != @total_sec
      refresh
    end
  end
end


#==============================================================================
# ** Window_MenuStatus
#------------------------------------------------------------------------------
#  This window displays party member status on the menu screen.
#==============================================================================

class Window_MenuStatus < Window_Selectable
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(0, 64, 480, 416)
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh
    self.active = false
    self.index = -1
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    @item_max = $game_party.actors.size
    for i in 0...$game_party.actors.size
      x = 68
      y = i * 96
      actor = $game_party.actors[i]
      bitmap = RPG::Cache.picture(actor.name)
      opacity = actor.state?(1) ? 160 : 255
      self.contents.blt(x - 64, y, bitmap, Rect.new(0, 0, 96, 96), opacity)
      x = 112
      draw_actor_name(actor, x, y)
      draw_actor_level(actor, x + 144, y)
      draw_actor_state(actor, x + 144, y + 32)
      draw_actor_exp(actor, x + 144, y + 64)
      draw_actor_hp(actor, x, y + 32)
      draw_actor_sp(actor, x, y + 64)
    end
  end
  #--------------------------------------------------------------------------
  # * Cursor Rectangle Update
  #--------------------------------------------------------------------------
  def update_cursor_rect
    if @index < 0
      self.cursor_rect.empty
    else
      self.cursor_rect.set(0, @index * 116, self.width - 32, 96)
    end
  end
end


#==============================================================================
# ** Window_Help2
#------------------------------------------------------------------------------
#  This window is a copy of Window_Help
#==============================================================================

class Window_Help2 < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(0, 0, 320, 64)
    self.contents = Bitmap.new(width - 32, height - 32)
  end
  #--------------------------------------------------------------------------
  # * Set Text
  #  text  : text string displayed in window
  #  align : alignment (0..flush left, 1..center, 2..flush right)
  #--------------------------------------------------------------------------
  def set_text(text, align = 0)
    # If at least one part of text and alignment differ from last time
    if text != @text or align != @align
      # Redraw text
      self.contents.clear
      self.contents.font.color = normal_color
      self.contents.draw_text(4, 0, 280, 32, text, align)
      @text = text
      @align = align
    end
    self.visible = true
  end
end


#==============================================================================
# ** Window_KeyItem
#------------------------------------------------------------------------------
#  This window displays importan items in possession.
#==============================================================================

class Window_KeyItem < Window_Selectable
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(0, 64, 640, 416)
    @column_max = 2
    refresh
    self.index = 0
  end
  #--------------------------------------------------------------------------
  # * Get Item
  #--------------------------------------------------------------------------
  def item
    return @data[self.index]
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    if self.contents != nil
      self.contents.dispose
      self.contents = nil
    end
    @data = []
    # Add items
    for i in 1...$data_items.size
      if $game_party.item_number(i) > 0
        @data.push($data_items[i]) if 
          $data_items[i].element_set.include?(KEY_ITEM)
      end
    end
    for i in 1...$data_weapons.size
      if $game_party.weapon_number(i) > 0
        @data.push($data_weapons[i]) if 
          $data_weapons[i].element_set.include?(KEY_ITEM)
      end
    end
    for i in 1...$data_armors.size
      if $game_party.armor_number(i) > 0
        @data.push($data_armors[i]) if 
          $data_armors[i].guard_element_set.include?(KEY_ITEM)
      end
    end
    # If item count is not 0, make a bit map and draw all items
    @item_max = @data.size
    if @item_max > 0
      self.contents = Bitmap.new(width - 32, row_max * 32)
      for i in 0...@item_max
        draw_item(i)
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Draw Item
  #     index : item number
  #--------------------------------------------------------------------------
  def draw_item(index)
    item = @data[index]
    number = $game_party.item_number(item.id)
    self.contents.font.color = normal_color
    x = 4 + index % 2 * (288 + 32)
    y = index / 2 * 32
    rect = Rect.new(x, y, self.width / @column_max - 32, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    bitmap = RPG::Cache.icon(item.icon_name)
    opacity = self.contents.font.color == normal_color ? 255 : 128
    self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
    self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
    self.contents.draw_text(x + 240, y, 16, 32, "x", 1)
    self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2)
  end
  #--------------------------------------------------------------------------
  # * Help Text Update
  #--------------------------------------------------------------------------
  def update_help
    @help_window.set_text(self.item == nil ? "" : self.item.description)
  end
end


#==============================================================================
# ** Scene_KeyItem
#------------------------------------------------------------------------------
#  This class performs item screen processing.
#==============================================================================

class Scene_KeyItem
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  def main
    # Make help window, item window
    @help_window = Window_Help.new
    @item_window = Window_KeyItem.new
    # Associate help window
    @item_window.help_window = @help_window
    # Make target window (set to invisible / inactive)
    @target_window = Window_Target.new
    @target_window.visible = false
    @target_window.active = false
    # Execute transition
    Graphics.transition
    # Main loop
    loop do
      # Update game screen
      Graphics.update
      # Update input information
      Input.update
      # Frame update
      update
      # Abort loop if screen is changed
      if $scene != self
        break
      end
    end
    # Prepare for transition
    Graphics.freeze
    # Dispose of windows
    @help_window.dispose
    @item_window.dispose
    @target_window.dispose
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # Update windows
    @help_window.update
    @item_window.update
    @target_window.update
    # If item window is active: call update_item
    if @item_window.active
      update_item
      return
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update (when item window is active)
  #--------------------------------------------------------------------------
  def update_item
    # If B button was pressed
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # Switch to menu screen
      $scene = Scene_Menu.new(0)
      return
    end
    # If C button was pressed
    if Input.trigger?(Input::C)
      # Play decision SE
      $game_system.se_play($data_system.decision_se)
      return
    end
  end
end


#==============================================================================
# ** Scene_Menu
#------------------------------------------------------------------------------
#  This class performs menu screen processing.
#==============================================================================

class Scene_Menu
  #--------------------------------------------------------------------------
  # * Object Initialization
  #     menu_index : command cursor's initial position
  #--------------------------------------------------------------------------
  def initialize(menu_index = 0)
    @menu_index = menu_index
  end
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  def main
    # Make command window
    s1 = 'Key ' + $data_system.words.item
    s2 = $data_system.words.item
    s3 = $data_system.words.skill
    s4 = $data_system.words.equip
    s5 = "Status"
    s6 = "Monster Data"
    s7 = "End Game"
    @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6, s7])
    @command_window.index = @menu_index
    # If number of party members is 0
    if $game_party.actors.size == 0
      # Disable items, skills, equipment, and status
      @command_window.disable_item(0)
      @command_window.disable_item(1)
      @command_window.disable_item(2)
      @command_window.disable_item(3)
      @command_window.disable_item(4)
    end
    @command_window.x = 480
    @command_window.y = 64
    # Make play time window
    @playtime_window = Window_PlayTime.new
    @playtime_window.x = 320
    @playtime_window.y = 0
    # Make gold window
    @gold_window = Window_Gold.new
    @gold_window.x = 480
    @gold_window.y = 0
    # Make status window
    @status_window = Window_MenuStatus.new
    @status_window.x = 0
    @status_window.y = 64
    @help_window = Window_Help2.new
    update_help
    @sprite = Sprite.new
    @sprite.x = 480
    @sprite.y = 320
    @sprite.bitmap = RPG::Cache.picture($game_system.menu_pic)
    # Execute transition
    Graphics.transition
    # Main loop
    loop do
      # Update game screen
      Graphics.update
      # Update input information
      Input.update
      # Frame update
      update
      # Abort loop if screen is changed
      if $scene != self
        break
      end
    end
    # Prepare for transition
    Graphics.freeze
    # Dispose of windows
    @command_window.dispose
    @playtime_window.dispose
    @gold_window.dispose
    @status_window.dispose
    @help_window.dispose
    @sprite.dispose
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # Update windows
    @command_window.update
    @playtime_window.update
    @gold_window.update
    @status_window.update
    @help_window.update
    @sprite.update
    # If command window is active: call update_command
    if @command_window.active
      update_command
      update_help
      return
    end
    # If status window is active: call update_status
    if @status_window.active
      update_status
      return
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update (when command window is active)
  #--------------------------------------------------------------------------
  def update_command
    # If B button was pressed
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # Switch to map screen
      $scene = Scene_Map.new
      return
    end
    # If C button was pressed
    if Input.trigger?(Input::C)
      # If command other than save or end game, and party members = 0
      if $game_party.actors.size == 0 and @command_window.index < 5
        # Play buzzer SE
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      # Branch by command window cursor position
      case @command_window.index
      when 0  # key item
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to item screen
        $scene = Scene_KeyItem.new
      when 1  # item
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to item screen
        $scene = Scene_Item.new
      when 2  # skill
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Make status window active
        @command_window.active = false
        @status_window.active = true
        @status_window.index = 0
      when 3  # equipment
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Make status window active
        @command_window.active = false
        @status_window.active = true
        @status_window.index = 0
      when 4  # status
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Make status window active
        @command_window.active = false
        @status_window.active = true
        @status_window.index = 0
      when 5  # save
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to save screen
        $scene = Scene_MonsterBook.new
      when 6  # end game
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to end game screen
        $scene = Scene_End.new
      end
      return
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update (when status window is active)
  #--------------------------------------------------------------------------
  def update_status
    # If B button was pressed
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # Make command window active
      @command_window.active = true
      @status_window.active = false
      @status_window.index = -1
      return
    end
    # If C button was pressed
    if Input.trigger?(Input::C)
      # Branch by command window cursor position
      case @command_window.index
      when 2  # skill
        # If this actor's action limit is 2 or more
        if $game_party.actors[@status_window.index].restriction >= 2
          # Play buzzer SE
          $game_system.se_play($data_system.buzzer_se)
          return
        end
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to skill screen
        $scene = Scene_Skill.new(@status_window.index)
      when 3  # equipment
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to equipment screen
        $scene = Scene_Equip.new(@status_window.index)
      when 4  # status
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to status screen
        $scene = Scene_Status.new(@status_window.index)
      end
      return
    end
  end
  def update_help
    @help_window.set_text($game_system.menu_help[@command_window.index])
  end
end
 
That makes the bars work fine. THanks

But, the selection thing is still the same (Check the pic above).

Also, I noticed, while items with the Key Item element go in the Key Item menu, those items still go into the item menu. is there anyway to exclude items that are important from the regular item menu?

Also, is there anyway to make it so the faces bigger without them cutting out, because the faces I use are 96x96
 
Ok then. This code should be bug free.
Code:
#===========================================================================
#  Custom Menu Script for kaze950
#  Created my MeisMe
#  Credit to: ccoa - Icon Status
#---------------------------------------------------------------------------
#  INSTRUCTIONS
#  1) Inset this script into a new section above 'Main'
#  2) In Scene_Item, Scene_Skill, Scene_Equip, Scene_Status and Scene_End, 
#     increase the number in every $scene = Scene_Menu.new(#) by ONE.
#     The Scene_MonsterBook one should read $scene = Scene_Menu.new(5)
#  3) Change KEY_ITEM to the atribute ID of your key items. DO NOT ADD ANY 
#     ZEROS(0) TO THE FRONT!
#  4) Change the variables in the Game_System class to what you need.
#  5) Enjoy!
#===========================================================================


KEY_ITEM = 1 # This is the atribute id of key items.

#==============================================================================
# ** Game_System
#------------------------------------------------------------------------------
#  This class handles data surrounding the system. Backround music, etc.
#  is managed here as well. Refer to "$game_system" for the instance of 
#  this class.
#==============================================================================

class Game_System
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor :menu_pic
  attr_accessor :menu_help
  #--------------------------------------------------------------------------
  # * Object Aliasing
  #--------------------------------------------------------------------------
  alias old_initialize initialize
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    old_initialize
    @menu_pic = 'Menupic'
    s1 = 'View important items.'
    s2 = 'Use regular items.'
    s3 = 'Use character skills'
    s4 = 'Change character equipment.'
    s5 = 'View character status.'
    s6 = 'View enemy data.'
    s7 = 'Quit the game.'
    @menu_help = [s1, s2, s3, s4, s5, s6, s7]
  end
end


#==============================================================================
# ** Game_Actor
#------------------------------------------------------------------------------
#  This class handles the actor. It's used within the Game_Actors class
#  ($game_actors) and refers to the Game_Party class ($game_party).
#==============================================================================

class Game_Actor
  #--------------------------------------------------------------------------
  # * Get the current EXP
  #--------------------------------------------------------------------------
  def now_exp
    return @exp - @exp_list[@level]
  end
  #--------------------------------------------------------------------------
  # * Get the next level's EXP
  #--------------------------------------------------------------------------
  def next_exp
    return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0
  end
end

#==============================================================================
# ** Window_Base
#------------------------------------------------------------------------------
#  This class is for all in-game windows.
#==============================================================================

class Window_Base
  def make_battler_state_images(battler)
    images = []
    for i in battler.states
      images.push(RPG::Cache.icon($data_states[i].name))
    end
    return images
  end
  def draw_actor_state(actor, x, y, width = 120)
    images = make_battler_state_images(actor)
    for i in 0...images.length
      rect = Rect.new(x + (i * 26), y, self.width - 32, 24)
      self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
      self.contents.blt(x + (i * 26), y, images[i], Rect.new(0, 0, 24, 24), 255)
    end
  end
end


#==============================================================================
# ** Window_PlayTime
#------------------------------------------------------------------------------
#  This window displays play time on the menu screen.
#==============================================================================

class Window_PlayTime
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(0, 0, 160, 64)
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    self.contents.clear
    self.contents.font.color = system_color
    self.contents.draw_text(4, 0, 120, 32, "T")
    @total_sec = Graphics.frame_count / Graphics.frame_rate
    hour = @total_sec / 60 / 60
    min = @total_sec / 60 % 60
    sec = @total_sec % 60
    text = sprintf("%02d:%02d:%02d", hour, min, sec)
    self.contents.font.color = normal_color
    self.contents.draw_text(4, 0, 120, 32, text, 2)
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    super
    if Graphics.frame_count / Graphics.frame_rate != @total_sec
      refresh
    end
  end
end


#==============================================================================
# ** Window_MenuStatus
#------------------------------------------------------------------------------
#  This window displays party member status on the menu screen.
#==============================================================================

class Window_MenuStatus < Window_Selectable
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(0, 64, 480, 416)
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh
    self.active = false
    self.index = -1
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    @item_max = $game_party.actors.size
    for i in 0...$game_party.actors.size
      x = 68
      y = i * 96
      actor = $game_party.actors[i]
      bitmap = RPG::Cache.picture(actor.name)
      opacity = actor.state?(1) ? 160 : 255
      self.contents.blt(x - 64, y, bitmap, Rect.new(0, 0, 96, 96), opacity)
      x = 112
      draw_actor_name(actor, x, y)
      draw_actor_level(actor, x + 144, y)
      draw_actor_state(actor, x + 144, y + 32)
      draw_actor_exp(actor, x + 144, y + 64)
      draw_actor_hp(actor, x, y + 32)
      draw_actor_sp(actor, x, y + 64)
    end
  end
  #--------------------------------------------------------------------------
  # * Cursor Rectangle Update
  #--------------------------------------------------------------------------
  def update_cursor_rect
    if @index < 0
      self.cursor_rect.empty
    else
      self.cursor_rect.set(0, @index * 96, self.width - 32, 96)
    end
  end
end


#==============================================================================
# ** Window_Help2
#------------------------------------------------------------------------------
#  This window is a copy of Window_Help
#==============================================================================

class Window_Help2 < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(0, 0, 320, 64)
    self.contents = Bitmap.new(width - 32, height - 32)
  end
  #--------------------------------------------------------------------------
  # * Set Text
  #  text  : text string displayed in window
  #  align : alignment (0..flush left, 1..center, 2..flush right)
  #--------------------------------------------------------------------------
  def set_text(text, align = 0)
    # If at least one part of text and alignment differ from last time
    if text != @text or align != @align
      # Redraw text
      self.contents.clear
      self.contents.font.color = normal_color
      self.contents.draw_text(4, 0, 280, 32, text, align)
      @text = text
      @align = align
    end
    self.visible = true
  end
end


#==============================================================================
# ** Window_KeyItem
#------------------------------------------------------------------------------
#  This window displays importan items in possession.
#==============================================================================

class Window_KeyItem < Window_Selectable
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(0, 64, 640, 416)
    @column_max = 2
    refresh
    self.index = 0
  end
  #--------------------------------------------------------------------------
  # * Get Item
  #--------------------------------------------------------------------------
  def item
    return @data[self.index]
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    if self.contents != nil
      self.contents.dispose
      self.contents = nil
    end
    @data = []
    # Add items
    for i in 1...$data_items.size
      if $game_party.item_number(i) > 0
        @data.push($data_items[i]) if 
          $data_items[i].element_set.include?(KEY_ITEM)
      end
    end
    for i in 1...$data_weapons.size
      if $game_party.weapon_number(i) > 0
        @data.push($data_weapons[i]) if 
          $data_weapons[i].element_set.include?(KEY_ITEM)
      end
    end
    for i in 1...$data_armors.size
      if $game_party.armor_number(i) > 0
        @data.push($data_armors[i]) if 
          $data_armors[i].guard_element_set.include?(KEY_ITEM)
      end
    end
    # If item count is not 0, make a bit map and draw all items
    @item_max = @data.size
    if @item_max > 0
      self.contents = Bitmap.new(width - 32, row_max * 32)
      for i in 0...@item_max
        draw_item(i)
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Draw Item
  #     index : item number
  #--------------------------------------------------------------------------
  def draw_item(index)
    item = @data[index]
    number = $game_party.item_number(item.id)
    self.contents.font.color = normal_color
    x = 4 + index % 2 * (288 + 32)
    y = index / 2 * 32
    rect = Rect.new(x, y, self.width / @column_max - 32, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    bitmap = RPG::Cache.icon(item.icon_name)
    opacity = self.contents.font.color == normal_color ? 255 : 128
    self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
    self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
    self.contents.draw_text(x + 240, y, 16, 32, "x", 1)
    self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2)
  end
  #--------------------------------------------------------------------------
  # * Help Text Update
  #--------------------------------------------------------------------------
  def update_help
    @help_window.set_text(self.item == nil ? "" : self.item.description)
  end
end


#==============================================================================
# ** Window_Item
#------------------------------------------------------------------------------
#  This window displays items in possession on the item and battle screens.
#==============================================================================

class Window_Item
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    if self.contents != nil
      self.contents.dispose
      self.contents = nil
    end
    @data = []
    # Add items
    for i in 1...$data_items.size
      if $game_party.item_number(i) > 0
        @data.push($data_items[i]) if not
          $data_items[i].element_set.include?(KEY_ITEM)
      end
    end
    for i in 1...$data_weapons.size
      if $game_party.weapon_number(i) > 0
        @data.push($data_weapons[i]) if not
          $data_weapons[i].element_set.include?(KEY_ITEM)
      end
    end
    for i in 1...$data_armors.size
      if $game_party.armor_number(i) > 0
        @data.push($data_armors[i]) if not
          $data_armors[i].guard_element_set.include?(KEY_ITEM)
      end
    end
    # If item count is not 0, make a bit map and draw all items
    @item_max = @data.size
    if @item_max > 0
      self.contents = Bitmap.new(width - 32, row_max * 32)
      for i in 0...@item_max
        draw_item(i)
      end
    end
  end
end


#==============================================================================
# ** Scene_KeyItem
#------------------------------------------------------------------------------
#  This class performs item screen processing.
#==============================================================================

class Scene_KeyItem
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  def main
    # Make help window, item window
    @help_window = Window_Help.new
    @item_window = Window_KeyItem.new
    # Associate help window
    @item_window.help_window = @help_window
    # Make target window (set to invisible / inactive)
    @target_window = Window_Target.new
    @target_window.visible = false
    @target_window.active = false
    # Execute transition
    Graphics.transition
    # Main loop
    loop do
      # Update game screen
      Graphics.update
      # Update input information
      Input.update
      # Frame update
      update
      # Abort loop if screen is changed
      if $scene != self
        break
      end
    end
    # Prepare for transition
    Graphics.freeze
    # Dispose of windows
    @help_window.dispose
    @item_window.dispose
    @target_window.dispose
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # Update windows
    @help_window.update
    @item_window.update
    @target_window.update
    # If item window is active: call update_item
    if @item_window.active
      update_item
      return
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update (when item window is active)
  #--------------------------------------------------------------------------
  def update_item
    # If B button was pressed
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # Switch to menu screen
      $scene = Scene_Menu.new(0)
      return
    end
    # If C button was pressed
    if Input.trigger?(Input::C)
      # Play decision SE
      $game_system.se_play($data_system.decision_se)
      return
    end
  end
end


#==============================================================================
# ** Scene_Menu
#------------------------------------------------------------------------------
#  This class performs menu screen processing.
#==============================================================================

class Scene_Menu
  #--------------------------------------------------------------------------
  # * Object Initialization
  #     menu_index : command cursor's initial position
  #--------------------------------------------------------------------------
  def initialize(menu_index = 0)
    @menu_index = menu_index
  end
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  def main
    # Make command window
    s1 = 'Key ' + $data_system.words.item
    s2 = $data_system.words.item
    s3 = $data_system.words.skill
    s4 = $data_system.words.equip
    s5 = "Status"
    s6 = "Monster Data"
    s7 = "End Game"
    @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6, s7])
    @command_window.index = @menu_index
    # If number of party members is 0
    if $game_party.actors.size == 0
      # Disable items, skills, equipment, and status
      @command_window.disable_item(0)
      @command_window.disable_item(1)
      @command_window.disable_item(2)
      @command_window.disable_item(3)
      @command_window.disable_item(4)
    end
    @command_window.x = 480
    @command_window.y = 64
    # Make play time window
    @playtime_window = Window_PlayTime.new
    @playtime_window.x = 320
    @playtime_window.y = 0
    # Make gold window
    @gold_window = Window_Gold.new
    @gold_window.x = 480
    @gold_window.y = 0
    # Make status window
    @status_window = Window_MenuStatus.new
    @status_window.x = 0
    @status_window.y = 64
    @help_window = Window_Help2.new
    update_help
    @sprite = Sprite.new
    @sprite.x = 480
    @sprite.y = 320
    @sprite.bitmap = RPG::Cache.picture($game_system.menu_pic)
    # Execute transition
    Graphics.transition
    # Main loop
    loop do
      # Update game screen
      Graphics.update
      # Update input information
      Input.update
      # Frame update
      update
      # Abort loop if screen is changed
      if $scene != self
        break
      end
    end
    # Prepare for transition
    Graphics.freeze
    # Dispose of windows
    @command_window.dispose
    @playtime_window.dispose
    @gold_window.dispose
    @status_window.dispose
    @help_window.dispose
    @sprite.dispose
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # Update windows
    @command_window.update
    @playtime_window.update
    @gold_window.update
    @status_window.update
    @help_window.update
    @sprite.update
    # If command window is active: call update_command
    if @command_window.active
      update_command
      update_help
      return
    end
    # If status window is active: call update_status
    if @status_window.active
      update_status
      return
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update (when command window is active)
  #--------------------------------------------------------------------------
  def update_command
    # If B button was pressed
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # Switch to map screen
      $scene = Scene_Map.new
      return
    end
    # If C button was pressed
    if Input.trigger?(Input::C)
      # If command other than save or end game, and party members = 0
      if $game_party.actors.size == 0 and @command_window.index < 5
        # Play buzzer SE
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      # Branch by command window cursor position
      case @command_window.index
      when 0  # key item
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to item screen
        $scene = Scene_KeyItem.new
      when 1  # item
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to item screen
        $scene = Scene_Item.new
      when 2  # skill
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Make status window active
        @command_window.active = false
        @status_window.active = true
        @status_window.index = 0
      when 3  # equipment
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Make status window active
        @command_window.active = false
        @status_window.active = true
        @status_window.index = 0
      when 4  # status
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Make status window active
        @command_window.active = false
        @status_window.active = true
        @status_window.index = 0
      when 5  # save
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to save screen
        $scene = Scene_MonsterBook.new
      when 6  # end game
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to end game screen
        $scene = Scene_End.new
      end
      return
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update (when status window is active)
  #--------------------------------------------------------------------------
  def update_status
    # If B button was pressed
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # Make command window active
      @command_window.active = true
      @status_window.active = false
      @status_window.index = -1
      return
    end
    # If C button was pressed
    if Input.trigger?(Input::C)
      # Branch by command window cursor position
      case @command_window.index
      when 2  # skill
        # If this actor's action limit is 2 or more
        if $game_party.actors[@status_window.index].restriction >= 2
          # Play buzzer SE
          $game_system.se_play($data_system.buzzer_se)
          return
        end
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to skill screen
        $scene = Scene_Skill.new(@status_window.index)
      when 3  # equipment
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to equipment screen
        $scene = Scene_Equip.new(@status_window.index)
      when 4  # status
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to status screen
        $scene = Scene_Status.new(@status_window.index)
      end
      return
    end
  end
  def update_help
    @help_window.set_text($game_system.menu_help[@command_window.index])
  end
end
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top