From 9b7b9de0e5e8bfe49ad9e02474eb9ddd5d7dacd5 Mon Sep 17 00:00:00 2001 From: Bastiaan Olij Date: Thu, 17 Mar 2022 10:24:47 +1100 Subject: Add action map editor for OpenXR --- modules/openxr/action_map/openxr_action_set.h | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'modules/openxr/action_map/openxr_action_set.h') diff --git a/modules/openxr/action_map/openxr_action_set.h b/modules/openxr/action_map/openxr_action_set.h index 012a088b1c..b1d7168894 100644 --- a/modules/openxr/action_map/openxr_action_set.h +++ b/modules/openxr/action_map/openxr_action_set.h @@ -43,26 +43,31 @@ private: int priority = 0; Array actions; + void clear_actions(); protected: static void _bind_methods(); public: - static Ref new_action_set(const char *p_name, const char *p_localized_name, const int p_priority = 0); + static Ref new_action_set(const char *p_name, const char *p_localized_name, const int p_priority = 0); // Helper function for adding and setting up an action set - void set_localized_name(const String p_localized_name); - String get_localized_name() const; + void set_localized_name(const String p_localized_name); // Set the localized name of this action set + String get_localized_name() const; // Get the localized name of this action set - void set_priority(const int p_priority); - int get_priority() const; + void set_priority(const int p_priority); // Set the priority of this action set + int get_priority() const; // Get the priority of this action set - void set_actions(Array p_actions); - Array get_actions() const; + int get_action_count() const; // Retrieve the number of actions in our action set + void set_actions(Array p_actions); // Set our actions using an array of actions (for loading a resource) + Array get_actions() const; // Get our actions as an array (for saving a resource) - void add_action(Ref p_action); - void remove_action(Ref p_action); + Ref get_action(const String p_name) const; // Retrieve an action by name + void add_action(Ref p_action); // Add a new action to our action set + void remove_action(Ref p_action); // remove a action from our action set - Ref add_new_action(const char *p_name, const char *p_localized_name, const OpenXRAction::ActionType p_action_type, const char *p_toplevel_paths); + Ref add_new_action(const char *p_name, const char *p_localized_name, const OpenXRAction::ActionType p_action_type, const char *p_toplevel_paths); // Helper function for adding and setting up an action + + // TODO add validation to display in the interface that checks if we have duplicate action names within our action set ~OpenXRActionSet(); }; -- cgit v1.2.3