diff options
Diffstat (limited to 'editor/editor_node.cpp')
-rw-r--r-- | editor/editor_node.cpp | 50 |
1 files changed, 15 insertions, 35 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 6243ebc852..64665833df 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -2332,6 +2332,13 @@ void EditorNode::_run(bool p_current, const String &p_custom) { return; } + play_button->set_pressed(false); + play_button->set_icon(gui_base->get_theme_icon(SNAME("MainPlay"), SNAME("EditorIcons"))); + play_scene_button->set_pressed(false); + play_scene_button->set_icon(gui_base->get_theme_icon(SNAME("PlayScene"), SNAME("EditorIcons"))); + play_custom_scene_button->set_pressed(false); + play_custom_scene_button->set_icon(gui_base->get_theme_icon(SNAME("PlayCustom"), SNAME("EditorIcons"))); + String write_movie_file; if (write_movie_button->is_pressed()) { if (p_current && get_tree()->get_edited_scene_root() && get_tree()->get_edited_scene_root()->has_meta("movie_file")) { @@ -2346,13 +2353,6 @@ void EditorNode::_run(bool p_current, const String &p_custom) { } } - play_button->set_pressed(false); - play_button->set_icon(gui_base->get_theme_icon(SNAME("MainPlay"), SNAME("EditorIcons"))); - play_scene_button->set_pressed(false); - play_scene_button->set_icon(gui_base->get_theme_icon(SNAME("PlayScene"), SNAME("EditorIcons"))); - play_custom_scene_button->set_pressed(false); - play_custom_scene_button->set_icon(gui_base->get_theme_icon(SNAME("PlayCustom"), SNAME("EditorIcons"))); - String run_filename; if (p_current || (editor_data.get_edited_scene_root() && !p_custom.is_empty() && p_custom == editor_data.get_edited_scene_root()->get_scene_file_path())) { @@ -2792,9 +2792,6 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) { case RUN_SETTINGS: { project_settings_editor->popup_project_settings(); } break; - case RUN_WRITE_MOVIE: { - _update_write_movie_icon(); - } break; case FILE_INSTALL_ANDROID_SOURCE: { if (p_confirmed) { export_template_manager->install_android_template(); @@ -4046,10 +4043,8 @@ Ref<ImageTexture> EditorNode::_load_custom_class_icon(const String &p_path) cons Ref<Image> img = memnew(Image); Error err = ImageLoader::load_image(p_path, img); if (err == OK) { - Ref<ImageTexture> icon = memnew(ImageTexture); img->resize(16 * EDSCALE, 16 * EDSCALE, Image::INTERPOLATE_LANCZOS); - icon->create_from_image(img); - return icon; + return ImageTexture::create_from_image(img); } } return nullptr; @@ -4956,14 +4951,6 @@ String EditorNode::get_run_playing_scene() const { return run_filename; } -void EditorNode::_update_write_movie_icon() { - if (write_movie_button->is_pressed()) { - write_movie_button->set_icon(gui_base->get_theme_icon(SNAME("MainMovieWriteEnabled"), SNAME("EditorIcons"))); - } else { - write_movie_button->set_icon(gui_base->get_theme_icon(SNAME("MainMovieWrite"), SNAME("EditorIcons"))); - } -} - void EditorNode::_immediate_dialog_confirmed() { immediate_dialog_confirmed = true; } @@ -5404,9 +5391,7 @@ Variant EditorNode::drag_resource(const Ref<Resource> &p_res, Control *p_from) { Ref<Image> img = texture->get_image(); img = img->duplicate(); img->resize(48, 48); // meh - Ref<ImageTexture> resized_pic = Ref<ImageTexture>(memnew(ImageTexture)); - resized_pic->create_from_image(img); - preview = resized_pic; + preview = ImageTexture::create_from_image(img); } drag_preview->set_texture(preview); @@ -6732,15 +6717,12 @@ EditorNode::EditorNode() { write_movie_button->set_pressed(false); write_movie_button->set_icon(gui_base->get_theme_icon(SNAME("MainMovieWrite"), SNAME("EditorIcons"))); write_movie_button->set_focus_mode(Control::FOCUS_NONE); - write_movie_button->connect("pressed", callable_mp(this, &EditorNode::_menu_option), make_binds(RUN_WRITE_MOVIE)); write_movie_button->set_tooltip(TTR("Enable Movie Maker mode.\nThe project will run at stable FPS and the visual and audio output will be recorded to a video file.")); - // Restore these values to something more useful so it ignores the theme - write_movie_button->add_theme_color_override("icon_normal_color", Color(1, 1, 1, 0.4)); - write_movie_button->add_theme_color_override("icon_pressed_color", Color(1, 1, 1, 1)); - write_movie_button->add_theme_color_override("icon_hover_color", Color(1.2, 1.2, 1.2, 0.4)); - write_movie_button->add_theme_color_override("icon_hover_pressed_color", Color(1.2, 1.2, 1.2, 1)); - write_movie_button->add_theme_color_override("icon_focus_color", Color(1, 1, 1, 1)); - write_movie_button->add_theme_color_override("icon_disabled_color", Color(1, 1, 1, 0.4)); + + // This button behaves differently, so color it as such. + write_movie_button->add_theme_color_override("icon_normal_color", Color(1, 1, 1, 0.7)); + write_movie_button->add_theme_color_override("icon_pressed_color", gui_base->get_theme_color(SNAME("error_color"), SNAME("Editor"))); + write_movie_button->add_theme_color_override("icon_hover_color", Color(1, 1, 1, 0.9)); HBoxContainer *right_menu_hb = memnew(HBoxContainer); menu_hb->add_child(right_menu_hb); @@ -7070,12 +7052,10 @@ EditorNode::EditorNode() { ScriptTextEditor::register_editor(); // Register one for text scripts. TextEditor::register_editor(); - // Asset Library can't work on Web editor for now as most assets are sourced - // directly from GitHub which does not set CORS. if (AssetLibraryEditorPlugin::is_available()) { add_editor_plugin(memnew(AssetLibraryEditorPlugin)); } else { - WARN_PRINT("Asset Library not available, as it requires SSL to work."); + print_verbose("Asset Library not available (due to using Web editor, or SSL support disabled)."); } // Add interface before adding plugins. |