Godot Version
4.5 Stable
Question
I am making a graph-based dialogue plugin. Each time the user saves their work, I serialize the graph into a new resource file (EventSequence) containing all the dialogue nodes. My problem is that using ResourceSaver.save() does not immediately update the resource seen in the inspector, even though the old resource should have been completely overwritten. After saving, I still see the old resource, but with its path wiped.
How do I immediately refresh the inspector after the user saves?
func _save_graph(i: int, custom_path: String = "") -> void:
var old_sequence := sequences[i]
var graph := graphs[i]
var new_sequence := graph.serialize(true)
sequences[i] = new_sequence
var path := custom_path
if path.is_empty():
path = old_sequence.resource_path
new_sequence.take_over_path(path)
ResourceSaver.save(new_sequence, path)