diff options
Diffstat (limited to 'scene/main')
-rwxr-xr-x | scene/main/node.cpp | 3 | ||||
-rw-r--r-- | scene/main/scene_tree.cpp | 41 | ||||
-rw-r--r-- | scene/main/viewport.cpp | 7 |
3 files changed, 26 insertions, 25 deletions
diff --git a/scene/main/node.cpp b/scene/main/node.cpp index 0d872d906e..0474c6fd26 100755 --- a/scene/main/node.cpp +++ b/scene/main/node.cpp @@ -1301,8 +1301,9 @@ String Node::_generate_serial_child_name(Node *p_child) { } } + int num_places = nums.length(); for (;;) { - String attempt = (name + (num > 0 || explicit_zero ? nnsep + itos(num) : "")).strip_edges(); + String attempt = (name + (num > 0 || explicit_zero ? nnsep + itos(num).pad_zeros(num_places) : "")).strip_edges(); bool found = false; for (int i = 0; i < data.children.size(); i++) { if (data.children[i] == p_child) diff --git a/scene/main/scene_tree.cpp b/scene/main/scene_tree.cpp index 067bcbff3e..66eafa1070 100644 --- a/scene/main/scene_tree.cpp +++ b/scene/main/scene_tree.cpp @@ -801,11 +801,11 @@ Ref<Material> SceneTree::get_debug_navigation_material() { return navigation_material; Ref<SpatialMaterial> line_material = Ref<SpatialMaterial>(memnew(SpatialMaterial)); - /* line_material->set_flag(Material::FLAG_UNSHADED, true); - line_material->set_line_width(3.0); - line_material->set_fixed_flag(SpatialMaterial::FLAG_USE_ALPHA, true); - line_material->set_fixed_flag(SpatialMaterial::FLAG_USE_COLOR_ARRAY, true); - line_material->set_parameter(SpatialMaterial::PARAM_DIFFUSE,get_debug_navigation_color());*/ + line_material->set_flag(SpatialMaterial::FLAG_UNSHADED, true); + line_material->set_feature(SpatialMaterial::FEATURE_TRANSPARENT, true); + line_material->set_flag(SpatialMaterial::FLAG_SRGB_VERTEX_COLOR, true); + line_material->set_flag(SpatialMaterial::FLAG_ALBEDO_FROM_VERTEX_COLOR, true); + line_material->set_albedo(get_debug_navigation_color()); navigation_material = line_material; @@ -818,11 +818,11 @@ Ref<Material> SceneTree::get_debug_navigation_disabled_material() { return navigation_disabled_material; Ref<SpatialMaterial> line_material = Ref<SpatialMaterial>(memnew(SpatialMaterial)); - /* line_material->set_flag(Material::FLAG_UNSHADED, true); - line_material->set_line_width(3.0); - line_material->set_fixed_flag(SpatialMaterial::FLAG_USE_ALPHA, true); - line_material->set_fixed_flag(SpatialMaterial::FLAG_USE_COLOR_ARRAY, true); - line_material->set_parameter(SpatialMaterial::PARAM_DIFFUSE,get_debug_navigation_disabled_color());*/ + line_material->set_flag(SpatialMaterial::FLAG_UNSHADED, true); + line_material->set_feature(SpatialMaterial::FEATURE_TRANSPARENT, true); + line_material->set_flag(SpatialMaterial::FLAG_SRGB_VERTEX_COLOR, true); + line_material->set_flag(SpatialMaterial::FLAG_ALBEDO_FROM_VERTEX_COLOR, true); + line_material->set_albedo(get_debug_navigation_disabled_color()); navigation_disabled_material = line_material; @@ -834,11 +834,11 @@ Ref<Material> SceneTree::get_debug_collision_material() { return collision_material; Ref<SpatialMaterial> line_material = Ref<SpatialMaterial>(memnew(SpatialMaterial)); - /*line_material->set_flag(Material::FLAG_UNSHADED, true); - line_material->set_line_width(3.0); - line_material->set_fixed_flag(SpatialMaterial::FLAG_USE_ALPHA, true); - line_material->set_fixed_flag(SpatialMaterial::FLAG_USE_COLOR_ARRAY, true); - line_material->set_parameter(SpatialMaterial::PARAM_DIFFUSE,get_debug_collisions_color());*/ + line_material->set_flag(SpatialMaterial::FLAG_UNSHADED, true); + line_material->set_feature(SpatialMaterial::FEATURE_TRANSPARENT, true); + line_material->set_flag(SpatialMaterial::FLAG_SRGB_VERTEX_COLOR, true); + line_material->set_flag(SpatialMaterial::FLAG_ALBEDO_FROM_VERTEX_COLOR, true); + line_material->set_albedo(get_debug_collisions_color()); collision_material = line_material; @@ -852,11 +852,12 @@ Ref<ArrayMesh> SceneTree::get_debug_contact_mesh() { debug_contact_mesh = Ref<ArrayMesh>(memnew(ArrayMesh)); - Ref<SpatialMaterial> mat = memnew(SpatialMaterial); - /*mat->set_flag(Material::FLAG_UNSHADED,true); - mat->set_flag(Material::FLAG_DOUBLE_SIDED,true); - mat->set_fixed_flag(SpatialMaterial::FLAG_USE_ALPHA,true); - mat->set_parameter(SpatialMaterial::PARAM_DIFFUSE,get_debug_collision_contact_color());*/ + Ref<SpatialMaterial> mat = Ref<SpatialMaterial>(memnew(SpatialMaterial)); + mat->set_flag(SpatialMaterial::FLAG_UNSHADED, true); + mat->set_feature(SpatialMaterial::FEATURE_TRANSPARENT, true); + mat->set_flag(SpatialMaterial::FLAG_SRGB_VERTEX_COLOR, true); + mat->set_flag(SpatialMaterial::FLAG_ALBEDO_FROM_VERTEX_COLOR, true); + mat->set_albedo(get_debug_collision_contact_color()); Vector3 diamond[6] = { Vector3(-1, 0, 0), diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index 717e76c5fd..a22d897669 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -1473,8 +1473,8 @@ void Viewport::_gui_show_tooltip() { gui.tooltip_label->set_anchor_and_margin(MARGIN_LEFT, Control::ANCHOR_BEGIN, ttp->get_margin(MARGIN_LEFT)); gui.tooltip_label->set_anchor_and_margin(MARGIN_TOP, Control::ANCHOR_BEGIN, ttp->get_margin(MARGIN_TOP)); - gui.tooltip_label->set_anchor_and_margin(MARGIN_RIGHT, Control::ANCHOR_END, ttp->get_margin(MARGIN_RIGHT)); - gui.tooltip_label->set_anchor_and_margin(MARGIN_BOTTOM, Control::ANCHOR_END, ttp->get_margin(MARGIN_BOTTOM)); + gui.tooltip_label->set_anchor_and_margin(MARGIN_RIGHT, Control::ANCHOR_END, -ttp->get_margin(MARGIN_RIGHT)); + gui.tooltip_label->set_anchor_and_margin(MARGIN_BOTTOM, Control::ANCHOR_END, -ttp->get_margin(MARGIN_BOTTOM)); gui.tooltip_label->set_text(tooltip); Rect2 r(gui.tooltip_pos + Point2(10, 10), gui.tooltip_label->get_combined_minimum_size() + ttp->get_minimum_size()); Rect2 vr = gui.tooltip_label->get_viewport_rect(); @@ -1932,8 +1932,7 @@ void Viewport::_gui_input_event(Ref<InputEvent> p_event) { Control *top = gui.modal_stack.back()->get(); if (over != top && !top->is_a_parent_of(over)) { - - return; // don't send motion event to anything below modal stack top + over = NULL; //nothing can be found outside the modal stack } } |