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-- | modules/mono/csharp_script.cpp | 11 | ||||
-rw-r--r-- | modules/mono/editor/godotsharp_editor.cpp | 4 | ||||
-rw-r--r-- | modules/mono/godotsharp_dirs.cpp | 9 | ||||
-rw-r--r-- | modules/mono/mono_gd/gd_mono.cpp | 7 | ||||
-rw-r--r-- | modules/opus/audio_stream_opus.cpp | 6 | ||||
-rw-r--r-- | modules/opus/audio_stream_opus.h | 2 | ||||
-rw-r--r-- | modules/vorbis/audio_stream_ogg_vorbis.cpp | 8 | ||||
-rw-r--r-- | modules/vorbis/audio_stream_ogg_vorbis.h | 2 | ||||
-rw-r--r-- | scene/resources/video_stream.h | 2 | ||||
-rw-r--r-- | servers/audio/audio_stream.cpp | 6 | ||||
-rw-r--r-- | servers/audio/audio_stream.h | 6 | ||||
-rw-r--r-- | servers/visual/visual_server_raster.h | 2 |
16 files changed, 77 insertions, 28 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/modules/mono/csharp_script.cpp b/modules/mono/csharp_script.cpp index 8d4e19469a..2e1cdf8d01 100644 --- a/modules/mono/csharp_script.cpp +++ b/modules/mono/csharp_script.cpp @@ -488,13 +488,17 @@ void CSharpLanguage::reload_assemblies_if_needed(bool p_soft_reload) { GDMonoAssembly *proj_assembly = gdmono->get_project_assembly(); + String name = ProjectSettings::get_singleton()->get("application/config/name"); + if (name.empty()) { + name = "UnnamedProject"; + } + if (proj_assembly) { String proj_asm_path = proj_assembly->get_path(); if (!FileAccess::exists(proj_assembly->get_path())) { // Maybe it wasn't loaded from the default path, so check this as well - String proj_asm_name = ProjectSettings::get_singleton()->get("application/config/name"); - proj_asm_path = GodotSharpDirs::get_res_temp_assemblies_dir().plus_file(proj_asm_name); + proj_asm_path = GodotSharpDirs::get_res_temp_assemblies_dir().plus_file(name); if (!FileAccess::exists(proj_asm_path)) return; // No assembly to load } @@ -502,8 +506,7 @@ void CSharpLanguage::reload_assemblies_if_needed(bool p_soft_reload) { if (FileAccess::get_modified_time(proj_asm_path) <= proj_assembly->get_modified_time()) return; // Already up to date } else { - String proj_asm_name = ProjectSettings::get_singleton()->get("application/config/name"); - if (!FileAccess::exists(GodotSharpDirs::get_res_temp_assemblies_dir().plus_file(proj_asm_name))) + if (!FileAccess::exists(GodotSharpDirs::get_res_temp_assemblies_dir().plus_file(name))) return; // No assembly to load } } diff --git a/modules/mono/editor/godotsharp_editor.cpp b/modules/mono/editor/godotsharp_editor.cpp index 30e7653256..ebfbdafeaf 100644 --- a/modules/mono/editor/godotsharp_editor.cpp +++ b/modules/mono/editor/godotsharp_editor.cpp @@ -71,6 +71,10 @@ bool GodotSharpEditor::_create_project_solution() { String path = OS::get_singleton()->get_resource_dir(); String name = ProjectSettings::get_singleton()->get("application/config/name"); + if (name.empty()) { + name = "UnnamedProject"; + } + String guid = CSharpProject::generate_game_project(path, name); if (guid.length()) { diff --git a/modules/mono/godotsharp_dirs.cpp b/modules/mono/godotsharp_dirs.cpp index 6bcf0e2355..7cc2168b70 100644 --- a/modules/mono/godotsharp_dirs.cpp +++ b/modules/mono/godotsharp_dirs.cpp @@ -122,7 +122,14 @@ private: #ifdef TOOLS_ENABLED mono_solutions_dir = mono_user_dir.plus_file("solutions"); build_logs_dir = mono_user_dir.plus_file("build_logs"); - String base_path = String("res://") + ProjectSettings::get_singleton()->get("application/config/name"); + + String name = ProjectSettings::get_singleton()->get("application/config/name"); + if (name.empty()) { + name = "UnnamedProject"; + } + + String base_path = String("res://") + name; + sln_filepath = ProjectSettings::get_singleton()->globalize_path(base_path + ".sln"); csproj_filepath = ProjectSettings::get_singleton()->globalize_path(base_path + ".csproj"); #endif diff --git a/modules/mono/mono_gd/gd_mono.cpp b/modules/mono/mono_gd/gd_mono.cpp index 4b5f5eb137..6d7cde95df 100644 --- a/modules/mono/mono_gd/gd_mono.cpp +++ b/modules/mono/mono_gd/gd_mono.cpp @@ -369,9 +369,12 @@ bool GDMono::_load_project_assembly() { if (project_assembly) return true; - String project_assembly_name = ProjectSettings::get_singleton()->get("application/config/name"); + String name = ProjectSettings::get_singleton()->get("application/config/name"); + if (name.empty()) { + name = "UnnamedProject"; + } - bool success = _load_assembly(project_assembly_name, &project_assembly); + bool success = _load_assembly(name, &project_assembly); if (success) mono_assembly_set_main(project_assembly->get_assembly()); diff --git a/modules/opus/audio_stream_opus.cpp b/modules/opus/audio_stream_opus.cpp index c7748b9b21..06eab4c94d 100644 --- a/modules/opus/audio_stream_opus.cpp +++ b/modules/opus/audio_stream_opus.cpp @@ -267,7 +267,7 @@ void AudioStreamPlaybackOpus::seek(float p_time) { frames_mixed = osrate * p_time; } -int AudioStreamPlaybackOpus::mix(int16_t *p_bufer, int p_frames) { +int AudioStreamPlaybackOpus::mix(int16_t *p_buffer, int p_frames) { if (!playing) return 0; @@ -281,7 +281,7 @@ int AudioStreamPlaybackOpus::mix(int16_t *p_bufer, int p_frames) { break; } - int ret = op_read(opus_file, (opus_int16 *)p_bufer, todo * stream_channels, ¤t_section); + int ret = op_read(opus_file, (opus_int16 *)p_buffer, todo * stream_channels, ¤t_section); if (ret < 0) { playing = false; ERR_EXPLAIN("Error reading Opus File: " + file); @@ -325,7 +325,7 @@ int AudioStreamPlaybackOpus::mix(int16_t *p_bufer, int p_frames) { frames_mixed += ret; - p_bufer += ret * stream_channels; + p_buffer += ret * stream_channels; p_frames -= ret; } diff --git a/modules/opus/audio_stream_opus.h b/modules/opus/audio_stream_opus.h index 7b7740a804..f8d8f585cf 100644 --- a/modules/opus/audio_stream_opus.h +++ b/modules/opus/audio_stream_opus.h @@ -107,7 +107,7 @@ public: virtual int get_minimum_buffer_size() const; - virtual int mix(int16_t *p_bufer, int p_frames); + virtual int mix(int16_t *p_buffer, int p_frames); AudioStreamPlaybackOpus(); ~AudioStreamPlaybackOpus(); diff --git a/modules/vorbis/audio_stream_ogg_vorbis.cpp b/modules/vorbis/audio_stream_ogg_vorbis.cpp index 0afb889199..6235799fc2 100644 --- a/modules/vorbis/audio_stream_ogg_vorbis.cpp +++ b/modules/vorbis/audio_stream_ogg_vorbis.cpp @@ -92,7 +92,7 @@ long AudioStreamPlaybackOGGVorbis::_ov_tell_func(void *_f) { return fa->get_position(); } -int AudioStreamPlaybackOGGVorbis::mix(int16_t *p_bufer, int p_frames) { +int AudioStreamPlaybackOGGVorbis::mix(int16_t *p_buffer, int p_frames) { if (!playing) return 0; @@ -109,9 +109,9 @@ int AudioStreamPlaybackOGGVorbis::mix(int16_t *p_bufer, int p_frames) { //printf("to mix %i - mix me %i bytes\n",to_mix,to_mix*stream_channels*sizeof(int16_t)); #ifdef BIG_ENDIAN_ENABLED - long ret = ov_read(&vf, (char *)p_bufer, todo * stream_channels * sizeof(int16_t), 1, 2, 1, ¤t_section); + long ret = ov_read(&vf, (char *)p_buffer, todo * stream_channels * sizeof(int16_t), 1, 2, 1, ¤t_section); #else - long ret = ov_read(&vf, (char *)p_bufer, todo * stream_channels * sizeof(int16_t), 0, 2, 1, ¤t_section); + long ret = ov_read(&vf, (char *)p_buffer, todo * stream_channels * sizeof(int16_t), 0, 2, 1, ¤t_section); #endif if (ret < 0) { @@ -162,7 +162,7 @@ int AudioStreamPlaybackOGGVorbis::mix(int16_t *p_bufer, int p_frames) { frames_mixed += ret; - p_bufer += ret * stream_channels; + p_buffer += ret * stream_channels; p_frames -= ret; } diff --git a/modules/vorbis/audio_stream_ogg_vorbis.h b/modules/vorbis/audio_stream_ogg_vorbis.h index 929b2651e9..79eadec56e 100644 --- a/modules/vorbis/audio_stream_ogg_vorbis.h +++ b/modules/vorbis/audio_stream_ogg_vorbis.h @@ -103,7 +103,7 @@ public: virtual int get_mix_rate() const { return stream_srate; } virtual int get_minimum_buffer_size() const { return 0; } - virtual int mix(int16_t *p_bufer, int p_frames); + virtual int mix(int16_t *p_buffer, int p_frames); AudioStreamPlaybackOGGVorbis(); ~AudioStreamPlaybackOGGVorbis(); diff --git a/scene/resources/video_stream.h b/scene/resources/video_stream.h index 0f07233185..3f79858056 100644 --- a/scene/resources/video_stream.h +++ b/scene/resources/video_stream.h @@ -60,7 +60,7 @@ public: virtual void set_audio_track(int p_idx) = 0; - //virtual int mix(int16_t* p_bufer,int p_frames)=0; + //virtual int mix(int16_t* p_buffer,int p_frames)=0; virtual Ref<Texture> get_texture() = 0; virtual void update(float p_delta) = 0; diff --git a/servers/audio/audio_stream.cpp b/servers/audio/audio_stream.cpp index 0e3d5824d9..d7b2c2c5e0 100644 --- a/servers/audio/audio_stream.cpp +++ b/servers/audio/audio_stream.cpp @@ -191,12 +191,12 @@ void AudioStreamPlaybackRandomPitch::seek(float p_time) { } } -void AudioStreamPlaybackRandomPitch::mix(AudioFrame *p_bufer, float p_rate_scale, int p_frames) { +void AudioStreamPlaybackRandomPitch::mix(AudioFrame *p_buffer, float p_rate_scale, int p_frames) { if (playing.is_valid()) { - playing->mix(p_bufer, p_rate_scale * pitch_scale, p_frames); + playing->mix(p_buffer, p_rate_scale * pitch_scale, p_frames); } else { for (int i = 0; i < p_frames; i++) { - p_bufer[i] = AudioFrame(0, 0); + p_buffer[i] = AudioFrame(0, 0); } } } diff --git a/servers/audio/audio_stream.h b/servers/audio/audio_stream.h index 3324597b41..dc931502b4 100644 --- a/servers/audio/audio_stream.h +++ b/servers/audio/audio_stream.h @@ -48,7 +48,7 @@ public: virtual float get_playback_position() const = 0; virtual void seek(float p_time) = 0; - virtual void mix(AudioFrame *p_bufer, float p_rate_scale, int p_frames) = 0; + virtual void mix(AudioFrame *p_buffer, float p_rate_scale, int p_frames) = 0; virtual float get_length() const = 0; //if supported, otherwise return 0 }; @@ -70,7 +70,7 @@ class AudioStreamPlaybackResampled : public AudioStreamPlayback { protected: void _begin_resample(); - virtual void _mix_internal(AudioFrame *p_bufer, int p_frames) = 0; + virtual void _mix_internal(AudioFrame *p_buffer, int p_frames) = 0; virtual float get_stream_sampling_rate() = 0; public: @@ -136,7 +136,7 @@ public: virtual float get_playback_position() const; virtual void seek(float p_time); - virtual void mix(AudioFrame *p_bufer, float p_rate_scale, int p_frames); + virtual void mix(AudioFrame *p_buffer, float p_rate_scale, int p_frames); virtual float get_length() const; //if supported, otherwise return 0 diff --git a/servers/visual/visual_server_raster.h b/servers/visual/visual_server_raster.h index 302f13ee4f..425381550e 100644 --- a/servers/visual/visual_server_raster.h +++ b/servers/visual/visual_server_raster.h @@ -281,7 +281,7 @@ class VisualServerRaster : public VisualServer { Set<Instance*> owned_instances; BakedLightSampler *sampler; int resolution; - Vector<Color> light_bufer; + Vector<Color> light_buffer; RID sampled_light; uint64_t last_pass; Transform xform; // viewspace normal to lightspace, might not use one. |