Fix some invalid plugin edit calls
This commit is contained in:
parent
37d1dfef9d
commit
366c9678ca
@ -925,6 +925,7 @@ Dictionary EditorData::restore_edited_scene_state(EditorSelection *p_selection,
|
|||||||
for (Node *E : es.selection) {
|
for (Node *E : es.selection) {
|
||||||
p_selection->add_node(E);
|
p_selection->add_node(E);
|
||||||
}
|
}
|
||||||
|
p_selection->cancel_update(); // Selection update results in redundant Node edit, so we cancel it.
|
||||||
set_editor_plugin_states(es.editor_states);
|
set_editor_plugin_states(es.editor_states);
|
||||||
|
|
||||||
return es.custom_state;
|
return es.custom_state;
|
||||||
@ -1326,6 +1327,10 @@ void EditorSelection::clear() {
|
|||||||
node_list_changed = true;
|
node_list_changed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void EditorSelection::cancel_update() {
|
||||||
|
changed = false;
|
||||||
|
}
|
||||||
|
|
||||||
EditorSelection::EditorSelection() {
|
EditorSelection::EditorSelection() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -312,6 +312,7 @@ public:
|
|||||||
|
|
||||||
void update();
|
void update();
|
||||||
void clear();
|
void clear();
|
||||||
|
void cancel_update();
|
||||||
|
|
||||||
// Returns all the selected nodes.
|
// Returns all the selected nodes.
|
||||||
TypedArray<Node> get_selected_nodes();
|
TypedArray<Node> get_selected_nodes();
|
||||||
|
@ -46,12 +46,6 @@
|
|||||||
#include "scene/gui/separator.h"
|
#include "scene/gui/separator.h"
|
||||||
#include "scene/main/window.h"
|
#include "scene/main/window.h"
|
||||||
|
|
||||||
void GridMapEditor::_node_removed(Node *p_node) {
|
|
||||||
if (p_node == node) {
|
|
||||||
node = nullptr;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void GridMapEditor::_configure() {
|
void GridMapEditor::_configure() {
|
||||||
if (!node) {
|
if (!node) {
|
||||||
return;
|
return;
|
||||||
@ -1030,7 +1024,6 @@ void GridMapEditor::_update_theme() {
|
|||||||
void GridMapEditor::_notification(int p_what) {
|
void GridMapEditor::_notification(int p_what) {
|
||||||
switch (p_what) {
|
switch (p_what) {
|
||||||
case NOTIFICATION_ENTER_TREE: {
|
case NOTIFICATION_ENTER_TREE: {
|
||||||
get_tree()->connect("node_removed", callable_mp(this, &GridMapEditor::_node_removed));
|
|
||||||
mesh_library_palette->connect("item_selected", callable_mp(this, &GridMapEditor::_item_selected_cbk));
|
mesh_library_palette->connect("item_selected", callable_mp(this, &GridMapEditor::_item_selected_cbk));
|
||||||
for (int i = 0; i < 3; i++) {
|
for (int i = 0; i < 3; i++) {
|
||||||
grid[i] = RS::get_singleton()->mesh_create();
|
grid[i] = RS::get_singleton()->mesh_create();
|
||||||
@ -1051,7 +1044,6 @@ void GridMapEditor::_notification(int p_what) {
|
|||||||
} break;
|
} break;
|
||||||
|
|
||||||
case NOTIFICATION_EXIT_TREE: {
|
case NOTIFICATION_EXIT_TREE: {
|
||||||
get_tree()->disconnect("node_removed", callable_mp(this, &GridMapEditor::_node_removed));
|
|
||||||
_clear_clipboard_data();
|
_clear_clipboard_data();
|
||||||
|
|
||||||
for (int i = 0; i < 3; i++) {
|
for (int i = 0; i < 3; i++) {
|
||||||
@ -1471,7 +1463,6 @@ void GridMapEditorPlugin::make_visible(bool p_visible) {
|
|||||||
} else {
|
} else {
|
||||||
grid_map_editor->spatial_editor_hb->hide();
|
grid_map_editor->spatial_editor_hb->hide();
|
||||||
grid_map_editor->hide();
|
grid_map_editor->hide();
|
||||||
grid_map_editor->edit(nullptr);
|
|
||||||
grid_map_editor->set_process(false);
|
grid_map_editor->set_process(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -222,7 +222,6 @@ class GridMapEditor : public VBoxContainer {
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
void _notification(int p_what);
|
void _notification(int p_what);
|
||||||
void _node_removed(Node *p_node);
|
|
||||||
static void _bind_methods();
|
static void _bind_methods();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
Loading…
Reference in New Issue
Block a user