summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorSilc Renew <tokage.it.lab@gmail.com>2022-08-16 03:04:17 +0900
committerSilc 'Tokage' Renew <61938263+TokageItLab@users.noreply.github.com>2022-09-08 20:02:48 +0900
commit3c7a5fd8ac78cf4f9cab1eba17c5cfce114300cd (patch)
treee7d97a6397405d71d4c347c23e18e7cd9b85b2e8 /editor
parentc6fd311da0d0052bb11237662ec528f9fab1b7dd (diff)
bind AfterGUIInput
Diffstat (limited to 'editor')
-rw-r--r--editor/editor_node.cpp4
-rw-r--r--editor/editor_plugin.cpp4
-rw-r--r--editor/editor_plugin.h3
-rw-r--r--editor/plugins/node_3d_editor_plugin.cpp12
-rw-r--r--editor/plugins/skeleton_3d_editor_plugin.cpp2
5 files changed, 15 insertions, 10 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index c2820389c6..c11a9d197d 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -7598,8 +7598,8 @@ EditorPlugin::AfterGUIInput EditorPluginList::forward_spatial_gui_input(Camera3D
if (current_after == EditorPlugin::AFTER_GUI_INPUT_STOP) {
after = EditorPlugin::AFTER_GUI_INPUT_STOP;
}
- if (after != EditorPlugin::AFTER_GUI_INPUT_STOP && current_after == EditorPlugin::AFTER_GUI_INPUT_DESELECT) {
- after = EditorPlugin::AFTER_GUI_INPUT_DESELECT;
+ if (after != EditorPlugin::AFTER_GUI_INPUT_STOP && current_after == EditorPlugin::AFTER_GUI_INPUT_CUSTOM) {
+ after = EditorPlugin::AFTER_GUI_INPUT_CUSTOM;
}
}
diff --git a/editor/editor_plugin.cpp b/editor/editor_plugin.cpp
index 4fc6947636..1ccfcf21fc 100644
--- a/editor/editor_plugin.cpp
+++ b/editor/editor_plugin.cpp
@@ -972,6 +972,10 @@ void EditorPlugin::_bind_methods() {
BIND_ENUM_CONSTANT(DOCK_SLOT_RIGHT_UR);
BIND_ENUM_CONSTANT(DOCK_SLOT_RIGHT_BR);
BIND_ENUM_CONSTANT(DOCK_SLOT_MAX);
+
+ BIND_ENUM_CONSTANT(AFTER_GUI_INPUT_PASS);
+ BIND_ENUM_CONSTANT(AFTER_GUI_INPUT_STOP);
+ BIND_ENUM_CONSTANT(AFTER_GUI_INPUT_CUSTOM);
}
Ref<EditorUndoRedoManager> EditorPlugin::get_undo_redo() {
diff --git a/editor/editor_plugin.h b/editor/editor_plugin.h
index 8357f0960a..898694c2d3 100644
--- a/editor/editor_plugin.h
+++ b/editor/editor_plugin.h
@@ -204,7 +204,7 @@ public:
enum AfterGUIInput {
AFTER_GUI_INPUT_PASS,
AFTER_GUI_INPUT_STOP,
- AFTER_GUI_INPUT_DESELECT
+ AFTER_GUI_INPUT_CUSTOM
};
//TODO: send a resource for editing to the editor node?
@@ -312,6 +312,7 @@ public:
VARIANT_ENUM_CAST(EditorPlugin::CustomControlContainer);
VARIANT_ENUM_CAST(EditorPlugin::DockSlot);
+VARIANT_ENUM_CAST(EditorPlugin::AfterGUIInput);
typedef EditorPlugin *(*EditorPluginCreateFunc)();
diff --git a/editor/plugins/node_3d_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp
index 0bb044e679..524a7bd9bd 100644
--- a/editor/plugins/node_3d_editor_plugin.cpp
+++ b/editor/plugins/node_3d_editor_plugin.cpp
@@ -1360,8 +1360,8 @@ void Node3DEditorViewport::_sinput(const Ref<InputEvent> &p_event) {
if (discard == EditorPlugin::AFTER_GUI_INPUT_STOP) {
return;
}
- if (discard == EditorPlugin::AFTER_GUI_INPUT_DESELECT) {
- after = EditorPlugin::AFTER_GUI_INPUT_DESELECT;
+ if (discard == EditorPlugin::AFTER_GUI_INPUT_CUSTOM) {
+ after = EditorPlugin::AFTER_GUI_INPUT_CUSTOM;
}
}
}
@@ -1373,8 +1373,8 @@ void Node3DEditorViewport::_sinput(const Ref<InputEvent> &p_event) {
if (discard == EditorPlugin::AFTER_GUI_INPUT_STOP) {
return;
}
- if (discard == EditorPlugin::AFTER_GUI_INPUT_DESELECT) {
- after = EditorPlugin::AFTER_GUI_INPUT_DESELECT;
+ if (discard == EditorPlugin::AFTER_GUI_INPUT_CUSTOM) {
+ after = EditorPlugin::AFTER_GUI_INPUT_CUSTOM;
}
}
}
@@ -1601,7 +1601,7 @@ void Node3DEditorViewport::_sinput(const Ref<InputEvent> &p_event) {
break;
}
- if (after != EditorPlugin::AFTER_GUI_INPUT_DESELECT) {
+ if (after != EditorPlugin::AFTER_GUI_INPUT_CUSTOM) {
//clicking is always deferred to either move or release
clicked = _select_ray(b->get_position());
selection_in_progress = true;
@@ -1622,7 +1622,7 @@ void Node3DEditorViewport::_sinput(const Ref<InputEvent> &p_event) {
break;
}
- if (after != EditorPlugin::AFTER_GUI_INPUT_DESELECT) {
+ if (after != EditorPlugin::AFTER_GUI_INPUT_CUSTOM) {
selection_in_progress = false;
if (clicked.is_valid()) {
diff --git a/editor/plugins/skeleton_3d_editor_plugin.cpp b/editor/plugins/skeleton_3d_editor_plugin.cpp
index b85e44e106..62198cd742 100644
--- a/editor/plugins/skeleton_3d_editor_plugin.cpp
+++ b/editor/plugins/skeleton_3d_editor_plugin.cpp
@@ -1139,7 +1139,7 @@ EditorPlugin::AfterGUIInput Skeleton3DEditorPlugin::forward_spatial_gui_input(Ca
se->update_bone_original();
}
}
- return EditorPlugin::AFTER_GUI_INPUT_DESELECT;
+ return EditorPlugin::AFTER_GUI_INPUT_CUSTOM;
}
return EditorPlugin::AFTER_GUI_INPUT_PASS;
}