diff options
-rw-r--r-- | editor/plugins/sprite_frames_editor_plugin.cpp | 19 | ||||
-rw-r--r-- | editor/plugins/sprite_frames_editor_plugin.h | 2 | ||||
-rw-r--r-- | editor/project_settings_editor.cpp | 18 | ||||
-rw-r--r-- | editor/project_settings_editor.h | 1 | ||||
-rw-r--r-- | platform/windows/detect.py | 5 |
5 files changed, 37 insertions, 8 deletions
diff --git a/editor/plugins/sprite_frames_editor_plugin.cpp b/editor/plugins/sprite_frames_editor_plugin.cpp index dc7acd9fdc..b8274122f8 100644 --- a/editor/plugins/sprite_frames_editor_plugin.cpp +++ b/editor/plugins/sprite_frames_editor_plugin.cpp @@ -142,6 +142,19 @@ void SpriteFramesEditor::_paste_pressed() { undo_redo->commit_action(); } +void SpriteFramesEditor::_copy_pressed() { + ERR_FAIL_COND(!frames->has_animation(edited_anim)); + + if (tree->get_current() < 0) + return; + Ref<Texture> r = frames->get_frame(edited_anim, tree->get_current()); + if (!r.is_valid()) { + return; + } + + EditorSettings::get_singleton()->set_resource_clipboard(r); +} + void SpriteFramesEditor::_empty_pressed() { ERR_FAIL_COND(!frames->has_animation(edited_anim)); @@ -642,6 +655,7 @@ void SpriteFramesEditor::_bind_methods() { ClassDB::bind_method(D_METHOD("_empty_pressed"), &SpriteFramesEditor::_empty_pressed); ClassDB::bind_method(D_METHOD("_empty2_pressed"), &SpriteFramesEditor::_empty2_pressed); ClassDB::bind_method(D_METHOD("_delete_pressed"), &SpriteFramesEditor::_delete_pressed); + ClassDB::bind_method(D_METHOD("_copy_pressed"), &SpriteFramesEditor::_copy_pressed); ClassDB::bind_method(D_METHOD("_paste_pressed"), &SpriteFramesEditor::_paste_pressed); ClassDB::bind_method(D_METHOD("_file_load_request", "files", "at_position"), &SpriteFramesEditor::_file_load_request, DEFVAL(-1)); ClassDB::bind_method(D_METHOD("_update_library", "skipsel"), &SpriteFramesEditor::_update_library, DEFVAL(false)); @@ -725,6 +739,10 @@ SpriteFramesEditor::SpriteFramesEditor() { load->set_tooltip(TTR("Load Resource")); hbc->add_child(load); + copy = memnew(Button); + copy->set_text(TTR("Copy")); + hbc->add_child(copy); + paste = memnew(Button); paste->set_text(TTR("Paste")); hbc->add_child(paste); @@ -772,6 +790,7 @@ SpriteFramesEditor::SpriteFramesEditor() { load->connect("pressed", this, "_load_pressed"); _delete->connect("pressed", this, "_delete_pressed"); + copy->connect("pressed", this, "_copy_pressed"); paste->connect("pressed", this, "_paste_pressed"); empty->connect("pressed", this, "_empty_pressed"); empty2->connect("pressed", this, "_empty2_pressed"); diff --git a/editor/plugins/sprite_frames_editor_plugin.h b/editor/plugins/sprite_frames_editor_plugin.h index 0d1ab9fd8c..9fdab37f0e 100644 --- a/editor/plugins/sprite_frames_editor_plugin.h +++ b/editor/plugins/sprite_frames_editor_plugin.h @@ -44,6 +44,7 @@ class SpriteFramesEditor : public PanelContainer { Button *load; Button *_delete; + Button *copy; Button *paste; Button *empty; Button *empty2; @@ -72,6 +73,7 @@ class SpriteFramesEditor : public PanelContainer { void _load_pressed(); void _load_scene_pressed(); void _file_load_request(const PoolVector<String> &p_path, int p_at_pos = -1); + void _copy_pressed(); void _paste_pressed(); void _empty_pressed(); void _empty2_pressed(); diff --git a/editor/project_settings_editor.cpp b/editor/project_settings_editor.cpp index 1284788425..3f79d00f80 100644 --- a/editor/project_settings_editor.cpp +++ b/editor/project_settings_editor.cpp @@ -81,6 +81,8 @@ void ProjectSettingsEditor::_notification(int p_what) { search_button->set_icon(get_icon("Search", "EditorIcons")); clear_button->set_icon(get_icon("Close", "EditorIcons")); + action_add_error->add_color_override("font_color", get_color("error_color", "Editor")); + translation_list->connect("button_pressed", this, "_translation_delete"); _update_actions(); popup_add->add_icon_item(get_icon("Keyboard", "EditorIcons"), TTR("Key "), INPUT_KEY); //"Key " - because the word 'key' has already been used as a key animation @@ -819,12 +821,16 @@ void ProjectSettingsEditor::_action_check(String p_action) { } else { if (p_action.find("/") != -1 || p_action.find(":") != -1) { - action_add->set_text(TTR("Can't contain '/' or ':'")); + + action_add_error->set_text(TTR("Can't contain '/' or ':'")); + action_add_error->show(); action_add->set_disabled(true); return; } if (ProjectSettings::get_singleton()->has_setting("input/" + p_action)) { - action_add->set_text(TTR("Already existing")); + + action_add_error->set_text(TTR("Already existing")); + action_add_error->show(); action_add->set_disabled(true); return; } @@ -832,7 +838,7 @@ void ProjectSettingsEditor::_action_check(String p_action) { action_add->set_disabled(false); } - action_add->set_text(TTR("Add")); + action_add_error->hide(); } void ProjectSettingsEditor::_action_adds(String) { @@ -869,7 +875,7 @@ void ProjectSettingsEditor::_action_add() { return; r->select(0); input_editor->ensure_cursor_is_visible(); - action_add->set_text(TTR("Add")); + action_add_error->hide(); } void ProjectSettingsEditor::_item_checked(const String &p_item, bool p_check) { @@ -1696,6 +1702,10 @@ ProjectSettingsEditor::ProjectSettingsEditor(EditorData *p_data) { action_name->connect("text_entered", this, "_action_adds"); action_name->connect("text_changed", this, "_action_check"); + action_add_error = memnew(Label); + hbc->add_child(action_add_error); + action_add_error->hide(); + add = memnew(Button); hbc->add_child(add); add->set_custom_minimum_size(Size2(150, 0) * EDSCALE); diff --git a/editor/project_settings_editor.h b/editor/project_settings_editor.h index a86cfee813..dbca158133 100644 --- a/editor/project_settings_editor.h +++ b/editor/project_settings_editor.h @@ -86,6 +86,7 @@ class ProjectSettingsEditor : public AcceptDialog { LineEdit *action_name; Button *action_add; + Label *action_add_error; Tree *input_editor; bool setting; bool updating_translations; diff --git a/platform/windows/detect.py b/platform/windows/detect.py index cd4230acd4..bac5df5668 100644 --- a/platform/windows/detect.py +++ b/platform/windows/detect.py @@ -264,10 +264,7 @@ def configure(env): if env['use_lto']: env.Append(CCFLAGS=['-flto']) - if not env['use_llvm'] and env.GetOption("num_jobs") > 1: - env.Append(LINKFLAGS=['-flto=' + str(env.GetOption("num_jobs"))]) - else: - env.Append(LINKFLAGS=['-flto']) + env.Append(LINKFLAGS=['-flto=' + str(env.GetOption("num_jobs"))]) ## Compile flags |