aboutsummaryrefslogtreecommitdiff
path: root/core/globals.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/globals.cpp')
-rw-r--r--core/globals.cpp33
1 files changed, 17 insertions, 16 deletions
diff --git a/core/globals.cpp b/core/globals.cpp
index 6fe53c741..8b335b8a0 100644
--- a/core/globals.cpp
+++ b/core/globals.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -54,7 +54,8 @@ String Globals::localize_path(const String& p_path) const {
if (resource_path=="")
return p_path; //not initialied yet
- if (p_path.begins_with("res://") || p_path.begins_with("user://"))
+ if (p_path.begins_with("res://") || p_path.begins_with("user://") ||
+ (p_path.is_abs_path() && !p_path.begins_with(resource_path)))
return p_path.simplify_path();
@@ -1419,21 +1420,21 @@ bool Globals::is_using_datapack() const {
void Globals::_bind_methods() {
- ObjectTypeDB::bind_method(_MD("has","name"),&Globals::has);
- ObjectTypeDB::bind_method(_MD("set_order","name","pos"),&Globals::set_order);
- ObjectTypeDB::bind_method(_MD("get_order","name"),&Globals::get_order);
- ObjectTypeDB::bind_method(_MD("set_persisting","name","enable"),&Globals::set_persisting);
- ObjectTypeDB::bind_method(_MD("is_persisting","name"),&Globals::is_persisting);
- ObjectTypeDB::bind_method(_MD("add_property_info", "hint"),&Globals::_add_property_info_bind);
- ObjectTypeDB::bind_method(_MD("clear","name"),&Globals::clear);
- ObjectTypeDB::bind_method(_MD("localize_path","path"),&Globals::localize_path);
- ObjectTypeDB::bind_method(_MD("globalize_path","path"),&Globals::globalize_path);
- ObjectTypeDB::bind_method(_MD("save"),&Globals::save);
- ObjectTypeDB::bind_method(_MD("has_singleton","name"),&Globals::has_singleton);
- ObjectTypeDB::bind_method(_MD("get_singleton","name"),&Globals::get_singleton_object);
- ObjectTypeDB::bind_method(_MD("load_resource_pack","pack"),&Globals::_load_resource_pack);
+ ClassDB::bind_method(_MD("has","name"),&Globals::has);
+ ClassDB::bind_method(_MD("set_order","name","pos"),&Globals::set_order);
+ ClassDB::bind_method(_MD("get_order","name"),&Globals::get_order);
+ ClassDB::bind_method(_MD("set_persisting","name","enable"),&Globals::set_persisting);
+ ClassDB::bind_method(_MD("is_persisting","name"),&Globals::is_persisting);
+ ClassDB::bind_method(_MD("add_property_info", "hint"),&Globals::_add_property_info_bind);
+ ClassDB::bind_method(_MD("clear","name"),&Globals::clear);
+ ClassDB::bind_method(_MD("localize_path","path"),&Globals::localize_path);
+ ClassDB::bind_method(_MD("globalize_path","path"),&Globals::globalize_path);
+ ClassDB::bind_method(_MD("save"),&Globals::save);
+ ClassDB::bind_method(_MD("has_singleton","name"),&Globals::has_singleton);
+ ClassDB::bind_method(_MD("get_singleton","name"),&Globals::get_singleton_object);
+ ClassDB::bind_method(_MD("load_resource_pack","pack"),&Globals::_load_resource_pack);
- ObjectTypeDB::bind_method(_MD("save_custom","file"),&Globals::_save_custom_bnd);
+ ClassDB::bind_method(_MD("save_custom","file"),&Globals::_save_custom_bnd);
}