Open Anutrix opened 1 year ago
The project converter has no information about the script type, it operates only using text. Thus update()
can't be auto-converted, because it would change methods that shouldn't be changed.
It would take a lot of effort to have the converter discern type by context, and therefore being able to appropriately convert update
where needed. In the end it may be worth it, but there's so many things to focus on.
The project converter has no information about the script type, it operates only using text. Thus
update()
can't be auto-converted, because it would change methods that shouldn't be changed.
Exactly.
It would take a lot of effort to have the converter discern type by context, and therefore being able to appropriately convert
update
where needed. In the end it may be worth it, but there's so many things to focus on.
But the files are converted one at a time so reading first non-empty line to see what type it extends should work, right? Then, we can make type-specific method/property name conversions.
Also, we would need to inform the user someway if conversion is not possible. I had to dig the repo and file commit history to find out what update
method was renamed to.
What can be done in those situations is to add a command at the end of the line, like this:
func _ready():
$Something.update() # 3to4: `update()` may have to be renamed to `queue_redraw()`.
Godot version
v4.0.beta.custom_build [0c23a2cfe]
System information
Windows 11 Pro 22H2 64 bit
Issue description
update()
is not renamed toqueue_redraw()
forNode2D
(or anything that inheritsCanvasItem
) after https://github.com/godotengine/godot/pull/64377.Additional info: I thought of making a simple MR to add it myself in ProjectConverter3To4 but I wasn't sure simply if replacing update() function in all script files will work since other classes also have
update()
method.Steps to reproduce
Parse Error: Function "update()" not found in base self
error.OR
4.0-dev
branch.Parse Error: Function "update()" not found in base self
error.Minimal reproduction project
Bullet Shower demo from https://github.com/godotengine/godot-demo-projects