"Select Key Item" menu opacity

Discussion in 'RGSSx Script Support' started by gabicho, Jan 9, 2019.

    Tags:
  1. gabicho

    gabicho Warper Member

    Messages:
    2
    Likes Received:
    1
    First Language:
    english
    Primarily Uses:
    N/A
    Hello! I was wondering if there was a way to have a separate opacity setting for the "select key item" menu that pops up in an event?
    I'm using a custom item menu script (Seiryuki's CATEGORIZE ITEM SCENE) that changes the opacity settings for the item screen on the menu which makes it completely transparent. However, this messes with the key item menu that comes up with an event.
    I wanted to keep the transparent menu-item screen while having an opaque key item menu for events. Is this possible?

    Here's the part of the custom script that deals with the item list and also changes the key item menu::
    class Window_ItemList < Window_Selectable

    alias icat_initialize initialize
    def initialize(x, y, width, height)
    icat_initialize(x, y, 575, height)
    @category = ICAT::VISIBLE_CATEGORY_INDEX
    self.opacity = 255
    end

    def include?(item)
    return false if item == nil
    case @category
    when :item
    item.is_a?(RPG::Item) && !item.key_item?
    when :weapon
    item.is_a?(RPG::Weapon)
    when :armor
    item.is_a?(RPG::Armor)
    when :key_item
    item.is_a?(RPG::Item) && item.key_item?
    when :all_item
    item.is_a?(RPG::Item) || item.is_a?(RPG::Armor) || item.is_a?(RPG::Weapon)
    else
    ###### NEED TO CHECK FOR CUSTOM CATEGORIES HERE AND
    ###### DECIDE IF TO INCLUDE THE ITEM TO IT
    @icategory = item.item_category
    for i in @icategory do
    if @category == i
    return item.item_category.include?(@category)
    end
    end
    return false
    end #when
    end #def

    end #class
     
    #1
  2. mlogan

    mlogan Global Moderators Global Mod

    Messages:
    13,838
    Likes Received:
    7,641
    Location:
    Texas
    First Language:
    English
    Primarily Uses:
    RMMV

    I've moved this thread to Script Support. Please be sure to post your threads in the correct forum next time. Thank you.

     
    #2
  3. ZirconStorms

    ZirconStorms VX & VX Ace Scripts Veteran

    Messages:
    332
    Likes Received:
    107
    First Language:
    English
    Primarily Uses:
    RMVXA
    Add "self.opacity = 255" in Window_KeyItem like this:

    Code:
    class Window_KeyItem < Window_ItemList
      #--------------------------------------------------------------------------
      # * Object Initialization
      #--------------------------------------------------------------------------
      def initialize(message_window)
        @message_window = message_window
        super(0, 0, Graphics.width, fitting_height(4))
        self.openness = 0
        self.opacity = 255
        deactivate
        set_handler(:ok,     method(:on_ok))
        set_handler(:cancel, method(:on_cancel))
      end
    and in the custom scipt, in class Window_ItemList < Window_Selectable (def initialize) add self.opacity = 0, like this:

    Code:
    class Window_ItemList < Window_Selectable
     
      alias icat_initialize initialize
      def initialize(x, y, width, height)
        icat_initialize(x, y, width, height)
        @category = ICAT::VISIBLE_CATEGORY_INDEX
        self.opacity = 0
      end
    upload_2019-1-10_10-8-44.png
    upload_2019-1-10_10-9-0.png
     
    #3
  4. gabicho

    gabicho Warper Member

    Messages:
    2
    Likes Received:
    1
    First Language:
    english
    Primarily Uses:
    N/A
    ^
    Thank you so much!! It worked perfectly!
     
    #4
    ZirconStorms likes this.

Share This Page