2014-02-10 09:10:30 +08:00
|
|
|
/*************************************************************************/
|
|
|
|
/* editor_node.h */
|
|
|
|
/*************************************************************************/
|
|
|
|
/* This file is part of: */
|
|
|
|
/* GODOT ENGINE */
|
2017-08-27 20:16:55 +08:00
|
|
|
/* https://godotengine.org */
|
2014-02-10 09:10:30 +08:00
|
|
|
/*************************************************************************/
|
2022-01-04 04:27:34 +08:00
|
|
|
/* Copyright (c) 2007-2022 Juan Linietsky, Ariel Manzur. */
|
|
|
|
/* Copyright (c) 2014-2022 Godot Engine contributors (cf. AUTHORS.md). */
|
2014-02-10 09:10:30 +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
|
|
|
|
2014-02-10 09:10:30 +08:00
|
|
|
#ifndef EDITOR_NODE_H
|
|
|
|
#define EDITOR_NODE_H
|
|
|
|
|
2021-02-11 02:22:13 +08:00
|
|
|
#include "core/templates/safe_refcount.h"
|
2018-10-30 03:36:31 +08:00
|
|
|
#include "editor/editor_folding.h"
|
2021-01-06 07:01:50 +08:00
|
|
|
#include "editor/editor_native_shader_source_visualizer.h"
|
2017-03-05 21:21:25 +08:00
|
|
|
#include "editor/editor_run.h"
|
2022-08-23 18:40:48 +08:00
|
|
|
#include "editor/editor_title_bar.h"
|
2022-07-18 01:24:37 +08:00
|
|
|
#include "editor/export/editor_export.h"
|
2018-05-17 14:01:47 +08:00
|
|
|
#include "editor/inspector_dock.h"
|
2019-05-31 02:16:40 +08:00
|
|
|
|
2014-02-25 20:31:47 +08:00
|
|
|
typedef void (*EditorNodeInitCallback)();
|
2016-08-07 06:00:54 +08:00
|
|
|
typedef void (*EditorPluginInitializeCallback)();
|
2017-08-30 05:59:20 +08:00
|
|
|
typedef bool (*EditorBuildCallback)();
|
2014-02-25 20:31:47 +08:00
|
|
|
|
2019-12-24 15:17:23 +08:00
|
|
|
class AcceptDialog;
|
|
|
|
class AudioStreamPreviewGenerator;
|
|
|
|
class BackgroundProgress;
|
2022-02-12 09:46:22 +08:00
|
|
|
class Button;
|
2019-12-24 15:17:23 +08:00
|
|
|
class CenterContainer;
|
2022-08-01 02:14:15 +08:00
|
|
|
class ColorPicker;
|
2019-12-24 15:17:23 +08:00
|
|
|
class ConfirmationDialog;
|
|
|
|
class Control;
|
|
|
|
class DependencyEditor;
|
|
|
|
class DependencyErrorDialog;
|
2022-02-12 09:46:22 +08:00
|
|
|
class DynamicFontImportSettings;
|
2019-12-24 15:17:23 +08:00
|
|
|
class EditorAbout;
|
2021-05-29 21:28:16 +08:00
|
|
|
class EditorCommandPalette;
|
2019-12-24 15:17:23 +08:00
|
|
|
class EditorExport;
|
2022-02-12 09:46:22 +08:00
|
|
|
class EditorExtensionManager;
|
2019-12-24 15:17:23 +08:00
|
|
|
class EditorFeatureProfileManager;
|
|
|
|
class EditorFileServer;
|
2022-02-12 09:46:22 +08:00
|
|
|
class EditorFolding;
|
2019-12-24 15:17:23 +08:00
|
|
|
class EditorInspector;
|
|
|
|
class EditorLayoutsDialog;
|
|
|
|
class EditorLog;
|
|
|
|
class EditorPlugin;
|
2016-03-30 07:02:53 +08:00
|
|
|
class EditorPluginList;
|
2019-12-24 15:17:23 +08:00
|
|
|
class EditorQuickOpen;
|
|
|
|
class EditorResourcePreview;
|
2022-08-01 02:14:15 +08:00
|
|
|
class EditorResourceConversionPlugin;
|
2022-02-12 09:46:22 +08:00
|
|
|
class EditorRun;
|
2019-12-24 15:17:23 +08:00
|
|
|
class EditorRunNative;
|
|
|
|
class EditorSettingsDialog;
|
2022-02-12 09:46:22 +08:00
|
|
|
class EditorToaster;
|
2022-03-26 01:06:46 +08:00
|
|
|
class EditorUndoRedoManager;
|
2019-12-24 15:17:23 +08:00
|
|
|
class ExportTemplateManager;
|
2022-02-12 09:46:22 +08:00
|
|
|
class FileDialog;
|
2019-12-24 15:17:23 +08:00
|
|
|
class FileSystemDock;
|
2022-11-07 03:53:20 +08:00
|
|
|
class HistoryDock;
|
2019-12-24 15:17:23 +08:00
|
|
|
class HSplitContainer;
|
|
|
|
class ImportDock;
|
2022-02-12 09:46:22 +08:00
|
|
|
class LinkButton;
|
2022-08-01 17:28:16 +08:00
|
|
|
class MenuBar;
|
2019-12-24 15:17:23 +08:00
|
|
|
class MenuButton;
|
|
|
|
class NodeDock;
|
|
|
|
class OrphanResourcesDialog;
|
|
|
|
class Panel;
|
|
|
|
class PanelContainer;
|
|
|
|
class PluginConfigDialog;
|
|
|
|
class ProgressDialog;
|
|
|
|
class ProjectExportDialog;
|
|
|
|
class ProjectSettingsEditor;
|
|
|
|
class RunSettingsDialog;
|
2022-02-12 09:46:22 +08:00
|
|
|
class SceneImportSettings;
|
2022-07-21 07:00:58 +08:00
|
|
|
class AudioStreamImportSettings;
|
2019-12-24 15:17:23 +08:00
|
|
|
class ScriptCreateDialog;
|
2022-02-12 09:46:22 +08:00
|
|
|
class SubViewport;
|
2021-10-18 00:55:44 +08:00
|
|
|
class TabBar;
|
2022-02-12 09:46:22 +08:00
|
|
|
class TabContainer;
|
2020-12-15 04:10:09 +08:00
|
|
|
class TextureProgressBar;
|
2019-12-24 15:17:23 +08:00
|
|
|
class VSplitContainer;
|
2020-03-04 09:51:12 +08:00
|
|
|
class Window;
|
2022-07-14 20:18:18 +08:00
|
|
|
class EditorBuildProfileManager;
|
2015-06-14 09:12:53 +08:00
|
|
|
|
2014-02-10 09:10:30 +08:00
|
|
|
class EditorNode : public Node {
|
2017-01-03 10:03:46 +08:00
|
|
|
GDCLASS(EditorNode, Node);
|
2015-11-28 04:42:48 +08:00
|
|
|
|
2016-02-28 10:10:44 +08:00
|
|
|
public:
|
|
|
|
enum DockSlot {
|
|
|
|
DOCK_SLOT_LEFT_UL,
|
|
|
|
DOCK_SLOT_LEFT_BL,
|
|
|
|
DOCK_SLOT_LEFT_UR,
|
|
|
|
DOCK_SLOT_LEFT_BR,
|
|
|
|
DOCK_SLOT_RIGHT_UL,
|
|
|
|
DOCK_SLOT_RIGHT_BL,
|
|
|
|
DOCK_SLOT_RIGHT_UR,
|
|
|
|
DOCK_SLOT_RIGHT_BR,
|
|
|
|
DOCK_SLOT_MAX
|
|
|
|
};
|
2017-03-05 23:44:50 +08:00
|
|
|
|
2022-03-31 02:12:26 +08:00
|
|
|
enum EditorTable {
|
|
|
|
EDITOR_2D = 0,
|
|
|
|
EDITOR_3D,
|
|
|
|
EDITOR_SCRIPT,
|
|
|
|
EDITOR_ASSETLIB
|
|
|
|
};
|
|
|
|
|
2022-09-09 08:29:59 +08:00
|
|
|
enum SceneNameCasing {
|
|
|
|
SCENE_NAME_CASING_AUTO,
|
|
|
|
SCENE_NAME_CASING_PASCAL_CASE,
|
|
|
|
SCENE_NAME_CASING_SNAKE_CASE
|
|
|
|
};
|
|
|
|
|
2019-04-08 02:46:52 +08:00
|
|
|
struct ExecuteThreadArgs {
|
|
|
|
String path;
|
|
|
|
List<String> args;
|
|
|
|
String output;
|
2021-01-19 20:29:41 +08:00
|
|
|
Thread execute_output_thread;
|
2020-02-26 18:28:13 +08:00
|
|
|
Mutex execute_output_mutex;
|
2020-11-24 17:12:55 +08:00
|
|
|
int exitcode = 0;
|
2021-02-11 02:22:13 +08:00
|
|
|
SafeFlag done;
|
2019-04-08 02:46:52 +08:00
|
|
|
};
|
|
|
|
|
2016-02-28 10:10:44 +08:00
|
|
|
private:
|
2014-02-10 09:10:30 +08:00
|
|
|
enum MenuOptions {
|
|
|
|
FILE_NEW_SCENE,
|
2015-10-10 20:09:09 +08:00
|
|
|
FILE_NEW_INHERITED_SCENE,
|
2014-02-10 09:10:30 +08:00
|
|
|
FILE_OPEN_SCENE,
|
|
|
|
FILE_SAVE_SCENE,
|
|
|
|
FILE_SAVE_AS_SCENE,
|
2016-06-26 11:54:17 +08:00
|
|
|
FILE_SAVE_ALL_SCENES,
|
2015-01-07 06:28:25 +08:00
|
|
|
FILE_SAVE_AND_RUN,
|
2022-06-22 11:56:09 +08:00
|
|
|
FILE_SAVE_AND_RUN_MAIN_SCENE,
|
2018-09-14 01:06:40 +08:00
|
|
|
FILE_SHOW_IN_FILESYSTEM,
|
2014-02-10 09:10:30 +08:00
|
|
|
FILE_EXPORT_PROJECT,
|
|
|
|
FILE_EXPORT_MESH_LIBRARY,
|
2019-04-08 02:46:52 +08:00
|
|
|
FILE_INSTALL_ANDROID_SOURCE,
|
|
|
|
FILE_EXPLORE_ANDROID_BUILD_TEMPLATES,
|
2014-02-10 09:10:30 +08:00
|
|
|
FILE_SAVE_OPTIMIZED,
|
|
|
|
FILE_OPEN_RECENT,
|
|
|
|
FILE_OPEN_OLD_SCENE,
|
2019-05-10 04:06:35 +08:00
|
|
|
FILE_QUICK_OPEN,
|
2014-02-10 09:10:30 +08:00
|
|
|
FILE_QUICK_OPEN_SCENE,
|
|
|
|
FILE_QUICK_OPEN_SCRIPT,
|
|
|
|
FILE_OPEN_PREV,
|
2015-06-22 11:03:19 +08:00
|
|
|
FILE_CLOSE,
|
2019-04-21 17:44:21 +08:00
|
|
|
FILE_CLOSE_OTHERS,
|
|
|
|
FILE_CLOSE_RIGHT,
|
|
|
|
FILE_CLOSE_ALL,
|
2017-06-26 22:04:53 +08:00
|
|
|
FILE_CLOSE_ALL_AND_QUIT,
|
|
|
|
FILE_CLOSE_ALL_AND_RUN_PROJECT_MANAGER,
|
2022-03-23 19:07:29 +08:00
|
|
|
FILE_CLOSE_ALL_AND_RELOAD_CURRENT_PROJECT,
|
2014-02-10 09:10:30 +08:00
|
|
|
FILE_QUIT,
|
|
|
|
FILE_EXTERNAL_OPEN_SCENE,
|
|
|
|
EDIT_UNDO,
|
|
|
|
EDIT_REDO,
|
2020-05-11 02:12:25 +08:00
|
|
|
EDIT_RELOAD_SAVED_SCENE,
|
2015-11-29 12:08:31 +08:00
|
|
|
TOOLS_ORPHAN_RESOURCES,
|
2022-07-14 20:18:18 +08:00
|
|
|
TOOLS_BUILD_PROFILE_MANAGER,
|
2018-03-17 09:50:35 +08:00
|
|
|
TOOLS_CUSTOM,
|
2014-02-10 09:10:30 +08:00
|
|
|
RESOURCE_SAVE,
|
|
|
|
RESOURCE_SAVE_AS,
|
|
|
|
RUN_PLAY,
|
2016-05-22 08:18:16 +08:00
|
|
|
|
2014-02-10 09:10:30 +08:00
|
|
|
RUN_STOP,
|
|
|
|
RUN_PLAY_SCENE,
|
|
|
|
RUN_PLAY_CUSTOM_SCENE,
|
|
|
|
RUN_SETTINGS,
|
2021-12-28 08:51:45 +08:00
|
|
|
RUN_USER_DATA_FOLDER,
|
2022-03-23 19:07:29 +08:00
|
|
|
RELOAD_CURRENT_PROJECT,
|
2014-02-18 12:21:06 +08:00
|
|
|
RUN_PROJECT_MANAGER,
|
2020-09-30 03:01:26 +08:00
|
|
|
RUN_VCS_METADATA,
|
2019-09-03 22:42:08 +08:00
|
|
|
RUN_VCS_SETTINGS,
|
2018-12-11 23:52:25 +08:00
|
|
|
SETTINGS_UPDATE_CONTINUOUSLY,
|
|
|
|
SETTINGS_UPDATE_WHEN_CHANGED,
|
2019-09-03 22:42:08 +08:00
|
|
|
SETTINGS_UPDATE_ALWAYS,
|
|
|
|
SETTINGS_UPDATE_CHANGES,
|
2016-10-01 22:15:07 +08:00
|
|
|
SETTINGS_UPDATE_SPINNER_HIDE,
|
2014-02-10 09:10:30 +08:00
|
|
|
SETTINGS_PREFERENCES,
|
2015-11-23 02:11:17 +08:00
|
|
|
SETTINGS_LAYOUT_SAVE,
|
|
|
|
SETTINGS_LAYOUT_DELETE,
|
|
|
|
SETTINGS_LAYOUT_DEFAULT,
|
2018-07-26 01:53:12 +08:00
|
|
|
SETTINGS_EDITOR_DATA_FOLDER,
|
|
|
|
SETTINGS_EDITOR_CONFIG_FOLDER,
|
2017-03-21 10:31:41 +08:00
|
|
|
SETTINGS_MANAGE_EXPORT_TEMPLATES,
|
2019-04-09 06:18:03 +08:00
|
|
|
SETTINGS_MANAGE_FEATURE_PROFILES,
|
2021-07-15 21:12:56 +08:00
|
|
|
SETTINGS_INSTALL_ANDROID_BUILD_TEMPLATE,
|
2016-06-28 06:59:33 +08:00
|
|
|
SETTINGS_PICK_MAIN_SCENE,
|
2018-06-11 13:53:25 +08:00
|
|
|
SETTINGS_TOGGLE_FULLSCREEN,
|
2014-02-10 09:10:30 +08:00
|
|
|
SETTINGS_HELP,
|
2015-11-19 21:15:17 +08:00
|
|
|
SCENE_TAB_CLOSE,
|
2014-02-10 09:10:30 +08:00
|
|
|
|
2019-03-29 21:53:11 +08:00
|
|
|
EDITOR_SCREENSHOT,
|
|
|
|
EDITOR_OPEN_SCREENSHOT,
|
|
|
|
|
2017-05-26 22:34:41 +08:00
|
|
|
HELP_SEARCH,
|
2021-05-29 21:28:16 +08:00
|
|
|
HELP_COMMAND_PALETTE,
|
2017-05-26 22:34:41 +08:00
|
|
|
HELP_DOCS,
|
|
|
|
HELP_QA,
|
2020-01-30 06:10:09 +08:00
|
|
|
HELP_REPORT_A_BUG,
|
2021-06-16 08:24:34 +08:00
|
|
|
HELP_SUGGEST_A_FEATURE,
|
2020-01-30 06:10:09 +08:00
|
|
|
HELP_SEND_DOCS_FEEDBACK,
|
2017-05-26 22:34:41 +08:00
|
|
|
HELP_COMMUNITY,
|
|
|
|
HELP_ABOUT,
|
2021-05-15 07:57:21 +08:00
|
|
|
HELP_SUPPORT_GODOT_DEVELOPMENT,
|
2017-05-26 22:34:41 +08:00
|
|
|
|
2022-09-08 08:44:36 +08:00
|
|
|
SET_RENDERER_NAME_SAVE_AND_RESTART,
|
2018-07-20 05:58:15 +08:00
|
|
|
|
2019-02-06 21:57:06 +08:00
|
|
|
GLOBAL_NEW_WINDOW,
|
|
|
|
GLOBAL_SCENE,
|
|
|
|
|
2014-02-10 09:10:30 +08:00
|
|
|
IMPORT_PLUGIN_BASE = 100,
|
|
|
|
|
2016-08-07 22:01:22 +08:00
|
|
|
TOOL_MENU_BASE = 1000
|
2014-02-10 09:10:30 +08:00
|
|
|
};
|
|
|
|
|
2022-03-31 02:12:26 +08:00
|
|
|
enum {
|
|
|
|
MAX_INIT_CALLBACKS = 128,
|
|
|
|
MAX_BUILD_CALLBACKS = 128
|
|
|
|
};
|
|
|
|
|
|
|
|
struct BottomPanelItem {
|
|
|
|
String name;
|
|
|
|
Control *control = nullptr;
|
|
|
|
Button *button = nullptr;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct ExportDefer {
|
|
|
|
String preset;
|
|
|
|
String path;
|
|
|
|
bool debug = false;
|
|
|
|
bool pack_only = false;
|
|
|
|
} export_defer;
|
|
|
|
|
|
|
|
static EditorNode *singleton;
|
|
|
|
|
|
|
|
EditorData editor_data;
|
|
|
|
EditorFolding editor_folding;
|
|
|
|
EditorRun editor_run;
|
|
|
|
EditorSelectionHistory editor_history;
|
|
|
|
|
|
|
|
EditorCommandPalette *command_palette = nullptr;
|
|
|
|
EditorExport *editor_export = nullptr;
|
|
|
|
EditorInterface *editor_interface = nullptr;
|
|
|
|
EditorLog *log = nullptr;
|
|
|
|
EditorNativeShaderSourceVisualizer *native_shader_source_visualizer = nullptr;
|
|
|
|
EditorPlugin *editor_plugin_screen = nullptr;
|
|
|
|
EditorPluginList *editor_plugins_force_input_forwarding = nullptr;
|
|
|
|
EditorPluginList *editor_plugins_force_over = nullptr;
|
|
|
|
EditorPluginList *editor_plugins_over = nullptr;
|
|
|
|
EditorQuickOpen *quick_open = nullptr;
|
|
|
|
EditorQuickOpen *quick_run = nullptr;
|
|
|
|
EditorResourcePreview *resource_preview = nullptr;
|
|
|
|
EditorRunNative *run_native = nullptr;
|
|
|
|
EditorSelection *editor_selection = nullptr;
|
|
|
|
EditorSettingsDialog *editor_settings_dialog = nullptr;
|
2022-11-07 03:53:20 +08:00
|
|
|
HistoryDock *history_dock = nullptr;
|
2022-03-31 02:12:26 +08:00
|
|
|
|
|
|
|
ProjectExportDialog *project_export = nullptr;
|
|
|
|
ProjectSettingsEditor *project_settings_editor = nullptr;
|
|
|
|
|
|
|
|
Vector<EditorPlugin *> editor_plugins;
|
|
|
|
bool _initializing_plugins = false;
|
2022-05-13 21:04:37 +08:00
|
|
|
HashMap<String, EditorPlugin *> addon_name_to_plugin;
|
2014-02-10 09:10:30 +08:00
|
|
|
|
2022-04-04 21:06:57 +08:00
|
|
|
PanelContainer *scene_root_parent = nullptr;
|
|
|
|
Control *theme_base = nullptr;
|
|
|
|
Control *gui_base = nullptr;
|
|
|
|
VBoxContainer *main_vbox = nullptr;
|
2022-09-08 08:44:36 +08:00
|
|
|
OptionButton *renderer = nullptr;
|
2018-07-20 05:58:15 +08:00
|
|
|
|
2022-04-04 21:06:57 +08:00
|
|
|
ConfirmationDialog *video_restart_dialog = nullptr;
|
2018-07-20 05:58:15 +08:00
|
|
|
|
2022-09-08 08:44:36 +08:00
|
|
|
int renderer_current = 0;
|
|
|
|
String renderer_request;
|
2015-06-14 09:12:53 +08:00
|
|
|
|
2022-03-31 02:12:26 +08:00
|
|
|
// Split containers.
|
2022-04-04 21:06:57 +08:00
|
|
|
HSplitContainer *left_l_hsplit = nullptr;
|
|
|
|
VSplitContainer *left_l_vsplit = nullptr;
|
|
|
|
HSplitContainer *left_r_hsplit = nullptr;
|
|
|
|
VSplitContainer *left_r_vsplit = nullptr;
|
|
|
|
HSplitContainer *main_hsplit = nullptr;
|
|
|
|
HSplitContainer *right_hsplit = nullptr;
|
|
|
|
VSplitContainer *right_l_vsplit = nullptr;
|
|
|
|
VSplitContainer *right_r_vsplit = nullptr;
|
|
|
|
VSplitContainer *center_split = nullptr;
|
2022-03-31 02:12:26 +08:00
|
|
|
// To access those easily by index.
|
2018-09-14 22:56:18 +08:00
|
|
|
Vector<VSplitContainer *> vsplits;
|
|
|
|
Vector<HSplitContainer *> hsplits;
|
|
|
|
|
2022-03-31 02:12:26 +08:00
|
|
|
// Main tabs.
|
2022-04-04 21:06:57 +08:00
|
|
|
TabBar *scene_tabs = nullptr;
|
|
|
|
PopupMenu *scene_tabs_context_menu = nullptr;
|
|
|
|
Panel *tab_preview_panel = nullptr;
|
|
|
|
TextureRect *tab_preview = nullptr;
|
2022-05-02 22:28:25 +08:00
|
|
|
int tab_closing_idx = 0;
|
2015-06-14 09:12:53 +08:00
|
|
|
|
2022-02-15 22:56:58 +08:00
|
|
|
bool exiting = false;
|
|
|
|
bool dimmed = false;
|
2015-06-14 09:12:53 +08:00
|
|
|
|
2022-05-02 22:28:25 +08:00
|
|
|
int old_split_ofs = 0;
|
2022-04-04 21:06:57 +08:00
|
|
|
VSplitContainer *top_split = nullptr;
|
|
|
|
HBoxContainer *bottom_hb = nullptr;
|
|
|
|
Control *vp_base = nullptr;
|
|
|
|
|
2022-09-22 17:06:11 +08:00
|
|
|
Label *project_title = nullptr;
|
|
|
|
Control *left_menu_spacer = nullptr;
|
|
|
|
Control *right_menu_spacer = nullptr;
|
2022-08-23 18:40:48 +08:00
|
|
|
EditorTitleBar *menu_hb = nullptr;
|
2022-09-07 07:30:54 +08:00
|
|
|
VBoxContainer *main_screen_vbox = nullptr;
|
2022-08-01 17:28:16 +08:00
|
|
|
MenuBar *main_menu = nullptr;
|
|
|
|
PopupMenu *file_menu = nullptr;
|
|
|
|
PopupMenu *project_menu = nullptr;
|
|
|
|
PopupMenu *debug_menu = nullptr;
|
|
|
|
PopupMenu *settings_menu = nullptr;
|
|
|
|
PopupMenu *help_menu = nullptr;
|
2022-04-04 21:06:57 +08:00
|
|
|
PopupMenu *tool_menu = nullptr;
|
2022-04-06 20:41:04 +08:00
|
|
|
PopupMenu *export_as_menu = nullptr;
|
2022-04-04 21:06:57 +08:00
|
|
|
Button *export_button = nullptr;
|
|
|
|
Button *prev_scene = nullptr;
|
2022-08-30 22:12:49 +08:00
|
|
|
Button *search_button = nullptr;
|
|
|
|
TextureProgressBar *audio_vu = nullptr;
|
|
|
|
|
|
|
|
PanelContainer *launch_pad = nullptr;
|
2022-04-04 21:06:57 +08:00
|
|
|
Button *play_button = nullptr;
|
|
|
|
Button *pause_button = nullptr;
|
|
|
|
Button *stop_button = nullptr;
|
|
|
|
Button *play_scene_button = nullptr;
|
|
|
|
Button *play_custom_scene_button = nullptr;
|
2022-08-30 22:12:49 +08:00
|
|
|
PanelContainer *write_movie_panel = nullptr;
|
Implement Running Godot as Movie Writer
* Allows running the game in "movie writer" mode.
* It ensures entirely stable framerate, so your run can be saved stable and with proper sound (which is impossible if your CPU/GPU can't sustain doing this in real-time).
* If disabling vsync, it can save movies faster than the game is run, but if you want to control the interaction it can get difficult.
* Implements a simple, default MJPEG writer.
This new features has two main use cases, which have high demand:
* Saving game videos in high quality and ensuring the frame rate is *completely* stable, always.
* Using Godot as a tool to make movies and animations (which is ideal if you want interaction, or creating them procedurally. No other software is as good for this).
**Note**: This feature **IS NOT** for capturing real-time footage. Use something like OBS, SimpleScreenRecorder or FRAPS to achieve that, as they do a much better job at intercepting the compositor than Godot can probably do using Vulkan or OpenGL natively. If your game runs near real-time when capturing, you can still use this feature but it will play no sound (sound will be saved directly).
Usage:
$ godot --write-movie movie.avi [scene_file.tscn]
Missing:
* Options for configuring video writing via GLOBAL_DEF
* UI Menu for launching with this mode from the editor.
* Add to list of command line options.
* Add a feature tag to override configurations when movie writing (fantastic for saving videos with highest quality settings).
2022-06-17 06:55:19 +08:00
|
|
|
Button *write_movie_button = nullptr;
|
2022-04-04 21:06:57 +08:00
|
|
|
|
|
|
|
Timer *screenshot_timer = nullptr;
|
|
|
|
|
|
|
|
PluginConfigDialog *plugin_config_dialog = nullptr;
|
|
|
|
|
|
|
|
RichTextLabel *load_errors = nullptr;
|
|
|
|
AcceptDialog *load_error_dialog = nullptr;
|
|
|
|
|
|
|
|
RichTextLabel *execute_outputs = nullptr;
|
|
|
|
AcceptDialog *execute_output_dialog = nullptr;
|
2019-04-08 02:46:52 +08:00
|
|
|
|
2015-01-04 03:52:37 +08:00
|
|
|
Ref<Theme> theme;
|
2014-02-10 09:10:30 +08:00
|
|
|
|
2022-04-04 21:06:57 +08:00
|
|
|
PopupMenu *recent_scenes = nullptr;
|
2022-03-31 02:12:26 +08:00
|
|
|
String _recent_scene;
|
|
|
|
List<String> previous_scenes;
|
|
|
|
String defer_load_scene;
|
2022-04-04 21:06:57 +08:00
|
|
|
Node *_last_instantiated_scene = nullptr;
|
|
|
|
|
|
|
|
ConfirmationDialog *confirmation = nullptr;
|
|
|
|
ConfirmationDialog *save_confirmation = nullptr;
|
|
|
|
ConfirmationDialog *import_confirmation = nullptr;
|
|
|
|
ConfirmationDialog *pick_main_scene = nullptr;
|
|
|
|
Button *select_current_scene_button = nullptr;
|
|
|
|
AcceptDialog *accept = nullptr;
|
|
|
|
AcceptDialog *save_accept = nullptr;
|
|
|
|
EditorAbout *about = nullptr;
|
|
|
|
AcceptDialog *warning = nullptr;
|
2014-02-10 09:10:30 +08:00
|
|
|
|
2022-05-02 22:28:25 +08:00
|
|
|
int overridden_default_layout = -1;
|
2016-01-12 05:23:45 +08:00
|
|
|
Ref<ConfigFile> default_layout;
|
2022-04-04 21:06:57 +08:00
|
|
|
PopupMenu *editor_layouts = nullptr;
|
|
|
|
EditorLayoutsDialog *layout_dialog = nullptr;
|
|
|
|
|
|
|
|
ConfirmationDialog *custom_build_manage_templates = nullptr;
|
|
|
|
ConfirmationDialog *install_android_build_template = nullptr;
|
|
|
|
ConfirmationDialog *remove_android_build_template = nullptr;
|
|
|
|
|
|
|
|
PopupMenu *vcs_actions_menu = nullptr;
|
|
|
|
EditorFileDialog *file = nullptr;
|
|
|
|
ExportTemplateManager *export_template_manager = nullptr;
|
|
|
|
EditorFeatureProfileManager *feature_profile_manager = nullptr;
|
2022-07-14 20:18:18 +08:00
|
|
|
EditorBuildProfileManager *build_profile_manager = nullptr;
|
2022-04-04 21:06:57 +08:00
|
|
|
EditorFileDialog *file_templates = nullptr;
|
|
|
|
EditorFileDialog *file_export_lib = nullptr;
|
|
|
|
EditorFileDialog *file_script = nullptr;
|
|
|
|
EditorFileDialog *file_android_build_source = nullptr;
|
|
|
|
CheckBox *file_export_lib_merge = nullptr;
|
|
|
|
CheckBox *file_export_lib_apply_xforms = nullptr;
|
2014-02-10 09:10:30 +08:00
|
|
|
String current_path;
|
2022-04-04 21:06:57 +08:00
|
|
|
MenuButton *update_spinner = nullptr;
|
2017-05-24 18:00:55 +08:00
|
|
|
|
2022-09-22 17:06:11 +08:00
|
|
|
HBoxContainer *main_editor_button_hb = nullptr;
|
2020-06-20 02:49:04 +08:00
|
|
|
Vector<Button *> main_editor_buttons;
|
2014-02-10 09:10:30 +08:00
|
|
|
Vector<EditorPlugin *> editor_table;
|
|
|
|
|
2022-04-04 21:06:57 +08:00
|
|
|
AudioStreamPreviewGenerator *audio_preview_gen = nullptr;
|
|
|
|
ProgressDialog *progress_dialog = nullptr;
|
|
|
|
BackgroundProgress *progress_hb = nullptr;
|
2014-02-10 09:10:30 +08:00
|
|
|
|
2022-04-04 21:06:57 +08:00
|
|
|
DependencyErrorDialog *dependency_error = nullptr;
|
2022-05-19 23:00:06 +08:00
|
|
|
HashMap<String, HashSet<String>> dependency_errors;
|
2022-04-04 21:06:57 +08:00
|
|
|
DependencyEditor *dependency_fixer = nullptr;
|
|
|
|
OrphanResourcesDialog *orphan_resources = nullptr;
|
|
|
|
ConfirmationDialog *open_imported = nullptr;
|
|
|
|
Button *new_inherited_button = nullptr;
|
2017-02-05 07:31:15 +08:00
|
|
|
String open_import_request;
|
|
|
|
|
2020-03-07 01:00:16 +08:00
|
|
|
Vector<Control *> floating_docks;
|
|
|
|
|
2022-04-04 21:06:57 +08:00
|
|
|
Button *dock_float = nullptr;
|
|
|
|
Button *dock_tab_move_left = nullptr;
|
|
|
|
Button *dock_tab_move_right = nullptr;
|
|
|
|
Control *dock_select = nullptr;
|
|
|
|
PopupPanel *dock_select_popup = nullptr;
|
2022-03-31 02:12:26 +08:00
|
|
|
Rect2 dock_select_rect[DOCK_SLOT_MAX];
|
|
|
|
TabContainer *dock_slot[DOCK_SLOT_MAX];
|
2022-04-04 21:06:57 +08:00
|
|
|
Timer *dock_drag_timer = nullptr;
|
2022-02-15 22:56:58 +08:00
|
|
|
bool docks_visible = true;
|
2022-05-02 22:28:25 +08:00
|
|
|
int dock_popup_selected_idx = -1;
|
|
|
|
int dock_select_rect_over_idx = -1;
|
2017-11-17 06:57:57 +08:00
|
|
|
|
2022-08-29 22:40:17 +08:00
|
|
|
PanelContainer *tabbar_panel = nullptr;
|
2022-04-04 21:06:57 +08:00
|
|
|
HBoxContainer *tabbar_container = nullptr;
|
|
|
|
Button *distraction_free = nullptr;
|
|
|
|
Button *scene_tab_add = nullptr;
|
|
|
|
Control *scene_tab_add_ph = nullptr;
|
2015-06-14 09:12:53 +08:00
|
|
|
|
2022-03-31 02:12:26 +08:00
|
|
|
Vector<BottomPanelItem> bottom_panel_items;
|
2022-04-04 21:06:57 +08:00
|
|
|
PanelContainer *bottom_panel = nullptr;
|
|
|
|
HBoxContainer *bottom_panel_hb = nullptr;
|
|
|
|
HBoxContainer *bottom_panel_hb_editors = nullptr;
|
|
|
|
VBoxContainer *bottom_panel_vb = nullptr;
|
|
|
|
EditorToaster *editor_toaster = nullptr;
|
|
|
|
LinkButton *version_btn = nullptr;
|
|
|
|
Button *bottom_panel_raise = nullptr;
|
2014-02-10 09:10:30 +08:00
|
|
|
|
2022-04-04 21:06:57 +08:00
|
|
|
Tree *disk_changed_list = nullptr;
|
|
|
|
ConfirmationDialog *disk_changed = nullptr;
|
2014-02-10 09:10:30 +08:00
|
|
|
|
2022-03-31 02:12:26 +08:00
|
|
|
bool scene_distraction_free = false;
|
|
|
|
bool script_distraction_free = false;
|
2014-02-10 09:10:30 +08:00
|
|
|
|
2022-02-15 22:56:58 +08:00
|
|
|
bool _playing_edited = false;
|
|
|
|
bool changing_scene = false;
|
2022-03-31 02:12:26 +08:00
|
|
|
bool cmdline_export_mode = false;
|
|
|
|
bool convert_old = false;
|
|
|
|
bool immediate_dialog_confirmed = false;
|
|
|
|
bool opening_prev = false;
|
|
|
|
bool restoring_scenes = false;
|
|
|
|
bool settings_changed = true; // Make it update settings on first frame.
|
|
|
|
bool unsaved_cache = true;
|
2022-02-15 22:56:58 +08:00
|
|
|
bool waiting_for_first_scan = true;
|
2016-05-28 01:18:40 +08:00
|
|
|
|
2022-05-02 22:28:25 +08:00
|
|
|
int current_menu_option = 0;
|
2022-03-31 02:12:26 +08:00
|
|
|
|
2022-04-04 21:06:57 +08:00
|
|
|
SubViewport *scene_root = nullptr; // Root of the scene being edited.
|
|
|
|
Object *current = nullptr;
|
2022-03-31 02:12:26 +08:00
|
|
|
|
|
|
|
Ref<Resource> saving_resource;
|
|
|
|
|
2022-05-02 22:28:25 +08:00
|
|
|
uint64_t update_spinner_step_msec = 0;
|
|
|
|
uint64_t update_spinner_step_frame = 0;
|
|
|
|
int update_spinner_step = 0;
|
2014-02-10 09:10:30 +08:00
|
|
|
|
2022-03-31 02:12:26 +08:00
|
|
|
String _tmp_import_path;
|
|
|
|
String external_file;
|
|
|
|
String open_navigate;
|
2022-03-02 06:19:02 +08:00
|
|
|
|
2022-03-31 02:12:26 +08:00
|
|
|
String run_custom_filename;
|
2022-03-02 06:19:02 +08:00
|
|
|
String run_current_filename;
|
2014-02-10 09:10:30 +08:00
|
|
|
|
2022-04-04 21:06:57 +08:00
|
|
|
DynamicFontImportSettings *fontdata_import_settings = nullptr;
|
|
|
|
SceneImportSettings *scene_import_settings = nullptr;
|
2022-07-21 07:00:58 +08:00
|
|
|
AudioStreamImportSettings *audio_stream_import_settings = nullptr;
|
2016-01-18 07:03:57 +08:00
|
|
|
|
2022-03-31 02:12:26 +08:00
|
|
|
String import_reload_fn;
|
2016-01-18 07:03:57 +08:00
|
|
|
|
2022-05-19 23:00:06 +08:00
|
|
|
HashSet<String> textfile_extensions;
|
|
|
|
HashSet<FileDialog *> file_dialogs;
|
|
|
|
HashSet<EditorFileDialog *> editor_file_dialogs;
|
2018-07-16 09:38:14 +08:00
|
|
|
|
2022-03-31 02:12:26 +08:00
|
|
|
Vector<Ref<EditorResourceConversionPlugin>> resource_conversion_plugins;
|
|
|
|
PrintHandlerList print_handler;
|
2019-08-29 01:42:27 +08:00
|
|
|
|
2022-05-13 21:04:37 +08:00
|
|
|
HashMap<String, Ref<Texture2D>> icon_type_cache;
|
|
|
|
HashMap<Ref<Script>, Ref<Texture>> script_icon_cache;
|
2016-01-18 07:03:57 +08:00
|
|
|
|
2022-03-31 02:12:26 +08:00
|
|
|
static EditorBuildCallback build_callbacks[MAX_BUILD_CALLBACKS];
|
|
|
|
static EditorPluginInitializeCallback plugin_init_callbacks[MAX_INIT_CALLBACKS];
|
|
|
|
static int build_callback_count;
|
|
|
|
static int plugin_init_callback_count;
|
|
|
|
static Vector<EditorNodeInitCallback> _init_callbacks;
|
2017-08-26 21:32:15 +08:00
|
|
|
|
2022-03-31 02:12:26 +08:00
|
|
|
static void _dependency_error_report(void *ud, const String &p_path, const String &p_dep, const String &p_type) {
|
2022-04-05 18:40:26 +08:00
|
|
|
EditorNode *en = static_cast<EditorNode *>(ud);
|
2022-03-31 02:12:26 +08:00
|
|
|
if (!en->dependency_errors.has(p_path)) {
|
2022-05-19 23:00:06 +08:00
|
|
|
en->dependency_errors[p_path] = HashSet<String>();
|
2022-03-31 02:12:26 +08:00
|
|
|
}
|
|
|
|
en->dependency_errors[p_path].insert(p_dep + "::" + p_type);
|
|
|
|
}
|
2016-01-18 07:03:57 +08:00
|
|
|
|
2022-03-31 02:12:26 +08:00
|
|
|
static Ref<Texture2D> _file_dialog_get_icon(const String &p_path);
|
|
|
|
static void _file_dialog_register(FileDialog *p_dialog);
|
|
|
|
static void _file_dialog_unregister(FileDialog *p_dialog);
|
|
|
|
static void _editor_file_dialog_register(EditorFileDialog *p_dialog);
|
|
|
|
static void _editor_file_dialog_unregister(EditorFileDialog *p_dialog);
|
|
|
|
|
|
|
|
static void _load_error_notify(void *p_ud, const String &p_text);
|
|
|
|
static void _file_access_close_error_notify(const String &p_str);
|
|
|
|
|
2022-05-03 07:29:38 +08:00
|
|
|
static void _print_handler(void *p_this, const String &p_string, bool p_error, bool p_rich);
|
2022-05-03 07:43:50 +08:00
|
|
|
static void _resource_saved(Ref<Resource> p_resource, const String &p_path);
|
|
|
|
static void _resource_loaded(Ref<Resource> p_resource, const String &p_path);
|
2022-03-31 02:12:26 +08:00
|
|
|
|
|
|
|
void _build_icon_type_cache();
|
2016-03-09 07:00:52 +08:00
|
|
|
|
2014-02-10 09:10:30 +08:00
|
|
|
void _dialog_action(String p_file);
|
|
|
|
|
2021-09-13 03:17:34 +08:00
|
|
|
void _edit_current(bool p_skip_foreign = false);
|
2017-08-28 11:24:50 +08:00
|
|
|
void _dialog_display_save_error(String p_file, Error p_error);
|
|
|
|
void _dialog_display_load_error(String p_file, Error p_error);
|
2016-03-09 07:00:52 +08:00
|
|
|
|
2014-02-10 09:10:30 +08:00
|
|
|
void _menu_option(int p_option);
|
|
|
|
void _menu_confirm_current();
|
|
|
|
void _menu_option_confirm(int p_option, bool p_confirmed);
|
2019-03-29 21:53:11 +08:00
|
|
|
|
2021-07-15 21:12:56 +08:00
|
|
|
void _android_build_source_selected(const String &p_file);
|
|
|
|
|
2019-03-29 21:53:11 +08:00
|
|
|
void _request_screenshot();
|
|
|
|
void _screenshot(bool p_use_utc = false);
|
|
|
|
void _save_screenshot(NodePath p_path);
|
|
|
|
|
2018-03-17 09:50:35 +08:00
|
|
|
void _tool_menu_option(int p_idx);
|
2022-04-06 20:41:04 +08:00
|
|
|
void _export_as_menu_option(int p_idx);
|
2019-04-10 23:21:26 +08:00
|
|
|
void _update_file_menu_opened();
|
|
|
|
void _update_file_menu_closed();
|
2014-02-10 09:10:30 +08:00
|
|
|
|
2021-05-09 20:17:15 +08:00
|
|
|
void _remove_plugin_from_enabled(const String &p_name);
|
2018-07-19 23:34:22 +08:00
|
|
|
|
2014-02-10 09:10:30 +08:00
|
|
|
void _fs_changed();
|
2017-09-01 05:57:03 +08:00
|
|
|
void _resources_reimported(const Vector<String> &p_resources);
|
2014-02-10 09:10:30 +08:00
|
|
|
void _sources_changed(bool p_exist);
|
|
|
|
|
|
|
|
void _node_renamed();
|
2017-05-17 03:26:32 +08:00
|
|
|
void _editor_select_next();
|
|
|
|
void _editor_select_prev();
|
2016-06-26 11:54:17 +08:00
|
|
|
void _set_scene_metadata(const String &p_file, int p_idx = -1);
|
2015-12-31 11:31:00 +08:00
|
|
|
void _get_scene_metadata(const String &p_file);
|
2014-02-10 09:10:30 +08:00
|
|
|
void _update_title();
|
2015-06-22 11:03:19 +08:00
|
|
|
void _update_scene_tabs();
|
2019-09-03 22:42:08 +08:00
|
|
|
void _version_control_menu_option(int p_idx);
|
2014-02-10 09:10:30 +08:00
|
|
|
void _close_messages();
|
|
|
|
void _show_messages();
|
|
|
|
void _vp_resized();
|
2022-09-22 17:06:11 +08:00
|
|
|
void _titlebar_resized();
|
2019-12-24 08:20:54 +08:00
|
|
|
void _version_button_pressed();
|
2014-02-10 09:10:30 +08:00
|
|
|
|
2019-02-28 07:00:40 +08:00
|
|
|
int _save_external_resources();
|
|
|
|
|
2018-11-28 05:56:31 +08:00
|
|
|
bool _validate_scene_recursive(const String &p_filename, Node *p_node);
|
2016-06-26 11:54:17 +08:00
|
|
|
void _save_scene(String p_file, int idx = -1);
|
2017-06-24 18:57:30 +08:00
|
|
|
void _save_all_scenes();
|
2017-07-26 19:29:45 +08:00
|
|
|
int _next_unsaved_scene(bool p_valid_filename, int p_start = 0);
|
2017-06-21 12:15:39 +08:00
|
|
|
void _discard_changes(const String &p_str = String());
|
2014-02-10 09:10:30 +08:00
|
|
|
|
2019-05-08 10:35:23 +08:00
|
|
|
void _inherit_request(String p_file);
|
2021-06-18 06:03:09 +08:00
|
|
|
void _instantiate_request(const Vector<String> &p_files);
|
2014-02-10 09:10:30 +08:00
|
|
|
|
2016-03-30 07:02:53 +08:00
|
|
|
void _display_top_editors(bool p_display);
|
|
|
|
void _set_top_editors(Vector<EditorPlugin *> p_editor_plugins_over);
|
|
|
|
void _set_editing_top_editors(Object *p_current_object);
|
2016-05-21 21:29:25 +08:00
|
|
|
|
2016-01-08 19:27:34 +08:00
|
|
|
void _quick_opened();
|
2016-02-18 02:40:06 +08:00
|
|
|
void _quick_run();
|
2021-05-29 21:28:16 +08:00
|
|
|
void _open_command_palette();
|
2014-02-10 09:10:30 +08:00
|
|
|
|
2022-08-30 22:12:49 +08:00
|
|
|
void _write_movie_toggled(bool p_enabled);
|
|
|
|
|
2014-02-10 09:10:30 +08:00
|
|
|
void _run(bool p_current = false, const String &p_custom = "");
|
2020-03-16 16:37:43 +08:00
|
|
|
void _run_native(const Ref<EditorExportPreset> &p_preset);
|
2022-03-02 06:19:02 +08:00
|
|
|
void _reset_play_buttons();
|
2014-02-10 09:10:30 +08:00
|
|
|
|
|
|
|
void _add_to_recent_scenes(const String &p_scene);
|
|
|
|
void _update_recent_scenes();
|
|
|
|
void _open_recent_scene(int p_idx);
|
2020-03-08 00:02:54 +08:00
|
|
|
void _global_menu_scene(const Variant &p_tag);
|
|
|
|
void _global_menu_new_window(const Variant &p_tag);
|
2022-04-11 03:25:24 +08:00
|
|
|
void _dropped_files(const Vector<String> &p_files);
|
2019-03-26 05:39:45 +08:00
|
|
|
void _add_dropped_files_recursive(const Vector<String> &p_files, String to_path);
|
2014-02-10 09:10:30 +08:00
|
|
|
|
2022-03-31 02:12:26 +08:00
|
|
|
void _update_from_settings();
|
2019-01-17 20:09:01 +08:00
|
|
|
|
2022-09-08 08:44:36 +08:00
|
|
|
void _renderer_selected(int);
|
|
|
|
void _update_renderer_color();
|
2014-02-10 09:10:30 +08:00
|
|
|
|
2022-03-31 02:12:26 +08:00
|
|
|
void _exit_editor(int p_exit_code);
|
2014-02-10 09:10:30 +08:00
|
|
|
|
2022-01-11 21:59:52 +08:00
|
|
|
virtual void shortcut_input(const Ref<InputEvent> &p_event) override;
|
2014-02-10 09:10:30 +08:00
|
|
|
|
|
|
|
bool has_main_screen() const { return true; }
|
|
|
|
|
2019-06-04 11:36:23 +08:00
|
|
|
void _remove_edited_scene(bool p_change_tab = true);
|
|
|
|
void _remove_scene(int index, bool p_change_tab = true);
|
2022-05-13 21:04:37 +08:00
|
|
|
bool _find_and_save_resource(Ref<Resource> p_res, HashMap<Ref<Resource>, bool> &processed, int32_t flags);
|
|
|
|
bool _find_and_save_edited_subresources(Object *obj, HashMap<Ref<Resource>, bool> &processed, int32_t flags);
|
|
|
|
void _save_edited_subresources(Node *scene, HashMap<Ref<Resource>, bool> &processed, int32_t flags);
|
2017-06-30 01:37:54 +08:00
|
|
|
void _mark_unsaved_scenes();
|
2014-02-10 09:10:30 +08:00
|
|
|
|
2015-05-31 12:59:42 +08:00
|
|
|
void _find_node_types(Node *p_node, int &count_2d, int &count_3d);
|
2017-11-12 11:48:00 +08:00
|
|
|
void _save_scene_with_preview(String p_file, int p_idx = -1);
|
2015-05-31 12:59:42 +08:00
|
|
|
|
2014-06-19 13:23:03 +08:00
|
|
|
bool _find_scene_in_use(Node *p_node, const String &p_path) const;
|
|
|
|
|
2020-03-07 01:00:16 +08:00
|
|
|
void _update_dock_containers();
|
|
|
|
|
2017-05-20 23:38:03 +08:00
|
|
|
void _dock_select_input(const Ref<InputEvent> &p_input);
|
2015-06-14 11:41:08 +08:00
|
|
|
void _dock_move_left();
|
|
|
|
void _dock_move_right();
|
2015-06-14 09:12:53 +08:00
|
|
|
void _dock_select_draw();
|
|
|
|
void _dock_pre_popup(int p_which);
|
|
|
|
void _dock_split_dragged(int ofs);
|
2015-06-14 11:41:08 +08:00
|
|
|
void _dock_popup_exit();
|
2020-03-07 01:00:16 +08:00
|
|
|
void _dock_floating_close_request(Control *p_control);
|
|
|
|
void _dock_make_float();
|
2015-06-22 11:03:19 +08:00
|
|
|
void _scene_tab_changed(int p_tab);
|
2019-04-21 17:44:21 +08:00
|
|
|
void _scene_tab_closed(int p_tab, int option = SCENE_TAB_CLOSE);
|
2020-12-09 19:04:02 +08:00
|
|
|
void _scene_tab_hovered(int p_tab);
|
2017-06-15 23:30:03 +08:00
|
|
|
void _scene_tab_exit();
|
|
|
|
void _scene_tab_input(const Ref<InputEvent> &p_input);
|
2017-07-05 21:44:53 +08:00
|
|
|
void _reposition_active_tab(int idx_to);
|
2019-06-12 02:43:37 +08:00
|
|
|
void _thumbnail_done(const String &p_path, const Ref<Texture2D> &p_preview, const Ref<Texture2D> &p_small_preview, const Variant &p_udata);
|
2015-07-26 21:44:10 +08:00
|
|
|
void _scene_tab_script_edited(int p_tab);
|
2015-06-22 11:03:19 +08:00
|
|
|
|
|
|
|
Dictionary _get_main_scene_state();
|
2016-06-29 05:53:31 +08:00
|
|
|
void _set_main_scene_state(Dictionary p_state, Node *p_for_scene);
|
2015-06-14 09:12:53 +08:00
|
|
|
|
2015-11-18 15:47:41 +08:00
|
|
|
int _get_current_main_editor();
|
|
|
|
|
2015-06-14 09:12:53 +08:00
|
|
|
void _save_docks();
|
|
|
|
void _load_docks();
|
2015-11-23 02:11:17 +08:00
|
|
|
void _save_docks_to_config(Ref<ConfigFile> p_layout, const String &p_section);
|
|
|
|
void _load_docks_from_config(Ref<ConfigFile> p_layout, const String &p_section);
|
2022-02-13 21:16:12 +08:00
|
|
|
void _update_dock_slots_visibility(bool p_keep_selected_tabs = false);
|
2018-02-07 21:01:45 +08:00
|
|
|
void _dock_tab_changed(int p_tab);
|
2015-11-23 02:11:17 +08:00
|
|
|
|
2017-11-25 07:32:54 +08:00
|
|
|
void _save_open_scenes_to_config(Ref<ConfigFile> p_layout, const String &p_section);
|
|
|
|
void _load_open_scenes_from_config(Ref<ConfigFile> p_layout, const String &p_section);
|
|
|
|
|
2015-11-23 02:11:17 +08:00
|
|
|
void _update_layouts_menu();
|
2017-08-13 00:52:50 +08:00
|
|
|
void _layout_menu_option(int p_id);
|
2014-06-19 13:23:03 +08:00
|
|
|
|
2016-02-28 10:10:44 +08:00
|
|
|
void _update_addon_config();
|
|
|
|
|
2016-09-13 20:46:17 +08:00
|
|
|
void _toggle_distraction_free_mode();
|
2016-08-07 06:00:54 +08:00
|
|
|
|
2017-02-05 07:31:15 +08:00
|
|
|
void _inherit_imported(const String &p_action);
|
|
|
|
void _open_imported();
|
2016-09-13 20:46:17 +08:00
|
|
|
|
2017-05-29 08:46:48 +08:00
|
|
|
void _save_default_environment();
|
2018-12-11 23:52:25 +08:00
|
|
|
void _update_update_spinner();
|
|
|
|
|
2020-02-18 05:06:54 +08:00
|
|
|
void _resources_changed(const Vector<String> &p_resources);
|
2019-08-29 01:42:27 +08:00
|
|
|
void _scan_external_changes();
|
|
|
|
void _reload_modified_scenes();
|
2021-01-17 08:09:17 +08:00
|
|
|
void _reload_project_settings();
|
2019-08-29 01:42:27 +08:00
|
|
|
void _resave_scenes(String p_str);
|
2018-11-21 08:47:48 +08:00
|
|
|
|
2019-04-09 06:18:03 +08:00
|
|
|
void _feature_profile_changed();
|
|
|
|
bool _is_class_editor_disabled_by_feature_profile(const StringName &p_class);
|
2019-10-24 02:11:04 +08:00
|
|
|
Ref<ImageTexture> _load_custom_class_icon(const String &p_path) const;
|
2019-04-09 06:18:03 +08:00
|
|
|
|
2021-07-06 22:10:07 +08:00
|
|
|
void _pick_main_scene_custom_action(const String &p_custom_action_name);
|
|
|
|
|
2021-08-21 02:32:56 +08:00
|
|
|
void _immediate_dialog_confirmed();
|
2020-08-05 11:14:39 +08:00
|
|
|
void _select_default_main_screen_plugin();
|
|
|
|
|
2022-03-31 02:12:26 +08:00
|
|
|
void _bottom_panel_switch(bool p_enable, int p_idx);
|
|
|
|
void _bottom_panel_raise_toggled(bool);
|
|
|
|
|
2022-08-19 20:21:43 +08:00
|
|
|
void _begin_first_scan();
|
|
|
|
bool use_startup_benchmark = false;
|
|
|
|
String startup_benchmark_file;
|
|
|
|
|
2014-02-10 09:10:30 +08:00
|
|
|
protected:
|
2022-03-31 02:12:26 +08:00
|
|
|
friend class FileSystemDock;
|
2019-03-29 21:53:11 +08:00
|
|
|
|
2015-11-23 02:11:17 +08:00
|
|
|
static void _bind_methods();
|
2014-02-10 09:10:30 +08:00
|
|
|
|
2022-03-31 02:12:26 +08:00
|
|
|
void _notification(int p_what);
|
2019-06-04 11:36:23 +08:00
|
|
|
|
|
|
|
int get_current_tab();
|
|
|
|
void set_current_tab(int p_tab);
|
|
|
|
|
2017-03-05 23:44:50 +08:00
|
|
|
public:
|
2020-12-06 23:09:18 +08:00
|
|
|
// Public for use with callable_mp.
|
|
|
|
void _on_plugin_ready(Object *p_script, const String &p_activate_name);
|
|
|
|
|
|
|
|
void editor_select(int p_which);
|
|
|
|
void set_visible_editor(EditorTable p_table) { editor_select(p_table); }
|
2018-02-14 23:23:04 +08:00
|
|
|
|
2022-03-31 02:12:26 +08:00
|
|
|
bool call_build();
|
2016-08-07 06:00:54 +08:00
|
|
|
|
2022-03-31 02:12:26 +08:00
|
|
|
static void register_editor_types();
|
|
|
|
static void unregister_editor_types();
|
2015-11-25 07:46:44 +08:00
|
|
|
|
2014-05-05 09:50:23 +08:00
|
|
|
static EditorNode *get_singleton() { return singleton; }
|
2014-02-10 09:10:30 +08:00
|
|
|
|
2022-03-31 02:12:26 +08:00
|
|
|
static EditorLog *get_log() { return singleton->log; }
|
|
|
|
static EditorData &get_editor_data() { return singleton->editor_data; }
|
|
|
|
static EditorFolding &get_editor_folding() { return singleton->editor_folding; }
|
2022-03-26 01:06:46 +08:00
|
|
|
static Ref<EditorUndoRedoManager> &get_undo_redo();
|
2014-02-10 09:10:30 +08:00
|
|
|
|
2022-03-31 02:12:26 +08:00
|
|
|
static HBoxContainer *get_menu_hb() { return singleton->menu_hb; }
|
|
|
|
static VSplitContainer *get_top_split() { return singleton->top_split; }
|
|
|
|
|
2022-09-09 08:29:59 +08:00
|
|
|
static String adjust_scene_name_casing(const String &root_name);
|
|
|
|
|
2022-03-31 02:12:26 +08:00
|
|
|
static bool has_unsaved_changes() { return singleton->unsaved_cache; }
|
|
|
|
static void disambiguate_filenames(const Vector<String> p_full_paths, Vector<String> &r_filenames);
|
|
|
|
static void add_io_error(const String &p_error);
|
|
|
|
|
|
|
|
static void progress_add_task(const String &p_task, const String &p_label, int p_steps, bool p_can_cancel = false);
|
|
|
|
static bool progress_task_step(const String &p_task, const String &p_state, int p_step = -1, bool p_force_refresh = true);
|
|
|
|
static void progress_end_task(const String &p_task);
|
|
|
|
|
|
|
|
static void progress_add_task_bg(const String &p_task, const String &p_label, int p_steps);
|
|
|
|
static void progress_task_step_bg(const String &p_task, int p_step = -1);
|
|
|
|
static void progress_end_task_bg(const String &p_task);
|
2018-02-14 12:31:38 +08:00
|
|
|
|
2018-06-11 08:59:53 +08:00
|
|
|
static void add_editor_plugin(EditorPlugin *p_editor, bool p_config_changed = false);
|
|
|
|
static void remove_editor_plugin(EditorPlugin *p_editor, bool p_config_changed = false);
|
2014-03-11 13:38:30 +08:00
|
|
|
|
2022-03-31 02:12:26 +08:00
|
|
|
static void add_plugin_init_callback(EditorPluginInitializeCallback p_callback);
|
|
|
|
static void add_init_callback(EditorNodeInitCallback p_callback) { _init_callbacks.push_back(p_callback); }
|
|
|
|
static void add_build_callback(EditorBuildCallback p_callback);
|
|
|
|
|
|
|
|
static bool immediate_confirmation_dialog(const String &p_text, const String &p_ok_text = TTR("Ok"), const String &p_cancel_text = TTR("Cancel"));
|
|
|
|
|
|
|
|
EditorPlugin *get_editor_plugin_screen() { return editor_plugin_screen; }
|
|
|
|
EditorPluginList *get_editor_plugins_force_input_forwarding() { return editor_plugins_force_input_forwarding; }
|
|
|
|
EditorPluginList *get_editor_plugins_force_over() { return editor_plugins_force_over; }
|
|
|
|
EditorPluginList *get_editor_plugins_over() { return editor_plugins_over; }
|
|
|
|
EditorSelection *get_editor_selection() { return editor_selection; }
|
|
|
|
EditorSelectionHistory *get_editor_selection_history() { return &editor_history; }
|
|
|
|
|
|
|
|
ProjectSettingsEditor *get_project_settings() { return project_settings_editor; }
|
2020-05-27 12:49:05 +08:00
|
|
|
|
2016-05-16 23:23:40 +08:00
|
|
|
void new_inherited_scene() { _menu_option_confirm(FILE_NEW_INHERITED_SCENE, false); }
|
2016-05-11 22:46:08 +08:00
|
|
|
|
2016-05-31 02:29:43 +08:00
|
|
|
void set_docks_visible(bool p_show);
|
|
|
|
bool get_docks_visible() const;
|
|
|
|
|
|
|
|
void set_distraction_free_mode(bool p_enter);
|
2020-06-01 01:58:15 +08:00
|
|
|
bool is_distraction_free_mode_enabled() const;
|
2016-05-11 22:46:08 +08:00
|
|
|
|
2016-02-28 10:10:44 +08:00
|
|
|
void add_control_to_dock(DockSlot p_slot, Control *p_control);
|
|
|
|
void remove_control_from_dock(Control *p_control);
|
|
|
|
|
2018-06-11 08:59:53 +08:00
|
|
|
void set_addon_plugin_enabled(const String &p_addon, bool p_enabled, bool p_config_changed = false);
|
2016-02-28 10:10:44 +08:00
|
|
|
bool is_addon_plugin_enabled(const String &p_addon) const;
|
2014-02-10 09:10:30 +08:00
|
|
|
|
2022-06-26 08:23:59 +08:00
|
|
|
void set_movie_maker_enabled(bool p_enabled);
|
|
|
|
bool is_movie_maker_enabled() const;
|
|
|
|
|
2014-02-10 09:10:30 +08:00
|
|
|
void edit_node(Node *p_node);
|
2021-11-18 04:08:55 +08:00
|
|
|
void edit_resource(const Ref<Resource> &p_resource) { InspectorDock::get_singleton()->edit_resource(p_resource); };
|
2015-09-01 11:49:47 +08:00
|
|
|
|
|
|
|
void save_resource_in_path(const Ref<Resource> &p_resource, const String &p_path);
|
2014-02-10 09:10:30 +08:00
|
|
|
void save_resource(const Ref<Resource> &p_resource);
|
2016-05-11 22:46:08 +08:00
|
|
|
void save_resource_as(const Ref<Resource> &p_resource, const String &p_at_path = String());
|
2014-02-10 09:10:30 +08:00
|
|
|
|
2017-08-11 23:04:32 +08:00
|
|
|
void show_about() { _menu_option_confirm(HELP_ABOUT, false); }
|
|
|
|
|
2018-06-19 09:10:48 +08:00
|
|
|
void push_item(Object *p_object, const String &p_property = "", bool p_inspector_only = false);
|
|
|
|
void edit_item(Object *p_object);
|
2022-05-03 07:43:50 +08:00
|
|
|
void edit_item_resource(Ref<Resource> p_resource);
|
2018-06-19 09:10:48 +08:00
|
|
|
bool item_has_editor(Object *p_object);
|
2019-03-05 03:44:39 +08:00
|
|
|
void hide_top_editors();
|
2014-02-10 09:10:30 +08:00
|
|
|
|
2019-08-06 01:57:23 +08:00
|
|
|
void select_editor_by_name(const String &p_name);
|
|
|
|
|
2014-02-10 09:10:30 +08:00
|
|
|
void open_request(const String &p_path);
|
2022-05-03 07:43:50 +08:00
|
|
|
void edit_foreign_resource(Ref<Resource> p_resource);
|
2014-02-10 09:10:30 +08:00
|
|
|
|
2022-09-07 17:14:06 +08:00
|
|
|
bool is_resource_read_only(Ref<Resource> p_resource, bool p_foreign_resources_are_writable = false);
|
2022-04-29 14:06:48 +08:00
|
|
|
|
2015-06-22 11:03:19 +08:00
|
|
|
bool is_changing_scene() const;
|
2014-02-10 09:10:30 +08:00
|
|
|
|
2022-09-07 07:30:54 +08:00
|
|
|
VBoxContainer *get_main_screen_control();
|
2022-03-31 02:12:26 +08:00
|
|
|
SubViewport *get_scene_root() { return scene_root; } // Root of the scene being edited.
|
2014-02-10 09:10:30 +08:00
|
|
|
|
2015-06-22 11:03:19 +08:00
|
|
|
void set_edited_scene(Node *p_scene);
|
|
|
|
Node *get_edited_scene() { return editor_data.get_edited_scene_root(); }
|
2014-02-10 09:10:30 +08:00
|
|
|
|
2015-08-24 07:15:56 +08:00
|
|
|
void fix_dependencies(const String &p_for_file);
|
2019-08-16 01:47:21 +08:00
|
|
|
int new_scene();
|
2019-08-29 01:42:27 +08:00
|
|
|
Error load_scene(const String &p_scene, bool p_ignore_broken_deps = false, bool p_set_inherited = false, bool p_clear_errors = true, bool p_force_open_imported = false, bool p_silent_change_tab = false);
|
2018-11-02 11:44:40 +08:00
|
|
|
Error load_resource(const String &p_resource, bool p_ignore_broken_deps = false);
|
2014-02-10 09:10:30 +08:00
|
|
|
|
2015-08-24 07:15:56 +08:00
|
|
|
bool is_scene_open(const String &p_path);
|
|
|
|
|
2015-06-22 11:03:19 +08:00
|
|
|
void set_current_scene(int p_idx);
|
|
|
|
|
2022-07-01 11:43:46 +08:00
|
|
|
void setup_color_picker(ColorPicker *picker);
|
|
|
|
|
2016-05-12 07:57:52 +08:00
|
|
|
void request_instance_scene(const String &p_path);
|
2021-06-18 06:03:09 +08:00
|
|
|
void request_instantiate_scenes(const Vector<String> &p_files);
|
2014-02-10 09:10:30 +08:00
|
|
|
|
|
|
|
void set_convert_old_scene(bool p_old) { convert_old = p_old; }
|
|
|
|
|
2020-02-07 09:52:05 +08:00
|
|
|
void notify_all_debug_sessions_exited();
|
2014-02-10 09:10:30 +08:00
|
|
|
|
2020-02-07 09:52:05 +08:00
|
|
|
OS::ProcessID has_child_process(OS::ProcessID p_pid) const { return editor_run.has_child_process(p_pid); }
|
|
|
|
void stop_child_process(OS::ProcessID p_pid);
|
2014-02-10 09:10:30 +08:00
|
|
|
|
2015-01-04 03:52:37 +08:00
|
|
|
Ref<Theme> get_editor_theme() const { return theme; }
|
2019-07-20 03:21:30 +08:00
|
|
|
Ref<Script> get_object_custom_type_base(const Object *p_object) const;
|
|
|
|
StringName get_object_custom_type_name(const Object *p_object) const;
|
2022-05-05 20:27:29 +08:00
|
|
|
Ref<Texture2D> get_object_icon(const Object *p_object, const String &p_fallback = "Object");
|
2019-06-12 02:43:37 +08:00
|
|
|
Ref<Texture2D> get_class_icon(const String &p_class, const String &p_fallback = "Object") const;
|
2015-01-04 03:52:37 +08:00
|
|
|
|
2022-10-08 06:16:54 +08:00
|
|
|
bool is_object_of_custom_type(const Object *p_object, const StringName &p_class);
|
|
|
|
|
2018-05-27 10:41:19 +08:00
|
|
|
void show_accept(const String &p_text, const String &p_title);
|
2021-09-11 09:35:13 +08:00
|
|
|
void show_save_accept(const String &p_text, const String &p_title);
|
2019-12-21 14:57:15 +08:00
|
|
|
void show_warning(const String &p_text, const String &p_title = TTR("Warning!"));
|
2015-01-04 03:52:37 +08:00
|
|
|
|
2019-07-10 02:11:31 +08:00
|
|
|
void _copy_warning(const String &p_str);
|
|
|
|
|
2022-08-19 20:21:43 +08:00
|
|
|
void set_use_startup_benchmark(bool p_use_startup_benchmark, const String &p_startup_benchmark_file);
|
2020-01-08 21:22:50 +08:00
|
|
|
Error export_preset(const String &p_preset, const String &p_path, bool p_debug, bool p_pack_only);
|
2014-02-10 09:10:30 +08:00
|
|
|
|
|
|
|
Control *get_gui_base() { return gui_base; }
|
2016-06-17 12:13:23 +08:00
|
|
|
Control *get_theme_base() { return gui_base->get_parent_control(); }
|
2014-02-10 09:10:30 +08:00
|
|
|
|
2017-08-26 21:32:15 +08:00
|
|
|
void save_scene_to_path(String p_file, bool p_with_preview = true) {
|
2020-05-14 22:41:43 +08:00
|
|
|
if (p_with_preview) {
|
2017-08-26 21:32:15 +08:00
|
|
|
_save_scene_with_preview(p_file);
|
2020-05-14 22:41:43 +08:00
|
|
|
} else {
|
2017-08-26 21:32:15 +08:00
|
|
|
_save_scene(p_file);
|
2020-05-14 22:41:43 +08:00
|
|
|
}
|
2017-08-26 21:32:15 +08:00
|
|
|
}
|
2014-06-19 13:23:03 +08:00
|
|
|
|
|
|
|
bool is_scene_in_use(const String &p_path);
|
|
|
|
|
2015-06-22 11:03:19 +08:00
|
|
|
void save_layout();
|
|
|
|
|
2017-03-21 10:31:41 +08:00
|
|
|
void open_export_template_manager();
|
|
|
|
|
2016-06-29 05:53:31 +08:00
|
|
|
void reload_scene(const String &p_path);
|
|
|
|
|
2016-06-08 09:08:12 +08:00
|
|
|
bool is_exiting() const { return exiting; }
|
|
|
|
|
2020-06-20 02:49:04 +08:00
|
|
|
Button *get_pause_button() { return pause_button; }
|
2016-05-22 08:18:16 +08:00
|
|
|
|
2020-06-20 02:49:04 +08:00
|
|
|
Button *add_bottom_panel_item(String p_text, Control *p_item);
|
2016-01-18 07:03:57 +08:00
|
|
|
void make_bottom_panel_item_visible(Control *p_item);
|
|
|
|
void raise_bottom_panel_item(Control *p_item);
|
|
|
|
void hide_bottom_panel();
|
2016-02-29 03:58:17 +08:00
|
|
|
void remove_bottom_panel_item(Control *p_item);
|
2016-01-18 07:03:57 +08:00
|
|
|
|
2016-05-11 22:46:08 +08:00
|
|
|
Variant drag_resource(const Ref<Resource> &p_res, Control *p_from);
|
2017-10-25 06:09:04 +08:00
|
|
|
Variant drag_files_and_dirs(const Vector<String> &p_paths, Control *p_from);
|
2016-05-11 22:46:08 +08:00
|
|
|
|
2020-12-16 07:04:21 +08:00
|
|
|
void add_tool_menu_item(const String &p_name, const Callable &p_callback);
|
2016-08-07 22:01:22 +08:00
|
|
|
void add_tool_submenu_item(const String &p_name, PopupMenu *p_submenu);
|
|
|
|
void remove_tool_menu_item(const String &p_name);
|
2016-05-11 22:46:08 +08:00
|
|
|
|
2022-04-06 20:41:04 +08:00
|
|
|
PopupMenu *get_export_as_menu();
|
|
|
|
|
2019-01-26 04:23:56 +08:00
|
|
|
void save_all_scenes();
|
2019-06-04 11:36:23 +08:00
|
|
|
void save_scene_list(Vector<String> p_scene_filenames);
|
2019-01-26 04:23:56 +08:00
|
|
|
void restart_editor();
|
2018-07-20 05:58:15 +08:00
|
|
|
|
2021-02-13 22:06:56 +08:00
|
|
|
void notify_settings_changed();
|
|
|
|
|
2021-05-29 07:58:03 +08:00
|
|
|
void dim_editor(bool p_dimming);
|
2019-11-01 03:58:53 +08:00
|
|
|
bool is_editor_dimmed() const;
|
2017-03-07 03:11:56 +08:00
|
|
|
|
2018-05-17 14:01:47 +08:00
|
|
|
void edit_current() { _edit_current(); };
|
|
|
|
|
2018-09-21 11:14:04 +08:00
|
|
|
bool has_scenes_in_session();
|
2018-05-17 14:01:47 +08:00
|
|
|
|
2019-04-08 02:46:52 +08:00
|
|
|
int execute_and_show_output(const String &p_title, const String &p_path, const List<String> &p_arguments, bool p_close_on_ok = true, bool p_close_on_errors = false);
|
|
|
|
|
2016-03-09 07:00:52 +08:00
|
|
|
EditorNode();
|
2014-02-10 09:10:30 +08:00
|
|
|
~EditorNode();
|
|
|
|
|
2017-09-22 20:20:28 +08:00
|
|
|
void add_resource_conversion_plugin(const Ref<EditorResourceConversionPlugin> &p_plugin);
|
|
|
|
void remove_resource_conversion_plugin(const Ref<EditorResourceConversionPlugin> &p_plugin);
|
2020-03-17 14:33:00 +08:00
|
|
|
Vector<Ref<EditorResourceConversionPlugin>> find_resource_conversion_plugin(const Ref<Resource> &p_for_resource);
|
2017-09-22 20:20:28 +08:00
|
|
|
|
2019-03-22 09:08:28 +08:00
|
|
|
bool ensure_main_scene(bool p_from_native);
|
2019-07-18 10:08:24 +08:00
|
|
|
|
2021-07-20 19:24:56 +08:00
|
|
|
Error run_play_native(int p_idx, int p_platform);
|
2019-07-18 10:08:24 +08:00
|
|
|
void run_play();
|
2020-04-05 22:19:24 +08:00
|
|
|
void run_play_current();
|
|
|
|
void run_play_custom(const String &p_custom);
|
2019-07-18 10:08:24 +08:00
|
|
|
void run_stop();
|
2020-04-05 22:19:24 +08:00
|
|
|
bool is_run_playing() const;
|
|
|
|
String get_run_playing_scene() const;
|
2014-02-10 09:10:30 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
struct EditorProgress {
|
|
|
|
String task;
|
2017-12-14 19:59:46 +08:00
|
|
|
bool step(const String &p_state, int p_step = -1, bool p_force_refresh = true) { return EditorNode::progress_task_step(task, p_state, p_step, p_force_refresh); }
|
|
|
|
EditorProgress(const String &p_task, const String &p_label, int p_amount, bool p_can_cancel = false) {
|
|
|
|
EditorNode::progress_add_task(p_task, p_label, p_amount, p_can_cancel);
|
2014-02-10 09:10:30 +08:00
|
|
|
task = p_task;
|
|
|
|
}
|
|
|
|
~EditorProgress() { EditorNode::progress_end_task(task); }
|
|
|
|
};
|
|
|
|
|
2016-03-30 07:02:53 +08:00
|
|
|
class EditorPluginList : public Object {
|
|
|
|
private:
|
|
|
|
Vector<EditorPlugin *> plugins_list;
|
|
|
|
|
|
|
|
public:
|
|
|
|
void set_plugins_list(Vector<EditorPlugin *> p_plugins_list) {
|
|
|
|
plugins_list = p_plugins_list;
|
|
|
|
}
|
|
|
|
|
2016-07-04 21:43:07 +08:00
|
|
|
Vector<EditorPlugin *> &get_plugins_list() {
|
2016-03-30 07:02:53 +08:00
|
|
|
return plugins_list;
|
|
|
|
}
|
|
|
|
|
|
|
|
void make_visible(bool p_visible);
|
|
|
|
void edit(Object *p_object);
|
2017-10-16 04:33:25 +08:00
|
|
|
bool forward_gui_input(const Ref<InputEvent> &p_event);
|
2018-09-19 02:00:07 +08:00
|
|
|
void forward_canvas_draw_over_viewport(Control *p_overlay);
|
|
|
|
void forward_canvas_force_draw_over_viewport(Control *p_overlay);
|
2022-09-09 00:38:33 +08:00
|
|
|
EditorPlugin::AfterGUIInput forward_3d_gui_input(Camera3D *p_camera, const Ref<InputEvent> &p_event, bool serve_when_force_input_enabled);
|
|
|
|
void forward_3d_draw_over_viewport(Control *p_overlay);
|
|
|
|
void forward_3d_force_draw_over_viewport(Control *p_overlay);
|
2017-06-09 01:57:35 +08:00
|
|
|
void add_plugin(EditorPlugin *p_plugin);
|
2019-02-25 23:49:06 +08:00
|
|
|
void remove_plugin(EditorPlugin *p_plugin);
|
2016-03-30 07:02:53 +08:00
|
|
|
void clear();
|
2020-12-15 20:04:21 +08:00
|
|
|
bool is_empty();
|
2016-03-30 07:02:53 +08:00
|
|
|
|
|
|
|
EditorPluginList();
|
|
|
|
~EditorPluginList();
|
2016-05-21 21:29:25 +08:00
|
|
|
};
|
2016-03-30 07:02:53 +08:00
|
|
|
|
2014-02-10 09:10:30 +08:00
|
|
|
struct EditorProgressBG {
|
|
|
|
String task;
|
|
|
|
void step(int p_step = -1) { EditorNode::progress_task_step_bg(task, p_step); }
|
|
|
|
EditorProgressBG(const String &p_task, const String &p_label, int p_amount) {
|
|
|
|
EditorNode::progress_add_task_bg(p_task, p_label, p_amount);
|
|
|
|
task = p_task;
|
|
|
|
}
|
|
|
|
~EditorProgressBG() { EditorNode::progress_end_task_bg(task); }
|
|
|
|
};
|
|
|
|
|
2017-08-26 23:46:49 +08:00
|
|
|
#endif // EDITOR_NODE_H
|