mirror of
https://github.com/Relintai/godot-resources-as-sheets-plugin.git
synced 2025-05-20 23:28:20 +02:00
Fix inspector no undo, minor array editing improvements
This commit is contained in:
parent
b97d63bb48
commit
4f1b31cb26
@ -379,7 +379,7 @@ func _try_open_docks(cell : Control):
|
|||||||
x.get_node(x.path_property_name).text = columns[column_index]
|
x.get_node(x.path_property_name).text = columns[column_index]
|
||||||
|
|
||||||
|
|
||||||
func set_edited_cells_values(new_cell_values : Array, update_whole_row : bool = false):
|
func set_edited_cells_values(new_cell_values : Array):
|
||||||
var column = _get_cell_column(edited_cells[0])
|
var column = _get_cell_column(edited_cells[0])
|
||||||
var edited_cells_resources = _get_edited_cells_resources()
|
var edited_cells_resources = _get_edited_cells_resources()
|
||||||
|
|
||||||
@ -400,11 +400,6 @@ func set_edited_cells_values(new_cell_values : Array, update_whole_row : bool =
|
|||||||
self,
|
self,
|
||||||
"_update_selected_cells_text"
|
"_update_selected_cells_text"
|
||||||
)
|
)
|
||||||
for i in new_cell_values.size():
|
|
||||||
column_editors[column].set_value(edited_cells[i], new_cell_values[i])
|
|
||||||
if update_whole_row:
|
|
||||||
_update_row(_get_cell_row(edited_cells[i]) + 1)
|
|
||||||
|
|
||||||
editor_plugin.undo_redo.add_do_method(
|
editor_plugin.undo_redo.add_do_method(
|
||||||
self,
|
self,
|
||||||
"_update_resources",
|
"_update_resources",
|
||||||
@ -636,12 +631,8 @@ func set_cell(cell, value):
|
|||||||
|
|
||||||
|
|
||||||
func _update_resources(update_rows : Array, update_cells : Array, update_column : int, values : Array):
|
func _update_resources(update_rows : Array, update_cells : Array, update_column : int, values : Array):
|
||||||
var cells := get_node(path_table_root).get_children()
|
|
||||||
for i in update_rows.size():
|
for i in update_rows.size():
|
||||||
if undo_redo_version > editor_plugin.undo_redo.get_version():
|
column_editors[update_column].set_value(update_cells[i], values[i])
|
||||||
# Set cell values, but only when undoing/redoing (set_cell() normally fills these in)
|
|
||||||
column_editors[update_column].set_value(update_cells[i], values[i])
|
|
||||||
|
|
||||||
values[i] = _try_convert(values[i], column_types[update_column])
|
values[i] = _try_convert(values[i], column_types[update_column])
|
||||||
if values[i] == null:
|
if values[i] == null:
|
||||||
continue
|
continue
|
||||||
@ -709,6 +700,7 @@ func _on_ProcessExpr_text_entered(new_text : String):
|
|||||||
func _on_inspector_property_edited(property : String):
|
func _on_inspector_property_edited(property : String):
|
||||||
if !visible: return
|
if !visible: return
|
||||||
if inspector_resource == null: return
|
if inspector_resource == null: return
|
||||||
|
if undo_redo_version > editor_plugin.undo_redo.get_version(): return
|
||||||
|
|
||||||
var value = inspector_resource.get(property)
|
var value = inspector_resource.get(property)
|
||||||
var values = []
|
var values = []
|
||||||
|
@ -11,10 +11,11 @@ var _stored_type := 0
|
|||||||
|
|
||||||
|
|
||||||
func _ready():
|
func _ready():
|
||||||
recent_container.get_child(1).add_item("Add")
|
if recent_container.get_child(1).get_item_count() < 3:
|
||||||
recent_container.get_child(1).add_item("Erase")
|
recent_container.get_child(1).add_item("Add")
|
||||||
recent_container.get_child(1).add_item("Delete From Recent")
|
recent_container.get_child(1).add_item("Erase")
|
||||||
recent_container.get_child(1).select(0)
|
recent_container.get_child(1).add_item("Delete From Recent")
|
||||||
|
recent_container.get_child(1).select(0)
|
||||||
|
|
||||||
|
|
||||||
func try_edit_value(value, type, propert_hint) -> bool:
|
func try_edit_value(value, type, propert_hint) -> bool:
|
||||||
|
@ -73,18 +73,13 @@ margin_right = 320.0
|
|||||||
margin_bottom = 52.0
|
margin_bottom = 52.0
|
||||||
size_flags_horizontal = 3
|
size_flags_horizontal = 3
|
||||||
|
|
||||||
[node name="Panel" type="Panel" parent="HBoxContainer/HBoxContainer/Panel"]
|
[node name="Label" type="TextEdit" parent="HBoxContainer/HBoxContainer/Panel"]
|
||||||
margin_right = 320.0
|
|
||||||
margin_bottom = 52.0
|
|
||||||
|
|
||||||
[node name="Label" type="Label" parent="HBoxContainer/HBoxContainer/Panel"]
|
|
||||||
margin_right = 320.0
|
margin_right = 320.0
|
||||||
margin_bottom = 52.0
|
margin_bottom = 52.0
|
||||||
rect_min_size = Vector2( 128, 0 )
|
rect_min_size = Vector2( 128, 0 )
|
||||||
size_flags_vertical = 5
|
size_flags_vertical = 5
|
||||||
text = "[]"
|
text = "[]"
|
||||||
align = 2
|
readonly = true
|
||||||
autowrap = true
|
|
||||||
|
|
||||||
[node name="VSeparator2" type="VSeparator" parent="HBoxContainer/HBoxContainer"]
|
[node name="VSeparator2" type="VSeparator" parent="HBoxContainer/HBoxContainer"]
|
||||||
margin_left = 324.0
|
margin_left = 324.0
|
||||||
|
Loading…
Reference in New Issue
Block a user