-
-
Notifications
You must be signed in to change notification settings - Fork 21.7k
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
Allow loading custom ProjectSettings instance #75048
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what was the intention here, but
get_resource_path()
can point to invalid directory and_csproj_exists()
crash. If the previous code was correct, I could handle it in_csproj_exists()
instead.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The intention was to get the path to the directory that contains
project.godot
(which isres://
). Maybe we can just use the literal string"res://"
here and it would be handled byDirAccess
.The
_csproj_exists
method is just meant to beFileAccess::exists("res://*.csproj")
butFileAccess::exists
doesn't support globbing.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
get_resource_path()
returns the loaded path. With my change,save_custom
used to save to a directory different thanres://
will look for.csproj
inside that directory instead of the load path. Would that be correct? (I think it doesn't affect the editor, assave_custom()
is normally always used with the current path)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like we always look for the
.csproj
in theres://
directory so looking in a different directory wouldn't be correct. Are you saying theproject.godot
file can be in a directory other thanres://
? Doesn't the editor always assume this file to be in the root project directory?In which cases is
save_custom
used to save to a directory different thanres://
? I see that this method is exposed to scripting, is this the case you are concerned about? If so, I don't think we care about this scenario. This detection is only used to add the "C#" feature tag to be used by the Project Manager, so any usage outside of that doesn't really matter.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I checked how we use
save_custom
and it's used only for creating new projects and for saving project file for exported project. So I guess my concerns are irrelevant.