summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/classes/ScrollContainer.xml2
-rw-r--r--editor/editor_node.cpp7
-rw-r--r--modules/mono/csharp_script.cpp5
-rw-r--r--modules/mono/editor/script_class_parser.cpp19
-rw-r--r--scene/3d/spatial.cpp1
5 files changed, 23 insertions, 11 deletions
diff --git a/doc/classes/ScrollContainer.xml b/doc/classes/ScrollContainer.xml
index 94920d57e5..deaed5b60f 100644
--- a/doc/classes/ScrollContainer.xml
+++ b/doc/classes/ScrollContainer.xml
@@ -13,12 +13,14 @@
<return type="HScrollBar">
</return>
<description>
+ Returns the horizontal scrollbar [HScrollBar] of this [ScrollContainer].
</description>
</method>
<method name="get_v_scrollbar">
<return type="VScrollBar">
</return>
<description>
+ Returns the vertical scrollbar [VScrollBar] of this [ScrollContainer].
</description>
</method>
</methods>
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index c5b67eb971..dd15910d09 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -1765,6 +1765,8 @@ void EditorNode::_edit_current() {
return;
}
+ Object *prev_inspected_object = get_inspector()->get_edited_object();
+
bool capitalize = bool(EDITOR_GET("interface/inspector/capitalize_properties"));
bool disable_folding = bool(EDITOR_GET("interface/inspector/disable_folding"));
bool is_resource = current_obj->is_class("Resource");
@@ -1856,6 +1858,11 @@ void EditorNode::_edit_current() {
inspector_dock->update(NULL);
}
+ if (current_obj == prev_inspected_object) {
+ // Make sure inspected properties are restored.
+ get_inspector()->update_tree();
+ }
+
inspector_dock->set_warning(editable_warning);
if (get_inspector()->is_capitalize_paths_enabled() != capitalize) {
diff --git a/modules/mono/csharp_script.cpp b/modules/mono/csharp_script.cpp
index 3d868b0839..9e19e5f8c4 100644
--- a/modules/mono/csharp_script.cpp
+++ b/modules/mono/csharp_script.cpp
@@ -2425,6 +2425,9 @@ bool CSharpScript::_update_exports() {
top = top->get_parent_class();
}
+ // Need to check this here, before disposal
+ bool base_ref = Object::cast_to<Reference>(tmp_native) != NULL;
+
// Dispose the temporary managed instance
MonoException *exc = NULL;
@@ -2438,7 +2441,7 @@ bool CSharpScript::_update_exports() {
MonoGCHandle::free_handle(tmp_pinned_gchandle);
tmp_object = NULL;
- if (tmp_native && !Object::cast_to<Reference>(tmp_native)) {
+ if (tmp_native && !base_ref) {
Node *node = Object::cast_to<Node>(tmp_native);
if (node && node->is_inside_tree()) {
ERR_PRINTS("Temporary instance was added to the scene tree.");
diff --git a/modules/mono/editor/script_class_parser.cpp b/modules/mono/editor/script_class_parser.cpp
index 8ac4df9952..bece23c9a6 100644
--- a/modules/mono/editor/script_class_parser.cpp
+++ b/modules/mono/editor/script_class_parser.cpp
@@ -635,13 +635,14 @@ static String get_preprocessor_directive(const String &p_line, int p_from) {
CRASH_COND(p_line[p_from] != '#');
p_from++;
int i = p_from;
- while (i < p_line.length() && p_line[i] != ' ' && p_line[i] != '\t') {
+ while (i < p_line.length() && (p_line[i] == '_' || (p_line[i] >= 'A' && p_line[i] <= 'Z') ||
+ (p_line[i] >= 'a' && p_line[i] <= 'z') || p_line[i] > 127)) {
i++;
}
return p_line.substr(p_from, i - p_from);
}
-static void run_dummy_preprocessor(String &r_source) {
+static void run_dummy_preprocessor(String &r_source, const String &p_filepath) {
Vector<String> lines = r_source.split("\n", /* p_allow_empty: */ true);
@@ -655,8 +656,8 @@ static void run_dummy_preprocessor(String &r_source) {
const int line_len = line.length();
- int j = 0;
- while (j < line_len) {
+ int j;
+ for (j = 0; j < line_len; j++) {
if (line[j] != ' ' && line[j] != '\t') {
if (line[j] == '#') {
// First non-whitespace char of the line is '#'
@@ -668,13 +669,13 @@ static void run_dummy_preprocessor(String &r_source) {
if_level++;
is_branch_being_compiled.push_back(if_level == 0 || is_branch_being_compiled[if_level - 1]);
} else if (directive == "elif") {
- ERR_CONTINUE_MSG(if_level == -1, "Found unexpected '#elif' directive.");
+ ERR_CONTINUE_MSG(if_level == -1, "Found unexpected '#elif' directive. File: '" + p_filepath + "'.");
is_branch_being_compiled.write[if_level] = false;
} else if (directive == "else") {
- ERR_CONTINUE_MSG(if_level == -1, "Found unexpected '#else' directive.");
+ ERR_CONTINUE_MSG(if_level == -1, "Found unexpected '#else' directive. File: '" + p_filepath + "'.");
is_branch_being_compiled.write[if_level] = false;
} else if (directive == "endif") {
- ERR_CONTINUE_MSG(if_level == -1, "Found unexpected '#endif' directive.");
+ ERR_CONTINUE_MSG(if_level == -1, "Found unexpected '#endif' directive. File: '" + p_filepath + "'.");
is_branch_being_compiled.remove(if_level);
if_level--;
}
@@ -686,8 +687,6 @@ static void run_dummy_preprocessor(String &r_source) {
break;
}
}
-
- j++;
}
if (j == line_len) {
@@ -722,7 +721,7 @@ Error ScriptClassParser::parse_file(const String &p_filepath) {
" Please ensure that scripts are saved in valid UTF-8 unicode." :
"Failed to read file: '" + p_filepath + "'.");
- run_dummy_preprocessor(source);
+ run_dummy_preprocessor(source, p_filepath);
return parse(source);
}
diff --git a/scene/3d/spatial.cpp b/scene/3d/spatial.cpp
index b7cd2114db..f1911348ce 100644
--- a/scene/3d/spatial.cpp
+++ b/scene/3d/spatial.cpp
@@ -125,6 +125,7 @@ void Spatial::_notification(int p_what) {
switch (p_what) {
case NOTIFICATION_ENTER_TREE: {
+ ERR_FAIL_COND(!get_tree());
Node *p = get_parent();
if (p)