#==============================================================================
# ** Window_Command2
#------------------------------------------------------------------------------
# This window deals with general command choices.
#==============================================================================
class Window_Command2 < Window_Selectable
#--------------------------------------------------------------------------
# * Object Initialization
# width : window width
# commands2 : command text string array
#--------------------------------------------------------------------------
def initialize(width, commands2)
# Compute window height from command quantity
super(0, 0, width, commands.size * 32 + 32)
@item_max = commands2.size
@commands2 = commands2
# This is the part where you can change the colours.
self.contents.font.color = Color.new(-255,-255,-255,-255)
self.contents = Bitmap.new(width - 32, @item_max * 32)
refresh
self.index = 0
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
for i in 0...@item_max
draw_item(i, normal_color)
end
end
#--------------------------------------------------------------------------
# * Draw Item
# index : item number
# color : text color
#--------------------------------------------------------------------------
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))
self.contents.draw_text(rect, @commands2[index])
end
#--------------------------------------------------------------------------
# * Disable Item
# index : item number
#--------------------------------------------------------------------------
def disable_item(index)
draw_item(index, disabled_color)
end
end