2017-03-05 22:47:28 +08:00
|
|
|
/*************************************************************************/
|
|
|
|
/* import_dock.h */
|
|
|
|
/*************************************************************************/
|
|
|
|
/* This file is part of: */
|
|
|
|
/* GODOT ENGINE */
|
2017-08-27 20:16:55 +08:00
|
|
|
/* https://godotengine.org */
|
2017-03-05 22:47:28 +08:00
|
|
|
/*************************************************************************/
|
2021-01-02 03:13:46 +08:00
|
|
|
/* Copyright (c) 2007-2021 Juan Linietsky, Ariel Manzur. */
|
|
|
|
/* Copyright (c) 2014-2021 Godot Engine contributors (cf. AUTHORS.md). */
|
2017-03-05 22:47:28 +08:00
|
|
|
/* */
|
|
|
|
/* 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. */
|
|
|
|
/*************************************************************************/
|
2018-01-05 07:50:27 +08:00
|
|
|
|
2017-02-01 20:45:45 +08:00
|
|
|
#ifndef IMPORTDOCK_H
|
|
|
|
#define IMPORTDOCK_H
|
|
|
|
|
2018-08-18 21:07:23 +08:00
|
|
|
#include "core/io/config_file.h"
|
2019-02-12 20:30:56 +08:00
|
|
|
#include "core/io/resource_importer.h"
|
2018-08-18 21:07:23 +08:00
|
|
|
#include "editor/editor_file_system.h"
|
|
|
|
#include "editor/editor_inspector.h"
|
2017-02-01 20:45:45 +08:00
|
|
|
#include "scene/gui/box_container.h"
|
2019-01-26 04:23:56 +08:00
|
|
|
#include "scene/gui/dialogs.h"
|
2018-08-18 21:07:23 +08:00
|
|
|
#include "scene/gui/menu_button.h"
|
2017-02-01 20:45:45 +08:00
|
|
|
#include "scene/gui/option_button.h"
|
|
|
|
#include "scene/gui/popup_menu.h"
|
|
|
|
|
|
|
|
class ImportDockParameters;
|
|
|
|
class ImportDock : public VBoxContainer {
|
2019-03-20 02:35:57 +08:00
|
|
|
GDCLASS(ImportDock, VBoxContainer);
|
2017-02-01 20:45:45 +08:00
|
|
|
|
2017-08-05 02:16:04 +08:00
|
|
|
Label *imported;
|
2017-02-01 20:45:45 +08:00
|
|
|
OptionButton *import_as;
|
|
|
|
MenuButton *preset;
|
2018-08-18 21:07:23 +08:00
|
|
|
EditorInspector *import_opts;
|
2017-02-01 20:45:45 +08:00
|
|
|
|
|
|
|
List<PropertyInfo> properties;
|
2017-03-05 23:44:50 +08:00
|
|
|
Map<StringName, Variant> property_values;
|
2017-02-01 20:45:45 +08:00
|
|
|
|
2019-01-26 04:23:56 +08:00
|
|
|
ConfirmationDialog *reimport_confirm;
|
|
|
|
Label *label_warning;
|
2017-02-01 20:45:45 +08:00
|
|
|
Button *import;
|
|
|
|
|
2021-03-19 20:57:52 +08:00
|
|
|
Control *advanced_spacer;
|
|
|
|
Button *advanced;
|
|
|
|
|
2017-02-01 20:45:45 +08:00
|
|
|
ImportDockParameters *params;
|
|
|
|
|
|
|
|
void _preset_selected(int p_idx);
|
2017-11-11 04:53:01 +08:00
|
|
|
void _importer_selected(int i_idx);
|
2021-11-15 01:02:38 +08:00
|
|
|
void _update_options(const String &p_path, const Ref<ConfigFile> &p_config = Ref<ConfigFile>());
|
2020-02-14 09:58:19 +08:00
|
|
|
void _update_preset_menu();
|
2021-09-22 13:10:09 +08:00
|
|
|
void _add_keep_import_option(const String &p_importer_name);
|
2017-02-01 20:45:45 +08:00
|
|
|
|
2021-10-09 18:29:53 +08:00
|
|
|
void _property_edited(const StringName &p_prop);
|
2018-10-31 00:11:54 +08:00
|
|
|
void _property_toggled(const StringName &p_prop, bool p_checked);
|
2021-10-09 18:29:53 +08:00
|
|
|
void _set_dirty(bool p_dirty);
|
2019-01-26 04:23:56 +08:00
|
|
|
void _reimport_attempt();
|
|
|
|
void _reimport_and_restart();
|
2017-02-01 20:45:45 +08:00
|
|
|
void _reimport();
|
2017-03-05 23:44:50 +08:00
|
|
|
|
2021-03-19 20:57:52 +08:00
|
|
|
void _advanced_options();
|
2017-07-24 05:48:05 +08:00
|
|
|
enum {
|
|
|
|
ITEM_SET_AS_DEFAULT = 100,
|
|
|
|
ITEM_LOAD_DEFAULT,
|
|
|
|
ITEM_CLEAR_DEFAULT,
|
|
|
|
};
|
|
|
|
|
2017-02-01 20:45:45 +08:00
|
|
|
protected:
|
|
|
|
static void _bind_methods();
|
2017-08-31 22:58:43 +08:00
|
|
|
void _notification(int p_what);
|
2017-02-01 20:45:45 +08:00
|
|
|
|
2017-03-05 23:44:50 +08:00
|
|
|
public:
|
|
|
|
void set_edit_path(const String &p_path);
|
|
|
|
void set_edit_multiple_paths(const Vector<String> &p_paths);
|
2017-07-23 22:44:42 +08:00
|
|
|
void initialize_import_options() const;
|
2017-02-01 20:45:45 +08:00
|
|
|
void clear();
|
|
|
|
|
|
|
|
ImportDock();
|
|
|
|
~ImportDock();
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // IMPORTDOCK_H
|