aboutsummaryrefslogtreecommitdiff
path: root/scene/resources/theme.cpp
diff options
context:
space:
mode:
authorJuan Linietsky2015-08-23 20:15:56 -0300
committerJuan Linietsky2015-08-23 20:15:56 -0300
commit07e97414250827c3b930befa123a4bbd48d24861 (patch)
tree8ec9872421ad333d3a1150ee64db1d0d27bd4269 /scene/resources/theme.cpp
parent9d185ccc30ad5fe7eb716390ca2e7f5c06574ce0 (diff)
downloadgodot-07e97414250827c3b930befa123a4bbd48d24861.tar.gz
godot-07e97414250827c3b930befa123a4bbd48d24861.tar.zst
godot-07e97414250827c3b930befa123a4bbd48d24861.zip
**WARNING BEFORE PULLING**
This push changes the binary and XML formats and bumps the major version to 2.0. As such, files saved in this version WILL NO LONGER WORK IN PREVIOUS VERSIONS. This compatibility breakage with older versions was required in order to properly provide project refactoring tools. If I were you, unless you are brave, I would wait a week or two before pulling, in case of bugs :) Summary of Changes -New Filesystem dock, with filesystem & tree view modes. -New refactoring tools, to change or fix dependencies. -Quick search dialog, to quickly search any file
Diffstat (limited to 'scene/resources/theme.cpp')
-rw-r--r--scene/resources/theme.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/scene/resources/theme.cpp b/scene/resources/theme.cpp
index 3060fe41b..651e234b4 100644
--- a/scene/resources/theme.cpp
+++ b/scene/resources/theme.cpp
@@ -601,7 +601,9 @@ Theme::~Theme()
-RES ResourceFormatLoaderTheme::load(const String &p_path,const String& p_original_path) {
+RES ResourceFormatLoaderTheme::load(const String &p_path, const String& p_original_path, Error *r_error) {
+ if (r_error)
+ *r_error=ERR_CANT_OPEN;
Error err;
FileAccess *f = FileAccess::open(p_path,FileAccess::READ,&err);
@@ -611,6 +613,8 @@ RES ResourceFormatLoaderTheme::load(const String &p_path,const String& p_origina
String base_path = p_path.get_base_dir();
Ref<Theme> theme( memnew( Theme ) );
Map<StringName,Variant> library;
+ if (r_error)
+ *r_error=ERR_FILE_CORRUPT;
bool reading_library=false;
int line=0;
@@ -1003,6 +1007,9 @@ RES ResourceFormatLoaderTheme::load(const String &p_path,const String& p_origina
f->close();
memdelete(f);
+ if (r_error)
+ *r_error=OK;
+
return theme;
}