X Tutup
Skip to content

Make InputEvent subclasses' to_string() respect overrides from scripts and GDExtension#110993

Closed
chocola-mint wants to merge 1 commit intogodotengine:masterfrom
chocola-mint:fix-#110338
Closed

Make InputEvent subclasses' to_string() respect overrides from scripts and GDExtension#110993
chocola-mint wants to merge 1 commit intogodotengine:masterfrom
chocola-mint:fix-#110338

Conversation

@chocola-mint
Copy link
Contributor

@chocola-mint chocola-mint commented Sep 28, 2025

Fixes #110338

I've also taken this opportunity to add a new method Object::_try_get_override_to_string() so the same implementation can be used by Node::to_string(), Object::to_string().

For consistency within the same file, other InputAction subclasses also have the issue mentioned above fixed.

@chocola-mint chocola-mint requested review from a team as code owners September 28, 2025 06:41
@chocola-mint chocola-mint changed the title Make InputEventAction.to_string() respect overrides from scripts and GDExtension Make InputEvent subclasses' to_string() respect overrides from scripts and GDExtension Sep 28, 2025
@AThousandShips AThousandShips added this to the 4.x milestone Sep 29, 2025
@chocola-mint
Copy link
Contributor Author

Sorry, but I just realized that this is basically a duplicate of #94047

That PR has a slightly bigger scope (overridding to_string() for Resource) but otherwise is solving the same problem, albeit with a different approach.

If the other PR's solution is preferred, I'll close this one.

@dsnopek
Copy link
Contributor

dsnopek commented Oct 4, 2025

Thanks!

Sorry, but I just realized that this is basically a duplicate of #94047

Ah, after reading your PR, I was going to suggest exactly the approach taken in #94047 of having a non-virtual to_string() and and a virtual _to_string() so folks wouldn't need to remember to use _try_get_override_to_string()

Let's try to help the other one move forward. If you have time to do any review or testing of it, that would be appreciated!

@chocola-mint
Copy link
Contributor Author

Closing to concentrate efforts on #94047

@AThousandShips AThousandShips removed this from the 4.x milestone Oct 5, 2025
@chocola-mint chocola-mint deleted the fix-#110338 branch October 7, 2025 14:44
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.

Can't override _to_string of InputEventAction

3 participants

X Tutup