mirror of
https://github.com/Relintai/pandemonium_engine.git
synced 2025-01-03 01:19:38 +01:00
Restore EditorCodeEditor's _gui_input method.
This commit is contained in:
parent
edec78785d
commit
041de5607e
@ -69,6 +69,36 @@
|
|||||||
|
|
||||||
#include "editor_script_editor.h"
|
#include "editor_script_editor.h"
|
||||||
|
|
||||||
|
// This function should be used to handle shortcuts that could otherwise
|
||||||
|
// be handled too late if they weren't handled here.
|
||||||
|
void EditorCodeTextEditor::_shortcut_input(const Ref<InputEvent> &event) {
|
||||||
|
const Ref<InputEventKey> key_event = event;
|
||||||
|
if (!key_event.is_valid() || !key_event->is_pressed()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ED_IS_SHORTCUT("script_text_editor/move_up", key_event)) {
|
||||||
|
move_lines_up();
|
||||||
|
accept_event();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (ED_IS_SHORTCUT("script_text_editor/move_down", key_event)) {
|
||||||
|
move_lines_down();
|
||||||
|
accept_event();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (ED_IS_SHORTCUT("script_text_editor/delete_line", key_event)) {
|
||||||
|
delete_lines();
|
||||||
|
accept_event();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (ED_IS_SHORTCUT("script_text_editor/duplicate_selection", key_event)) {
|
||||||
|
duplicate_selection();
|
||||||
|
accept_event();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void EditorCodeTextEditor::_text_editor_gui_input(const Ref<InputEvent> &p_event) {
|
void EditorCodeTextEditor::_text_editor_gui_input(const Ref<InputEvent> &p_event) {
|
||||||
Ref<InputEventMouseButton> mb = p_event;
|
Ref<InputEventMouseButton> mb = p_event;
|
||||||
|
|
||||||
@ -1015,6 +1045,7 @@ void EditorCodeTextEditor::remove_all_bookmarks() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void EditorCodeTextEditor::_bind_methods() {
|
void EditorCodeTextEditor::_bind_methods() {
|
||||||
|
ClassDB::bind_method(D_METHOD("_shortcut_input"), &EditorCodeTextEditor::_shortcut_input);
|
||||||
ClassDB::bind_method("_text_editor_gui_input", &EditorCodeTextEditor::_text_editor_gui_input);
|
ClassDB::bind_method("_text_editor_gui_input", &EditorCodeTextEditor::_text_editor_gui_input);
|
||||||
ClassDB::bind_method("_line_col_changed", &EditorCodeTextEditor::_line_col_changed);
|
ClassDB::bind_method("_line_col_changed", &EditorCodeTextEditor::_line_col_changed);
|
||||||
ClassDB::bind_method("_text_changed", &EditorCodeTextEditor::_text_changed);
|
ClassDB::bind_method("_text_changed", &EditorCodeTextEditor::_text_changed);
|
||||||
|
@ -90,6 +90,7 @@ class EditorCodeTextEditor : public VBoxContainer {
|
|||||||
void _font_resize_timeout();
|
void _font_resize_timeout();
|
||||||
bool _add_font_size(int p_delta);
|
bool _add_font_size(int p_delta);
|
||||||
|
|
||||||
|
void _shortcut_input(const Ref<InputEvent> &event);
|
||||||
void _text_editor_gui_input(const Ref<InputEvent> &p_event);
|
void _text_editor_gui_input(const Ref<InputEvent> &p_event);
|
||||||
void _zoom_in();
|
void _zoom_in();
|
||||||
void _zoom_out();
|
void _zoom_out();
|
||||||
|
Loading…
Reference in New Issue
Block a user