summaryrefslogtreecommitdiff
path: root/modules/openxr/action_map/openxr_action.cpp
diff options
context:
space:
mode:
authorBastiaan Olij <mux213@gmail.com>2022-03-17 10:24:47 +1100
committerBastiaan Olij <mux213@gmail.com>2022-04-04 18:43:29 +1000
commit9b7b9de0e5e8bfe49ad9e02474eb9ddd5d7dacd5 (patch)
tree1b97984c4874521c4551c5d76ba03ef05b46abb3 /modules/openxr/action_map/openxr_action.cpp
parent7bb963efe9083662baa356f56a2d5c368b96a9a0 (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.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);
}