Allow editor commands to have multiple default commands

This commit is contained in:
Kevin Cardona 2023-09-16 15:30:37 -06:00
parent ba54c34551
commit 20887d801b
2 changed files with 11 additions and 0 deletions

View file

@ -357,3 +357,13 @@ Ref<Shortcut> ED_SHORTCUT_AND_COMMAND(const String &p_path, const String &p_name
EditorCommandPalette::get_singleton()->add_shortcut_command(p_command_name, p_path, shortcut);
return shortcut;
}
Ref<Shortcut> ED_SHORTCUT_ARRAY_AND_COMMAND(const String &p_path, const String &p_name, const PackedInt32Array &p_keycodes, String p_command_name) {
if (p_command_name.is_empty()) {
p_command_name = p_name;
}
Ref<Shortcut> shortcut = ED_SHORTCUT_ARRAY(p_path, p_name, p_keycodes);
EditorCommandPalette::get_singleton()->add_shortcut_command(p_command_name, p_path, shortcut);
return shortcut;
}

View file

@ -105,5 +105,6 @@ public:
};
Ref<Shortcut> ED_SHORTCUT_AND_COMMAND(const String &p_path, const String &p_name, Key p_keycode = Key::NONE, String p_command = "");
Ref<Shortcut> ED_SHORTCUT_ARRAY_AND_COMMAND(const String &p_path, const String &p_name, const PackedInt32Array &p_keycodes, String p_command = "");
#endif // EDITOR_COMMAND_PALETTE_H