diff --git a/graph_node_renderer/variable_viewer.gd b/graph_node_renderer/variable_viewer.gd index 680d94f..9ca0ed5 100644 --- a/graph_node_renderer/variable_viewer.gd +++ b/graph_node_renderer/variable_viewer.gd @@ -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