draw_item
(or whatever is the equivalent name) method. def draw_item(index)
item = @data[index]
case item
when RPG::Item
number = $game_party.item_number(item.id)
when RPG::Weapon
number = $game_party.weapon_number(item.id)
when RPG::Armor
number = $game_party.armor_number(item.id)
end
if item.is_a?(RPG::Item) and
$game_party.item_can_use?(item.id)
self.contents.font.color = normal_color
else
self.contents.font.color = disabled_color
end
x = 4 + index % 2 * (288 + 32)
y = index / 2 * 32
rect = Rect.new(x, y, self.width / @column_max - 32, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
bitmap = RPG::Cache.icon(item.icon_name)
opacity = self.contents.font.color == normal_color ? 255 : 128
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
self.contents.draw_text(x + 240, y, 16, 32, ":", 1)
self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2)
end
self.contents.font.color
is being assigned here. You will need to add some condition for when the item is being highlighted, perhaps when its index matches the window's @index: if index == @index
self.contents.font.color = Color.new(255,0,0)
elsif item.is_a?(RPG::Item) and
$game_party.item_can_use?(item.id)
self.contents.font.color = normal_color
else
self.contents.font.color = disabled_color
end
draw_item
method is only called when refresh
is. I agree with updating update_cursor_rect
as that ensures the @index has updated.class Window_Selectable < Window_Base
alias redraw_item_if_highlighted update_cursor_rect
def update_cursor_rect
refresh
redraw_item_if_highlighted
end
end
draw_item
for the selected index, which will require much more work.im about to scream i just almost finished making my own terribly inefficient version of that, but using a text "<" instead of an image. Thank you so much though, i feel stupid