godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
91.06k stars 21.18k forks source link

Saving an editor layout in 4.x breaks 3.x's layouts #81025

Open mieldepoche opened 1 year ago

mieldepoche commented 1 year ago

Godot version

4.1.1, 3.5.2

System information

linux

Issue description

Godot 3 outputs: ERROR: ConfigFile parse error at /home/miel/.config/godot/editor_layouts.cfg:22: Unexpected identifier: 'Rect2i' when I try to save a custom layout. It also shows an error dialog in the editor: image and the layout isn't saved.

Steps to reproduce

Make a layout in 4.1 and try making one in 3.x afterwards.

Minimal reproduction project

unrelated to projects

YuriSizov commented 1 year ago

You can't have 2 system-wide versions of Godot at the same time since they share the same editor files and caches. You need to use the self-contained mode if you want to have multiple versions.

FireCatMagic commented 1 year ago

You can't have 2 system-wide versions of Godot at the same time since they share the same editor files and caches. You need to use the self-contained mode if you want to have multiple versions.

With editor settings, settings are saved as "editor_settings-3" and "editor_settings-4" respectively. Would there be a way to do that sort of thing with this?

YuriSizov commented 1 year ago

I think it's too late for this given that 4.0 and 4.1 are already affected by this. Plus there are just too many different files that can conflict on the global level, not all of which can be resolved with a naming scheme. We probably should've defined a new folder for Godot 4, e.g. godot.4 or something like that, to avoid this issue.

But if we limit the scope to only some of the files, we could still do some changes.

FireCatMagic commented 1 year ago

I think it's too late for this given that 4.0 and 4.1 are already affected by this. Plus there are just too many different files that can conflict on the global level, not all of which can be resolved with a naming scheme. We probably should've defined a new folder for Godot 4, e.g. godot.4 or something like that, to avoid this issue.

But if we limit the scope to only some of the files, we could still do some changes.

Maybe this is a stupid suggestion, but what if it did something like this?

If it doesn't just create the godot.4 folder as normal

Alternately, as I haven't seen inside the folder, I don't know exactly what it contains. But if there's a file in there that indicates it was generated in Godot 3 vs Godot 4, that could skip the entire dialog

Calinou commented 1 year ago

We can probably hack around the Godot 3.x editor layout loader to use String.replace("Rect2i", "Rect2") before loading the ConfigFile as a buffer.