RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
Rmvxa script troubleshooting help

0 Members and 1 Guest are viewing this topic.

**
Rep: +0/-0Level 83
I'm trying to make a custom selectable window and I want to show a picture for each item. The problem I am having is that the first item picture works as it should, but the subsequent pictures do not appear.

I looked through the other classes and as far as I can tell it should work, but obviously I am missing something. Can anybody give me any tips?



Code: [Select]
class Window_CraftSlots < Window_Selectable
  def initialize(x, y, width, height)
    super
    #self.windowskin = nil
    get_unlocked_slots(1)
    draw_all_items
    refresh
    activate
  end
  def get_unlocked_slots (unlockedslots)
    @unlockedslots = unlockedslots
  end
  def draw_item(index)
    draw_empty_slot(index)
  end
  def col_max
    return 2
  end
  def item_max
    return 8
  end
  def item_height
    line_height * 4
  end
  def draw_empty_slot(index)
    if index + 1 <= @unlockedslots
      bitmap = Cache.picture("craftslot.png")
    else
      bitmap = Cache.picture("lockedcraftslot.png")
    end
    rect = item_rect(index)
    contents.blt(rect.x + 1, rect.y + 1, bitmap, rect, 255)
    bitmap.dispose
  end
end