summaryrefslogtreecommitdiff
path: root/core/bind/core_bind.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2020-04-29 16:07:34 +0200
committerGitHub <noreply@github.com>2020-04-29 16:07:34 +0200
commitb99b212855ed3d208405bf5f12f43034e5f960cf (patch)
tree659dc1ca3f08874982aa0c6cd3cb84f095ff5344 /core/bind/core_bind.cpp
parentf6e29addd433130100061935b9a2b8f6de38254b (diff)
parentd46e411b4475ffd5cc6871b5e5dc70150d930164 (diff)
Merge pull request #38307 from Calinou/shell-open-res-user-warning
Warn when trying to open `res://` or `user://` with `OS.shell_open()`
Diffstat (limited to 'core/bind/core_bind.cpp')
-rw-r--r--core/bind/core_bind.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/core/bind/core_bind.cpp b/core/bind/core_bind.cpp
index e8955c05df..e2774deb3c 100644
--- a/core/bind/core_bind.cpp
+++ b/core/bind/core_bind.cpp
@@ -237,6 +237,11 @@ String _OS::get_executable_path() const {
Error _OS::shell_open(String p_uri) {
+ if (p_uri.begins_with("res://")) {
+ WARN_PRINT("Attempting to open an URL with the \"res://\" protocol. Use `ProjectSettings.globalize_path()` to convert a Godot-specific path to a system path before opening it with `OS.shell_open()`.");
+ } else if (p_uri.begins_with("user://")) {
+ WARN_PRINT("Attempting to open an URL with the \"user://\" protocol. Use `ProjectSettings.globalize_path()` to convert a Godot-specific path to a system path before opening it with `OS.shell_open()`.");
+ }
return OS::get_singleton()->shell_open(p_uri);
};