1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

Rename consume_drag_and_drop to mouse_target

The functionality of the parameter is not limited to drag-and-drop
operations, but it has also other uses.
So its name should not be tied to drag-and-drop.

The API was created in the not yet released Godot 4.4-dev6, so this
change should not be considered compatibility breaking.
This commit is contained in:
Markus Sauermann
2024-11-25 21:36:29 +01:00
parent 0c45ace151
commit 003647972f
4 changed files with 17 additions and 16 deletions

View File

@@ -246,12 +246,12 @@ bool SubViewportContainer::_is_propagated_in_gui_input(const Ref<InputEvent> &p_
return false;
}
void SubViewportContainer::set_consume_drag_and_drop(bool p_enable) {
consume_drag_and_drop = p_enable;
void SubViewportContainer::set_mouse_target(bool p_enable) {
mouse_target = p_enable;
}
bool SubViewportContainer::is_consume_drag_and_drop_enabled() {
return consume_drag_and_drop;
bool SubViewportContainer::is_mouse_target_enabled() {
return mouse_target;
}
void SubViewportContainer::add_child_notify(Node *p_child) {
@@ -294,12 +294,12 @@ void SubViewportContainer::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_stretch_shrink", "amount"), &SubViewportContainer::set_stretch_shrink);
ClassDB::bind_method(D_METHOD("get_stretch_shrink"), &SubViewportContainer::get_stretch_shrink);
ClassDB::bind_method(D_METHOD("set_consume_drag_and_drop", "amount"), &SubViewportContainer::set_consume_drag_and_drop);
ClassDB::bind_method(D_METHOD("is_consume_drag_and_drop_enabled"), &SubViewportContainer::is_consume_drag_and_drop_enabled);
ClassDB::bind_method(D_METHOD("set_mouse_target", "amount"), &SubViewportContainer::set_mouse_target);
ClassDB::bind_method(D_METHOD("is_mouse_target_enabled"), &SubViewportContainer::is_mouse_target_enabled);
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "stretch"), "set_stretch", "is_stretch_enabled");
ADD_PROPERTY(PropertyInfo(Variant::INT, "stretch_shrink", PROPERTY_HINT_RANGE, "1,32,1,or_greater"), "set_stretch_shrink", "get_stretch_shrink");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "consume_drag_and_drop"), "set_consume_drag_and_drop", "is_consume_drag_and_drop_enabled");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "mouse_target"), "set_mouse_target", "is_mouse_target_enabled");
GDVIRTUAL_BIND(_propagate_input_event, "event");
}