diff options
Diffstat (limited to 'editor')
-rw-r--r-- | editor/plugins/spatial_editor_plugin.cpp | 6 | ||||
-rw-r--r-- | editor/script_create_dialog.cpp | 9 | ||||
-rw-r--r-- | editor/spatial_editor_gizmos.cpp | 12 |
3 files changed, 17 insertions, 10 deletions
diff --git a/editor/plugins/spatial_editor_plugin.cpp b/editor/plugins/spatial_editor_plugin.cpp index bc5c700959..d2e60ef9ce 100644 --- a/editor/plugins/spatial_editor_plugin.cpp +++ b/editor/plugins/spatial_editor_plugin.cpp @@ -3505,7 +3505,7 @@ void SpatialEditor::_init_indicators() { gizmo_hl = Ref<SpatialMaterial>(memnew(SpatialMaterial)); gizmo_hl->set_flag(SpatialMaterial::FLAG_UNSHADED, true); - gizmo_hl->set_flag(SpatialMaterial::FLAG_ONTOP, true); + gizmo_hl->set_on_top_of_alpha(); gizmo_hl->set_feature(SpatialMaterial::FEATURE_TRANSPARENT, true); gizmo_hl->set_albedo(Color(1, 1, 1, gizmo_alph + 0.2f)); gizmo_hl->set_cull_mode(SpatialMaterial::CULL_DISABLED); @@ -3518,7 +3518,7 @@ void SpatialEditor::_init_indicators() { Ref<SpatialMaterial> mat = memnew(SpatialMaterial); mat->set_flag(SpatialMaterial::FLAG_UNSHADED, true); - mat->set_flag(SpatialMaterial::FLAG_ONTOP, true); + mat->set_on_top_of_alpha(); mat->set_feature(SpatialMaterial::FEATURE_TRANSPARENT, true); Color col; col[i] = 1.0; @@ -3613,7 +3613,7 @@ void SpatialEditor::_init_indicators() { Ref<SpatialMaterial> plane_mat = memnew(SpatialMaterial); plane_mat->set_flag(SpatialMaterial::FLAG_UNSHADED, true); - plane_mat->set_flag(SpatialMaterial::FLAG_ONTOP, true); + plane_mat->set_on_top_of_alpha(); plane_mat->set_feature(SpatialMaterial::FEATURE_TRANSPARENT, true); plane_mat->set_cull_mode(SpatialMaterial::CULL_DISABLED); Color col; diff --git a/editor/script_create_dialog.cpp b/editor/script_create_dialog.cpp index d0e2e0c240..089c054b59 100644 --- a/editor/script_create_dialog.cpp +++ b/editor/script_create_dialog.cpp @@ -352,9 +352,16 @@ void ScriptCreateDialog::_path_changed(const String &p_path) { /* Does file already exist */ DirAccess *f = DirAccess::create(DirAccess::ACCESS_RESOURCES); - if (f->file_exists(p) && !(f->current_is_dir())) { + if (f->dir_exists(p)) { + is_new_script_created = false; + is_path_valid = false; + _msg_path_valid(false, TTR("Directory of the same name exists")); + } else if (f->file_exists(p)) { is_new_script_created = false; is_path_valid = true; + _msg_path_valid(true, TTR("File exists, will be reused")); + } else { + path_error_label->set_text(""); } memdelete(f); _update_dialog(); diff --git a/editor/spatial_editor_gizmos.cpp b/editor/spatial_editor_gizmos.cpp index c127b9a2f1..9c7ea506aa 100644 --- a/editor/spatial_editor_gizmos.cpp +++ b/editor/spatial_editor_gizmos.cpp @@ -580,7 +580,7 @@ Ref<SpatialMaterial> EditorSpatialGizmo::create_material(const String &p_name, c } if (p_on_top && is_selected()) { - line_material->set_flag(SpatialMaterial::FLAG_ONTOP, true); + line_material->set_on_top_of_alpha(); } line_material->set_albedo(color); @@ -624,7 +624,7 @@ Ref<SpatialMaterial> EditorSpatialGizmo::create_icon_material(const String &p_na icon->set_billboard_mode(SpatialMaterial::BILLBOARD_ENABLED); if (p_on_top && is_selected()) { - icon->set_flag(SpatialMaterial::FLAG_ONTOP, true); + icon->set_on_top_of_alpha(); } SpatialEditorGizmos::singleton->material_cache[name] = icon; @@ -3411,7 +3411,7 @@ SpatialEditorGizmos::SpatialEditorGizmos() { handle_material = Ref<SpatialMaterial>(memnew(SpatialMaterial)); handle_material->set_flag(SpatialMaterial::FLAG_UNSHADED, true); - handle_material->set_flag(SpatialMaterial::FLAG_ONTOP, true); + handle_material->set_on_top_of_alpha(); handle_material->set_albedo(Color(0.8, 0.8, 0.8)); handle_material_billboard = handle_material->duplicate(); handle_material_billboard->set_billboard_mode(SpatialMaterial::BILLBOARD_ENABLED); @@ -3426,11 +3426,11 @@ SpatialEditorGizmos::SpatialEditorGizmos() { handle2_material->set_feature(SpatialMaterial::FEATURE_TRANSPARENT, true); handle2_material->set_flag(SpatialMaterial::FLAG_ALBEDO_FROM_VERTEX_COLOR, true); handle2_material->set_flag(SpatialMaterial::FLAG_SRGB_VERTEX_COLOR, true); - handle2_material->set_flag(SpatialMaterial::FLAG_ONTOP, true); + handle2_material->set_on_top_of_alpha(); handle2_material_billboard = handle2_material->duplicate(); handle2_material_billboard->set_billboard_mode(SpatialMaterial::BILLBOARD_ENABLED); handle2_material_billboard->set_billboard_mode(SpatialMaterial::BILLBOARD_ENABLED); - handle2_material_billboard->set_flag(SpatialMaterial::FLAG_ONTOP, true); + handle2_material_billboard->set_on_top_of_alpha(); EDITOR_DEF("editors/3d_gizmos/gizmo_colors/light", Color(1, 1, 0.2)); EDITOR_DEF("editors/3d_gizmos/gizmo_colors/stream_player_3d", Color(0.4, 0.8, 1)); @@ -3490,7 +3490,7 @@ SpatialEditorGizmos::SpatialEditorGizmos() { skeleton_material = create_line_material(Color(0.6, 1.0, 0.3)); skeleton_material->set_cull_mode(SpatialMaterial::CULL_DISABLED); skeleton_material->set_flag(SpatialMaterial::FLAG_UNSHADED, true); - skeleton_material->set_flag(SpatialMaterial::FLAG_ONTOP, true); + skeleton_material->set_on_top_of_alpha(); skeleton_material->set_depth_draw_mode(SpatialMaterial::DEPTH_DRAW_DISABLED); //position 3D Shared mesh |