You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-14 13:41:12 +00:00
Entirely removes BIND_VMETHOD in favor of GDVIRTUAL
* `_gui_input`, `_input`, `_unhandled_input` and `_unhandled_key_input` are now regular C++ virutal functions. * Everything else converted to GDVIRTUAL * BIND_VMETHOD is gone, always use the new syntax from now on. Creating `_gui_input` method and using the binder to register events will no longer work, simply override the virtual function now.
This commit is contained in:
@@ -31,8 +31,8 @@
|
||||
#include "input_event.h"
|
||||
|
||||
#include "core/input/input_map.h"
|
||||
#include "core/input/shortcut.h"
|
||||
#include "core/os/keyboard.h"
|
||||
#include "scene/gui/shortcut.h"
|
||||
|
||||
const int InputEvent::DEVICE_ID_TOUCH_MOUSE = -1;
|
||||
const int InputEvent::DEVICE_ID_INTERNAL = -2;
|
||||
@@ -1545,6 +1545,13 @@ Ref<Shortcut> InputEventShortcut::get_shortcut() {
|
||||
return shortcut;
|
||||
}
|
||||
|
||||
void InputEventShortcut::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("set_shortcut", "shortcut"), &InputEventShortcut::set_shortcut);
|
||||
ClassDB::bind_method(D_METHOD("get_shortcut"), &InputEventShortcut::get_shortcut);
|
||||
|
||||
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "shortcut", PROPERTY_HINT_RESOURCE_TYPE, "Shortcut"), "set_shortcut", "get_shortcut");
|
||||
}
|
||||
|
||||
bool InputEventShortcut::is_pressed() const {
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user