Improve handling of archives when installing assets - #81358
Merged
akien-mga merged 1 commit intoSep 8, 2023
Merged
Conversation
YuriSizov
force-pushed
the
assets-install-however-you-want
branch
from
September 6, 2023 13:26
84ee26b to
86f5573
Compare
|
Would it be possible to modify what info the editor retries from the asset library to verify if the repo host is custom or not? I think that could potentially be a cleaner approach as then we would know for certain how it should be handled in either case. EDIT: This would not resolve issues with manual imports still, but it would help the checkbox be more accurate in assumptions for direct downloads. |
Fixes #81311. Closes #75712.
So #75712 has been a problem for quite some time now. As discussed, there are two key points:
And #81311 is a new finding, as far as I know. It seems some ZIP archives can skip the directory structure information and just contain record of files without intermediate folders. We fail at handling those gracefully.
So I set to fix these problems, and along the way I tweaks smaller details here and there. Here's a list of changes:
TTRNfor that last message).Most of it should be self explanatory. Regarding the checkbox, it tries to be smart. First of all, it's disabled if there is no single root folder in the asset archive. It only becomes available if your asset has a folder structure similar to what GitHub creates. This may backfire when your ZIP file contains, for example, only the
addonsfolder — but if that becomes an issue we should be able to easily add an exception.I've decided to preserve the current dual logic, where assets installed through the AssetLib have their root folder skipped, while archives installed manually don't behave this way. However, this is no longer a hardcoded behavior. Instead, the checkbox is either checked by default or not, but can still be changed by the user.
Here's everything in action (note that the image loading error is related to the broken asset and is not a part of this PR):
godot.windows.editor.dev.x86_64_2023-09-05_23-53-18.mp4