You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-07 12:30:27 +00:00
Refactored input, goes all via windows now.
Also renamed Input to InputFilter because all it does is filter events.
This commit is contained in:
committed by
Juan Linietsky
parent
9e08742de8
commit
8e6960a69e
@@ -31,7 +31,7 @@
|
||||
#include "texture_region_editor_plugin.h"
|
||||
|
||||
#include "core/core_string_names.h"
|
||||
#include "core/input/input.h"
|
||||
#include "core/input/input_filter.h"
|
||||
#include "core/os/keyboard.h"
|
||||
#include "editor/editor_scale.h"
|
||||
#include "scene/gui/check_box.h"
|
||||
@@ -307,7 +307,7 @@ void TextureRegionEditor::_region_input(const Ref<InputEvent> &p_input) {
|
||||
for (List<Rect2>::Element *E = autoslice_cache.front(); E; E = E->next()) {
|
||||
if (E->get().has_point(point)) {
|
||||
rect = E->get();
|
||||
if (Input::get_singleton()->is_key_pressed(KEY_CONTROL) && !(Input::get_singleton()->is_key_pressed(KEY_SHIFT | KEY_ALT))) {
|
||||
if (InputFilter::get_singleton()->is_key_pressed(KEY_CONTROL) && !(InputFilter::get_singleton()->is_key_pressed(KEY_SHIFT | KEY_ALT))) {
|
||||
Rect2 r;
|
||||
if (node_sprite)
|
||||
r = node_sprite->get_region_rect();
|
||||
@@ -449,7 +449,7 @@ void TextureRegionEditor::_region_input(const Ref<InputEvent> &p_input) {
|
||||
|
||||
if (mm.is_valid()) {
|
||||
|
||||
if (mm->get_button_mask() & BUTTON_MASK_MIDDLE || Input::get_singleton()->is_key_pressed(KEY_SPACE)) {
|
||||
if (mm->get_button_mask() & BUTTON_MASK_MIDDLE || InputFilter::get_singleton()->is_key_pressed(KEY_SPACE)) {
|
||||
|
||||
Vector2 dragged(mm->get_relative().x / draw_zoom, mm->get_relative().y / draw_zoom);
|
||||
hscroll->set_value(hscroll->get_value() - dragged.x);
|
||||
@@ -756,7 +756,7 @@ void TextureRegionEditor::_notification(int p_what) {
|
||||
_update_autoslice();
|
||||
}
|
||||
} break;
|
||||
case MainLoop::NOTIFICATION_WM_FOCUS_IN: {
|
||||
case NOTIFICATION_WM_FOCUS_IN: {
|
||||
// This happens when the user leaves the Editor and returns,
|
||||
// they could have changed the textures, so the cache is cleared.
|
||||
cache_map.clear();
|
||||
|
||||
Reference in New Issue
Block a user