#==============================================================================
# ** Window_Command - Brew
#------------------------------------------------------------------------------
# This window deals with general command choices.
# Display an icon if the name matches the menu option
# Put a matching icon the Graphics\Icons folder. (i.e. Item.png)
#==============================================================================
class Window_Command
def draw_item(index, color)
self.contents.font.color = color
rect = Rect.new(4, 32 * index, self.contents.width - 8, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
if File.exist?("Graphics\\Icons\\#{@commands[index]}.png")
bitmap = RPG::Cache.icon(@commands[index])
opacity = color == disabled_color ? 127 : 255
rect = bitmap.rect
self.contents.blt(4, 32 * index, bitmap, rect, opacity)
rect = Rect.new(32, 32 * index, self.contents.width - 32, 32)
self.contents.draw_text(rect, @commands[index])
else
self.contents.draw_text(rect, @commands[index])
end
end
end