Skip to content
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

the Export path not works when Export PCK/Zip #39769

Closed
alexzheng opened this issue Jun 23, 2020 · 4 comments · Fixed by #45359
Closed

the Export path not works when Export PCK/Zip #39769

alexzheng opened this issue Jun 23, 2020 · 4 comments · Fixed by #45359

Comments

@alexzheng
Copy link

alexzheng commented Jun 23, 2020

Godot version:

3.2.1

OS/device including version:

macOS 10.15.5

Issue description:

When click Export PCK/ZIP, the default directory is the project root directory, not the Export Path.

And the Export with Debug Checkbox is always checked on.

Steps to reproduce:
Create a project
do export for any platform
close the project
reopen the same project
click Export PCK/ZIP
the default directory is not the export path and the Export with Debug is always on.

Without restarting the project,these options are recorded on export.

Minimal reproduction project:

Screen Shot 2020-06-23 at 9 45 01 AM

Screen Shot 2020-06-23 at 4 33 25 PM

@mrushyendra
Copy link
Contributor

The following change would fix the issue:

--- a/editor/project_export.cpp
+++ b/editor/project_export.cpp
@@ -876,6 +876,18 @@ void ProjectExportDialog::_tree_changed() {
 }
 
 void ProjectExportDialog::_export_pck_zip() {
+       Ref<EditorExportPreset> current = get_current_preset();
+       ERR_FAIL_COND(current.is_null());
+
+       String p_path = current->get_export_path();
+       if (p_path != "") {
+               int pos = MAX(p_path.find_last("/"), p_path.find_last("\\"));
+               if (pos != -1) {
+                       String dir = p_path.substr(0, pos);
+                       export_pck_zip->set_current_dir(dir);
+               }
+       }
        export_pck_zip->popup_centered_ratio();
 }

Before submitting a PR, I wanted to confirm what the expected behavior should be. Right now the code seems to explicitly use the export path only for the general Export case, and intentionally ignores the path for the Export PCK/ZIP case. Is there a reason for this?

In fact, currently the Export Path is not a directory, but must be a specific file ending with the appropriate extension, e.g. .x86-64. To show the same folder when exporting as PCK/ZIP requires a slightly-hackish behavior to parse the file directory out from the entire path as shown above.

@alexzheng
Copy link
Author

alexzheng commented Jul 3, 2020

Take iOS export for example,
the work flow would be:

1.export the Xcode project
2.do some custom settings to the Xcode project
3.run the Xcode project on device
4.do some modification in Godot Project
5.export PCK/ZIP to update the old one in the Xcode project

then again loop 3 - 4- 5

It would be expected the PCK/ZIP export path alway the same as the Xcode project root directory.

Currently, the default directory for PCK/ZIP is the Godot project root directory, I think nobody would export the PCK/ZIP to the Godot project.

@alexzheng
Copy link
Author

alexzheng commented Dec 23, 2020

@mrushyendra
How about this issue?
It's quite time consuming to select the directory each time when update the PCK file for exported iOS project.

@alexzheng
Copy link
Author

@mrushyendra
I have tested the above code, it works, please commit it. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants