1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-13 13:31:48 +00:00

Implementation of tool to automatically upgrade and re-save meshes

This commit is contained in:
clayjohn
2023-10-19 13:31:26 +02:00
parent 7f884b4e00
commit 318ef8461f
9 changed files with 193 additions and 8 deletions

View File

@@ -153,6 +153,7 @@
#include "editor/project_settings_editor.h"
#include "editor/register_exporters.h"
#include "editor/scene_tree_dock.h"
#include "editor/surface_upgrade_tool.h"
#include "editor/window_wrapper.h"
#include <stdio.h>
@@ -5507,11 +5508,16 @@ bool EditorNode::ensure_main_scene(bool p_from_native) {
void EditorNode::_immediate_dialog_confirmed() {
immediate_dialog_confirmed = true;
}
bool EditorNode::immediate_confirmation_dialog(const String &p_text, const String &p_ok_text, const String &p_cancel_text) {
bool EditorNode::immediate_confirmation_dialog(const String &p_text, const String &p_ok_text, const String &p_cancel_text, uint32_t p_wrap_width) {
ConfirmationDialog *cd = memnew(ConfirmationDialog);
cd->set_text(p_text);
cd->set_ok_button_text(p_ok_text);
cd->set_cancel_button_text(p_cancel_text);
if (p_wrap_width > 0) {
cd->set_autowrap(true);
cd->get_label()->set_custom_minimum_size(Size2(p_wrap_width, 0) * EDSCALE);
}
cd->connect("confirmed", callable_mp(singleton, &EditorNode::_immediate_dialog_confirmed));
singleton->gui_base->add_child(cd);
@@ -8022,6 +8028,8 @@ EditorNode::EditorNode() {
String exec = OS::get_singleton()->get_executable_path();
// Save editor executable path for third-party tools.
EditorSettings::get_singleton()->set_project_metadata("editor_metadata", "executable_path", exec);
surface_upgrade_tool = memnew(SurfaceUpgradeTool);
}
EditorNode::~EditorNode() {
@@ -8036,6 +8044,7 @@ EditorNode::~EditorNode() {
memdelete(editor_plugins_force_over);
memdelete(editor_plugins_force_input_forwarding);
memdelete(progress_hb);
memdelete(surface_upgrade_tool);
EditorSettings::destroy();