diff options
| -rw-r--r-- | modules/openxr/editor/openxr_interaction_profile_editor.cpp | 2 | ||||
| -rw-r--r-- | scene/gui/graph_edit.cpp | 1 | ||||
| -rw-r--r-- | scene/gui/graph_node.cpp | 1 | ||||
| -rw-r--r-- | scene/gui/tree.cpp | 120 | ||||
| -rw-r--r-- | scene/resources/environment.cpp | 6 | 
5 files changed, 76 insertions, 54 deletions
diff --git a/modules/openxr/editor/openxr_interaction_profile_editor.cpp b/modules/openxr/editor/openxr_interaction_profile_editor.cpp index 669cc694f2..24ac5494dd 100644 --- a/modules/openxr/editor/openxr_interaction_profile_editor.cpp +++ b/modules/openxr/editor/openxr_interaction_profile_editor.cpp @@ -209,6 +209,8 @@ void OpenXRInteractionProfileEditor::_add_io_path(VBoxContainer *p_container, co  }  void OpenXRInteractionProfileEditor::_update_interaction_profile() { +	ERR_FAIL_NULL(profile_def); +  	// out with the old...  	while (main_hb->get_child_count() > 0) {  		memdelete(main_hb->get_child(0)); diff --git a/scene/gui/graph_edit.cpp b/scene/gui/graph_edit.cpp index e39791642a..8b7e0f22b9 100644 --- a/scene/gui/graph_edit.cpp +++ b/scene/gui/graph_edit.cpp @@ -1637,6 +1637,7 @@ float GraphEdit::get_minimap_opacity() const {  void GraphEdit::set_minimap_enabled(bool p_enable) {  	minimap_button->set_pressed(p_enable); +	_minimap_toggled();  	minimap->update();  } diff --git a/scene/gui/graph_node.cpp b/scene/gui/graph_node.cpp index ef0ac75cb4..51fb26b459 100644 --- a/scene/gui/graph_node.cpp +++ b/scene/gui/graph_node.cpp @@ -393,7 +393,6 @@ void GraphNode::_notification(int p_what) {  				w -= close->get_width();  			} -			title_buf->set_width(w);  			title_buf->draw(get_canvas_item(), Point2(sb->get_margin(SIDE_LEFT) + title_h_offset, -title_buf->get_size().y + title_offset), title_color);  			if (show_close) {  				Vector2 cpos = Point2(w + sb->get_margin(SIDE_LEFT) + close_h_offset, -close->get_height() + close_offset); diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp index 24cd485e1b..3c8ea4d6df 100644 --- a/scene/gui/tree.cpp +++ b/scene/gui/tree.cpp @@ -2089,7 +2089,6 @@ int Tree::draw_item(const Point2i &p_pos, const Point2 &p_draw_ofs, const Size2  	}  	if (!p_item->collapsed) { /* if not collapsed, check the children */ -  		TreeItem *c = p_item->first_child;  		int base_ofs = children_pos.y - cache.offset.y + p_draw_ofs.y; @@ -2097,82 +2096,97 @@ int Tree::draw_item(const Point2i &p_pos, const Point2 &p_draw_ofs, const Size2  		int prev_hl_ofs = base_ofs;  		while (c) { +			int child_h = -1;  			if (htotal >= 0) { -				int child_h = draw_item(children_pos, p_draw_ofs, p_draw_size, c); +				child_h = draw_item(children_pos, p_draw_ofs, p_draw_size, c); +			} -				// Draw relationship lines. -				if (cache.draw_relationship_lines > 0 && (!hide_root || c->parent != root)) { -					int root_ofs = children_pos.x + ((p_item->disable_folding || hide_folding) ? cache.hseparation : cache.item_margin); -					int parent_ofs = p_pos.x + cache.item_margin; -					Point2i root_pos = Point2i(root_ofs, children_pos.y + label_h / 2) - cache.offset + p_draw_ofs; +			// Draw relationship lines. +			if (cache.draw_relationship_lines > 0 && (!hide_root || c->parent != root)) { +				int root_ofs = children_pos.x + ((p_item->disable_folding || hide_folding) ? cache.hseparation : cache.item_margin); +				int parent_ofs = p_pos.x + cache.item_margin; +				Point2i root_pos = Point2i(root_ofs, children_pos.y + label_h / 2) - cache.offset + p_draw_ofs; -					if (c->get_first_child() != nullptr) { -						root_pos -= Point2i(cache.arrow->get_width(), 0); -					} +				if (c->get_first_child() != nullptr) { +					root_pos -= Point2i(cache.arrow->get_width(), 0); +				} -					float line_width = cache.relationship_line_width * Math::round(cache.base_scale); -					float parent_line_width = cache.parent_hl_line_width * Math::round(cache.base_scale); -					float children_line_width = cache.children_hl_line_width * Math::round(cache.base_scale); +				float line_width = cache.relationship_line_width * Math::round(cache.base_scale); +				float parent_line_width = cache.parent_hl_line_width * Math::round(cache.base_scale); +				float children_line_width = cache.children_hl_line_width * Math::round(cache.base_scale); -					Point2i parent_pos = Point2i(parent_ofs - cache.arrow->get_width() / 2, p_pos.y + label_h / 2 + cache.arrow->get_height() / 2) - cache.offset + p_draw_ofs; +				Point2i parent_pos = Point2i(parent_ofs - cache.arrow->get_width() / 2, p_pos.y + label_h / 2 + cache.arrow->get_height() / 2) - cache.offset + p_draw_ofs; -					int more_prev_ofs = 0; +				int more_prev_ofs = 0; -					if (root_pos.y + line_width >= 0) { -						if (rtl) { -							root_pos.x = get_size().width - root_pos.x; -							parent_pos.x = get_size().width - parent_pos.x; -						} +				if (root_pos.y + line_width >= 0) { +					if (rtl) { +						root_pos.x = get_size().width - root_pos.x; +						parent_pos.x = get_size().width - parent_pos.x; +					} -						// Order of parts on this bend: the horizontal line first, then the vertical line. -						if (_is_branch_selected(c)) { -							// If this item or one of its children is selected, we draw the line using parent highlight style. +					// Order of parts on this bend: the horizontal line first, then the vertical line. +					if (_is_branch_selected(c)) { +						// If this item or one of its children is selected, we draw the line using parent highlight style. +						if (htotal >= 0) {  							RenderingServer::get_singleton()->canvas_item_add_line(ci, root_pos, Point2i(parent_pos.x + Math::floor(parent_line_width / 2), root_pos.y), cache.parent_hl_line_color, parent_line_width); +						} +						RenderingServer::get_singleton()->canvas_item_add_line(ci, Point2i(parent_pos.x, root_pos.y + Math::floor(parent_line_width / 2)), Point2i(parent_pos.x, prev_hl_ofs), cache.parent_hl_line_color, parent_line_width); + +						more_prev_ofs = cache.parent_hl_line_margin; +						prev_hl_ofs = root_pos.y + Math::floor(parent_line_width / 2); +					} else if (p_item->is_selected(0)) { +						// If parent item is selected (but this item is not), we draw the line using children highlight style. +						// Siblings of the selected branch can be drawn with a slight offset and their vertical line must appear as highlighted. +						if (_is_sibling_branch_selected(c)) { +							if (htotal >= 0) { +								RenderingServer::get_singleton()->canvas_item_add_line(ci, root_pos, Point2i(parent_pos.x + Math::floor(parent_line_width / 2), root_pos.y), cache.children_hl_line_color, children_line_width); +							}  							RenderingServer::get_singleton()->canvas_item_add_line(ci, Point2i(parent_pos.x, root_pos.y + Math::floor(parent_line_width / 2)), Point2i(parent_pos.x, prev_hl_ofs), cache.parent_hl_line_color, parent_line_width); -							more_prev_ofs = cache.parent_hl_line_margin;  							prev_hl_ofs = root_pos.y + Math::floor(parent_line_width / 2); -						} else if (p_item->is_selected(0)) { -							// If parent item is selected (but this item is not), we draw the line using children highlight style. -							// Siblings of the selected branch can be drawn with a slight offset and their vertical line must appear as highlighted. -							if (_is_sibling_branch_selected(c)) { -								RenderingServer::get_singleton()->canvas_item_add_line(ci, root_pos, Point2i(parent_pos.x + Math::floor(parent_line_width / 2), root_pos.y), cache.children_hl_line_color, children_line_width); -								RenderingServer::get_singleton()->canvas_item_add_line(ci, Point2i(parent_pos.x, root_pos.y + Math::floor(parent_line_width / 2)), Point2i(parent_pos.x, prev_hl_ofs), cache.parent_hl_line_color, parent_line_width); - -								prev_hl_ofs = root_pos.y + Math::floor(parent_line_width / 2); -							} else { +						} else { +							if (htotal >= 0) {  								RenderingServer::get_singleton()->canvas_item_add_line(ci, root_pos, Point2i(parent_pos.x + Math::floor(children_line_width / 2), root_pos.y), cache.children_hl_line_color, children_line_width); -								RenderingServer::get_singleton()->canvas_item_add_line(ci, Point2i(parent_pos.x, root_pos.y + Math::floor(children_line_width / 2)), Point2i(parent_pos.x, prev_ofs + Math::floor(children_line_width / 2)), cache.children_hl_line_color, children_line_width);  							} -						} else { -							// If nothing of the above is true, we draw the line using normal style. -							// Siblings of the selected branch can be drawn with a slight offset and their vertical line must appear as highlighted. -							if (_is_sibling_branch_selected(c)) { +							RenderingServer::get_singleton()->canvas_item_add_line(ci, Point2i(parent_pos.x, root_pos.y + Math::floor(children_line_width / 2)), Point2i(parent_pos.x, prev_ofs + Math::floor(children_line_width / 2)), cache.children_hl_line_color, children_line_width); +						} +					} else { +						// If nothing of the above is true, we draw the line using normal style. +						// Siblings of the selected branch can be drawn with a slight offset and their vertical line must appear as highlighted. +						if (_is_sibling_branch_selected(c)) { +							if (htotal >= 0) {  								RenderingServer::get_singleton()->canvas_item_add_line(ci, root_pos, Point2i(parent_pos.x + cache.parent_hl_line_margin, root_pos.y), cache.relationship_line_color, line_width); -								RenderingServer::get_singleton()->canvas_item_add_line(ci, Point2i(parent_pos.x, root_pos.y + Math::floor(parent_line_width / 2)), Point2i(parent_pos.x, prev_hl_ofs), cache.parent_hl_line_color, parent_line_width); +							} +							RenderingServer::get_singleton()->canvas_item_add_line(ci, Point2i(parent_pos.x, root_pos.y + Math::floor(parent_line_width / 2)), Point2i(parent_pos.x, prev_hl_ofs), cache.parent_hl_line_color, parent_line_width); -								prev_hl_ofs = root_pos.y + Math::floor(parent_line_width / 2); -							} else { +							prev_hl_ofs = root_pos.y + Math::floor(parent_line_width / 2); +						} else { +							if (htotal >= 0) {  								RenderingServer::get_singleton()->canvas_item_add_line(ci, root_pos, Point2i(parent_pos.x + Math::floor(line_width / 2), root_pos.y), cache.relationship_line_color, line_width); -								RenderingServer::get_singleton()->canvas_item_add_line(ci, Point2i(parent_pos.x, root_pos.y + Math::floor(line_width / 2)), Point2i(parent_pos.x, prev_ofs + Math::floor(line_width / 2)), cache.relationship_line_color, line_width);  							} +							RenderingServer::get_singleton()->canvas_item_add_line(ci, Point2i(parent_pos.x, root_pos.y + Math::floor(line_width / 2)), Point2i(parent_pos.x, prev_ofs + Math::floor(line_width / 2)), cache.relationship_line_color, line_width);  						}  					} - -					prev_ofs = root_pos.y + more_prev_ofs;  				} -				if (child_h < 0) { -					if (cache.draw_relationship_lines == 0) { -						return -1; // break, stop drawing, no need to anymore -					} +				prev_ofs = root_pos.y + more_prev_ofs; +			} -					htotal = -1; -					children_pos.y = cache.offset.y + p_draw_size.height; -				} else { -					htotal += child_h; -					children_pos.y += child_h; +			if (child_h < 0) { +				if (htotal == -1) { +					break; // Last loop done, stop.  				} + +				if (cache.draw_relationship_lines == 0) { +					return -1; // No need to draw anymore, full stop. +				} + +				htotal = -1; +				children_pos.y = cache.offset.y + p_draw_size.height; +			} else { +				htotal += child_h; +				children_pos.y += child_h;  			}  			c = c->next; diff --git a/scene/resources/environment.cpp b/scene/resources/environment.cpp index 78698835fc..d92d34437e 100644 --- a/scene/resources/environment.cpp +++ b/scene/resources/environment.cpp @@ -189,6 +189,7 @@ void Environment::_update_ambient_light() {  void Environment::set_tonemapper(ToneMapper p_tone_mapper) {  	tone_mapper = p_tone_mapper;  	_update_tonemap(); +	notify_property_list_changed();  }  Environment::ToneMapper Environment::get_tonemapper() const { @@ -1049,6 +1050,10 @@ void Environment::_validate_property(PropertyInfo &property) const {  		}  	} +	if (property.name == "tonemap_white" && tone_mapper == TONE_MAPPER_LINEAR) { +		property.usage = PROPERTY_USAGE_NO_EDITOR | PROPERTY_USAGE_INTERNAL; +	} +  	if (property.name == "glow_intensity" && glow_blend_mode == GLOW_BLEND_MODE_MIX) {  		property.usage = PROPERTY_USAGE_NO_EDITOR | PROPERTY_USAGE_INTERNAL;  	} @@ -1081,6 +1086,7 @@ void Environment::_validate_property(PropertyInfo &property) const {  		"auto_exposure_",  		"ssr_",  		"ssao_", +		"ssil_",  		"sdfgi_",  		"glow_",  		"adjustment_",  |