Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose Viewport.gui_cancel_drag() to GDScript as a counterpart to Control.force_drag() #96614

Merged
merged 1 commit into from
Sep 6, 2024

Conversation

graydoubt
Copy link
Contributor

Using Control.force_drag() has no counterpart to abort a drag operation. The expectation is that a left mouse click completes the operation. This small changes exposes the Viewport.gui_cancel_drag() method to GDScript, per @KoBeWi's suggestion in godotengine/godot-proposals/issues/10624.

@graydoubt
Copy link
Contributor Author

@KoBeWi it looks like the Linux mono build experienced a NuGet API timeout, could you give it another kick?

@AThousandShips
Copy link
Member

Your commit seems not to be linked to your GitHub account. See: Why are my commits linked to the wrong user? for more info.

@graydoubt
Copy link
Contributor Author

@AThousandShips My bad. I just linked the email address and amended the commit, since the docs indicate old commits won't get picked up.

@graydoubt
Copy link
Contributor Author

@AThousandShips Based on your comment, I interpreted the CI pipeline failing as somehow related to the unlinked commit, but I see that it's failed again. Were those two things not related?

@akien-mga akien-mga changed the title Expose Viewport.gui_cancel_drag() to GDScript as a counterpart to Control.force_drag() Expose Viewport.gui_cancel_drag() to GDScript as a counterpart to Control.force_drag() Sep 6, 2024
@akien-mga
Copy link
Member

@AThousandShips Based on your comment, I interpreted the CI pipeline failing as somehow related to the unlinked commit, but I see that it's failed again. Were those two things not related?

The CI is failing because the documentation XML needs to be updated to match the API change you made (removing the const qualifier):

diff --git a/doc/classes/Viewport.xml b/doc/classes/Viewport.xml
index 441239d..350fd65 100644
--- a/doc/classes/Viewport.xml
+++ b/doc/classes/Viewport.xml
@@ -117,7 +117,7 @@
 				Returns the visible rectangle in global screen coordinates.
 			</description>
 		</method>
-		<method name="gui_cancel_drag" qualifiers="const">
+		<method name="gui_cancel_drag">
 			<return type="void" />
 			<description>
 				Cancels the drag operation that was previously started through [method Control._get_drag_data] or forced with [method Control.force_drag].

@graydoubt
Copy link
Contributor Author

Thanks, I've addressed the documentation XML. It hadn't gotten that far when I looked at it. It failed with a NuGet API timeout.

@akien-mga akien-mga modified the milestones: 4.x, 4.4 Sep 6, 2024
@akien-mga akien-mga merged commit a6db33e into godotengine:master Sep 6, 2024
20 checks passed
@akien-mga
Copy link
Member

Thanks! And congrats for your first merged Godot contribution 🎉

@graydoubt
Copy link
Contributor Author

Thanks, everyone for the patience, feedback, and help to push this across the finish line!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants