Add stub presentation for lists.

This commit is contained in:
Nolan Darilek 2018-06-10 21:14:43 +00:00
parent 9c9c4c4af5
commit 70f8e1c98d

View File

@ -2,12 +2,24 @@ extends Object
var node var node
func item_or_items(count):
if count == 1:
return "item"
else:
return "items"
func present_button(): func present_button():
var text = "Unlabelled" var text = "Unlabelled"
if node.text: if node.text:
text = node.text text = node.text
print("%s: button" % text) print("%s: button" % text)
func present_item_list():
var count = node.get_item_count()
var selected = node.get_selected_items()
print("list, %s %s" % [count, item_or_items(count)])
print(selected)
func present_line_edit(): func present_line_edit():
var text = "blank" var text = "blank"
if node.secret: if node.secret:
@ -21,12 +33,6 @@ func present_line_edit():
type = "text" type = "text"
print("%s: %s" % [text, type]) print("%s: %s" % [text, type])
func item_or_items(count):
if count == 1:
return "item"
else:
return "items"
func present_tree(): func present_tree():
var root = node.get_root() var root = node.get_root()
var count = 0 var count = 0
@ -35,6 +41,8 @@ func present_tree():
func focused(): func focused():
if node is Button: if node is Button:
present_button() present_button()
elif node is ItemList:
present_item_list()
elif node is LineEdit: elif node is LineEdit:
present_line_edit() present_line_edit()
elif node is Tree: elif node is Tree: