Path: blob/master/modules/openxr/action_map/openxr_action_set.h
10278 views
/**************************************************************************/1/* openxr_action_set.h */2/**************************************************************************/3/* This file is part of: */4/* GODOT ENGINE */5/* https://godotengine.org */6/**************************************************************************/7/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */8/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */9/* */10/* Permission is hereby granted, free of charge, to any person obtaining */11/* a copy of this software and associated documentation files (the */12/* "Software"), to deal in the Software without restriction, including */13/* without limitation the rights to use, copy, modify, merge, publish, */14/* distribute, sublicense, and/or sell copies of the Software, and to */15/* permit persons to whom the Software is furnished to do so, subject to */16/* the following conditions: */17/* */18/* The above copyright notice and this permission notice shall be */19/* included in all copies or substantial portions of the Software. */20/* */21/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */22/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */23/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */24/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */25/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */26/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */27/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */28/**************************************************************************/2930#pragma once3132#include "openxr_action.h"3334#include "core/io/resource.h"3536class OpenXRActionSet : public Resource {37GDCLASS(OpenXRActionSet, Resource);3839private:40String localized_name;41int priority = 0;4243Array actions;44void clear_actions();4546protected:47static void _bind_methods();4849public:50static Ref<OpenXRActionSet> 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 set5152void set_localized_name(const String p_localized_name); // Set the localized name of this action set53String get_localized_name() const; // Get the localized name of this action set5455void set_priority(const int p_priority); // Set the priority of this action set56int get_priority() const; // Get the priority of this action set5758int get_action_count() const; // Retrieve the number of actions in our action set59void set_actions(Array p_actions); // Set our actions using an array of actions (for loading a resource)60Array get_actions() const; // Get our actions as an array (for saving a resource)6162Ref<OpenXRAction> get_action(const String p_name) const; // Retrieve an action by name63void add_action(Ref<OpenXRAction> p_action); // Add a new action to our action set64void remove_action(Ref<OpenXRAction> p_action); // remove a action from our action set6566Ref<OpenXRAction> 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 action6768// TODO add validation to display in the interface that checks if we have duplicate action names within our action set6970~OpenXRActionSet();71};727374