diff options
author | Bastiaan Olij <mux213@gmail.com> | 2023-07-17 16:36:01 +1000 |
---|---|---|
committer | Bastiaan Olij <mux213@gmail.com> | 2023-08-30 10:25:35 +1000 |
commit | 3a89bb388d11f0be015d1413df8a2d79b8c83d83 (patch) | |
tree | 3d22a955cfa1a6ff4ed6348354e4e0f2573a79a7 /modules/openxr/action_map/openxr_interaction_profile_metadata.cpp | |
parent | d2f76e87869b892d7992696e0b381c5afebe3d0d (diff) | |
download | redot-engine-3a89bb388d11f0be015d1413df8a2d79b8c83d83.tar.gz |
Change to new PICO interaction profiles
Diffstat (limited to 'modules/openxr/action_map/openxr_interaction_profile_metadata.cpp')
-rw-r--r-- | modules/openxr/action_map/openxr_interaction_profile_metadata.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/modules/openxr/action_map/openxr_interaction_profile_metadata.cpp b/modules/openxr/action_map/openxr_interaction_profile_metadata.cpp index 9f0198dfc4..df607b0def 100644 --- a/modules/openxr/action_map/openxr_interaction_profile_metadata.cpp +++ b/modules/openxr/action_map/openxr_interaction_profile_metadata.cpp @@ -46,11 +46,26 @@ OpenXRInteractionProfileMetadata::~OpenXRInteractionProfileMetadata() { } void OpenXRInteractionProfileMetadata::_bind_methods() { + ClassDB::bind_method(D_METHOD("register_profile_rename", "old_name", "new_name"), &OpenXRInteractionProfileMetadata::register_profile_rename); ClassDB::bind_method(D_METHOD("register_top_level_path", "display_name", "openxr_path", "openxr_extension_name"), &OpenXRInteractionProfileMetadata::register_top_level_path); ClassDB::bind_method(D_METHOD("register_interaction_profile", "display_name", "openxr_path", "openxr_extension_name"), &OpenXRInteractionProfileMetadata::register_interaction_profile); ClassDB::bind_method(D_METHOD("register_io_path", "interaction_profile", "display_name", "toplevel_path", "openxr_path", "openxr_extension_name", "action_type"), &OpenXRInteractionProfileMetadata::register_io_path); } +void OpenXRInteractionProfileMetadata::register_profile_rename(const String &p_old_name, const String &p_new_name) { + ERR_FAIL_COND(profile_renames.has(p_old_name)); + + profile_renames[p_old_name] = p_new_name; +} + +String OpenXRInteractionProfileMetadata::check_profile_name(const String &p_name) const { + if (profile_renames.has(p_name)) { + return profile_renames[p_name]; + } + + return p_name; +} + void OpenXRInteractionProfileMetadata::register_top_level_path(const String &p_display_name, const String &p_openxr_path, const String &p_openxr_extension_name) { ERR_FAIL_COND_MSG(has_top_level_path(p_openxr_path), p_openxr_path + " had already been registered"); |