diff options
author | Bastiaan Olij <mux213@gmail.com> | 2022-03-17 10:24:47 +1100 |
---|---|---|
committer | Bastiaan Olij <mux213@gmail.com> | 2022-04-04 18:43:29 +1000 |
commit | 9b7b9de0e5e8bfe49ad9e02474eb9ddd5d7dacd5 (patch) | |
tree | 1b97984c4874521c4551c5d76ba03ef05b46abb3 /modules/openxr/action_map/openxr_action.cpp | |
parent | 7bb963efe9083662baa356f56a2d5c368b96a9a0 (diff) |
Add action map editor for OpenXR
Diffstat (limited to 'modules/openxr/action_map/openxr_action.cpp')
-rw-r--r-- | modules/openxr/action_map/openxr_action.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/modules/openxr/action_map/openxr_action.cpp b/modules/openxr/action_map/openxr_action.cpp index 59ee3f4292..359975a480 100644 --- a/modules/openxr/action_map/openxr_action.cpp +++ b/modules/openxr/action_map/openxr_action.cpp @@ -29,6 +29,7 @@ /*************************************************************************/ #include "openxr_action.h" +#include "openxr_action_set.h" void OpenXRAction::_bind_methods() { ClassDB::bind_method(D_METHOD("set_localized_name", "localized_name"), &OpenXRAction::set_localized_name); @@ -62,6 +63,16 @@ Ref<OpenXRAction> OpenXRAction::new_action(const char *p_name, const char *p_loc return action; } +String OpenXRAction::get_name_with_set() const { + String name = get_name(); + + if (action_set != nullptr) { + name = action_set->get_name() + "/" + name; + } + + return name; +} + void OpenXRAction::set_localized_name(const String p_localized_name) { localized_name = p_localized_name; } @@ -86,6 +97,18 @@ PackedStringArray OpenXRAction::get_toplevel_paths() const { return toplevel_paths; } +void OpenXRAction::add_toplevel_path(const String p_toplevel_path) { + if (!toplevel_paths.has(p_toplevel_path)) { + toplevel_paths.push_back(p_toplevel_path); + } +} + +void OpenXRAction::rem_toplevel_path(const String p_toplevel_path) { + if (toplevel_paths.has(p_toplevel_path)) { + toplevel_paths.erase(p_toplevel_path); + } +} + void OpenXRAction::parse_toplevel_paths(const String p_toplevel_paths) { toplevel_paths = p_toplevel_paths.split(",", false); } |