def drawItem(index,_count,rect)
return if index>=self.top_row+self.page_item_max
#changing the rectangle height doesn't do anything for some reason
rect = Rect.new(rect.x+16,rect.y,rect.width-16,rect.height)
#name = $quest_data.getName(@quests[index].id)
name = $quest_data.getName(@quests[index].id)
name = "<b>" + "#{name}" + "</b>" if @quests[index].story
base = self.baseColor
#shadow = self.shadowColor
col = @quests[index].color
#drawFormattedTextEx(self.contents,rect.x,rect.y+4,
#436,"<c2=#{col}>#{name}</c2>",base,shadow)
drawFormattedTextEx(self.contents,rect.x,rect.y+4,
436,"<c2=#{col}>#{name}</c2>",base)
#pbDrawImagePositions(self.contents,[[sprintf("Graphics/Pictures/QuestUI/new"),rect.width-16,rect.y+2]]) if @quests[index].new
#this draws the exclamation icon named "new" when there is new activity on an objective
pbDrawImagePositions(self.contents,[[sprintf("Graphics/Pictures/QuestUI/new"),rect.width-80,rect.y+8]]) if @quests[index].new
end
def refresh
#this is the number of quests that are in the list currently showing
@item_max = itemCount
#the width and height of the entire box that displays all the quest names
dwidth = self.width-self.borderX
dheight = self.height-self.borderY
self.contents = pbDoEnsureBitmap(self.contents,dwidth,dheight)
self.contents.clear
for i in 0...@item_max
next if i<self.top_item || i>self.top_item+self.page_item_max
drawItem(i,@item_max,itemRect(i))
end
drawCursor(self.index,itemRect(self.index)) if itemCount >0
end