summaryrefslogtreecommitdiff
path: root/modules/openxr/action_map/openxr_action.cpp
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-04-04 14:26:28 +0200
committerGitHub <noreply@github.com>2022-04-04 14:26:28 +0200
commit338b23d57224ecd04eaff4763a7ba493ffa6cb3d (patch)
tree6eed6f575b7f5b5c1ddd5788c8b5ea7261767e05 /modules/openxr/action_map/openxr_action.cpp
parentf1592cb3da3f8149cea72026b4ce2c61a753c25c (diff)
parent9b7b9de0e5e8bfe49ad9e02474eb9ddd5d7dacd5 (diff)
Merge pull request #59513 from BastiaanOlij/openxr_actionmap_editor
Diffstat (limited to 'modules/openxr/action_map/openxr_action.cpp')
-rw-r--r--modules/openxr/action_map/openxr_action.cpp23
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);
}