Very Simple Item Menu

Discussion in 'RGSS3 Scripts (RMVX Ace)' started by lemongreen, Jun 13, 2014.

  1. lemongreen

    lemongreen Veteran Veteran

    Messages:
    230
    Likes Received:
    258
    First Language:
    English
    Simple Item Menu ver. 1.0
    by lemongreen



    Introduction
    Just a very simple edit to the item menu so it only shows Items and Key Items; also the number total now only shows for regular items. It also gets rid of the help box. I made it based on the item menu from Mad Father due to liking the style and figuring it would work in a short game I'm working on.

    Screenshots

    Here's what it looks like:

    [​IMG]

    And here's what it's based off of:

    [​IMG]

    (I know it doesn't actually look close to the same at all, but it's what I could manage...)

    How to Use
    Just paste it in above Main and it'll work. (Chances are high that it won't work with other scripts that change the items menu; I haven't really tested it in such a way, anyways)

    Script
    Here's a Dropbox link for people who would prefer that still.

    Code:
    =begin
    #--------------------------------------------------------------------------
    #Very Simple Item Menu Edit
    #Version 1,0
    #June 6, 2014
    #By smallhobbit (or lemongreen)
    #--------------------------------------------------------------------------
    A simple edit to the item menu so it only shows Items and Key Items as well as
    gets rid of the Help Text; also, only regular Items have numbers. Supposed to
    emulate the item menu from "Mad Father"
    
    Just paste it in above Main and it'll work. (though probably not with other
    Item menu changing scripts)
    =end
    
    
    class Window_ItemCategory < Window_HorzCommand
      #--------------------------------------------------------------------------
      # * Get Window Width
      #--------------------------------------------------------------------------
      def window_width
        Graphics.width/2
      end
      #--------------------------------------------------------------------------
      # * Get Digit Count (changed number)
      #--------------------------------------------------------------------------
      def col_max
        return 2
      end
      #--------------------------------------------------------------------------
      # * Create Command List (Items & Key Items only)
      #--------------------------------------------------------------------------
      def make_command_list
        add_command(Vocab::item,     :item)
        add_command(Vocab::key_item, :key_item)
      end
    end
    
    class Window_ItemList < Window_Selectable
      #--------------------------------------------------------------------------
      # * Get Digit Count (changed number)
      #--------------------------------------------------------------------------
      def col_max
        return 1
      end
      #--------------------------------------------------------------------------
      # * Include in Item List? (removed weapons and armor)
      #--------------------------------------------------------------------------
      def include?(item)
        case @category
        when :item
          item.is_a?(RPG::Item) && !item.key_item?
        when :key_item
          item.is_a?(RPG::Item) && item.key_item?
        else
          false
        end
      end
      #--------------------------------------------------------------------------
      # * Draw Item (changed draw_item_number)
      #--------------------------------------------------------------------------
      def draw_item(index)
        item = @data[index]
          rect = item_rect(index)
          rect.width -= 4
          draw_item_name(item, rect.x, rect.y, enable?(item))
         if item.is_a?(RPG::Item) && !item.key_item?
          draw_item_number(rect, item)
        else
          false
        end
      end
      #--------------------------------------------------------------------------
      # * Draw Number of Items
      #--------------------------------------------------------------------------
      def draw_item_number(rect, item)
        draw_text(rect, sprintf(":%2d", $game_party.item_number(item)), 2)
      end
    end
    
    class Scene_Item < Scene_ItemBase
      #--------------------------------------------------------------------------
      # * Start Processing (removed help window
      #--------------------------------------------------------------------------
      def start
        super
        create_category_window
        create_item_window
      end
      #--------------------------------------------------------------------------
      # * Create Category Window
      #--------------------------------------------------------------------------
      def create_category_window
        @category_window = Window_ItemCategory.new
        @category_window.viewport = @viewport
        @category_window.y = 20
        @category_window.set_handler(:ok,     method(:on_category_ok))
        @category_window.set_handler(:cancel, method(:return_scene))
      end
      #--------------------------------------------------------------------------
      # * Create Item Window
      #--------------------------------------------------------------------------
      def create_item_window
        wy = @category_window.y + @category_window.height
        wh = Graphics.height - 150
        @item_window = Window_ItemList.new(0, wy, Graphics.width/2, wh)
        @item_window.viewport = @viewport
        @item_window.set_handler(:ok,     method(:on_item_ok))
        @item_window.set_handler(:cancel, method(:on_item_cancel))
        @category_window.item_window = @item_window
      end
    end
    Just so people know, I'm fine with either being credited as lemongreen or smallhobbit (I have both in the script header; though if this is confusing then just go with lemongreen) Also, I don't really care how you use this as long as credit is given.

    Thanks
    The general community here (surprisingly I think I've gotten more work done on games since I stopped lurking around on here)

    Author's Notes
    Even though there's really not much to this script, I'll probably come back to it later to make it better... somehow. Also, I don't know how well I'd be able to do compatibility work (though there shouldn't be much in the way of that)
     
    Last edited: Mar 25, 2017
    #1
  2. Panda P.I.

    Panda P.I. Warper Member

    Messages:
    1
    Likes Received:
    0
    Location:
    Washington state, USA
    First Language:
    English
    Awesome! This is exactly what I was looking for and it works like a charm!
     
    #2
  3. moonrabbit

    moonrabbit Villager Member

    Messages:
    18
    Likes Received:
    0
    First Language:
    English
    Thank you so much! This is also exactly what I wanted. :3
     
    #3
  4. Wind (Team Yume)

    Wind (Team Yume) Warper Member

    Messages:
    1
    Likes Received:
    0
    First Language:
    Portuguese
    This is perfect for the game I'm working on, though I wonder if there is a way to center it (horizontally at least)? It would look more beautiful that way in my game

    Thanks!
     
    #4
  5. Moonport

    Moonport 初心者 Member

    Messages:
    21
    Likes Received:
    22
    First Language:
    English
    Primarily Uses:
    N/A
    Hi! I know this is kind of an old post, but I'd really like to use your script. Unfortunately, the Dropbox link is down. Could you please re-upload it again? Thank you!!
     
    #5
  6. lemongreen

    lemongreen Veteran Veteran

    Messages:
    230
    Likes Received:
    258
    First Language:
    English
    Edited the main post to fix the Dropbox link and also add the code directly (the site's changed a lot since I first posted this)
     
    #6
  7. Moonport

    Moonport 初心者 Member

    Messages:
    21
    Likes Received:
    22
    First Language:
    English
    Primarily Uses:
    N/A
    Thank you so much :)
    This works out perfectly!!
     
    #7
  8. ToonRudy

    ToonRudy Warper Member

    Messages:
    1
    Likes Received:
    0
    First Language:
    Spanish
    I love this script, but the only bad thing is that it's too much at the left. I tryied adding @category_windows.x = 20 on
    # * Create Category Window
    and it worked, but I don't know how to make it for
    # * Create Item Window...

    [​IMG]
     
    #8
  9. Roninator2

    Roninator2 Gamer Veteran

    Messages:
    1,770
    Likes Received:
    386
    Location:
    Canada
    First Language:
    English
    Primarily Uses:
    RMVXA
    try that
     
    #9
  10. Lemori

    Lemori Villager Member

    Messages:
    8
    Likes Received:
    21
    Love this script, its what I've been looking for. But is there a way I can add the help window. I want the items to show simple information
    when its selected/highlighted. I can't figure out how to alter it...
     
    #10
  11. Amaia Ruiz

    Amaia Ruiz Warper Member

    Messages:
    2
    Likes Received:
    0
    First Language:
    spanish
    Primarily Uses:
    RMVXA
    Hello, could you make a script in which the menu has "item" and "exit" options only? And if possible I would want the items to be used on events or to show some descriptions but when selected I don´t want them to be given to a character (I don´t know if I am explaining this very well) sorry
     
    #11
  12. Hoorebeke Enterprise

    Hoorebeke Enterprise ~Doom~ Veteran

    Messages:
    30
    Likes Received:
    8
    Location:
    Planet Hoorebeke
    First Language:
    English
    Primarily Uses:
    RMVXA
    This is what I am looking for, I just have to find a way to slightly edit it so I can have Non-Mind Items and Mind Evidence xD
     
    #12

Share This Page