editor-core
editor-core copied to clipboard
Identify read-only components to the editor
This ticket is blocked until #26 and #27 are complete.
As defined in #26 and #27, we support syncing Components/Resources that only implement Serialize
, but in a read-only fashion that can't accept edits from the editor. In order to allow editors to provide a better user-experience for read-only components, we should provide information to the editor about which types have edit support vs which ones are read-only.
Ideally, it would be best to provide this sort of metadata once when the connection is established, however we don't currently have any sense of a "connection" between the game and editor. As such, there's no reasonable way to ensure that the game will know to send the information to the editor when the editor first connects. For simplicity, then, we should send this information with every state update that the game sends out.
We should update the SerializedComponent
and SerializedResource
structs to include some indication of whether or not the types supports editing. A boolean read_only
field would be sufficient, but it might be nicer to have an EditMode
enum that has variants for ReadOnly
and ReadWrite
. The approach to take is up to whomever takes on this task.