Better Layout for Select Key Item

Hi guys,

I decided I can best showcase what I'm looking for by trying to create a mock-up of it in the graphic program (at least I'm trying to, but I'm quite satisfied with the result).

As I find the Select Key Item menu quite ugly (am I the only one?) I wanted to spread the question: Is it possible to turn this...

Spoiler: What it looks by default
1.png

... into this...

Spoiler: What I want it to look like
2.png

... and does someone like to help me out here?

Edit: If there's no item at all, it could simply print a greyed out "No item" as a string there.


Sorry for having quite a lot of requests lately. :LZScheeze:
That wouldn't be massively hard to do, but I have to ask...why would you want to turn a window showing multiple items at once into one that only shows one at a time? I can't imagine that being convenient for players, especially if they accidentally overshoot the scrolling or the one they want is right at the end.
@Trihan I don't use quite a lot of key items in my recent game (currently I am at 3 items in total) but when I do, they're selectable. I don't want to overload the screen with a huge selection window when less could be more, so my idea is to keep it minimal. Also, most information passed to the player in this very game is done by windows using this gradient style, so for consistency I want to stick with it.
@Trihan I don't use quite a lot of key items in my recent game (currently I am at 3 items in total) but when I do, they're selectable. I don't want to overload the screen with a huge selection window when less could be more, so my idea is to keep it minimal. Also, most information passed to the player in this very game is done by windows using this gradient style, so for consistency I want to stick with it.
You could apply that window style and just make it smaller rather than reducing it to a single item at a time.
Or you get a little creative like I did!

key_item_ace01.jpg
... and does someone like to help me out here?
always... to the limit of my abilities.

Spoiler: up & down
Spoiler: image
1711138903606.png
Spoiler: code
Ruby:
# ╔═══════════════════════════════════════════════╦════════════════════╗
# ║ Title: Alternate Key Item Window View 2       ║  Version: 1.00     ║
# ║ Author: Roninator2                            ║                    ║
# ╠═══════════════════════════════════════════════╬════════════════════╣
# ║ Function:                                     ║   Date Created     ║
# ║                                               ╠════════════════════╣
# ║   Make the key items viewed one at a time     ║    21 Mar 2024     ║
# ╚═══════════════════════════════════════════════╩════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Requires: nil                                                      ║
# ║                                                                    ║
# ╚════════════════════════════════════════════════════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Brief Description:                                                 ║
# ║   Change the key item window to show items one at a time           ║
# ╚════════════════════════════════════════════════════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Instructions:                                                      ║
# ║   Set id of the item that is used as a placeholder for             ║
# ║   when you have no key items to show                               ║
# ╚════════════════════════════════════════════════════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Updates:                                                           ║
# ║ 1.00 - 21 Mar 2024 - Script finished                               ║
# ║                                                                    ║
# ╚════════════════════════════════════════════════════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Credits and Thanks:                                                ║
# ║   Roninator2                                                       ║
# ║                                                                    ║
# ╚════════════════════════════════════════════════════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Terms of use:                                                      ║
# ║  Follow the original Authors terms of use where applicable         ║
# ║    - When not made by me (Roninator2)                              ║
# ║  Free for all uses in RPG Maker except nudity                      ║
# ║  Anyone using this script in their project before these terms      ║
# ║  were changed are allowed to use this script even if it conflicts  ║
# ║  with these new terms. New terms effective 03 Apr 2024             ║
# ║  No part of this code can be used with AI programs or tools        ║
# ║  Credit must be given                                              ║
# ╚════════════════════════════════════════════════════════════════════╝

module R2_Key_Item_Empty
  EMPTY = 17 # id of item that is used to draw Empty text
end

# ╔════════════════════════════════════════════════════════════════════╗
# ║                      End of editable region                        ║
# ╚════════════════════════════════════════════════════════════════════╝

class Window_KeyItem < Window_ItemList
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize(message_window)
    @message_window = message_window
    super(0, 0, window_width, window_height)
    self.openness = 0
    self.opacity = 0
    self.contents_opacity = 255
    deactivate
    set_handler(:ok,     method(:on_ok))
    set_handler(:cancel, method(:on_cancel))
  end
  #--------------------------------------------------------------------------
  # * Start Input Processing
  #--------------------------------------------------------------------------
  def start
    self.category = :key_item
    update_placement
    refresh
    cursor_rect.empty
    select(0)
    open
    activate
  end
  #--------------------------------------------------------------------------
  # * Create Item List
  #--------------------------------------------------------------------------
  def make_item_list
    @data = $game_party.all_items.select {|item| include?(item) }
    if @data.empty?
      item = $data_items[R2_Key_Item_Empty::EMPTY]
      @data.push(item)
    end
    @data.push(nil) if include?(nil)
  end
  #--------------------------------------------------------------------------
  # * Window Width
  #--------------------------------------------------------------------------
  def window_width
    return 250
  end
  #--------------------------------------------------------------------------
  # * Window Height
  #--------------------------------------------------------------------------
  def window_height
    return fitting_height(1)
  end
  #--------------------------------------------------------------------------
  # * Update Window Position
  #--------------------------------------------------------------------------
  def update_placement
    self.x = Graphics.width / 2 - window_width / 2
    self.y = Graphics.height / 3
  end
  #--------------------------------------------------------------------------
  # * Get Digit Count
  #--------------------------------------------------------------------------
  def col_max
    return 1
  end
  #--------------------------------------------------------------------------
  # * Draw Item Name
  #     enabled : Enabled flag. When false, draw semi-transparently.
  #--------------------------------------------------------------------------
  def draw_item_name(item, x, y, enabled = true, width = 172)
    return unless item
    draw_icon(item.icon_index, 0, y, enabled)
    change_color(normal_color, enabled)
    draw_text(24, y, width, line_height, item.name, 1)
  end
  #--------------------------------------------------------------------------
  # * Draw Number of Items
  #--------------------------------------------------------------------------
  def draw_item_number(rect, item)
    rect.x = 0
    draw_text(rect, sprintf(":%2d", $game_party.item_number(item)), 2) unless
    item.id == R2_Key_Item_Empty::EMPTY
  end
  #--------------------------------------------------------------------------
  # * Processing at OK
  #--------------------------------------------------------------------------
  def on_ok
    result = item ? item.id : 0
    $game_variables[$game_message.item_choice_variable_id] = result
    close
  end
  #--------------------------------------------------------------------------
  # * Processing at Cancel
  #--------------------------------------------------------------------------
  def on_cancel
    $game_variables[$game_message.item_choice_variable_id] = 0
    close
  end
  #--------------------------------------------------------------------------
  # * Create Background Bitmap
  #--------------------------------------------------------------------------
  def create_shadow_back
    contents.gradient_fill_rect(0, 0, width / 2, height + 24, back_color2, back_color1)
    contents.gradient_fill_rect(width / 2, 0, width / 2, height + 24, back_color1, back_color2)
  end
  #--------------------------------------------------------------------------
  # * Get Background Color 1
  #--------------------------------------------------------------------------
  def back_color1
    Color.new(0, 0, 0, 160)
  end
  #--------------------------------------------------------------------------
  # * Get Background Color 2
  #--------------------------------------------------------------------------
  def back_color2
    Color.new(0, 0, 0, 0)
  end
  #--------------------------------------------------------------------------
  # * Update Cursor
  #--------------------------------------------------------------------------
  alias :r2_hide_cursor_keyitem    :update_cursor
  def update_cursor
    r2_hide_cursor_keyitem
    cursor_rect.empty
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    make_item_list
    create_contents
    create_shadow_back
    draw_all_items
  end
end
Here is the working script.
Spoiler: Left & right
Spoiler: image
1711138646757.png
Spoiler: code
Ruby:
# ╔═══════════════════════════════════════════════╦════════════════════╗
# ║ Title: Alternate Key Item Window View 1       ║  Version: 1.02     ║
# ║ Author: Roninator2                            ║                    ║
# ╠═══════════════════════════════════════════════╬════════════════════╣
# ║ Function:                                     ║   Date Created     ║
# ║                                               ╠════════════════════╣
# ║   Make the key items viewed one at a time     ║    21 Mar 2024     ║
# ╚═══════════════════════════════════════════════╩════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Requires: nil                                                      ║
# ║                                                                    ║
# ╚════════════════════════════════════════════════════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Brief Description:                                                 ║
# ║   Change the key item window to show items one at a time           ║
# ╚════════════════════════════════════════════════════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Instructions:                                                      ║
# ║   Set id of the item that is used as a placeholder for             ║
# ║   when you have no key items to show                               ║
# ╚════════════════════════════════════════════════════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Updates:                                                           ║
# ║ 1.00 - 21 Mar 2024 - Script finished                               ║
# ║ 1.01 - 21 Mar 2024 - Made Left to Right                            ║
# ║ 1.02 - 24 Mar 2024 - Fixed Bug                                     ║
# ║                                                                    ║
# ╚════════════════════════════════════════════════════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Credits and Thanks:                                                ║
# ║   Roninator2                                                       ║
# ║                                                                    ║
# ╚════════════════════════════════════════════════════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Terms of use:                                                      ║
# ║  Follow the original Authors terms of use where applicable         ║
# ║    - When not made by me (Roninator2)                              ║
# ║  Free for all uses in RPG Maker except nudity                      ║
# ║  Anyone using this script in their project before these terms      ║
# ║  were changed are allowed to use this script even if it conflicts  ║
# ║  with these new terms. New terms effective 03 Apr 2024             ║
# ║  No part of this code can be used with AI programs or tools        ║
# ║  Credit must be given                                              ║
# ╚════════════════════════════════════════════════════════════════════╝

module R2_Key_Item_Empty
  EMPTY = 17 # id of item that is used to draw Empty text
end

# ╔════════════════════════════════════════════════════════════════════╗
# ║                      End of editable region                        ║
# ╚════════════════════════════════════════════════════════════════════╝

class Window_KeyItem < Window_ItemList
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize(message_window)
    @message_window = message_window
    super(0, 0, window_width, window_height)
    self.openness = 0
    self.opacity = 0
    self.contents_opacity = 255
    deactivate
    set_handler(:ok,     method(:on_ok))
    set_handler(:cancel, method(:on_cancel))
  end
  #--------------------------------------------------------------------------
  # * Start Input Processing
  #--------------------------------------------------------------------------
  def start
    self.category = :key_item
    update_placement
    @index = 0
    refresh
    cursor_rect.empty
    select(0)
    open
    activate
    draw_move_item
  end
  #--------------------------------------------------------------------------
  # * Create Item List
  #--------------------------------------------------------------------------
  def make_item_list
    @data = $game_party.all_items.select {|item| include?(item) }
    if @data.empty?
      item = $data_items[R2_Key_Item_Empty::EMPTY]
      @data.push(item)
    end
    @data.push(nil) if include?(nil)
  end
  #--------------------------------------------------------------------------
  # * Window Width
  #--------------------------------------------------------------------------
  def window_width
    return 250
  end
  #--------------------------------------------------------------------------
  # * Window Height
  #--------------------------------------------------------------------------
  def window_height
    return fitting_height(visible_line_number)
  end
  #--------------------------------------------------------------------------
  # * Update Window Position
  #--------------------------------------------------------------------------
  def update_placement
    self.x = Graphics.width / 2 - window_width / 2
    self.y = Graphics.height / 3
  end
  #--------------------------------------------------------------------------
  # * Get Digit Count
  #--------------------------------------------------------------------------
  def col_max
    return 1
  end
  #--------------------------------------------------------------------------
  # * Get Number of Lines to Show
  #--------------------------------------------------------------------------
  def visible_line_number
    return 1
  end
  #--------------------------------------------------------------------------
  # * Get Digit Count
  #--------------------------------------------------------------------------
  def col_max
    return 1
  end
  #--------------------------------------------------------------------------
  # * Get Spacing for Items Arranged Side by Side
  #--------------------------------------------------------------------------
  def spacing
    return 8
  end
  #--------------------------------------------------------------------------
  # * Calculate Width of Window Contents
  #--------------------------------------------------------------------------
  def contents_width
    (item_width + spacing) * item_max - spacing
  end
  #--------------------------------------------------------------------------
  # * Calculate Height of Window Contents
  #--------------------------------------------------------------------------
  def contents_height
    item_height
  end
  #--------------------------------------------------------------------------
  # * Get Leading Digits
  #--------------------------------------------------------------------------
  def top_col
    self.ox / (item_width + spacing)
  end
  #--------------------------------------------------------------------------
  # * Set Leading Digits
  #--------------------------------------------------------------------------
  def top_col=(col)
    self.ox = col * (item_width + spacing)
  end
  #--------------------------------------------------------------------------
  # * Get Trailing Digits
  #--------------------------------------------------------------------------
  def bottom_col
    top_col + col_max - 1
  end
  #--------------------------------------------------------------------------
  # * Set Trailing Digits
  #--------------------------------------------------------------------------
  def bottom_col=(col)
    self.top_col = col - (col_max - 1)
  end
  #--------------------------------------------------------------------------
  # * Scroll Cursor to Position Within Screen
  #--------------------------------------------------------------------------
  def ensure_cursor_visible
    self.top_col = index if index < top_col
    self.bottom_col = index if index > bottom_col
  end
  #--------------------------------------------------------------------------
  # * Get Rectangle for Displaying Items
  #--------------------------------------------------------------------------
  def item_rect(index)
    rect = super
    rect.x = 0
    rect.y = 0
    rect
  end
  #--------------------------------------------------------------------------
  # * Draw All Items
  #--------------------------------------------------------------------------
  def draw_all_items
    draw_item(@index)
  end
  #--------------------------------------------------------------------------
  # * Draw Item
  #--------------------------------------------------------------------------
  def draw_item(index)
    item = @data[index]
    if item
      rect = item_rect(index)
      rect.width -= 4
      draw_item_name(item, rect.x, rect.y, enable?(item))
      draw_item_number(rect, item)
    end
  end
  #--------------------------------------------------------------------------
  # * New * Draw item refresh
  #--------------------------------------------------------------------------
  def draw_move_item
    contents.clear
    create_contents
    create_shadow_back
    draw_all_items
  end
  #--------------------------------------------------------------------------
  # * Get Alignment
  #--------------------------------------------------------------------------
  def alignment
    return 1
  end
  #--------------------------------------------------------------------------
  # * Move Cursor Right
  #--------------------------------------------------------------------------
  def cursor_right(wrap = false)
    if index < item_max - 1
      select((index + 1) % item_max)
    end
    draw_move_item
  end
  #--------------------------------------------------------------------------
  # * Move Cursor Left
  #--------------------------------------------------------------------------
  def cursor_left(wrap = false)
    if index > 0
      select((index - 1 + item_max) % item_max)
    end
    draw_move_item
  end
  #--------------------------------------------------------------------------
  # * Move Cursor Down
  #--------------------------------------------------------------------------
  def cursor_down(wrap = false)
  end
  #--------------------------------------------------------------------------
  # * Move Cursor Up
  #--------------------------------------------------------------------------
  def cursor_up(wrap = false)
  end
  #--------------------------------------------------------------------------
  # * Move Cursor One Page Down
  #--------------------------------------------------------------------------
  def cursor_pagedown
  end
  #--------------------------------------------------------------------------
  # * Move Cursor One Page Up
  #--------------------------------------------------------------------------
  def cursor_pageup
  end
  #--------------------------------------------------------------------------
  # * Draw Item Name
  #     enabled : Enabled flag. When false, draw semi-transparently.
  #--------------------------------------------------------------------------
  def draw_item_name(item, x, y, enabled = true, width = 172)
    return unless item
    draw_icon(item.icon_index, self.ox, y, enabled)
    change_color(normal_color, enabled)
    draw_text(self.ox + 24, y, width, line_height, item.name, alignment)
  end
  #--------------------------------------------------------------------------
  # * Draw Number of Items
  #--------------------------------------------------------------------------
  def draw_item_number(rect, item)
    rect.x = self.ox
    draw_text(rect, sprintf(":%2d", $game_party.item_number(item)), 2) unless
    item.id == R2_Key_Item_Empty::EMPTY
  end
  #--------------------------------------------------------------------------
  # * Create Background Bitmap
  #--------------------------------------------------------------------------
  def create_shadow_back
    contents.gradient_fill_rect(self.ox, 0, width / 2, height + 24, back_color2, back_color1)
    contents.gradient_fill_rect(self.ox + width / 2, 0, width / 2, height + 24, back_color1, back_color2)
  end
  #--------------------------------------------------------------------------
  # * Get Background Color 1
  #--------------------------------------------------------------------------
  def back_color1
    Color.new(0, 0, 0, 160)
  end
  #--------------------------------------------------------------------------
  # * Get Background Color 2
  #--------------------------------------------------------------------------
  def back_color2
    Color.new(0, 0, 0, 0)
  end
  #--------------------------------------------------------------------------
  # * Update Cursor
  #--------------------------------------------------------------------------
  alias :r2_hide_cursor_keyitem    :update_cursor
  def update_cursor
    r2_hide_cursor_keyitem
    cursor_rect.empty
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    contents.clear
    make_item_list
    create_contents
    create_shadow_back
    draw_all_items
  end
end
Empty item used as placeholder but not added to inventory
1711110136474.png
Well, I will paste my code here after I finish running some pending errands.

EDIT: Here's the code.

Ruby:
# * Select Key Item ACE * #
#   Scripter : Kyonides Arkanthes
#   2024-03-21

# Display your Key Items on screen with style!
# Don't forget to add some key items to your party's bag before opening calling
# the Select Item event command or this script might not work as intended.
# You might only need to configure 4 CONSTANTS, yes in ALL_CAPS.
# Yet, this script can run just like any plug & play code available out there.

class Window_KeyItem
  # [Red, Green, Blue, Alpha]
  MAIN_COLOR = [0, 0, 0, 160]
  EDGE_COLOR = [0, 0, 0, 0]
  WINDOW_WIDTH = (Graphics.width - 40) / 2
  POS_Y = Graphics.height / 2 - 24
  def initialize(message_window)
    @message_window = message_window
    @cw = WINDOW_WIDTH - 24
    super(WINDOW_WIDTH / 2, 0, WINDOW_WIDTH, 72)
    self.openness = 0
    create_back_bitmap
    create_back_sprite
    self.back_opacity = 0
    self.opacity = 0
    deactivate
    set_handler(:ok,     method(:on_ok))
    set_handler(:cancel, method(:on_cancel))
  end

  def create_back_bitmap
    @back_bitmap = Bitmap.new(@cw, 24)
    rect1 = Rect.new(0, 0, width, 12)
    rect2 = Rect.new(0, 12, width, height - 24)
    rect3 = Rect.new(0, height - 12, width, 12)
    @back_bitmap.gradient_fill_rect(rect1, back_color2, back_color1, true)
    @back_bitmap.fill_rect(rect2, back_color1)
    @back_bitmap.gradient_fill_rect(rect3, back_color1, back_color2, true)
  end

  def create_back_sprite
    @back_sprite = Sprite.new
    @back_sprite.bitmap = @back_bitmap
    @back_sprite.visible = false
    @back_sprite.x = self.x + 12
    @back_sprite.z = self.z - 1
  end

  def back_color1
    Color.new(*MAIN_COLOR)
  end

  def back_color2
    Color.new(*EDGE_COLOR)
  end

  def start
    self.category = :key_item
    update_placement
    select(0)
    open
    @back_sprite.visible = true
    activate
  end

  def make_item_list
    @data = $game_party.all_items.select {|item| include?(item) }
    @icon_ox = @cw / 2 - item_max * 14
  end

  def update_placement
    self.y = POS_Y
    @back_sprite.y = self.y + 36
  end

  def select(new_index)
    self.index = new_index
    draw_this_item
  end

  def item_max
    @data.size
  end

  def create_contents
    contents.dispose
    self.contents = Bitmap.new(@cw, 48)
  end

  def draw_this_item
    contents.clear_rect(0, 24, @cw, 24)
    item = @data[@index]
    rect = Rect.new(0, 24, @cw - 4, 24)
    draw_item_name(item)
    draw_item_number(rect, item)
  end

  def draw_item(n)
    icon_pos = @data[n].icon_index
    draw_icon(icon_pos, @icon_ox + n * 28, 0, true)
  end

  def draw_item_name(item)
    change_color(normal_color, true)
    draw_text(4, 24, @cw - 32, line_height, item.name)
  end

  def draw_item_number(rect, item)
    draw_text(rect, sprintf(":%2d", $game_party.item_number(item)), 2)
  end

  def hide_backdrop
    @back_sprite.visible = false
  end

  def this_rect
    Rect.new(@icon_ox + @index * 28, 0, 24, 24)
  end

  def update_cursor
    if @index < 0
      cursor_rect.empty
      return
    end
    cursor_rect.set(this_rect)
  end

  def dispose
    super
    @back_bitmap.dispose
    @back_sprite.dispose
  end
end

class Window_Message
  def input_item
    @item_window.start
    Fiber.yield while @item_window.active
    @item_window.hide_backdrop
  end
end
Thanks a lot to all of you, mates. :LZSjoy: I'm sure I can use one of those different script versions. I'll dive into it and I'm quite sure I can then select my key items in a much smarter way.
Well, I will paste my code here after I finish running some pending errands.

EDIT: Here's the code.

Ruby:
# * Select Key Item ACE * #
#   Scripter : Kyonides Arkanthes
#   2024-03-21

# Display your Key Items on screen with style!
# Don't forget to add some key items to your party's bag before opening calling
# the Select Item event command or this script might not work as intended.
# You might only need to configure 4 CONSTANTS, yes in ALL_CAPS.
# Yet, this script can run just like any plug & play code available out there.

class Window_KeyItem
  # [Red, Green, Blue, Alpha]
  MAIN_COLOR = [0, 0, 0, 160]
  EDGE_COLOR = [0, 0, 0, 0]
  WINDOW_WIDTH = (Graphics.width - 40) / 2
  POS_Y = Graphics.height / 2 - 24
  def initialize(message_window)
    @message_window = message_window
    @cw = WINDOW_WIDTH - 24
    super(WINDOW_WIDTH / 2, 0, WINDOW_WIDTH, 72)
    self.openness = 0
    create_back_bitmap
    create_back_sprite
    self.back_opacity = 0
    self.opacity = 0
    deactivate
    set_handler(:ok,     method(:on_ok))
    set_handler(:cancel, method(:on_cancel))
  end

  def create_back_bitmap
    @back_bitmap = Bitmap.new(@cw, 24)
    rect1 = Rect.new(0, 0, width, 12)
    rect2 = Rect.new(0, 12, width, height - 24)
    rect3 = Rect.new(0, height - 12, width, 12)
    @back_bitmap.gradient_fill_rect(rect1, back_color2, back_color1, true)
    @back_bitmap.fill_rect(rect2, back_color1)
    @back_bitmap.gradient_fill_rect(rect3, back_color1, back_color2, true)
  end

  def create_back_sprite
    @back_sprite = Sprite.new
    @back_sprite.bitmap = @back_bitmap
    @back_sprite.visible = false
    @back_sprite.x = self.x + 12
    @back_sprite.z = self.z - 1
  end

  def back_color1
    Color.new(*MAIN_COLOR)
  end

  def back_color2
    Color.new(*EDGE_COLOR)
  end

  def start
    self.category = :key_item
    update_placement
    select(0)
    open
    @back_sprite.visible = true
    activate
  end

  def make_item_list
    @data = $game_party.all_items.select {|item| include?(item) }
    @icon_ox = @cw / 2 - item_max * 14
  end

  def update_placement
    self.y = POS_Y
    @back_sprite.y = self.y + 36
  end

  def select(new_index)
    self.index = new_index
    draw_this_item
  end

  def item_max
    @data.size
  end

  def create_contents
    contents.dispose
    self.contents = Bitmap.new(@cw, 48)
  end

  def draw_this_item
    contents.clear_rect(0, 24, @cw, 24)
    item = @data[@index]
    rect = Rect.new(0, 24, @cw - 4, 24)
    draw_item_name(item)
    draw_item_number(rect, item)
  end

  def draw_item(n)
    icon_pos = @data[n].icon_index
    draw_icon(icon_pos, @icon_ox + n * 28, 0, true)
  end

  def draw_item_name(item)
    change_color(normal_color, true)
    draw_text(4, 24, @cw - 32, line_height, item.name)
  end

  def draw_item_number(rect, item)
    draw_text(rect, sprintf(":%2d", $game_party.item_number(item)), 2)
  end

  def hide_backdrop
    @back_sprite.visible = false
  end

  def this_rect
    Rect.new(@icon_ox + @index * 28, 0, 24, 24)
  end

  def update_cursor
    if @index < 0
      cursor_rect.empty
      return
    end
    cursor_rect.set(this_rect)
  end

  def dispose
    super
    @back_bitmap.dispose
    @back_sprite.dispose
  end
end

class Window_Message
  def input_item
    @item_window.start
    Fiber.yield while @item_window.active
    @item_window.hide_backdrop
  end
end
@caligo334 Kyonides said in his script
Don't forget to add some key items to your party's bag before opening
Can be used with Galv's Use Item on Event! just need to remove "@heading.dispose" in line 232 and @heading.bitmap.dispose in line 233 from Galv's script.
That part of commenting out the @heading.dispose part makes me worry a lot. That's NEVER supposed to be done. All sprites and windows should be disposed of no matter what.

Well, here's the link to my script's thread. Gotta get approved by a moderator first. 😛
Unfortunately removing these two lines makes Galv's script help texts disappear and category names texts to glitch, but everything else still works correctly, you can just remove the glitched texts in the script.
That part of commenting out the @heading.dispose part makes me worry a lot. That's NEVER supposed to be done. All sprites and windows should be disposed of no matter what.

Well, here's the link to my script's thread. Gotta get approved by a moderator first. 😛
Unfortunately removing these two lines makes Galv's script help texts disappear and category names texts to glitch, but everything else still works correctly, you can just remove the glitched texts in the script.
You're free to make as many mistakes as you want.
You also are talking about a script that was not asked about in this thread.
Unfortunately removing these two lines makes Galv's script help texts disappear and category names texts to glitch, but everything else still works correctly, you can just remove the glitched texts in the script.

You're free to make as many mistakes as you want.
You also are talking about a script that was not asked about in this thread.

"What kind of mistake is it?", you caligo might ask. Well, you'd be creating a memory leak issue, useles memory blocks you'll never use again, plus visual glitches because that sprite or window has never been disposed of. This means that whenever you expect it the least, that heading might show up for no good reason. It might happen even if you have changed to another scene a couple of times already.

Original thread: https://forums.rpgmakerweb.com/threads/better-layout-for-select-key-item.167033/