-
-
Notifications
You must be signed in to change notification settings - Fork 22k
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
Project converter: fix convertion for project.godot file #66251
Project converter: fix convertion for project.godot file #66251
Conversation
Bug found: If I want to remove a key or move it to another section and its value is multiline, then the resulting file is broken. |
64ba5b2
to
9aeb252
Compare
c07df6e
to
a04da1c
Compare
I did some rewrite here in order to be able to later handle resource files (.tscn/.tres) a bit like It provides a static method I defined 5 types of elements:
As I mentioned here, the problem is that sometimes we need some context to be able to rename things. Now, we would be able to do things like
if we want to rename the Few things to note:
the KeyValue element stores
|
If this PR is approved, I will have to make some change to #66150 (should I turn it into a draft?) |
I haven't reviewed the code in-depth but I'm not sure why You should be able to open |
Regarding a This allows us to have some kind of context when converting |
I don't claim that this exactly fits the bill as I haven't reviewed your code in depth, but I'd still be surprised if we needed so much new code to reimplement loading/editing files that Godot loads/edits all the time. |
I went for a much simpler approach in #74040. More hardcoding, but for a converter which relies on hacky use of regexes, I think it's good enough. |
This PR is intended to fixes #66125.
While testing this issue, I noticed that adding
{ "display/window/size/width", "display/window/size/viewport_width" },
to theproject_settings_renames
array, do not have any effect.After a closer look, I think this is because
project.godot
is an INI fileIn this PR, I decided to parse the existing project settings renames into a new structure (so substitutions for ".gd" and ".tscn" files are not affected).
Apart from solving the initial issue, this PR also supports remove keys or move a key to another/new section, based on the original rename config format. Because of that, the
project.godot
file is fully rewritten at the end of the conversion process.As a dummy example, adding these lines to the existing config
with this
project.godot
file:will produce the following validation check
When converting, the file is rewritten according to the actions detected during the analyze stage.
Any comments are welcomed!