Add down arrow for ListBox

This commit is contained in:
2022-05-03 20:01:34 -05:00
parent 31e909eb30
commit 0a62e5180a

View File

@@ -31,6 +31,13 @@ module CyberarmEngine
self.choose = @choose
end
def render
super
w = @text.textobject.text_width("")
@text.textobject.draw("", @x + content_width - w, @y + @style.padding_top, @z, 1, 1, @text.color)
end
def choose=(item)
valid = @items.detect { |i| i == item }
raise "Invalid value '#{item}' for choose, valid options were: #{@items.map { |i| "#{i.inspect}" }.join(", ")}" unless valid