Add customizable 3D navigation settings

This commit adds 3 new editor settings for orbit, pan, and zoom mouse buttons, and 6 new shortcuts which act as modifiers for the navigation controls. These new shortcuts replace the old orbit, pan, and zoom modifier settings.

The `navigation_scheme` setting now acts as a preset which changes the new options added above, and the new settings are what drives 3D navigation instead. A new struct is used for ordering the navigation logic so that actions with fewer shortcuts are checked first. When the editor starts, the preset detection will run to automatically update user settings from old Godot versions. When the setting is changed, the hint values for the mouse buttons are dynamically updated to show the user the corresponding shortcut values.

The new doc fields have been generated and the description for the new settings are filled out. The `navigation_scheme` entry now has more consistent styling and added control descriptions that were missing before.
This commit is contained in:
Matt Enad
2023-11-24 15:40:54 -05:00
parent cae2f853dc
commit 9d343ced58
7 changed files with 287 additions and 80 deletions

View File

@ -100,6 +100,10 @@ class EditorSettingsDialog : public AcceptDialog {
void _tabs_tab_changed(int p_tab);
void _focus_current_search_box();
void _update_dynamic_property_hints();
PropertyInfo _create_mouse_shortcut_property_info(const String &p_property_name, const String &p_shortcut_1_name, const String &p_shortcut_2_name);
String _get_shortcut_button_string(const String &p_shortcut_name);
void _filter_shortcuts(const String &p_filter);
void _filter_shortcuts_by_event(const Ref<InputEvent> &p_event);
bool _should_display_shortcut(const String &p_name, const Array &p_events) const;
@ -107,6 +111,7 @@ class EditorSettingsDialog : public AcceptDialog {
void _update_shortcuts();
void _shortcut_button_pressed(Object *p_item, int p_column, int p_idx, MouseButton p_button = MouseButton::LEFT);
void _shortcut_cell_double_clicked();
static void _set_shortcut_input(const String &p_name, Ref<InputEventKey> &p_event);
static void _undo_redo_callback(void *p_self, const String &p_name);
@ -124,6 +129,7 @@ protected:
public:
void popup_edit_settings();
static void update_navigation_preset();
EditorSettingsDialog();
~EditorSettingsDialog();