2017-03-05 15:47:28 +01:00
|
|
|
/*************************************************************************/
|
|
|
|
/* import_dock.h */
|
|
|
|
/*************************************************************************/
|
|
|
|
/* This file is part of: */
|
|
|
|
/* GODOT ENGINE */
|
2017-08-27 14:16:55 +02:00
|
|
|
/* https://godotengine.org */
|
2017-03-05 15:47:28 +01:00
|
|
|
/*************************************************************************/
|
2018-01-01 14:40:08 +01:00
|
|
|
/* Copyright (c) 2007-2018 Juan Linietsky, Ariel Manzur. */
|
|
|
|
/* Copyright (c) 2014-2018 Godot Engine contributors (cf. AUTHORS.md) */
|
2017-03-05 15:47:28 +01: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 00:50:27 +01:00
|
|
|
|
2017-02-01 13:45:45 +01:00
|
|
|
#ifndef IMPORTDOCK_H
|
|
|
|
#define IMPORTDOCK_H
|
|
|
|
|
|
|
|
#include "editor_file_system.h"
|
2017-03-05 16:44:50 +01:00
|
|
|
#include "io/resource_import.h"
|
|
|
|
#include "property_editor.h"
|
2017-02-01 13:45:45 +01:00
|
|
|
#include "scene/gui/box_container.h"
|
|
|
|
#include "scene/gui/option_button.h"
|
|
|
|
#include "scene/gui/popup_menu.h"
|
|
|
|
|
|
|
|
class ImportDockParameters;
|
|
|
|
class ImportDock : public VBoxContainer {
|
2017-03-05 16:44:50 +01:00
|
|
|
GDCLASS(ImportDock, VBoxContainer)
|
2017-02-01 13:45:45 +01:00
|
|
|
|
2017-08-04 20:16:04 +02:00
|
|
|
Label *imported;
|
2017-02-01 13:45:45 +01:00
|
|
|
OptionButton *import_as;
|
|
|
|
MenuButton *preset;
|
|
|
|
PropertyEditor *import_opts;
|
|
|
|
|
|
|
|
List<PropertyInfo> properties;
|
2017-03-05 16:44:50 +01:00
|
|
|
Map<StringName, Variant> property_values;
|
2017-02-01 13:45:45 +01:00
|
|
|
|
|
|
|
Button *import;
|
|
|
|
|
|
|
|
ImportDockParameters *params;
|
|
|
|
|
|
|
|
void _preset_selected(int p_idx);
|
2017-11-10 21:53:01 +01:00
|
|
|
void _importer_selected(int i_idx);
|
2017-11-13 20:31:00 +01:00
|
|
|
void _update_options(const Ref<ConfigFile> &p_config = Ref<ConfigFile>());
|
2017-02-01 13:45:45 +01:00
|
|
|
|
|
|
|
void _reimport();
|
2017-03-05 16:44:50 +01:00
|
|
|
|
2017-07-23 23:48:05 +02:00
|
|
|
enum {
|
|
|
|
ITEM_SET_AS_DEFAULT = 100,
|
|
|
|
ITEM_LOAD_DEFAULT,
|
|
|
|
ITEM_CLEAR_DEFAULT,
|
|
|
|
};
|
|
|
|
|
2017-02-01 13:45:45 +01:00
|
|
|
protected:
|
|
|
|
static void _bind_methods();
|
2017-08-31 16:58:43 +02:00
|
|
|
void _notification(int p_what);
|
2017-02-01 13:45:45 +01:00
|
|
|
|
2017-03-05 16:44:50 +01:00
|
|
|
public:
|
|
|
|
void set_edit_path(const String &p_path);
|
|
|
|
void set_edit_multiple_paths(const Vector<String> &p_paths);
|
2017-07-23 16:44:42 +02:00
|
|
|
void initialize_import_options() const;
|
2017-02-01 13:45:45 +01:00
|
|
|
void clear();
|
|
|
|
|
|
|
|
ImportDock();
|
|
|
|
~ImportDock();
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // IMPORTDOCK_H
|