The RPG Maker Resource Kit

RMRK RPG Maker Creation => RPG Maker General => General Scripting => Topic started by: czernobog on June 19, 2012, 03:56:57 AM

Title: Rmvxa script troubleshooting help
Post by: czernobog on June 19, 2012, 03:56:57 AM
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