RMRK is retiring.
Server is paid up for the rest of 2026, but the forum may go after that. See here for more information. Please archive or save anything you would like to keep before 2027.
Main Menu
  • Welcome to The RPG Maker Resource Kit.

Rmvxa script troubleshooting help

Started by czernobog, June 19, 2012, 03:56:57 AM

0 Members and 1 Guest are viewing this topic.

czernobog

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?



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