mirror of
https://codeberg.org/StreamGraph/StreamGraph.git
synced 2024-11-13 19:49:55 +01:00
add range cell for numeric values
This commit is contained in:
parent
84ecb41684
commit
7f263b45fb
1 changed files with 10 additions and 1 deletions
|
@ -31,8 +31,16 @@ func rebuild_variable_tree(data: Dictionary = {}) -> void:
|
|||
func add_item(item_name: String, item_value: Variant, parent: TreeItem = root) -> TreeItem:
|
||||
var item := variable_tree.create_item(parent)
|
||||
item.set_text(0, item_name)
|
||||
item.set_text(1, str(item_value))
|
||||
var type: DeckType.Types = DeckType.INVERSE_GODOT_TYPES_MAP[typeof(item_value)]
|
||||
|
||||
match type:
|
||||
DeckType.Types.NUMERIC:
|
||||
item.set_cell_mode(1, TreeItem.CELL_MODE_RANGE)
|
||||
item.set_range(1, item_value)
|
||||
item.set_range_config(1, -9999, 9999, 0.0001)
|
||||
_:
|
||||
item.set_text(1, str(item_value))
|
||||
|
||||
item.set_text(2, DeckType.type_str(type))
|
||||
if item_value is Dictionary:
|
||||
for i in item_value:
|
||||
|
@ -41,4 +49,5 @@ func add_item(item_name: String, item_value: Variant, parent: TreeItem = root) -
|
|||
for i in (item_value as Array).size():
|
||||
add_item(str(i), item_value[i], item)
|
||||
item.collapsed = true
|
||||
|
||||
return item
|
||||
|
|
Loading…
Reference in a new issue