From 9c1d49c6a1613738af7584546003ae3980ec4793 Mon Sep 17 00:00:00 2001 From: lawnjelly Date: Mon, 22 Apr 2024 06:57:52 +0100 Subject: [PATCH] Fix `spatial_editor_plugin` enum * The `view_mesh_stats` feature introduced a new enum value `VIEW_SLECTED_INFO` within the unnamed `VIEW` enum. * This turns out to be saved somehow, which means the view settings can get out of sync when reloading the project in an older version of the editor. * The solution is simply to move the new value to the end of the enum so there are no conflicts. --- editor/plugins/spatial_editor_plugin.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/editor/plugins/spatial_editor_plugin.h b/editor/plugins/spatial_editor_plugin.h index 1b1f89909..9f6f7c8fd 100644 --- a/editor/plugins/spatial_editor_plugin.h +++ b/editor/plugins/spatial_editor_plugin.h @@ -150,6 +150,9 @@ class SpatialEditorViewport : public Control { friend class ViewportNavigationControl; friend class ViewportRotationControl; + // These values are serialized, so if adding new values + // add to the bottom to preserve compatibility between + // editor versions. enum { VIEW_TOP, VIEW_BOTTOM, @@ -169,7 +172,6 @@ class SpatialEditorViewport : public Control { VIEW_AUDIO_DOPPLER, VIEW_GIZMOS, VIEW_INFORMATION, - VIEW_SELECTED_INFO, VIEW_FPS, VIEW_DISPLAY_NORMAL, VIEW_DISPLAY_WIREFRAME, @@ -179,6 +181,7 @@ class SpatialEditorViewport : public Control { VIEW_CINEMATIC_PREVIEW, VIEW_AUTO_ORTHOGONAL, VIEW_PORTAL_CULLING, + VIEW_SELECTED_INFO, }; enum ViewType {