ephread / inkgd

Implementation of inkle's Ink in pure GDScript for Godot, with editor support.
MIT License
305 stars 33 forks source link

Godot 4 #56

Closed ephread closed 1 year ago

ephread commented 2 years ago

This PR tracks the changes required to run inkgd in Godot 4. (Also see #55)

Global

Runtime

Editor Plugin

ephread commented 2 years ago

This script might also be useful, although I wouldn't run it on the codebase as-is. https://gist.github.com/aaronfranke/79b424226475d277d0035b7835b09c5f

Jummit commented 2 years ago

I converted the entire project to Godot 4 using the built-in tool, and here are some notable things I encountered:

ephread commented 2 years ago

@Jummit perfect, thanks for investigating this. Did you push the conversion somewhere? I'm really curious to see what it looks like and if it maintains member orders.

I still need to land a couple of things in main before starting the conversion. I want prevent the Godot 3.x and the Godot 4.x versions of inkgd from diverging too much, but it's pretty close to being done.

We should be able to start the migration soon.

lunarcloud commented 1 year ago

Seems that "minimum_size" was changed to "custom_minimum_size"

Jummit commented 1 year ago
  • Cyclic references are still a problem sadly

I currently have cyclic dependencies in scripts using class_name, so it seems like it's working! I think this would simplify a lot of the codebase.

Jummit commented 1 year ago

Gave this a shot again.

I removed the get_class functions and used the is operator in is_ink_class. This works, but a lot of code needs to be replaced to use class references instead of strings.

static func is_ink_class(object, name_of_class: GDScript) -> bool:
    return (object is Object) && object.get_script() == name_of_class

All the "imports" can be removed, as cyclic references are now possible.

Setters and getters are interesting, I think they work different than before. In 3.5 you could use the . syntax to use the getter, now it uses it by default. I think this is the main cause for issues at the moment.

Maybe I'll try again another time, but it's too tedious for me at the moment.

ephread commented 1 year ago

Closed in favour of #75.