#ifndef EDITOR_DATA_H #define EDITOR_DATA_H /*************************************************************************/ /* editor_data.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ /* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2022 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2022 Godot Engine contributors (cf. AUTHORS.md). */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ /* "Software"), to deal in the Software without restriction, including */ /* without limitation the rights to use, copy, modify, merge, publish, */ /* distribute, sublicense, and/or sell copies of the Software, and to */ /* permit persons to whom the Software is furnished to do so, subject to */ /* the following conditions: */ /* */ /* The above copyright notice and this permission notice shall be */ /* included in all copies or substantial portions of the Software. */ /* */ /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ #include "core/object/object.h" #include "scene/resources/texture.h" #include "core/containers/list.h" #include "core/containers/pair.h" #include "core/object/undo_redo.h" #include "core/variant/array.h" #include "core/variant/dictionary.h" #include "core/containers/hash_map.h" #include "core/containers/rb_map.h" #include "core/string/node_path.h" #include "core/object/object_id.h" #include "core/object/reference.h" #include "core/object/script_language.h" #include "core/containers/rb_set.h" #include "core/string/string_name.h" #include "core/typedefs.h" #include "core/string/ustring.h" #include "core/variant/variant.h" #include "core/containers/vector.h" #include "modules/modules_enabled.gen.h" #ifdef MODULE_EDITOR_CODE_EDITOR_ENABLED #include "editor_code_editor/script_editor_plugin.h" #endif class ConfigFile; class EditorPlugin; class Node; class Resource; class EditorHistory { enum { HISTORY_MAX = 64 }; struct Obj { REF ref; ObjectID object; String property; bool inspector_only; }; struct History { Vector path; int level; }; friend class EditorData; Vector history; int current; //Vector editor_plugins; struct PropertyData { String name; Variant value; }; void _add_object(ObjectID p_object, const String &p_property, int p_level_change, bool p_inspector_only = false); public: void cleanup_history(); bool is_at_beginning() const; bool is_at_end() const; void add_object_inspector_only(ObjectID p_object); void add_object(ObjectID p_object); void add_object(ObjectID p_object, const String &p_subprop); void add_object(ObjectID p_object, int p_relevel); int get_history_len(); int get_history_pos(); ObjectID get_history_obj(int p_obj) const; bool is_history_obj_inspector_only(int p_obj) const; bool next(); bool previous(); ObjectID get_current(); bool is_current_inspector_only() const; int get_path_size() const; ObjectID get_path_object(int p_index) const; String get_path_property(int p_index) const; void clear(); EditorHistory(); }; class EditorSelection; class EditorData { public: struct CustomType { String name; Ref