Rework export template dialog to allow individual templates#117072
Conversation
|
Just going off of the video, I would expect every download that is done to immediately disappear from the bottom list and appear in the top list. (or give the downloaded item a hardcoded second or two at 100% for that extra completionist feel.) How (or if at all) does this UI work with custom templates? |
Currently the tree only updates all at once, because it's simpler. Moving items would require some logic to determine where to drop the element, which involves Tree searching and re-creating branches as necessary. I decided it's not worth it.
It doesn't. At most I can add a Unknown/Extra category in Installed tree that lists unrecognized files. |
Can't you just update / recreate the whole tree every time something finishes downloading? We're talking about milliseconds of freeing and instantiating new nodes, are we not? |
No, because the files that are still downloading would lose their metadata. I'd have to transfer it somehow to the re-created tree, which also requires some extra logic. |
47895e4 to
483739b
Compare
|
Almost finished.
I did that in the end. godot.windows.editor.dev.x86_64_S2WtvgGzbg.mp4I had to transfer metadata anyway, to properly display download errors. The code is terribly inefficient, but for ~30 template files it does not matter. |
275079f to
9a2cc3e
Compare
9a2cc3e to
82ddcc0
Compare
|
I think this should be ready 🤔 I updated the description and video. Definitely needs some testing, I'm not 100% sure I didn't forget anything xd |
| mirrors_requester->connect("request_completed", callable_mp(this, &ExportTemplateManager::_mirrors_request_completed)); | ||
| add_child(mirrors_requester); | ||
|
|
||
| for (int i = 0; i < 5; i++) { |
There was a problem hiding this comment.
I suppose this could be an editor setting 🤔
904b409 to
14d6891
Compare
|
Tested this. Thoughts:
|
These two are on different level. ICU Data is "template" while "_console" files are files (part of a template). I was considering adding descriptions for templates, but not for each individual file, not sure if it's worth it. The file list is also folded by default, because normally you don't need to interact with them. It's there for extra info for advanced users.
That's the plan, but there is no such webpage yet :P See #117072 (comment)
idk, this option was there before. Could be useful for troubleshooting purposes maybe.
You can't install custom templates. They are usually configured in export presets (unless people actually do copy them to the templates folder?).
Yeah, I was considering adding another SplitContainer, but thought that the list is wide enough by default 🤷♂️
That's because of hover style taking over. Not sure how to resolve that, it can be changed only for the whole Tree. |
|
The Get Mirror URL option and the Open in Web Browser kind of lead to the same thing. I'd probably remove the Get Mirror URL option until there is actual demand.
Admittedly I did this for Rift Riff when we needed a cherrypick fix for a specific platform. But generally I agree that the custom template field in the export preset should be used. And yeah, I tend to agree that those shouldn't be part of this window. But when someone makes a custom build of Godot + templates, those will show up, right? |
That would make a menu with single option 🤔 I guess it could be a simple button then.
Editor and templates are separate builds that don't know about each other. But if you have a custom build, you can easily add custom templates to the list, by modifying the |
d41a115 to
1e1fa84
Compare
1e1fa84 to
dda7043
Compare
bruvzg
left a comment
There was a problem hiding this comment.
Seems to be working as expected. Code looks good.
I would not list *console.exe wrapers as separate items, since these are tiny and not useful on their own, but it is fine to keep it as is (might make more sense to change Windows template structure to use ZIPs in the future).
dda7043 to
db1829b
Compare
db1829b to
32ed89c
Compare
Alex2782
left a comment
There was a problem hiding this comment.
Looks good!
Tested with https://godotengine.org/mirrorlist/4.7.dev4.json
and code for Zip and HTTP requests checked.
The configuration/settings icon for downloading all files might be confusing for some users. I would simply display the download icon again if there aren't any more suitable icons available.
|
It's a different action than downloading the whole template, so IMO it needs a different icon than regular download. I'm open to suggestions, it has to convey "repairing". |
| if (p_index < 0) { | ||
| p_index += cells[p_column].buttons.size(); | ||
| } |
There was a problem hiding this comment.
This new behavior should be documented in the TreeItem class reference.
Calinou
left a comment
There was a problem hiding this comment.
Tested locally, it works as expected.
Some feedback:
-
With this PR, it's no longer possible to install a
.tpzfile in the editor. I don't think this was used often in the 4.x days (as third-party builds that were available for multiple platforms became rarer), but it's worth noting. -
When in offline mode, "Error getting the list of mirrors" still shows up when using a development build after a small delay:
-
Removing export templates should have a confirmation dialog, as there's no way to undo the operation. While official templates can be easily redownloaded, this is not the case if you are far away from an Internet connection, or if you installed third-party export templates.
- The confirmation dialog could be skipped by holding Shift when clicking the delete icon.
For future PRs:
-
There should be a way to remove all export templates for an associated version, so you can quickly clean up old data after upgrading to a new version.
-
In the long term, it might be worth deprecating the concept of a
.tpzfile and switch to a flat structure with ZIP files directly being downloaded (likely after moving the Windows/Linux templates to ZIPs). This could simplify the editor code significantly, and allow for CI platforms to download specific platforms easily. -
Alternatively, we could add a command line argument to download specific platforms for CI usage, but this requires a Godot process to be spun up, which takes more time to start than
curlorwget.
-
They are moved to trash, so technically you can undo it. |
Co-authored-by: Alexander Hartmann <alex.hart.278@gmail.com>
32ed89c to
2f079a1
Compare
|
Thanks! |

Closes godotengine/godot-proposals#647 (on the editor side at least)
DCrsRTre6i.mp4
This PR completely rewrites the template manager dialog. Instead of managing template packages, it now manages individual template files. The list of files is hard-coded, since it concerns only official templates and these are the same for a version.
You can see a list of individual installed templates and a list of templates available for download. The available templates can be downloaded individually. They are organized as Platform Family -> Platform -> Template -> File. Each of them have checkboxes, so you have fine-grained control on what you want to install. Once you hit the install button, the manager will start downloading, and is able to download multiple files at once. Closing the dialog does not cancel download, it can run in background.
As mentioned above, the dialog is completely rewritten, so it's easier to review the files as a whole, instead of changes. Note that Android-related methods are not changed (not sure why they are even in the dialog, if they aren't part of the dialog. It just happens to be called "template manager"). I left some debug options for easier testing, see comments below.