godot icon indicating copy to clipboard operation
godot copied to clipboard

[4.0] Project converter: Missing conversion for button_pressed for nodes extending BaseButton

Open nobuyukinyuu opened this issue 2 years ago • 5 comments

Godot version

4.0 stable

System information

Windows 10

Issue description

BaseButton Property pressed has changed from a bool to a signal. Code explicitly referencing nodes extending BaseButton do not change this property nor warn the user that the property has changed when migrating from 3.x to 4.0.

There may be issues regarding object qualification if converter doesn't do this yet, addressed in other issues (I don't know if an issue specific to this is filed or how to word it since I don't know the state of the internals of the project converter). It should at least be possible to qualify nodes that exist at design time...

Steps to reproduce

Migrate 3.x project to 4.0

Minimal reproduction project

n/a

nobuyukinyuu avatar Mar 05 '23 01:03 nobuyukinyuu

This is not going to be possible to address, because convertor has no context and is simply doing substitutions. So something as common as "pressed" would result in many false positives.

YuriSizov avatar Mar 05 '23 10:03 YuriSizov

pressed would become button_pressed in godot 4

Reneator avatar Mar 06 '23 13:03 Reneator

@Reneator as Yuri said the word pressed is impossible to convert because the converter doesn't know the context

Zireael07 avatar Mar 06 '23 15:03 Zireael07

This is why I mentioned type qualification, which I'm not sure if this is an appropriate issue for addressing here directly, but if there is an existing proposal or tracker this can be moved to encapsulate all project converter issues which require type qualification, by all means please link it. In my first issue referencing converter problems I linked #67003 because it's the first issue being tracked I noticed where qualification issues were being discussed.

Basic qualification can still be done in instances where a NodePath is known at design time. (The autocomplete hinter already appears to do this.)

nobuyukinyuu avatar Mar 06 '23 20:03 nobuyukinyuu

@nobuyukinyuu This issue is fine, it's just unlikely to be fixed, unless someone wants to reimplement the convertor to be smarter than just a bunch of regex substitutions.

YuriSizov avatar Mar 07 '23 11:03 YuriSizov