diff options
Diffstat (limited to 'editor')
374 files changed, 12854 insertions, 10637 deletions
diff --git a/editor/SCsub b/editor/SCsub index e54383350e..13ae85bbf0 100644 --- a/editor/SCsub +++ b/editor/SCsub @@ -1,43 +1,42 @@ #!/usr/bin/env python -Import('env') +Import("env") env.editor_sources = [] import os import os.path from platform_methods import run_in_subprocess -from compat import open_utf8 import editor_builders def _make_doc_data_class_path(to_path): # NOTE: It is safe to generate this file here, since this is still executed serially - g = open_utf8(os.path.join(to_path, "doc_data_class_path.gen.h"), "w") + g = open(os.path.join(to_path, "doc_data_class_path.gen.h"), "w", encoding="utf-8") g.write("static const int _doc_data_class_path_count = " + str(len(env.doc_class_path)) + ";\n") g.write("struct _DocDataClassPath { const char* name; const char* path; };\n") - g.write("static const _DocDataClassPath _doc_data_class_paths[" + str(len(env.doc_class_path) + 1) + "] = {\n"); + g.write("static const _DocDataClassPath _doc_data_class_paths[" + str(len(env.doc_class_path) + 1) + "] = {\n") for c in sorted(env.doc_class_path): - g.write("\t{\"" + c + "\", \"" + env.doc_class_path[c] + "\"},\n") - g.write("\t{NULL, NULL}\n") + g.write('\t{"' + c + '", "' + env.doc_class_path[c] + '"},\n') + g.write("\t{nullptr, nullptr}\n") g.write("};\n") g.close() -if env['tools']: +if env["tools"]: # Register exporters reg_exporters_inc = '#include "register_exporters.h"\n' - reg_exporters = 'void register_exporters() {\n' + reg_exporters = "void register_exporters() {\n" for e in env.platform_exporters: env.add_source_files(env.editor_sources, "#platform/" + e + "/export/export.cpp") - reg_exporters += '\tregister_' + e + '_exporter();\n' + reg_exporters += "\tregister_" + e + "_exporter();\n" reg_exporters_inc += '#include "platform/' + e + '/export/export.h"\n' - reg_exporters += '}\n' + reg_exporters += "}\n" # NOTE: It is safe to generate this file here, since this is still executed serially - with open_utf8("register_exporters.gen.cpp", "w") as f: + with open("register_exporters.gen.cpp", "w", encoding="utf-8") as f: f.write(reg_exporters_inc) f.write(reg_exporters) @@ -51,12 +50,12 @@ if env['tools']: for d in doc_dirs: try: - for f in os.listdir(os.path.join(env.Dir('#').abspath, d)): + for f in os.listdir(os.path.join(env.Dir("#").abspath, d)): docs.append("#" + os.path.join(d, f)) except OSError: pass - _make_doc_data_class_path(os.path.join(env.Dir('#').abspath, "editor/doc")) + _make_doc_data_class_path(os.path.join(env.Dir("#").abspath, "editor")) docs = sorted(docs) env.Depends("#editor/doc_data_compressed.gen.h", docs) @@ -64,34 +63,36 @@ if env['tools']: import glob - path = env.Dir('.').abspath + path = env.Dir(".").abspath # Editor translations tlist = glob.glob(path + "/translations/*.po") - env.Depends('#editor/editor_translations.gen.h', tlist) - env.CommandNoCache('#editor/editor_translations.gen.h', tlist, run_in_subprocess(editor_builders.make_editor_translations_header)) + env.Depends("#editor/editor_translations.gen.h", tlist) + env.CommandNoCache( + "#editor/editor_translations.gen.h", tlist, run_in_subprocess(editor_builders.make_editor_translations_header) + ) # Documentation translations tlist = glob.glob(env.Dir("#doc").abspath + "/translations/*.po") - env.Depends('#editor/doc_translations.gen.h', tlist) - env.CommandNoCache('#editor/doc_translations.gen.h', tlist, run_in_subprocess(editor_builders.make_doc_translations_header)) + env.Depends("#editor/doc_translations.gen.h", tlist) + env.CommandNoCache( + "#editor/doc_translations.gen.h", tlist, run_in_subprocess(editor_builders.make_doc_translations_header) + ) # Fonts flist = glob.glob(path + "/../thirdparty/fonts/*.ttf") flist.extend(glob.glob(path + "/../thirdparty/fonts/*.otf")) flist.sort() - env.Depends('#editor/builtin_fonts.gen.h', flist) - env.CommandNoCache('#editor/builtin_fonts.gen.h', flist, run_in_subprocess(editor_builders.make_fonts_header)) + env.Depends("#editor/builtin_fonts.gen.h", flist) + env.CommandNoCache("#editor/builtin_fonts.gen.h", flist, run_in_subprocess(editor_builders.make_fonts_header)) env.add_source_files(env.editor_sources, "*.cpp") - SConscript('collada/SCsub') - SConscript('doc/SCsub') - SConscript('debugger/SCsub') - SConscript('fileserver/SCsub') - SConscript('icons/SCsub') - SConscript('import/SCsub') - SConscript('plugins/SCsub') + SConscript("debugger/SCsub") + SConscript("fileserver/SCsub") + SConscript("icons/SCsub") + SConscript("import/SCsub") + SConscript("plugins/SCsub") lib = env.add_library("editor", env.editor_sources) env.Prepend(LIBS=[lib]) diff --git a/editor/animation_bezier_editor.cpp b/editor/animation_bezier_editor.cpp index 6dcc9dd8ae..e6a020bf41 100644 --- a/editor/animation_bezier_editor.cpp +++ b/editor/animation_bezier_editor.cpp @@ -215,20 +215,20 @@ void AnimationBezierTrackEdit::_draw_line_clipped(const Vector2 &p_from, const V void AnimationBezierTrackEdit::_notification(int p_what) { if (p_what == NOTIFICATION_THEME_CHANGED || p_what == NOTIFICATION_ENTER_TREE) { - bezier_icon = get_icon("KeyBezierPoint", "EditorIcons"); - bezier_handle_icon = get_icon("KeyBezierHandle", "EditorIcons"); - selected_icon = get_icon("KeyBezierSelected", "EditorIcons"); + bezier_icon = get_theme_icon("KeyBezierPoint", "EditorIcons"); + bezier_handle_icon = get_theme_icon("KeyBezierHandle", "EditorIcons"); + selected_icon = get_theme_icon("KeyBezierSelected", "EditorIcons"); if (handle_mode_option->get_item_count() == 0) { - handle_mode_option->add_icon_item(get_icon("BezierHandlesFree", "EditorIcons"), TTR("Free"), HANDLE_MODE_FREE); - handle_mode_option->add_icon_item(get_icon("BezierHandlesBalanced", "EditorIcons"), TTR("Balanced"), HANDLE_MODE_BALANCED); - handle_mode_option->add_icon_item(get_icon("BezierHandlesMirror", "EditorIcons"), TTR("Mirror"), HANDLE_MODE_MIRROR); + handle_mode_option->add_icon_item(get_theme_icon("BezierHandlesFree", "EditorIcons"), TTR("Free"), HANDLE_MODE_FREE); + handle_mode_option->add_icon_item(get_theme_icon("BezierHandlesBalanced", "EditorIcons"), TTR("Balanced"), HANDLE_MODE_BALANCED); + handle_mode_option->add_icon_item(get_theme_icon("BezierHandlesMirror", "EditorIcons"), TTR("Mirror"), HANDLE_MODE_MIRROR); } } if (p_what == NOTIFICATION_RESIZED) { int right_limit = get_size().width - timeline->get_buttons_width(); - int hsep = get_constant("hseparation", "ItemList"); - int vsep = get_constant("vseparation", "ItemList"); + int hsep = get_theme_constant("hseparation", "ItemList"); + int vsep = get_theme_constant("vseparation", "ItemList"); handle_mode_option->set_position(Vector2(right_limit + hsep, get_size().height - handle_mode_option->get_combined_minimum_size().height - vsep)); handle_mode_option->set_size(Vector2(timeline->get_buttons_width() - hsep * 2, handle_mode_option->get_combined_minimum_size().height)); @@ -240,15 +240,15 @@ void AnimationBezierTrackEdit::_notification(int p_what) { int limit = timeline->get_name_limit(); if (has_focus()) { - Color accent = get_color("accent_color", "Editor"); + Color accent = get_theme_color("accent_color", "Editor"); accent.a *= 0.7; draw_rect(Rect2(Point2(), get_size()), accent, false); } - Ref<Font> font = get_font("font", "Label"); - Color color = get_color("font_color", "Label"); - int hsep = get_constant("hseparation", "ItemList"); - int vsep = get_constant("vseparation", "ItemList"); + Ref<Font> font = get_theme_font("font", "Label"); + Color color = get_theme_color("font_color", "Label"); + int hsep = get_theme_constant("hseparation", "ItemList"); + int vsep = get_theme_constant("vseparation", "ItemList"); Color linecolor = color; linecolor.a = 0.2; @@ -258,7 +258,7 @@ void AnimationBezierTrackEdit::_notification(int p_what) { draw_line(Point2(right_limit, 0), Point2(right_limit, get_size().height), linecolor); - Ref<Texture2D> close_icon = get_icon("Close", "EditorIcons"); + Ref<Texture2D> close_icon = get_theme_icon("Close", "EditorIcons"); close_icon_rect.position = Vector2(get_size().width - close_icon->get_width() - hsep, hsep); close_icon_rect.size = close_icon->get_size(); @@ -277,7 +277,7 @@ void AnimationBezierTrackEdit::_notification(int p_what) { { NodePath path = animation->track_get_path(track); - Node *node = NULL; + Node *node = nullptr; if (root && root->has_node(path)) { node = root->get_node(path); @@ -340,7 +340,7 @@ void AnimationBezierTrackEdit::_notification(int p_what) { subtracks[i] = rect; } else { - Color ac = get_color("accent_color", "Editor"); + Color ac = get_theme_color("accent_color", "Editor"); ac.a = 0.5; draw_rect(rect, ac); } @@ -349,7 +349,7 @@ void AnimationBezierTrackEdit::_notification(int p_what) { vofs += font->get_height() + vsep; } - Color accent = get_color("accent_color", "Editor"); + Color accent = get_theme_color("accent_color", "Editor"); { //guides float min_left_scale = font->get_height() + vsep; @@ -391,7 +391,7 @@ void AnimationBezierTrackEdit::_notification(int p_what) { { //draw OTHER curves float scale = timeline->get_zoom_scale(); - Ref<Texture2D> point = get_icon("KeyValue", "EditorIcons"); + Ref<Texture2D> point = get_theme_icon("KeyValue", "EditorIcons"); for (Map<int, Color>::Element *E = subtrack_colors.front(); E; E = E->next()) { _draw_track(E->key(), E->get()); @@ -410,7 +410,7 @@ void AnimationBezierTrackEdit::_notification(int p_what) { } //draw edited curve - const Color highlight = get_color("highlight_color", "Editor"); + const Color highlight = get_theme_color("highlight_color", "Editor"); _draw_track(track, highlight); } @@ -540,7 +540,7 @@ void AnimationBezierTrackEdit::_play_position_draw() { int px = (-timeline->get_value() + play_position_pos) * scale + timeline->get_name_limit(); if (px >= timeline->get_name_limit() && px < (get_size().width - timeline->get_buttons_width())) { - Color color = get_color("accent_color", "Editor"); + Color color = get_theme_color("accent_color", "Editor"); play_position->draw_line(Point2(px, 0), Point2(px, h), color); } } @@ -657,9 +657,9 @@ void AnimationBezierTrackEdit::_gui_input(const Ref<InputEvent> &p_event) { menu->add_icon_item(bezier_icon, TTR("Insert Key Here"), MENU_KEY_INSERT); if (selection.size()) { menu->add_separator(); - menu->add_icon_item(get_icon("Duplicate", "EditorIcons"), TTR("Duplicate Selected Key(s)"), MENU_KEY_DUPLICATE); + menu->add_icon_item(get_theme_icon("Duplicate", "EditorIcons"), TTR("Duplicate Selected Key(s)"), MENU_KEY_DUPLICATE); menu->add_separator(); - menu->add_icon_item(get_icon("Remove", "EditorIcons"), TTR("Delete Selected Key(s)"), MENU_KEY_DELETE); + menu->add_icon_item(get_theme_icon("Remove", "EditorIcons"), TTR("Delete Selected Key(s)"), MENU_KEY_DELETE); } menu->set_as_minsize(); @@ -1162,11 +1162,11 @@ void AnimationBezierTrackEdit::_bind_methods() { } AnimationBezierTrackEdit::AnimationBezierTrackEdit() { - undo_redo = NULL; - timeline = NULL; - root = NULL; - menu = NULL; - block_animation_update_ptr = NULL; + undo_redo = nullptr; + timeline = nullptr; + root = nullptr; + menu = nullptr; + block_animation_update_ptr = nullptr; moving_selection_attempt = false; moving_selection = false; diff --git a/editor/animation_track_editor.cpp b/editor/animation_track_editor.cpp index fb427afe24..f10e439f10 100644 --- a/editor/animation_track_editor.cpp +++ b/editor/animation_track_editor.cpp @@ -31,13 +31,13 @@ #include "animation_track_editor.h" #include "animation_track_editor_plugins.h" -#include "core/os/input.h" +#include "core/input/input_filter.h" #include "core/os/keyboard.h" #include "editor/animation_bezier_editor.h" #include "editor/plugins/animation_player_editor_plugin.h" #include "editor_node.h" #include "editor_scale.h" -#include "scene/main/viewport.h" +#include "scene/main/window.h" #include "servers/audio/audio_stream.h" class AnimationTrackKeyEdit : public Object { @@ -242,7 +242,7 @@ public: args.write[idx] = Variant::construct(t, (const Variant **)ptrs, 1, err); } else { - args.write[idx] = Variant::construct(t, NULL, 0, err); + args.write[idx] = Variant::construct(t, nullptr, 0, err); } change_notify_deserved = true; d_new["args"] = args; @@ -693,7 +693,7 @@ public: key_ofs = 0; track = -1; setting = false; - root_path = NULL; + root_path = nullptr; } }; @@ -905,7 +905,7 @@ public: args.write[idx] = Variant::construct(t, (const Variant **)ptrs, 1, err); } else { - args.write[idx] = Variant::construct(t, NULL, 0, err); + args.write[idx] = Variant::construct(t, nullptr, 0, err); } change_notify_deserved = true; d_new["args"] = args; @@ -1389,7 +1389,7 @@ public: AnimationMultiTrackKeyEdit() { use_fps = false; setting = false; - root_path = NULL; + root_path = nullptr; } }; @@ -1402,7 +1402,7 @@ void AnimationTimelineEdit::_zoom_changed(double) { float AnimationTimelineEdit::get_zoom_scale() const { - float zv = zoom->get_value(); + float zv = zoom->get_max() - zoom->get_value(); if (zv < 1) { zv = 1.0 - zv; return Math::pow(1.0f + zv, 8.0f) * 100; @@ -1442,11 +1442,11 @@ void AnimationTimelineEdit::_anim_loop_pressed() { int AnimationTimelineEdit::get_buttons_width() const { - Ref<Texture2D> interp_mode = get_icon("TrackContinuous", "EditorIcons"); - Ref<Texture2D> interp_type = get_icon("InterpRaw", "EditorIcons"); - Ref<Texture2D> loop_type = get_icon("InterpWrapClamp", "EditorIcons"); - Ref<Texture2D> remove_icon = get_icon("Remove", "EditorIcons"); - Ref<Texture2D> down_icon = get_icon("select_arrow", "Tree"); + Ref<Texture2D> interp_mode = get_theme_icon("TrackContinuous", "EditorIcons"); + Ref<Texture2D> interp_type = get_theme_icon("InterpRaw", "EditorIcons"); + Ref<Texture2D> loop_type = get_theme_icon("InterpWrapClamp", "EditorIcons"); + Ref<Texture2D> remove_icon = get_theme_icon("Remove", "EditorIcons"); + Ref<Texture2D> down_icon = get_theme_icon("select_arrow", "Tree"); int total_w = interp_mode->get_width() + interp_type->get_width() + loop_type->get_width() + remove_icon->get_width(); total_w += (down_icon->get_width() + 4 * EDSCALE) * 4; @@ -1456,7 +1456,7 @@ int AnimationTimelineEdit::get_buttons_width() const { int AnimationTimelineEdit::get_name_limit() const { - Ref<Texture2D> hsize_icon = get_icon("Hsize", "EditorIcons"); + Ref<Texture2D> hsize_icon = get_theme_icon("Hsize", "EditorIcons"); int limit = MAX(name_limit, add_track->get_minimum_size().width + hsize_icon->get_width()); @@ -1468,17 +1468,17 @@ int AnimationTimelineEdit::get_name_limit() const { void AnimationTimelineEdit::_notification(int p_what) { if (p_what == NOTIFICATION_ENTER_TREE) { - add_track->set_icon(get_icon("Add", "EditorIcons")); - loop->set_icon(get_icon("Loop", "EditorIcons")); - time_icon->set_texture(get_icon("Time", "EditorIcons")); + add_track->set_icon(get_theme_icon("Add", "EditorIcons")); + loop->set_icon(get_theme_icon("Loop", "EditorIcons")); + time_icon->set_texture(get_theme_icon("Time", "EditorIcons")); add_track->get_popup()->clear(); - add_track->get_popup()->add_icon_item(get_icon("KeyValue", "EditorIcons"), TTR("Property Track")); - add_track->get_popup()->add_icon_item(get_icon("KeyXform", "EditorIcons"), TTR("3D Transform Track")); - add_track->get_popup()->add_icon_item(get_icon("KeyCall", "EditorIcons"), TTR("Call Method Track")); - add_track->get_popup()->add_icon_item(get_icon("KeyBezier", "EditorIcons"), TTR("Bezier Curve Track")); - add_track->get_popup()->add_icon_item(get_icon("KeyAudio", "EditorIcons"), TTR("Audio Playback Track")); - add_track->get_popup()->add_icon_item(get_icon("KeyAnimation", "EditorIcons"), TTR("Animation Playback Track")); + add_track->get_popup()->add_icon_item(get_theme_icon("KeyValue", "EditorIcons"), TTR("Property Track")); + add_track->get_popup()->add_icon_item(get_theme_icon("KeyXform", "EditorIcons"), TTR("3D Transform Track")); + add_track->get_popup()->add_icon_item(get_theme_icon("KeyCall", "EditorIcons"), TTR("Call Method Track")); + add_track->get_popup()->add_icon_item(get_theme_icon("KeyBezier", "EditorIcons"), TTR("Bezier Curve Track")); + add_track->get_popup()->add_icon_item(get_theme_icon("KeyAudio", "EditorIcons"), TTR("Audio Playback Track")); + add_track->get_popup()->add_icon_item(get_theme_icon("KeyAnimation", "EditorIcons"), TTR("Animation Playback Track")); } if (p_what == NOTIFICATION_RESIZED) { @@ -1493,8 +1493,8 @@ void AnimationTimelineEdit::_notification(int p_what) { if (!animation.is_valid()) return; - Ref<Font> font = get_font("font", "Label"); - Color color = get_color("font_color", "Label"); + Ref<Font> font = get_theme_font("font", "Label"); + Color color = get_theme_color("font_color", "Label"); int zoomw = key_range; float scale = get_zoom_scale(); @@ -1504,7 +1504,7 @@ void AnimationTimelineEdit::_notification(int p_what) { if (l <= 0) l = 0.001; //avoid crashor - Ref<Texture2D> hsize_icon = get_icon("Hsize", "EditorIcons"); + Ref<Texture2D> hsize_icon = get_theme_icon("Hsize", "EditorIcons"); hsize_rect = Rect2(get_name_limit() - hsize_icon->get_width() - 2 * EDSCALE, (get_size().height - hsize_icon->get_height()) / 2, hsize_icon->get_width(), hsize_icon->get_height()); draw_texture(hsize_icon, hsize_rect.position); @@ -1554,7 +1554,7 @@ void AnimationTimelineEdit::_notification(int p_what) { int end_px = (l - get_value()) * scale; int begin_px = -get_value() * scale; - Color notimecol = get_color("dark_color_2", "Editor"); + Color notimecol = get_theme_color("dark_color_2", "Editor"); Color timecolor = color; timecolor.a = 0.2; Color linecolor = color; @@ -1685,9 +1685,9 @@ void AnimationTimelineEdit::set_animation(const Ref<Animation> &p_animation) { Size2 AnimationTimelineEdit::get_minimum_size() const { Size2 ms = add_track->get_minimum_size(); - Ref<Font> font = get_font("font", "Label"); + Ref<Font> font = get_theme_font("font", "Label"); ms.height = MAX(ms.height, font->get_height()); - ms.width = get_buttons_width() + add_track->get_minimum_size().width + get_icon("Hsize", "EditorIcons")->get_width() + 2; + ms.width = get_buttons_width() + add_track->get_minimum_size().width + get_theme_icon("Hsize", "EditorIcons")->get_width() + 2; return ms; } @@ -1746,11 +1746,11 @@ void AnimationTimelineEdit::_play_position_draw() { int px = (-get_value() + play_position_pos) * scale + get_name_limit(); if (px >= get_name_limit() && px < (play_position->get_size().width - get_buttons_width())) { - Color color = get_color("accent_color", "Editor"); + Color color = get_theme_color("accent_color", "Editor"); play_position->draw_line(Point2(px, 0), Point2(px, h), color, Math::round(2 * EDSCALE)); play_position->draw_texture( - get_icon("TimelineIndicator", "EditorIcons"), - Point2(px - get_icon("TimelineIndicator", "EditorIcons")->get_width() * 0.5, 0), + get_theme_icon("TimelineIndicator", "EditorIcons"), + Point2(px - get_theme_icon("TimelineIndicator", "EditorIcons")->get_width() * 0.5, 0), color); } } @@ -1859,7 +1859,7 @@ AnimationTimelineEdit::AnimationTimelineEdit() { use_fps = false; editing = false; name_limit = 150 * EDSCALE; - zoom = NULL; + zoom = nullptr; play_position_pos = 0; play_position = memnew(Control); @@ -1921,23 +1921,23 @@ void AnimationTrackEdit::_notification(int p_what) { int limit = timeline->get_name_limit(); if (has_focus()) { - Color accent = get_color("accent_color", "Editor"); + Color accent = get_theme_color("accent_color", "Editor"); accent.a *= 0.7; // Offside so the horizontal sides aren't cutoff. draw_rect(Rect2(Point2(1 * EDSCALE, 0), get_size() - Size2(1 * EDSCALE, 0)), accent, false); } - Ref<Font> font = get_font("font", "Label"); - Color color = get_color("font_color", "Label"); + Ref<Font> font = get_theme_font("font", "Label"); + Color color = get_theme_color("font_color", "Label"); Ref<Texture2D> type_icons[6] = { - get_icon("KeyValue", "EditorIcons"), - get_icon("KeyXform", "EditorIcons"), - get_icon("KeyCall", "EditorIcons"), - get_icon("KeyBezier", "EditorIcons"), - get_icon("KeyAudio", "EditorIcons"), - get_icon("KeyAnimation", "EditorIcons") + get_theme_icon("KeyValue", "EditorIcons"), + get_theme_icon("KeyXform", "EditorIcons"), + get_theme_icon("KeyCall", "EditorIcons"), + get_theme_icon("KeyBezier", "EditorIcons"), + get_theme_icon("KeyAudio", "EditorIcons"), + get_theme_icon("KeyAnimation", "EditorIcons") }; - int hsep = get_constant("hseparation", "ItemList"); + int hsep = get_theme_constant("hseparation", "ItemList"); Color linecolor = color; linecolor.a = 0.2; @@ -1945,7 +1945,7 @@ void AnimationTrackEdit::_notification(int p_what) { { - Ref<Texture2D> check = animation->track_is_enabled(track) ? get_icon("checked", "CheckBox") : get_icon("unchecked", "CheckBox"); + Ref<Texture2D> check = animation->track_is_enabled(track) ? get_theme_icon("checked", "CheckBox") : get_theme_icon("unchecked", "CheckBox"); int ofs = in_group ? check->get_width() : 0; //not the best reference for margin but.. @@ -1958,7 +1958,7 @@ void AnimationTrackEdit::_notification(int p_what) { ofs += type_icon->get_width() + hsep; NodePath path = animation->track_get_path(track); - Node *node = NULL; + Node *node = nullptr; if (root && root->has_node(path)) { node = root->get_node(path); } @@ -1966,7 +1966,7 @@ void AnimationTrackEdit::_notification(int p_what) { String text; Color text_color = color; if (node && EditorNode::get_singleton()->get_editor_selection()->is_selected(node)) { - text_color = get_color("accent_color", "Editor"); + text_color = get_theme_color("accent_color", "Editor"); } if (in_group) { @@ -2045,25 +2045,25 @@ void AnimationTrackEdit::_notification(int p_what) { { Ref<Texture2D> wrap_icon[2] = { - get_icon("InterpWrapClamp", "EditorIcons"), - get_icon("InterpWrapLoop", "EditorIcons"), + get_theme_icon("InterpWrapClamp", "EditorIcons"), + get_theme_icon("InterpWrapLoop", "EditorIcons"), }; Ref<Texture2D> interp_icon[3] = { - get_icon("InterpRaw", "EditorIcons"), - get_icon("InterpLinear", "EditorIcons"), - get_icon("InterpCubic", "EditorIcons") + get_theme_icon("InterpRaw", "EditorIcons"), + get_theme_icon("InterpLinear", "EditorIcons"), + get_theme_icon("InterpCubic", "EditorIcons") }; Ref<Texture2D> cont_icon[4] = { - get_icon("TrackContinuous", "EditorIcons"), - get_icon("TrackDiscrete", "EditorIcons"), - get_icon("TrackTrigger", "EditorIcons"), - get_icon("TrackCapture", "EditorIcons") + get_theme_icon("TrackContinuous", "EditorIcons"), + get_theme_icon("TrackDiscrete", "EditorIcons"), + get_theme_icon("TrackTrigger", "EditorIcons"), + get_theme_icon("TrackCapture", "EditorIcons") }; int ofs = get_size().width - timeline->get_buttons_width(); - Ref<Texture2D> down_icon = get_icon("select_arrow", "Tree"); + Ref<Texture2D> down_icon = get_theme_icon("select_arrow", "Tree"); draw_line(Point2(ofs, 0), Point2(ofs, get_size().height), linecolor, Math::round(EDSCALE)); @@ -2100,7 +2100,7 @@ void AnimationTrackEdit::_notification(int p_what) { update_mode_rect.size.x += down_icon->get_width(); bezier_edit_rect = Rect2(); } else if (animation->track_get_type(track) == Animation::TYPE_BEZIER) { - Ref<Texture2D> bezier_icon = get_icon("EditBezier", "EditorIcons"); + Ref<Texture2D> bezier_icon = get_theme_icon("EditBezier", "EditorIcons"); update_mode_rect.size.x += down_icon->get_width(); bezier_edit_rect.position = update_mode_rect.position + (update_mode_rect.size - bezier_icon->get_size()) / 2; bezier_edit_rect.size = bezier_icon->get_size(); @@ -2185,7 +2185,7 @@ void AnimationTrackEdit::_notification(int p_what) { { //erase - Ref<Texture2D> icon = get_icon("Remove", "EditorIcons"); + Ref<Texture2D> icon = get_theme_icon("Remove", "EditorIcons"); remove_rect.position.x = ofs + ((get_size().width - ofs) - icon->get_width()) / 2; remove_rect.position.y = int(get_size().height - icon->get_height()) / 2; @@ -2202,7 +2202,7 @@ void AnimationTrackEdit::_notification(int p_what) { } if (dropping_at != 0) { - Color drop_color = get_color("accent_color", "Editor"); + Color drop_color = get_theme_color("accent_color", "Editor"); if (dropping_at < 0) { draw_line(Vector2(0, 0), Vector2(get_size().width, 0), drop_color, Math::round(EDSCALE)); } else { @@ -2249,7 +2249,7 @@ void AnimationTrackEdit::draw_key_link(int p_index, float p_pixels_sec, int p_x, if (current != next) return; - Color color = get_color("font_color", "Label"); + Color color = get_theme_color("font_color", "Label"); color.a = 0.5; int from_x = MAX(p_x, p_clip_left); @@ -2273,15 +2273,15 @@ void AnimationTrackEdit::draw_key(int p_index, float p_pixels_sec, int p_x, bool const Variant &v = animation->track_get_key_value(track, p_index); Variant::Type valid_type = Variant::NIL; if (!_is_value_key_valid(v, valid_type)) { - icon_to_draw = get_icon("KeyInvalid", "EditorIcons"); + icon_to_draw = get_theme_icon("KeyInvalid", "EditorIcons"); } } Vector2 ofs(p_x - icon_to_draw->get_width() / 2, int(get_size().height - icon_to_draw->get_height()) / 2); if (animation->track_get_type(track) == Animation::TYPE_METHOD) { - Ref<Font> font = get_font("font", "Label"); - Color color = get_color("font_color", "Label"); + Ref<Font> font = get_theme_font("font", "Label"); + Color color = get_theme_color("font_color", "Label"); color.a = 0.5; Dictionary d = animation->track_get_key_value(track, p_index); @@ -2387,19 +2387,19 @@ void AnimationTrackEdit::set_animation_and_track(const Ref<Animation> &p_animati update(); Ref<Texture2D> type_icons[6] = { - get_icon("KeyValue", "EditorIcons"), - get_icon("KeyXform", "EditorIcons"), - get_icon("KeyCall", "EditorIcons"), - get_icon("KeyBezier", "EditorIcons"), - get_icon("KeyAudio", "EditorIcons"), - get_icon("KeyAnimation", "EditorIcons") + get_theme_icon("KeyValue", "EditorIcons"), + get_theme_icon("KeyXform", "EditorIcons"), + get_theme_icon("KeyCall", "EditorIcons"), + get_theme_icon("KeyBezier", "EditorIcons"), + get_theme_icon("KeyAudio", "EditorIcons"), + get_theme_icon("KeyAnimation", "EditorIcons") }; ERR_FAIL_INDEX(track, animation->get_track_count()); node_path = animation->track_get_path(p_track); type_icon = type_icons[animation->track_get_type(track)]; - selected_icon = get_icon("KeySelected", "EditorIcons"); + selected_icon = get_theme_icon("KeySelected", "EditorIcons"); } NodePath AnimationTrackEdit::get_path() const { @@ -2408,9 +2408,9 @@ NodePath AnimationTrackEdit::get_path() const { Size2 AnimationTrackEdit::get_minimum_size() const { - Ref<Texture2D> texture = get_icon("Object", "EditorIcons"); - Ref<Font> font = get_font("font", "Label"); - int separation = get_constant("vseparation", "ItemList"); + Ref<Texture2D> texture = get_theme_icon("Object", "EditorIcons"); + Ref<Font> font = get_theme_font("font", "Label"); + int separation = get_theme_constant("vseparation", "ItemList"); int max_h = MAX(texture->get_height(), font->get_height()); max_h = MAX(max_h, get_key_height()); @@ -2442,7 +2442,7 @@ void AnimationTrackEdit::_play_position_draw() { int px = (-timeline->get_value() + play_position_pos) * scale + timeline->get_name_limit(); if (px >= timeline->get_name_limit() && px < (get_size().width - timeline->get_buttons_width())) { - Color color = get_color("accent_color", "Editor"); + Color color = get_theme_color("accent_color", "Editor"); play_position->draw_line(Point2(px, 0), Point2(px, h), color, Math::round(2 * EDSCALE)); } } @@ -2471,6 +2471,7 @@ void AnimationTrackEdit::_path_entered(const String &p_text) { undo_redo->add_do_method(animation.ptr(), "track_set_path", track, p_text); undo_redo->add_undo_method(animation.ptr(), "track_set_path", track, animation->track_get_path(track)); undo_redo->commit_action(); + path_popup->hide(); } bool AnimationTrackEdit::_is_value_key_valid(const Variant &p_key_value, Variant::Type &r_valid_type) const { @@ -2482,7 +2483,7 @@ bool AnimationTrackEdit::_is_value_key_valid(const Variant &p_key_value, Variant Vector<StringName> leftover_path; Node *node = root->get_node_and_resource(animation->track_get_path(track), res, leftover_path); - Object *obj = NULL; + Object *obj = nullptr; if (res.is_valid()) { obj = res.ptr(); } else if (node) { @@ -2689,14 +2690,14 @@ void AnimationTrackEdit::_gui_input(const Ref<InputEvent> &p_event) { menu->connect("id_pressed", callable_mp(this, &AnimationTrackEdit::_menu_selected)); } menu->clear(); - menu->add_icon_item(get_icon("TrackContinuous", "EditorIcons"), TTR("Continuous"), MENU_CALL_MODE_CONTINUOUS); - menu->add_icon_item(get_icon("TrackDiscrete", "EditorIcons"), TTR("Discrete"), MENU_CALL_MODE_DISCRETE); - menu->add_icon_item(get_icon("TrackTrigger", "EditorIcons"), TTR("Trigger"), MENU_CALL_MODE_TRIGGER); - menu->add_icon_item(get_icon("TrackCapture", "EditorIcons"), TTR("Capture"), MENU_CALL_MODE_CAPTURE); + menu->add_icon_item(get_theme_icon("TrackContinuous", "EditorIcons"), TTR("Continuous"), MENU_CALL_MODE_CONTINUOUS); + menu->add_icon_item(get_theme_icon("TrackDiscrete", "EditorIcons"), TTR("Discrete"), MENU_CALL_MODE_DISCRETE); + menu->add_icon_item(get_theme_icon("TrackTrigger", "EditorIcons"), TTR("Trigger"), MENU_CALL_MODE_TRIGGER); + menu->add_icon_item(get_theme_icon("TrackCapture", "EditorIcons"), TTR("Capture"), MENU_CALL_MODE_CAPTURE); menu->set_as_minsize(); - Vector2 popup_pos = get_global_position() + update_mode_rect.position + Vector2(0, update_mode_rect.size.height); - menu->set_global_position(popup_pos); + Vector2 popup_pos = get_screen_position() + update_mode_rect.position + Vector2(0, update_mode_rect.size.height); + menu->set_position(popup_pos); menu->popup(); accept_event(); } @@ -2708,13 +2709,13 @@ void AnimationTrackEdit::_gui_input(const Ref<InputEvent> &p_event) { menu->connect("id_pressed", callable_mp(this, &AnimationTrackEdit::_menu_selected)); } menu->clear(); - menu->add_icon_item(get_icon("InterpRaw", "EditorIcons"), TTR("Nearest"), MENU_INTERPOLATION_NEAREST); - menu->add_icon_item(get_icon("InterpLinear", "EditorIcons"), TTR("Linear"), MENU_INTERPOLATION_LINEAR); - menu->add_icon_item(get_icon("InterpCubic", "EditorIcons"), TTR("Cubic"), MENU_INTERPOLATION_CUBIC); + menu->add_icon_item(get_theme_icon("InterpRaw", "EditorIcons"), TTR("Nearest"), MENU_INTERPOLATION_NEAREST); + menu->add_icon_item(get_theme_icon("InterpLinear", "EditorIcons"), TTR("Linear"), MENU_INTERPOLATION_LINEAR); + menu->add_icon_item(get_theme_icon("InterpCubic", "EditorIcons"), TTR("Cubic"), MENU_INTERPOLATION_CUBIC); menu->set_as_minsize(); - Vector2 popup_pos = get_global_position() + interp_mode_rect.position + Vector2(0, interp_mode_rect.size.height); - menu->set_global_position(popup_pos); + Vector2 popup_pos = get_screen_position() + interp_mode_rect.position + Vector2(0, interp_mode_rect.size.height); + menu->set_position(popup_pos); menu->popup(); accept_event(); } @@ -2726,12 +2727,12 @@ void AnimationTrackEdit::_gui_input(const Ref<InputEvent> &p_event) { menu->connect("id_pressed", callable_mp(this, &AnimationTrackEdit::_menu_selected)); } menu->clear(); - menu->add_icon_item(get_icon("InterpWrapClamp", "EditorIcons"), TTR("Clamp Loop Interp"), MENU_LOOP_CLAMP); - menu->add_icon_item(get_icon("InterpWrapLoop", "EditorIcons"), TTR("Wrap Loop Interp"), MENU_LOOP_WRAP); + menu->add_icon_item(get_theme_icon("InterpWrapClamp", "EditorIcons"), TTR("Clamp Loop Interp"), MENU_LOOP_CLAMP); + menu->add_icon_item(get_theme_icon("InterpWrapLoop", "EditorIcons"), TTR("Wrap Loop Interp"), MENU_LOOP_WRAP); menu->set_as_minsize(); - Vector2 popup_pos = get_global_position() + loop_mode_rect.position + Vector2(0, loop_mode_rect.size.height); - menu->set_global_position(popup_pos); + Vector2 popup_pos = get_screen_position() + loop_mode_rect.position + Vector2(0, loop_mode_rect.size.height); + menu->set_position(popup_pos); menu->popup(); accept_event(); } @@ -2822,17 +2823,17 @@ void AnimationTrackEdit::_gui_input(const Ref<InputEvent> &p_event) { } menu->clear(); - menu->add_icon_item(get_icon("Key", "EditorIcons"), TTR("Insert Key"), MENU_KEY_INSERT); + menu->add_icon_item(get_theme_icon("Key", "EditorIcons"), TTR("Insert Key"), MENU_KEY_INSERT); if (editor->is_selection_active()) { menu->add_separator(); - menu->add_icon_item(get_icon("Duplicate", "EditorIcons"), TTR("Duplicate Key(s)"), MENU_KEY_DUPLICATE); + menu->add_icon_item(get_theme_icon("Duplicate", "EditorIcons"), TTR("Duplicate Key(s)"), MENU_KEY_DUPLICATE); menu->add_separator(); - menu->add_icon_item(get_icon("Remove", "EditorIcons"), TTR("Delete Key(s)"), MENU_KEY_DELETE); + menu->add_icon_item(get_theme_icon("Remove", "EditorIcons"), TTR("Delete Key(s)"), MENU_KEY_DELETE); } menu->set_as_minsize(); - Vector2 popup_pos = get_global_transform().xform(get_local_mouse_position()); - menu->set_global_position(popup_pos); + Vector2 popup_pos = get_screen_transform().xform(get_local_mouse_position()); + menu->set_position(popup_pos); menu->popup(); insert_at_pos = offset + timeline->get_value(); @@ -2843,17 +2844,20 @@ void AnimationTrackEdit::_gui_input(const Ref<InputEvent> &p_event) { if (mb.is_valid() && !mb->is_pressed() && mb->get_button_index() == BUTTON_LEFT && clicking_on_name) { if (!path) { + path_popup = memnew(Popup); + path_popup->set_wrap_controls(true); + add_child(path_popup); path = memnew(LineEdit); - add_child(path); - path->set_as_toplevel(true); + path_popup->add_child(path); + path->set_anchors_and_margins_preset(PRESET_WIDE); path->connect("text_entered", callable_mp(this, &AnimationTrackEdit::_path_entered)); } path->set_text(animation->track_get_path(track)); - Vector2 theme_ofs = path->get_stylebox("normal", "LineEdit")->get_offset(); - path->set_position(get_global_position() + path_rect.position - theme_ofs); - path->set_size(path_rect.size); - path->show_modal(); + Vector2 theme_ofs = path->get_theme_stylebox("normal", "LineEdit")->get_offset(); + path_popup->set_position(get_screen_position() + path_rect.position - theme_ofs); + path_popup->set_size(path_rect.size); + path_popup->popup(); path->grab_focus(); path->set_cursor_position(path->get_text().length()); clicking_on_name = false; @@ -3086,11 +3090,12 @@ void AnimationTrackEdit::_bind_methods() { } AnimationTrackEdit::AnimationTrackEdit() { - undo_redo = NULL; - timeline = NULL; - root = NULL; - path = NULL; - menu = NULL; + undo_redo = nullptr; + timeline = nullptr; + root = nullptr; + path = nullptr; + path_popup = nullptr; + menu = nullptr; clicking_on_name = false; dropping_at = 0; @@ -3135,7 +3140,7 @@ AnimationTrackEdit *AnimationTrackEditPlugin::create_value_track_edit(Object *p_ Callable::CallError ce; return Object::cast_to<AnimationTrackEdit>(get_script_instance()->call("create_value_track_edit", (const Variant **)&argptrs, 6, ce).operator Object *()); } - return NULL; + return nullptr; } AnimationTrackEdit *AnimationTrackEditPlugin::create_audio_track_edit() { @@ -3143,14 +3148,14 @@ AnimationTrackEdit *AnimationTrackEditPlugin::create_audio_track_edit() { if (get_script_instance()) { return Object::cast_to<AnimationTrackEdit>(get_script_instance()->call("create_audio_track_edit").operator Object *()); } - return NULL; + return nullptr; } AnimationTrackEdit *AnimationTrackEditPlugin::create_animation_track_edit(Object *p_object) { if (get_script_instance()) { return Object::cast_to<AnimationTrackEdit>(get_script_instance()->call("create_animation_track_edit", p_object).operator Object *()); } - return NULL; + return nullptr; } /////////////////////////////////////// @@ -3158,18 +3163,18 @@ AnimationTrackEdit *AnimationTrackEditPlugin::create_animation_track_edit(Object void AnimationTrackEditGroup::_notification(int p_what) { if (p_what == NOTIFICATION_DRAW) { - Ref<Font> font = get_font("font", "Label"); - int separation = get_constant("hseparation", "ItemList"); - Color color = get_color("font_color", "Label"); + Ref<Font> font = get_theme_font("font", "Label"); + int separation = get_theme_constant("hseparation", "ItemList"); + Color color = get_theme_color("font_color", "Label"); if (root && root->has_node(node)) { Node *n = root->get_node(node); if (n && EditorNode::get_singleton()->get_editor_selection()->is_selected(n)) { - color = get_color("accent_color", "Editor"); + color = get_theme_color("accent_color", "Editor"); } } - Color bgcol = get_color("dark_color_2", "Editor"); + Color bgcol = get_theme_color("dark_color_2", "Editor"); bgcol.a *= 0.6; draw_rect(Rect2(Point2(), get_size()), bgcol); Color linecolor = color; @@ -3187,7 +3192,7 @@ void AnimationTrackEditGroup::_notification(int p_what) { int px = (-timeline->get_value() + timeline->get_play_position()) * timeline->get_zoom_scale() + timeline->get_name_limit(); if (px >= timeline->get_name_limit() && px < (get_size().width - timeline->get_buttons_width())) { - Color accent = get_color("accent_color", "Editor"); + Color accent = get_theme_color("accent_color", "Editor"); draw_line(Point2(px, 0), Point2(px, get_size().height), accent, Math::round(2 * EDSCALE)); } } @@ -3203,8 +3208,8 @@ void AnimationTrackEditGroup::set_type_and_name(const Ref<Texture2D> &p_type, co Size2 AnimationTrackEditGroup::get_minimum_size() const { - Ref<Font> font = get_font("font", "Label"); - int separation = get_constant("vseparation", "ItemList"); + Ref<Font> font = get_theme_font("font", "Label"); + int separation = get_theme_constant("vseparation", "ItemList"); return Vector2(0, MAX(font->get_height(), icon->get_height()) + separation); } @@ -3299,7 +3304,7 @@ Ref<Animation> AnimationTrackEditor::get_current_animation() const { } void AnimationTrackEditor::_root_removed(Node *p_root) { - root = NULL; + root = nullptr; } void AnimationTrackEditor::set_root(Node *p_root) { @@ -3443,7 +3448,7 @@ void AnimationTrackEditor::_query_insert(const InsertData &p_id) { if (insert_frame != Engine::get_singleton()->get_frames_drawn()) { //clear insert list for the frame if frame changed - if (insert_confirm->is_visible_in_tree()) + if (insert_confirm->is_visible()) return; //do nothing insert_data.clear(); insert_query = false; @@ -3496,7 +3501,7 @@ void AnimationTrackEditor::_query_insert(const InsertData &p_id) { insert_confirm_bezier->set_visible(all_bezier); insert_confirm->get_ok()->set_text(TTR("Create")); - insert_confirm->popup_centered_minsize(); + insert_confirm->popup_centered(); insert_query = true; } else { call_deferred("_insert_delay"); @@ -3549,7 +3554,7 @@ void AnimationTrackEditor::_insert_delay() { insert_queue = false; } -void AnimationTrackEditor::insert_transform_key(Spatial *p_node, const String &p_sub, const Transform &p_xform) { +void AnimationTrackEditor::insert_transform_key(Node3D *p_node, const String &p_sub, const Transform &p_xform) { if (!keying) return; @@ -3897,7 +3902,7 @@ PropertyInfo AnimationTrackEditor::_find_hint_for_track(int p_idx, NodePath &r_b return PropertyInfo(); } -static Vector<String> _get_bezier_subindices_for_type(Variant::Type p_type, bool *r_valid = NULL) { +static Vector<String> _get_bezier_subindices_for_type(Variant::Type p_type, bool *r_valid = nullptr) { Vector<String> subindices; if (r_valid) { *r_valid = true; @@ -4095,7 +4100,7 @@ bool AnimationTrackEditor::is_selection_active() const { } bool AnimationTrackEditor::is_snap_enabled() const { - return snap->is_pressed() ^ Input::get_singleton()->is_key_pressed(KEY_CONTROL); + return snap->is_pressed() ^ InputFilter::get_singleton()->is_key_pressed(KEY_CONTROL); } void AnimationTrackEditor::_update_tracks() { @@ -4118,7 +4123,7 @@ void AnimationTrackEditor::_update_tracks() { bool use_filter = selected_filter->is_pressed(); for (int i = 0; i < animation->get_track_count(); i++) { - AnimationTrackEdit *track_edit = NULL; + AnimationTrackEdit *track_edit = nullptr; //find hint and info for plugin @@ -4179,7 +4184,7 @@ void AnimationTrackEditor::_update_tracks() { if (animation->track_get_type(i) == Animation::TYPE_ANIMATION) { NodePath path = animation->track_get_path(i); - Node *node = NULL; + Node *node = nullptr; if (root && root->has_node(path)) { node = root->get_node(path); } @@ -4194,7 +4199,7 @@ void AnimationTrackEditor::_update_tracks() { } } - if (track_edit == NULL) { + if (track_edit == nullptr) { //no valid plugin_found track_edit = memnew(AnimationTrackEdit); } @@ -4207,7 +4212,7 @@ void AnimationTrackEditor::_update_tracks() { if (!group_sort.has(base_path)) { AnimationTrackEditGroup *g = memnew(AnimationTrackEditGroup); - Ref<Texture2D> icon = get_icon("Node", "EditorIcons"); + Ref<Texture2D> icon = get_theme_icon("Node", "EditorIcons"); String name = base_path; String tooltip; if (root && root->has_node(base_path)) { @@ -4225,7 +4230,7 @@ void AnimationTrackEditor::_update_tracks() { g->set_timeline(timeline); groups.push_back(g); VBoxContainer *vb = memnew(VBoxContainer); - vb->add_constant_override("separation", 0); + vb->add_theme_constant_override("separation", 0); vb->add_child(g); track_vbox->add_child(vb); group_sort[base_path] = vb; @@ -4368,12 +4373,12 @@ MenuButton *AnimationTrackEditor::get_edit_menu() { void AnimationTrackEditor::_notification(int p_what) { if (p_what == NOTIFICATION_THEME_CHANGED || p_what == NOTIFICATION_ENTER_TREE) { - zoom_icon->set_texture(get_icon("Zoom", "EditorIcons")); - snap->set_icon(get_icon("Snap", "EditorIcons")); - view_group->set_icon(get_icon(view_group->is_pressed() ? "AnimationTrackList" : "AnimationTrackGroup", "EditorIcons")); - selected_filter->set_icon(get_icon("AnimationFilter", "EditorIcons")); - imported_anim_warning->set_icon(get_icon("NodeWarning", "EditorIcons")); - main_panel->add_style_override("panel", get_stylebox("bg", "Tree")); + zoom_icon->set_texture(get_theme_icon("Zoom", "EditorIcons")); + snap->set_icon(get_theme_icon("Snap", "EditorIcons")); + view_group->set_icon(get_theme_icon(view_group->is_pressed() ? "AnimationTrackList" : "AnimationTrackGroup", "EditorIcons")); + selected_filter->set_icon(get_theme_icon("AnimationFilter", "EditorIcons")); + imported_anim_warning->set_icon(get_theme_icon("NodeWarning", "EditorIcons")); + main_panel->add_theme_style_override("panel", get_theme_stylebox("bg", "Tree")); } if (p_what == NOTIFICATION_READY) { @@ -4441,8 +4446,8 @@ void AnimationTrackEditor::_new_track_node_selected(NodePath p_path) { ERR_FAIL_COND(!node); NodePath path_to = root->get_path_to(node); - if (adding_track_type == Animation::TYPE_TRANSFORM && !node->is_class("Spatial")) { - EditorNode::get_singleton()->show_warning(TTR("Transform tracks only apply to Spatial-based nodes.")); + if (adding_track_type == Animation::TYPE_TRANSFORM && !node->is_class("Node3D")) { + EditorNode::get_singleton()->show_warning(TTR("Transform tracks only apply to 3D-based nodes.")); return; } @@ -4633,10 +4638,10 @@ void AnimationTrackEditor::_insert_key_from_track(float p_ofs, int p_track) { EditorNode::get_singleton()->show_warning(TTR("Track path is invalid, so can't add a key.")); return; } - Spatial *base = Object::cast_to<Spatial>(root->get_node(animation->track_get_path(p_track))); + Node3D *base = Object::cast_to<Node3D>(root->get_node(animation->track_get_path(p_track))); if (!base) { - EditorNode::get_singleton()->show_warning(TTR("Track is not of type Spatial, can't insert key")); + EditorNode::get_singleton()->show_warning(TTR("Track is not of type Node3D, can't insert key")); return; } @@ -4747,7 +4752,7 @@ void AnimationTrackEditor::_add_method_key(const String &p_method) { params.push_back(arg); } else { Callable::CallError ce; - Variant arg = Variant::construct(E->get().arguments[i].type, NULL, 0, ce); + Variant arg = Variant::construct(E->get().arguments[i].type, nullptr, 0, ce); params.push_back(arg); } } @@ -4833,21 +4838,21 @@ void AnimationTrackEditor::_clear_key_edit() { if (key_edit) { //if key edit is the object being inspected, remove it first if (EditorNode::get_singleton()->get_inspector()->get_edited_object() == key_edit) { - EditorNode::get_singleton()->push_item(NULL); + EditorNode::get_singleton()->push_item(nullptr); } //then actually delete it memdelete(key_edit); - key_edit = NULL; + key_edit = nullptr; } if (multi_key_edit) { if (EditorNode::get_singleton()->get_inspector()->get_edited_object() == multi_key_edit) { - EditorNode::get_singleton()->push_item(NULL); + EditorNode::get_singleton()->push_item(nullptr); } memdelete(multi_key_edit); - multi_key_edit = NULL; + multi_key_edit = nullptr; } } @@ -5050,8 +5055,8 @@ float AnimationTrackEditor::get_moving_selection_offset() const { void AnimationTrackEditor::_box_selection_draw() { const Rect2 selection_rect = Rect2(Point2(), box_selection->get_size()); - box_selection->draw_rect(selection_rect, get_color("box_selection_fill_color", "Editor")); - box_selection->draw_rect(selection_rect, get_color("box_selection_stroke_color", "Editor"), false, Math::round(EDSCALE)); + box_selection->draw_rect(selection_rect, get_theme_color("box_selection_fill_color", "Editor")); + box_selection->draw_rect(selection_rect, get_theme_color("box_selection_stroke_color", "Editor"), false, Math::round(EDSCALE)); } void AnimationTrackEditor::_scroll_input(const Ref<InputEvent> &p_event) { @@ -5259,17 +5264,17 @@ void AnimationTrackEditor::_edit_menu_pressed(int p_option) { for (int i = 0; i < animation->get_track_count(); i++) { NodePath path = animation->track_get_path(i); - Node *node = NULL; + Node *node = nullptr; if (root && root->has_node(path)) { node = root->get_node(path); } String text; - Ref<Texture2D> icon = get_icon("Node", "EditorIcons"); + Ref<Texture2D> icon = get_theme_icon("Node", "EditorIcons"); if (node) { - if (has_icon(node->get_class(), "EditorIcons")) { - icon = get_icon(node->get_class(), "EditorIcons"); + if (has_theme_icon(node->get_class(), "EditorIcons")) { + icon = get_theme_icon(node->get_class(), "EditorIcons"); } text = node->get_name(); @@ -5309,7 +5314,7 @@ void AnimationTrackEditor::_edit_menu_pressed(int p_option) { it->set_metadata(0, md); } - track_copy_dialog->popup_centered_minsize(Size2(350, 500) * EDSCALE); + track_copy_dialog->popup_centered(Size2(350, 500) * EDSCALE); } break; case EDIT_COPY_TRACKS_CONFIRM: { @@ -5356,7 +5361,7 @@ void AnimationTrackEditor::_edit_menu_pressed(int p_option) { undo_redo->create_action(TTR("Paste Tracks")); for (int i = 0; i < track_clipboard.size(); i++) { undo_redo->add_do_method(animation.ptr(), "add_track", track_clipboard[i].track_type); - Node *exists = NULL; + Node *exists = nullptr; NodePath path = track_clipboard[i].base_path; if (root) { @@ -5578,7 +5583,7 @@ void AnimationTrackEditor::_edit_menu_pressed(int p_option) { } break; case EDIT_CLEAN_UP_ANIMATION: { - cleanup_dialog->popup_centered_minsize(Size2(300, 0) * EDSCALE); + cleanup_dialog->popup_centered(Size2(300, 0) * EDSCALE); } break; case EDIT_CLEAN_UP_ANIMATION_CONFIRM: { @@ -5602,7 +5607,7 @@ void AnimationTrackEditor::_cleanup_animation(Ref<Animation> p_animation) { bool prop_exists = false; Variant::Type valid_type = Variant::NIL; - Object *obj = NULL; + Object *obj = nullptr; RES res; Vector<StringName> leftover_path; @@ -5652,7 +5657,7 @@ void AnimationTrackEditor::_cleanup_animation(Ref<Animation> p_animation) { void AnimationTrackEditor::_view_group_toggle() { _update_tracks(); - view_group->set_icon(get_icon(view_group->is_pressed() ? "AnimationTrackList" : "AnimationTrackGroup", "EditorIcons")); + view_group->set_icon(get_theme_icon(view_group->is_pressed() ? "AnimationTrackList" : "AnimationTrackGroup", "EditorIcons")); } bool AnimationTrackEditor::is_grouping_tracks() { @@ -5748,7 +5753,7 @@ void AnimationTrackEditor::_bind_methods() { } AnimationTrackEditor::AnimationTrackEditor() { - root = NULL; + root = nullptr; undo_redo = EditorNode::get_singleton()->get_undo_redo(); @@ -5763,7 +5768,7 @@ AnimationTrackEditor::AnimationTrackEditor() { timeline_scroll->add_child(timeline_vbox); timeline_vbox->set_v_size_flags(SIZE_EXPAND_FILL); timeline_vbox->set_h_size_flags(SIZE_EXPAND_FILL); - timeline_vbox->add_constant_override("separation", 0); + timeline_vbox->add_theme_constant_override("separation", 0); info_message = memnew(Label); info_message->set_text(TTR("Select an AnimationPlayer node to create and edit animations.")); @@ -5814,7 +5819,7 @@ AnimationTrackEditor::AnimationTrackEditor() { track_vbox->set_h_size_flags(SIZE_EXPAND_FILL); scroll->set_enable_h_scroll(false); scroll->set_enable_v_scroll(true); - track_vbox->add_constant_override("separation", 0); + track_vbox->add_theme_constant_override("separation", 0); HBoxContainer *bottom_hb = memnew(HBoxContainer); add_child(bottom_hb); @@ -5940,8 +5945,8 @@ AnimationTrackEditor::AnimationTrackEditor() { icvb->add_child(insert_confirm_bezier); keying = false; moving_selection = 0; - key_edit = NULL; - multi_key_edit = NULL; + key_edit = nullptr; + multi_key_edit = nullptr; box_selection = memnew(Control); add_child(box_selection); diff --git a/editor/animation_track_editor.h b/editor/animation_track_editor.h index 8de56a153e..96a60cc135 100644 --- a/editor/animation_track_editor.h +++ b/editor/animation_track_editor.h @@ -140,6 +140,7 @@ class AnimationTrackEdit : public Control { }; AnimationTimelineEdit *timeline; UndoRedo *undo_redo; + Popup *path_popup; LineEdit *path; Node *root; Control *play_position; //separate control used to draw so updates for only position changed are much faster @@ -378,7 +379,7 @@ class AnimationTrackEditor : public VBoxContainer { void _root_removed(Node *p_root); - PropertyInfo _find_hint_for_track(int p_idx, NodePath &r_base_path, Variant *r_current_val = NULL); + PropertyInfo _find_hint_for_track(int p_idx, NodePath &r_base_path, Variant *r_current_val = nullptr); void _timeline_value_changed(double); @@ -512,7 +513,7 @@ public: void set_anim_pos(float p_pos); void insert_node_value_key(Node *p_node, const String &p_property, const Variant &p_value, bool p_only_if_exists = false); void insert_value_key(const String &p_property, const Variant &p_value, bool p_advance); - void insert_transform_key(Spatial *p_node, const String &p_sub, const Transform &p_xform); + void insert_transform_key(Node3D *p_node, const String &p_sub, const Transform &p_xform); void show_select_node_warning(bool p_show); diff --git a/editor/animation_track_editor_plugins.cpp b/editor/animation_track_editor_plugins.cpp index fc47a69a2c..695c294ad2 100644 --- a/editor/animation_track_editor_plugins.cpp +++ b/editor/animation_track_editor_plugins.cpp @@ -33,8 +33,8 @@ #include "editor/audio_stream_preview.h" #include "editor_resource_preview.h" #include "editor_scale.h" -#include "scene/2d/animated_sprite.h" -#include "scene/2d/sprite.h" +#include "scene/2d/animated_sprite_2d.h" +#include "scene/2d/sprite_2d.h" #include "scene/3d/sprite_3d.h" #include "scene/animation/animation_player.h" #include "servers/audio/audio_stream.h" @@ -42,12 +42,12 @@ /// BOOL /// int AnimationTrackEditBool::get_key_height() const { - Ref<Texture2D> checked = get_icon("checked", "CheckBox"); + Ref<Texture2D> checked = get_theme_icon("checked", "CheckBox"); return checked->get_height(); } Rect2 AnimationTrackEditBool::get_key_rect(int p_index, float p_pixels_sec) { - Ref<Texture2D> checked = get_icon("checked", "CheckBox"); + Ref<Texture2D> checked = get_theme_icon("checked", "CheckBox"); return Rect2(-checked->get_width() / 2, 0, checked->get_width(), get_size().height); } @@ -58,7 +58,7 @@ bool AnimationTrackEditBool::is_key_selectable_by_distance() const { void AnimationTrackEditBool::draw_key(int p_index, float p_pixels_sec, int p_x, bool p_selected, int p_clip_left, int p_clip_right) { bool checked = get_animation()->track_get_key_value(get_track(), p_index); - Ref<Texture2D> icon = get_icon(checked ? "checked" : "unchecked", "CheckBox"); + Ref<Texture2D> icon = get_theme_icon(checked ? "checked" : "unchecked", "CheckBox"); Vector2 ofs(p_x - icon->get_width() / 2, int(get_size().height - icon->get_height()) / 2); @@ -71,7 +71,7 @@ void AnimationTrackEditBool::draw_key(int p_index, float p_pixels_sec, int p_x, draw_texture(icon, ofs); if (p_selected) { - Color color = get_color("accent_color", "Editor"); + Color color = get_theme_color("accent_color", "Editor"); draw_rect_clipped(Rect2(ofs, icon->get_size()), color, false); } } @@ -80,12 +80,12 @@ void AnimationTrackEditBool::draw_key(int p_index, float p_pixels_sec, int p_x, int AnimationTrackEditColor::get_key_height() const { - Ref<Font> font = get_font("font", "Label"); + Ref<Font> font = get_theme_font("font", "Label"); return font->get_height() * 0.8; } Rect2 AnimationTrackEditColor::get_key_rect(int p_index, float p_pixels_sec) { - Ref<Font> font = get_font("font", "Label"); + Ref<Font> font = get_theme_font("font", "Label"); int fh = font->get_height() * 0.8; return Rect2(-fh / 2, 0, fh, get_size().height); } @@ -97,7 +97,7 @@ bool AnimationTrackEditColor::is_key_selectable_by_distance() const { void AnimationTrackEditColor::draw_key_link(int p_index, float p_pixels_sec, int p_x, int p_next_x, int p_clip_left, int p_clip_right) { - Ref<Font> font = get_font("font", "Label"); + Ref<Font> font = get_theme_font("font", "Label"); int fh = (font->get_height() * 0.8); int x_from = p_x + fh / 2 - 1; @@ -146,7 +146,7 @@ void AnimationTrackEditColor::draw_key(int p_index, float p_pixels_sec, int p_x, Color color = get_animation()->track_get_key_value(get_track(), p_index); - Ref<Font> font = get_font("font", "Label"); + Ref<Font> font = get_theme_font("font", "Label"); int fh = font->get_height() * 0.8; Rect2 rect(Vector2(p_x - fh / 2, int(get_size().height - fh) / 2), Size2(fh, fh)); @@ -158,7 +158,7 @@ void AnimationTrackEditColor::draw_key(int p_index, float p_pixels_sec, int p_x, draw_rect_clipped(rect, color); if (p_selected) { - Color accent = get_color("accent_color", "Editor"); + Color accent = get_theme_color("accent_color", "Editor"); draw_rect_clipped(rect, accent, false); } } @@ -185,7 +185,7 @@ int AnimationTrackEditAudio::get_key_height() const { return AnimationTrackEdit::get_key_height(); } - Ref<Font> font = get_font("font", "Label"); + Ref<Font> font = get_theme_font("font", "Label"); return int(font->get_height() * 1.5); } Rect2 AnimationTrackEditAudio::get_key_rect(int p_index, float p_pixels_sec) { @@ -218,7 +218,7 @@ Rect2 AnimationTrackEditAudio::get_key_rect(int p_index, float p_pixels_sec) { return Rect2(0, 0, len * p_pixels_sec, get_size().height); } else { - Ref<Font> font = get_font("font", "Label"); + Ref<Font> font = get_theme_font("font", "Label"); int fh = font->get_height() * 0.8; return Rect2(0, 0, fh, get_size().height); } @@ -279,7 +279,7 @@ void AnimationTrackEditAudio::draw_key(int p_index, float p_pixels_sec, int p_x, if (to_x <= from_x) return; - Ref<Font> font = get_font("font", "Label"); + Ref<Font> font = get_theme_font("font", "Label"); float fh = int(font->get_height() * 1.5); Rect2 rect = Rect2(from_x, (get_size().height - fh) / 2, to_x - from_x, fh); draw_rect(rect, Color(0.25, 0.25, 0.25)); @@ -303,22 +303,22 @@ void AnimationTrackEditAudio::draw_key(int p_index, float p_pixels_sec, int p_x, Vector<Color> color; color.push_back(Color(0.75, 0.75, 0.75)); - VS::get_singleton()->canvas_item_add_multiline(get_canvas_item(), lines, color); + RS::get_singleton()->canvas_item_add_multiline(get_canvas_item(), lines, color); if (p_selected) { - Color accent = get_color("accent_color", "Editor"); + Color accent = get_theme_color("accent_color", "Editor"); draw_rect(rect, accent, false); } } else { - Ref<Font> font = get_font("font", "Label"); + Ref<Font> font = get_theme_font("font", "Label"); int fh = font->get_height() * 0.8; Rect2 rect(Vector2(p_x, int(get_size().height - fh) / 2), Size2(fh, fh)); - Color color = get_color("font_color", "Label"); + Color color = get_theme_color("font_color", "Label"); draw_rect(rect, color); if (p_selected) { - Color accent = get_color("accent_color", "Editor"); + Color accent = get_theme_color("accent_color", "Editor"); draw_rect(rect, accent, false); } } @@ -344,7 +344,7 @@ int AnimationTrackEditSpriteFrame::get_key_height() const { return AnimationTrackEdit::get_key_height(); } - Ref<Font> font = get_font("font", "Label"); + Ref<Font> font = get_theme_font("font", "Label"); return int(font->get_height() * 2); } Rect2 AnimationTrackEditSpriteFrame::get_key_rect(int p_index, float p_pixels_sec) { @@ -357,7 +357,7 @@ Rect2 AnimationTrackEditSpriteFrame::get_key_rect(int p_index, float p_pixels_se Size2 size; - if (Object::cast_to<Sprite>(object) || Object::cast_to<Sprite3D>(object)) { + if (Object::cast_to<Sprite2D>(object) || Object::cast_to<Sprite3D>(object)) { Ref<Texture2D> texture = object->call("get_texture"); if (!texture.is_valid()) { @@ -379,7 +379,7 @@ Rect2 AnimationTrackEditSpriteFrame::get_key_rect(int p_index, float p_pixels_se if (vframes > 1) { size.y /= vframes; } - } else if (Object::cast_to<AnimatedSprite>(object) || Object::cast_to<AnimatedSprite3D>(object)) { + } else if (Object::cast_to<AnimatedSprite2D>(object) || Object::cast_to<AnimatedSprite3D>(object)) { Ref<SpriteFrames> sf = object->call("get_sprite_frames"); if (sf.is_null()) { @@ -413,7 +413,7 @@ Rect2 AnimationTrackEditSpriteFrame::get_key_rect(int p_index, float p_pixels_se size = size.floor(); - Ref<Font> font = get_font("font", "Label"); + Ref<Font> font = get_theme_font("font", "Label"); int height = int(font->get_height() * 2); int width = height * size.width / size.height; @@ -436,7 +436,7 @@ void AnimationTrackEditSpriteFrame::draw_key(int p_index, float p_pixels_sec, in Ref<Texture2D> texture; Rect2 region; - if (Object::cast_to<Sprite>(object) || Object::cast_to<Sprite3D>(object)) { + if (Object::cast_to<Sprite2D>(object) || Object::cast_to<Sprite3D>(object)) { texture = object->call("get_texture"); if (!texture.is_valid()) { @@ -473,7 +473,7 @@ void AnimationTrackEditSpriteFrame::draw_key(int p_index, float p_pixels_sec, in region.position.x += region.size.x * coords.x; region.position.y += region.size.y * coords.y; - } else if (Object::cast_to<AnimatedSprite>(object) || Object::cast_to<AnimatedSprite3D>(object)) { + } else if (Object::cast_to<AnimatedSprite2D>(object) || Object::cast_to<AnimatedSprite3D>(object)) { Ref<SpriteFrames> sf = object->call("get_sprite_frames"); if (sf.is_null()) { @@ -507,7 +507,7 @@ void AnimationTrackEditSpriteFrame::draw_key(int p_index, float p_pixels_sec, in region.size = texture->get_size(); } - Ref<Font> font = get_font("font", "Label"); + Ref<Font> font = get_theme_font("font", "Label"); int height = int(font->get_height() * 2); int width = height * region.size.width / region.size.height; @@ -520,7 +520,7 @@ void AnimationTrackEditSpriteFrame::draw_key(int p_index, float p_pixels_sec, in if (rect.position.x > p_clip_right) return; - Color accent = get_color("accent_color", "Editor"); + Color accent = get_theme_color("accent_color", "Editor"); Color bg = accent; bg.a = 0.15; @@ -551,7 +551,7 @@ int AnimationTrackEditSubAnim::get_key_height() const { return AnimationTrackEdit::get_key_height(); } - Ref<Font> font = get_font("font", "Label"); + Ref<Font> font = get_theme_font("font", "Label"); return int(font->get_height() * 1.5); } Rect2 AnimationTrackEditSubAnim::get_key_rect(int p_index, float p_pixels_sec) { @@ -580,7 +580,7 @@ Rect2 AnimationTrackEditSubAnim::get_key_rect(int p_index, float p_pixels_sec) { return Rect2(0, 0, len * p_pixels_sec, get_size().height); } else { - Ref<Font> font = get_font("font", "Label"); + Ref<Font> font = get_theme_font("font", "Label"); int fh = font->get_height() * 0.8; return Rect2(0, 0, fh, get_size().height); } @@ -633,12 +633,12 @@ void AnimationTrackEditSubAnim::draw_key(int p_index, float p_pixels_sec, int p_ if (to_x <= from_x) return; - Ref<Font> font = get_font("font", "Label"); + Ref<Font> font = get_theme_font("font", "Label"); int fh = font->get_height() * 1.5; Rect2 rect(from_x, int(get_size().height - fh) / 2, to_x - from_x, fh); - Color color = get_color("font_color", "Label"); + Color color = get_theme_color("font_color", "Label"); Color bg = color; bg.r = 1 - color.r; bg.g = 1 - color.g; @@ -673,7 +673,7 @@ void AnimationTrackEditSubAnim::draw_key(int p_index, float p_pixels_sec, int p_ } if (lines.size() > 2) { - VS::get_singleton()->canvas_item_add_multiline(get_canvas_item(), lines, colorv); + RS::get_singleton()->canvas_item_add_multiline(get_canvas_item(), lines, colorv); } int limit = to_x - from_x - 4; @@ -682,19 +682,19 @@ void AnimationTrackEditSubAnim::draw_key(int p_index, float p_pixels_sec, int p_ } if (p_selected) { - Color accent = get_color("accent_color", "Editor"); + Color accent = get_theme_color("accent_color", "Editor"); draw_rect(rect, accent, false); } } else { - Ref<Font> font = get_font("font", "Label"); + Ref<Font> font = get_theme_font("font", "Label"); int fh = font->get_height() * 0.8; Rect2 rect(Vector2(p_x, int(get_size().height - fh) / 2), Size2(fh, fh)); - Color color = get_color("font_color", "Label"); + Color color = get_theme_color("font_color", "Label"); draw_rect(rect, color); if (p_selected) { - Color accent = get_color("accent_color", "Editor"); + Color accent = get_theme_color("accent_color", "Editor"); draw_rect(rect, accent, false); } } @@ -709,13 +709,13 @@ void AnimationTrackEditSubAnim::set_node(Object *p_object) { int AnimationTrackEditVolumeDB::get_key_height() const { - Ref<Texture2D> volume_texture = get_icon("ColorTrackVu", "EditorIcons"); + Ref<Texture2D> volume_texture = get_theme_icon("ColorTrackVu", "EditorIcons"); return volume_texture->get_height() * 1.2; } void AnimationTrackEditVolumeDB::draw_bg(int p_clip_left, int p_clip_right) { - Ref<Texture2D> volume_texture = get_icon("ColorTrackVu", "EditorIcons"); + Ref<Texture2D> volume_texture = get_theme_icon("ColorTrackVu", "EditorIcons"); int tex_h = volume_texture->get_height(); int y_from = (get_size().height - tex_h) / 2; @@ -727,7 +727,7 @@ void AnimationTrackEditVolumeDB::draw_bg(int p_clip_left, int p_clip_right) { void AnimationTrackEditVolumeDB::draw_fg(int p_clip_left, int p_clip_right) { - Ref<Texture2D> volume_texture = get_icon("ColorTrackVu", "EditorIcons"); + Ref<Texture2D> volume_texture = get_theme_icon("ColorTrackVu", "EditorIcons"); int tex_h = volume_texture->get_height(); int y_from = (get_size().height - tex_h) / 2; int db0 = y_from + (24 / 80.0) * tex_h; @@ -762,12 +762,12 @@ void AnimationTrackEditVolumeDB::draw_key_link(int p_index, float p_pixels_sec, to_x = p_clip_right; } - Ref<Texture2D> volume_texture = get_icon("ColorTrackVu", "EditorIcons"); + Ref<Texture2D> volume_texture = get_theme_icon("ColorTrackVu", "EditorIcons"); int tex_h = volume_texture->get_height(); int y_from = (get_size().height - tex_h) / 2; - Color color = get_color("font_color", "Label"); + Color color = get_theme_color("font_color", "Label"); color.a *= 0.7; draw_line(Point2(from_x, y_from + h * tex_h), Point2(to_x, y_from + h_n * tex_h), color, 2); @@ -790,7 +790,7 @@ void AnimationTrackEditTypeAudio::_preview_changed(ObjectID p_which) { int AnimationTrackEditTypeAudio::get_key_height() const { - Ref<Font> font = get_font("font", "Label"); + Ref<Font> font = get_theme_font("font", "Label"); return int(font->get_height() * 1.5); } Rect2 AnimationTrackEditTypeAudio::get_key_rect(int p_index, float p_pixels_sec) { @@ -854,7 +854,7 @@ void AnimationTrackEditTypeAudio::draw_key(int p_index, float p_pixels_sec, int } } - Ref<Font> font = get_font("font", "Label"); + Ref<Font> font = get_theme_font("font", "Label"); float fh = int(font->get_height() * 1.5); float len = stream->get_length(); @@ -926,9 +926,9 @@ void AnimationTrackEditTypeAudio::draw_key(int p_index, float p_pixels_sec, int Vector<Color> color; color.push_back(Color(0.75, 0.75, 0.75)); - VS::get_singleton()->canvas_item_add_multiline(get_canvas_item(), lines, color); + RS::get_singleton()->canvas_item_add_multiline(get_canvas_item(), lines, color); - Color cut_color = get_color("accent_color", "Editor"); + Color cut_color = get_theme_color("accent_color", "Editor"); cut_color.a = 0.7; if (start_ofs > 0 && pixel_begin > p_clip_left) { draw_rect(Rect2(pixel_begin, rect.position.y, 1, rect.size.y), cut_color); @@ -938,7 +938,7 @@ void AnimationTrackEditTypeAudio::draw_key(int p_index, float p_pixels_sec, int } if (p_selected) { - Color accent = get_color("accent_color", "Editor"); + Color accent = get_theme_color("accent_color", "Editor"); draw_rect(rect, accent, false); } } @@ -1133,7 +1133,7 @@ int AnimationTrackEditTypeAnimation::get_key_height() const { return AnimationTrackEdit::get_key_height(); } - Ref<Font> font = get_font("font", "Label"); + Ref<Font> font = get_theme_font("font", "Label"); return int(font->get_height() * 1.5); } Rect2 AnimationTrackEditTypeAnimation::get_key_rect(int p_index, float p_pixels_sec) { @@ -1162,7 +1162,7 @@ Rect2 AnimationTrackEditTypeAnimation::get_key_rect(int p_index, float p_pixels_ return Rect2(0, 0, len * p_pixels_sec, get_size().height); } else { - Ref<Font> font = get_font("font", "Label"); + Ref<Font> font = get_theme_font("font", "Label"); int fh = font->get_height() * 0.8; return Rect2(0, 0, fh, get_size().height); } @@ -1215,12 +1215,12 @@ void AnimationTrackEditTypeAnimation::draw_key(int p_index, float p_pixels_sec, if (to_x <= from_x) return; - Ref<Font> font = get_font("font", "Label"); + Ref<Font> font = get_theme_font("font", "Label"); int fh = font->get_height() * 1.5; Rect2 rect(from_x, int(get_size().height - fh) / 2, to_x - from_x, fh); - Color color = get_color("font_color", "Label"); + Color color = get_theme_color("font_color", "Label"); Color bg = color; bg.r = 1 - color.r; bg.g = 1 - color.g; @@ -1255,7 +1255,7 @@ void AnimationTrackEditTypeAnimation::draw_key(int p_index, float p_pixels_sec, } if (lines.size() > 2) { - VS::get_singleton()->canvas_item_add_multiline(get_canvas_item(), lines, colorv); + RS::get_singleton()->canvas_item_add_multiline(get_canvas_item(), lines, colorv); } int limit = to_x - from_x - 4; @@ -1264,19 +1264,19 @@ void AnimationTrackEditTypeAnimation::draw_key(int p_index, float p_pixels_sec, } if (p_selected) { - Color accent = get_color("accent_color", "Editor"); + Color accent = get_theme_color("accent_color", "Editor"); draw_rect(rect, accent, false); } } else { - Ref<Font> font = get_font("font", "Label"); + Ref<Font> font = get_theme_font("font", "Label"); int fh = font->get_height() * 0.8; Rect2 rect(Vector2(p_x, int(get_size().height - fh) / 2), Size2(fh, fh)); - Color color = get_color("font_color", "Label"); + Color color = get_theme_color("font_color", "Label"); draw_rect(rect, color); if (p_selected) { - Color accent = get_color("accent_color", "Editor"); + Color accent = get_theme_color("accent_color", "Editor"); draw_rect(rect, accent, false); } } @@ -1300,14 +1300,14 @@ AnimationTrackEdit *AnimationTrackEditDefaultPlugin::create_value_track_edit(Obj return audio; } - if (p_property == "frame" && (p_object->is_class("Sprite") || p_object->is_class("Sprite3D") || p_object->is_class("AnimatedSprite") || p_object->is_class("AnimatedSprite3D"))) { + if (p_property == "frame" && (p_object->is_class("Sprite2D") || p_object->is_class("Sprite3D") || p_object->is_class("AnimatedSprite2D") || p_object->is_class("AnimatedSprite3D"))) { AnimationTrackEditSpriteFrame *sprite = memnew(AnimationTrackEditSpriteFrame); sprite->set_node(p_object); return sprite; } - if (p_property == "frame_coords" && (p_object->is_class("Sprite") || p_object->is_class("Sprite3D"))) { + if (p_property == "frame_coords" && (p_object->is_class("Sprite2D") || p_object->is_class("Sprite3D"))) { AnimationTrackEditSpriteFrame *sprite = memnew(AnimationTrackEditSpriteFrame); sprite->set_as_coords(); @@ -1335,7 +1335,7 @@ AnimationTrackEdit *AnimationTrackEditDefaultPlugin::create_value_track_edit(Obj return memnew(AnimationTrackEditColor); } - return NULL; + return nullptr; } AnimationTrackEdit *AnimationTrackEditDefaultPlugin::create_audio_track_edit() { diff --git a/editor/array_property_edit.cpp b/editor/array_property_edit.cpp index f14b12b132..9f6785ec06 100644 --- a/editor/array_property_edit.cpp +++ b/editor/array_property_edit.cpp @@ -43,7 +43,7 @@ Variant ArrayPropertyEdit::get_array() const { Variant arr = o->get(property); if (!arr.is_array()) { Callable::CallError ce; - arr = Variant::construct(default_type, NULL, 0, ce); + arr = Variant::construct(default_type, nullptr, 0, ce); } return arr; } @@ -110,7 +110,7 @@ bool ArrayPropertyEdit::_set(const StringName &p_name, const Variant &p_value) { new_type = arr.get(size - 1).get_type(); } if (new_type != Variant::NIL) { - init = Variant::construct(new_type, NULL, 0, ce); + init = Variant::construct(new_type, nullptr, 0, ce); for (int i = size; i < newsize; i++) { ur->add_do_method(this, "_set_value", i, init); } @@ -140,7 +140,7 @@ bool ArrayPropertyEdit::_set(const StringName &p_name, const Variant &p_value) { Variant value = arr.get(idx); if (value.get_type() != type && type >= 0 && type < Variant::VARIANT_MAX) { Callable::CallError ce; - Variant new_value = Variant::construct(Variant::Type(type), NULL, 0, ce); + Variant new_value = Variant::construct(Variant::Type(type), nullptr, 0, ce); UndoRedo *ur = EditorNode::get_undo_redo(); ur->create_action(TTR("Change Array Value Type")); diff --git a/editor/audio_stream_preview.cpp b/editor/audio_stream_preview.cpp index 64d435a901..fe28c913a7 100644 --- a/editor/audio_stream_preview.cpp +++ b/editor/audio_stream_preview.cpp @@ -212,7 +212,7 @@ void AudioStreamPreviewGenerator::_bind_methods() { ADD_SIGNAL(MethodInfo("preview_updated", PropertyInfo(Variant::INT, "obj_id"))); } -AudioStreamPreviewGenerator *AudioStreamPreviewGenerator::singleton = NULL; +AudioStreamPreviewGenerator *AudioStreamPreviewGenerator::singleton = nullptr; void AudioStreamPreviewGenerator::_notification(int p_what) { if (p_what == NOTIFICATION_PROCESS) { @@ -221,7 +221,7 @@ void AudioStreamPreviewGenerator::_notification(int p_what) { if (!E->get().generating) { if (E->get().thread) { Thread::wait_to_finish(E->get().thread); - E->get().thread = NULL; + E->get().thread = nullptr; } if (!ObjectDB::get_instance(E->key())) { //no longer in use, get rid of preview to_erase.push_back(E->key()); diff --git a/editor/code_editor.cpp b/editor/code_editor.cpp index ddd702fc6c..77e20b971c 100644 --- a/editor/code_editor.cpp +++ b/editor/code_editor.cpp @@ -30,7 +30,7 @@ #include "code_editor.h" -#include "core/os/input.h" +#include "core/input/input_filter.h" #include "core/os/keyboard.h" #include "core/string_builder.h" #include "editor/editor_scale.h" @@ -69,10 +69,10 @@ GotoLineDialog::GotoLineDialog() { set_title(TTR("Go to Line")); VBoxContainer *vbc = memnew(VBoxContainer); - vbc->set_anchor_and_margin(MARGIN_LEFT, ANCHOR_BEGIN, 8 * EDSCALE); - vbc->set_anchor_and_margin(MARGIN_TOP, ANCHOR_BEGIN, 8 * EDSCALE); - vbc->set_anchor_and_margin(MARGIN_RIGHT, ANCHOR_END, -8 * EDSCALE); - vbc->set_anchor_and_margin(MARGIN_BOTTOM, ANCHOR_END, -8 * EDSCALE); + vbc->set_anchor_and_margin(MARGIN_LEFT, Control::ANCHOR_BEGIN, 8 * EDSCALE); + vbc->set_anchor_and_margin(MARGIN_TOP, Control::ANCHOR_BEGIN, 8 * EDSCALE); + vbc->set_anchor_and_margin(MARGIN_RIGHT, Control::ANCHOR_END, -8 * EDSCALE); + vbc->set_anchor_and_margin(MARGIN_BOTTOM, Control::ANCHOR_END, -8 * EDSCALE); add_child(vbc); Label *l = memnew(Label); @@ -82,7 +82,7 @@ GotoLineDialog::GotoLineDialog() { line = memnew(LineEdit); vbc->add_child(line); register_text_enter(line); - text_editor = NULL; + text_editor = nullptr; set_hide_on_ok(false); } @@ -91,25 +91,25 @@ void FindReplaceBar::_notification(int p_what) { if (p_what == NOTIFICATION_READY) { - find_prev->set_icon(get_icon("MoveUp", "EditorIcons")); - find_next->set_icon(get_icon("MoveDown", "EditorIcons")); - hide_button->set_normal_texture(get_icon("Close", "EditorIcons")); - hide_button->set_hover_texture(get_icon("Close", "EditorIcons")); - hide_button->set_pressed_texture(get_icon("Close", "EditorIcons")); + find_prev->set_icon(get_theme_icon("MoveUp", "EditorIcons")); + find_next->set_icon(get_theme_icon("MoveDown", "EditorIcons")); + hide_button->set_normal_texture(get_theme_icon("Close", "EditorIcons")); + hide_button->set_hover_texture(get_theme_icon("Close", "EditorIcons")); + hide_button->set_pressed_texture(get_theme_icon("Close", "EditorIcons")); hide_button->set_custom_minimum_size(hide_button->get_normal_texture()->get_size()); } else if (p_what == NOTIFICATION_VISIBILITY_CHANGED) { set_process_unhandled_input(is_visible_in_tree()); } else if (p_what == EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED) { - find_prev->set_icon(get_icon("MoveUp", "EditorIcons")); - find_next->set_icon(get_icon("MoveDown", "EditorIcons")); - hide_button->set_normal_texture(get_icon("Close", "EditorIcons")); - hide_button->set_hover_texture(get_icon("Close", "EditorIcons")); - hide_button->set_pressed_texture(get_icon("Close", "EditorIcons")); + find_prev->set_icon(get_theme_icon("MoveUp", "EditorIcons")); + find_next->set_icon(get_theme_icon("MoveDown", "EditorIcons")); + hide_button->set_normal_texture(get_theme_icon("Close", "EditorIcons")); + hide_button->set_hover_texture(get_theme_icon("Close", "EditorIcons")); + hide_button->set_pressed_texture(get_theme_icon("Close", "EditorIcons")); hide_button->set_custom_minimum_size(hide_button->get_normal_texture()->get_size()); } else if (p_what == NOTIFICATION_THEME_CHANGED) { - matches_label->add_color_override("font_color", results_count > 0 ? get_color("font_color", "Label") : get_color("error_color", "Editor")); + matches_label->add_theme_color_override("font_color", results_count > 0 ? get_theme_color("font_color", "Label") : get_theme_color("error_color", "Editor")); } } @@ -226,6 +226,10 @@ void FindReplaceBar::_replace_all() { text_edit->begin_complex_operation(); + if (selection_enabled && is_selection_only()) { + text_edit->cursor_set_line(selection_begin.width); + text_edit->cursor_set_column(selection_begin.height); + } if (search_current()) { do { // replace area @@ -243,7 +247,7 @@ void FindReplaceBar::_replace_all() { if (selection_enabled && is_selection_only()) { if (match_from < selection_begin || match_to > selection_end) { - continue; + break; // Done. } // Replace but adjust selection bounds. @@ -277,7 +281,7 @@ void FindReplaceBar::_replace_all() { } text_edit->set_v_scroll(vsval); - matches_label->add_color_override("font_color", rc > 0 ? get_color("font_color", "Label") : get_color("error_color", "Editor")); + matches_label->add_theme_color_override("font_color", rc > 0 ? get_theme_color("font_color", "Label") : get_theme_color("error_color", "Editor")); matches_label->set_text(vformat(TTR("%d replaced."), rc)); text_edit->call_deferred("connect", "text_changed", Callable(this, "_editor_text_changed")); @@ -289,6 +293,10 @@ void FindReplaceBar::_get_search_from(int &r_line, int &r_col) { r_line = text_edit->cursor_get_line(); r_col = text_edit->cursor_get_column(); + if (text_edit->is_selection_active() && is_selection_only()) { + return; + } + if (r_line == result_line && r_col >= result_col && r_col <= result_col + get_search_text().length()) { r_col = result_col; } @@ -331,7 +339,7 @@ void FindReplaceBar::_update_matches_label() { } else { matches_label->show(); - matches_label->add_color_override("font_color", results_count > 0 ? get_color("font_color", "Label") : get_color("error_color", "Editor")); + matches_label->add_theme_color_override("font_color", results_count > 0 ? get_theme_color("font_color", "Label") : get_theme_color("error_color", "Editor")); matches_label->set_text(vformat(results_count == 1 ? TTR("%d match.") : TTR("%d matches."), results_count)); } } @@ -505,7 +513,7 @@ void FindReplaceBar::_search_text_changed(const String &p_text) { void FindReplaceBar::_search_text_entered(const String &p_text) { - if (Input::get_singleton()->is_key_pressed(KEY_SHIFT)) { + if (InputFilter::get_singleton()->is_key_pressed(KEY_SHIFT)) { search_prev(); } else { search_next(); @@ -517,7 +525,7 @@ void FindReplaceBar::_replace_text_entered(const String &p_text) { if (selection_only->is_pressed() && text_edit->is_selection_active()) { _replace_all(); _hide_bar(); - } else if (Input::get_singleton()->is_key_pressed(KEY_SHIFT)) { + } else if (InputFilter::get_singleton()->is_key_pressed(KEY_SHIFT)) { _replace(); search_prev(); } else { @@ -712,7 +720,7 @@ void CodeTextEditor::_text_editor_gui_input(const Ref<InputEvent> &p_event) { Ref<InputEventMagnifyGesture> magnify_gesture = p_event; if (magnify_gesture.is_valid()) { - Ref<DynamicFont> font = text_editor->get_font("font"); + Ref<DynamicFont> font = text_editor->get_theme_font("font"); if (font.is_valid()) { if (font->get_size() != (int)font_size) { @@ -760,7 +768,7 @@ void CodeTextEditor::_zoom_changed() { } void CodeTextEditor::_reset_zoom() { - Ref<DynamicFont> font = text_editor->get_font("font"); // Reset source font size to default. + Ref<DynamicFont> font = text_editor->get_theme_font("font"); // Reset source font size to default. if (font.is_valid()) { EditorSettings::get_singleton()->set("interface/editor/code_font_size", 14); @@ -828,41 +836,41 @@ Ref<Texture2D> CodeTextEditor::_get_completion_icon(const ScriptCodeCompletionOp Ref<Texture2D> tex; switch (p_option.kind) { case ScriptCodeCompletionOption::KIND_CLASS: { - if (has_icon(p_option.display, "EditorIcons")) { - tex = get_icon(p_option.display, "EditorIcons"); + if (has_theme_icon(p_option.display, "EditorIcons")) { + tex = get_theme_icon(p_option.display, "EditorIcons"); } else { - tex = get_icon("Object", "EditorIcons"); + tex = get_theme_icon("Object", "EditorIcons"); } } break; case ScriptCodeCompletionOption::KIND_ENUM: - tex = get_icon("Enum", "EditorIcons"); + tex = get_theme_icon("Enum", "EditorIcons"); break; case ScriptCodeCompletionOption::KIND_FILE_PATH: - tex = get_icon("File", "EditorIcons"); + tex = get_theme_icon("File", "EditorIcons"); break; case ScriptCodeCompletionOption::KIND_NODE_PATH: - tex = get_icon("NodePath", "EditorIcons"); + tex = get_theme_icon("NodePath", "EditorIcons"); break; case ScriptCodeCompletionOption::KIND_VARIABLE: - tex = get_icon("Variant", "EditorIcons"); + tex = get_theme_icon("Variant", "EditorIcons"); break; case ScriptCodeCompletionOption::KIND_CONSTANT: - tex = get_icon("MemberConstant", "EditorIcons"); + tex = get_theme_icon("MemberConstant", "EditorIcons"); break; case ScriptCodeCompletionOption::KIND_MEMBER: - tex = get_icon("MemberProperty", "EditorIcons"); + tex = get_theme_icon("MemberProperty", "EditorIcons"); break; case ScriptCodeCompletionOption::KIND_SIGNAL: - tex = get_icon("MemberSignal", "EditorIcons"); + tex = get_theme_icon("MemberSignal", "EditorIcons"); break; case ScriptCodeCompletionOption::KIND_FUNCTION: - tex = get_icon("MemberMethod", "EditorIcons"); + tex = get_theme_icon("MemberMethod", "EditorIcons"); break; case ScriptCodeCompletionOption::KIND_PLAIN_TEXT: - tex = get_icon("CubeMesh", "EditorIcons"); + tex = get_theme_icon("CubeMesh", "EditorIcons"); break; default: - tex = get_icon("String", "EditorIcons"); + tex = get_theme_icon("String", "EditorIcons"); break; } return tex; @@ -877,7 +885,7 @@ void CodeTextEditor::_font_resize_timeout() { bool CodeTextEditor::_add_font_size(int p_delta) { - Ref<DynamicFont> font = text_editor->get_font("font"); + Ref<DynamicFont> font = text_editor->get_theme_font("font"); if (font.is_valid()) { int new_size = CLAMP(font->get_size() + p_delta, 8 * EDSCALE, 96 * EDSCALE); @@ -1454,18 +1462,18 @@ void CodeTextEditor::goto_error() { void CodeTextEditor::_update_font() { - text_editor->add_font_override("font", get_font("source", "EditorFonts")); + text_editor->add_theme_font_override("font", get_theme_font("source", "EditorFonts")); - error->add_font_override("font", get_font("status_source", "EditorFonts")); - error->add_color_override("font_color", get_color("error_color", "Editor")); + error->add_theme_font_override("font", get_theme_font("status_source", "EditorFonts")); + error->add_theme_color_override("font_color", get_theme_color("error_color", "Editor")); - Ref<Font> status_bar_font = get_font("status_source", "EditorFonts"); - error->add_font_override("font", status_bar_font); + Ref<Font> status_bar_font = get_theme_font("status_source", "EditorFonts"); + error->add_theme_font_override("font", status_bar_font); int count = status_bar->get_child_count(); for (int i = 0; i < count; i++) { Control *n = Object::cast_to<Control>(status_bar->get_child(i)); if (n) - n->add_font_override("font", status_bar_font); + n->add_theme_font_override("font", status_bar_font); } } @@ -1516,7 +1524,7 @@ void CodeTextEditor::_set_show_warnings_panel(bool p_show) { } void CodeTextEditor::_toggle_scripts_pressed() { - toggle_scripts_button->set_icon(ScriptEditor::get_singleton()->toggle_scripts_panel() ? get_icon("Back", "EditorIcons") : get_icon("Forward", "EditorIcons")); + toggle_scripts_button->set_icon(ScriptEditor::get_singleton()->toggle_scripts_panel() ? get_theme_icon("Back", "EditorIcons") : get_theme_icon("Forward", "EditorIcons")); } void CodeTextEditor::_error_pressed(const Ref<InputEvent> &p_event) { @@ -1540,8 +1548,8 @@ void CodeTextEditor::_notification(int p_what) { _update_font(); } break; case NOTIFICATION_ENTER_TREE: { - warning_button->set_icon(get_icon("NodeWarning", "EditorIcons")); - add_constant_override("separation", 4 * EDSCALE); + warning_button->set_icon(get_theme_icon("NodeWarning", "EditorIcons")); + add_theme_constant_override("separation", 4 * EDSCALE); } break; case NOTIFICATION_VISIBILITY_CHANGED: { if (toggle_scripts_button->is_visible()) { @@ -1650,13 +1658,13 @@ void CodeTextEditor::show_toggle_scripts_button() { } void CodeTextEditor::update_toggle_scripts_button() { - toggle_scripts_button->set_icon(ScriptEditor::get_singleton()->is_scripts_panel_toggled() ? get_icon("Back", "EditorIcons") : get_icon("Forward", "EditorIcons")); + toggle_scripts_button->set_icon(ScriptEditor::get_singleton()->is_scripts_panel_toggled() ? get_theme_icon("Back", "EditorIcons") : get_theme_icon("Forward", "EditorIcons")); toggle_scripts_button->set_tooltip(TTR("Toggle Scripts Panel") + " (" + ED_GET_SHORTCUT("script_editor/toggle_scripts_panel")->get_as_text() + ")"); } CodeTextEditor::CodeTextEditor() { - code_complete_func = NULL; + code_complete_func = nullptr; ED_SHORTCUT("script_editor/zoom_in", TTR("Zoom In"), KEY_MASK_CMD | KEY_EQUAL); ED_SHORTCUT("script_editor/zoom_out", TTR("Zoom Out"), KEY_MASK_CMD | KEY_MINUS); ED_SHORTCUT("script_editor/reset_zoom", TTR("Reset Zoom"), KEY_MASK_CMD | KEY_0); @@ -1729,8 +1737,8 @@ CodeTextEditor::CodeTextEditor() { warning_count_label->set_default_cursor_shape(CURSOR_POINTING_HAND); warning_count_label->set_mouse_filter(MOUSE_FILTER_STOP); warning_count_label->set_tooltip(TTR("Warnings")); - warning_count_label->add_color_override("font_color", EditorNode::get_singleton()->get_gui_base()->get_color("warning_color", "Editor")); - warning_count_label->add_font_override("font", EditorNode::get_singleton()->get_gui_base()->get_font("status_source", "EditorFonts")); + warning_count_label->add_theme_color_override("font_color", EditorNode::get_singleton()->get_gui_base()->get_theme_color("warning_color", "Editor")); + warning_count_label->add_theme_font_override("font", EditorNode::get_singleton()->get_gui_base()->get_theme_font("status_source", "EditorFonts")); warning_count_label->connect("gui_input", callable_mp(this, &CodeTextEditor::_warning_label_gui_input)); is_warnings_panel_opened = false; @@ -1740,7 +1748,7 @@ CodeTextEditor::CodeTextEditor() { line_and_col_txt = memnew(Label); status_bar->add_child(line_and_col_txt); line_and_col_txt->set_v_size_flags(SIZE_EXPAND | SIZE_SHRINK_CENTER); - line_and_col_txt->add_font_override("font", EditorNode::get_singleton()->get_gui_base()->get_font("status_source", "EditorFonts")); + line_and_col_txt->add_theme_font_override("font", EditorNode::get_singleton()->get_gui_base()->get_theme_font("status_source", "EditorFonts")); line_and_col_txt->set_tooltip(TTR("Line and column numbers.")); line_and_col_txt->set_mouse_filter(MOUSE_FILTER_STOP); diff --git a/editor/collada/SCsub b/editor/collada/SCsub deleted file mode 100644 index 2b1e889fb0..0000000000 --- a/editor/collada/SCsub +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env python - -Import('env') - -env.add_source_files(env.editor_sources, "*.cpp") diff --git a/editor/connections_dialog.cpp b/editor/connections_dialog.cpp index 60a15984ee..bef5c3c2b0 100644 --- a/editor/connections_dialog.cpp +++ b/editor/connections_dialog.cpp @@ -40,7 +40,7 @@ static Node *_find_first_script(Node *p_root, Node *p_node) { if (p_node != p_root && p_node->get_owner() != p_root) { - return NULL; + return nullptr; } if (!p_node->get_script().is_null()) { return p_node; @@ -54,7 +54,7 @@ static Node *_find_first_script(Node *p_root, Node *p_node) { } } - return NULL; + return nullptr; } class ConnectDialogBinds : public Object { @@ -115,7 +115,7 @@ void ConnectDialog::ok_pressed() { if (dst_method->get_text() == "") { error->set_text(TTR("Method in target node must be specified.")); - error->popup_centered_minsize(); + error->popup_centered(); return; } Node *target = tree->get_selected(); @@ -125,7 +125,7 @@ void ConnectDialog::ok_pressed() { if (target->get_script().is_null()) { if (!target->has_method(dst_method->get_text())) { error->set_text(TTR("Target method not found. Specify a valid method or attach a script to the target node.")); - error->popup_centered_minsize(); + error->popup_centered(); return; } } @@ -315,7 +315,7 @@ void ConnectDialog::init(ConnectionData c, bool bEdit) { source = static_cast<Node *>(c.source); signal = c.signal; - tree->set_selected(NULL); + tree->set_selected(nullptr); tree->set_marked(source, true); if (c.target) { @@ -341,7 +341,7 @@ void ConnectDialog::init(ConnectionData c, bool bEdit) { void ConnectDialog::popup_dialog(const String &p_for_signal) { from_signal->set_text(p_for_signal); - error_label->add_color_override("font_color", get_color("error_color", "Editor")); + error_label->add_theme_color_override("font_color", error_label->get_theme_color("error_color", "Editor")); if (!advanced->is_pressed()) error_label->set_visible(!_find_first_script(get_tree()->get_edited_scene_root(), get_tree()->get_edited_scene_root())); @@ -351,14 +351,14 @@ void ConnectDialog::popup_dialog(const String &p_for_signal) { void ConnectDialog::_advanced_pressed() { if (advanced->is_pressed()) { - set_custom_minimum_size(Size2(900, 500) * EDSCALE); + set_min_size(Size2(900, 500) * EDSCALE); connect_to_label->set_text(TTR("Connect to Node:")); tree->set_connect_to_script_mode(false); vbc_right->show(); error_label->hide(); } else { - set_custom_minimum_size(Size2(600, 500) * EDSCALE); + set_min_size(Size2(600, 500) * EDSCALE); set_size(Size2()); connect_to_label->set_text(TTR("Connect to Script:")); tree->set_connect_to_script_mode(true); @@ -369,23 +369,23 @@ void ConnectDialog::_advanced_pressed() { _update_ok_enabled(); - set_position((get_viewport_rect().size - get_custom_minimum_size()) / 2); + popup_centered(); } ConnectDialog::ConnectDialog() { - set_custom_minimum_size(Size2(600, 500) * EDSCALE); + set_min_size(Size2(600, 500) * EDSCALE); VBoxContainer *vbc = memnew(VBoxContainer); add_child(vbc); HBoxContainer *main_hb = memnew(HBoxContainer); vbc->add_child(main_hb); - main_hb->set_v_size_flags(SIZE_EXPAND_FILL); + main_hb->set_v_size_flags(Control::SIZE_EXPAND_FILL); VBoxContainer *vbc_left = memnew(VBoxContainer); main_hb->add_child(vbc_left); - vbc_left->set_h_size_flags(SIZE_EXPAND_FILL); + vbc_left->set_h_size_flags(Control::SIZE_EXPAND_FILL); from_signal = memnew(LineEdit); from_signal->set_editable(false); @@ -407,13 +407,13 @@ ConnectDialog::ConnectDialog() { vbc_right = memnew(VBoxContainer); main_hb->add_child(vbc_right); - vbc_right->set_h_size_flags(SIZE_EXPAND_FILL); + vbc_right->set_h_size_flags(Control::SIZE_EXPAND_FILL); vbc_right->hide(); HBoxContainer *add_bind_hb = memnew(HBoxContainer); type_list = memnew(OptionButton); - type_list->set_h_size_flags(SIZE_EXPAND_FILL); + type_list->set_h_size_flags(Control::SIZE_EXPAND_FILL); add_bind_hb->add_child(type_list); type_list->add_item("bool", Variant::BOOL); type_list->add_item("int", Variant::INT); @@ -451,7 +451,7 @@ ConnectDialog::ConnectDialog() { vbc_left->add_margin_child(TTR("Receiver Method:"), dstm_hb); dst_method = memnew(LineEdit); - dst_method->set_h_size_flags(SIZE_EXPAND_FILL); + dst_method->set_h_size_flags(Control::SIZE_EXPAND_FILL); dst_method->connect("text_entered", callable_mp(this, &ConnectDialog::_text_entered)); dstm_hb->add_child(dst_method); @@ -477,8 +477,6 @@ ConnectDialog::ConnectDialog() { oneshot->set_tooltip(TTR("Disconnects the signal after its first emission.")); vbc_right->add_child(oneshot); - set_as_toplevel(true); - cdbinds = memnew(ConnectDialogBinds); error = memnew(AcceptDialog); @@ -499,7 +497,7 @@ ConnectDialog::~ConnectDialog() { Control *ConnectionsDockTree::make_custom_tooltip(const String &p_text) const { EditorHelpBit *help_bit = memnew(EditorHelpBit); - help_bit->add_style_override("panel", get_stylebox("panel", "TooltipPanel")); + help_bit->add_theme_style_override("panel", get_theme_stylebox("panel", "TooltipPanel")); help_bit->get_rich_text()->set_fixed_size_to_width(360 * EDSCALE); String text = TTR("Signal:") + " [u][b]" + p_text.get_slice("::", 0) + "[/b][/u]"; @@ -576,7 +574,7 @@ void ConnectionsDock::_make_or_edit_connection() { } // IMPORTANT NOTE: _disconnect and _connect cause an update_tree, which will delete the object "it" is pointing to. - it = NULL; + it = nullptr; if (add_script_function) { editor->emit_signal("script_add_function_request", target, cToMake.method, script_function_args); @@ -909,24 +907,24 @@ void ConnectionsDock::update_tree() { else name = scr->get_class(); - if (has_icon(scr->get_class(), "EditorIcons")) { - icon = get_icon(scr->get_class(), "EditorIcons"); + if (has_theme_icon(scr->get_class(), "EditorIcons")) { + icon = get_theme_icon(scr->get_class(), "EditorIcons"); } } } else { ClassDB::get_signal_list(base, &node_signals2, true); - if (has_icon(base, "EditorIcons")) { - icon = get_icon(base, "EditorIcons"); + if (has_theme_icon(base, "EditorIcons")) { + icon = get_theme_icon(base, "EditorIcons"); } name = base; } if (!icon.is_valid()) { - icon = get_icon("Object", "EditorIcons"); + icon = get_theme_icon("Object", "EditorIcons"); } - TreeItem *pitem = NULL; + TreeItem *pitem = nullptr; if (node_signals2.size()) { pitem = tree->create_item(root); @@ -934,7 +932,7 @@ void ConnectionsDock::update_tree() { pitem->set_icon(0, icon); pitem->set_selectable(0, false); pitem->set_editable(0, false); - pitem->set_custom_bg_color(0, get_color("prop_subsection", "Editor")); + pitem->set_custom_bg_color(0, get_theme_color("prop_subsection", "Editor")); node_signals2.sort(); } @@ -970,7 +968,7 @@ void ConnectionsDock::update_tree() { sinfo["name"] = signal_name; sinfo["args"] = argnames; item->set_metadata(0, sinfo); - item->set_icon(0, get_icon("Signal", "EditorIcons")); + item->set_icon(0, get_theme_icon("Signal", "EditorIcons")); // Set tooltip with the signal's documentation. { @@ -1045,7 +1043,7 @@ void ConnectionsDock::update_tree() { item2->set_text(0, path); Connection cd = c; item2->set_metadata(0, cd); - item2->set_icon(0, get_icon("Slot", "EditorIcons")); + item2->set_icon(0, get_theme_icon("Slot", "EditorIcons")); } } @@ -1072,7 +1070,7 @@ ConnectionsDock::ConnectionsDock(EditorNode *p_editor) { tree->set_select_mode(Tree::SELECT_ROW); tree->set_hide_root(true); vbc->add_child(tree); - tree->set_v_size_flags(SIZE_EXPAND_FILL); + tree->set_v_size_flags(Control::SIZE_EXPAND_FILL); tree->set_allow_rmb_select(true); connect_button = memnew(Button); @@ -1083,11 +1081,9 @@ ConnectionsDock::ConnectionsDock(EditorNode *p_editor) { connect_button->connect("pressed", callable_mp(this, &ConnectionsDock::_connect_pressed)); connect_dialog = memnew(ConnectDialog); - connect_dialog->set_as_toplevel(true); add_child(connect_dialog); disconnect_all_dialog = memnew(ConfirmationDialog); - disconnect_all_dialog->set_as_toplevel(true); add_child(disconnect_all_dialog); disconnect_all_dialog->connect("confirmed", callable_mp(this, &ConnectionsDock::_disconnect_all)); disconnect_all_dialog->set_text(TTR("Are you sure you want to remove all connections from this signal?")); @@ -1110,7 +1106,7 @@ ConnectionsDock::ConnectionsDock(EditorNode *p_editor) { tree->connect("item_activated", callable_mp(this, &ConnectionsDock::_tree_item_activated)); tree->connect("item_rmb_selected", callable_mp(this, &ConnectionsDock::_rmb_pressed)); - add_constant_override("separation", 3 * EDSCALE); + add_theme_constant_override("separation", 3 * EDSCALE); } ConnectionsDock::~ConnectionsDock() { diff --git a/editor/connections_dialog.h b/editor/connections_dialog.h index 8f29a4f720..91d0d5c32c 100644 --- a/editor/connections_dialog.h +++ b/editor/connections_dialog.h @@ -203,7 +203,7 @@ public: void set_node(Node *p_node); void update_tree(); - ConnectionsDock(EditorNode *p_editor = NULL); + ConnectionsDock(EditorNode *p_editor = nullptr); ~ConnectionsDock(); }; diff --git a/editor/create_dialog.cpp b/editor/create_dialog.cpp index b220e82f6c..6cbb1b1791 100644 --- a/editor/create_dialog.cpp +++ b/editor/create_dialog.cpp @@ -193,7 +193,7 @@ void CreateDialog::add_type(const String &p_type, HashMap<String, TreeItem *> &p item->set_text(0, p_type + " (" + ScriptServer::get_global_class_path(p_type).get_file() + ")"); } if (!can_instance) { - item->set_custom_color(0, get_color("disabled_font_color", "Editor")); + item->set_custom_color(0, search_options->get_theme_color("disabled_font_color", "Editor")); item->set_selectable(0, false); } else if (!(*to_select && (*to_select)->get_text(0) == search_box->get_text())) { String search_term = search_box->get_text().to_lower(); @@ -310,11 +310,11 @@ void CreateDialog::_update_search() { EditorData &ed = EditorNode::get_editor_data(); root->set_text(0, base_type); - if (has_icon(base_type, "EditorIcons")) { - root->set_icon(0, get_icon(base_type, "EditorIcons")); + if (search_options->has_theme_icon(base_type, "EditorIcons")) { + root->set_icon(0, search_options->get_theme_icon(base_type, "EditorIcons")); } - TreeItem *to_select = search_box->get_text() == base_type ? root : NULL; + TreeItem *to_select = search_box->get_text() == base_type ? root : nullptr; for (List<StringName>::Element *I = type_list.front(); I; I = I->next()) { @@ -417,7 +417,7 @@ void CreateDialog::_update_search() { favorite->set_pressed(favorite_list.find(to_select->get_text(0)) != -1); } - get_ok()->set_disabled(root->get_children() == NULL); + get_ok()->set_disabled(root->get_children() == nullptr); } void CreateDialog::_confirmed() { @@ -460,23 +460,22 @@ void CreateDialog::_notification(int p_what) { switch (p_what) { case NOTIFICATION_ENTER_TREE: { connect("confirmed", callable_mp(this, &CreateDialog::_confirmed)); - search_box->set_right_icon(get_icon("Search", "EditorIcons")); + search_box->set_right_icon(search_options->get_theme_icon("Search", "EditorIcons")); search_box->set_clear_button_enabled(true); - favorite->set_icon(get_icon("Favorites", "EditorIcons")); + favorite->set_icon(search_options->get_theme_icon("Favorites", "EditorIcons")); } break; case NOTIFICATION_EXIT_TREE: { disconnect("confirmed", callable_mp(this, &CreateDialog::_confirmed)); } break; case NOTIFICATION_VISIBILITY_CHANGED: { - if (is_visible_in_tree()) { + if (is_visible()) { search_box->call_deferred("grab_focus"); // still not visible search_box->select_all(); + } else { + EditorSettings::get_singleton()->get_project_metadata("dialog_bounds", "create_new_node", Rect2(get_position(), get_size())); + search_loaded_scripts.clear(); } } break; - case NOTIFICATION_POPUP_HIDE: { - EditorSettings::get_singleton()->get_project_metadata("dialog_bounds", "create_new_node", get_rect()); - search_loaded_scripts.clear(); - } break; } } @@ -539,7 +538,7 @@ Object *CreateDialog::instance_selected() { } } - return NULL; + return nullptr; } void CreateDialog::_item_selected() { @@ -562,7 +561,7 @@ void CreateDialog::_item_selected() { } void CreateDialog::_hide_requested() { - _closed(); // From WindowDialog. + _cancel_pressed(); // From AcceptDialog. } void CreateDialog::_favorite_toggled() { @@ -662,7 +661,7 @@ Variant CreateDialog::get_drag_data_fw(const Point2 &p_point, Control *p_from) { ToolButton *tb = memnew(ToolButton); tb->set_icon(ti->get_icon(0)); tb->set_text(ti->get_text(0)); - set_drag_preview(tb); + favorites->set_drag_preview(tb); return d; } @@ -743,8 +742,6 @@ CreateDialog::CreateDialog() { is_replace_mode = false; - set_resizable(true); - HSplitContainer *hsc = memnew(HSplitContainer); add_child(hsc); @@ -754,7 +751,7 @@ CreateDialog::CreateDialog() { VBoxContainer *fav_vb = memnew(VBoxContainer); vsc->add_child(fav_vb); fav_vb->set_custom_minimum_size(Size2(150, 100) * EDSCALE); - fav_vb->set_v_size_flags(SIZE_EXPAND_FILL); + fav_vb->set_v_size_flags(Control::SIZE_EXPAND_FILL); favorites = memnew(Tree); fav_vb->add_margin_child(TTR("Favorites:"), favorites, true); @@ -763,13 +760,16 @@ CreateDialog::CreateDialog() { favorites->set_allow_reselect(true); favorites->connect("cell_selected", callable_mp(this, &CreateDialog::_favorite_selected)); favorites->connect("item_activated", callable_mp(this, &CreateDialog::_favorite_activated)); - favorites->set_drag_forwarding(this); - favorites->add_constant_override("draw_guides", 1); +#ifndef _MSC_VER +#warning cant forward drag data to a non control, must be fixed +#endif + //favorites->set_drag_forwarding(this); + favorites->add_theme_constant_override("draw_guides", 1); VBoxContainer *rec_vb = memnew(VBoxContainer); vsc->add_child(rec_vb); rec_vb->set_custom_minimum_size(Size2(150, 100) * EDSCALE); - rec_vb->set_v_size_flags(SIZE_EXPAND_FILL); + rec_vb->set_v_size_flags(Control::SIZE_EXPAND_FILL); recent = memnew(Tree); rec_vb->add_margin_child(TTR("Recent:"), recent, true); @@ -778,15 +778,15 @@ CreateDialog::CreateDialog() { recent->set_allow_reselect(true); recent->connect("cell_selected", callable_mp(this, &CreateDialog::_history_selected)); recent->connect("item_activated", callable_mp(this, &CreateDialog::_history_activated)); - recent->add_constant_override("draw_guides", 1); + recent->add_theme_constant_override("draw_guides", 1); VBoxContainer *vbc = memnew(VBoxContainer); hsc->add_child(vbc); vbc->set_custom_minimum_size(Size2(300, 0) * EDSCALE); - vbc->set_h_size_flags(SIZE_EXPAND_FILL); + vbc->set_h_size_flags(Control::SIZE_EXPAND_FILL); HBoxContainer *search_hb = memnew(HBoxContainer); search_box = memnew(LineEdit); - search_box->set_h_size_flags(SIZE_EXPAND_FILL); + search_box->set_h_size_flags(Control::SIZE_EXPAND_FILL); search_hb->add_child(search_box); favorite = memnew(Button); favorite->set_flat(true); diff --git a/editor/debugger/SCsub b/editor/debugger/SCsub index 2b1e889fb0..359d04e5df 100644 --- a/editor/debugger/SCsub +++ b/editor/debugger/SCsub @@ -1,5 +1,5 @@ #!/usr/bin/env python -Import('env') +Import("env") env.add_source_files(env.editor_sources, "*.cpp") diff --git a/editor/debugger/editor_debugger_inspector.cpp b/editor/debugger/editor_debugger_inspector.cpp index 9587daf93e..00ed2bbc4c 100644 --- a/editor/debugger/editor_debugger_inspector.cpp +++ b/editor/debugger/editor_debugger_inspector.cpp @@ -125,7 +125,7 @@ void EditorDebuggerInspector::_object_selected(ObjectID p_object) { } ObjectID EditorDebuggerInspector::add_object(const Array &p_arr) { - EditorDebuggerRemoteObject *debugObj = NULL; + EditorDebuggerRemoteObject *debugObj = nullptr; SceneDebuggerObject obj; obj.deserialize(p_arr); @@ -211,7 +211,7 @@ void EditorDebuggerInspector::clear_cache() { for (Map<ObjectID, EditorDebuggerRemoteObject *>::Element *E = remote_objects.front(); E; E = E->next()) { EditorNode *editor = EditorNode::get_singleton(); if (editor->get_editor_history()->get_current() == E->value()->get_instance_id()) { - editor->push_item(NULL); + editor->push_item(nullptr); } memdelete(E->value()); } @@ -221,7 +221,7 @@ void EditorDebuggerInspector::clear_cache() { Object *EditorDebuggerInspector::get_object(ObjectID p_id) { if (remote_objects.has(p_id)) return remote_objects[p_id]; - return NULL; + return nullptr; } void EditorDebuggerInspector::add_stack_variable(const Array &p_array) { diff --git a/editor/debugger/editor_debugger_node.cpp b/editor/debugger/editor_debugger_node.cpp index f4a8102b79..3302b50103 100644 --- a/editor/debugger/editor_debugger_node.cpp +++ b/editor/debugger/editor_debugger_node.cpp @@ -47,14 +47,14 @@ void _for_all(TabContainer *p_node, const Func &p_func) { } } -EditorDebuggerNode *EditorDebuggerNode::singleton = NULL; +EditorDebuggerNode *EditorDebuggerNode::singleton = nullptr; EditorDebuggerNode::EditorDebuggerNode() { if (!singleton) singleton = this; - add_constant_override("margin_left", -EditorNode::get_singleton()->get_gui_base()->get_stylebox("BottomPanelDebuggerOverride", "EditorStyles")->get_margin(MARGIN_LEFT)); - add_constant_override("margin_right", -EditorNode::get_singleton()->get_gui_base()->get_stylebox("BottomPanelDebuggerOverride", "EditorStyles")->get_margin(MARGIN_RIGHT)); + add_theme_constant_override("margin_left", -EditorNode::get_singleton()->get_gui_base()->get_theme_stylebox("BottomPanelDebuggerOverride", "EditorStyles")->get_margin(MARGIN_LEFT)); + add_theme_constant_override("margin_right", -EditorNode::get_singleton()->get_gui_base()->get_theme_stylebox("BottomPanelDebuggerOverride", "EditorStyles")->get_margin(MARGIN_RIGHT)); tabs = memnew(TabContainer); tabs->set_tab_align(TabContainer::ALIGN_LEFT); @@ -64,7 +64,7 @@ EditorDebuggerNode::EditorDebuggerNode() { Ref<StyleBoxEmpty> empty; empty.instance(); - tabs->add_style_override("panel", empty); + tabs->add_theme_style_override("panel", empty); auto_switch_remote_scene_tree = EDITOR_DEF("debugger/auto_switch_to_remote_scene_tree", false); _add_debugger(); @@ -110,7 +110,7 @@ ScriptEditorDebugger *EditorDebuggerNode::_add_debugger() { if (tabs->get_tab_count() > 1) { node->clear_style(); tabs->set_tabs_visible(true); - tabs->add_style_override("panel", EditorNode::get_singleton()->get_gui_base()->get_stylebox("DebuggerPanel", "EditorStyles")); + tabs->add_theme_style_override("panel", EditorNode::get_singleton()->get_gui_base()->get_theme_stylebox("DebuggerPanel", "EditorStyles")); } return node; @@ -223,10 +223,10 @@ void EditorDebuggerNode::_notification(int p_what) { } break; case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: { if (tabs->get_tab_count() > 1) { - add_constant_override("margin_left", -EditorNode::get_singleton()->get_gui_base()->get_stylebox("BottomPanelDebuggerOverride", "EditorStyles")->get_margin(MARGIN_LEFT)); - add_constant_override("margin_right", -EditorNode::get_singleton()->get_gui_base()->get_stylebox("BottomPanelDebuggerOverride", "EditorStyles")->get_margin(MARGIN_RIGHT)); + add_theme_constant_override("margin_left", -EditorNode::get_singleton()->get_gui_base()->get_theme_stylebox("BottomPanelDebuggerOverride", "EditorStyles")->get_margin(MARGIN_LEFT)); + add_theme_constant_override("margin_right", -EditorNode::get_singleton()->get_gui_base()->get_theme_stylebox("BottomPanelDebuggerOverride", "EditorStyles")->get_margin(MARGIN_RIGHT)); - tabs->add_style_override("panel", EditorNode::get_singleton()->get_gui_base()->get_stylebox("DebuggerPanel", "EditorStyles")); + tabs->add_theme_style_override("panel", EditorNode::get_singleton()->get_gui_base()->get_theme_stylebox("DebuggerPanel", "EditorStyles")); } } break; default: @@ -262,9 +262,9 @@ void EditorDebuggerNode::_notification(int p_what) { } else { debugger_button->set_text(TTR("Debugger") + " (" + itos(error_count + warning_count) + ")"); if (error_count == 0) { - debugger_button->set_icon(get_icon("Warning", "EditorIcons")); + debugger_button->set_icon(get_theme_icon("Warning", "EditorIcons")); } else { - debugger_button->set_icon(get_icon("Error", "EditorIcons")); + debugger_button->set_icon(get_theme_icon("Error", "EditorIcons")); } } last_error_count = error_count; @@ -291,13 +291,13 @@ void EditorDebuggerNode::_notification(int p_what) { // Take connections. if (server->is_connection_available()) { - ScriptEditorDebugger *debugger = NULL; + ScriptEditorDebugger *debugger = nullptr; _for_all(tabs, [&](ScriptEditorDebugger *dbg) { if (debugger || dbg->is_session_active()) return; debugger = dbg; }); - if (debugger == NULL) { + if (debugger == nullptr) { if (tabs->get_tab_count() <= 4) { // Max 4 debugging sessions active. debugger = _add_debugger(); } else { @@ -356,7 +356,7 @@ void EditorDebuggerNode::_debugger_changed(int p_tab) { if (get_inspected_remote_object()) { // Clear inspected object, you can only inspect objects in selected debugger. // Hopefully, in the future, we will have one inspector per debugger. - EditorNode::get_singleton()->push_item(NULL); + EditorNode::get_singleton()->push_item(nullptr); } if (remote_scene_tree->is_visible_in_tree()) { get_current_debugger()->request_remote_tree(); @@ -371,7 +371,6 @@ void EditorDebuggerNode::set_script_debug_button(MenuButton *p_button) { script_menu->set_text(TTR("Debug")); script_menu->set_switch_on_hover(true); PopupMenu *p = script_menu->get_popup(); - p->set_hide_on_window_lose_focus(true); p->add_shortcut(ED_GET_SHORTCUT("debugger/step_into"), DEBUG_STEP); p->add_shortcut(ED_GET_SHORTCUT("debugger/step_over"), DEBUG_NEXT); p->add_separator(); diff --git a/editor/debugger/editor_debugger_node.h b/editor/debugger/editor_debugger_node.h index 6181ccdb5f..9467442c9a 100644 --- a/editor/debugger/editor_debugger_node.h +++ b/editor/debugger/editor_debugger_node.h @@ -85,9 +85,9 @@ private: }; Ref<EditorDebuggerServer> server; - TabContainer *tabs = NULL; - Button *debugger_button = NULL; - MenuButton *script_menu = NULL; + TabContainer *tabs = nullptr; + Button *debugger_button = nullptr; + MenuButton *script_menu = nullptr; Ref<Script> stack_script; // Why?!? @@ -95,7 +95,7 @@ private: int last_warning_count = 0; float inspect_edited_object_timeout = 0; - EditorDebuggerTree *remote_scene_tree = NULL; + EditorDebuggerTree *remote_scene_tree = nullptr; float remote_scene_tree_timeout = 0.0; bool auto_switch_remote_scene_tree = false; bool debug_with_external_editor = false; diff --git a/editor/debugger/editor_debugger_tree.cpp b/editor/debugger/editor_debugger_tree.cpp index 019a5d0fc3..c2b94c79bb 100644 --- a/editor/debugger/editor_debugger_tree.cpp +++ b/editor/debugger/editor_debugger_tree.cpp @@ -33,6 +33,7 @@ #include "editor/editor_node.h" #include "scene/debugger/scene_debugger.h" #include "scene/resources/packed_scene.h" +#include "servers/display_server.h" EditorDebuggerTree::EditorDebuggerTree() { set_v_size_flags(SIZE_EXPAND_FILL); @@ -106,9 +107,9 @@ void EditorDebuggerTree::_scene_tree_rmb_selected(const Vector2 &p_position) { item->select(0); item_menu->clear(); - item_menu->add_icon_item(get_icon("CreateNewSceneFrom", "EditorIcons"), TTR("Save Branch as Scene"), ITEM_MENU_SAVE_REMOTE_NODE); - item_menu->add_icon_item(get_icon("CopyNodePath", "EditorIcons"), TTR("Copy Node Path"), ITEM_MENU_COPY_NODE_PATH); - item_menu->set_global_position(get_global_mouse_position()); + item_menu->add_icon_item(get_theme_icon("CreateNewSceneFrom", "EditorIcons"), TTR("Save Branch as Scene"), ITEM_MENU_SAVE_REMOTE_NODE); + item_menu->add_icon_item(get_theme_icon("CopyNodePath", "EditorIcons"), TTR("Copy Node Path"), ITEM_MENU_COPY_NODE_PATH); + item_menu->set_position(get_screen_transform().xform(get_local_mouse_position())); item_menu->popup(); } @@ -134,7 +135,7 @@ void EditorDebuggerTree::update_scene_tree(const SceneDebuggerTree *p_tree, int // Nodes are in a flatten list, depth first. Use a stack of parents, avoid recursion. List<Pair<TreeItem *, int>> parents; for (int i = 0; i < p_tree->nodes.size(); i++) { - TreeItem *parent = NULL; + TreeItem *parent = nullptr; if (parents.size()) { // Find last parent. Pair<TreeItem *, int> &p = parents[0]; parent = p.first; @@ -190,7 +191,7 @@ void EditorDebuggerTree::update_scene_tree(const SceneDebuggerTree *p_tree, int // Check if parent expects more children. for (int j = 0; j < parents.size(); j++) { if (parents[j].first == item) { - parent = NULL; + parent = nullptr; break; // Might have more children. } } @@ -210,7 +211,7 @@ String EditorDebuggerTree::get_selected_path() { String EditorDebuggerTree::_get_path(TreeItem *p_item) { ERR_FAIL_COND_V(!p_item, ""); - if (p_item->get_parent() == NULL) { + if (p_item->get_parent() == nullptr) { return "/root"; } String text = p_item->get_text(0); @@ -229,7 +230,7 @@ void EditorDebuggerTree::_item_menu_id_pressed(int p_option) { case ITEM_MENU_SAVE_REMOTE_NODE: { file_dialog->set_access(EditorFileDialog::ACCESS_RESOURCES); - file_dialog->set_mode(EditorFileDialog::MODE_SAVE_FILE); + file_dialog->set_file_mode(EditorFileDialog::FILE_MODE_SAVE_FILE); List<String> extensions; Ref<PackedScene> sd = memnew(PackedScene); @@ -257,7 +258,7 @@ void EditorDebuggerTree::_item_menu_id_pressed(int p_option) { text = text.substr(slash + 1); } } - OS::get_singleton()->set_clipboard(text); + DisplayServer::get_singleton()->clipboard_set(text); } break; } } diff --git a/editor/debugger/editor_debugger_tree.h b/editor/debugger/editor_debugger_tree.h index d9084bc596..342eb23194 100644 --- a/editor/debugger/editor_debugger_tree.h +++ b/editor/debugger/editor_debugger_tree.h @@ -50,8 +50,8 @@ private: int debugger_id = 0; bool updating_scene_tree = false; Set<ObjectID> unfold_cache; - PopupMenu *item_menu = NULL; - EditorFileDialog *file_dialog = NULL; + PopupMenu *item_menu = nullptr; + EditorFileDialog *file_dialog = nullptr; String _get_path(TreeItem *p_item); void _scene_tree_folded(Object *p_obj); diff --git a/editor/debugger/editor_network_profiler.cpp b/editor/debugger/editor_network_profiler.cpp index 21ef66d1aa..b8c795d9ca 100644 --- a/editor/debugger/editor_network_profiler.cpp +++ b/editor/debugger/editor_network_profiler.cpp @@ -41,14 +41,14 @@ void EditorNetworkProfiler::_bind_methods() { void EditorNetworkProfiler::_notification(int p_what) { if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED) { - activate->set_icon(get_icon("Play", "EditorIcons")); - clear_button->set_icon(get_icon("Clear", "EditorIcons")); - incoming_bandwidth_text->set_right_icon(get_icon("ArrowDown", "EditorIcons")); - outgoing_bandwidth_text->set_right_icon(get_icon("ArrowUp", "EditorIcons")); + activate->set_icon(get_theme_icon("Play", "EditorIcons")); + clear_button->set_icon(get_theme_icon("Clear", "EditorIcons")); + incoming_bandwidth_text->set_right_icon(get_theme_icon("ArrowDown", "EditorIcons")); + outgoing_bandwidth_text->set_right_icon(get_theme_icon("ArrowUp", "EditorIcons")); // This needs to be done here to set the faded color when the profiler is first opened - incoming_bandwidth_text->add_color_override("font_color_uneditable", get_color("font_color", "Editor") * Color(1, 1, 1, 0.5)); - outgoing_bandwidth_text->add_color_override("font_color_uneditable", get_color("font_color", "Editor") * Color(1, 1, 1, 0.5)); + incoming_bandwidth_text->add_theme_color_override("font_color_uneditable", get_theme_color("font_color", "Editor") * Color(1, 1, 1, 0.5)); + outgoing_bandwidth_text->add_theme_color_override("font_color_uneditable", get_theme_color("font_color", "Editor") * Color(1, 1, 1, 0.5)); } } @@ -77,10 +77,10 @@ void EditorNetworkProfiler::_update_frame() { void EditorNetworkProfiler::_activate_pressed() { if (activate->is_pressed()) { - activate->set_icon(get_icon("Stop", "EditorIcons")); + activate->set_icon(get_theme_icon("Stop", "EditorIcons")); activate->set_text(TTR("Stop")); } else { - activate->set_icon(get_icon("Play", "EditorIcons")); + activate->set_icon(get_theme_icon("Play", "EditorIcons")); activate->set_text(TTR("Start")); } emit_signal("enable_profiling", activate->is_pressed()); @@ -118,12 +118,12 @@ void EditorNetworkProfiler::set_bandwidth(int p_incoming, int p_outgoing) { outgoing_bandwidth_text->set_text(vformat(TTR("%s/s"), String::humanize_size(p_outgoing))); // Make labels more prominent when the bandwidth is greater than 0 to attract user attention - incoming_bandwidth_text->add_color_override( + incoming_bandwidth_text->add_theme_color_override( "font_color_uneditable", - get_color("font_color", "Editor") * Color(1, 1, 1, p_incoming > 0 ? 1 : 0.5)); - outgoing_bandwidth_text->add_color_override( + get_theme_color("font_color", "Editor") * Color(1, 1, 1, p_incoming > 0 ? 1 : 0.5)); + outgoing_bandwidth_text->add_theme_color_override( "font_color_uneditable", - get_color("font_color", "Editor") * Color(1, 1, 1, p_outgoing > 0 ? 1 : 0.5)); + get_theme_color("font_color", "Editor") * Color(1, 1, 1, p_outgoing > 0 ? 1 : 0.5)); } bool EditorNetworkProfiler::is_profiling() { @@ -133,7 +133,7 @@ bool EditorNetworkProfiler::is_profiling() { EditorNetworkProfiler::EditorNetworkProfiler() { HBoxContainer *hb = memnew(HBoxContainer); - hb->add_constant_override("separation", 8 * EDSCALE); + hb->add_theme_constant_override("separation", 8 * EDSCALE); add_child(hb); activate = memnew(Button); diff --git a/editor/debugger/editor_profiler.cpp b/editor/debugger/editor_profiler.cpp index ca4979563d..1577e24ac0 100644 --- a/editor/debugger/editor_profiler.cpp +++ b/editor/debugger/editor_profiler.cpp @@ -132,11 +132,11 @@ String EditorProfiler::_get_time_as_text(const Metric &m, float p_time, int p_ca Color EditorProfiler::_get_color_from_signature(const StringName &p_signature) const { - Color bc = get_color("error_color", "Editor"); + Color bc = get_theme_color("error_color", "Editor"); double rot = ABS(double(p_signature.hash()) / double(0x7FFFFFFF)); Color c; c.set_hsv(rot, bc.get_s(), bc.get_v()); - return c.linear_interpolate(get_color("base_color", "Editor"), 0.07); + return c.linear_interpolate(get_theme_color("base_color", "Editor"), 0.07); } void EditorProfiler::_item_edited() { @@ -176,7 +176,7 @@ void EditorProfiler::_update_plot() { } uint8_t *wr = graph_image.ptrw(); - const Color background_color = get_color("dark_color_2", "Editor"); + const Color background_color = get_theme_color("dark_color_2", "Editor"); // Clear the previous frame and set the background color. for (int i = 0; i < desired_len; i += 4) { @@ -420,10 +420,10 @@ void EditorProfiler::_update_frame() { void EditorProfiler::_activate_pressed() { if (activate->is_pressed()) { - activate->set_icon(get_icon("Stop", "EditorIcons")); + activate->set_icon(get_theme_icon("Stop", "EditorIcons")); activate->set_text(TTR("Stop")); } else { - activate->set_icon(get_icon("Play", "EditorIcons")); + activate->set_icon(get_theme_icon("Play", "EditorIcons")); activate->set_text(TTR("Start")); } emit_signal("enable_profiling", activate->is_pressed()); @@ -438,8 +438,8 @@ void EditorProfiler::_clear_pressed() { void EditorProfiler::_notification(int p_what) { if (p_what == NOTIFICATION_ENTER_TREE) { - activate->set_icon(get_icon("Play", "EditorIcons")); - clear_button->set_icon(get_icon("Clear", "EditorIcons")); + activate->set_icon(get_theme_icon("Play", "EditorIcons")); + clear_button->set_icon(get_theme_icon("Clear", "EditorIcons")); } } @@ -712,7 +712,7 @@ EditorProfiler::EditorProfiler() { hb->add_child(cursor_metric_edit); cursor_metric_edit->connect("value_changed", callable_mp(this, &EditorProfiler::_cursor_metric_changed)); - hb->add_constant_override("separation", 8 * EDSCALE); + hb->add_theme_constant_override("separation", 8 * EDSCALE); h_split = memnew(HSplitContainer); add_child(h_split); diff --git a/editor/debugger/editor_visual_profiler.cpp b/editor/debugger/editor_visual_profiler.cpp index 48425062d1..d2edba5970 100644 --- a/editor/debugger/editor_visual_profiler.cpp +++ b/editor/debugger/editor_visual_profiler.cpp @@ -128,11 +128,11 @@ String EditorVisualProfiler::_get_time_as_text(float p_time) { Color EditorVisualProfiler::_get_color_from_signature(const StringName &p_signature) const { - Color bc = get_color("error_color", "Editor"); + Color bc = get_theme_color("error_color", "Editor"); double rot = ABS(double(p_signature.hash()) / double(0x7FFFFFFF)); Color c; c.set_hsv(rot, bc.get_s(), bc.get_v()); - return c.linear_interpolate(get_color("base_color", "Editor"), 0.07); + return c.linear_interpolate(get_theme_color("base_color", "Editor"), 0.07); } void EditorVisualProfiler::_item_selected() { @@ -327,7 +327,7 @@ void EditorVisualProfiler::_update_frame(bool p_focus_selected) { int cursor_metric = _get_cursor_index(); - Ref<Texture> track_icon = get_icon("TrackColor", "EditorIcons"); + Ref<Texture> track_icon = get_theme_icon("TrackColor", "EditorIcons"); ERR_FAIL_INDEX(cursor_metric, frame_metrics.size()); @@ -418,11 +418,11 @@ void EditorVisualProfiler::_update_frame(bool p_focus_selected) { void EditorVisualProfiler::_activate_pressed() { if (activate->is_pressed()) { - activate->set_icon(get_icon("Stop", "EditorIcons")); + activate->set_icon(get_theme_icon("Stop", "EditorIcons")); activate->set_text(TTR("Stop")); _clear_pressed(); //always clear on start } else { - activate->set_icon(get_icon("Play", "EditorIcons")); + activate->set_icon(get_theme_icon("Play", "EditorIcons")); activate->set_text(TTR("Start")); } emit_signal("enable_profiling", activate->is_pressed()); @@ -437,8 +437,8 @@ void EditorVisualProfiler::_clear_pressed() { void EditorVisualProfiler::_notification(int p_what) { if (p_what == NOTIFICATION_ENTER_TREE) { - activate->set_icon(get_icon("Play", "EditorIcons")); - clear_button->set_icon(get_icon("Clear", "EditorIcons")); + activate->set_icon(get_theme_icon("Play", "EditorIcons")); + clear_button->set_icon(get_theme_icon("Clear", "EditorIcons")); } } @@ -446,7 +446,7 @@ void EditorVisualProfiler::_graph_tex_draw() { if (last_metric < 0) return; - Ref<Font> font = get_font("font", "Label"); + Ref<Font> font = get_theme_font("font", "Label"); if (seeking) { int max_frames = frame_metrics.size(); @@ -777,7 +777,7 @@ EditorVisualProfiler::EditorVisualProfiler() { hb->add_child(cursor_metric_edit); cursor_metric_edit->connect("value_changed", callable_mp(this, &EditorVisualProfiler::_cursor_metric_changed)); - hb->add_constant_override("separation", 8 * EDSCALE); + hb->add_theme_constant_override("separation", 8 * EDSCALE); h_split = memnew(HSplitContainer); add_child(h_split); diff --git a/editor/debugger/script_editor_debugger.cpp b/editor/debugger/script_editor_debugger.cpp index dcb1611f71..1971abadc4 100644 --- a/editor/debugger/script_editor_debugger.cpp +++ b/editor/debugger/script_editor_debugger.cpp @@ -42,10 +42,10 @@ #include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/plugins/canvas_item_editor_plugin.h" -#include "editor/plugins/spatial_editor_plugin.h" +#include "editor/plugins/node_3d_editor_plugin.h" #include "editor/property_editor.h" #include "main/performance.h" -#include "scene/3d/camera.h" +#include "scene/3d/camera_3d.h" #include "scene/debugger/scene_debugger.h" #include "scene/gui/dialogs.h" #include "scene/gui/label.h" @@ -58,6 +58,7 @@ #include "scene/gui/texture_button.h" #include "scene/gui/tree.h" #include "scene/resources/packed_scene.h" +#include "servers/display_server.h" using CameraOverride = EditorDebuggerNode::CameraOverride; @@ -73,15 +74,15 @@ void ScriptEditorDebugger::_put_msg(String p_message, Array p_data) { void ScriptEditorDebugger::debug_copy() { String msg = reason->get_text(); if (msg == "") return; - OS::get_singleton()->set_clipboard(msg); + DisplayServer::get_singleton()->clipboard_set(msg); } void ScriptEditorDebugger::debug_skip_breakpoints() { skip_breakpoints_value = !skip_breakpoints_value; if (skip_breakpoints_value) - skip_breakpoints->set_icon(get_icon("DebugSkipBreakpointsOn", "EditorIcons")); + skip_breakpoints->set_icon(get_theme_icon("DebugSkipBreakpointsOn", "EditorIcons")); else - skip_breakpoints->set_icon(get_icon("DebugSkipBreakpointsOff", "EditorIcons")); + skip_breakpoints->set_icon(get_theme_icon("DebugSkipBreakpointsOff", "EditorIcons")); Array msg; msg.push_back(skip_breakpoints_value); @@ -116,7 +117,7 @@ void ScriptEditorDebugger::debug_continue() { // Allow focus stealing only if we actually run this client for security. if (remote_pid && EditorNode::get_singleton()->has_child_process(remote_pid)) - OS::get_singleton()->enable_for_stealing_focus(remote_pid); + DisplayServer::get_singleton()->enable_for_stealing_focus(remote_pid); _clear_execution(); _put_msg("continue", Array()); @@ -129,15 +130,15 @@ void ScriptEditorDebugger::update_tabs() { } else { errors_tab->set_name(TTR("Errors") + " (" + itos(error_count + warning_count) + ")"); if (error_count == 0) { - tabs->set_tab_icon(errors_tab->get_index(), get_icon("Warning", "EditorIcons")); + tabs->set_tab_icon(errors_tab->get_index(), get_theme_icon("Warning", "EditorIcons")); } else { - tabs->set_tab_icon(errors_tab->get_index(), get_icon("Error", "EditorIcons")); + tabs->set_tab_icon(errors_tab->get_index(), get_theme_icon("Error", "EditorIcons")); } } } void ScriptEditorDebugger::clear_style() { - tabs->add_style_override("panel", NULL); + tabs->add_theme_style_override("panel", nullptr); } void ScriptEditorDebugger::save_node(ObjectID p_id, const String &p_file) { @@ -253,7 +254,7 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da _update_buttons_state(); _set_reason_text(error, MESSAGE_ERROR); emit_signal("breaked", true, can_continue); - OS::get_singleton()->move_window_to_foreground(); + DisplayServer::get_singleton()->window_move_to_foreground(); if (error != "") { tabs->set_current_tab(0); } @@ -310,8 +311,8 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da it->set_text(3, String::humanize_size(bytes)); total += bytes; - if (has_icon(type, "EditorIcons")) - it->set_icon(0, get_icon(type, "EditorIcons")); + if (has_theme_icon(type, "EditorIcons")) + it->set_icon(0, get_theme_icon(type, "EditorIcons")); } vmem_total->set_tooltip(TTR("Bytes:") + " " + itos(total)); @@ -442,7 +443,7 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da TreeItem *error = error_tree->create_item(r); error->set_collapsed(true); - error->set_icon(0, get_icon(oe.warning ? "Warning" : "Error", "EditorIcons")); + error->set_icon(0, get_theme_icon(oe.warning ? "Warning" : "Error", "EditorIcons")); error->set_text(0, time); error->set_text_align(0, TreeItem::ALIGN_LEFT); @@ -660,13 +661,13 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da void ScriptEditorDebugger::_set_reason_text(const String &p_reason, MessageType p_type) { switch (p_type) { case MESSAGE_ERROR: - reason->add_color_override("font_color", get_color("error_color", "Editor")); + reason->add_theme_color_override("font_color", get_theme_color("error_color", "Editor")); break; case MESSAGE_WARNING: - reason->add_color_override("font_color", get_color("warning_color", "Editor")); + reason->add_theme_color_override("font_color", get_theme_color("warning_color", "Editor")); break; default: - reason->add_color_override("font_color", get_color("success_color", "Editor")); + reason->add_theme_color_override("font_color", get_theme_color("success_color", "Editor")); } reason->set_text(p_reason); reason->set_tooltip(p_reason.word_wrap(80)); @@ -693,8 +694,8 @@ void ScriptEditorDebugger::_performance_draw() { info_message->hide(); - Ref<StyleBox> graph_sb = get_stylebox("normal", "TextEdit"); - Ref<Font> graph_font = get_font("font", "TextEdit"); + Ref<StyleBox> graph_sb = get_theme_stylebox("normal", "TextEdit"); + Ref<Font> graph_font = get_theme_font("font", "TextEdit"); int cols = Math::ceil(Math::sqrt((float)which.size())); int rows = Math::ceil((float)which.size() / cols); @@ -714,7 +715,7 @@ void ScriptEditorDebugger::_performance_draw() { r.position += graph_sb->get_offset(); r.size -= graph_sb->get_minimum_size(); int pi = which[i]; - Color c = get_color("accent_color", "Editor"); + Color c = get_theme_color("accent_color", "Editor"); float h = (float)which[i] / (float)(perf_items.size()); // Use a darker color on light backgrounds for better visibility float value_multiplier = EditorSettings::get_singleton()->is_dark_theme() ? 1.4 : 0.55; @@ -753,20 +754,20 @@ void ScriptEditorDebugger::_notification(int p_what) { case NOTIFICATION_ENTER_TREE: { - skip_breakpoints->set_icon(get_icon("DebugSkipBreakpointsOff", "EditorIcons")); - copy->set_icon(get_icon("ActionCopy", "EditorIcons")); + skip_breakpoints->set_icon(get_theme_icon("DebugSkipBreakpointsOff", "EditorIcons")); + copy->set_icon(get_theme_icon("ActionCopy", "EditorIcons")); - step->set_icon(get_icon("DebugStep", "EditorIcons")); - next->set_icon(get_icon("DebugNext", "EditorIcons")); - dobreak->set_icon(get_icon("Pause", "EditorIcons")); - docontinue->set_icon(get_icon("DebugContinue", "EditorIcons")); + step->set_icon(get_theme_icon("DebugStep", "EditorIcons")); + next->set_icon(get_theme_icon("DebugNext", "EditorIcons")); + dobreak->set_icon(get_theme_icon("Pause", "EditorIcons")); + docontinue->set_icon(get_theme_icon("DebugContinue", "EditorIcons")); le_set->connect("pressed", callable_mp(this, &ScriptEditorDebugger::_live_edit_set)); le_clear->connect("pressed", callable_mp(this, &ScriptEditorDebugger::_live_edit_clear)); error_tree->connect("item_selected", callable_mp(this, &ScriptEditorDebugger::_error_selected)); error_tree->connect("item_activated", callable_mp(this, &ScriptEditorDebugger::_error_activated)); - vmem_refresh->set_icon(get_icon("Reload", "EditorIcons")); + vmem_refresh->set_icon(get_theme_icon("Reload", "EditorIcons")); - reason->add_color_override("font_color", get_color("error_color", "Editor")); + reason->add_theme_color_override("font_color", get_theme_color("error_color", "Editor")); } break; case NOTIFICATION_PROCESS: { @@ -790,12 +791,12 @@ void ScriptEditorDebugger::_notification(int p_what) { } else if (camera_override >= CameraOverride::OVERRIDE_3D_1) { int viewport_idx = camera_override - CameraOverride::OVERRIDE_3D_1; - SpatialEditorViewport *viewport = SpatialEditor::get_singleton()->get_editor_viewport(viewport_idx); - Camera *const cam = viewport->get_camera(); + Node3DEditorViewport *viewport = Node3DEditor::get_singleton()->get_editor_viewport(viewport_idx); + Camera3D *const cam = viewport->get_camera(); Array msg; msg.push_back(cam->get_camera_transform()); - if (cam->get_projection() == Camera::PROJECTION_ORTHOGONAL) { + if (cam->get_projection() == Camera3D::PROJECTION_ORTHOGONAL) { msg.push_back(false); msg.push_back(cam->get_size()); } else { @@ -829,16 +830,16 @@ void ScriptEditorDebugger::_notification(int p_what) { } break; case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: { - if (tabs->has_stylebox_override("panel")) { - tabs->add_style_override("panel", editor->get_gui_base()->get_stylebox("DebuggerPanel", "EditorStyles")); + if (tabs->has_theme_stylebox_override("panel")) { + tabs->add_theme_style_override("panel", editor->get_gui_base()->get_theme_stylebox("DebuggerPanel", "EditorStyles")); } - copy->set_icon(get_icon("ActionCopy", "EditorIcons")); - step->set_icon(get_icon("DebugStep", "EditorIcons")); - next->set_icon(get_icon("DebugNext", "EditorIcons")); - dobreak->set_icon(get_icon("Pause", "EditorIcons")); - docontinue->set_icon(get_icon("DebugContinue", "EditorIcons")); - vmem_refresh->set_icon(get_icon("Reload", "EditorIcons")); + copy->set_icon(get_theme_icon("ActionCopy", "EditorIcons")); + step->set_icon(get_theme_icon("DebugStep", "EditorIcons")); + next->set_icon(get_theme_icon("DebugNext", "EditorIcons")); + dobreak->set_icon(get_theme_icon("Pause", "EditorIcons")); + docontinue->set_icon(get_theme_icon("DebugContinue", "EditorIcons")); + vmem_refresh->set_icon(get_theme_icon("Reload", "EditorIcons")); } break; } } @@ -922,7 +923,7 @@ void ScriptEditorDebugger::stop() { res_path_cache.clear(); profiler_signature.clear(); - inspector->edit(NULL); + inspector->edit(nullptr); _update_buttons_state(); } @@ -972,13 +973,13 @@ void ScriptEditorDebugger::_stack_dump_frame_selected() { msg.push_back(frame); _put_msg("get_stack_frame_vars", msg); } else { - inspector->edit(NULL); + inspector->edit(nullptr); } } void ScriptEditorDebugger::_export_csv() { - file_dialog->set_mode(EditorFileDialog::MODE_SAVE_FILE); + file_dialog->set_file_mode(EditorFileDialog::FILE_MODE_SAVE_FILE); file_dialog->set_access(EditorFileDialog::ACCESS_FILESYSTEM); file_dialog->popup_centered_ratio(); } @@ -1388,7 +1389,7 @@ void ScriptEditorDebugger::_error_tree_item_rmb_selected(const Vector2 &p_pos) { item_menu->set_size(Size2(1, 1)); if (error_tree->is_anything_selected()) { - item_menu->add_icon_item(get_icon("ActionCopy", "EditorIcons"), TTR("Copy Error"), 0); + item_menu->add_icon_item(get_theme_icon("ActionCopy", "EditorIcons"), TTR("Copy Error"), 0); } if (item_menu->get_item_count() > 0) { @@ -1404,9 +1405,9 @@ void ScriptEditorDebugger::_item_menu_id_pressed(int p_option) { String type; - if (ti->get_icon(0) == get_icon("Warning", "EditorIcons")) { + if (ti->get_icon(0) == get_theme_icon("Warning", "EditorIcons")) { type = "W "; - } else if (ti->get_icon(0) == get_icon("Error", "EditorIcons")) { + } else if (ti->get_icon(0) == get_theme_icon("Error", "EditorIcons")) { type = "E "; } @@ -1420,7 +1421,7 @@ void ScriptEditorDebugger::_item_menu_id_pressed(int p_option) { ci = ci->get_next(); } - OS::get_singleton()->set_clipboard(text); + DisplayServer::get_singleton()->clipboard_set(text); } void ScriptEditorDebugger::_tab_changed(int p_tab) { @@ -1461,7 +1462,7 @@ ScriptEditorDebugger::ScriptEditorDebugger(EditorNode *p_editor) { tabs = memnew(TabContainer); tabs->set_tab_align(TabContainer::ALIGN_LEFT); - tabs->add_style_override("panel", editor->get_gui_base()->get_stylebox("DebuggerPanel", "EditorStyles")); + tabs->add_theme_style_override("panel", editor->get_gui_base()->get_theme_stylebox("DebuggerPanel", "EditorStyles")); tabs->connect("tab_changed", callable_mp(this, &ScriptEditorDebugger::_tab_changed)); add_child(tabs); diff --git a/editor/debugger/script_editor_debugger.h b/editor/debugger/script_editor_debugger.h index 7944d7cb99..9cb7dc2edf 100644 --- a/editor/debugger/script_editor_debugger.h +++ b/editor/debugger/script_editor_debugger.h @@ -107,7 +107,7 @@ private: Button *docontinue; // Reference to "Remote" tab in scene tree. Needed by _live_edit_set and buttons state. // Each debugger should have it's tree in the future I guess. - const Tree *editor_remote_tree = NULL; + const Tree *editor_remote_tree = nullptr; List<Vector<float>> perf_history; Vector<float> perf_max; @@ -255,7 +255,7 @@ public: bool is_skip_breakpoints(); virtual Size2 get_minimum_size() const; - ScriptEditorDebugger(EditorNode *p_editor = NULL); + ScriptEditorDebugger(EditorNode *p_editor = nullptr); ~ScriptEditorDebugger(); }; diff --git a/editor/dependency_editor.cpp b/editor/dependency_editor.cpp index 5a0accd45c..2302fb0780 100644 --- a/editor/dependency_editor.cpp +++ b/editor/dependency_editor.cpp @@ -174,7 +174,7 @@ void DependencyEditor::_update_list() { TreeItem *root = tree->create_item(); - Ref<Texture2D> folder = get_icon("folder", "FileDialog"); + Ref<Texture2D> folder = tree->get_theme_icon("folder", "FileDialog"); bool broken = false; @@ -256,7 +256,7 @@ DependencyEditor::DependencyEditor() { vb->add_child(hbc); MarginContainer *mc = memnew(MarginContainer); - mc->set_v_size_flags(SIZE_EXPAND_FILL); + mc->set_v_size_flags(Control::SIZE_EXPAND_FILL); mc->add_child(tree); vb->add_child(mc); @@ -264,7 +264,7 @@ DependencyEditor::DependencyEditor() { set_title(TTR("Dependency Editor")); search = memnew(EditorFileDialog); search->connect("file_selected", callable_mp(this, &DependencyEditor::_searched)); - search->set_mode(EditorFileDialog::MODE_OPEN_FILE); + search->set_file_mode(EditorFileDialog::FILE_MODE_OPEN_FILE); search->set_title(TTR("Search Replacement Resource:")); add_child(search); } @@ -422,17 +422,17 @@ void DependencyRemoveDialog::_build_removed_dependency_tree(const Vector<Removed if (!tree_items.has(rd.dependency_folder)) { TreeItem *folder_item = owners->create_item(owners->get_root()); folder_item->set_text(0, rd.dependency_folder); - folder_item->set_icon(0, get_icon("Folder", "EditorIcons")); + folder_item->set_icon(0, owners->get_theme_icon("Folder", "EditorIcons")); tree_items[rd.dependency_folder] = folder_item; } TreeItem *dependency_item = owners->create_item(tree_items[rd.dependency_folder]); dependency_item->set_text(0, rd.dependency); - dependency_item->set_icon(0, get_icon("Warning", "EditorIcons")); + dependency_item->set_icon(0, owners->get_theme_icon("Warning", "EditorIcons")); tree_items[rd.dependency] = dependency_item; } else { TreeItem *dependency_item = owners->create_item(owners->get_root()); dependency_item->set_text(0, rd.dependency); - dependency_item->set_icon(0, get_icon("Warning", "EditorIcons")); + dependency_item->set_icon(0, owners->get_theme_icon("Warning", "EditorIcons")); tree_items[rd.dependency] = dependency_item; } } @@ -580,7 +580,7 @@ DependencyRemoveDialog::DependencyRemoveDialog() { owners = memnew(Tree); owners->set_hide_root(true); vb->add_child(owners); - owners->set_v_size_flags(SIZE_EXPAND_FILL); + owners->set_v_size_flags(Control::SIZE_EXPAND_FILL); } ////////////// @@ -592,7 +592,7 @@ void DependencyErrorDialog::show(Mode p_mode, const String &p_for_file, const Ve set_title(TTR("Error loading:") + " " + p_for_file.get_file()); files->clear(); - TreeItem *root = files->create_item(NULL); + TreeItem *root = files->create_item(nullptr); for (int i = 0; i < report.size(); i++) { String dep; @@ -636,9 +636,9 @@ DependencyErrorDialog::DependencyErrorDialog() { files = memnew(Tree); files->set_hide_root(true); vb->add_margin_child(TTR("Load failed due to missing dependencies:"), files, true); - files->set_v_size_flags(SIZE_EXPAND_FILL); + files->set_v_size_flags(Control::SIZE_EXPAND_FILL); - set_custom_minimum_size(Size2(500, 220) * EDSCALE); + set_min_size(Size2(500, 220) * EDSCALE); get_ok()->set_text(TTR("Open Anyway")); get_cancel()->set_text(TTR("Close")); @@ -662,7 +662,7 @@ void OrphanResourcesDialog::ok_pressed() { return; delete_confirm->set_text(vformat(TTR("Permanently delete %d item(s)? (No undo!)"), paths.size())); - delete_confirm->popup_centered_clamped(delete_confirm->get_minimum_size()); + delete_confirm->popup_centered(); } bool OrphanResourcesDialog::_fill_owners(EditorFileSystemDirectory *efsd, HashMap<String, int> &refs, TreeItem *p_parent) { @@ -674,11 +674,11 @@ bool OrphanResourcesDialog::_fill_owners(EditorFileSystemDirectory *efsd, HashMa for (int i = 0; i < efsd->get_subdir_count(); i++) { - TreeItem *dir_item = NULL; + TreeItem *dir_item = nullptr; if (p_parent) { dir_item = files->create_item(p_parent); dir_item->set_text(0, efsd->get_subdir(i)->get_name()); - dir_item->set_icon(0, get_icon("folder", "FileDialog")); + dir_item->set_icon(0, files->get_theme_icon("folder", "FileDialog")); } bool children = _fill_owners(efsd->get_subdir(i), refs, dir_item); @@ -717,7 +717,7 @@ bool OrphanResourcesDialog::_fill_owners(EditorFileSystemDirectory *efsd, HashMa int ds = efsd->get_file_deps(i).size(); ti->set_text(1, itos(ds)); if (ds) { - ti->add_button(1, get_icon("GuiVisibilityVisible", "EditorIcons"), -1, false, TTR("Show Dependencies")); + ti->add_button(1, files->get_theme_icon("GuiVisibilityVisible", "EditorIcons"), -1, false, TTR("Show Dependencies")); } ti->set_metadata(0, path); has_children = true; @@ -730,7 +730,7 @@ bool OrphanResourcesDialog::_fill_owners(EditorFileSystemDirectory *efsd, HashMa void OrphanResourcesDialog::refresh() { HashMap<String, int> refs; - _fill_owners(EditorFileSystem::get_singleton()->get_filesystem(), refs, NULL); + _fill_owners(EditorFileSystem::get_singleton()->get_filesystem(), refs, nullptr); files->clear(); TreeItem *root = files->create_item(); _fill_owners(EditorFileSystem::get_singleton()->get_filesystem(), refs, root); diff --git a/editor/dictionary_property_edit.cpp b/editor/dictionary_property_edit.cpp index 82db639379..7169986b14 100644 --- a/editor/dictionary_property_edit.cpp +++ b/editor/dictionary_property_edit.cpp @@ -96,7 +96,7 @@ Node *DictionaryPropertyEdit::get_node() { Object *o = ObjectDB::get_instance(obj); if (!o) - return NULL; + return nullptr; return cast_to<Node>(o); } diff --git a/editor/doc/SCsub b/editor/doc/SCsub deleted file mode 100644 index 2b1e889fb0..0000000000 --- a/editor/doc/SCsub +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env python - -Import('env') - -env.add_source_files(env.editor_sources, "*.cpp") diff --git a/editor/doc/doc_dump.cpp b/editor/doc/doc_dump.cpp deleted file mode 100644 index b0a89ff4b8..0000000000 --- a/editor/doc/doc_dump.cpp +++ /dev/null @@ -1,308 +0,0 @@ -/*************************************************************************/ -/* doc_dump.cpp */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* https://godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */ -/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */ -/* */ -/* Permission is hereby granted, free of charge, to any person obtaining */ -/* a copy of this software and associated documentation files (the */ -/* "Software"), to deal in the Software without restriction, including */ -/* without limitation the rights to use, copy, modify, merge, publish, */ -/* distribute, sublicense, and/or sell copies of the Software, and to */ -/* permit persons to whom the Software is furnished to do so, subject to */ -/* the following conditions: */ -/* */ -/* The above copyright notice and this permission notice shall be */ -/* included in all copies or substantial portions of the Software. */ -/* */ -/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ -/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ -/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ -/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ -/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ -/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/*************************************************************************/ - -#include "doc_dump.h" - -#include "core/os/file_access.h" -#include "core/version.h" -#include "scene/main/node.h" - -static void _write_string(FileAccess *f, int p_tablevel, const String &p_string) { - - String tab; - for (int i = 0; i < p_tablevel; i++) - tab += "\t"; - f->store_string(tab + p_string + "\n"); -} - -struct _ConstantSort { - - String name; - int value; - bool operator<(const _ConstantSort &p_c) const { - - String left_a = name.find("_") == -1 ? name : name.substr(0, name.find("_")); - String left_b = p_c.name.find("_") == -1 ? p_c.name : p_c.name.substr(0, p_c.name.find("_")); - if (left_a == left_b) - return value < p_c.value; - else - return left_a < left_b; - } -}; - -static String _escape_string(const String &p_str) { - - String ret = p_str; - ret = ret.replace("&", "&"); - ret = ret.replace("<", ">"); - ret = ret.replace(">", "<"); - ret = ret.replace("'", "'"); - ret = ret.replace("\"", """); - for (char i = 1; i < 32; i++) { - - char chr[2] = { i, 0 }; - ret = ret.replace(chr, "&#" + String::num(i) + ";"); - } - ret = ret.utf8(); - return ret; -} -void DocDump::dump(const String &p_file) { - - List<StringName> class_list; - ClassDB::get_class_list(&class_list); - - class_list.sort_custom<StringName::AlphCompare>(); - - FileAccess *f = FileAccess::open(p_file, FileAccess::WRITE); - - _write_string(f, 0, "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>"); - _write_string(f, 0, String("<doc version=\"") + VERSION_BRANCH + "\" name=\"Engine Types\">"); - - while (class_list.size()) { - - String name = class_list.front()->get(); - - String header = "<class name=\"" + name + "\""; - String inherits = ClassDB::get_parent_class(name); - if (inherits != "") - header += " inherits=\"" + inherits + "\""; - _write_string(f, 0, header); - - _write_string(f, 1, "<brief_description>"); - _write_string(f, 1, "</brief_description>"); - - _write_string(f, 1, "<description>"); - _write_string(f, 1, "</description>"); - - _write_string(f, 1, "<methods>"); - - List<MethodInfo> method_list; - ClassDB::get_method_list(name, &method_list, true); - method_list.sort(); - - for (List<MethodInfo>::Element *E = method_list.front(); E; E = E->next()) { - if (E->get().name == "" || E->get().name[0] == '_') - continue; //hidden - - MethodBind *m = ClassDB::get_method(name, E->get().name); - - String qualifiers; - if (E->get().flags & METHOD_FLAG_CONST) - qualifiers += "qualifiers=\"const\""; - - _write_string(f, 2, "<method name=\"" + _escape_string(E->get().name) + "\" " + qualifiers + " >"); - - for (int i = -1; i < E->get().arguments.size(); i++) { - - PropertyInfo arginfo; - - if (i == -1) { - - arginfo = E->get().return_val; - String type_name = (arginfo.hint == PROPERTY_HINT_RESOURCE_TYPE) ? arginfo.hint_string : Variant::get_type_name(arginfo.type); - - if (arginfo.type == Variant::NIL) - continue; - _write_string(f, 3, "<return type=\"" + type_name + "\">"); - } else { - - arginfo = E->get().arguments[i]; - - String type_name; - - if (arginfo.hint == PROPERTY_HINT_RESOURCE_TYPE) - type_name = arginfo.hint_string; - else if (arginfo.type == Variant::NIL) - type_name = "Variant"; - else - type_name = Variant::get_type_name(arginfo.type); - - if (m && m->has_default_argument(i)) { - Variant default_arg = m->get_default_argument(i); - String default_arg_text = String(_escape_string(m->get_default_argument(i))); - - switch (default_arg.get_type()) { - - case Variant::NIL: - default_arg_text = "NULL"; - break; - // atomic types - case Variant::BOOL: - if (bool(default_arg)) - default_arg_text = "true"; - else - default_arg_text = "false"; - break; - case Variant::INT: - case Variant::FLOAT: - //keep it - break; - case Variant::STRING: - case Variant::STRING_NAME: - default_arg_text = "@\"" + default_arg_text + "\""; - break; - case Variant::NODE_PATH: - default_arg_text = "\"" + default_arg_text + "\""; - break; - case Variant::TRANSFORM: - if (default_arg.operator Transform() == Transform()) { - default_arg_text = ""; - } - - default_arg_text = Variant::get_type_name(default_arg.get_type()) + "(" + default_arg_text + ")"; - break; - - case Variant::VECTOR2: - case Variant::RECT2: - case Variant::VECTOR3: - case Variant::PLANE: - case Variant::QUAT: - case Variant::AABB: - case Variant::BASIS: - case Variant::COLOR: - case Variant::PACKED_BYTE_ARRAY: - case Variant::PACKED_INT32_ARRAY: - case Variant::PACKED_FLOAT32_ARRAY: - case Variant::PACKED_INT64_ARRAY: - case Variant::PACKED_FLOAT64_ARRAY: - case Variant::PACKED_STRING_ARRAY: - case Variant::PACKED_VECTOR3_ARRAY: - case Variant::PACKED_COLOR_ARRAY: - default_arg_text = Variant::get_type_name(default_arg.get_type()) + "(" + default_arg_text + ")"; - break; - case Variant::OBJECT: - case Variant::DICTIONARY: - case Variant::ARRAY: - case Variant::_RID: - - default: { - } - } - - _write_string(f, 3, "<argument index=\"" + itos(i) + "\" name=\"" + _escape_string(arginfo.name) + "\" type=\"" + type_name + "\" default=\"" + _escape_string(default_arg_text) + "\">"); - } else - _write_string(f, 3, "<argument index=\"" + itos(i) + "\" name=\"" + arginfo.name + "\" type=\"" + type_name + "\">"); - } - - String hint; - switch (arginfo.hint) { - case PROPERTY_HINT_DIR: hint = "A directory."; break; - case PROPERTY_HINT_RANGE: hint = "Range - min: " + arginfo.hint_string.get_slice(",", 0) + " max: " + arginfo.hint_string.get_slice(",", 1) + " step: " + arginfo.hint_string.get_slice(",", 2); break; - case PROPERTY_HINT_ENUM: - hint = "Values: "; - for (int j = 0; j < arginfo.hint_string.get_slice_count(","); j++) { - if (j > 0) hint += ", "; - hint += arginfo.hint_string.get_slice(",", j) + "=" + itos(j); - } - break; - case PROPERTY_HINT_LENGTH: hint = "Length: " + arginfo.hint_string; break; - case PROPERTY_HINT_FLAGS: - hint = "Values: "; - for (int j = 0; j < arginfo.hint_string.get_slice_count(","); j++) { - if (j > 0) hint += ", "; - hint += arginfo.hint_string.get_slice(",", j) + "=" + itos((uint64_t)1 << j); - } - break; - case PROPERTY_HINT_FILE: hint = "A file:"; break; - default: { - } - //case PROPERTY_HINT_RESOURCE_TYPE: hint="Type: "+arginfo.hint_string; break; - }; - if (hint != "") - _write_string(f, 4, hint); - - _write_string(f, 3, (i == -1) ? "</return>" : "</argument>"); - } - - _write_string(f, 3, "<description>"); - _write_string(f, 3, "</description>"); - - _write_string(f, 2, "</method>"); - } - - _write_string(f, 1, "</methods>"); - - List<MethodInfo> signal_list; - ClassDB::get_signal_list(name, &signal_list, true); - - if (signal_list.size()) { - - _write_string(f, 1, "<signals>"); - for (List<MethodInfo>::Element *EV = signal_list.front(); EV; EV = EV->next()) { - - _write_string(f, 2, "<signal name=\"" + EV->get().name + "\">"); - for (int i = 0; i < EV->get().arguments.size(); i++) { - PropertyInfo arginfo = EV->get().arguments[i]; - _write_string(f, 3, "<argument index=\"" + itos(i) + "\" name=\"" + arginfo.name + "\" type=\"" + Variant::get_type_name(arginfo.type) + "\">"); - _write_string(f, 3, "</argument>"); - } - _write_string(f, 3, "<description>"); - _write_string(f, 3, "</description>"); - - _write_string(f, 2, "</signal>"); - } - - _write_string(f, 1, "</signals>"); - } - - _write_string(f, 1, "<constants>"); - - List<String> constant_list; - ClassDB::get_integer_constant_list(name, &constant_list, true); - - /* constants are sorted in a special way */ - - List<_ConstantSort> constant_sort; - - for (List<String>::Element *E = constant_list.front(); E; E = E->next()) { - _ConstantSort cs; - cs.name = E->get(); - cs.value = ClassDB::get_integer_constant(name, E->get()); - constant_sort.push_back(cs); - } - - constant_sort.sort(); - - for (List<_ConstantSort>::Element *E = constant_sort.front(); E; E = E->next()) { - - _write_string(f, 2, "<constant name=\"" + E->get().name + "\" value=\"" + itos(E->get().value) + "\">"); - _write_string(f, 2, "</constant>"); - } - - _write_string(f, 1, "</constants>"); - _write_string(f, 0, "</class>"); - - class_list.erase(name); - } - - _write_string(f, 0, "</doc>"); - f->close(); - memdelete(f); -} diff --git a/editor/doc/doc_dump.h b/editor/doc/doc_dump.h deleted file mode 100644 index f8f1b6f805..0000000000 --- a/editor/doc/doc_dump.h +++ /dev/null @@ -1,41 +0,0 @@ -/*************************************************************************/ -/* doc_dump.h */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* https://godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */ -/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */ -/* */ -/* Permission is hereby granted, free of charge, to any person obtaining */ -/* a copy of this software and associated documentation files (the */ -/* "Software"), to deal in the Software without restriction, including */ -/* without limitation the rights to use, copy, modify, merge, publish, */ -/* distribute, sublicense, and/or sell copies of the Software, and to */ -/* permit persons to whom the Software is furnished to do so, subject to */ -/* the following conditions: */ -/* */ -/* The above copyright notice and this permission notice shall be */ -/* included in all copies or substantial portions of the Software. */ -/* */ -/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ -/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ -/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ -/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ -/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ -/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/*************************************************************************/ - -#ifndef DOC_DUMP_H -#define DOC_DUMP_H - -#include "core/class_db.h" - -class DocDump { -public: - static void dump(const String &p_file); -}; - -#endif // DOC_DUMP_H diff --git a/editor/doc/doc_data.cpp b/editor/doc_data.cpp index 66134b4428..310e78ee60 100644 --- a/editor/doc/doc_data.cpp +++ b/editor/doc_data.cpp @@ -40,6 +40,9 @@ #include "core/version.h" #include "scene/resources/theme.h" +// Used for a hack preserving Mono properties on non-Mono builds. +#include "modules/modules_enabled.gen.h" + void DocData::merge_from(const DocData &p_data) { for (Map<String, ClassDoc>::Element *E = class_list.front(); E; E = E->next()) { @@ -154,6 +157,23 @@ void DocData::merge_from(const DocData &p_data) { break; } } + +#ifndef MODULE_MONO_ENABLED + // The Mono module defines some properties that we want to keep when + // re-generating docs with a non-Mono build, to prevent pointless diffs + // (and loss of descriptions) depending on the config of the doc writer. + // We use a horrible hack to force keeping the relevant properties, + // hardcoded below. At least it's an ad hoc hack... ¯\_(ツ)_/¯ + // Don't show this to your kids. + if (c.name == "@GlobalScope") { + // Retrieve GodotSharp singleton. + for (int j = 0; j < cf.properties.size(); j++) { + if (cf.properties[j].name == "GodotSharp") { + c.properties.push_back(cf.properties[j]); + } + } + } +#endif } } @@ -173,6 +193,8 @@ static void return_doc_from_retinfo(DocData::MethodDoc &p_method, const Property p_method.return_type = "int"; } else if (p_retinfo.class_name != StringName()) { p_method.return_type = p_retinfo.class_name; + } else if (p_retinfo.type == Variant::ARRAY && p_retinfo.hint == PROPERTY_HINT_ARRAY_TYPE) { + p_method.return_type = p_retinfo.hint_string + "[]"; } else if (p_retinfo.hint == PROPERTY_HINT_RESOURCE_TYPE) { p_method.return_type = p_retinfo.hint_string; } else if (p_retinfo.type == Variant::NIL && p_retinfo.usage & PROPERTY_USAGE_NIL_IS_VARIANT) { @@ -195,6 +217,8 @@ static void argument_doc_from_arginfo(DocData::ArgumentDoc &p_argument, const Pr p_argument.type = "int"; } else if (p_arginfo.class_name != StringName()) { p_argument.type = p_arginfo.class_name; + } else if (p_arginfo.type == Variant::ARRAY && p_arginfo.hint == PROPERTY_HINT_ARRAY_TYPE) { + p_argument.type = p_arginfo.hint_string + "[]"; } else if (p_arginfo.hint == PROPERTY_HINT_RESOURCE_TYPE) { p_argument.type = p_arginfo.hint_string; } else if (p_arginfo.type == Variant::NIL) { @@ -243,6 +267,12 @@ void DocData::generate(bool p_basic_types) { Set<StringName> setters_getters; String name = classes.front()->get(); + if (!ClassDB::is_class_exposed(name)) { + print_verbose(vformat("Class '%s' is not exposed, skipping.", name)); + classes.pop_front(); + continue; + } + String cname = name; if (cname.begins_with("_")) //proxy class cname = cname.substr(1, name.length()); @@ -265,13 +295,13 @@ void DocData::generate(bool p_basic_types) { List<PropertyInfo>::Element *EO = own_properties.front(); for (List<PropertyInfo>::Element *E = properties.front(); E; E = E->next()) { - bool inherited = EO == NULL; + bool inherited = EO == nullptr; if (EO && EO->get() == E->get()) { inherited = false; EO = EO->next(); } - if (E->get().usage & PROPERTY_USAGE_GROUP || E->get().usage & PROPERTY_USAGE_CATEGORY || E->get().usage & PROPERTY_USAGE_INTERNAL) + if (E->get().usage & PROPERTY_USAGE_GROUP || E->get().usage & PROPERTY_USAGE_SUBGROUP || E->get().usage & PROPERTY_USAGE_CATEGORY || E->get().usage & PROPERTY_USAGE_INTERNAL) continue; PropertyDoc prop; @@ -328,6 +358,8 @@ void DocData::generate(bool p_basic_types) { prop.type = "int"; } else if (retinfo.class_name != StringName()) { prop.type = retinfo.class_name; + } else if (retinfo.type == Variant::ARRAY && retinfo.hint == PROPERTY_HINT_ARRAY_TYPE) { + prop.type = retinfo.hint_string + "[]"; } else if (retinfo.hint == PROPERTY_HINT_RESOURCE_TYPE) { prop.type = retinfo.hint_string; @@ -372,7 +404,7 @@ void DocData::generate(bool p_basic_types) { if (skip_setter_getter_methods && setters_getters.has(E->get().name)) { // Don't skip parametric setters and getters, i.e. method which require // one or more parameters to define what property should be set or retrieved. - // E.g. CPUParticles::set_param(Parameter param, float value). + // E.g. CPUParticles3D::set_param(Parameter param, float value). if (E->get().arguments.size() == 0 /* getter */ || (E->get().arguments.size() == 1 && E->get().return_val.type == Variant::NIL /* setter */)) { continue; } @@ -534,7 +566,7 @@ void DocData::generate(bool p_basic_types) { c.name = cname; Callable::CallError cerror; - Variant v = Variant::construct(Variant::Type(i), NULL, 0, cerror); + Variant v = Variant::construct(Variant::Type(i), nullptr, 0, cerror); List<MethodInfo> method_list; v.get_method_list(&method_list); diff --git a/editor/doc/doc_data.h b/editor/doc_data.h index 073705f0b1..073705f0b1 100644 --- a/editor/doc/doc_data.h +++ b/editor/doc_data.h diff --git a/editor/editor_about.cpp b/editor/editor_about.cpp index a223cee360..b0bcc2b448 100644 --- a/editor/editor_about.cpp +++ b/editor/editor_about.cpp @@ -37,20 +37,23 @@ #include "core/version.h" #include "core/version_hash.gen.h" +void EditorAbout::_theme_changed() { + + Control *base = EditorNode::get_singleton()->get_gui_base(); + Ref<Font> font = base->get_theme_font("source", "EditorFonts"); + _tpl_text->add_theme_font_override("normal_font", font); + _tpl_text->add_theme_constant_override("line_separation", 6 * EDSCALE); + _license_text->add_theme_font_override("normal_font", font); + _license_text->add_theme_constant_override("line_separation", 6 * EDSCALE); + _logo->set_texture(base->get_theme_icon("Logo", "EditorIcons")); +} + void EditorAbout::_notification(int p_what) { switch (p_what) { - case NOTIFICATION_ENTER_TREE: - case NOTIFICATION_THEME_CHANGED: { - - Control *base = EditorNode::get_singleton()->get_gui_base(); - Ref<Font> font = base->get_font("source", "EditorFonts"); - _tpl_text->add_font_override("normal_font", font); - _tpl_text->add_constant_override("line_separation", 6 * EDSCALE); - _license_text->add_font_override("normal_font", font); - _license_text->add_constant_override("line_separation", 6 * EDSCALE); - _logo->set_texture(base->get_icon("Logo", "EditorIcons")); + case NOTIFICATION_ENTER_TREE: { + _theme_changed(); } break; } } @@ -95,9 +98,9 @@ ScrollContainer *EditorAbout::_populate_list(const String &p_name, const List<St il->set_same_column_width(true); il->set_auto_height(true); il->set_mouse_filter(Control::MOUSE_FILTER_IGNORE); - il->add_constant_override("hseparation", 16 * EDSCALE); + il->add_theme_constant_override("hseparation", 16 * EDSCALE); while (*names_ptr) { - il->add_item(String::utf8(*names_ptr++), NULL, false); + il->add_item(String::utf8(*names_ptr++), nullptr, false); } il->set_max_columns(il->get_item_count() < 4 || single_column ? 1 : 16); vbc->add_child(il); @@ -115,13 +118,13 @@ EditorAbout::EditorAbout() { set_title(TTR("Thanks from the Godot community!")); set_hide_on_ok(true); - set_resizable(true); VBoxContainer *vbc = memnew(VBoxContainer); + vbc->connect("theme_changed", callable_mp(this, &EditorAbout::_theme_changed)); HBoxContainer *hbc = memnew(HBoxContainer); hbc->set_h_size_flags(Control::SIZE_EXPAND_FILL); hbc->set_alignment(BoxContainer::ALIGN_CENTER); - hbc->add_constant_override("separation", 30 * EDSCALE); + hbc->add_theme_constant_override("separation", 30 * EDSCALE); add_child(vbc); vbc->add_child(hbc); diff --git a/editor/editor_about.h b/editor/editor_about.h index 51438ee953..83e9e9f490 100644 --- a/editor/editor_about.h +++ b/editor/editor_about.h @@ -57,6 +57,8 @@ private: RichTextLabel *_tpl_text; TextureRect *_logo; + void _theme_changed(); + protected: void _notification(int p_what); static void _bind_methods(); diff --git a/editor/editor_asset_installer.cpp b/editor/editor_asset_installer.cpp index e26d44025f..74c4102003 100644 --- a/editor/editor_asset_installer.cpp +++ b/editor/editor_asset_installer.cpp @@ -85,7 +85,7 @@ void EditorAssetInstaller::open(const String &p_path, int p_depth) { package_path = p_path; Set<String> files_sorted; - FileAccess *src_f = NULL; + FileAccess *src_f = nullptr; zlib_filefunc_def io = zipio_create_io_from_file(&src_f); unzFile pkg = unzOpen2(p_path.utf8().get_data(), &io); @@ -102,7 +102,7 @@ void EditorAssetInstaller::open(const String &p_path, int p_depth) { //get filename unz_file_info info; char fname[16384]; - unzGetCurrentFileInfo(pkg, &info, fname, 16384, NULL, 0, NULL, 0); + unzGetCurrentFileInfo(pkg, &info, fname, 16384, nullptr, 0, nullptr, 0); String name = fname; files_sorted.insert(name); @@ -112,17 +112,17 @@ void EditorAssetInstaller::open(const String &p_path, int p_depth) { Map<String, Ref<Texture2D>> extension_guess; { - extension_guess["png"] = get_icon("ImageTexture", "EditorIcons"); - extension_guess["jpg"] = get_icon("ImageTexture", "EditorIcons"); - extension_guess["atlastex"] = get_icon("AtlasTexture", "EditorIcons"); - extension_guess["scn"] = get_icon("PackedScene", "EditorIcons"); - extension_guess["tscn"] = get_icon("PackedScene", "EditorIcons"); - extension_guess["shader"] = get_icon("Shader", "EditorIcons"); - extension_guess["gd"] = get_icon("GDScript", "EditorIcons"); - extension_guess["vs"] = get_icon("VisualScript", "EditorIcons"); + extension_guess["png"] = tree->get_theme_icon("ImageTexture", "EditorIcons"); + extension_guess["jpg"] = tree->get_theme_icon("ImageTexture", "EditorIcons"); + extension_guess["atlastex"] = tree->get_theme_icon("AtlasTexture", "EditorIcons"); + extension_guess["scn"] = tree->get_theme_icon("PackedScene", "EditorIcons"); + extension_guess["tscn"] = tree->get_theme_icon("PackedScene", "EditorIcons"); + extension_guess["shader"] = tree->get_theme_icon("Shader", "EditorIcons"); + extension_guess["gd"] = tree->get_theme_icon("GDScript", "EditorIcons"); + extension_guess["vs"] = tree->get_theme_icon("VisualScript", "EditorIcons"); } - Ref<Texture2D> generic_extension = get_icon("Object", "EditorIcons"); + Ref<Texture2D> generic_extension = tree->get_theme_icon("Object", "EditorIcons"); unzClose(pkg); @@ -131,7 +131,7 @@ void EditorAssetInstaller::open(const String &p_path, int p_depth) { TreeItem *root = tree->create_item(); root->set_cell_mode(0, TreeItem::CELL_MODE_CHECK); root->set_checked(0, true); - root->set_icon(0, get_icon("folder", "FileDialog")); + root->set_icon(0, tree->get_theme_icon("folder", "FileDialog")); root->set_text(0, "res://"); root->set_editable(0, true); Map<String, TreeItem *> dir_map; @@ -180,7 +180,7 @@ void EditorAssetInstaller::open(const String &p_path, int p_depth) { if (isdir) { dir_map[path] = ti; ti->set_text(0, path.get_file() + "/"); - ti->set_icon(0, get_icon("folder", "FileDialog")); + ti->set_icon(0, tree->get_theme_icon("folder", "FileDialog")); ti->set_metadata(0, String()); } else { String file = path.get_file(); @@ -194,7 +194,7 @@ void EditorAssetInstaller::open(const String &p_path, int p_depth) { String res_path = "res://" + path; if (FileAccess::exists(res_path)) { - ti->set_custom_color(0, get_color("error_color", "Editor")); + ti->set_custom_color(0, tree->get_theme_color("error_color", "Editor")); ti->set_tooltip(0, vformat(TTR("%s (Already Exists)"), res_path)); ti->set_checked(0, false); } else { @@ -212,7 +212,7 @@ void EditorAssetInstaller::open(const String &p_path, int p_depth) { void EditorAssetInstaller::ok_pressed() { - FileAccess *src_f = NULL; + FileAccess *src_f = nullptr; zlib_filefunc_def io = zipio_create_io_from_file(&src_f); unzFile pkg = unzOpen2(package_path.utf8().get_data(), &io); @@ -234,7 +234,7 @@ void EditorAssetInstaller::ok_pressed() { //get filename unz_file_info info; char fname[16384]; - ret = unzGetCurrentFileInfo(pkg, &info, fname, 16384, NULL, 0, NULL, 0); + ret = unzGetCurrentFileInfo(pkg, &info, fname, 16384, nullptr, 0, nullptr, 0); String name = fname; @@ -297,10 +297,10 @@ void EditorAssetInstaller::ok_pressed() { } msg += failed_files[i]; } - if (EditorNode::get_singleton() != NULL) + if (EditorNode::get_singleton() != nullptr) EditorNode::get_singleton()->show_warning(msg); } else { - if (EditorNode::get_singleton() != NULL) + if (EditorNode::get_singleton() != nullptr) EditorNode::get_singleton()->show_warning(TTR("Package installed successfully!"), TTR("Success!")); } EditorFileSystem::get_singleton()->scan_changes(); diff --git a/editor/editor_audio_buses.cpp b/editor/editor_audio_buses.cpp index d77216697e..7e499facd5 100644 --- a/editor/editor_audio_buses.cpp +++ b/editor/editor_audio_buses.cpp @@ -30,8 +30,8 @@ #include "editor_audio_buses.h" +#include "core/input/input_filter.h" #include "core/io/resource_saver.h" -#include "core/os/input.h" #include "core/os/keyboard.h" #include "editor_node.h" #include "editor_scale.h" @@ -69,27 +69,27 @@ void EditorAudioBus::_notification(int p_what) { case NOTIFICATION_READY: { for (int i = 0; i < CHANNELS_MAX; i++) { - channel[i].vu_l->set_under_texture(get_icon("BusVuEmpty", "EditorIcons")); - channel[i].vu_l->set_progress_texture(get_icon("BusVuFull", "EditorIcons")); - channel[i].vu_r->set_under_texture(get_icon("BusVuEmpty", "EditorIcons")); - channel[i].vu_r->set_progress_texture(get_icon("BusVuFull", "EditorIcons")); + channel[i].vu_l->set_under_texture(get_theme_icon("BusVuEmpty", "EditorIcons")); + channel[i].vu_l->set_progress_texture(get_theme_icon("BusVuFull", "EditorIcons")); + channel[i].vu_r->set_under_texture(get_theme_icon("BusVuEmpty", "EditorIcons")); + channel[i].vu_r->set_progress_texture(get_theme_icon("BusVuFull", "EditorIcons")); channel[i].prev_active = true; } - disabled_vu = get_icon("BusVuFrozen", "EditorIcons"); + disabled_vu = get_theme_icon("BusVuFrozen", "EditorIcons"); Color solo_color = EditorSettings::get_singleton()->is_dark_theme() ? Color(1.0, 0.89, 0.22) : Color(1.0, 0.92, 0.44); Color mute_color = EditorSettings::get_singleton()->is_dark_theme() ? Color(1.0, 0.16, 0.16) : Color(1.0, 0.44, 0.44); Color bypass_color = EditorSettings::get_singleton()->is_dark_theme() ? Color(0.13, 0.8, 1.0) : Color(0.44, 0.87, 1.0); - solo->set_icon(get_icon("AudioBusSolo", "EditorIcons")); - solo->add_color_override("icon_color_pressed", solo_color); - mute->set_icon(get_icon("AudioBusMute", "EditorIcons")); - mute->add_color_override("icon_color_pressed", mute_color); - bypass->set_icon(get_icon("AudioBusBypass", "EditorIcons")); - bypass->add_color_override("icon_color_pressed", bypass_color); + solo->set_icon(get_theme_icon("AudioBusSolo", "EditorIcons")); + solo->add_theme_color_override("icon_color_pressed", solo_color); + mute->set_icon(get_theme_icon("AudioBusMute", "EditorIcons")); + mute->add_theme_color_override("icon_color_pressed", mute_color); + bypass->set_icon(get_theme_icon("AudioBusBypass", "EditorIcons")); + bypass->add_theme_color_override("icon_color_pressed", bypass_color); - bus_options->set_icon(get_icon("GuiTabMenu", "EditorIcons")); + bus_options->set_icon(get_theme_icon("GuiTabMenu", "EditorIcons")); update_bus(); set_process(true); @@ -97,15 +97,15 @@ void EditorAudioBus::_notification(int p_what) { case NOTIFICATION_DRAW: { if (is_master) { - draw_style_box(get_stylebox("disabled", "Button"), Rect2(Vector2(), get_size())); + draw_style_box(get_theme_stylebox("disabled", "Button"), Rect2(Vector2(), get_size())); } else if (has_focus()) { - draw_style_box(get_stylebox("focus", "Button"), Rect2(Vector2(), get_size())); + draw_style_box(get_theme_stylebox("focus", "Button"), Rect2(Vector2(), get_size())); } else { - draw_style_box(get_stylebox("panel", "TabContainer"), Rect2(Vector2(), get_size())); + draw_style_box(get_theme_stylebox("panel", "TabContainer"), Rect2(Vector2(), get_size())); } if (get_index() != 0 && hovering_drop) { - Color accent = get_color("accent_color", "Editor"); + Color accent = get_theme_color("accent_color", "Editor"); accent.a *= 0.7; draw_rect(Rect2(Point2(), get_size()), accent, false); } @@ -168,20 +168,20 @@ void EditorAudioBus::_notification(int p_what) { case NOTIFICATION_THEME_CHANGED: { for (int i = 0; i < CHANNELS_MAX; i++) { - channel[i].vu_l->set_under_texture(get_icon("BusVuEmpty", "EditorIcons")); - channel[i].vu_l->set_progress_texture(get_icon("BusVuFull", "EditorIcons")); - channel[i].vu_r->set_under_texture(get_icon("BusVuEmpty", "EditorIcons")); - channel[i].vu_r->set_progress_texture(get_icon("BusVuFull", "EditorIcons")); + channel[i].vu_l->set_under_texture(get_theme_icon("BusVuEmpty", "EditorIcons")); + channel[i].vu_l->set_progress_texture(get_theme_icon("BusVuFull", "EditorIcons")); + channel[i].vu_r->set_under_texture(get_theme_icon("BusVuEmpty", "EditorIcons")); + channel[i].vu_r->set_progress_texture(get_theme_icon("BusVuFull", "EditorIcons")); channel[i].prev_active = true; } - disabled_vu = get_icon("BusVuFrozen", "EditorIcons"); + disabled_vu = get_theme_icon("BusVuFrozen", "EditorIcons"); - solo->set_icon(get_icon("AudioBusSolo", "EditorIcons")); - mute->set_icon(get_icon("AudioBusMute", "EditorIcons")); - bypass->set_icon(get_icon("AudioBusBypass", "EditorIcons")); + solo->set_icon(get_theme_icon("AudioBusSolo", "EditorIcons")); + mute->set_icon(get_theme_icon("AudioBusMute", "EditorIcons")); + bypass->set_icon(get_theme_icon("AudioBusBypass", "EditorIcons")); - bus_options->set_icon(get_icon("GuiTabMenu", "EditorIcons")); + bus_options->set_icon(get_theme_icon("GuiTabMenu", "EditorIcons")); } break; case NOTIFICATION_MOUSE_EXIT: case NOTIFICATION_DRAG_END: { @@ -325,7 +325,7 @@ void EditorAudioBus::_volume_changed(float p_normalized) { const float p_db = this->_normalized_volume_to_scaled_db(p_normalized); - if (Input::get_singleton()->is_key_pressed(KEY_CONTROL)) { + if (InputFilter::get_singleton()->is_key_pressed(KEY_CONTROL)) { // Snap the value when holding Ctrl for easier editing. // To do so, it needs to be converted back to normalized volume (as the slider uses that unit). slider->set_value(_scaled_db_to_normalized_volume(Math::round(p_db))); @@ -386,7 +386,7 @@ float EditorAudioBus::_scaled_db_to_normalized_volume(float db) { void EditorAudioBus::_show_value(float slider_value) { float db; - if (Input::get_singleton()->is_key_pressed(KEY_CONTROL)) { + if (InputFilter::get_singleton()->is_key_pressed(KEY_CONTROL)) { // Display the correct (snapped) value when holding Ctrl db = Math::round(_normalized_volume_to_scaled_db(slider_value)); } else { @@ -586,7 +586,7 @@ Variant EditorAudioBus::get_drag_data(const Point2 &p_point) { Panel *p = memnew(Panel); c->add_child(p); p->set_modulate(Color(1, 1, 1, 0.7)); - p->add_style_override("panel", get_stylebox("focus", "Button")); + p->add_theme_style_override("panel", get_theme_stylebox("focus", "Button")); p->set_size(get_size()); p->set_position(-p_point); set_drag_preview(c); @@ -819,10 +819,10 @@ EditorAudioBus::EditorAudioBus(EditorAudioBuses *p_buses, bool p_is_master) { Ref<StyleBoxEmpty> sbempty = memnew(StyleBoxEmpty); for (int i = 0; i < hbc->get_child_count(); i++) { Control *child = Object::cast_to<Control>(hbc->get_child(i)); - child->add_style_override("normal", sbempty); - child->add_style_override("hover", sbempty); - child->add_style_override("focus", sbempty); - child->add_style_override("pressed", sbempty); + child->add_theme_style_override("normal", sbempty); + child->add_theme_style_override("hover", sbempty); + child->add_theme_style_override("focus", sbempty); + child->add_theme_style_override("pressed", sbempty); } HSeparator *separator = memnew(HSeparator); @@ -854,7 +854,7 @@ EditorAudioBus::EditorAudioBus(EditorAudioBuses *p_buses, bool p_is_master) { audio_value_preview_box->set_as_toplevel(true); Ref<StyleBoxFlat> panel_style = memnew(StyleBoxFlat); panel_style->set_bg_color(Color(0.0f, 0.0f, 0.0f, 0.8f)); - audio_value_preview_box->add_style_override("panel", panel_style); + audio_value_preview_box->add_theme_style_override("panel", panel_style); audio_value_preview_box->set_mouse_filter(MOUSE_FILTER_PASS); audio_value_preview_box->hide(); @@ -953,10 +953,10 @@ void EditorAudioBusDrop::_notification(int p_what) { switch (p_what) { case NOTIFICATION_DRAW: { - draw_style_box(get_stylebox("normal", "Button"), Rect2(Vector2(), get_size())); + draw_style_box(get_theme_stylebox("normal", "Button"), Rect2(Vector2(), get_size())); if (hovering_drop) { - Color accent = get_color("accent_color", "Editor"); + Color accent = get_theme_color("accent_color", "Editor"); accent.a *= 0.7; draw_rect(Rect2(Point2(), get_size()), accent, false); } @@ -1007,7 +1007,7 @@ void EditorAudioBuses::_update_buses() { memdelete(bus_hb->get_child(0)); } - drop_end = NULL; + drop_end = nullptr; for (int i = 0; i < AudioServer::get_singleton()->get_bus_count(); i++) { @@ -1035,7 +1035,7 @@ void EditorAudioBuses::_notification(int p_what) { case NOTIFICATION_ENTER_TREE: case NOTIFICATION_THEME_CHANGED: { - bus_scroll->add_style_override("bg", get_stylebox("bg", "Tree")); + bus_scroll->add_theme_style_override("bg", get_theme_stylebox("bg", "Tree")); } break; case NOTIFICATION_READY: { @@ -1045,7 +1045,7 @@ void EditorAudioBuses::_notification(int p_what) { if (drop_end) { drop_end->queue_delete(); - drop_end = NULL; + drop_end = nullptr; } } break; case NOTIFICATION_PROCESS: { @@ -1204,7 +1204,7 @@ void EditorAudioBuses::_select_layout() { void EditorAudioBuses::_save_as_layout() { - file_dialog->set_mode(EditorFileDialog::MODE_SAVE_FILE); + file_dialog->set_file_mode(EditorFileDialog::FILE_MODE_SAVE_FILE); file_dialog->set_title(TTR("Save Audio Bus Layout As...")); file_dialog->set_current_path(edited_path); file_dialog->popup_centered_ratio(); @@ -1213,7 +1213,7 @@ void EditorAudioBuses::_save_as_layout() { void EditorAudioBuses::_new_layout() { - file_dialog->set_mode(EditorFileDialog::MODE_SAVE_FILE); + file_dialog->set_file_mode(EditorFileDialog::FILE_MODE_SAVE_FILE); file_dialog->set_title(TTR("Location for New Layout...")); file_dialog->set_current_path(edited_path); file_dialog->popup_centered_ratio(); @@ -1222,7 +1222,7 @@ void EditorAudioBuses::_new_layout() { void EditorAudioBuses::_load_layout() { - file_dialog->set_mode(EditorFileDialog::MODE_OPEN_FILE); + file_dialog->set_file_mode(EditorFileDialog::FILE_MODE_OPEN_FILE); file_dialog->set_title(TTR("Open Audio Bus Layout")); file_dialog->set_current_path(edited_path); file_dialog->popup_centered_ratio(); @@ -1249,7 +1249,7 @@ void EditorAudioBuses::_load_default_layout() { void EditorAudioBuses::_file_dialog_callback(const String &p_string) { - if (file_dialog->get_mode() == EditorFileDialog::MODE_OPEN_FILE) { + if (file_dialog->get_file_mode() == EditorFileDialog::FILE_MODE_OPEN_FILE) { Ref<AudioBusLayout> state = ResourceLoader::load(p_string, "", true); if (state.is_null()) { EditorNode::get_singleton()->show_warning(TTR("Invalid file, not an audio bus layout.")); @@ -1263,7 +1263,7 @@ void EditorAudioBuses::_file_dialog_callback(const String &p_string) { EditorNode::get_singleton()->get_undo_redo()->clear_history(); call_deferred("_select_layout"); - } else if (file_dialog->get_mode() == EditorFileDialog::MODE_SAVE_FILE) { + } else if (file_dialog->get_file_mode() == EditorFileDialog::FILE_MODE_SAVE_FILE) { if (new_layout) { Ref<AudioBusLayout> empty_state; @@ -1296,7 +1296,7 @@ void EditorAudioBuses::_bind_methods() { EditorAudioBuses::EditorAudioBuses() { - drop_end = NULL; + drop_end = nullptr; top_hb = memnew(HBoxContainer); add_child(top_hb); @@ -1402,7 +1402,7 @@ void AudioBusesEditorPlugin::edit(Object *p_node) { bool AudioBusesEditorPlugin::handles(Object *p_node) const { - return (Object::cast_to<AudioBusLayout>(p_node) != NULL); + return (Object::cast_to<AudioBusLayout>(p_node) != nullptr); } void AudioBusesEditorPlugin::make_visible(bool p_visible) { @@ -1423,7 +1423,7 @@ void EditorAudioMeterNotches::add_notch(float p_normalized_offset, float p_db_va Size2 EditorAudioMeterNotches::get_minimum_size() const { - Ref<Font> font = get_font("font", "Label"); + Ref<Font> font = get_theme_font("font", "Label"); float font_height = font->get_height(); float width = 0; @@ -1460,7 +1460,7 @@ void EditorAudioMeterNotches::_notification(int p_what) { void EditorAudioMeterNotches::_draw_audio_notches() { - Ref<Font> font = get_font("font", "Label"); + Ref<Font> font = get_theme_font("font", "Label"); float font_height = font->get_height(); for (int i = 0; i < notches.size(); i++) { diff --git a/editor/editor_audio_buses.h b/editor/editor_audio_buses.h index 72098c7232..be1551629d 100644 --- a/editor/editor_audio_buses.h +++ b/editor/editor_audio_buses.h @@ -133,7 +133,7 @@ public: void update_bus(); void update_send(); - EditorAudioBus(EditorAudioBuses *p_buses = NULL, bool p_is_master = false); + EditorAudioBus(EditorAudioBuses *p_buses = nullptr, bool p_is_master = false); }; class EditorAudioBusDrop : public Control { diff --git a/editor/editor_autoload_settings.cpp b/editor/editor_autoload_settings.cpp index 83a1e2fca2..6917b2b775 100644 --- a/editor/editor_autoload_settings.cpp +++ b/editor/editor_autoload_settings.cpp @@ -35,7 +35,7 @@ #include "editor_node.h" #include "editor_scale.h" #include "project_settings_editor.h" -#include "scene/main/viewport.h" +#include "scene/main/window.h" #include "scene/resources/packed_scene.h" #define PREVIEW_LIST_MAX_SIZE 10 @@ -48,8 +48,6 @@ void EditorAutoloadSettings::_notification(int p_what) { ResourceLoader::get_recognized_extensions_for_type("Script", &afn); ResourceLoader::get_recognized_extensions_for_type("PackedScene", &afn); - EditorFileDialog *file_dialog = autoload_add_path->get_file_dialog(); - for (List<String>::Element *E = afn.front(); E; E = E->next()) { file_dialog->add_filter("*." + E->get()); @@ -61,6 +59,9 @@ void EditorAutoloadSettings::_notification(int p_what) { get_tree()->get_root()->call_deferred("add_child", info.node); } } + browse_button->set_icon(get_theme_icon("Folder", "EditorIcons")); + } else if (p_what == NOTIFICATION_THEME_CHANGED) { + browse_button->set_icon(get_theme_icon("Folder", "EditorIcons")); } } @@ -116,8 +117,8 @@ bool EditorAutoloadSettings::_autoload_name_is_valid(const String &p_name, Strin void EditorAutoloadSettings::_autoload_add() { - if (autoload_add(autoload_add_name->get_text(), autoload_add_path->get_line_edit()->get_text())) - autoload_add_path->get_line_edit()->set_text(""); + if (autoload_add(autoload_add_name->get_text(), autoload_add_path->get_text())) + autoload_add_path->set_text(""); autoload_add_name->set_text(""); add_autoload->set_disabled(true); @@ -240,7 +241,7 @@ void EditorAutoloadSettings::_autoload_button_pressed(Object *p_item, int p_colu case BUTTON_MOVE_UP: case BUTTON_MOVE_DOWN: { - TreeItem *swap = NULL; + TreeItem *swap = nullptr; if (p_button == BUTTON_MOVE_UP) { swap = ti->get_prev(); @@ -326,7 +327,7 @@ void EditorAutoloadSettings::_autoload_file_callback(const String &p_path) { void EditorAutoloadSettings::_autoload_text_entered(const String p_name) { - if (autoload_add_path->get_line_edit()->get_text() != "" && _autoload_name_is_valid(p_name, NULL)) { + if (autoload_add_path->get_text() != "" && _autoload_name_is_valid(p_name, nullptr)) { _autoload_add(); } } @@ -334,19 +335,19 @@ void EditorAutoloadSettings::_autoload_text_entered(const String p_name) { void EditorAutoloadSettings::_autoload_path_text_changed(const String p_path) { add_autoload->set_disabled( - p_path == "" || !_autoload_name_is_valid(autoload_add_name->get_text(), NULL)); + p_path == "" || !_autoload_name_is_valid(autoload_add_name->get_text(), nullptr)); } void EditorAutoloadSettings::_autoload_text_changed(const String p_name) { add_autoload->set_disabled( - autoload_add_path->get_line_edit()->get_text() == "" || !_autoload_name_is_valid(p_name, NULL)); + autoload_add_path->get_text() == "" || !_autoload_name_is_valid(p_name, nullptr)); } Node *EditorAutoloadSettings::_create_autoload(const String &p_path) { RES res = ResourceLoader::load(p_path); - ERR_FAIL_COND_V_MSG(res.is_null(), NULL, "Can't autoload: " + p_path + "."); - Node *n = NULL; + ERR_FAIL_COND_V_MSG(res.is_null(), nullptr, "Can't autoload: " + p_path + "."); + Node *n = nullptr; if (res->is_class("PackedScene")) { Ref<PackedScene> ps = res; n = ps->instance(); @@ -354,17 +355,17 @@ Node *EditorAutoloadSettings::_create_autoload(const String &p_path) { Ref<Script> s = res; StringName ibt = s->get_instance_base_type(); bool valid_type = ClassDB::is_parent_class(ibt, "Node"); - ERR_FAIL_COND_V_MSG(!valid_type, NULL, "Script does not inherit a Node: " + p_path + "."); + ERR_FAIL_COND_V_MSG(!valid_type, nullptr, "Script does not inherit a Node: " + p_path + "."); Object *obj = ClassDB::instance(ibt); - ERR_FAIL_COND_V_MSG(obj == NULL, NULL, "Cannot instance script for autoload, expected 'Node' inheritance, got: " + String(ibt) + "."); + ERR_FAIL_COND_V_MSG(obj == nullptr, nullptr, "Cannot instance script for autoload, expected 'Node' inheritance, got: " + String(ibt) + "."); n = Object::cast_to<Node>(obj); n->set_script(s); } - ERR_FAIL_COND_V_MSG(!n, NULL, "Path in autoload not a node or script: " + p_path + "."); + ERR_FAIL_COND_V_MSG(!n, nullptr, "Path in autoload not a node or script: " + p_path + "."); return n; } @@ -429,7 +430,7 @@ void EditorAutoloadSettings::update_autoload() { to_remove.erase(name); need_to_add = false; } else { - info.node = NULL; + info.node = nullptr; } } } @@ -452,10 +453,10 @@ void EditorAutoloadSettings::update_autoload() { item->set_editable(2, true); item->set_text(2, TTR("Enable")); item->set_checked(2, info.is_singleton); - item->add_button(3, get_icon("Load", "EditorIcons"), BUTTON_OPEN); - item->add_button(3, get_icon("MoveUp", "EditorIcons"), BUTTON_MOVE_UP); - item->add_button(3, get_icon("MoveDown", "EditorIcons"), BUTTON_MOVE_DOWN); - item->add_button(3, get_icon("Remove", "EditorIcons"), BUTTON_DELETE); + item->add_button(3, get_theme_icon("Load", "EditorIcons"), BUTTON_OPEN); + item->add_button(3, get_theme_icon("MoveUp", "EditorIcons"), BUTTON_MOVE_UP); + item->add_button(3, get_theme_icon("MoveDown", "EditorIcons"), BUTTON_MOVE_DOWN); + item->add_button(3, get_theme_icon("Remove", "EditorIcons"), BUTTON_DELETE); item->set_selectable(3, false); } @@ -474,7 +475,7 @@ void EditorAutoloadSettings::update_autoload() { if (info.node) { info.node->queue_delete(); - info.node = NULL; + info.node = nullptr; } } @@ -505,7 +506,7 @@ void EditorAutoloadSettings::update_autoload() { if (!info->in_editor && !info->is_singleton) { // No reason to keep this node memdelete(info->node); - info->node = NULL; + info->node = nullptr; } } @@ -523,7 +524,7 @@ Variant EditorAutoloadSettings::get_drag_data_fw(const Point2 &p_point, Control PackedStringArray autoloads; - TreeItem *next = tree->get_next_selected(NULL); + TreeItem *next = tree->get_next_selected(nullptr); while (next) { autoloads.push_back(next->get_text(0)); @@ -604,7 +605,7 @@ void EditorAutoloadSettings::drop_data_fw(const Point2 &p_point, const Variant & int order = ProjectSettings::get_singleton()->get_order("autoload/" + name); AutoLoadInfo aux; - List<AutoLoadInfo>::Element *E = NULL; + List<AutoLoadInfo>::Element *E = nullptr; if (!move_to_back) { aux.order = order; @@ -805,9 +806,9 @@ EditorAutoloadSettings::EditorAutoloadSettings() { } } - if (!info.is_singleton && !info.in_editor && info.node != NULL) { + if (!info.is_singleton && !info.in_editor && info.node != nullptr) { memdelete(info.node); - info.node = NULL; + info.node = nullptr; } } @@ -823,13 +824,24 @@ EditorAutoloadSettings::EditorAutoloadSettings() { l->set_text(TTR("Path:")); hbc->add_child(l); - autoload_add_path = memnew(EditorLineEditFileChooser); - autoload_add_path->set_h_size_flags(SIZE_EXPAND_FILL); - autoload_add_path->get_file_dialog()->set_mode(EditorFileDialog::MODE_OPEN_FILE); - autoload_add_path->get_file_dialog()->connect("file_selected", callable_mp(this, &EditorAutoloadSettings::_autoload_file_callback)); - autoload_add_path->get_line_edit()->connect("text_changed", callable_mp(this, &EditorAutoloadSettings::_autoload_path_text_changed)); - + autoload_add_path = memnew(LineEdit); hbc->add_child(autoload_add_path); + autoload_add_path->set_h_size_flags(Control::SIZE_EXPAND_FILL); + autoload_add_path->connect("text_changed", callable_mp(this, &EditorAutoloadSettings::_autoload_path_text_changed)); + + browse_button = memnew(Button); + hbc->add_child(browse_button); + browse_button->connect("pressed", callable_mp(this, &EditorAutoloadSettings::_browse_autoload_add_path)); + + file_dialog = memnew(EditorFileDialog); + hbc->add_child(file_dialog); + file_dialog->connect("file_selected", callable_mp(this, &EditorAutoloadSettings::_set_autoload_add_path)); + file_dialog->connect("dir_selected", callable_mp(this, &EditorAutoloadSettings::_set_autoload_add_path)); + file_dialog->connect("files_selected", callable_mp(this, &EditorAutoloadSettings::_set_autoload_add_path)); + + hbc->set_h_size_flags(SIZE_EXPAND_FILL); + file_dialog->set_file_mode(EditorFileDialog::FILE_MODE_OPEN_FILE); + file_dialog->connect("file_selected", callable_mp(this, &EditorAutoloadSettings::_autoload_file_callback)); l = memnew(Label); l->set_text(TTR("Node Name:")); @@ -890,3 +902,14 @@ EditorAutoloadSettings::~EditorAutoloadSettings() { } } } + +void EditorAutoloadSettings::_set_autoload_add_path(const String &p_text) { + + autoload_add_path->set_text(p_text); + autoload_add_path->emit_signal("text_entered", p_text); +} + +void EditorAutoloadSettings::_browse_autoload_add_path() { + + file_dialog->popup_centered_ratio(); +}
\ No newline at end of file diff --git a/editor/editor_autoload_settings.h b/editor/editor_autoload_settings.h index 653a1b0a78..94a581401c 100644 --- a/editor/editor_autoload_settings.h +++ b/editor/editor_autoload_settings.h @@ -63,7 +63,7 @@ class EditorAutoloadSettings : public VBoxContainer { AutoLoadInfo() { is_singleton = false; in_editor = false; - node = NULL; + node = nullptr; } }; @@ -74,11 +74,13 @@ class EditorAutoloadSettings : public VBoxContainer { String selected_autoload; Tree *tree; - EditorLineEditFileChooser *autoload_add_path; LineEdit *autoload_add_name; Button *add_autoload; + LineEdit *autoload_add_path; + Button *browse_button; + EditorFileDialog *file_dialog; - bool _autoload_name_is_valid(const String &p_name, String *r_error = NULL); + bool _autoload_name_is_valid(const String &p_name, String *r_error = nullptr); void _autoload_add(); void _autoload_selected(); @@ -96,6 +98,9 @@ class EditorAutoloadSettings : public VBoxContainer { bool can_drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_control) const; void drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_control); + void _set_autoload_add_path(const String &p_text); + void _browse_autoload_add_path(); + protected: void _notification(int p_what); static void _bind_methods(); diff --git a/editor/editor_builders.py b/editor/editor_builders.py index e8c23acf9e..ea32e24f6e 100644 --- a/editor/editor_builders.py +++ b/editor/editor_builders.py @@ -6,26 +6,26 @@ All such functions are invoked in a subprocess on Windows to prevent build flaki import os import os.path from platform_methods import subprocess_main -from compat import encode_utf8, byte_to_str, open_utf8 def make_doc_header(target, source, env): dst = target[0] - g = open_utf8(dst, "w") + g = open(dst, "w", encoding="utf-8") buf = "" docbegin = "" docend = "" for src in source: if not src.endswith(".xml"): continue - with open_utf8(src, "r") as f: + with open(src, "r", encoding="utf-8") as f: content = f.read() buf += content - buf = encode_utf8(docbegin + buf + docend) + buf = (docbegin + buf + docend).encode("utf-8") decomp_size = len(buf) import zlib + buf = zlib.compress(buf) g.write("/* THIS FILE IS GENERATED DO NOT EDIT */\n") @@ -35,7 +35,7 @@ def make_doc_header(target, source, env): g.write("static const int _doc_data_uncompressed_size = " + str(decomp_size) + ";\n") g.write("static const unsigned char _doc_data_compressed[] = {\n") for i in range(len(buf)): - g.write("\t" + byte_to_str(buf[i]) + ",\n") + g.write("\t" + str(buf[i]) + ",\n") g.write("};\n") g.write("#endif") @@ -47,7 +47,7 @@ def make_fonts_header(target, source, env): dst = target[0] - g = open_utf8(dst, "w") + g = open(dst, "w", encoding="utf-8") g.write("/* THIS FILE IS GENERATED DO NOT EDIT */\n") g.write("#ifndef _EDITOR_FONTS_H\n") @@ -56,7 +56,7 @@ def make_fonts_header(target, source, env): # saving uncompressed, since freetype will reference from memory pointer xl_names = [] for i in range(len(source)): - with open(source[i], "rb")as f: + with open(source[i], "rb") as f: buf = f.read() name = os.path.splitext(os.path.basename(source[i]))[0] @@ -64,7 +64,7 @@ def make_fonts_header(target, source, env): g.write("static const int _font_" + name + "_size = " + str(len(buf)) + ";\n") g.write("static const unsigned char _font_" + name + "[] = {\n") for j in range(len(buf)): - g.write("\t" + byte_to_str(buf[j]) + ",\n") + g.write("\t" + str(buf[j]) + ",\n") g.write("};\n") @@ -77,7 +77,7 @@ def make_translations_header(target, source, env, category): dst = target[0] - g = open_utf8(dst, "w") + g = open(dst, "w", encoding="utf-8") g.write("/* THIS FILE IS GENERATED DO NOT EDIT */\n") g.write("#ifndef _{}_TRANSLATIONS_H\n".format(category.upper())) @@ -98,7 +98,7 @@ def make_translations_header(target, source, env, category): g.write("static const unsigned char _{}_translation_{}_compressed[] = {{\n".format(category, name)) for j in range(len(buf)): - g.write("\t" + byte_to_str(buf[j]) + ",\n") + g.write("\t" + str(buf[j]) + ",\n") g.write("};\n") @@ -112,8 +112,10 @@ def make_translations_header(target, source, env, category): g.write("};\n\n") g.write("static {}TranslationList _{}_translations[] = {{\n".format(category.capitalize(), category)) for x in xl_names: - g.write("\t{{ \"{}\", {}, {}, _{}_translation_{}_compressed }},\n".format(x[0], str(x[1]), str(x[2]), category, x[0])) - g.write("\t{NULL, 0, 0, NULL}\n") + g.write( + '\t{{ "{}", {}, {}, _{}_translation_{}_compressed }},\n'.format(x[0], str(x[1]), str(x[2]), category, x[0]) + ) + g.write("\t{nullptr, 0, 0, nullptr}\n") g.write("};\n") g.write("#endif") @@ -129,5 +131,5 @@ def make_doc_translations_header(target, source, env): make_translations_header(target, source, env, "doc") -if __name__ == '__main__': +if __name__ == "__main__": subprocess_main(globals()) diff --git a/editor/editor_data.cpp b/editor/editor_data.cpp index 1c19327da7..9c739474d1 100644 --- a/editor/editor_data.cpp +++ b/editor/editor_data.cpp @@ -270,7 +270,7 @@ EditorPlugin *EditorData::get_editor(Object *p_object) { return editor_plugins[i]; } - return NULL; + return nullptr; } EditorPlugin *EditorData::get_subeditor(Object *p_object) { @@ -281,7 +281,7 @@ EditorPlugin *EditorData::get_subeditor(Object *p_object) { return editor_plugins[i]; } - return NULL; + return nullptr; } Vector<EditorPlugin *> EditorData::get_subeditors(Object *p_object) { @@ -302,7 +302,7 @@ EditorPlugin *EditorData::get_editor(String p_name) { return editor_plugins[i]; } - return NULL; + return nullptr; } void EditorData::copy_object_params(Object *p_object) { @@ -464,7 +464,7 @@ UndoRedo &EditorData::get_undo_redo() { void EditorData::remove_editor_plugin(EditorPlugin *p_plugin) { - p_plugin->undo_redo = NULL; + p_plugin->undo_redo = nullptr; editor_plugins.erase(p_plugin); } @@ -479,7 +479,7 @@ int EditorData::get_editor_plugin_count() const { } EditorPlugin *EditorData::get_editor_plugin(int p_idx) { - ERR_FAIL_INDEX_V(p_idx, editor_plugins.size(), NULL); + ERR_FAIL_INDEX_V(p_idx, editor_plugins.size(), nullptr); return editor_plugins[p_idx]; } @@ -506,7 +506,7 @@ Object *EditorData::instance_custom_type(const String &p_type, const String &p_i Ref<Script> script = get_custom_types()[p_inherits][i].script; Object *ob = ClassDB::instance(p_inherits); - ERR_FAIL_COND_V(!ob, NULL); + ERR_FAIL_COND_V(!ob, nullptr); if (ob->is_class("Node")) { ob->call("set_name", p_type); } @@ -516,7 +516,7 @@ Object *EditorData::instance_custom_type(const String &p_type, const String &p_i } } - return NULL; + return nullptr; } void EditorData::remove_custom_type(const String &p_type) { @@ -540,7 +540,7 @@ int EditorData::add_edited_scene(int p_at_pos) { if (p_at_pos < 0) p_at_pos = edited_scene.size(); EditedScene es; - es.root = NULL; + es.root = nullptr; es.path = String(); es.history_current = -1; es.version = 0; @@ -680,10 +680,10 @@ void EditorData::set_edited_scene(int p_idx) { } Node *EditorData::get_edited_scene_root(int p_idx) { if (p_idx < 0) { - ERR_FAIL_INDEX_V(current_edited_scene, edited_scene.size(), NULL); + ERR_FAIL_INDEX_V(current_edited_scene, edited_scene.size(), nullptr); return edited_scene[current_edited_scene].root; } else { - ERR_FAIL_INDEX_V(p_idx, edited_scene.size(), NULL); + ERR_FAIL_INDEX_V(p_idx, edited_scene.size(), nullptr); return edited_scene[p_idx].root; } } @@ -915,7 +915,7 @@ Object *EditorData::script_class_instance(const String &p_class) { return obj; } } - return NULL; + return nullptr; } Ref<Script> EditorData::script_class_load_script(const String &p_class) const { @@ -1018,7 +1018,7 @@ void EditorSelection::add_node(Node *p_node) { changed = true; nl_changed = true; - Object *meta = NULL; + Object *meta = nullptr; for (List<Object *>::Element *E = editor_plugins.front(); E; E = E->next()) { meta = E->get()->call("_get_editor_data", p_node); @@ -1066,9 +1066,9 @@ Array EditorSelection::_get_transformable_selected_nodes() { return ret; } -Array EditorSelection::get_selected_nodes() { +TypedArray<Node> EditorSelection::get_selected_nodes() { - Array ret; + TypedArray<Node> ret; for (Map<Node *, Object *>::Element *E = selection.front(); E; E = E->next()) { diff --git a/editor/editor_data.h b/editor/editor_data.h index 5095ea8479..e4f4c67c8e 100644 --- a/editor/editor_data.h +++ b/editor/editor_data.h @@ -257,7 +257,7 @@ protected: static void _bind_methods(); public: - Array get_selected_nodes(); + TypedArray<Node> get_selected_nodes(); void add_node(Node *p_node); void remove_node(Node *p_node); bool is_selected(Node *) const; @@ -265,7 +265,7 @@ public: template <class T> T *get_node_editor_data(Node *p_node) { if (!selection.has(p_node)) - return NULL; + return nullptr; return Object::cast_to<T>(selection[p_node]); } diff --git a/editor/editor_dir_dialog.cpp b/editor/editor_dir_dialog.cpp index 20fe349ef6..cb87656382 100644 --- a/editor/editor_dir_dialog.cpp +++ b/editor/editor_dir_dialog.cpp @@ -35,6 +35,7 @@ #include "editor/editor_file_system.h" #include "editor/editor_settings.h" #include "editor_scale.h" +#include "servers/display_server.h" void EditorDirDialog::_update_dir(TreeItem *p_item, EditorFileSystemDirectory *p_dir, const String &p_select_path) { @@ -43,7 +44,7 @@ void EditorDirDialog::_update_dir(TreeItem *p_item, EditorFileSystemDirectory *p String path = p_dir->get_path(); p_item->set_metadata(0, p_dir->get_path()); - p_item->set_icon(0, get_icon("Folder", "EditorIcons")); + p_item->set_icon(0, tree->get_theme_icon("Folder", "EditorIcons")); if (!p_item->get_parent()) { p_item->set_text(0, "res://"); @@ -68,7 +69,7 @@ void EditorDirDialog::_update_dir(TreeItem *p_item, EditorFileSystemDirectory *p void EditorDirDialog::reload(const String &p_path) { - if (!is_visible_in_tree()) { + if (!is_visible()) { must_reload = true; return; } @@ -102,7 +103,7 @@ void EditorDirDialog::_notification(int p_what) { } if (p_what == NOTIFICATION_VISIBILITY_CHANGED) { - if (must_reload && is_visible_in_tree()) { + if (must_reload && is_visible()) { reload(); } } @@ -141,11 +142,11 @@ void EditorDirDialog::_make_dir() { TreeItem *ti = tree->get_selected(); if (!ti) { mkdirerr->set_text(TTR("Please select a base directory first.")); - mkdirerr->popup_centered_minsize(); + mkdirerr->popup_centered(); return; } - makedialog->popup_centered_minsize(Size2(250, 80)); + makedialog->popup_centered(Size2(250, 80)); makedirname->grab_focus(); } @@ -162,7 +163,7 @@ void EditorDirDialog::_make_dir_confirm() { Error err = d->make_dir(makedirname->get_text()); if (err != OK) { - mkdirerr->popup_centered_minsize(Size2(250, 80) * EDSCALE); + mkdirerr->popup_centered(Size2(250, 80) * EDSCALE); } else { opened_paths.insert(dir); //reload(dir.plus_file(makedirname->get_text())); @@ -188,7 +189,7 @@ EditorDirDialog::EditorDirDialog() { tree->connect("item_activated", callable_mp(this, &EditorDirDialog::_item_activated)); - makedir = add_button(TTR("Create Folder"), OS::get_singleton()->get_swap_ok_cancel(), "makedir"); + makedir = add_button(TTR("Create Folder"), DisplayServer::get_singleton()->get_swap_ok_cancel(), "makedir"); makedir->connect("pressed", callable_mp(this, &EditorDirDialog::_make_dir)); makedialog = memnew(ConfirmationDialog); diff --git a/editor/editor_export.cpp b/editor/editor_export.cpp index 5883b5eb1e..e8167070d4 100644 --- a/editor/editor_export.cpp +++ b/editor/editor_export.cpp @@ -358,12 +358,12 @@ Error EditorExportPlatform::_save_zip_file(void *p_userdata, const String &p_pat zipOpenNewFileInZip(zip, path.utf8().get_data(), - NULL, - NULL, + nullptr, + nullptr, 0, - NULL, + nullptr, 0, - NULL, + nullptr, Z_DEFLATED, Z_DEFAULT_COMPRESSION); @@ -582,6 +582,14 @@ String EditorExportPlugin::get_ios_cpp_code() const { return ios_cpp_code; } +void EditorExportPlugin::add_ios_project_static_lib(const String &p_path) { + ios_project_static_libs.push_back(p_path); +} + +Vector<String> EditorExportPlugin::get_ios_project_static_libs() const { + return ios_project_static_libs; +} + void EditorExportPlugin::_export_file_script(const String &p_path, const String &p_type, const Vector<String> &p_features) { if (get_script_instance()) { @@ -617,6 +625,7 @@ void EditorExportPlugin::skip() { void EditorExportPlugin::_bind_methods() { ClassDB::bind_method(D_METHOD("add_shared_object", "path", "tags"), &EditorExportPlugin::add_shared_object); + ClassDB::bind_method(D_METHOD("add_ios_project_static_lib", "path"), &EditorExportPlugin::add_ios_project_static_lib); ClassDB::bind_method(D_METHOD("add_file", "path", "file", "remap"), &EditorExportPlugin::add_file); ClassDB::bind_method(D_METHOD("add_ios_framework", "path"), &EditorExportPlugin::add_ios_framework); ClassDB::bind_method(D_METHOD("add_ios_plist_content", "plist_content"), &EditorExportPlugin::add_ios_plist_content); @@ -1070,7 +1079,7 @@ Error EditorExportPlatform::save_zip(const Ref<EditorExportPreset> &p_preset, co FileAccess *src_f; zlib_filefunc_def io = zipio_create_io_from_file(&src_f); - zipFile zip = zipOpen2(p_path.utf8().get_data(), APPEND_STATUS_CREATE, NULL, &io); + zipFile zip = zipOpen2(p_path.utf8().get_data(), APPEND_STATUS_CREATE, nullptr, &io); ZipData zd; zd.ep = &ep; @@ -1080,7 +1089,7 @@ Error EditorExportPlatform::save_zip(const Ref<EditorExportPreset> &p_preset, co if (err != OK && err != ERR_SKIP) ERR_PRINT("Failed to export project files"); - zipClose(zip, NULL); + zipClose(zip, nullptr); return OK; } @@ -1153,7 +1162,7 @@ EditorExportPlatform::EditorExportPlatform() { //// -EditorExport *EditorExport::singleton = NULL; +EditorExport *EditorExport::singleton = nullptr; void EditorExport::_save() { @@ -1686,7 +1695,7 @@ void EditorExportPlatformPC::set_fixup_embedded_pck_func(FixUpEmbeddedPckFunc p_ EditorExportPlatformPC::EditorExportPlatformPC() { chmod_flags = -1; - fixup_embedded_pck_func = NULL; + fixup_embedded_pck_func = nullptr; } /////////////////////// diff --git a/editor/editor_export.h b/editor/editor_export.h index 81790eb0a4..f47fe9c95e 100644 --- a/editor/editor_export.h +++ b/editor/editor_export.h @@ -212,7 +212,7 @@ protected: FeatureContainers get_feature_containers(const Ref<EditorExportPreset> &p_preset); bool exists_export_template(String template_file_name, String *err) const; - String find_export_template(String template_file_name, String *err = NULL) const; + String find_export_template(String template_file_name, String *err = nullptr) const; void gen_export_flags(Vector<String> &r_flags, int p_flags); public: @@ -238,9 +238,9 @@ public: virtual String get_name() const = 0; virtual Ref<Texture2D> get_logo() const = 0; - Error export_project_files(const Ref<EditorExportPreset> &p_preset, EditorExportSaveFunction p_func, void *p_udata, EditorExportSaveSharedObject p_so_func = NULL); + Error export_project_files(const Ref<EditorExportPreset> &p_preset, EditorExportSaveFunction p_func, void *p_udata, EditorExportSaveSharedObject p_so_func = nullptr); - Error save_pack(const Ref<EditorExportPreset> &p_preset, const String &p_path, Vector<SharedObject> *p_so_files = NULL, bool p_embed = false, int64_t *r_embedded_start = NULL, int64_t *r_embedded_size = NULL); + Error save_pack(const Ref<EditorExportPreset> &p_preset, const String &p_path, Vector<SharedObject> *p_so_files = nullptr, bool p_embed = false, int64_t *r_embedded_start = nullptr, int64_t *r_embedded_size = nullptr); Error save_zip(const Ref<EditorExportPreset> &p_preset, const String &p_path); virtual bool poll_export() { return false; } @@ -291,6 +291,7 @@ class EditorExportPlugin : public Reference { bool skipped; Vector<String> ios_frameworks; + Vector<String> ios_project_static_libs; String ios_plist_content; String ios_linker_flags; Vector<String> ios_bundle_files; @@ -322,6 +323,7 @@ protected: void add_shared_object(const String &p_path, const Vector<String> &tags); void add_ios_framework(const String &p_path); + void add_ios_project_static_lib(const String &p_path); void add_ios_plist_content(const String &p_plist_content); void add_ios_linker_flags(const String &p_flags); void add_ios_bundle_file(const String &p_path); @@ -336,6 +338,7 @@ protected: public: Vector<String> get_ios_frameworks() const; + Vector<String> get_ios_project_static_libs() const; String get_ios_plist_content() const; String get_ios_linker_flags() const; Vector<String> get_ios_bundle_files() const; diff --git a/editor/editor_feature_profile.cpp b/editor/editor_feature_profile.cpp index 4b0bbdcec2..e2b79efb43 100644 --- a/editor/editor_feature_profile.cpp +++ b/editor/editor_feature_profile.cpp @@ -420,7 +420,7 @@ void EditorFeatureProfileManager::_profile_action(int p_action) { } break; case PROFILE_NEW: { - new_profile_dialog->popup_centered_minsize(); + new_profile_dialog->popup_centered(); new_profile_name->clear(); new_profile_name->grab_focus(); } break; @@ -430,7 +430,7 @@ void EditorFeatureProfileManager::_profile_action(int p_action) { ERR_FAIL_COND(selected == String()); erase_profile_dialog->set_text(vformat(TTR("Erase profile '%s'? (no undo)"), selected)); - erase_profile_dialog->popup_centered_minsize(); + erase_profile_dialog->popup_centered(); } break; } } @@ -485,7 +485,7 @@ void EditorFeatureProfileManager::_fill_classes_from(TreeItem *p_parent, const S bool disabled_editor = edited->is_class_editor_disabled(p_class); bool disabled_properties = edited->has_class_properties_disabled(p_class); if (disabled) { - class_item->set_custom_color(0, get_color("disabled_font_color", "Editor")); + class_item->set_custom_color(0, class_list->get_theme_color("disabled_font_color", "Editor")); } else if (disabled_editor && disabled_properties) { text += " " + TTR("(Editor Disabled, Properties Disabled)"); } else if (disabled_properties) { @@ -787,7 +787,7 @@ Ref<EditorFeatureProfile> EditorFeatureProfileManager::get_current_profile() { return current; } -EditorFeatureProfileManager *EditorFeatureProfileManager::singleton = NULL; +EditorFeatureProfileManager *EditorFeatureProfileManager::singleton = nullptr; void EditorFeatureProfileManager::_bind_methods() { @@ -805,7 +805,7 @@ EditorFeatureProfileManager::EditorFeatureProfileManager() { current_profile_name = memnew(LineEdit); name_hbc->add_child(current_profile_name); current_profile_name->set_editable(false); - current_profile_name->set_h_size_flags(SIZE_EXPAND_FILL); + current_profile_name->set_h_size_flags(Control::SIZE_EXPAND_FILL); profile_actions[PROFILE_CLEAR] = memnew(Button(TTR("Unset"))); name_hbc->add_child(profile_actions[PROFILE_CLEAR]); profile_actions[PROFILE_CLEAR]->set_disabled(true); @@ -815,7 +815,7 @@ EditorFeatureProfileManager::EditorFeatureProfileManager() { HBoxContainer *profiles_hbc = memnew(HBoxContainer); profile_list = memnew(OptionButton); - profile_list->set_h_size_flags(SIZE_EXPAND_FILL); + profile_list->set_h_size_flags(Control::SIZE_EXPAND_FILL); profiles_hbc->add_child(profile_list); profile_list->connect("item_selected", callable_mp(this, &EditorFeatureProfileManager::_profile_selected)); @@ -849,12 +849,12 @@ EditorFeatureProfileManager::EditorFeatureProfileManager() { main_vbc->add_margin_child(TTR("Available Profiles:"), profiles_hbc); h_split = memnew(HSplitContainer); - h_split->set_v_size_flags(SIZE_EXPAND_FILL); + h_split->set_v_size_flags(Control::SIZE_EXPAND_FILL); main_vbc->add_child(h_split); VBoxContainer *class_list_vbc = memnew(VBoxContainer); h_split->add_child(class_list_vbc); - class_list_vbc->set_h_size_flags(SIZE_EXPAND_FILL); + class_list_vbc->set_h_size_flags(Control::SIZE_EXPAND_FILL); class_list = memnew(Tree); class_list_vbc->add_margin_child(TTR("Enabled Classes:"), class_list, true); @@ -865,7 +865,7 @@ EditorFeatureProfileManager::EditorFeatureProfileManager() { VBoxContainer *property_list_vbc = memnew(VBoxContainer); h_split->add_child(property_list_vbc); - property_list_vbc->set_h_size_flags(SIZE_EXPAND_FILL); + property_list_vbc->set_h_size_flags(Control::SIZE_EXPAND_FILL); property_list = memnew(Tree); property_list_vbc->add_margin_child(TTR("Class Options"), property_list, true); @@ -891,7 +891,7 @@ EditorFeatureProfileManager::EditorFeatureProfileManager() { import_profiles = memnew(EditorFileDialog); add_child(import_profiles); - import_profiles->set_mode(EditorFileDialog::MODE_OPEN_FILES); + import_profiles->set_file_mode(EditorFileDialog::FILE_MODE_OPEN_FILES); import_profiles->add_filter("*.profile; " + TTR("Godot Feature Profile")); import_profiles->connect("files_selected", callable_mp(this, &EditorFeatureProfileManager::_import_profiles)); import_profiles->set_title(TTR("Import Profile(s)")); @@ -899,7 +899,7 @@ EditorFeatureProfileManager::EditorFeatureProfileManager() { export_profile = memnew(EditorFileDialog); add_child(export_profile); - export_profile->set_mode(EditorFileDialog::MODE_SAVE_FILE); + export_profile->set_file_mode(EditorFileDialog::FILE_MODE_SAVE_FILE); export_profile->add_filter("*.profile; " + TTR("Godot Feature Profile")); export_profile->connect("file_selected", callable_mp(this, &EditorFeatureProfileManager::_export_profile)); export_profile->set_title(TTR("Export Profile")); diff --git a/editor/editor_file_dialog.cpp b/editor/editor_file_dialog.cpp index 250fa6b3e0..6a06c6657e 100644 --- a/editor/editor_file_dialog.cpp +++ b/editor/editor_file_dialog.cpp @@ -42,12 +42,13 @@ #include "scene/gui/center_container.h" #include "scene/gui/label.h" #include "scene/gui/margin_container.h" +#include "servers/display_server.h" -EditorFileDialog::GetIconFunc EditorFileDialog::get_icon_func = NULL; -EditorFileDialog::GetIconFunc EditorFileDialog::get_large_icon_func = NULL; +EditorFileDialog::GetIconFunc EditorFileDialog::get_icon_func = nullptr; +EditorFileDialog::GetIconFunc EditorFileDialog::get_large_icon_func = nullptr; -EditorFileDialog::RegisterFunc EditorFileDialog::register_func = NULL; -EditorFileDialog::RegisterFunc EditorFileDialog::unregister_func = NULL; +EditorFileDialog::RegisterFunc EditorFileDialog::register_func = nullptr; +EditorFileDialog::RegisterFunc EditorFileDialog::unregister_func = nullptr; VBoxContainer *EditorFileDialog::get_vbox() { return vbox; @@ -58,17 +59,17 @@ void EditorFileDialog::_notification(int p_what) { if (p_what == NOTIFICATION_ENTER_TREE) { // update icons - mode_thumbnails->set_icon(get_icon("FileThumbnail", "EditorIcons")); - mode_list->set_icon(get_icon("FileList", "EditorIcons")); - dir_prev->set_icon(get_icon("Back", "EditorIcons")); - dir_next->set_icon(get_icon("Forward", "EditorIcons")); - dir_up->set_icon(get_icon("ArrowUp", "EditorIcons")); - refresh->set_icon(get_icon("Reload", "EditorIcons")); - favorite->set_icon(get_icon("Favorites", "EditorIcons")); - show_hidden->set_icon(get_icon("GuiVisibilityVisible", "EditorIcons")); - - fav_up->set_icon(get_icon("MoveUp", "EditorIcons")); - fav_down->set_icon(get_icon("MoveDown", "EditorIcons")); + mode_thumbnails->set_icon(item_list->get_theme_icon("FileThumbnail", "EditorIcons")); + mode_list->set_icon(item_list->get_theme_icon("FileList", "EditorIcons")); + dir_prev->set_icon(item_list->get_theme_icon("Back", "EditorIcons")); + dir_next->set_icon(item_list->get_theme_icon("Forward", "EditorIcons")); + dir_up->set_icon(item_list->get_theme_icon("ArrowUp", "EditorIcons")); + refresh->set_icon(item_list->get_theme_icon("Reload", "EditorIcons")); + favorite->set_icon(item_list->get_theme_icon("Favorites", "EditorIcons")); + show_hidden->set_icon(item_list->get_theme_icon("GuiVisibilityVisible", "EditorIcons")); + + fav_up->set_icon(item_list->get_theme_icon("MoveUp", "EditorIcons")); + fav_down->set_icon(item_list->get_theme_icon("MoveDown", "EditorIcons")); } else if (p_what == NOTIFICATION_PROCESS) { @@ -78,14 +79,11 @@ void EditorFileDialog::_notification(int p_what) { preview_wheel_index++; if (preview_wheel_index >= 8) preview_wheel_index = 0; - Ref<Texture2D> frame = get_icon("Progress" + itos(preview_wheel_index + 1), "EditorIcons"); + Ref<Texture2D> frame = item_list->get_theme_icon("Progress" + itos(preview_wheel_index + 1), "EditorIcons"); preview->set_texture(frame); preview_wheel_timeout = 0.1; } } - } else if (p_what == NOTIFICATION_POPUP_HIDE) { - - set_process_unhandled_input(false); } else if (p_what == EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED) { @@ -95,18 +93,23 @@ void EditorFileDialog::_notification(int p_what) { set_display_mode((DisplayMode)EditorSettings::get_singleton()->get("filesystem/file_dialog/display_mode").operator int()); // update icons - mode_thumbnails->set_icon(get_icon("FileThumbnail", "EditorIcons")); - mode_list->set_icon(get_icon("FileList", "EditorIcons")); - dir_prev->set_icon(get_icon("Back", "EditorIcons")); - dir_next->set_icon(get_icon("Forward", "EditorIcons")); - dir_up->set_icon(get_icon("ArrowUp", "EditorIcons")); - refresh->set_icon(get_icon("Reload", "EditorIcons")); - favorite->set_icon(get_icon("Favorites", "EditorIcons")); - - fav_up->set_icon(get_icon("MoveUp", "EditorIcons")); - fav_down->set_icon(get_icon("MoveDown", "EditorIcons")); + mode_thumbnails->set_icon(item_list->get_theme_icon("FileThumbnail", "EditorIcons")); + mode_list->set_icon(item_list->get_theme_icon("FileList", "EditorIcons")); + dir_prev->set_icon(item_list->get_theme_icon("Back", "EditorIcons")); + dir_next->set_icon(item_list->get_theme_icon("Forward", "EditorIcons")); + dir_up->set_icon(item_list->get_theme_icon("ArrowUp", "EditorIcons")); + refresh->set_icon(item_list->get_theme_icon("Reload", "EditorIcons")); + favorite->set_icon(item_list->get_theme_icon("Favorites", "EditorIcons")); + + fav_up->set_icon(item_list->get_theme_icon("MoveUp", "EditorIcons")); + fav_down->set_icon(item_list->get_theme_icon("MoveDown", "EditorIcons")); // DO NOT CALL UPDATE FILE LIST HERE, ALL HUNDREDS OF HIDDEN DIALOGS WILL RESPOND, CALL INVALIDATE INSTEAD invalidate(); + } else if (p_what == NOTIFICATION_VISIBILITY_CHANGED) { + + if (!is_visible()) { + set_process_unhandled_input(false); + } } } @@ -114,7 +117,7 @@ void EditorFileDialog::_unhandled_input(const Ref<InputEvent> &p_event) { Ref<InputEventKey> k = p_event; - if (k.is_valid() && is_window_modal_on_top()) { + if (k.is_valid()) { if (k->is_pressed()) { @@ -176,7 +179,7 @@ void EditorFileDialog::_unhandled_input(const Ref<InputEvent> &p_event) { } if (handled) { - accept_event(); + set_input_as_handled(); } } } @@ -208,15 +211,15 @@ void EditorFileDialog::update_dir() { get_ok()->set_disabled(_is_open_should_be_disabled()); switch (mode) { - case MODE_OPEN_FILE: - case MODE_OPEN_FILES: + case FILE_MODE_OPEN_FILE: + case FILE_MODE_OPEN_FILES: get_ok()->set_text(TTR("Open")); break; - case MODE_OPEN_DIR: + case FILE_MODE_OPEN_DIR: get_ok()->set_text(TTR("Select Current Folder")); break; - case MODE_OPEN_ANY: - case MODE_SAVE_FILE: + case FILE_MODE_OPEN_ANY: + case FILE_MODE_SAVE_FILE: // FIXME: Implement, or refactor to avoid duplication with set_mode break; } @@ -251,23 +254,23 @@ void EditorFileDialog::_post_popup() { update_file_list(); invalidated = false; } - if (mode == MODE_SAVE_FILE) + if (mode == FILE_MODE_SAVE_FILE) file->grab_focus(); else item_list->grab_focus(); - if (mode == MODE_OPEN_DIR) { + if (mode == FILE_MODE_OPEN_DIR) { file_box->set_visible(false); } else { file_box->set_visible(true); } - if (is_visible_in_tree() && get_current_file() != "") + if (is_visible() && get_current_file() != "") _request_single_thumbnail(get_current_dir().plus_file(get_current_file())); - if (is_visible_in_tree()) { - Ref<Texture2D> folder = get_icon("folder", "FileDialog"); - const Color folder_color = get_color("folder_icon_modulate", "FileDialog"); + if (is_visible()) { + Ref<Texture2D> folder = item_list->get_theme_icon("folder", "FileDialog"); + const Color folder_color = item_list->get_theme_color("folder_icon_modulate", "FileDialog"); recent->clear(); bool res = access == ACCESS_RESOURCES; @@ -346,7 +349,7 @@ void EditorFileDialog::_request_single_thumbnail(const String &p_path) { void EditorFileDialog::_action_pressed() { - if (mode == MODE_OPEN_FILES) { + if (mode == FILE_MODE_OPEN_FILES) { String fbase = dir_access->get_current_dir(); @@ -367,11 +370,11 @@ void EditorFileDialog::_action_pressed() { String f = dir_access->get_current_dir().plus_file(file->get_text()); - if ((mode == MODE_OPEN_ANY || mode == MODE_OPEN_FILE) && dir_access->file_exists(f)) { + if ((mode == FILE_MODE_OPEN_ANY || mode == FILE_MODE_OPEN_FILE) && dir_access->file_exists(f)) { _save_to_recent(); hide(); emit_signal("file_selected", f); - } else if (mode == MODE_OPEN_ANY || mode == MODE_OPEN_DIR) { + } else if (mode == FILE_MODE_OPEN_ANY || mode == FILE_MODE_OPEN_DIR) { String path = dir_access->get_current_dir(); @@ -393,7 +396,7 @@ void EditorFileDialog::_action_pressed() { emit_signal("dir_selected", path); } - if (mode == MODE_SAVE_FILE) { + if (mode == FILE_MODE_SAVE_FILE) { bool valid = false; @@ -446,7 +449,7 @@ void EditorFileDialog::_action_pressed() { if (!valid) { - exterr->popup_centered_minsize(Size2(250, 80) * EDSCALE); + exterr->popup_centered(Size2(250, 80) * EDSCALE); return; } @@ -481,7 +484,7 @@ void EditorFileDialog::_item_selected(int p_item) { file->set_text(d["name"]); _request_single_thumbnail(get_current_dir().plus_file(get_current_file())); - } else if (mode == MODE_OPEN_DIR) { + } else if (mode == FILE_MODE_OPEN_DIR) { get_ok()->set_text(TTR("Select This Folder")); } @@ -512,19 +515,19 @@ void EditorFileDialog::_items_clear_selection() { // If nothing is selected, then block Open button. switch (mode) { - case MODE_OPEN_FILE: - case MODE_OPEN_FILES: + case FILE_MODE_OPEN_FILE: + case FILE_MODE_OPEN_FILES: get_ok()->set_text(TTR("Open")); get_ok()->set_disabled(!item_list->is_anything_selected()); break; - case MODE_OPEN_DIR: + case FILE_MODE_OPEN_DIR: get_ok()->set_disabled(false); get_ok()->set_text(TTR("Select Current Folder")); break; - case MODE_OPEN_ANY: - case MODE_SAVE_FILE: + case FILE_MODE_OPEN_ANY: + case FILE_MODE_SAVE_FILE: // FIXME: Implement, or refactor to avoid duplication with set_mode break; } @@ -586,16 +589,16 @@ void EditorFileDialog::_item_list_item_rmb_selected(int p_item, const Vector2 &p } if (single_item_selected) { - item_menu->add_icon_item(get_icon("ActionCopy", "EditorIcons"), TTR("Copy Path"), ITEM_MENU_COPY_PATH); + item_menu->add_icon_item(item_list->get_theme_icon("ActionCopy", "EditorIcons"), TTR("Copy Path"), ITEM_MENU_COPY_PATH); } if (allow_delete) { - item_menu->add_icon_item(get_icon("Remove", "EditorIcons"), TTR("Delete"), ITEM_MENU_DELETE, KEY_DELETE); + item_menu->add_icon_item(item_list->get_theme_icon("Remove", "EditorIcons"), TTR("Delete"), ITEM_MENU_DELETE, KEY_DELETE); } if (single_item_selected) { item_menu->add_separator(); Dictionary item_meta = item_list->get_item_metadata(p_item); String item_text = item_meta["dir"] ? TTR("Open in File Manager") : TTR("Show in File Manager"); - item_menu->add_icon_item(get_icon("Filesystem", "EditorIcons"), item_text, ITEM_MENU_SHOW_IN_EXPLORER); + item_menu->add_icon_item(item_list->get_theme_icon("Filesystem", "EditorIcons"), item_text, ITEM_MENU_SHOW_IN_EXPLORER); } if (item_menu->get_item_count() > 0) { @@ -615,11 +618,11 @@ void EditorFileDialog::_item_list_rmb_clicked(const Vector2 &p_pos) { item_menu->set_size(Size2(1, 1)); if (can_create_dir) { - item_menu->add_icon_item(get_icon("folder", "FileDialog"), TTR("New Folder..."), ITEM_MENU_NEW_FOLDER, KEY_MASK_CMD | KEY_N); + item_menu->add_icon_item(item_list->get_theme_icon("folder", "FileDialog"), TTR("New Folder..."), ITEM_MENU_NEW_FOLDER, KEY_MASK_CMD | KEY_N); } - item_menu->add_icon_item(get_icon("Reload", "EditorIcons"), TTR("Refresh"), ITEM_MENU_REFRESH, KEY_F5); + item_menu->add_icon_item(item_list->get_theme_icon("Reload", "EditorIcons"), TTR("Refresh"), ITEM_MENU_REFRESH, KEY_F5); item_menu->add_separator(); - item_menu->add_icon_item(get_icon("Filesystem", "EditorIcons"), TTR("Open in File Manager"), ITEM_MENU_SHOW_IN_EXPLORER); + item_menu->add_icon_item(item_list->get_theme_icon("Filesystem", "EditorIcons"), TTR("Open in File Manager"), ITEM_MENU_SHOW_IN_EXPLORER); item_menu->set_position(item_list->get_global_position() + p_pos); item_menu->popup(); @@ -631,7 +634,7 @@ void EditorFileDialog::_item_menu_id_pressed(int p_option) { case ITEM_MENU_COPY_PATH: { Dictionary item_meta = item_list->get_item_metadata(item_list->get_current()); - OS::get_singleton()->set_clipboard(item_meta["path"]); + DisplayServer::get_singleton()->clipboard_set(item_meta["path"]); } break; case ITEM_MENU_DELETE: { @@ -667,18 +670,18 @@ void EditorFileDialog::_item_menu_id_pressed(int p_option) { bool EditorFileDialog::_is_open_should_be_disabled() { - if (mode == MODE_OPEN_ANY || mode == MODE_SAVE_FILE) + if (mode == FILE_MODE_OPEN_ANY || mode == FILE_MODE_SAVE_FILE) return false; Vector<int> items = item_list->get_selected_items(); if (items.size() == 0) - return mode != MODE_OPEN_DIR; // In "Open folder" mode, having nothing selected picks the current folder. + return mode != FILE_MODE_OPEN_DIR; // In "Open folder" mode, having nothing selected picks the current folder. for (int i = 0; i < items.size(); i++) { Dictionary d = item_list->get_item_metadata(items.get(i)); - if (((mode == MODE_OPEN_FILE || mode == MODE_OPEN_FILES) && d["dir"]) || (mode == MODE_OPEN_DIR && !d["dir"])) + if (((mode == FILE_MODE_OPEN_FILE || mode == FILE_MODE_OPEN_FILES) && d["dir"]) || (mode == FILE_MODE_OPEN_DIR && !d["dir"])) return true; } @@ -724,11 +727,11 @@ void EditorFileDialog::update_file_list() { item_list->set_fixed_icon_size(Size2(thumbnail_size, thumbnail_size)); if (thumbnail_size < 64) { - folder_thumbnail = get_icon("FolderMediumThumb", "EditorIcons"); - file_thumbnail = get_icon("FileMediumThumb", "EditorIcons"); + folder_thumbnail = item_list->get_theme_icon("FolderMediumThumb", "EditorIcons"); + file_thumbnail = item_list->get_theme_icon("FileMediumThumb", "EditorIcons"); } else { - folder_thumbnail = get_icon("FolderBigThumb", "EditorIcons"); - file_thumbnail = get_icon("FileBigThumb", "EditorIcons"); + folder_thumbnail = item_list->get_theme_icon("FolderBigThumb", "EditorIcons"); + file_thumbnail = item_list->get_theme_icon("FileBigThumb", "EditorIcons"); } preview_vb->hide(); @@ -748,8 +751,8 @@ void EditorFileDialog::update_file_list() { dir_access->list_dir_begin(); - Ref<Texture2D> folder = get_icon("folder", "FileDialog"); - const Color folder_color = get_color("folder_icon_modulate", "FileDialog"); + Ref<Texture2D> folder = item_list->get_theme_icon("folder", "FileDialog"); + const Color folder_color = item_list->get_theme_color("folder_icon_modulate", "FileDialog"); List<String> files; List<String> dirs; @@ -978,7 +981,7 @@ void EditorFileDialog::set_current_file(const String &p_file) { file->grab_focus(); } - if (is_visible_in_tree()) + if (is_visible()) _request_single_thumbnail(get_current_dir().plus_file(get_current_file())); } void EditorFileDialog::set_current_path(const String &p_path) { @@ -998,39 +1001,39 @@ void EditorFileDialog::set_current_path(const String &p_path) { } } -void EditorFileDialog::set_mode(Mode p_mode) { +void EditorFileDialog::set_file_mode(FileMode p_mode) { mode = p_mode; switch (mode) { - case MODE_OPEN_FILE: + case FILE_MODE_OPEN_FILE: get_ok()->set_text(TTR("Open")); set_title(TTR("Open a File")); can_create_dir = false; break; - case MODE_OPEN_FILES: + case FILE_MODE_OPEN_FILES: get_ok()->set_text(TTR("Open")); set_title(TTR("Open File(s)")); can_create_dir = false; break; - case MODE_OPEN_DIR: + case FILE_MODE_OPEN_DIR: get_ok()->set_text(TTR("Open")); set_title(TTR("Open a Directory")); can_create_dir = true; break; - case MODE_OPEN_ANY: + case FILE_MODE_OPEN_ANY: get_ok()->set_text(TTR("Open")); set_title(TTR("Open a File or Directory")); can_create_dir = true; break; - case MODE_SAVE_FILE: + case FILE_MODE_SAVE_FILE: get_ok()->set_text(TTR("Save")); set_title(TTR("Save a File")); can_create_dir = true; break; } - if (mode == MODE_OPEN_FILES) { + if (mode == FILE_MODE_OPEN_FILES) { item_list->set_select_mode(ItemList::SELECT_MULTI); } else { item_list->set_select_mode(ItemList::SELECT_SINGLE); @@ -1043,7 +1046,7 @@ void EditorFileDialog::set_mode(Mode p_mode) { } } -EditorFileDialog::Mode EditorFileDialog::get_mode() const { +EditorFileDialog::FileMode EditorFileDialog::get_file_mode() const { return mode; } @@ -1077,7 +1080,7 @@ void EditorFileDialog::set_access(Access p_access) { void EditorFileDialog::invalidate() { - if (is_visible_in_tree()) { + if (is_visible()) { update_file_list(); _update_favorites(); invalidated = false; @@ -1102,14 +1105,14 @@ void EditorFileDialog::_make_dir_confirm() { _push_history(); EditorFileSystem::get_singleton()->scan_changes(); //we created a dir, so rescan changes } else { - mkdirerr->popup_centered_minsize(Size2(250, 50) * EDSCALE); + mkdirerr->popup_centered(Size2(250, 50) * EDSCALE); } makedirname->set_text(""); // reset label } void EditorFileDialog::_make_dir() { - makedialog->popup_centered_minsize(Size2(250, 80) * EDSCALE); + makedialog->popup_centered(Size2(250, 80) * EDSCALE); makedirname->grab_focus(); } @@ -1224,8 +1227,8 @@ void EditorFileDialog::_update_favorites() { bool res = access == ACCESS_RESOURCES; String current = get_current_dir(); - Ref<Texture2D> folder_icon = get_icon("Folder", "EditorIcons"); - const Color folder_color = get_color("folder_icon_modulate", "FileDialog"); + Ref<Texture2D> folder_icon = item_list->get_theme_icon("Folder", "EditorIcons"); + const Color folder_color = item_list->get_theme_color("folder_icon_modulate", "FileDialog"); favorites->clear(); favorite->set_pressed(false); @@ -1383,8 +1386,8 @@ void EditorFileDialog::_bind_methods() { ClassDB::bind_method(D_METHOD("set_current_dir", "dir"), &EditorFileDialog::set_current_dir); ClassDB::bind_method(D_METHOD("set_current_file", "file"), &EditorFileDialog::set_current_file); ClassDB::bind_method(D_METHOD("set_current_path", "path"), &EditorFileDialog::set_current_path); - ClassDB::bind_method(D_METHOD("set_mode", "mode"), &EditorFileDialog::set_mode); - ClassDB::bind_method(D_METHOD("get_mode"), &EditorFileDialog::get_mode); + ClassDB::bind_method(D_METHOD("set_file_mode", "mode"), &EditorFileDialog::set_file_mode); + ClassDB::bind_method(D_METHOD("get_file_mode"), &EditorFileDialog::get_file_mode); ClassDB::bind_method(D_METHOD("get_vbox"), &EditorFileDialog::get_vbox); ClassDB::bind_method(D_METHOD("set_access", "access"), &EditorFileDialog::set_access); ClassDB::bind_method(D_METHOD("get_access"), &EditorFileDialog::get_access); @@ -1408,18 +1411,18 @@ void EditorFileDialog::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::INT, "access", PROPERTY_HINT_ENUM, "Resources,User data,File system"), "set_access", "get_access"); ADD_PROPERTY(PropertyInfo(Variant::INT, "display_mode", PROPERTY_HINT_ENUM, "Thumbnails,List"), "set_display_mode", "get_display_mode"); - ADD_PROPERTY(PropertyInfo(Variant::INT, "mode", PROPERTY_HINT_ENUM, "Open one,Open many,Open folder,Open any,Save"), "set_mode", "get_mode"); + ADD_PROPERTY(PropertyInfo(Variant::INT, "file_mode", PROPERTY_HINT_ENUM, "Open one,Open many,Open folder,Open any,Save"), "set_file_mode", "get_file_mode"); ADD_PROPERTY(PropertyInfo(Variant::STRING, "current_dir", PROPERTY_HINT_DIR), "set_current_dir", "get_current_dir"); ADD_PROPERTY(PropertyInfo(Variant::STRING, "current_file", PROPERTY_HINT_FILE, "*"), "set_current_file", "get_current_file"); ADD_PROPERTY(PropertyInfo(Variant::STRING, "current_path"), "set_current_path", "get_current_path"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "show_hidden_files"), "set_show_hidden_files", "is_showing_hidden_files"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "disable_overwrite_warning"), "set_disable_overwrite_warning", "is_overwrite_warning_disabled"); - BIND_ENUM_CONSTANT(MODE_OPEN_FILE); - BIND_ENUM_CONSTANT(MODE_OPEN_FILES); - BIND_ENUM_CONSTANT(MODE_OPEN_DIR); - BIND_ENUM_CONSTANT(MODE_OPEN_ANY); - BIND_ENUM_CONSTANT(MODE_SAVE_FILE); + BIND_ENUM_CONSTANT(FILE_MODE_OPEN_FILE); + BIND_ENUM_CONSTANT(FILE_MODE_OPEN_FILES); + BIND_ENUM_CONSTANT(FILE_MODE_OPEN_DIR); + BIND_ENUM_CONSTANT(FILE_MODE_OPEN_ANY); + BIND_ENUM_CONSTANT(FILE_MODE_SAVE_FILE); BIND_ENUM_CONSTANT(ACCESS_RESOURCES); BIND_ENUM_CONSTANT(ACCESS_USERDATA); @@ -1483,8 +1486,6 @@ bool EditorFileDialog::is_overwrite_warning_disabled() const { EditorFileDialog::EditorFileDialog() { - set_resizable(true); - show_hidden_files = default_show_hidden_files; display_mode = default_display_mode; local_history_pos = 0; @@ -1492,7 +1493,7 @@ EditorFileDialog::EditorFileDialog() { VBoxContainer *vbc = memnew(VBoxContainer); add_child(vbc); - mode = MODE_SAVE_FILE; + mode = FILE_MODE_SAVE_FILE; set_title(TTR("Save a File")); ED_SHORTCUT("file_dialog/go_back", TTR("Go Back"), KEY_MASK_ALT | KEY_LEFT); @@ -1532,7 +1533,7 @@ EditorFileDialog::EditorFileDialog() { dir = memnew(LineEdit); pathhb->add_child(dir); - dir->set_h_size_flags(SIZE_EXPAND_FILL); + dir->set_h_size_flags(Control::SIZE_EXPAND_FILL); refresh = memnew(ToolButton); refresh->set_tooltip(TTR("Refresh files.")); @@ -1578,6 +1579,7 @@ EditorFileDialog::EditorFileDialog() { drives = memnew(OptionButton); drives->connect("item_selected", callable_mp(this, &EditorFileDialog::_select_drive)); + pathhb->add_child(drives); makedir = memnew(Button); makedir->set_text(TTR("Create Folder")); @@ -1588,7 +1590,7 @@ EditorFileDialog::EditorFileDialog() { vbc->add_child(pathhb); vbc->add_child(list_hb); - list_hb->set_v_size_flags(SIZE_EXPAND_FILL); + list_hb->set_v_size_flags(Control::SIZE_EXPAND_FILL); VSplitContainer *vsc = memnew(VSplitContainer); list_hb->add_child(vsc); @@ -1596,7 +1598,7 @@ EditorFileDialog::EditorFileDialog() { VBoxContainer *fav_vb = memnew(VBoxContainer); vsc->add_child(fav_vb); fav_vb->set_custom_minimum_size(Size2(150, 100) * EDSCALE); - fav_vb->set_v_size_flags(SIZE_EXPAND_FILL); + fav_vb->set_v_size_flags(Control::SIZE_EXPAND_FILL); HBoxContainer *fav_hb = memnew(HBoxContainer); fav_vb->add_child(fav_hb); fav_hb->add_child(memnew(Label(TTR("Favorites:")))); @@ -1610,13 +1612,13 @@ EditorFileDialog::EditorFileDialog() { favorites = memnew(ItemList); fav_vb->add_child(favorites); - favorites->set_v_size_flags(SIZE_EXPAND_FILL); + favorites->set_v_size_flags(Control::SIZE_EXPAND_FILL); favorites->connect("item_selected", callable_mp(this, &EditorFileDialog::_favorite_selected)); VBoxContainer *rec_vb = memnew(VBoxContainer); vsc->add_child(rec_vb); rec_vb->set_custom_minimum_size(Size2(150, 100) * EDSCALE); - rec_vb->set_v_size_flags(SIZE_EXPAND_FILL); + rec_vb->set_v_size_flags(Control::SIZE_EXPAND_FILL); recent = memnew(ItemList); recent->set_allow_reselect(true); rec_vb->add_margin_child(TTR("Recent:"), recent, true); @@ -1627,18 +1629,18 @@ EditorFileDialog::EditorFileDialog() { item_vb->set_custom_minimum_size(Size2(320, 0) * EDSCALE); HBoxContainer *preview_hb = memnew(HBoxContainer); - preview_hb->set_v_size_flags(SIZE_EXPAND_FILL); + preview_hb->set_v_size_flags(Control::SIZE_EXPAND_FILL); item_vb->add_child(preview_hb); VBoxContainer *list_vb = memnew(VBoxContainer); - list_vb->set_h_size_flags(SIZE_EXPAND_FILL); + list_vb->set_h_size_flags(Control::SIZE_EXPAND_FILL); list_vb->add_child(memnew(Label(TTR("Directories & Files:")))); preview_hb->add_child(list_vb); // Item (files and folders) list with context menu. item_list = memnew(ItemList); - item_list->set_v_size_flags(SIZE_EXPAND_FILL); + item_list->set_v_size_flags(Control::SIZE_EXPAND_FILL); item_list->connect("item_rmb_selected", callable_mp(this, &EditorFileDialog::_item_list_item_rmb_selected)); item_list->connect("rmb_clicked", callable_mp(this, &EditorFileDialog::_item_list_rmb_clicked)); item_list->set_allow_rmb_select(true); @@ -1662,14 +1664,14 @@ EditorFileDialog::EditorFileDialog() { file_box->add_child(memnew(Label(TTR("File:")))); file = memnew(LineEdit); file->set_stretch_ratio(4); - file->set_h_size_flags(SIZE_EXPAND_FILL); + file->set_h_size_flags(Control::SIZE_EXPAND_FILL); file_box->add_child(file); filter = memnew(OptionButton); filter->set_stretch_ratio(3); - filter->set_h_size_flags(SIZE_EXPAND_FILL); + filter->set_h_size_flags(Control::SIZE_EXPAND_FILL); filter->set_clip_text(true); // Too many extensions overflow it. file_box->add_child(filter); - file_box->set_h_size_flags(SIZE_EXPAND_FILL); + file_box->set_h_size_flags(Control::SIZE_EXPAND_FILL); item_vb->add_child(file_box); dir_access = DirAccess::create(DirAccess::ACCESS_RESOURCES); @@ -1686,7 +1688,7 @@ EditorFileDialog::EditorFileDialog() { filter->connect("item_selected", callable_mp(this, &EditorFileDialog::_filter_selected)); confirm_save = memnew(ConfirmationDialog); - confirm_save->set_as_toplevel(true); + //confirm_save->set_as_toplevel(true); add_child(confirm_save); confirm_save->connect("confirmed", callable_mp(this, &EditorFileDialog::_save_confirm_pressed)); @@ -1732,42 +1734,3 @@ EditorFileDialog::~EditorFileDialog() { unregister_func(this); memdelete(dir_access); } - -void EditorLineEditFileChooser::_notification(int p_what) { - - if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED) - button->set_icon(get_icon("Folder", "EditorIcons")); -} - -void EditorLineEditFileChooser::_bind_methods() { - - ClassDB::bind_method(D_METHOD("get_button"), &EditorLineEditFileChooser::get_button); - ClassDB::bind_method(D_METHOD("get_line_edit"), &EditorLineEditFileChooser::get_line_edit); - ClassDB::bind_method(D_METHOD("get_file_dialog"), &EditorLineEditFileChooser::get_file_dialog); -} - -void EditorLineEditFileChooser::_chosen(const String &p_text) { - - line_edit->set_text(p_text); - line_edit->emit_signal("text_entered", p_text); -} - -void EditorLineEditFileChooser::_browse() { - - dialog->popup_centered_ratio(); -} - -EditorLineEditFileChooser::EditorLineEditFileChooser() { - - line_edit = memnew(LineEdit); - add_child(line_edit); - line_edit->set_h_size_flags(SIZE_EXPAND_FILL); - button = memnew(Button); - add_child(button); - button->connect("pressed", callable_mp(this, &EditorLineEditFileChooser::_browse)); - dialog = memnew(EditorFileDialog); - add_child(dialog); - dialog->connect("file_selected", callable_mp(this, &EditorLineEditFileChooser::_chosen)); - dialog->connect("dir_selected", callable_mp(this, &EditorLineEditFileChooser::_chosen)); - dialog->connect("files_selected", callable_mp(this, &EditorLineEditFileChooser::_chosen)); -} diff --git a/editor/editor_file_dialog.h b/editor/editor_file_dialog.h index 998ac33761..8efb8f5368 100644 --- a/editor/editor_file_dialog.h +++ b/editor/editor_file_dialog.h @@ -60,12 +60,12 @@ public: ACCESS_FILESYSTEM }; - enum Mode { - MODE_OPEN_FILE, - MODE_OPEN_FILES, - MODE_OPEN_DIR, - MODE_OPEN_ANY, - MODE_SAVE_FILE + enum FileMode { + FILE_MODE_OPEN_FILE, + FILE_MODE_OPEN_FILES, + FILE_MODE_OPEN_DIR, + FILE_MODE_OPEN_ANY, + FILE_MODE_SAVE_FILE }; typedef Ref<Texture2D> (*GetIconFunc)(const String &); @@ -92,7 +92,7 @@ private: Access access; //Button *action; VBoxContainer *vbox; - Mode mode; + FileMode mode; bool can_create_dir; LineEdit *dir; @@ -221,8 +221,8 @@ public: void set_display_mode(DisplayMode p_mode); DisplayMode get_display_mode() const; - void set_mode(Mode p_mode); - Mode get_mode() const; + void set_file_mode(FileMode p_mode); + FileMode get_file_mode() const; VBoxContainer *get_vbox(); LineEdit *get_line_edit() { return file; } @@ -245,29 +245,7 @@ public: ~EditorFileDialog(); }; -class EditorLineEditFileChooser : public HBoxContainer { - - GDCLASS(EditorLineEditFileChooser, HBoxContainer); - Button *button; - LineEdit *line_edit; - EditorFileDialog *dialog; - - void _chosen(const String &p_text); - void _browse(); - -protected: - void _notification(int p_what); - static void _bind_methods(); - -public: - Button *get_button() { return button; } - LineEdit *get_line_edit() { return line_edit; } - EditorFileDialog *get_file_dialog() { return dialog; } - - EditorLineEditFileChooser(); -}; - -VARIANT_ENUM_CAST(EditorFileDialog::Mode); +VARIANT_ENUM_CAST(EditorFileDialog::FileMode); VARIANT_ENUM_CAST(EditorFileDialog::Access); VARIANT_ENUM_CAST(EditorFileDialog::DisplayMode); diff --git a/editor/editor_file_system.cpp b/editor/editor_file_system.cpp index ad34b59c5c..c211d5852a 100644 --- a/editor/editor_file_system.cpp +++ b/editor/editor_file_system.cpp @@ -41,7 +41,7 @@ #include "editor_resource_preview.h" #include "editor_settings.h" -EditorFileSystem *EditorFileSystem::singleton = NULL; +EditorFileSystem *EditorFileSystem::singleton = nullptr; //the name is the version, to keep compatibility with different versions of Godot #define CACHE_FILE_NAME "filesystem_cache6" @@ -75,7 +75,7 @@ int EditorFileSystemDirectory::get_subdir_count() const { EditorFileSystemDirectory *EditorFileSystemDirectory::get_subdir(int p_idx) { - ERR_FAIL_INDEX_V(p_idx, subdirs.size(), NULL); + ERR_FAIL_INDEX_V(p_idx, subdirs.size(), nullptr); return subdirs[p_idx]; } @@ -176,7 +176,7 @@ void EditorFileSystemDirectory::_bind_methods() { EditorFileSystemDirectory::EditorFileSystemDirectory() { modified_time = 0; - parent = NULL; + parent = nullptr; verified = false; } @@ -300,7 +300,7 @@ void EditorFileSystem::_scan_filesystem() { sp.progress = &scan_progress; new_filesystem = memnew(EditorFileSystemDirectory); - new_filesystem->parent = NULL; + new_filesystem->parent = nullptr; DirAccess *d = DirAccess::create(DirAccess::ACCESS_RESOURCES); d->change_dir("res://"); @@ -383,7 +383,7 @@ bool EditorFileSystem::_test_for_reimport(const String &p_path, bool p_only_impo next_tag.fields.clear(); next_tag.name = String(); - err = VariantParser::parse_tag_assign_eof(&stream, lines, error_text, next_tag, assign, value, NULL, true); + err = VariantParser::parse_tag_assign_eof(&stream, lines, error_text, next_tag, assign, value, nullptr, true); if (err == ERR_FILE_EOF) { break; } else if (err != OK) { @@ -430,7 +430,7 @@ bool EditorFileSystem::_test_for_reimport(const String &p_path, bool p_only_impo next_tag.fields.clear(); next_tag.name = String(); - err = VariantParser::parse_tag_assign_eof(&md5_stream, lines, error_text, next_tag, assign, value, NULL, true); + err = VariantParser::parse_tag_assign_eof(&md5_stream, lines, error_text, next_tag, assign, value, nullptr, true); if (err == ERR_FILE_EOF) { break; @@ -622,7 +622,7 @@ void EditorFileSystem::scan() { memdelete(filesystem); //file_type_cache.clear(); filesystem = new_filesystem; - new_filesystem = NULL; + new_filesystem = nullptr; _update_scan_actions(); scanning = false; emit_signal("filesystem_changed"); @@ -1124,8 +1124,8 @@ void EditorFileSystem::_notification(int p_what) { } Thread::wait_to_finish(active_thread); memdelete(active_thread); - thread = NULL; - thread_sources = NULL; + thread = nullptr; + thread_sources = nullptr; WARN_PRINT("Scan thread aborted..."); set_process(false); } @@ -1134,8 +1134,8 @@ void EditorFileSystem::_notification(int p_what) { memdelete(filesystem); if (new_filesystem) memdelete(new_filesystem); - filesystem = NULL; - new_filesystem = NULL; + filesystem = nullptr; + new_filesystem = nullptr; } break; case NOTIFICATION_PROCESS: { @@ -1152,7 +1152,7 @@ void EditorFileSystem::_notification(int p_what) { Thread::wait_to_finish(thread_sources); memdelete(thread_sources); - thread_sources = NULL; + thread_sources = nullptr; if (_update_scan_actions()) emit_signal("filesystem_changed"); emit_signal("sources_changed", sources_changed.size() > 0); @@ -1166,10 +1166,10 @@ void EditorFileSystem::_notification(int p_what) { if (filesystem) memdelete(filesystem); filesystem = new_filesystem; - new_filesystem = NULL; + new_filesystem = nullptr; Thread::wait_to_finish(thread); memdelete(thread); - thread = NULL; + thread = nullptr; _update_scan_actions(); emit_signal("filesystem_changed"); emit_signal("sources_changed", sources_changed.size() > 0); @@ -1308,7 +1308,7 @@ bool EditorFileSystem::_find_file(const String &p_file, EditorFileSystemDirector String EditorFileSystem::get_file_type(const String &p_file) const { - EditorFileSystemDirectory *fs = NULL; + EditorFileSystemDirectory *fs = nullptr; int cpos = -1; if (!_find_file(p_file, &fs, cpos)) { @@ -1322,13 +1322,13 @@ String EditorFileSystem::get_file_type(const String &p_file) const { EditorFileSystemDirectory *EditorFileSystem::find_file(const String &p_file, int *r_index) const { if (!filesystem || scanning) - return NULL; + return nullptr; - EditorFileSystemDirectory *fs = NULL; + EditorFileSystemDirectory *fs = nullptr; int cpos = -1; if (!_find_file(p_file, &fs, cpos)) { - return NULL; + return nullptr; } if (r_index) @@ -1340,12 +1340,12 @@ EditorFileSystemDirectory *EditorFileSystem::find_file(const String &p_file, int EditorFileSystemDirectory *EditorFileSystem::get_filesystem_path(const String &p_path) { if (!filesystem || scanning) - return NULL; + return nullptr; String f = ProjectSettings::get_singleton()->localize_path(p_path); if (!f.begins_with("res://")) - return NULL; + return nullptr; f = f.substr(6, f.length()); f = f.replace("\\", "/"); @@ -1358,7 +1358,7 @@ EditorFileSystemDirectory *EditorFileSystem::get_filesystem_path(const String &p Vector<String> path = f.split("/"); if (path.size() == 0) - return NULL; + return nullptr; EditorFileSystemDirectory *fs = filesystem; @@ -1374,7 +1374,7 @@ EditorFileSystemDirectory *EditorFileSystem::get_filesystem_path(const String &p } if (idx == -1) { - return NULL; + return nullptr; } else { fs = fs->get_subdir(idx); @@ -1483,7 +1483,7 @@ void EditorFileSystem::_queue_update_script_classes() { void EditorFileSystem::update_file(const String &p_file) { - EditorFileSystemDirectory *fs = NULL; + EditorFileSystemDirectory *fs = nullptr; int cpos = -1; if (!_find_file(p_file, &fs, cpos)) { @@ -1684,7 +1684,7 @@ Error EditorFileSystem::_reimport_group(const String &p_group_file, const Vector } md5s->close(); - EditorFileSystemDirectory *fs = NULL; + EditorFileSystemDirectory *fs = nullptr; int cpos = -1; bool found = _find_file(file, &fs, cpos); ERR_FAIL_COND_V_MSG(!found, ERR_UNCONFIGURED, "Can't find file '" + file + "'."); @@ -1718,7 +1718,7 @@ Error EditorFileSystem::_reimport_group(const String &p_group_file, const Vector void EditorFileSystem::_reimport_file(const String &p_file) { - EditorFileSystemDirectory *fs = NULL; + EditorFileSystemDirectory *fs = nullptr; int cpos = -1; bool found = _find_file(p_file, &fs, cpos); ERR_FAIL_COND_MSG(!found, "Can't find file '" + p_file + "'."); @@ -1980,7 +1980,7 @@ void EditorFileSystem::reimport_files(const Vector<String> &p_files) { } //group may have changed, so also update group reference - EditorFileSystemDirectory *fs = NULL; + EditorFileSystemDirectory *fs = nullptr; int cpos = -1; if (_find_file(p_files[i], &fs, cpos)) { @@ -2131,14 +2131,14 @@ EditorFileSystem::EditorFileSystem() { singleton = this; filesystem = memnew(EditorFileSystemDirectory); //like, empty - filesystem->parent = NULL; + filesystem->parent = nullptr; - thread = NULL; + thread = nullptr; scanning = false; importing = false; use_threads = true; - thread_sources = NULL; - new_filesystem = NULL; + thread_sources = nullptr; + new_filesystem = nullptr; abort_scan = false; scanning_changes = false; diff --git a/editor/editor_file_system.h b/editor/editor_file_system.h index 9789dacdc1..55a2ed3d09 100644 --- a/editor/editor_file_system.h +++ b/editor/editor_file_system.h @@ -129,9 +129,9 @@ class EditorFileSystem : public Node { ItemAction() { action = ACTION_NONE; - dir = NULL; - new_dir = NULL; - new_file = NULL; + dir = nullptr; + new_dir = nullptr; + new_file = nullptr; } }; diff --git a/editor/editor_fonts.cpp b/editor/editor_fonts.cpp index 171b7a2176..8aadf02ea6 100644 --- a/editor/editor_fonts.cpp +++ b/editor/editor_fonts.cpp @@ -231,7 +231,7 @@ void editor_register_fonts(Ref<Theme> p_theme) { // Default font MAKE_DEFAULT_FONT(df, default_font_size); - p_theme->set_default_theme_font(df); + p_theme->set_font("font", "Node", df); // Default theme font p_theme->set_font("main", "EditorFonts", df); // Bold font diff --git a/editor/editor_help.cpp b/editor/editor_help.cpp index 874f984844..bad70d9714 100644 --- a/editor/editor_help.cpp +++ b/editor/editor_help.cpp @@ -30,7 +30,7 @@ #include "editor_help.h" -#include "core/os/input.h" +#include "core/input/input_filter.h" #include "core/os/keyboard.h" #include "doc_data_compressed.gen.h" #include "editor/plugins/script_editor_plugin.h" @@ -39,24 +39,22 @@ #include "editor_settings.h" #define CONTRIBUTE_URL "https://docs.godotengine.org/en/latest/community/contributing/updating_the_class_reference.html" -#define CONTRIBUTE2_URL "https://github.com/godotengine/godot-docs" -#define REQUEST_URL "https://github.com/godotengine/godot-docs/issues/new" -DocData *EditorHelp::doc = NULL; +DocData *EditorHelp::doc = nullptr; void EditorHelp::_init_colors() { - title_color = get_color("accent_color", "Editor"); - text_color = get_color("default_color", "RichTextLabel"); - headline_color = get_color("headline_color", "EditorHelp"); + title_color = get_theme_color("accent_color", "Editor"); + text_color = get_theme_color("default_color", "RichTextLabel"); + headline_color = get_theme_color("headline_color", "EditorHelp"); base_type_color = title_color.linear_interpolate(text_color, 0.5); comment_color = text_color * Color(1, 1, 1, 0.6); symbol_color = comment_color; value_color = text_color * Color(1, 1, 1, 0.6); qualifier_color = text_color * Color(1, 1, 1, 0.8); - type_color = get_color("accent_color", "Editor").linear_interpolate(text_color, 0.5); - class_desc->add_color_override("selection_color", get_color("accent_color", "Editor") * Color(1, 1, 1, 0.4)); - class_desc->add_constant_override("line_separation", Math::round(5 * EDSCALE)); + type_color = get_theme_color("accent_color", "Editor").linear_interpolate(text_color, 0.5); + class_desc->add_theme_color_override("selection_color", get_theme_color("accent_color", "Editor") * Color(1, 1, 1, 0.4)); + class_desc->add_theme_constant_override("line_separation", Math::round(5 * EDSCALE)); } void EditorHelp::_unhandled_key_input(const Ref<InputEvent> &p_ev) { @@ -109,7 +107,7 @@ void EditorHelp::_class_desc_select(const String &p_select) { String link = p_select.substr(tag_end + 1, p_select.length()).lstrip(" "); String topic; - Map<String, int> *table = NULL; + Map<String, int> *table = nullptr; if (tag == "method") { topic = "class_method"; @@ -173,14 +171,14 @@ void EditorHelp::_class_desc_input(const Ref<InputEvent> &p_input) { void EditorHelp::_class_desc_resized() { // Add extra horizontal margins for better readability. // The margins increase as the width of the editor help container increases. - Ref<Font> doc_code_font = get_font("doc_source", "EditorFonts"); + Ref<Font> doc_code_font = get_theme_font("doc_source", "EditorFonts"); real_t char_width = doc_code_font->get_char_size('x').width; const int display_margin = MAX(30 * EDSCALE, get_parent_anchorable_rect().size.width - char_width * 120 * EDSCALE) * 0.5; - Ref<StyleBox> class_desc_stylebox = EditorNode::get_singleton()->get_theme_base()->get_stylebox("normal", "RichTextLabel")->duplicate(); + Ref<StyleBox> class_desc_stylebox = EditorNode::get_singleton()->get_theme_base()->get_theme_stylebox("normal", "RichTextLabel")->duplicate(); class_desc_stylebox->set_default_margin(MARGIN_LEFT, display_margin); class_desc_stylebox->set_default_margin(MARGIN_RIGHT, display_margin); - class_desc->add_style_override("normal", class_desc_stylebox); + class_desc->add_theme_style_override("normal", class_desc_stylebox); } void EditorHelp::_add_type(const String &p_type, const String &p_enum) { @@ -197,10 +195,15 @@ void EditorHelp::_add_type(const String &p_type, const String &p_enum) { t = p_enum.get_slice(".", 0); } } - const Color text_color = get_color("default_color", "RichTextLabel"); - const Color type_color = get_color("accent_color", "Editor").linear_interpolate(text_color, 0.5); + const Color text_color = get_theme_color("default_color", "RichTextLabel"); + const Color type_color = get_theme_color("accent_color", "Editor").linear_interpolate(text_color, 0.5); class_desc->push_color(type_color); + bool add_array = false; if (can_ref) { + if (t.ends_with("[]")) { + add_array = true; + t = t.replace("[]", ""); + } if (p_enum.empty()) { class_desc->push_meta("#" + t); //class } else { @@ -208,8 +211,15 @@ void EditorHelp::_add_type(const String &p_type, const String &p_enum) { } } class_desc->add_text(t); - if (can_ref) + if (can_ref) { class_desc->pop(); + if (add_array) { + class_desc->add_text(" "); + class_desc->push_meta("#Array"); //class + class_desc->add_text("[]"); + class_desc->pop(); + } + } class_desc->pop(); } @@ -346,10 +356,10 @@ void EditorHelp::_update_doc() { DocData::ClassDoc cd = doc->class_list[edited_class]; //make a copy, so we can sort without worrying - Ref<Font> doc_font = get_font("doc", "EditorFonts"); - Ref<Font> doc_bold_font = get_font("doc_bold", "EditorFonts"); - Ref<Font> doc_title_font = get_font("doc_title", "EditorFonts"); - Ref<Font> doc_code_font = get_font("doc_source", "EditorFonts"); + Ref<Font> doc_font = get_theme_font("doc", "EditorFonts"); + Ref<Font> doc_bold_font = get_theme_font("doc_bold", "EditorFonts"); + Ref<Font> doc_title_font = get_theme_font("doc_title", "EditorFonts"); + Ref<Font> doc_code_font = get_theme_font("doc_source", "EditorFonts"); String link_color_text = title_color.to_html(false); // Class name @@ -1072,7 +1082,7 @@ void EditorHelp::_update_doc() { if (cd.properties[i].description.strip_edges() != String()) { _add_text(DTR(cd.properties[i].description)); } else { - class_desc->add_image(get_icon("Error", "EditorIcons")); + class_desc->add_image(get_theme_icon("Error", "EditorIcons")); class_desc->add_text(" "); class_desc->push_color(comment_color); class_desc->append_bbcode(TTR("There is currently no description for this property. Please help us by [color=$color][url=$url]contributing one[/url][/color]!").replace("$url", CONTRIBUTE_URL).replace("$color", link_color_text)); @@ -1125,7 +1135,7 @@ void EditorHelp::_update_doc() { if (methods_filtered[i].description.strip_edges() != String()) { _add_text(DTR(methods_filtered[i].description)); } else { - class_desc->add_image(get_icon("Error", "EditorIcons")); + class_desc->add_image(get_theme_icon("Error", "EditorIcons")); class_desc->add_text(" "); class_desc->push_color(comment_color); class_desc->append_bbcode(TTR("There is currently no description for this method. Please help us by [color=$color][url=$url]contributing one[/url][/color]!").replace("$url", CONTRIBUTE_URL).replace("$color", link_color_text)); @@ -1209,12 +1219,12 @@ static void _add_text_to_rt(const String &p_bbcode, RichTextLabel *p_rt) { DocData *doc = EditorHelp::get_doc_data(); String base_path; - Ref<Font> doc_font = p_rt->get_font("doc", "EditorFonts"); - Ref<Font> doc_bold_font = p_rt->get_font("doc_bold", "EditorFonts"); - Ref<Font> doc_code_font = p_rt->get_font("doc_source", "EditorFonts"); + Ref<Font> doc_font = p_rt->get_theme_font("doc", "EditorFonts"); + Ref<Font> doc_bold_font = p_rt->get_theme_font("doc_bold", "EditorFonts"); + Ref<Font> doc_code_font = p_rt->get_theme_font("doc_source", "EditorFonts"); - Color font_color_hl = p_rt->get_color("headline_color", "EditorHelp"); - Color accent_color = p_rt->get_color("accent_color", "Editor"); + Color font_color_hl = p_rt->get_theme_color("headline_color", "EditorHelp"); + Color accent_color = p_rt->get_theme_color("accent_color", "Editor"); Color link_color = accent_color.linear_interpolate(font_color_hl, 0.8); Color code_color = accent_color.linear_interpolate(font_color_hl, 0.6); @@ -1545,7 +1555,7 @@ EditorHelp::EditorHelp() { class_desc = memnew(RichTextLabel); add_child(class_desc); class_desc->set_v_size_flags(SIZE_EXPAND_FILL); - class_desc->add_color_override("selection_color", get_color("accent_color", "Editor") * Color(1, 1, 1, 0.4)); + class_desc->add_theme_color_override("selection_color", get_theme_color("accent_color", "Editor") * Color(1, 1, 1, 0.4)); class_desc->connect("meta_clicked", callable_mp(this, &EditorHelp::_class_desc_select)); class_desc->connect("gui_input", callable_mp(this, &EditorHelp::_class_desc_input)); @@ -1610,9 +1620,14 @@ void EditorHelpBit::_bind_methods() { void EditorHelpBit::_notification(int p_what) { switch (p_what) { + case NOTIFICATION_READY: { + rich_text->clear(); + _add_text_to_rt(text, rich_text); + + } break; case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: { - rich_text->add_color_override("selection_color", get_color("accent_color", "Editor") * Color(1, 1, 1, 0.4)); + rich_text->add_theme_color_override("selection_color", get_theme_color("accent_color", "Editor") * Color(1, 1, 1, 0.4)); } break; default: break; } @@ -1620,8 +1635,9 @@ void EditorHelpBit::_notification(int p_what) { void EditorHelpBit::set_text(const String &p_text) { + text = p_text; rich_text->clear(); - _add_text_to_rt(p_text, rich_text); + _add_text_to_rt(text, rich_text); } EditorHelpBit::EditorHelpBit() { @@ -1629,7 +1645,7 @@ EditorHelpBit::EditorHelpBit() { rich_text = memnew(RichTextLabel); add_child(rich_text); rich_text->connect("meta_clicked", callable_mp(this, &EditorHelpBit::_meta_clicked)); - rich_text->add_color_override("selection_color", get_color("accent_color", "Editor") * Color(1, 1, 1, 0.4)); + rich_text->add_theme_color_override("selection_color", get_theme_color("accent_color", "Editor") * Color(1, 1, 1, 0.4)); rich_text->set_override_selected_font_color(false); set_custom_minimum_size(Size2(0, 70 * EDSCALE)); } @@ -1693,13 +1709,13 @@ void FindBar::_notification(int p_what) { case NOTIFICATION_ENTER_TREE: case NOTIFICATION_THEME_CHANGED: { - find_prev->set_icon(get_icon("MoveUp", "EditorIcons")); - find_next->set_icon(get_icon("MoveDown", "EditorIcons")); - hide_button->set_normal_texture(get_icon("Close", "EditorIcons")); - hide_button->set_hover_texture(get_icon("Close", "EditorIcons")); - hide_button->set_pressed_texture(get_icon("Close", "EditorIcons")); + find_prev->set_icon(get_theme_icon("MoveUp", "EditorIcons")); + find_next->set_icon(get_theme_icon("MoveDown", "EditorIcons")); + hide_button->set_normal_texture(get_theme_icon("Close", "EditorIcons")); + hide_button->set_hover_texture(get_theme_icon("Close", "EditorIcons")); + hide_button->set_pressed_texture(get_theme_icon("Close", "EditorIcons")); hide_button->set_custom_minimum_size(hide_button->get_normal_texture()->get_size()); - matches_label->add_color_override("font_color", results_count > 0 ? get_color("font_color", "Label") : get_color("error_color", "Editor")); + matches_label->add_theme_color_override("font_color", results_count > 0 ? get_theme_color("font_color", "Label") : get_theme_color("error_color", "Editor")); } break; case NOTIFICATION_VISIBILITY_CHANGED: { @@ -1780,7 +1796,7 @@ void FindBar::_update_matches_label() { } else { matches_label->show(); - matches_label->add_color_override("font_color", results_count > 0 ? get_color("font_color", "Label") : get_color("error_color", "Editor")); + matches_label->add_theme_color_override("font_color", results_count > 0 ? get_theme_color("font_color", "Label") : get_theme_color("error_color", "Editor")); matches_label->set_text(vformat(results_count == 1 ? TTR("%d match.") : TTR("%d matches."), results_count)); } } @@ -1828,7 +1844,7 @@ void FindBar::_search_text_changed(const String &p_text) { void FindBar::_search_text_entered(const String &p_text) { - if (Input::get_singleton()->is_key_pressed(KEY_SHIFT)) { + if (InputFilter::get_singleton()->is_key_pressed(KEY_SHIFT)) { search_prev(); } else { search_next(); diff --git a/editor/editor_help.h b/editor/editor_help.h index a690e10e7e..2e053e674f 100644 --- a/editor/editor_help.h +++ b/editor/editor_help.h @@ -32,7 +32,7 @@ #define EDITOR_HELP_H #include "editor/code_editor.h" -#include "editor/doc/doc_data.h" +#include "editor/doc_data.h" #include "editor/editor_plugin.h" #include "scene/gui/margin_container.h" #include "scene/gui/menu_button.h" @@ -192,14 +192,16 @@ public: ~EditorHelp(); }; -class EditorHelpBit : public PanelContainer { +class EditorHelpBit : public MarginContainer { - GDCLASS(EditorHelpBit, PanelContainer); + GDCLASS(EditorHelpBit, MarginContainer); RichTextLabel *rich_text; void _go_to_help(String p_what); void _meta_clicked(String p_select); + String text; + protected: static void _bind_methods(); void _notification(int p_what); diff --git a/editor/editor_help_search.cpp b/editor/editor_help_search.cpp index f7ce2dd4fc..01a50cad2c 100644 --- a/editor/editor_help_search.cpp +++ b/editor/editor_help_search.cpp @@ -37,13 +37,13 @@ void EditorHelpSearch::_update_icons() { - search_box->set_right_icon(get_icon("Search", "EditorIcons")); + search_box->set_right_icon(results_tree->get_theme_icon("Search", "EditorIcons")); search_box->set_clear_button_enabled(true); - search_box->add_icon_override("right_icon", get_icon("Search", "EditorIcons")); - case_sensitive_button->set_icon(get_icon("MatchCase", "EditorIcons")); - hierarchy_button->set_icon(get_icon("ClassList", "EditorIcons")); + search_box->add_theme_icon_override("right_icon", results_tree->get_theme_icon("Search", "EditorIcons")); + case_sensitive_button->set_icon(results_tree->get_theme_icon("MatchCase", "EditorIcons")); + hierarchy_button->set_icon(results_tree->get_theme_icon("ClassList", "EditorIcons")); - if (is_visible_in_tree()) + if (is_visible()) _update_results(); } @@ -57,7 +57,7 @@ void EditorHelpSearch::_update_results() { if (hierarchy_button->is_pressed()) search_flags |= SEARCH_SHOW_HIERARCHY; - search = Ref<Runner>(memnew(Runner(this, results_tree, term, search_flags))); + search = Ref<Runner>(memnew(Runner(results_tree, results_tree, term, search_flags))); set_process(true); } @@ -105,6 +105,13 @@ void EditorHelpSearch::_confirmed() { void EditorHelpSearch::_notification(int p_what) { switch (p_what) { + case NOTIFICATION_VISIBILITY_CHANGED: { + if (!is_visible()) { + results_tree->call_deferred("clear"); // Wait for the Tree's mouse event propagation. + get_ok()->set_disabled(true); + EditorSettings::get_singleton()->set_project_metadata("dialog_bounds", "search_help", Rect2(get_position(), get_size())); + } + } break; case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: { _update_icons(); @@ -114,12 +121,7 @@ void EditorHelpSearch::_notification(int p_what) { connect("confirmed", callable_mp(this, &EditorHelpSearch::_confirmed)); _update_icons(); } break; - case NOTIFICATION_POPUP_HIDE: { - results_tree->call_deferred("clear"); // Wait for the Tree's mouse event propagation. - get_ok()->set_disabled(true); - EditorSettings::get_singleton()->set_project_metadata("dialog_bounds", "search_help", get_rect()); - } break; case NOTIFICATION_PROCESS: { // Update background search. @@ -184,7 +186,7 @@ EditorHelpSearch::EditorHelpSearch() { old_search = false; set_hide_on_ok(false); - set_resizable(true); + set_title(TTR("Search Help")); get_ok()->set_disabled(true); @@ -200,7 +202,7 @@ EditorHelpSearch::EditorHelpSearch() { search_box = memnew(LineEdit); search_box->set_custom_minimum_size(Size2(200, 0) * EDSCALE); - search_box->set_h_size_flags(SIZE_EXPAND_FILL); + search_box->set_h_size_flags(Control::SIZE_EXPAND_FILL); search_box->connect("gui_input", callable_mp(this, &EditorHelpSearch::_search_box_gui_input)); search_box->connect("text_changed", callable_mp(this, &EditorHelpSearch::_search_box_text_changed)); register_text_enter(search_box); @@ -210,7 +212,7 @@ EditorHelpSearch::EditorHelpSearch() { case_sensitive_button->set_tooltip(TTR("Case Sensitive")); case_sensitive_button->connect("pressed", callable_mp(this, &EditorHelpSearch::_update_results)); case_sensitive_button->set_toggle_mode(true); - case_sensitive_button->set_focus_mode(FOCUS_NONE); + case_sensitive_button->set_focus_mode(Control::FOCUS_NONE); hbox->add_child(case_sensitive_button); hierarchy_button = memnew(ToolButton); @@ -218,7 +220,7 @@ EditorHelpSearch::EditorHelpSearch() { hierarchy_button->connect("pressed", callable_mp(this, &EditorHelpSearch::_update_results)); hierarchy_button->set_toggle_mode(true); hierarchy_button->set_pressed(true); - hierarchy_button->set_focus_mode(FOCUS_NONE); + hierarchy_button->set_focus_mode(Control::FOCUS_NONE); hbox->add_child(hierarchy_button); filter_combo = memnew(OptionButton); @@ -237,7 +239,7 @@ EditorHelpSearch::EditorHelpSearch() { // Create the results tree. results_tree = memnew(Tree); - results_tree->set_v_size_flags(SIZE_EXPAND_FILL); + results_tree->set_v_size_flags(Control::SIZE_EXPAND_FILL); results_tree->set_columns(2); results_tree->set_column_title(0, TTR("Name")); results_tree->set_column_title(1, TTR("Member Type")); @@ -315,7 +317,7 @@ bool EditorHelpSearch::Runner::_phase_match_classes_init() { iterator_doc = EditorHelp::get_doc_data()->class_list.front(); matches.clear(); - matched_item = NULL; + matched_item = nullptr; return true; } @@ -479,10 +481,10 @@ TreeItem *EditorHelpSearch::Runner::_create_class_hierarchy(const ClassMatch &p_ TreeItem *EditorHelpSearch::Runner::_create_class_item(TreeItem *p_parent, const DocData::ClassDoc *p_doc, bool p_gray) { Ref<Texture2D> icon = empty_icon; - if (ui_service->has_icon(p_doc->name, "EditorIcons")) - icon = ui_service->get_icon(p_doc->name, "EditorIcons"); + if (ui_service->has_theme_icon(p_doc->name, "EditorIcons")) + icon = ui_service->get_theme_icon(p_doc->name, "EditorIcons"); else if (ClassDB::class_exists(p_doc->name) && ClassDB::is_parent_class(p_doc->name, "Object")) - icon = ui_service->get_icon("Object", "EditorIcons"); + icon = ui_service->get_theme_icon("Object", "EditorIcons"); String tooltip = p_doc->brief_description.strip_edges(); TreeItem *item = results_tree->create_item(p_parent); @@ -557,10 +559,10 @@ TreeItem *EditorHelpSearch::Runner::_create_member_item(TreeItem *p_parent, cons Ref<Texture2D> icon; String text; if (search_flags & SEARCH_SHOW_HIERARCHY) { - icon = ui_service->get_icon(p_icon, "EditorIcons"); + icon = ui_service->get_theme_icon(p_icon, "EditorIcons"); text = p_name; } else { - icon = ui_service->get_icon(p_icon, "EditorIcons"); + icon = ui_service->get_theme_icon(p_icon, "EditorIcons"); /*// In flat mode, show the class icon. if (ui_service->has_icon(p_class_name, "EditorIcons")) icon = ui_service->get_icon(p_class_name, "EditorIcons"); @@ -598,6 +600,6 @@ EditorHelpSearch::Runner::Runner(Control *p_icon_service, Tree *p_results_tree, results_tree(p_results_tree), term((p_search_flags & SEARCH_CASE_SENSITIVE) == 0 ? p_term.strip_edges().to_lower() : p_term.strip_edges()), search_flags(p_search_flags), - empty_icon(ui_service->get_icon("ArrowRight", "EditorIcons")), - disabled_color(ui_service->get_color("disabled_font_color", "Editor")) { + empty_icon(ui_service->get_theme_icon("ArrowRight", "EditorIcons")), + disabled_color(ui_service->get_theme_color("disabled_font_color", "Editor")) { } diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp index be3ee397e8..8fcd5bacb6 100644 --- a/editor/editor_inspector.cpp +++ b/editor/editor_inspector.cpp @@ -41,7 +41,7 @@ Size2 EditorProperty::get_minimum_size() const { Size2 ms; - Ref<Font> font = get_font("font", "Tree"); + Ref<Font> font = get_theme_font("font", "Tree"); ms.height = font->get_height(); for (int i = 0; i < get_child_count(); i++) { @@ -62,17 +62,22 @@ Size2 EditorProperty::get_minimum_size() const { } if (keying) { - Ref<Texture2D> key = get_icon("Key", "EditorIcons"); - ms.width += key->get_width() + get_constant("hseparator", "Tree"); + Ref<Texture2D> key = get_theme_icon("Key", "EditorIcons"); + ms.width += key->get_width() + get_theme_constant("hseparator", "Tree"); + } + + if (deletable) { + Ref<Texture2D> key = get_theme_icon("Close", "EditorIcons"); + ms.width += key->get_width() + get_theme_constant("hseparator", "Tree"); } if (checkable) { - Ref<Texture2D> check = get_icon("checked", "CheckBox"); - ms.width += check->get_width() + get_constant("hseparation", "CheckBox") + get_constant("hseparator", "Tree"); + Ref<Texture2D> check = get_theme_icon("checked", "CheckBox"); + ms.width += check->get_width() + get_theme_constant("hseparation", "CheckBox") + get_theme_constant("hseparator", "Tree"); } - if (bottom_editor != NULL && bottom_editor->is_visible()) { - ms.height += get_constant("vseparation", "Tree"); + if (bottom_editor != nullptr && bottom_editor->is_visible()) { + ms.height += get_theme_constant("vseparation", "Tree"); Size2 bems = bottom_editor->get_combined_minimum_size(); //bems.width += get_constant("item_margin", "Tree"); ms.height += bems.height; @@ -103,7 +108,7 @@ void EditorProperty::_notification(int p_what) { { int child_room = size.width * (1.0 - split_ratio); - Ref<Font> font = get_font("font", "Tree"); + Ref<Font> font = get_theme_font("font", "Tree"); int height = font->get_height(); bool no_children = true; @@ -136,24 +141,36 @@ void EditorProperty::_notification(int p_what) { int m = 0; //get_constant("item_margin", "Tree"); - bottom_rect = Rect2(m, rect.size.height + get_constant("vseparation", "Tree"), size.width - m, bottom_editor->get_combined_minimum_size().height); + bottom_rect = Rect2(m, rect.size.height + get_theme_constant("vseparation", "Tree"), size.width - m, bottom_editor->get_combined_minimum_size().height); } if (keying) { Ref<Texture2D> key; if (use_keying_next()) { - key = get_icon("KeyNext", "EditorIcons"); + key = get_theme_icon("KeyNext", "EditorIcons"); } else { - key = get_icon("Key", "EditorIcons"); + key = get_theme_icon("Key", "EditorIcons"); } - rect.size.x -= key->get_width() + get_constant("hseparator", "Tree"); + rect.size.x -= key->get_width() + get_theme_constant("hseparator", "Tree"); if (no_children) { text_size -= key->get_width() + 4 * EDSCALE; } } + + if (deletable) { + Ref<Texture2D> close; + + close = get_theme_icon("Close", "EditorIcons"); + + rect.size.x -= close->get_width() + get_theme_constant("hseparator", "Tree"); + + if (no_children) { + text_size -= close->get_width() + 4 * EDSCALE; + } + } } //set children @@ -180,8 +197,8 @@ void EditorProperty::_notification(int p_what) { } if (p_what == NOTIFICATION_DRAW) { - Ref<Font> font = get_font("font", "Tree"); - Color dark_color = get_color("dark_color_2", "Editor"); + Ref<Font> font = get_theme_font("font", "Tree"); + Color dark_color = get_theme_color("dark_color_2", "Editor"); Size2 size = get_size(); if (bottom_editor) { @@ -191,7 +208,7 @@ void EditorProperty::_notification(int p_what) { } if (selected) { - Ref<StyleBox> sb = get_stylebox("selected", "Tree"); + Ref<StyleBox> sb = get_theme_stylebox("selected", "Tree"); draw_style_box(sb, Rect2(Vector2(), size)); } @@ -204,9 +221,9 @@ void EditorProperty::_notification(int p_what) { Color color; if (draw_red) { - color = get_color("error_color", "Editor"); + color = get_theme_color("error_color", "Editor"); } else { - color = get_color("property_color", "Editor"); + color = get_theme_color("property_color", "Editor"); } if (label.find(".") != -1) { color.a = 0.5; //this should be un-hacked honestly, as it's used for editor overrides @@ -218,9 +235,9 @@ void EditorProperty::_notification(int p_what) { if (checkable) { Ref<Texture2D> checkbox; if (checked) - checkbox = get_icon("GuiChecked", "EditorIcons"); + checkbox = get_theme_icon("GuiChecked", "EditorIcons"); else - checkbox = get_icon("GuiUnchecked", "EditorIcons"); + checkbox = get_theme_icon("GuiUnchecked", "EditorIcons"); Color color2(1, 1, 1); if (check_hover) { @@ -230,16 +247,16 @@ void EditorProperty::_notification(int p_what) { } check_rect = Rect2(ofs, ((size.height - checkbox->get_height()) / 2), checkbox->get_width(), checkbox->get_height()); draw_texture(checkbox, check_rect.position, color2); - ofs += get_constant("hseparator", "Tree") + checkbox->get_width() + get_constant("hseparation", "CheckBox"); + ofs += get_theme_constant("hseparator", "Tree") + checkbox->get_width() + get_theme_constant("hseparation", "CheckBox"); text_limit -= ofs; } else { check_rect = Rect2(); } if (can_revert) { - Ref<Texture2D> reload_icon = get_icon("ReloadSmall", "EditorIcons"); - text_limit -= reload_icon->get_width() + get_constant("hseparator", "Tree") * 2; - revert_rect = Rect2(text_limit + get_constant("hseparator", "Tree"), (size.height - reload_icon->get_height()) / 2, reload_icon->get_width(), reload_icon->get_height()); + Ref<Texture2D> reload_icon = get_theme_icon("ReloadSmall", "EditorIcons"); + text_limit -= reload_icon->get_width() + get_theme_constant("hseparator", "Tree") * 2; + revert_rect = Rect2(text_limit + get_theme_constant("hseparator", "Tree"), (size.height - reload_icon->get_height()) / 2, reload_icon->get_width(), reload_icon->get_height()); Color color2(1, 1, 1); if (revert_hover) { @@ -260,12 +277,12 @@ void EditorProperty::_notification(int p_what) { Ref<Texture2D> key; if (use_keying_next()) { - key = get_icon("KeyNext", "EditorIcons"); + key = get_theme_icon("KeyNext", "EditorIcons"); } else { - key = get_icon("Key", "EditorIcons"); + key = get_theme_icon("Key", "EditorIcons"); } - ofs = size.width - key->get_width() - get_constant("hseparator", "Tree"); + ofs = size.width - key->get_width() - get_theme_constant("hseparator", "Tree"); Color color2(1, 1, 1); if (keying_hover) { @@ -278,6 +295,25 @@ void EditorProperty::_notification(int p_what) { } else { keying_rect = Rect2(); } + + if (deletable) { + Ref<Texture2D> close; + + close = get_theme_icon("Close", "EditorIcons"); + + ofs = size.width - close->get_width() - get_theme_constant("hseparator", "Tree"); + + Color color2(1, 1, 1); + if (delete_hover) { + color2.r *= 1.2; + color2.g *= 1.2; + color2.b *= 1.2; + } + delete_rect = Rect2(ofs, ((size.height - close->get_height()) / 2), close->get_width(), close->get_height()); + draw_texture(close, delete_rect.position, color2); + } else { + delete_rect = Rect2(); + } } } @@ -547,6 +583,16 @@ void EditorProperty::set_keying(bool p_keying) { queue_sort(); } +void EditorProperty::set_deletable(bool p_deletable) { + deletable = p_deletable; + update(); + queue_sort(); +} + +bool EditorProperty::is_deletable() const { + return deletable; +} + bool EditorProperty::is_keying() const { return keying; } @@ -619,6 +665,12 @@ void EditorProperty::_gui_input(const Ref<InputEvent> &p_event) { update(); } + bool new_delete_hover = delete_rect.has_point(me->get_position()) && !button_left; + if (new_delete_hover != delete_hover) { + delete_hover = new_delete_hover; + update(); + } + bool new_revert_hover = revert_rect.has_point(me->get_position()) && !button_left; if (new_revert_hover != revert_hover) { revert_hover = new_revert_hover; @@ -646,7 +698,7 @@ void EditorProperty::_gui_input(const Ref<InputEvent> &p_event) { emit_signal("property_keyed", property, use_keying_next()); if (use_keying_next()) { - if (property == "frame_coords" && (object->is_class("Sprite") || object->is_class("Sprite3D"))) { + if (property == "frame_coords" && (object->is_class("Sprite2D") || object->is_class("Sprite3D"))) { Vector2 new_coords = object->get(property); new_coords.x++; if (new_coords.x >= object->get("hframes").operator int64_t()) { @@ -662,6 +714,9 @@ void EditorProperty::_gui_input(const Ref<InputEvent> &p_event) { call_deferred("update_property"); } } + if (delete_rect.has_point(mb->get_position())) { + emit_signal("property_deleted", property); + } if (revert_rect.has_point(mb->get_position())) { @@ -776,13 +831,14 @@ Control *EditorProperty::make_custom_tooltip(const String &p_text) const { tooltip_text = p_text; EditorHelpBit *help_bit = memnew(EditorHelpBit); - help_bit->add_style_override("panel", get_stylebox("panel", "TooltipPanel")); + //help_bit->add_theme_style_override("panel", get_theme_stylebox("panel", "TooltipPanel")); help_bit->get_rich_text()->set_fixed_size_to_width(360 * EDSCALE); + String text; PackedStringArray slices = p_text.split("::", false); if (!slices.empty()) { String property_name = slices[0].strip_edges(); - String text = TTR("Property:") + " [u][b]" + property_name + "[/b][/u]"; + text = TTR("Property:") + " [u][b]" + property_name + "[/b][/u]"; if (slices.size() > 1) { String property_doc = slices[1].strip_edges(); @@ -790,7 +846,7 @@ Control *EditorProperty::make_custom_tooltip(const String &p_text) const { text += "\n" + property_doc; } } - help_bit->call_deferred("set_text", text); //hack so it uses proper theme once inside scene + help_bit->set_text(text); } return help_bit; @@ -820,6 +876,9 @@ void EditorProperty::_bind_methods() { ClassDB::bind_method(D_METHOD("set_keying", "keying"), &EditorProperty::set_keying); ClassDB::bind_method(D_METHOD("is_keying"), &EditorProperty::is_keying); + ClassDB::bind_method(D_METHOD("set_deletable", "deletable"), &EditorProperty::set_deletable); + ClassDB::bind_method(D_METHOD("is_deletable"), &EditorProperty::is_deletable); + ClassDB::bind_method(D_METHOD("get_edited_property"), &EditorProperty::get_edited_property); ClassDB::bind_method(D_METHOD("get_edited_object"), &EditorProperty::get_edited_object); @@ -838,9 +897,11 @@ void EditorProperty::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::BOOL, "checked"), "set_checked", "is_checked"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "draw_red"), "set_draw_red", "is_draw_red"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "keying"), "set_keying", "is_keying"); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "deletable"), "set_deletable", "is_deletable"); ADD_SIGNAL(MethodInfo("property_changed", PropertyInfo(Variant::STRING_NAME, "property"), PropertyInfo(Variant::NIL, "value", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NIL_IS_VARIANT))); ADD_SIGNAL(MethodInfo("multiple_properties_changed", PropertyInfo(Variant::PACKED_STRING_ARRAY, "properties"), PropertyInfo(Variant::ARRAY, "value"))); ADD_SIGNAL(MethodInfo("property_keyed", PropertyInfo(Variant::STRING_NAME, "property"))); + ADD_SIGNAL(MethodInfo("property_deleted", PropertyInfo(Variant::STRING_NAME, "property"))); ADD_SIGNAL(MethodInfo("property_keyed_with_value", PropertyInfo(Variant::STRING_NAME, "property"), PropertyInfo(Variant::NIL, "value", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NIL_IS_VARIANT))); ADD_SIGNAL(MethodInfo("property_checked", PropertyInfo(Variant::STRING_NAME, "property"), PropertyInfo(Variant::STRING, "bool"))); ADD_SIGNAL(MethodInfo("resource_selected", PropertyInfo(Variant::STRING, "path"), PropertyInfo(Variant::OBJECT, "resource", PROPERTY_HINT_RESOURCE_TYPE, "Resource"))); @@ -855,7 +916,7 @@ void EditorProperty::_bind_methods() { EditorProperty::EditorProperty() { draw_top_bg = true; - object = NULL; + object = nullptr; split_ratio = 0.5; selectable = true; text_size = 0; @@ -864,6 +925,7 @@ EditorProperty::EditorProperty() { checked = false; draw_red = false; keying = false; + deletable = false; keying_hover = false; revert_hover = false; check_hover = false; @@ -872,8 +934,8 @@ EditorProperty::EditorProperty() { property_usage = 0; selected = false; selected_focusable = -1; - label_reference = NULL; - bottom_editor = NULL; + label_reference = nullptr; + bottom_editor = nullptr; } //////////////////////////////////////////////// //////////////////////////////////////////////// @@ -887,7 +949,7 @@ void EditorInspectorPlugin::add_custom_control(Control *control) { void EditorInspectorPlugin::add_property_editor(const String &p_for_property, Control *p_prop) { - ERR_FAIL_COND(Object::cast_to<EditorProperty>(p_prop) == NULL); + ERR_FAIL_COND(Object::cast_to<EditorProperty>(p_prop) == nullptr); AddedEditor ae; ae.properties.push_back(p_for_property); @@ -925,7 +987,7 @@ void EditorInspectorPlugin::parse_category(Object *p_object, const String &p_par } } -bool EditorInspectorPlugin::parse_property(Object *p_object, Variant::Type p_type, const String &p_path, PropertyHint p_hint, const String &p_hint_text, int p_usage) { +bool EditorInspectorPlugin::parse_property(Object *p_object, Variant::Type p_type, const String &p_path, PropertyHint p_hint, const String &p_hint_text, int p_usage, bool p_wide) { if (get_script_instance()) { Variant arg[6] = { @@ -987,9 +1049,9 @@ void EditorInspectorCategory::_notification(int p_what) { if (p_what == NOTIFICATION_DRAW) { draw_rect(Rect2(Vector2(), get_size()), bg_color); - Ref<Font> font = get_font("font", "Tree"); + Ref<Font> font = get_theme_font("font", "Tree"); - int hs = get_constant("hseparation", "Tree"); + int hs = get_theme_constant("hseparation", "Tree"); int w = font->get_string_size(label).width; if (icon.is_valid()) { @@ -1003,7 +1065,7 @@ void EditorInspectorCategory::_notification(int p_what) { ofs += hs + icon->get_width(); } - Color color = get_color("font_color", "Tree"); + Color color = get_theme_color("font_color", "Tree"); draw_string(font, Point2(ofs, font->get_ascent() + (get_size().height - font->get_height()) / 2).floor(), label, color, get_size().width); } } @@ -1012,7 +1074,7 @@ Control *EditorInspectorCategory::make_custom_tooltip(const String &p_text) cons tooltip_text = p_text; EditorHelpBit *help_bit = memnew(EditorHelpBit); - help_bit->add_style_override("panel", get_stylebox("panel", "TooltipPanel")); + help_bit->add_theme_style_override("panel", get_theme_stylebox("panel", "TooltipPanel")); help_bit->get_rich_text()->set_fixed_size_to_width(360 * EDSCALE); PackedStringArray slices = p_text.split("::", false); @@ -1026,7 +1088,7 @@ Control *EditorInspectorCategory::make_custom_tooltip(const String &p_text) cons text += "\n" + property_doc; } } - help_bit->call_deferred("set_text", text); //hack so it uses proper theme once inside scene + help_bit->set_text(text); //hack so it uses proper theme once inside scene } return help_bit; @@ -1034,7 +1096,7 @@ Control *EditorInspectorCategory::make_custom_tooltip(const String &p_text) cons Size2 EditorInspectorCategory::get_minimum_size() const { - Ref<Font> font = get_font("font", "Tree"); + Ref<Font> font = get_theme_font("font", "Tree"); Size2 ms; ms.width = 1; @@ -1042,7 +1104,7 @@ Size2 EditorInspectorCategory::get_minimum_size() const { if (icon.is_valid()) { ms.height = MAX(icon->get_height(), ms.height); } - ms.height += get_constant("vseparation", "Tree"); + ms.height += get_theme_constant("vseparation", "Tree"); return ms; } @@ -1074,14 +1136,14 @@ void EditorInspectorSection::_notification(int p_what) { if (p_what == NOTIFICATION_SORT_CHILDREN) { - Ref<Font> font = get_font("font", "Tree"); + Ref<Font> font = get_theme_font("font", "Tree"); Ref<Texture2D> arrow; if (foldable) { if (object->editor_is_section_unfolded(section)) { - arrow = get_icon("arrow", "Tree"); + arrow = get_theme_icon("arrow", "Tree"); } else { - arrow = get_icon("arrow_collapsed", "Tree"); + arrow = get_theme_icon("arrow_collapsed", "Tree"); } } @@ -1092,8 +1154,8 @@ void EditorInspectorSection::_notification(int p_what) { offset.y = MAX(offset.y, arrow->get_height()); } - offset.y += get_constant("vseparation", "Tree"); - offset.x += get_constant("inspector_margin", "Editor"); + offset.y += get_theme_constant("vseparation", "Tree"); + offset.x += get_theme_constant("inspector_margin", "Editor"); Rect2 rect(offset, size - offset); @@ -1120,24 +1182,24 @@ void EditorInspectorSection::_notification(int p_what) { if (foldable) { if (object->editor_is_section_unfolded(section)) { - arrow = get_icon("arrow", "Tree"); + arrow = get_theme_icon("arrow", "Tree"); } else { - arrow = get_icon("arrow_collapsed", "Tree"); + arrow = get_theme_icon("arrow_collapsed", "Tree"); } } - Ref<Font> font = get_font("font", "Tree"); + Ref<Font> font = get_theme_font("font", "Tree"); int h = font->get_height(); if (arrow.is_valid()) { h = MAX(h, arrow->get_height()); } - h += get_constant("vseparation", "Tree"); + h += get_theme_constant("vseparation", "Tree"); draw_rect(Rect2(Vector2(), Vector2(get_size().width, h)), bg_color); const int arrow_margin = 3; - Color color = get_color("font_color", "Tree"); + Color color = get_theme_color("font_color", "Tree"); draw_string(font, Point2(Math::round((16 + arrow_margin) * EDSCALE), font->get_ascent() + (h - font->get_height()) / 2).floor(), label, color, get_size().width); if (arrow.is_valid()) { @@ -1163,9 +1225,9 @@ Size2 EditorInspectorSection::get_minimum_size() const { ms.height = MAX(ms.height, minsize.height); } - Ref<Font> font = get_font("font", "Tree"); - ms.height += font->get_height() + get_constant("vseparation", "Tree"); - ms.width += get_constant("inspector_margin", "Editor"); + Ref<Font> font = get_theme_font("font", "Tree"); + ms.height += font->get_height() + get_theme_constant("vseparation", "Tree"); + ms.width += get_theme_constant("inspector_margin", "Editor"); return ms; } @@ -1201,7 +1263,7 @@ void EditorInspectorSection::_gui_input(const Ref<InputEvent> &p_event) { Ref<InputEventMouseButton> mb = p_event; if (mb.is_valid() && mb->is_pressed() && mb->get_button_index() == BUTTON_LEFT) { - Ref<Font> font = get_font("font", "Tree"); + Ref<Font> font = get_theme_font("font", "Tree"); if (mb->get_position().y > font->get_height()) { //clicked outside return; } @@ -1256,7 +1318,7 @@ void EditorInspectorSection::_bind_methods() { } EditorInspectorSection::EditorInspectorSection() { - object = NULL; + object = nullptr; foldable = false; vbox = memnew(VBoxContainer); vbox_added = false; @@ -1275,11 +1337,11 @@ EditorInspectorSection::~EditorInspectorSection() { Ref<EditorInspectorPlugin> EditorInspector::inspector_plugins[MAX_PLUGINS]; int EditorInspector::inspector_plugin_count = 0; -EditorProperty *EditorInspector::instantiate_property_editor(Object *p_object, Variant::Type p_type, const String &p_path, PropertyHint p_hint, const String &p_hint_text, int p_usage) { +EditorProperty *EditorInspector::instantiate_property_editor(Object *p_object, Variant::Type p_type, const String &p_path, PropertyHint p_hint, const String &p_hint_text, int p_usage, bool p_wide) { for (int i = inspector_plugin_count - 1; i >= 0; i--) { - inspector_plugins[i]->parse_property(p_object, p_type, p_path, p_hint, p_hint_text, p_usage); + inspector_plugins[i]->parse_property(p_object, p_type, p_path, p_hint, p_hint_text, p_usage, p_wide); if (inspector_plugins[i]->added_editors.size()) { for (int j = 1; j < inspector_plugins[i]->added_editors.size(); j++) { //only keep first one memdelete(inspector_plugins[i]->added_editors[j].property_editor); @@ -1296,7 +1358,7 @@ EditorProperty *EditorInspector::instantiate_property_editor(Object *p_object, V } } } - return NULL; + return nullptr; } void EditorInspector::add_inspector_plugin(const Ref<EditorInspectorPlugin> &p_plugin) { @@ -1361,6 +1423,7 @@ void EditorInspector::_parse_added_editors(VBoxContainer *current_vbox, Ref<Edit ep->object = object; ep->connect("property_changed", callable_mp(this, &EditorInspector::_property_changed)); ep->connect("property_keyed", callable_mp(this, &EditorInspector::_property_keyed)); + ep->connect("property_deleted", callable_mp(this, &EditorInspector::_property_deleted), varray(), CONNECT_DEFERRED); ep->connect("property_keyed_with_value", callable_mp(this, &EditorInspector::_property_keyed_with_value)); ep->connect("property_checked", callable_mp(this, &EditorInspector::_property_checked)); ep->connect("selected", callable_mp(this, &EditorInspector::_property_selected)); @@ -1393,6 +1456,7 @@ void EditorInspector::_parse_added_editors(VBoxContainer *current_vbox, Ref<Edit ep->set_read_only(read_only); ep->update_property(); ep->update_reload_status(); + ep->set_deletable(deletable_properties); } } ped->added_editors.clear(); @@ -1472,12 +1536,14 @@ void EditorInspector::update_tree() { } } - // TreeItem *current_category = NULL; + // TreeItem *current_category = nullptr; String filter = search_box ? search_box->get_text() : ""; String group; String group_base; - VBoxContainer *category_vbox = NULL; + String subgroup; + String subgroup_base; + VBoxContainer *category_vbox = nullptr; List<PropertyInfo> plist; @@ -1488,7 +1554,7 @@ void EditorInspector::update_tree() { item_path[""] = main_vbox; - Color sscolor = get_color("prop_subsection", "Editor"); + Color sscolor = get_theme_color("prop_subsection", "Editor"); for (List<Ref<EditorInspectorPlugin>>::Element *E = valid_plugins.front(); E; E = E->next()) { Ref<EditorInspectorPlugin> ped = E->get(); @@ -1502,10 +1568,19 @@ void EditorInspector::update_tree() { //make sure the property can be edited - if (p.usage & PROPERTY_USAGE_GROUP) { + if (p.usage & PROPERTY_USAGE_SUBGROUP) { + + subgroup = p.name; + subgroup_base = p.hint_string; + + continue; + + } else if (p.usage & PROPERTY_USAGE_GROUP) { group = p.name; group_base = p.hint_string; + subgroup = ""; + subgroup_base = ""; continue; @@ -1513,6 +1588,8 @@ void EditorInspector::update_tree() { group = ""; group_base = ""; + subgroup = ""; + subgroup_base = ""; if (!show_categories) continue; @@ -1534,13 +1611,13 @@ void EditorInspector::update_tree() { EditorInspectorCategory *category = memnew(EditorInspectorCategory); main_vbox->add_child(category); - category_vbox = NULL; //reset + category_vbox = nullptr; //reset String type = p.name; category->icon = EditorNode::get_singleton()->get_class_icon(type, "Object"); category->label = type; - category->bg_color = get_color("prop_category", "Editor"); + category->bg_color = get_theme_color("prop_category", "Editor"); if (use_doc_hints) { StringName type2 = p.name; if (!class_descr_cache.has(type2)) { @@ -1568,7 +1645,7 @@ void EditorInspector::update_tree() { } else if (!(p.usage & PROPERTY_USAGE_EDITOR) || _is_property_disabled_by_feature_profile(p.name)) continue; - if (p.usage & PROPERTY_USAGE_HIGH_END_GFX && VS::get_singleton()->is_low_end()) + if (p.usage & PROPERTY_USAGE_HIGH_END_GFX && RS::get_singleton()->is_low_end()) continue; //do not show this property in low end gfx if (p.name == "script" && (hide_script || bool(object->call("_hide_script_from_inspector")))) { @@ -1576,18 +1653,33 @@ void EditorInspector::update_tree() { } String basename = p.name; + + if (subgroup != "") { + if (subgroup_base != "") { + if (basename.begins_with(subgroup_base)) { + basename = basename.replace_first(subgroup_base, ""); + } else if (subgroup_base.begins_with(basename)) { + //keep it, this is used pretty often + } else { + subgroup = ""; //no longer using subgroup base, clear + } + } + } if (group != "") { - if (group_base != "") { + if (group_base != "" && subgroup == "") { if (basename.begins_with(group_base)) { basename = basename.replace_first(group_base, ""); } else if (group_base.begins_with(basename)) { //keep it, this is used pretty often } else { group = ""; //no longer using group base, clear + subgroup = ""; } } } - + if (subgroup != "") { + basename = subgroup + "/" + basename; + } if (group != "") { basename = group + "/" + basename; } @@ -1620,7 +1712,7 @@ void EditorInspector::update_tree() { continue; } - if (category_vbox == NULL) { + if (category_vbox == nullptr) { category_vbox = memnew(VBoxContainer); main_vbox->add_child(category_vbox); } @@ -1658,7 +1750,7 @@ void EditorInspector::update_tree() { if (current_vbox == main_vbox) { //do not add directly to the main vbox, given it has no spacing - if (category_vbox == NULL) { + if (category_vbox == nullptr) { category_vbox = memnew(VBoxContainer); } current_vbox = category_vbox; @@ -1733,7 +1825,7 @@ void EditorInspector::update_tree() { for (List<Ref<EditorInspectorPlugin>>::Element *E = valid_plugins.front(); E; E = E->next()) { Ref<EditorInspectorPlugin> ped = E->get(); - bool exclusive = ped->parse_property(object, p.type, p.name, p.hint, p.hint_string, p.usage); + bool exclusive = ped->parse_property(object, p.type, p.name, p.hint, p.hint_string, p.usage, wide_editors); List<EditorInspectorPlugin::AddedEditor> editors = ped->added_editors; //make a copy, since plugins may be used again in a sub-inspector ped->added_editors.clear(); @@ -1777,6 +1869,7 @@ void EditorInspector::update_tree() { ep->set_keying(keying); ep->set_read_only(read_only); + ep->set_deletable(deletable_properties); } current_vbox->add_child(F->get().property_editor); @@ -1788,6 +1881,7 @@ void EditorInspector::update_tree() { ep->connect("property_changed", callable_mp(this, &EditorInspector::_property_changed_update_all), varray(), CONNECT_DEFERRED); } ep->connect("property_keyed", callable_mp(this, &EditorInspector::_property_keyed)); + ep->connect("property_deleted", callable_mp(this, &EditorInspector::_property_deleted), varray(), CONNECT_DEFERRED); ep->connect("property_keyed_with_value", callable_mp(this, &EditorInspector::_property_keyed_with_value)); ep->connect("property_checked", callable_mp(this, &EditorInspector::_property_checked)); ep->connect("selected", callable_mp(this, &EditorInspector::_property_selected)); @@ -1971,6 +2065,10 @@ int EditorInspector::get_scroll_offset() const { return get_v_scroll(); } +void EditorInspector::set_use_wide_editors(bool p_enable) { + wide_editors = p_enable; +} + void EditorInspector::set_sub_inspector(bool p_enable) { sub_inspector = p_enable; @@ -1978,12 +2076,16 @@ void EditorInspector::set_sub_inspector(bool p_enable) { return; if (sub_inspector) { - add_style_override("bg", get_stylebox("sub_inspector_bg", "Editor")); + add_theme_style_override("bg", get_theme_stylebox("sub_inspector_bg", "Editor")); } else { - add_style_override("bg", get_stylebox("bg", "Tree")); + add_theme_style_override("bg", get_theme_stylebox("bg", "Tree")); } } +void EditorInspector::set_use_deletable_properties(bool p_enabled) { + deletable_properties = p_enabled; +} + void EditorInspector::_edit_request_change(Object *p_object, const String &p_property) { if (object != p_object) //may be undoing/redoing for a non edited object, so ignore @@ -2116,6 +2218,15 @@ void EditorInspector::_property_keyed(const String &p_path, bool p_advance) { emit_signal("property_keyed", p_path, object->get(p_path), p_advance); //second param is deprecated } +void EditorInspector::_property_deleted(const String &p_path) { + + print_line("deleted pressed?"); + if (!object) + return; + + emit_signal("property_deleted", p_path); //second param is deprecated +} + void EditorInspector::_property_keyed_with_value(const String &p_path, const Variant &p_value, bool p_advance) { if (!object) @@ -2142,7 +2253,7 @@ void EditorInspector::_property_checked(const String &p_path, bool p_checked) { for (List<PropertyInfo>::Element *E = pinfo.front(); E; E = E->next()) { if (E->get().name == p_path) { Callable::CallError ce; - to_create = Variant::construct(E->get().type, NULL, 0, ce); + to_create = Variant::construct(E->get().type, nullptr, 0, ce); break; } } @@ -2190,7 +2301,7 @@ void EditorInspector::_resource_selected(const String &p_path, RES p_resource) { void EditorInspector::_node_removed(Node *p_node) { if (p_node == object) { - edit(NULL); + edit(nullptr); } } @@ -2203,21 +2314,21 @@ void EditorInspector::_notification(int p_what) { if (p_what == NOTIFICATION_ENTER_TREE) { if (sub_inspector) { - add_style_override("bg", get_stylebox("sub_inspector_bg", "Editor")); + add_theme_style_override("bg", get_theme_stylebox("sub_inspector_bg", "Editor")); } else { - add_style_override("bg", get_stylebox("bg", "Tree")); + add_theme_style_override("bg", get_theme_stylebox("bg", "Tree")); get_tree()->connect("node_removed", callable_mp(this, &EditorInspector::_node_removed)); } } if (p_what == NOTIFICATION_PREDELETE) { - edit(NULL); //just in case + edit(nullptr); //just in case } if (p_what == NOTIFICATION_EXIT_TREE) { if (!sub_inspector) { get_tree()->disconnect("node_removed", callable_mp(this, &EditorInspector::_node_removed)); } - edit(NULL); + edit(nullptr); } if (p_what == NOTIFICATION_PROCESS) { @@ -2266,9 +2377,9 @@ void EditorInspector::_notification(int p_what) { if (p_what == EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED) { if (sub_inspector) { - add_style_override("bg", get_stylebox("sub_inspector_bg", "Editor")); + add_theme_style_override("bg", get_theme_stylebox("sub_inspector_bg", "Editor")); } else if (is_inside_tree()) { - add_style_override("bg", get_stylebox("bg", "Tree")); + add_theme_style_override("bg", get_theme_stylebox("bg", "Tree")); } update_tree(); @@ -2319,6 +2430,7 @@ void EditorInspector::_bind_methods() { ADD_SIGNAL(MethodInfo("property_selected", PropertyInfo(Variant::STRING, "property"))); ADD_SIGNAL(MethodInfo("property_keyed", PropertyInfo(Variant::STRING, "property"))); + ADD_SIGNAL(MethodInfo("property_deleted", PropertyInfo(Variant::STRING, "property"))); ADD_SIGNAL(MethodInfo("resource_selected", PropertyInfo(Variant::OBJECT, "res"), PropertyInfo(Variant::STRING, "prop"))); ADD_SIGNAL(MethodInfo("object_id_selected", PropertyInfo(Variant::INT, "id"))); ADD_SIGNAL(MethodInfo("property_edited", PropertyInfo(Variant::STRING, "property"))); @@ -2327,15 +2439,16 @@ void EditorInspector::_bind_methods() { } EditorInspector::EditorInspector() { - object = NULL; - undo_redo = NULL; + object = nullptr; + undo_redo = nullptr; main_vbox = memnew(VBoxContainer); main_vbox->set_h_size_flags(SIZE_EXPAND_FILL); - main_vbox->add_constant_override("separation", 0); + main_vbox->add_theme_constant_override("separation", 0); add_child(main_vbox); set_enable_h_scroll(false); set_enable_v_scroll(true); + wide_editors = false; show_categories = false; hide_script = true; use_doc_hints = false; @@ -2348,12 +2461,13 @@ EditorInspector::EditorInspector() { update_tree_pending = false; refresh_countdown = 0; read_only = false; - search_box = NULL; + search_box = nullptr; keying = false; _prop_edited = "property_edited"; set_process(true); property_focusable = -1; sub_inspector = false; + deletable_properties = false; get_v_scrollbar()->connect("value_changed", callable_mp(this, &EditorInspector::_vscroll_changed)); update_scroll_request = -1; diff --git a/editor/editor_inspector.h b/editor/editor_inspector.h index b49a4424f6..c8c1ecc49a 100644 --- a/editor/editor_inspector.h +++ b/editor/editor_inspector.h @@ -64,6 +64,7 @@ private: bool checked; bool draw_red; bool keying; + bool deletable; Rect2 right_child_rect; Rect2 bottom_child_rect; @@ -74,6 +75,8 @@ private: bool revert_hover; Rect2 check_rect; bool check_hover; + Rect2 delete_rect; + bool delete_hover; bool can_revert; @@ -133,6 +136,8 @@ public: void set_keying(bool p_keying); bool is_keying() const; + void set_deletable(bool p_enable); + bool is_deletable() const; void add_focusable(Control *p_control); void select(int p_focusable = -1); void deselect(); @@ -190,7 +195,7 @@ public: virtual bool can_handle(Object *p_object); virtual void parse_begin(Object *p_object); virtual void parse_category(Object *p_object, const String &p_parse_category); - virtual bool parse_property(Object *p_object, Variant::Type p_type, const String &p_path, PropertyHint p_hint, const String &p_hint_text, int p_usage); + virtual bool parse_property(Object *p_object, Variant::Type p_type, const String &p_path, PropertyHint p_hint, const String &p_hint_text, int p_usage, bool p_wide = false); virtual void parse_end(); }; @@ -283,6 +288,8 @@ class EditorInspector : public ScrollContainer { bool read_only; bool keying; bool sub_inspector; + bool wide_editors; + bool deletable_properties; float refresh_countdown; bool update_tree_pending; @@ -307,6 +314,7 @@ class EditorInspector : public ScrollContainer { void _multiple_properties_changed(Vector<String> p_paths, Array p_values); void _property_keyed(const String &p_path, bool p_advance); void _property_keyed_with_value(const String &p_path, const Variant &p_value, bool p_advance); + void _property_deleted(const String &p_path); void _property_checked(const String &p_path, bool p_checked); @@ -337,7 +345,7 @@ public: static void remove_inspector_plugin(const Ref<EditorInspectorPlugin> &p_plugin); static void cleanup_plugins(); - static EditorProperty *instantiate_property_editor(Object *p_object, Variant::Type p_type, const String &p_path, PropertyHint p_hint, const String &p_hint_text, int p_usage); + static EditorProperty *instantiate_property_editor(Object *p_object, Variant::Type p_type, const String &p_path, PropertyHint p_hint, const String &p_hint_text, int p_usage, bool p_wide = false); void set_undo_redo(UndoRedo *p_undo_redo); @@ -380,8 +388,11 @@ public: void set_object_class(const String &p_class); String get_object_class() const; + void set_use_wide_editors(bool p_enable); void set_sub_inspector(bool p_enable); + void set_use_deletable_properties(bool p_enabled); + EditorInspector(); }; diff --git a/editor/editor_layouts_dialog.cpp b/editor/editor_layouts_dialog.cpp index 776fbd9314..dbd043c494 100644 --- a/editor/editor_layouts_dialog.cpp +++ b/editor/editor_layouts_dialog.cpp @@ -52,12 +52,12 @@ void EditorLayoutsDialog::_line_gui_input(const Ref<InputEvent> &p_event) { if (get_hide_on_ok()) hide(); ok_pressed(); - accept_event(); + set_input_as_handled(); } break; case KEY_ESCAPE: { hide(); - accept_event(); + set_input_as_handled(); } break; } } @@ -110,15 +110,15 @@ EditorLayoutsDialog::EditorLayoutsDialog() { makevb = memnew(VBoxContainer); add_child(makevb); - makevb->set_anchor_and_margin(MARGIN_LEFT, ANCHOR_BEGIN, 5); - makevb->set_anchor_and_margin(MARGIN_RIGHT, ANCHOR_END, -5); + makevb->set_anchor_and_margin(MARGIN_LEFT, Control::ANCHOR_BEGIN, 5); + makevb->set_anchor_and_margin(MARGIN_RIGHT, Control::ANCHOR_END, -5); layout_names = memnew(ItemList); makevb->add_child(layout_names); layout_names->set_visible(true); layout_names->set_margin(MARGIN_TOP, 5); - layout_names->set_anchor_and_margin(MARGIN_LEFT, ANCHOR_BEGIN, 5); - layout_names->set_anchor_and_margin(MARGIN_RIGHT, ANCHOR_END, -5); + layout_names->set_anchor_and_margin(MARGIN_LEFT, Control::ANCHOR_BEGIN, 5); + layout_names->set_anchor_and_margin(MARGIN_RIGHT, Control::ANCHOR_END, -5); layout_names->set_v_size_flags(Control::SIZE_EXPAND_FILL); layout_names->set_select_mode(ItemList::SELECT_MULTI); layout_names->set_allow_rmb_select(true); @@ -126,8 +126,8 @@ EditorLayoutsDialog::EditorLayoutsDialog() { name = memnew(LineEdit); makevb->add_child(name); name->set_margin(MARGIN_TOP, 5); - name->set_anchor_and_margin(MARGIN_LEFT, ANCHOR_BEGIN, 5); - name->set_anchor_and_margin(MARGIN_RIGHT, ANCHOR_END, -5); + name->set_anchor_and_margin(MARGIN_LEFT, Control::ANCHOR_BEGIN, 5); + name->set_anchor_and_margin(MARGIN_RIGHT, Control::ANCHOR_END, -5); name->connect("gui_input", callable_mp(this, &EditorLayoutsDialog::_line_gui_input)); name->connect("focus_entered", callable_mp(layout_names, &ItemList::unselect_all)); } diff --git a/editor/editor_log.cpp b/editor/editor_log.cpp index 0e50a5e95c..c89a7bcf23 100644 --- a/editor/editor_log.cpp +++ b/editor/editor_log.cpp @@ -62,12 +62,12 @@ void EditorLog::_notification(int p_what) { if (p_what == NOTIFICATION_ENTER_TREE) { //button->set_icon(get_icon("Console","EditorIcons")); - log->add_font_override("normal_font", get_font("output_source", "EditorFonts")); + log->add_theme_font_override("normal_font", get_theme_font("output_source", "EditorFonts")); } else if (p_what == NOTIFICATION_THEME_CHANGED) { - Ref<DynamicFont> df_output_code = get_font("output_source", "EditorFonts"); + Ref<DynamicFont> df_output_code = get_theme_font("output_source", "EditorFonts"); if (df_output_code.is_valid()) { - if (log != NULL) { - log->add_font_override("normal_font", get_font("output_source", "EditorFonts")); + if (log != nullptr) { + log->add_theme_font_override("normal_font", get_theme_font("output_source", "EditorFonts")); } } } @@ -101,22 +101,22 @@ void EditorLog::add_message(const String &p_msg, MessageType p_type) { case MSG_TYPE_STD: { } break; case MSG_TYPE_ERROR: { - log->push_color(get_color("error_color", "Editor")); - Ref<Texture2D> icon = get_icon("Error", "EditorIcons"); + log->push_color(get_theme_color("error_color", "Editor")); + Ref<Texture2D> icon = get_theme_icon("Error", "EditorIcons"); log->add_image(icon); log->add_text(" "); tool_button->set_icon(icon); } break; case MSG_TYPE_WARNING: { - log->push_color(get_color("warning_color", "Editor")); - Ref<Texture2D> icon = get_icon("Warning", "EditorIcons"); + log->push_color(get_theme_color("warning_color", "Editor")); + Ref<Texture2D> icon = get_theme_icon("Warning", "EditorIcons"); log->add_image(icon); log->add_text(" "); tool_button->set_icon(icon); } break; case MSG_TYPE_EDITOR: { // Distinguish editor messages from messages printed by the project - log->push_color(get_color("font_color", "Editor") * Color(1, 1, 1, 0.6)); + log->push_color(get_theme_color("font_color", "Editor") * Color(1, 1, 1, 0.6)); } break; } @@ -181,7 +181,7 @@ EditorLog::EditorLog() { current = Thread::get_caller_id(); - add_constant_override("separation", get_constant("separation", "VBoxContainer")); + add_theme_constant_override("separation", get_theme_constant("separation", "VBoxContainer")); EditorNode::get_undo_redo()->set_commit_notify_callback(_undo_redo_cbk, this); } diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 61480c3c20..3569cd411d 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -32,6 +32,7 @@ #include "core/bind/core_bind.h" #include "core/class_db.h" +#include "core/input/input_filter.h" #include "core/io/config_file.h" #include "core/io/image_loader.h" #include "core/io/resource_loader.h" @@ -39,7 +40,6 @@ #include "core/io/stream_peer_ssl.h" #include "core/message_queue.h" #include "core/os/file_access.h" -#include "core/os/input.h" #include "core/os/keyboard.h" #include "core/os/os.h" #include "core/path_remap.h" @@ -47,7 +47,6 @@ #include "core/project_settings.h" #include "core/translation.h" #include "core/version.h" -#include "main/input_default.h" #include "main/main.h" #include "scene/gui/center_container.h" #include "scene/gui/control.h" @@ -62,9 +61,10 @@ #include "scene/gui/texture_progress.h" #include "scene/gui/tool_button.h" #include "scene/resources/packed_scene.h" -#include "servers/navigation_2d_server.h" -#include "servers/navigation_server.h" -#include "servers/physics_2d_server.h" +#include "servers/navigation_server_2d.h" +#include "servers/navigation_server_3d.h" +#include "servers/physics_server_2d.h" +#include "servers/rendering/rendering_device.h" #include "editor/audio_stream_preview.h" #include "editor/debugger/editor_debugger_node.h" @@ -98,6 +98,7 @@ #include "editor/import/resource_importer_layered_texture.h" #include "editor/import/resource_importer_obj.h" #include "editor/import/resource_importer_scene.h" +#include "editor/import/resource_importer_shader_file.h" #include "editor/import/resource_importer_texture.h" #include "editor/import/resource_importer_texture_atlas.h" #include "editor/import/resource_importer_wav.h" @@ -115,43 +116,44 @@ #include "editor/plugins/asset_library_editor_plugin.h" #include "editor/plugins/audio_stream_editor_plugin.h" #include "editor/plugins/baked_lightmap_editor_plugin.h" -#include "editor/plugins/camera_editor_plugin.h" +#include "editor/plugins/camera_3d_editor_plugin.h" #include "editor/plugins/canvas_item_editor_plugin.h" #include "editor/plugins/collision_polygon_2d_editor_plugin.h" -#include "editor/plugins/collision_polygon_editor_plugin.h" +#include "editor/plugins/collision_polygon_3d_editor_plugin.h" #include "editor/plugins/collision_shape_2d_editor_plugin.h" #include "editor/plugins/cpu_particles_2d_editor_plugin.h" -#include "editor/plugins/cpu_particles_editor_plugin.h" +#include "editor/plugins/cpu_particles_3d_editor_plugin.h" #include "editor/plugins/curve_editor_plugin.h" #include "editor/plugins/debugger_editor_plugin.h" #include "editor/plugins/editor_preview_plugins.h" #include "editor/plugins/gi_probe_editor_plugin.h" +#include "editor/plugins/gpu_particles_2d_editor_plugin.h" +#include "editor/plugins/gpu_particles_3d_editor_plugin.h" #include "editor/plugins/gradient_editor_plugin.h" #include "editor/plugins/item_list_editor_plugin.h" #include "editor/plugins/light_occluder_2d_editor_plugin.h" #include "editor/plugins/line_2d_editor_plugin.h" #include "editor/plugins/material_editor_plugin.h" #include "editor/plugins/mesh_editor_plugin.h" -#include "editor/plugins/mesh_instance_editor_plugin.h" +#include "editor/plugins/mesh_instance_3d_editor_plugin.h" #include "editor/plugins/mesh_library_editor_plugin.h" #include "editor/plugins/multimesh_editor_plugin.h" #include "editor/plugins/navigation_polygon_editor_plugin.h" -#include "editor/plugins/particles_2d_editor_plugin.h" -#include "editor/plugins/particles_editor_plugin.h" +#include "editor/plugins/node_3d_editor_plugin.h" #include "editor/plugins/path_2d_editor_plugin.h" -#include "editor/plugins/path_editor_plugin.h" -#include "editor/plugins/physical_bone_plugin.h" +#include "editor/plugins/path_3d_editor_plugin.h" +#include "editor/plugins/physical_bone_3d_editor_plugin.h" #include "editor/plugins/polygon_2d_editor_plugin.h" #include "editor/plugins/resource_preloader_editor_plugin.h" #include "editor/plugins/root_motion_editor_plugin.h" #include "editor/plugins/script_editor_plugin.h" #include "editor/plugins/script_text_editor.h" #include "editor/plugins/shader_editor_plugin.h" +#include "editor/plugins/shader_file_editor_plugin.h" #include "editor/plugins/skeleton_2d_editor_plugin.h" -#include "editor/plugins/skeleton_editor_plugin.h" -#include "editor/plugins/skeleton_ik_editor_plugin.h" -#include "editor/plugins/spatial_editor_plugin.h" -#include "editor/plugins/sprite_editor_plugin.h" +#include "editor/plugins/skeleton_3d_editor_plugin.h" +#include "editor/plugins/skeleton_ik_3d_editor_plugin.h" +#include "editor/plugins/sprite_2d_editor_plugin.h" #include "editor/plugins/sprite_frames_editor_plugin.h" #include "editor/plugins/style_box_editor_plugin.h" #include "editor/plugins/text_editor.h" @@ -170,20 +172,23 @@ #include "editor/register_exporters.h" #include "editor/run_settings_dialog.h" #include "editor/settings_config_dialog.h" - +#include "scene/main/window.h" +#include "servers/display_server.h" #include <stdio.h> #include <stdlib.h> -EditorNode *EditorNode::singleton = NULL; +EditorNode *EditorNode::singleton = nullptr; void EditorNode::_update_scene_tabs() { bool show_rb = EditorSettings::get_singleton()->get("interface/scene_tabs/show_script_button"); - OS::get_singleton()->global_menu_clear("_dock"); + if (DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_GLOBAL_MENU)) { + DisplayServer::get_singleton()->global_menu_clear("_dock"); + } scene_tabs->clear_tabs(); - Ref<Texture2D> script_icon = gui_base->get_icon("Script", "EditorIcons"); + Ref<Texture2D> script_icon = gui_base->get_theme_icon("Script", "EditorIcons"); for (int i = 0; i < editor_data.get_edited_scene_count(); i++) { Node *type_node = editor_data.get_edited_scene_root(i); @@ -196,15 +201,19 @@ void EditorNode::_update_scene_tabs() { bool unsaved = (i == current) ? saved_version != editor_data.get_undo_redo().get_version() : editor_data.get_scene_version(i) != 0; scene_tabs->add_tab(editor_data.get_scene_title(i) + (unsaved ? "(*)" : ""), icon); - OS::get_singleton()->global_menu_add_item("_dock", editor_data.get_scene_title(i) + (unsaved ? "(*)" : ""), GLOBAL_SCENE, i); + if (DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_GLOBAL_MENU)) { + DisplayServer::get_singleton()->global_menu_add_item("_dock", editor_data.get_scene_title(i) + (unsaved ? "(*)" : ""), callable_mp(this, &EditorNode::_global_menu_scene), i); + } if (show_rb && editor_data.get_scene_root_script(i).is_valid()) { scene_tabs->set_tab_right_button(i, script_icon); } } - OS::get_singleton()->global_menu_add_separator("_dock"); - OS::get_singleton()->global_menu_add_item("_dock", TTR("New Window"), GLOBAL_NEW_WINDOW, Variant()); + if (DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_GLOBAL_MENU)) { + DisplayServer::get_singleton()->global_menu_add_separator("_dock"); + DisplayServer::get_singleton()->global_menu_add_item("_dock", TTR("New Window"), callable_mp(this, &EditorNode::_global_menu_new_window)); + } scene_tabs->set_current_tab(editor_data.get_edited_scene()); @@ -253,16 +262,13 @@ void EditorNode::_update_title() { if (unsaved_cache) title += " (*)"; - OS::get_singleton()->set_window_title(title); + DisplayServer::get_singleton()->window_set_title(title); } void EditorNode::_unhandled_input(const Ref<InputEvent> &p_event) { - if (Node::get_viewport()->get_modal_stack_top()) - return; //ignore because of modal window - Ref<InputEventKey> k = p_event; - if (k.is_valid() && k->is_pressed() && !k->is_echo() && !gui_base->get_viewport()->gui_has_modal_stack()) { + if (k.is_valid() && k->is_pressed() && !k->is_echo()) { EditorPlugin *old_editor = editor_plugin_screen; @@ -297,7 +303,7 @@ void EditorNode::_unhandled_input(const Ref<InputEvent> &p_event) { } if (old_editor != editor_plugin_screen) { - get_tree()->set_input_as_handled(); + get_tree()->get_root()->set_input_as_handled(); } } } @@ -335,13 +341,13 @@ void EditorNode::_notification(int p_what) { // update the icon itself only when the spinner is visible if (EditorSettings::get_singleton()->get("interface/editor/show_update_spinner")) { - update_spinner->set_icon(gui_base->get_icon("Progress" + itos(update_spinner_step + 1), "EditorIcons")); + update_spinner->set_icon(gui_base->get_theme_icon("Progress" + itos(update_spinner_step + 1), "EditorIcons")); } } editor_selection->update(); - scene_root->set_size_override(true, Size2(ProjectSettings::get_singleton()->get("display/window/size/width"), ProjectSettings::get_singleton()->get("display/window/size/height"))); + //scene_root->set_size_override(true, Size2(ProjectSettings::get_singleton()->get("display/window/size/width"), ProjectSettings::get_singleton()->get("display/window/size/height"))); { //TODO should only happen on settings changed int current_filter = GLOBAL_GET("rendering/canvas_textures/default_texture_filter"); @@ -355,13 +361,26 @@ void EditorNode::_notification(int p_what) { scene_root->set_default_canvas_item_texture_repeat(tr); } - VS::DOFBokehShape dof_shape = VS::DOFBokehShape(int(GLOBAL_GET("rendering/quality/filters/depth_of_field_bokeh_shape"))); - VS::get_singleton()->camera_effects_set_dof_blur_bokeh_shape(dof_shape); - VS::DOFBlurQuality dof_quality = VS::DOFBlurQuality(int(GLOBAL_GET("rendering/quality/filters/depth_of_field_bokeh_quality"))); - bool dof_jitter = GLOBAL_GET("rendering/quality/filters/depth_of_field_use_jitter"); - VS::get_singleton()->camera_effects_set_dof_blur_quality(dof_quality, dof_jitter); - VS::get_singleton()->environment_set_ssao_quality(VS::EnvironmentSSAOQuality(int(GLOBAL_GET("rendering/quality/ssao/quality"))), GLOBAL_GET("rendering/quality/ssao/half_size")); - VS::get_singleton()->screen_space_roughness_limiter_set_active(GLOBAL_GET("rendering/quality/filters/screen_space_roughness_limiter"), GLOBAL_GET("rendering/quality/filters/screen_space_roughness_limiter_curve")); + RS::DOFBokehShape dof_shape = RS::DOFBokehShape(int(GLOBAL_GET("rendering/quality/depth_of_field/depth_of_field_bokeh_shape"))); + RS::get_singleton()->camera_effects_set_dof_blur_bokeh_shape(dof_shape); + RS::DOFBlurQuality dof_quality = RS::DOFBlurQuality(int(GLOBAL_GET("rendering/quality/depth_of_field/depth_of_field_bokeh_quality"))); + bool dof_jitter = GLOBAL_GET("rendering/quality/depth_of_field/depth_of_field_use_jitter"); + RS::get_singleton()->camera_effects_set_dof_blur_quality(dof_quality, dof_jitter); + RS::get_singleton()->environment_set_ssao_quality(RS::EnvironmentSSAOQuality(int(GLOBAL_GET("rendering/quality/ssao/quality"))), GLOBAL_GET("rendering/quality/ssao/half_size")); + RS::get_singleton()->screen_space_roughness_limiter_set_active(GLOBAL_GET("rendering/quality/screen_filters/screen_space_roughness_limiter"), GLOBAL_GET("rendering/quality/screen_filters/screen_space_roughness_limiter_curve")); + bool glow_bicubic = int(GLOBAL_GET("rendering/quality/glow/upscale_mode")) > 0; + RS::get_singleton()->environment_glow_set_use_bicubic_upscale(glow_bicubic); + RS::EnvironmentSSRRoughnessQuality ssr_roughness_quality = RS::EnvironmentSSRRoughnessQuality(int(GLOBAL_GET("rendering/quality/screen_space_reflection/roughness_quality"))); + RS::get_singleton()->environment_set_ssr_roughness_quality(ssr_roughness_quality); + RS::SubSurfaceScatteringQuality sss_quality = RS::SubSurfaceScatteringQuality(int(GLOBAL_GET("rendering/quality/subsurface_scattering/subsurface_scattering_quality"))); + RS::get_singleton()->sub_surface_scattering_set_quality(sss_quality); + float sss_scale = GLOBAL_GET("rendering/quality/subsurface_scattering/subsurface_scattering_scale"); + float sss_depth_scale = GLOBAL_GET("rendering/quality/subsurface_scattering/subsurface_scattering_depth_scale"); + RS::get_singleton()->sub_surface_scattering_set_scale(sss_scale, sss_depth_scale); + RS::ShadowQuality shadows_quality = RS::ShadowQuality(int(GLOBAL_GET("rendering/quality/shadows/soft_shadow_quality"))); + RS::get_singleton()->shadows_quality_set(shadows_quality); + RS::ShadowQuality directional_shadow_quality = RS::ShadowQuality(int(GLOBAL_GET("rendering/quality/directional_shadow/soft_shadow_quality"))); + RS::get_singleton()->directional_shadow_quality_set(directional_shadow_quality); } ResourceImporterTexture::get_singleton()->update_imports(); @@ -374,15 +393,14 @@ void EditorNode::_notification(int p_what) { get_tree()->get_root()->set_as_audio_listener(false); get_tree()->get_root()->set_as_audio_listener_2d(false); get_tree()->set_auto_accept_quit(false); - get_tree()->connect("files_dropped", callable_mp(this, &EditorNode::_dropped_files)); - get_tree()->connect("global_menu_action", callable_mp(this, &EditorNode::_global_menu_action)); + get_tree()->get_root()->connect("files_dropped", callable_mp(this, &EditorNode::_dropped_files)); /* DO NOT LOAD SCENES HERE, WAIT FOR FILE SCANNING AND REIMPORT TO COMPLETE */ } break; case NOTIFICATION_EXIT_TREE: { editor_data.save_editor_external_data(); - FileAccess::set_file_close_fail_notify_callback(NULL); + FileAccess::set_file_close_fail_notify_callback(nullptr); log->deinit(); // do not get messages anymore editor_data.clear_edited_scenes(); } break; @@ -402,9 +420,9 @@ void EditorNode::_notification(int p_what) { _initializing_addons = false; } - VisualServer::get_singleton()->viewport_set_hide_scenario(get_scene_root()->get_viewport_rid(), true); - VisualServer::get_singleton()->viewport_set_hide_canvas(get_scene_root()->get_viewport_rid(), true); - VisualServer::get_singleton()->viewport_set_disable_environment(get_viewport()->get_viewport_rid(), true); + RenderingServer::get_singleton()->viewport_set_hide_scenario(get_scene_root()->get_viewport_rid(), true); + RenderingServer::get_singleton()->viewport_set_hide_canvas(get_scene_root()->get_viewport_rid(), true); + RenderingServer::get_singleton()->viewport_set_disable_environment(get_viewport()->get_viewport_rid(), true); feature_profile_manager->notify_changed(); @@ -417,7 +435,7 @@ void EditorNode::_notification(int p_what) { /* DO NOT LOAD SCENES HERE, WAIT FOR FILE SCANNING AND REIMPORT TO COMPLETE */ } break; - case MainLoop::NOTIFICATION_WM_FOCUS_IN: { + case NOTIFICATION_WM_FOCUS_IN: { // Restore the original FPS cap after focusing back on the editor OS::get_singleton()->set_low_processor_usage_mode_sleep_usec(int(EDITOR_GET("interface/editor/low_processor_mode_sleep_usec"))); @@ -425,18 +443,18 @@ void EditorNode::_notification(int p_what) { EditorFileSystem::get_singleton()->scan_changes(); } break; - case MainLoop::NOTIFICATION_WM_FOCUS_OUT: { + case NOTIFICATION_WM_FOCUS_OUT: { // Set a low FPS cap to decrease CPU/GPU usage while the editor is unfocused OS::get_singleton()->set_low_processor_usage_mode_sleep_usec(int(EDITOR_GET("interface/editor/unfocused_low_processor_mode_sleep_usec"))); } break; - case MainLoop::NOTIFICATION_WM_ABOUT: { + case NOTIFICATION_WM_ABOUT: { show_about(); } break; - case MainLoop::NOTIFICATION_WM_QUIT_REQUEST: { + case NOTIFICATION_WM_CLOSE_REQUEST: { _menu_option_confirm(FILE_QUIT, false); } break; @@ -448,17 +466,17 @@ void EditorNode::_notification(int p_what) { theme_base->set_theme(theme); gui_base->set_theme(theme); - gui_base->add_style_override("panel", gui_base->get_stylebox("Background", "EditorStyles")); - scene_root_parent->add_style_override("panel", gui_base->get_stylebox("Content", "EditorStyles")); - bottom_panel->add_style_override("panel", gui_base->get_stylebox("panel", "TabContainer")); - scene_tabs->add_style_override("tab_fg", gui_base->get_stylebox("SceneTabFG", "EditorStyles")); - scene_tabs->add_style_override("tab_bg", gui_base->get_stylebox("SceneTabBG", "EditorStyles")); + gui_base->add_theme_style_override("panel", gui_base->get_theme_stylebox("Background", "EditorStyles")); + scene_root_parent->add_theme_style_override("panel", gui_base->get_theme_stylebox("Content", "EditorStyles")); + bottom_panel->add_theme_style_override("panel", gui_base->get_theme_stylebox("panel", "TabContainer")); + scene_tabs->add_theme_style_override("tab_fg", gui_base->get_theme_stylebox("SceneTabFG", "EditorStyles")); + scene_tabs->add_theme_style_override("tab_bg", gui_base->get_theme_stylebox("SceneTabBG", "EditorStyles")); - file_menu->add_style_override("hover", gui_base->get_stylebox("MenuHover", "EditorStyles")); - project_menu->add_style_override("hover", gui_base->get_stylebox("MenuHover", "EditorStyles")); - debug_menu->add_style_override("hover", gui_base->get_stylebox("MenuHover", "EditorStyles")); - settings_menu->add_style_override("hover", gui_base->get_stylebox("MenuHover", "EditorStyles")); - help_menu->add_style_override("hover", gui_base->get_stylebox("MenuHover", "EditorStyles")); + file_menu->add_theme_style_override("hover", gui_base->get_theme_stylebox("MenuHover", "EditorStyles")); + project_menu->add_theme_style_override("hover", gui_base->get_theme_stylebox("MenuHover", "EditorStyles")); + debug_menu->add_theme_style_override("hover", gui_base->get_theme_stylebox("MenuHover", "EditorStyles")); + settings_menu->add_theme_style_override("hover", gui_base->get_theme_stylebox("MenuHover", "EditorStyles")); + help_menu->add_theme_style_override("hover", gui_base->get_theme_stylebox("MenuHover", "EditorStyles")); if (EDITOR_GET("interface/scene_tabs/resize_if_many_tabs")) { scene_tabs->set_min_width(int(EDITOR_GET("interface/scene_tabs/minimum_width")) * EDSCALE); @@ -471,7 +489,7 @@ void EditorNode::_notification(int p_what) { // debugger area if (EditorDebuggerNode::get_singleton()->is_visible()) - bottom_panel->add_style_override("panel", gui_base->get_stylebox("BottomPanelDebuggerOverride", "EditorStyles")); + bottom_panel->add_theme_style_override("panel", gui_base->get_theme_stylebox("BottomPanelDebuggerOverride", "EditorStyles")); // update_icons for (int i = 0; i < singleton->main_editor_buttons.size(); i++) { @@ -482,36 +500,38 @@ void EditorNode::_notification(int p_what) { if (icon.is_valid()) { tb->set_icon(icon); - } else if (singleton->gui_base->has_icon(p_editor->get_name(), "EditorIcons")) { - tb->set_icon(singleton->gui_base->get_icon(p_editor->get_name(), "EditorIcons")); + } else if (singleton->gui_base->has_theme_icon(p_editor->get_name(), "EditorIcons")) { + tb->set_icon(singleton->gui_base->get_theme_icon(p_editor->get_name(), "EditorIcons")); } } _build_icon_type_cache(); - play_button->set_icon(gui_base->get_icon("MainPlay", "EditorIcons")); - play_scene_button->set_icon(gui_base->get_icon("PlayScene", "EditorIcons")); - play_custom_scene_button->set_icon(gui_base->get_icon("PlayCustom", "EditorIcons")); - pause_button->set_icon(gui_base->get_icon("Pause", "EditorIcons")); - stop_button->set_icon(gui_base->get_icon("Stop", "EditorIcons")); + play_button->set_icon(gui_base->get_theme_icon("MainPlay", "EditorIcons")); + play_scene_button->set_icon(gui_base->get_theme_icon("PlayScene", "EditorIcons")); + play_custom_scene_button->set_icon(gui_base->get_theme_icon("PlayCustom", "EditorIcons")); + pause_button->set_icon(gui_base->get_theme_icon("Pause", "EditorIcons")); + stop_button->set_icon(gui_base->get_theme_icon("Stop", "EditorIcons")); - prev_scene->set_icon(gui_base->get_icon("PrevScene", "EditorIcons")); - distraction_free->set_icon(gui_base->get_icon("DistractionFree", "EditorIcons")); - scene_tab_add->set_icon(gui_base->get_icon("Add", "EditorIcons")); + prev_scene->set_icon(gui_base->get_theme_icon("PrevScene", "EditorIcons")); + distraction_free->set_icon(gui_base->get_theme_icon("DistractionFree", "EditorIcons")); + scene_tab_add->set_icon(gui_base->get_theme_icon("Add", "EditorIcons")); - bottom_panel_raise->set_icon(gui_base->get_icon("ExpandBottomDock", "EditorIcons")); + bottom_panel_raise->set_icon(gui_base->get_theme_icon("ExpandBottomDock", "EditorIcons")); // clear_button->set_icon(gui_base->get_icon("Close", "EditorIcons")); don't have access to that node. needs to become a class property dock_tab_move_left->set_icon(theme->get_icon("Back", "EditorIcons")); dock_tab_move_right->set_icon(theme->get_icon("Forward", "EditorIcons")); PopupMenu *p = help_menu->get_popup(); - p->set_item_icon(p->get_item_index(HELP_SEARCH), gui_base->get_icon("HelpSearch", "EditorIcons")); - p->set_item_icon(p->get_item_index(HELP_DOCS), gui_base->get_icon("Instance", "EditorIcons")); - p->set_item_icon(p->get_item_index(HELP_QA), gui_base->get_icon("Instance", "EditorIcons")); - p->set_item_icon(p->get_item_index(HELP_ISSUES), gui_base->get_icon("Instance", "EditorIcons")); - p->set_item_icon(p->get_item_index(HELP_COMMUNITY), gui_base->get_icon("Instance", "EditorIcons")); - p->set_item_icon(p->get_item_index(HELP_ABOUT), gui_base->get_icon("Godot", "EditorIcons")); + p->set_item_icon(p->get_item_index(HELP_SEARCH), gui_base->get_theme_icon("HelpSearch", "EditorIcons")); + p->set_item_icon(p->get_item_index(HELP_DOCS), gui_base->get_theme_icon("Instance", "EditorIcons")); + p->set_item_icon(p->get_item_index(HELP_QA), gui_base->get_theme_icon("Instance", "EditorIcons")); + p->set_item_icon(p->get_item_index(HELP_ABOUT), gui_base->get_theme_icon("Godot", "EditorIcons")); + p->set_item_icon(p->get_item_index(HELP_REPORT_A_BUG), gui_base->get_theme_icon("Instance", "EditorIcons")); + p->set_item_icon(p->get_item_index(HELP_SEND_DOCS_FEEDBACK), gui_base->get_theme_icon("Instance", "EditorIcons")); + p->set_item_icon(p->get_item_index(HELP_COMMUNITY), gui_base->get_theme_icon("Instance", "EditorIcons")); + p->set_item_icon(p->get_item_index(HELP_ABOUT), gui_base->get_theme_icon("Godot", "EditorIcons")); _update_update_spinner(); } break; @@ -691,6 +711,11 @@ void EditorNode::_sources_changed(bool p_exist) { if (waiting_for_first_scan) { waiting_for_first_scan = false; + // Reload the global shader variables, but this time + // loading texures, as they are now properly imported. + print_line("done scanning, reload textures"); + RenderingServer::get_singleton()->global_variables_load_settings(true); + // Start preview thread now that it's safe. if (!singleton->cmdline_export_mode) { EditorResourcePreview::get_singleton()->start(); @@ -822,7 +847,7 @@ void EditorNode::save_resource_as(const Ref<Resource> &p_resource, const String } } - file->set_mode(EditorFileDialog::MODE_SAVE_FILE); + file->set_file_mode(EditorFileDialog::FILE_MODE_SAVE_FILE); saving_resource = p_resource; current_option = RESOURCE_SAVE_AS; @@ -859,7 +884,7 @@ void EditorNode::save_resource_as(const Ref<Resource> &p_resource, const String file->set_current_path(p_resource->get_path()); if (extensions.size()) { String ext = p_resource->get_path().get_extension().to_lower(); - if (extensions.find(ext) == NULL) { + if (extensions.find(ext) == nullptr) { file->set_current_path(p_resource->get_path().replacen("." + ext, "." + extensions.front()->get())); } } @@ -1105,7 +1130,7 @@ void EditorNode::_find_node_types(Node *p_node, int &count_2d, int &count_3d) { if (p_node->is_class("CanvasItem")) count_2d++; - else if (p_node->is_class("Spatial")) + else if (p_node->is_class("Node3D")) count_3d++; for (int i = 0; i < p_node->get_child_count(); i++) @@ -1116,7 +1141,7 @@ void EditorNode::_save_scene_with_preview(String p_file, int p_idx) { EditorProgress save("save", TTR("Saving Scene"), 4); - if (editor_data.get_edited_scene_root() != NULL) { + if (editor_data.get_edited_scene_root() != nullptr) { save.step(TTR("Analyzing"), 0); int c2d = 0; @@ -1137,7 +1162,7 @@ void EditorNode::_save_scene_with_preview(String p_file, int p_idx) { if (is2d) { img = scene_root->get_texture()->get_data(); } else { - img = SpatialEditor::get_singleton()->get_editor_viewport(0)->get_viewport_node()->get_texture()->get_data(); + img = Node3DEditor::get_singleton()->get_editor_viewport(0)->get_viewport_node()->get_texture()->get_data(); } if (img.is_valid()) { @@ -1466,7 +1491,7 @@ void EditorNode::_dialog_action(String p_file) { int scene_idx = (current_option == FILE_SAVE_SCENE || current_option == FILE_SAVE_AS_SCENE) ? -1 : tab_closing; - if (file->get_mode() == EditorFileDialog::MODE_SAVE_FILE) { + if (file->get_file_mode() == EditorFileDialog::FILE_MODE_SAVE_FILE) { bool same_open_scene = false; for (int i = 0; i < editor_data.get_edited_scene_count(); i++) { if (editor_data.get_scene_path(i) == p_file && i != scene_idx) @@ -1490,7 +1515,7 @@ void EditorNode::_dialog_action(String p_file) { } break; case FILE_SAVE_AND_RUN: { - if (file->get_mode() == EditorFileDialog::MODE_SAVE_FILE) { + if (file->get_file_mode() == EditorFileDialog::FILE_MODE_SAVE_FILE) { _save_default_environment(); _save_scene_with_preview(p_file); @@ -1555,7 +1580,7 @@ void EditorNode::_dialog_action(String p_file) { save_resource_in_path(saving_resource, p_file); saving_resource = Ref<Resource>(); ObjectID current = editor_history.get_current(); - Object *current_obj = current.is_valid() ? ObjectDB::get_instance(current) : NULL; + Object *current_obj = current.is_valid() ? ObjectDB::get_instance(current) : nullptr; ERR_FAIL_COND(!current_obj); current_obj->_change_notify(); } break; @@ -1620,7 +1645,7 @@ void EditorNode::_dialog_action(String p_file) { } break; default: { //save scene? - if (file->get_mode() == EditorFileDialog::MODE_SAVE_FILE) { + if (file->get_file_mode() == EditorFileDialog::FILE_MODE_SAVE_FILE) { _save_scene_with_preview(p_file); } @@ -1701,10 +1726,10 @@ void EditorNode::edit_item(Object *p_object) { void EditorNode::push_item(Object *p_object, const String &p_property, bool p_inspector_only) { if (!p_object) { - get_inspector()->edit(NULL); - node_dock->set_node(NULL); - scene_tree_dock->set_selected(NULL); - inspector_dock->update(NULL); + get_inspector()->edit(nullptr); + node_dock->set_node(nullptr); + scene_tree_dock->set_selected(nullptr); + inspector_dock->update(nullptr); return; } @@ -1765,17 +1790,17 @@ static bool overrides_external_editor(Object *p_object) { void EditorNode::_edit_current() { ObjectID current = editor_history.get_current(); - Object *current_obj = current.is_valid() ? ObjectDB::get_instance(current) : NULL; + Object *current_obj = current.is_valid() ? ObjectDB::get_instance(current) : nullptr; bool inspector_only = editor_history.is_current_inspector_only(); this->current = current_obj; if (!current_obj) { - scene_tree_dock->set_selected(NULL); - get_inspector()->edit(NULL); - node_dock->set_node(NULL); - inspector_dock->update(NULL); + scene_tree_dock->set_selected(nullptr); + get_inspector()->edit(nullptr); + node_dock->set_node(nullptr); + inspector_dock->update(nullptr); _display_top_editors(false); @@ -1796,9 +1821,9 @@ void EditorNode::_edit_current() { Resource *current_res = Object::cast_to<Resource>(current_obj); ERR_FAIL_COND(!current_res); get_inspector()->edit(current_res); - scene_tree_dock->set_selected(NULL); - node_dock->set_node(NULL); - inspector_dock->update(NULL); + scene_tree_dock->set_selected(nullptr); + node_dock->set_node(nullptr); + inspector_dock->update(nullptr); EditorNode::get_singleton()->get_import_dock()->set_edit_path(current_res->get_path()); int subr_idx = current_res->get_path().find("::"); @@ -1827,9 +1852,9 @@ void EditorNode::_edit_current() { scene_tree_dock->set_selected(current_node); inspector_dock->update(current_node); } else { - node_dock->set_node(NULL); - scene_tree_dock->set_selected(NULL); - inspector_dock->update(NULL); + node_dock->set_node(nullptr); + scene_tree_dock->set_selected(nullptr); + inspector_dock->update(nullptr); } if (get_edited_scene() && get_edited_scene()->get_filename() != String()) { @@ -1841,7 +1866,7 @@ void EditorNode::_edit_current() { } else { - Node *selected_node = NULL; + Node *selected_node = nullptr; if (current_obj->is_class("EditorDebuggerRemoteObject")) { editable_warning = TTR("This is a remote object, so changes to it won't be kept.\nPlease read the documentation relevant to debugging to better understand this workflow."); @@ -1870,9 +1895,9 @@ void EditorNode::_edit_current() { } get_inspector()->edit(current_obj); - node_dock->set_node(NULL); + node_dock->set_node(nullptr); scene_tree_dock->set_selected(selected_node); - inspector_dock->update(NULL); + inspector_dock->update(nullptr); } if (current_obj == prev_inspected_object) { @@ -1898,7 +1923,7 @@ void EditorNode::_edit_current() { for (int i = 0; i < editor_table.size(); i++) { if (editor_table[i] == main_plugin && !main_editor_buttons[i]->is_visible()) { - main_plugin = NULL; //if button is not visible, then no plugin active + main_plugin = nullptr; //if button is not visible, then no plugin active } } @@ -1970,11 +1995,11 @@ void EditorNode::_run(bool p_current, const String &p_custom) { } play_button->set_pressed(false); - play_button->set_icon(gui_base->get_icon("MainPlay", "EditorIcons")); + play_button->set_icon(gui_base->get_theme_icon("MainPlay", "EditorIcons")); play_scene_button->set_pressed(false); - play_scene_button->set_icon(gui_base->get_icon("PlayScene", "EditorIcons")); + play_scene_button->set_icon(gui_base->get_theme_icon("PlayScene", "EditorIcons")); play_custom_scene_button->set_pressed(false); - play_custom_scene_button->set_icon(gui_base->get_icon("PlayCustom", "EditorIcons")); + play_custom_scene_button->set_icon(gui_base->get_theme_icon("PlayCustom", "EditorIcons")); String main_scene; String run_filename; @@ -2057,14 +2082,14 @@ void EditorNode::_run(bool p_current, const String &p_custom) { emit_signal("play_pressed"); if (p_current) { play_scene_button->set_pressed(true); - play_scene_button->set_icon(gui_base->get_icon("Reload", "EditorIcons")); + play_scene_button->set_icon(gui_base->get_theme_icon("Reload", "EditorIcons")); } else if (p_custom != "") { run_custom_filename = p_custom; play_custom_scene_button->set_pressed(true); - play_custom_scene_button->set_icon(gui_base->get_icon("Reload", "EditorIcons")); + play_custom_scene_button->set_icon(gui_base->get_theme_icon("Reload", "EditorIcons")); } else { play_button->set_pressed(true); - play_button->set_icon(gui_base->get_icon("Reload", "EditorIcons")); + play_button->set_icon(gui_base->get_theme_icon("Reload", "EditorIcons")); } stop_button->set_disabled(false); @@ -2085,7 +2110,7 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) { case FILE_NEW_INHERITED_SCENE: case FILE_OPEN_SCENE: { - file->set_mode(EditorFileDialog::MODE_OPEN_FILE); + file->set_file_mode(EditorFileDialog::FILE_MODE_OPEN_FILE); List<String> extensions; ResourceLoader::get_recognized_extensions_for_type("PackedScene", &extensions); file->clear_filters(); @@ -2158,7 +2183,7 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) { String scene_filename = editor_data.get_edited_scene_root(tab_closing)->get_filename(); save_confirmation->get_ok()->set_text(TTR("Save & Close")); save_confirmation->set_text(vformat(TTR("Save changes to '%s' before closing?"), scene_filename != "" ? scene_filename : "unsaved scene")); - save_confirmation->popup_centered_minsize(); + save_confirmation->popup_centered(); break; } } else if (p_option == FILE_CLOSE) { @@ -2212,7 +2237,7 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) { break; } - file->set_mode(EditorFileDialog::MODE_SAVE_FILE); + file->set_file_mode(EditorFileDialog::FILE_MODE_SAVE_FILE); List<String> extensions; Ref<PackedScene> sd = memnew(PackedScene); @@ -2227,7 +2252,7 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) { file->set_current_path(scene->get_filename()); if (extensions.size()) { String ext = scene->get_filename().get_extension().to_lower(); - if (extensions.find(ext) == NULL) { + if (extensions.find(ext) == nullptr) { file->set_current_path(scene->get_filename().replacen("." + ext, "." + extensions.front()->get())); } } @@ -2254,7 +2279,7 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) { confirmation->get_cancel()->set_text(TTR("No")); confirmation->get_ok()->set_text(TTR("Yes")); confirmation->set_text(TTR("This scene has never been saved. Save before running?")); - confirmation->popup_centered_minsize(); + confirmation->popup_centered(); break; } @@ -2326,7 +2351,7 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) { confirmation->get_ok()->set_text(TTR("Open")); confirmation->set_text(TTR("Current scene not saved. Open anyway?")); - confirmation->popup_centered_minsize(); + confirmation->popup_centered(); break; } @@ -2341,7 +2366,7 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) { case EDIT_UNDO: { - if (Input::get_singleton()->get_mouse_button_mask() & 0x7) { + if (InputFilter::get_singleton()->get_mouse_button_mask() & 0x7) { log->add_message("Can't undo while mouse buttons are pressed.", EditorLog::MSG_TYPE_EDITOR); } else { String action = editor_data.get_undo_redo().get_current_action_name(); @@ -2355,7 +2380,7 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) { } break; case EDIT_REDO: { - if (Input::get_singleton()->get_mouse_button_mask() & 0x7) { + if (InputFilter::get_singleton()->get_mouse_button_mask() & 0x7) { log->add_message("Can't redo while mouse buttons are pressed.", EditorLog::MSG_TYPE_EDITOR); } else { if (!editor_data.get_undo_redo().redo()) { @@ -2384,7 +2409,7 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) { if (unsaved_cache && !p_confirmed) { confirmation->get_ok()->set_text(TTR("Revert")); confirmation->set_text(TTR("This action cannot be undone. Revert anyway?")); - confirmation->popup_centered_minsize(); + confirmation->popup_centered(); break; } @@ -2424,11 +2449,11 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) { editor_run.stop(); run_custom_filename.clear(); play_button->set_pressed(false); - play_button->set_icon(gui_base->get_icon("MainPlay", "EditorIcons")); + play_button->set_icon(gui_base->get_theme_icon("MainPlay", "EditorIcons")); play_scene_button->set_pressed(false); - play_scene_button->set_icon(gui_base->get_icon("PlayScene", "EditorIcons")); + play_scene_button->set_icon(gui_base->get_theme_icon("PlayScene", "EditorIcons")); play_custom_scene_button->set_pressed(false); - play_custom_scene_button->set_icon(gui_base->get_icon("PlayCustom", "EditorIcons")); + play_custom_scene_button->set_icon(gui_base->get_theme_icon("PlayCustom", "EditorIcons")); stop_button->set_disabled(true); if (bool(EDITOR_GET("run/output/always_close_output_on_stop"))) { @@ -2487,11 +2512,11 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) { export_template_manager->install_android_template(); } else { if (DirAccess::exists("res://android/build")) { - remove_android_build_template->popup_centered_minsize(); + remove_android_build_template->popup_centered(); } else if (export_template_manager->can_install_android_template()) { - install_android_build_template->popup_centered_minsize(); + install_android_build_template->popup_centered(); } else { - custom_build_manage_templates->popup_centered_minsize(); + custom_build_manage_templates->popup_centered(); } } } break; @@ -2513,7 +2538,7 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) { confirmation->get_ok()->set_text(p_option == FILE_QUIT ? TTR("Quit") : TTR("Yes")); confirmation->set_text(p_option == FILE_QUIT ? TTR("Exit the editor?") : TTR("Open Project Manager?")); - confirmation->popup_centered_minsize(); + confirmation->popup_centered(); } else { _discard_changes(); break; @@ -2534,11 +2559,11 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) { save_confirmation->get_ok()->set_text(TTR("Save & Quit")); save_confirmation->set_text((p_option == FILE_QUIT ? TTR("Save changes to the following scene(s) before quitting?") : TTR("Save changes the following scene(s) before opening Project Manager?")) + unsaved_scenes); - save_confirmation->popup_centered_minsize(); + save_confirmation->popup_centered(); } } - OS::get_singleton()->request_attention(); + DisplayServer::get_singleton()->window_request_attention(); break; } @@ -2586,13 +2611,13 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) { } break; case SETTINGS_TOGGLE_FULLSCREEN: { - OS::get_singleton()->set_window_fullscreen(!OS::get_singleton()->is_window_fullscreen()); + DisplayServer::get_singleton()->window_set_mode(DisplayServer::get_singleton()->window_get_mode() == DisplayServer::WINDOW_MODE_FULLSCREEN ? DisplayServer::WINDOW_MODE_WINDOWED : DisplayServer::WINDOW_MODE_FULLSCREEN); } break; case SETTINGS_TOGGLE_CONSOLE: { - bool was_visible = OS::get_singleton()->is_console_visible(); - OS::get_singleton()->set_console_visible(!was_visible); + bool was_visible = DisplayServer::get_singleton()->is_console_visible(); + DisplayServer::get_singleton()->console_set_visible(!was_visible); EditorSettings::get_singleton()->set_setting("interface/editor/hide_console_window", was_visible); } break; case EDITOR_SCREENSHOT: { @@ -2601,7 +2626,7 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) { } break; case SETTINGS_PICK_MAIN_SCENE: { - file->set_mode(EditorFileDialog::MODE_OPEN_FILE); + file->set_file_mode(EditorFileDialog::FILE_MODE_OPEN_FILE); List<String> extensions; ResourceLoader::get_recognized_extensions_for_type("PackedScene", &extensions); file->clear_filters(); @@ -2627,14 +2652,17 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) { case HELP_QA: { OS::get_singleton()->shell_open("https://godotengine.org/qa/"); } break; - case HELP_ISSUES: { + case HELP_REPORT_A_BUG: { OS::get_singleton()->shell_open("https://github.com/godotengine/godot/issues"); } break; + case HELP_SEND_DOCS_FEEDBACK: { + OS::get_singleton()->shell_open("https://github.com/godotengine/godot-docs/issues"); + } break; case HELP_COMMUNITY: { OS::get_singleton()->shell_open("https://godotengine.org/community"); } break; case HELP_ABOUT: { - about->popup_centered_minsize(Size2(780, 500) * EDSCALE); + about->popup_centered(Size2(780, 500) * EDSCALE); } break; case SET_VIDEO_DRIVER_SAVE_AND_RESTART: { @@ -2663,10 +2691,10 @@ void EditorNode::_screenshot(bool p_use_utc) { void EditorNode::_save_screenshot(NodePath p_path) { - Viewport *viewport = EditorInterface::get_singleton()->get_editor_viewport()->get_viewport(); - viewport->set_clear_mode(Viewport::CLEAR_MODE_ONLY_NEXT_FRAME); + SubViewport *viewport = Object::cast_to<SubViewport>(EditorInterface::get_singleton()->get_editor_viewport()->get_viewport()); + viewport->set_clear_mode(SubViewport::CLEAR_MODE_ONLY_NEXT_FRAME); Ref<Image> img = viewport->get_texture()->get_data(); - viewport->set_clear_mode(Viewport::CLEAR_MODE_ALWAYS); + viewport->set_clear_mode(SubViewport::CLEAR_MODE_ALWAYS); Error error = img->save_png(p_path); ERR_FAIL_COND_MSG(error != OK, "Cannot save screenshot to file '" + p_path + "'."); } @@ -2737,7 +2765,7 @@ void EditorNode::_discard_changes(const String &p_str) { case SCENE_TAB_CLOSE: { Node *scene = editor_data.get_edited_scene_root(tab_closing); - if (scene != NULL) { + if (scene != nullptr) { String scene_filename = scene->get_filename(); if (scene_filename != "") { previous_scenes.push_back(scene_filename); @@ -2884,8 +2912,8 @@ void EditorNode::add_editor_plugin(EditorPlugin *p_editor, bool p_config_changed if (icon.is_valid()) { tb->set_icon(icon); - } else if (singleton->gui_base->has_icon(p_editor->get_name(), "EditorIcons")) { - tb->set_icon(singleton->gui_base->get_icon(p_editor->get_name(), "EditorIcons")); + } else if (singleton->gui_base->has_theme_icon(p_editor->get_name(), "EditorIcons")) { + tb->set_icon(singleton->gui_base->get_theme_icon(p_editor->get_name(), "EditorIcons")); } tb->set_name(p_editor->get_name()); @@ -3117,7 +3145,7 @@ Dictionary EditorNode::_get_main_scene_state() { void EditorNode::_set_main_scene_state(Dictionary p_state, Node *p_for_scene) { - if (get_edited_scene() != p_for_scene && p_for_scene != NULL) + if (get_edited_scene() != p_for_scene && p_for_scene != nullptr) return; //not for this scene changing_scene = false; @@ -3269,7 +3297,7 @@ Error EditorNode::load_scene(const String &p_scene, bool p_ignore_broken_deps, b if (!p_force_open_imported && FileAccess::exists(p_scene + ".import")) { open_imported->set_text(vformat(TTR("Scene '%s' was automatically imported, so it can't be modified.\nTo make changes to it, a new inherited scene can be created."), p_scene.get_file())); - open_imported->popup_centered_minsize(); + open_imported->popup_centered(); new_inherited_button->grab_focus(); open_import_request = p_scene; return OK; @@ -3412,7 +3440,7 @@ void EditorNode::open_request(const String &p_path) { if (!opening_prev) { List<String>::Element *prev_scene = previous_scenes.find(p_path); - if (prev_scene != NULL) { + if (prev_scene != nullptr) { prev_scene->erase(); } } @@ -3553,7 +3581,7 @@ void EditorNode::add_io_error(const String &p_error) { void EditorNode::_load_error_notify(void *p_ud, const String &p_text) { EditorNode *en = (EditorNode *)p_ud; - en->load_errors->add_image(en->gui_base->get_icon("Error", "EditorIcons")); + en->load_errors->add_image(en->gui_base->get_theme_icon("Error", "EditorIcons")); en->load_errors->add_text(p_text + "\n"); en->load_error_dialog->popup_centered_ratio(0.5); } @@ -3593,8 +3621,8 @@ void EditorNode::register_editor_types() { ClassDB::register_class<EditorSelection>(); ClassDB::register_class<EditorFileDialog>(); ClassDB::register_virtual_class<EditorSettings>(); - ClassDB::register_class<EditorSpatialGizmo>(); - ClassDB::register_class<EditorSpatialGizmoPlugin>(); + ClassDB::register_class<EditorNode3DGizmo>(); + ClassDB::register_class<EditorNode3DGizmoPlugin>(); ClassDB::register_virtual_class<EditorResourcePreview>(); ClassDB::register_class<EditorResourcePreviewGenerator>(); ClassDB::register_virtual_class<EditorFileSystem>(); @@ -3634,7 +3662,7 @@ void EditorNode::stop_child_process(OS::ProcessID p_pid) { } Ref<Script> EditorNode::get_object_custom_type_base(const Object *p_object) const { - ERR_FAIL_COND_V(!p_object, NULL); + ERR_FAIL_COND_V(!p_object, nullptr); Ref<Script> script = p_object->get_script(); @@ -3661,7 +3689,7 @@ Ref<Script> EditorNode::get_object_custom_type_base(const Object *p_object) cons } } - return NULL; + return nullptr; } StringName EditorNode::get_object_custom_type_name(const Object *p_object) const { @@ -3707,11 +3735,11 @@ Ref<ImageTexture> EditorNode::_load_custom_class_icon(const String &p_path) cons return icon; } } - return NULL; + return nullptr; } Ref<Texture2D> EditorNode::get_object_icon(const Object *p_object, const String &p_fallback) const { - ERR_FAIL_COND_V(!p_object || !gui_base, NULL); + ERR_FAIL_COND_V(!p_object || !gui_base, nullptr); Ref<Script> script = p_object->get_script(); if (script.is_null() && p_object->is_class("Script")) { @@ -3746,20 +3774,20 @@ Ref<Texture2D> EditorNode::get_object_icon(const Object *p_object, const String if (p_object->has_meta("_editor_icon")) return p_object->get_meta("_editor_icon"); - if (gui_base->has_icon(p_object->get_class(), "EditorIcons")) - return gui_base->get_icon(p_object->get_class(), "EditorIcons"); + if (gui_base->has_theme_icon(p_object->get_class(), "EditorIcons")) + return gui_base->get_theme_icon(p_object->get_class(), "EditorIcons"); if (p_fallback.length()) - return gui_base->get_icon(p_fallback, "EditorIcons"); + return gui_base->get_theme_icon(p_fallback, "EditorIcons"); - return NULL; + return nullptr; } Ref<Texture2D> EditorNode::get_class_icon(const String &p_class, const String &p_fallback) const { - ERR_FAIL_COND_V_MSG(p_class.empty(), NULL, "Class name cannot be empty."); + ERR_FAIL_COND_V_MSG(p_class.empty(), nullptr, "Class name cannot be empty."); - if (gui_base->has_icon(p_class, "EditorIcons")) { - return gui_base->get_icon(p_class, "EditorIcons"); + if (gui_base->has_theme_icon(p_class, "EditorIcons")) { + return gui_base->get_theme_icon(p_class, "EditorIcons"); } if (ScriptServer::is_global_class(p_class)) { @@ -3773,7 +3801,7 @@ Ref<Texture2D> EditorNode::get_class_icon(const String &p_class, const String &p while (script.is_valid()) { String current_icon_path; - script->get_language()->get_global_class_name(script->get_path(), NULL, ¤t_icon_path); + script->get_language()->get_global_class_name(script->get_path(), nullptr, ¤t_icon_path); icon = _load_custom_class_icon(current_icon_path); if (icon.is_valid()) { return icon; @@ -3782,7 +3810,7 @@ Ref<Texture2D> EditorNode::get_class_icon(const String &p_class, const String &p } if (icon.is_null()) { - icon = gui_base->get_icon(ScriptServer::get_global_class_base(p_class), "EditorIcons"); + icon = gui_base->get_theme_icon(ScriptServer::get_global_class_base(p_class), "EditorIcons"); } return icon; @@ -3800,10 +3828,10 @@ Ref<Texture2D> EditorNode::get_class_icon(const String &p_class, const String &p } } - if (p_fallback.length() && gui_base->has_icon(p_fallback, "EditorIcons")) - return gui_base->get_icon(p_fallback, "EditorIcons"); + if (p_fallback.length() && gui_base->has_theme_icon(p_fallback, "EditorIcons")) + return gui_base->get_theme_icon(p_fallback, "EditorIcons"); - return NULL; + return nullptr; } void EditorNode::progress_add_task(const String &p_task, const String &p_label, int p_steps, bool p_can_cancel) { @@ -3922,7 +3950,7 @@ void EditorNode::show_accept(const String &p_text, const String &p_title) { current_option = -1; accept->get_ok()->set_text(p_title); accept->set_text(p_text); - accept->popup_centered_minsize(); + accept->popup_centered(); } void EditorNode::show_warning(const String &p_text, const String &p_title) { @@ -3930,7 +3958,7 @@ void EditorNode::show_warning(const String &p_text, const String &p_title) { if (warning->is_inside_tree()) { warning->set_text(p_text); warning->set_title(p_title); - warning->popup_centered_minsize(); + warning->popup_centered(); } else { WARN_PRINT(p_title + " " + p_text); } @@ -3938,7 +3966,91 @@ void EditorNode::show_warning(const String &p_text, const String &p_title) { void EditorNode::_copy_warning(const String &p_str) { - OS::get_singleton()->set_clipboard(warning->get_text()); + DisplayServer::get_singleton()->clipboard_set(warning->get_text()); +} + +void EditorNode::_dock_floating_close_request(Control *p_control) { + // Through the MarginContainer to the Window. + Window *window = (Window *)p_control->get_parent()->get_parent(); + int window_slot = window->get_meta("dock_slot"); + + p_control->get_parent()->remove_child(p_control); + dock_slot[window_slot]->add_child(p_control); + dock_slot[window_slot]->move_child(p_control, MIN((int)window->get_meta("dock_index"), dock_slot[window_slot]->get_child_count())); + dock_slot[window_slot]->set_current_tab(window->get_meta("dock_index")); + + window->queue_delete(); + + _update_dock_containers(); + + floating_docks.erase(p_control); +} + +void EditorNode::_dock_make_float() { + Control *dock = dock_slot[dock_popup_selected]->get_current_tab_control(); + ERR_FAIL_COND(!dock); + + const Size2i borders = Size2i(4, 4) * EDSCALE; + Size2 dock_size = dock->get_size() + borders * 2; //remember size + Point2 dock_screen_pos = dock->get_global_position() + get_tree()->get_root()->get_position() - borders; + + print_line("dock pos: " + dock->get_global_position() + " window pos: " + get_tree()->get_root()->get_position()); + int dock_index = dock->get_index(); + dock_slot[dock_popup_selected]->remove_child(dock); + + Window *window = memnew(Window); + window->set_title(dock->get_name()); + Panel *p = memnew(Panel); + p->set_mode(Panel::MODE_FOREGROUND); + p->set_anchors_and_margins_preset(Control::PRESET_WIDE); + window->add_child(p); + MarginContainer *margin = memnew(MarginContainer); + margin->set_anchors_and_margins_preset(Control::PRESET_WIDE); + margin->add_theme_constant_override("margin_right", borders.width); + margin->add_theme_constant_override("margin_top", borders.height); + margin->add_theme_constant_override("margin_left", borders.width); + margin->add_theme_constant_override("margin_bottom", borders.height); + window->add_child(margin); + dock->set_anchors_and_margins_preset(Control::PRESET_WIDE); + margin->add_child(dock); + window->set_wrap_controls(true); + window->set_size(dock_size); + window->set_position(dock_screen_pos); + window->set_transient(true); + window->connect("close_requested", callable_mp(this, &EditorNode::_dock_floating_close_request), varray(dock)); + window->set_meta("dock_slot", dock_popup_selected); + window->set_meta("dock_index", dock_index); + gui_base->add_child(window); + + dock_select_popup->hide(); + + _update_dock_containers(); + + floating_docks.push_back(dock); +} + +void EditorNode::_update_dock_containers() { + + for (int i = 0; i < DOCK_SLOT_MAX; i++) { + if (dock_slot[i]->get_tab_count() == 0 && dock_slot[i]->is_visible()) { + dock_slot[i]->hide(); + } + if (dock_slot[i]->get_tab_count() > 0 && !dock_slot[i]->is_visible()) { + dock_slot[i]->show(); + } + } + for (int i = 0; i < vsplits.size(); i++) { + bool in_use = dock_slot[i * 2 + 0]->get_tab_count() || dock_slot[i * 2 + 1]->get_tab_count(); + if (in_use) + vsplits[i]->show(); + else + vsplits[i]->hide(); + } + + if (right_l_vsplit->is_visible() || right_r_vsplit->is_visible()) + right_hsplit->show(); + else + right_hsplit->hide(); } void EditorNode::_dock_select_input(const Ref<InputEvent> &p_input) { @@ -3986,18 +4098,7 @@ void EditorNode::_dock_select_input(const Ref<InputEvent> &p_input) { dock_slot[nrect]->show(); dock_select->update(); - for (int i = 0; i < vsplits.size(); i++) { - bool in_use = dock_slot[i * 2 + 0]->get_tab_count() || dock_slot[i * 2 + 1]->get_tab_count(); - if (in_use) - vsplits[i]->show(); - else - vsplits[i]->hide(); - } - - if (right_l_vsplit->is_visible() || right_r_vsplit->is_visible()) - right_hsplit->show(); - else - right_hsplit->hide(); + _update_dock_containers(); _edit_current(); _save_docks(); @@ -4051,7 +4152,7 @@ void EditorNode::_dock_select_draw() { Color used = Color(0.6, 0.6, 0.6, 0.8); Color used_selected = Color(0.8, 0.8, 0.8, 0.8); - Color tab_selected = theme_base->get_color("mono_color", "Editor"); + Color tab_selected = theme_base->get_theme_color("mono_color", "Editor"); Color unused = used; unused.a = 0.4; Color unusable = unused; @@ -4329,7 +4430,7 @@ void EditorNode::_load_docks_from_config(Ref<ConfigFile> p_layout, const String String name = names[j]; //find it, in a horribly inefficient way int atidx = -1; - Control *node = NULL; + Control *node = nullptr; for (int k = 0; k < DOCK_SLOT_MAX; k++) { if (!dock_slot[k]->has_node(name)) continue; @@ -4454,7 +4555,7 @@ bool EditorNode::ensure_main_scene(bool p_from_native) { current_option = -1; pick_main_scene->set_text(TTR("No main scene has ever been defined, select one?\nYou can change it later in \"Project Settings\" under the 'application' category.")); - pick_main_scene->popup_centered_minsize(); + pick_main_scene->popup_centered(); return false; } @@ -4462,7 +4563,7 @@ bool EditorNode::ensure_main_scene(bool p_from_native) { current_option = -1; pick_main_scene->set_text(vformat(TTR("Selected scene '%s' does not exist, select a valid one?\nYou can change it later in \"Project Settings\" under the 'application' category."), main_scene)); - pick_main_scene->popup_centered_minsize(); + pick_main_scene->popup_centered(); return false; } @@ -4470,7 +4571,7 @@ bool EditorNode::ensure_main_scene(bool p_from_native) { current_option = -1; pick_main_scene->set_text(vformat(TTR("Selected scene '%s' is not a scene file, select a valid one?\nYou can change it later in \"Project Settings\" under the 'application' category."), main_scene)); - pick_main_scene->popup_centered_minsize(); + pick_main_scene->popup_centered(); return false; } @@ -4590,7 +4691,7 @@ void EditorNode::_scene_tab_closed(int p_tab, int option) { if (unsaved) { save_confirmation->get_ok()->set_text(TTR("Save & Close")); save_confirmation->set_text(vformat(TTR("Save changes to '%s' before closing?"), scene->get_filename() != "" ? scene->get_filename() : "unsaved scene")); - save_confirmation->popup_centered_minsize(); + save_confirmation->popup_centered(); } else { _discard_changes(); } @@ -4814,9 +4915,9 @@ void EditorNode::_bottom_panel_switch(bool p_enable, int p_idx) { bottom_panel_items[i].control->set_visible(i == p_idx); } if (EditorDebuggerNode::get_singleton() == bottom_panel_items[p_idx].control) { // this is the debug panel which uses tabs, so the top section should be smaller - bottom_panel->add_style_override("panel", gui_base->get_stylebox("BottomPanelDebuggerOverride", "EditorStyles")); + bottom_panel->add_theme_style_override("panel", gui_base->get_theme_stylebox("BottomPanelDebuggerOverride", "EditorStyles")); } else { - bottom_panel->add_style_override("panel", gui_base->get_stylebox("panel", "TabContainer")); + bottom_panel->add_theme_style_override("panel", gui_base->get_theme_stylebox("panel", "TabContainer")); } center_split->set_dragger_visibility(SplitContainer::DRAGGER_VISIBLE); center_split->set_collapsed(false); @@ -4826,7 +4927,7 @@ void EditorNode::_bottom_panel_switch(bool p_enable, int p_idx) { bottom_panel_raise->show(); } else { - bottom_panel->add_style_override("panel", gui_base->get_stylebox("panel", "TabContainer")); + bottom_panel->add_theme_style_override("panel", gui_base->get_theme_stylebox("panel", "TabContainer")); bottom_panel_items[p_idx].button->set_pressed(false); bottom_panel_items[p_idx].control->set_visible(false); center_split->set_dragger_visibility(SplitContainer::DRAGGER_HIDDEN); @@ -4895,7 +4996,7 @@ void EditorNode::add_control_to_dock(DockSlot p_slot, Control *p_control) { void EditorNode::remove_control_from_dock(Control *p_control) { - Control *dock = NULL; + Control *dock = nullptr; for (int i = 0; i < DOCK_SLOT_MAX; i++) { if (p_control->get_parent() == dock_slot[i]) { dock = dock_slot[i]; @@ -4919,7 +5020,7 @@ Variant EditorNode::drag_resource(const Ref<Resource> &p_res, Control *p_from) { { //todo make proper previews - Ref<ImageTexture> pic = gui_base->get_icon("FileBigThumb", "EditorIcons"); + Ref<ImageTexture> pic = gui_base->get_theme_icon("FileBigThumb", "EditorIcons"); Ref<Image> img = pic->get_data(); img = img->duplicate(); img->resize(48, 48); //meh @@ -4971,10 +5072,10 @@ Variant EditorNode::drag_files_and_dirs(const Vector<String> &p_paths, Control * if (p_paths[i].ends_with("/")) { label->set_text(p_paths[i].substr(0, p_paths[i].length() - 1).get_file()); - icon->set_texture(gui_base->get_icon("Folder", "EditorIcons")); + icon->set_texture(gui_base->get_theme_icon("Folder", "EditorIcons")); } else { label->set_text(p_paths[i].get_file()); - icon->set_texture(gui_base->get_icon("File", "EditorIcons")); + icon->set_texture(gui_base->get_theme_icon("File", "EditorIcons")); } icon->set_stretch_mode(TextureRect::STRETCH_KEEP_CENTERED); icon->set_size(Size2(16, 16)); @@ -5018,7 +5119,7 @@ void EditorNode::add_tool_menu_item(const String &p_name, Object *p_handler, con void EditorNode::add_tool_submenu_item(const String &p_name, PopupMenu *p_submenu) { ERR_FAIL_NULL(p_submenu); - ERR_FAIL_COND(p_submenu->get_parent() != NULL); + ERR_FAIL_COND(p_submenu->get_parent() != nullptr); tool_menu->add_child(p_submenu); tool_menu->add_submenu_item(p_name, p_submenu->get_name(), TOOLS_CUSTOM); @@ -5042,21 +5143,19 @@ void EditorNode::remove_tool_menu_item(const String &p_name) { } } -void EditorNode::_global_menu_action(const Variant &p_id, const Variant &p_meta) { +void EditorNode::_global_menu_scene(const Variant &p_tag) { + int idx = (int)p_tag; + scene_tabs->set_current_tab(idx); +} - int id = (int)p_id; - if (id == GLOBAL_NEW_WINDOW) { - if (OS::get_singleton()->get_main_loop()) { - List<String> args; - args.push_back("-e"); - String exec = OS::get_singleton()->get_executable_path(); +void EditorNode::_global_menu_new_window(const Variant &p_tag) { + if (OS::get_singleton()->get_main_loop()) { + List<String> args; + args.push_back("-p"); + String exec = OS::get_singleton()->get_executable_path(); - OS::ProcessID pid = 0; - OS::get_singleton()->execute(exec, args, false, &pid); - } - } else if (id == GLOBAL_SCENE) { - int idx = (int)p_meta; - scene_tabs->set_current_tab(idx); + OS::ProcessID pid = 0; + OS::get_singleton()->execute(exec, args, false, &pid); } } @@ -5277,9 +5376,9 @@ void EditorNode::_update_video_driver_color() { // TODO: Probably should de-hardcode this and add to editor settings. if (video_driver->get_text() == "GLES2") { - video_driver->add_color_override("font_color", Color::hex(0x5586a4ff)); + video_driver->add_theme_color_override("font_color", Color::hex(0x5586a4ff)); } else if (video_driver->get_text() == "Vulkan") { - video_driver->add_color_override("font_color", theme_base->get_color("vulkan_color", "Editor")); + video_driver->add_theme_color_override("font_color", theme_base->get_theme_color("vulkan_color", "Editor")); } } @@ -5287,14 +5386,14 @@ void EditorNode::_video_driver_selected(int p_which) { String driver = video_driver->get_item_metadata(p_which); - String current = OS::get_singleton()->get_video_driver_name(OS::get_singleton()->get_current_video_driver()); + String current = ""; //OS::get_singleton()->get_video_driver_name(OS::get_singleton()->get_current_video_driver()); if (driver == current) { return; } video_driver_request = driver; - video_restart_dialog->popup_centered_minsize(); + video_restart_dialog->popup_centered(); video_driver->select(video_driver_current); _update_video_driver_color(); } @@ -5376,6 +5475,7 @@ void EditorNode::_bind_methods() { ClassDB::bind_method("_update_recent_scenes", &EditorNode::_update_recent_scenes); ClassDB::bind_method("_clear_undo_history", &EditorNode::_clear_undo_history); + ClassDB::bind_method("edit_item_resource", &EditorNode::edit_item_resource); ClassDB::bind_method(D_METHOD("get_gui_base"), &EditorNode::get_gui_base); @@ -5406,7 +5506,7 @@ void EditorNode::_print_handler(void *p_this, const String &p_string, bool p_err static void _execute_thread(void *p_ud) { EditorNode::ExecuteThreadArgs *eta = (EditorNode::ExecuteThreadArgs *)p_ud; - Error err = OS::get_singleton()->execute(eta->path, eta->args, true, NULL, &eta->output, &eta->exitcode, true, &eta->execute_output_mutex); + Error err = OS::get_singleton()->execute(eta->path, eta->args, true, nullptr, &eta->output, &eta->exitcode, true, &eta->execute_output_mutex); print_verbose("Thread exit status: " + itos(eta->exitcode)); if (err != OK) { eta->exitcode = err; @@ -5466,15 +5566,15 @@ int EditorNode::execute_and_show_output(const String &p_title, const String &p_p EditorNode::EditorNode() { - Input::get_singleton()->set_use_accumulated_input(true); + InputFilter::get_singleton()->set_use_accumulated_input(true); Resource::_get_local_scene_func = _resource_get_edited_scene; - VisualServer::get_singleton()->set_debug_generate_wireframes(true); + RenderingServer::get_singleton()->set_debug_generate_wireframes(true); - NavigationServer::get_singleton()->set_active(false); // no nav by default if editor + NavigationServer3D::get_singleton()->set_active(false); // no nav by default if editor - PhysicsServer::get_singleton()->set_active(false); // no physics by default if editor - Physics2DServer::get_singleton()->set_active(false); // no physics by default if editor + PhysicsServer3D::get_singleton()->set_active(false); // no physics by default if editor + PhysicsServer2D::get_singleton()->set_active(false); // no physics by default if editor ScriptServer::set_scripting_enabled(false); // no scripting by default if editor EditorHelp::generate_doc(); //before any editor classes are created @@ -5482,15 +5582,22 @@ EditorNode::EditorNode() { ResourceLoader::clear_translation_remaps(); //no remaps using during editor ResourceLoader::clear_path_remaps(); - InputDefault *id = Object::cast_to<InputDefault>(Input::get_singleton()); + InputFilter *id = InputFilter::get_singleton(); if (id) { - if (!OS::get_singleton()->has_touchscreen_ui_hint() && Input::get_singleton()) { + bool found_touchscreen = false; + for (int i = 0; i < DisplayServer::get_singleton()->get_screen_count(); i++) { + if (DisplayServer::get_singleton()->screen_is_touchscreen(i)) { + found_touchscreen = true; + } + } + + if (!found_touchscreen && InputFilter::get_singleton()) { //only if no touchscreen ui hint, set emulation id->set_emulate_touch_from_mouse(false); //just disable just in case } - id->set_custom_mouse_cursor(RES()); + DisplayServer::get_singleton()->cursor_set_custom_image(RES()); } singleton = this; @@ -5519,8 +5626,12 @@ EditorNode::EditorNode() { switch (display_scale) { case 0: { // Try applying a suitable display scale automatically - const int screen = OS::get_singleton()->get_current_screen(); - editor_set_scale(OS::get_singleton()->get_screen_dpi(screen) >= 192 && OS::get_singleton()->get_screen_size(screen).x > 2000 ? 2.0 : 1.0); + const int screen = DisplayServer::get_singleton()->window_get_current_screen(); +#ifdef OSX_ENABLED + editor_set_scale(DisplayServer::get_singleton()->screen_get_scale(screen)); +#else + editor_set_scale(DisplayServer::get_singleton()->screen_get_dpi(screen) >= 192 && DisplayServer::get_singleton()->screen_get_size(screen).x > 2000 ? 2.0 : 1.0); +#endif } break; case 1: { @@ -5554,7 +5665,7 @@ EditorNode::EditorNode() { } // Define a minimum window size to prevent UI elements from overlapping or being cut off - OS::get_singleton()->set_min_window_size(Size2(1024, 600) * EDSCALE); + DisplayServer::get_singleton()->window_set_min_size(Size2(1024, 600) * EDSCALE); ResourceLoader::set_abort_on_missing_resources(false); FileDialog::set_default_show_hidden_files(EditorSettings::get_singleton()->get("filesystem/file_dialog/show_hidden_files")); @@ -5607,6 +5718,10 @@ EditorNode::EditorNode() { import_obj.instance(); ResourceFormatImporter::get_singleton()->add_importer(import_obj); + Ref<ResourceImporterShaderFile> import_shader_file; + import_shader_file.instance(); + ResourceFormatImporter::get_singleton()->add_importer(import_shader_file); + Ref<ResourceImporterScene> import_scene; import_scene.instance(); ResourceFormatImporter::get_singleton()->add_importer(import_scene); @@ -5713,7 +5828,7 @@ EditorNode::EditorNode() { theme_base->set_theme(theme); gui_base->set_theme(theme); - gui_base->add_style_override("panel", gui_base->get_stylebox("Background", "EditorStyles")); + gui_base->add_theme_style_override("panel", gui_base->get_theme_stylebox("Background", "EditorStyles")); resource_preview = memnew(EditorResourcePreview); add_child(resource_preview); @@ -5728,7 +5843,7 @@ EditorNode::EditorNode() { main_vbox = memnew(VBoxContainer); gui_base->add_child(main_vbox); main_vbox->set_anchors_and_margins_preset(Control::PRESET_WIDE, Control::PRESET_MODE_MINSIZE, 8); - main_vbox->add_constant_override("separation", 8 * EDSCALE); + main_vbox->add_theme_constant_override("separation", 8 * EDSCALE); menu_hb = memnew(HBoxContainer); main_vbox->add_child(menu_hb); @@ -5832,6 +5947,14 @@ EditorNode::EditorNode() { dock_select->set_v_size_flags(Control::SIZE_EXPAND_FILL); dock_vb->add_child(dock_select); + dock_float = memnew(Button); + dock_float->set_text(TTR("Make Floating")); + dock_float->set_focus_mode(Control::FOCUS_NONE); + dock_float->set_h_size_flags(Control::SIZE_SHRINK_CENTER); + dock_float->connect("pressed", callable_mp(this, &EditorNode::_dock_make_float)); + + dock_vb->add_child(dock_float); + dock_select_popup->set_as_minsize(); dock_select_rect_over = -1; dock_popup_selected = -1; @@ -5861,7 +5984,7 @@ EditorNode::EditorNode() { VBoxContainer *srt = memnew(VBoxContainer); srt->set_v_size_flags(Control::SIZE_EXPAND_FILL); top_split->add_child(srt); - srt->add_constant_override("separation", 0); + srt->add_theme_constant_override("separation", 0); tab_preview_panel = memnew(Panel); tab_preview_panel->set_size(Size2(100, 100) * EDSCALE); @@ -5876,8 +5999,8 @@ EditorNode::EditorNode() { tab_preview_panel->add_child(tab_preview); scene_tabs = memnew(Tabs); - scene_tabs->add_style_override("tab_fg", gui_base->get_stylebox("SceneTabFG", "EditorStyles")); - scene_tabs->add_style_override("tab_bg", gui_base->get_stylebox("SceneTabBG", "EditorStyles")); + scene_tabs->add_theme_style_override("tab_fg", gui_base->get_theme_stylebox("SceneTabFG", "EditorStyles")); + scene_tabs->add_theme_style_override("tab_bg", gui_base->get_theme_stylebox("SceneTabBG", "EditorStyles")); scene_tabs->set_select_with_rmb(true); scene_tabs->add_tab("unsaved"); scene_tabs->set_tab_align(Tabs::ALIGN_LEFT); @@ -5899,7 +6022,6 @@ EditorNode::EditorNode() { scene_tabs_context_menu = memnew(PopupMenu); tabbar_container->add_child(scene_tabs_context_menu); scene_tabs_context_menu->connect("id_pressed", callable_mp(this, &EditorNode::_menu_option)); - scene_tabs_context_menu->set_hide_on_window_lose_focus(true); srt->add_child(tabbar_container); tabbar_container->add_child(scene_tabs); @@ -5911,34 +6033,34 @@ EditorNode::EditorNode() { #endif distraction_free->set_tooltip(TTR("Toggle distraction-free mode.")); distraction_free->connect("pressed", callable_mp(this, &EditorNode::_toggle_distraction_free_mode)); - distraction_free->set_icon(gui_base->get_icon("DistractionFree", "EditorIcons")); + distraction_free->set_icon(gui_base->get_theme_icon("DistractionFree", "EditorIcons")); distraction_free->set_toggle_mode(true); scene_tab_add = memnew(ToolButton); tabbar_container->add_child(scene_tab_add); tabbar_container->add_child(distraction_free); scene_tab_add->set_tooltip(TTR("Add a new scene.")); - scene_tab_add->set_icon(gui_base->get_icon("Add", "EditorIcons")); - scene_tab_add->add_color_override("icon_color_normal", Color(0.6f, 0.6f, 0.6f, 0.8f)); + scene_tab_add->set_icon(gui_base->get_theme_icon("Add", "EditorIcons")); + scene_tab_add->add_theme_color_override("icon_color_normal", Color(0.6f, 0.6f, 0.6f, 0.8f)); scene_tab_add->connect("pressed", callable_mp(this, &EditorNode::_menu_option), make_binds(FILE_NEW_SCENE)); scene_root_parent = memnew(PanelContainer); scene_root_parent->set_custom_minimum_size(Size2(0, 80) * EDSCALE); - scene_root_parent->add_style_override("panel", gui_base->get_stylebox("Content", "EditorStyles")); + scene_root_parent->add_theme_style_override("panel", gui_base->get_theme_stylebox("Content", "EditorStyles")); scene_root_parent->set_draw_behind_parent(true); srt->add_child(scene_root_parent); scene_root_parent->set_v_size_flags(Control::SIZE_EXPAND_FILL); - scene_root = memnew(Viewport); + scene_root = memnew(SubViewport); //scene_root->set_usage(Viewport::USAGE_2D); canvas BG mode prevents usage of this as 2D - VisualServer::get_singleton()->viewport_set_hide_scenario(scene_root->get_viewport_rid(), true); + RenderingServer::get_singleton()->viewport_set_hide_scenario(scene_root->get_viewport_rid(), true); scene_root->set_disable_input(true); scene_root->set_as_audio_listener_2d(true); viewport = memnew(VBoxContainer); viewport->set_v_size_flags(Control::SIZE_EXPAND_FILL); - viewport->add_constant_override("separation", 0); + viewport->add_theme_constant_override("separation", 0); scene_root_parent->add_child(viewport); HBoxContainer *left_menu_hb = memnew(HBoxContainer); @@ -5948,11 +6070,11 @@ EditorNode::EditorNode() { file_menu->set_flat(false); file_menu->set_switch_on_hover(true); file_menu->set_text(TTR("Scene")); - file_menu->add_style_override("hover", gui_base->get_stylebox("MenuHover", "EditorStyles")); + file_menu->add_theme_style_override("hover", gui_base->get_theme_stylebox("MenuHover", "EditorStyles")); left_menu_hb->add_child(file_menu); prev_scene = memnew(ToolButton); - prev_scene->set_icon(gui_base->get_icon("PrevScene", "EditorIcons")); + prev_scene->set_icon(gui_base->get_theme_icon("PrevScene", "EditorIcons")); prev_scene->set_tooltip(TTR("Go to previously opened scene.")); prev_scene->set_disabled(true); prev_scene->connect("pressed", callable_mp(this, &EditorNode::_menu_option), make_binds(FILE_OPEN_PREV)); @@ -6004,7 +6126,7 @@ EditorNode::EditorNode() { file_menu->set_tooltip(TTR("Operations with scene files.")); p = file_menu->get_popup(); - p->set_hide_on_window_lose_focus(true); + p->add_shortcut(ED_SHORTCUT("editor/new_scene", TTR("New Scene")), FILE_NEW_SCENE); p->add_shortcut(ED_SHORTCUT("editor/new_inherited_scene", TTR("New Inherited Scene...")), FILE_NEW_INHERITED_SCENE); p->add_shortcut(ED_SHORTCUT("editor/open_scene", TTR("Open Scene..."), KEY_MASK_CMD + KEY_O), FILE_OPEN_SCENE); @@ -6052,11 +6174,11 @@ EditorNode::EditorNode() { project_menu->set_switch_on_hover(true); project_menu->set_tooltip(TTR("Miscellaneous project or scene-wide tools.")); project_menu->set_text(TTR("Project")); - project_menu->add_style_override("hover", gui_base->get_stylebox("MenuHover", "EditorStyles")); + project_menu->add_theme_style_override("hover", gui_base->get_theme_stylebox("MenuHover", "EditorStyles")); left_menu_hb->add_child(project_menu); p = project_menu->get_popup(); - p->set_hide_on_window_lose_focus(true); + p->add_shortcut(ED_SHORTCUT("editor/project_settings", TTR("Project Settings...")), RUN_SETTINGS); p->connect("id_pressed", callable_mp(this, &EditorNode::_menu_option)); @@ -6102,19 +6224,20 @@ EditorNode::EditorNode() { debug_menu->set_flat(false); debug_menu->set_switch_on_hover(true); debug_menu->set_text(TTR("Debug")); - debug_menu->add_style_override("hover", gui_base->get_stylebox("MenuHover", "EditorStyles")); + debug_menu->add_theme_style_override("hover", gui_base->get_theme_stylebox("MenuHover", "EditorStyles")); left_menu_hb->add_child(debug_menu); + menu_hb->add_spacer(); settings_menu = memnew(MenuButton); settings_menu->set_flat(false); settings_menu->set_switch_on_hover(true); settings_menu->set_text(TTR("Editor")); - settings_menu->add_style_override("hover", gui_base->get_stylebox("MenuHover", "EditorStyles")); + settings_menu->add_theme_style_override("hover", gui_base->get_theme_stylebox("MenuHover", "EditorStyles")); left_menu_hb->add_child(settings_menu); p = settings_menu->get_popup(); - p->set_hide_on_window_lose_focus(true); + p->add_shortcut(ED_SHORTCUT("editor/editor_settings", TTR("Editor Settings...")), SETTINGS_PREFERENCES); p->add_separator(); @@ -6158,20 +6281,20 @@ EditorNode::EditorNode() { help_menu->set_flat(false); help_menu->set_switch_on_hover(true); help_menu->set_text(TTR("Help")); - help_menu->add_style_override("hover", gui_base->get_stylebox("MenuHover", "EditorStyles")); + help_menu->add_theme_style_override("hover", gui_base->get_theme_stylebox("MenuHover", "EditorStyles")); left_menu_hb->add_child(help_menu); p = help_menu->get_popup(); - p->set_hide_on_window_lose_focus(true); p->connect("id_pressed", callable_mp(this, &EditorNode::_menu_option)); - p->add_icon_shortcut(gui_base->get_icon("HelpSearch", "EditorIcons"), ED_SHORTCUT("editor/editor_help", TTR("Search"), KEY_MASK_SHIFT | KEY_F1), HELP_SEARCH); + p->add_icon_shortcut(gui_base->get_theme_icon("HelpSearch", "EditorIcons"), ED_SHORTCUT("editor/editor_help", TTR("Search"), KEY_MASK_SHIFT | KEY_F1), HELP_SEARCH); p->add_separator(); - p->add_icon_shortcut(gui_base->get_icon("Instance", "EditorIcons"), ED_SHORTCUT("editor/online_docs", TTR("Online Docs")), HELP_DOCS); - p->add_icon_shortcut(gui_base->get_icon("Instance", "EditorIcons"), ED_SHORTCUT("editor/q&a", TTR("Q&A")), HELP_QA); - p->add_icon_shortcut(gui_base->get_icon("Instance", "EditorIcons"), ED_SHORTCUT("editor/issue_tracker", TTR("Issue Tracker")), HELP_ISSUES); - p->add_icon_shortcut(gui_base->get_icon("Instance", "EditorIcons"), ED_SHORTCUT("editor/community", TTR("Community")), HELP_COMMUNITY); + p->add_icon_shortcut(gui_base->get_theme_icon("Instance", "EditorIcons"), ED_SHORTCUT("editor/online_docs", TTR("Online Docs")), HELP_DOCS); + p->add_icon_shortcut(gui_base->get_theme_icon("Instance", "EditorIcons"), ED_SHORTCUT("editor/q&a", TTR("Q&A")), HELP_QA); + p->add_icon_shortcut(gui_base->get_theme_icon("Instance", "EditorIcons"), ED_SHORTCUT("editor/report_a_bug", TTR("Report a Bug")), HELP_REPORT_A_BUG); + p->add_icon_shortcut(gui_base->get_theme_icon("Instance", "EditorIcons"), ED_SHORTCUT("editor/send_docs_feedback", TTR("Send Docs Feedback")), HELP_SEND_DOCS_FEEDBACK); + p->add_icon_shortcut(gui_base->get_theme_icon("Instance", "EditorIcons"), ED_SHORTCUT("editor/community", TTR("Community")), HELP_COMMUNITY); p->add_separator(); - p->add_icon_shortcut(gui_base->get_icon("Godot", "EditorIcons"), ED_SHORTCUT("editor/about", TTR("About")), HELP_ABOUT); + p->add_icon_shortcut(gui_base->get_theme_icon("Godot", "EditorIcons"), ED_SHORTCUT("editor/about", TTR("About")), HELP_ABOUT); HBoxContainer *play_hb = memnew(HBoxContainer); menu_hb->add_child(play_hb); @@ -6179,7 +6302,7 @@ EditorNode::EditorNode() { play_button = memnew(ToolButton); play_hb->add_child(play_button); play_button->set_toggle_mode(true); - play_button->set_icon(gui_base->get_icon("MainPlay", "EditorIcons")); + play_button->set_icon(gui_base->get_theme_icon("MainPlay", "EditorIcons")); play_button->set_focus_mode(Control::FOCUS_NONE); play_button->connect("pressed", callable_mp(this, &EditorNode::_menu_option), make_binds(RUN_PLAY)); play_button->set_tooltip(TTR("Play the project.")); @@ -6191,7 +6314,7 @@ EditorNode::EditorNode() { pause_button = memnew(ToolButton); pause_button->set_toggle_mode(true); - pause_button->set_icon(gui_base->get_icon("Pause", "EditorIcons")); + pause_button->set_icon(gui_base->get_theme_icon("Pause", "EditorIcons")); pause_button->set_focus_mode(Control::FOCUS_NONE); pause_button->set_tooltip(TTR("Pause the scene execution for debugging.")); pause_button->set_disabled(true); @@ -6205,7 +6328,7 @@ EditorNode::EditorNode() { stop_button = memnew(ToolButton); play_hb->add_child(stop_button); stop_button->set_focus_mode(Control::FOCUS_NONE); - stop_button->set_icon(gui_base->get_icon("Stop", "EditorIcons")); + stop_button->set_icon(gui_base->get_theme_icon("Stop", "EditorIcons")); stop_button->connect("pressed", callable_mp(this, &EditorNode::_menu_option), make_binds(RUN_STOP)); stop_button->set_tooltip(TTR("Stop the scene.")); stop_button->set_disabled(true); @@ -6223,7 +6346,7 @@ EditorNode::EditorNode() { play_hb->add_child(play_scene_button); play_scene_button->set_toggle_mode(true); play_scene_button->set_focus_mode(Control::FOCUS_NONE); - play_scene_button->set_icon(gui_base->get_icon("PlayScene", "EditorIcons")); + play_scene_button->set_icon(gui_base->get_theme_icon("PlayScene", "EditorIcons")); play_scene_button->connect("pressed", callable_mp(this, &EditorNode::_menu_option), make_binds(RUN_PLAY_SCENE)); play_scene_button->set_tooltip(TTR("Play the edited scene.")); #ifdef OSX_ENABLED @@ -6236,7 +6359,7 @@ EditorNode::EditorNode() { play_hb->add_child(play_custom_scene_button); play_custom_scene_button->set_toggle_mode(true); play_custom_scene_button->set_focus_mode(Control::FOCUS_NONE); - play_custom_scene_button->set_icon(gui_base->get_icon("PlayCustom", "EditorIcons")); + play_custom_scene_button->set_icon(gui_base->get_theme_icon("PlayCustom", "EditorIcons")); play_custom_scene_button->connect("pressed", callable_mp(this, &EditorNode::_menu_option), make_binds(RUN_PLAY_CUSTOM_SCENE)); play_custom_scene_button->set_tooltip(TTR("Play custom scene")); #ifdef OSX_ENABLED @@ -6253,11 +6376,15 @@ EditorNode::EditorNode() { video_driver->set_flat(true); video_driver->set_focus_mode(Control::FOCUS_NONE); video_driver->connect("item_selected", callable_mp(this, &EditorNode::_video_driver_selected)); - video_driver->add_font_override("font", gui_base->get_font("bold", "EditorFonts")); + video_driver->add_theme_font_override("font", gui_base->get_theme_font("bold", "EditorFonts")); // TODO re-enable when GLES2 is ported video_driver->set_disabled(true); right_menu_hb->add_child(video_driver); +#ifndef _MSC_VER +#warning neeeds to be reimplemented +#endif +#if 0 String video_drivers = ProjectSettings::get_singleton()->get_custom_property_info()["rendering/quality/driver/driver_name"].hint_string; String current_video_driver = OS::get_singleton()->get_video_driver_name(OS::get_singleton()->get_current_video_driver()); video_driver_current = 0; @@ -6273,7 +6400,7 @@ EditorNode::EditorNode() { } _update_video_driver_color(); - +#endif video_restart_dialog = memnew(ConfirmationDialog); video_restart_dialog->set_text(TTR("Changing the video driver requires restarting the editor.")); video_restart_dialog->get_ok()->set_text(TTR("Save & Restart")); @@ -6291,7 +6418,7 @@ EditorNode::EditorNode() { update_spinner = memnew(MenuButton); update_spinner->set_tooltip(TTR("Spins when the editor window redraws.")); right_menu_hb->add_child(update_spinner); - update_spinner->set_icon(gui_base->get_icon("Progress1", "EditorIcons")); + update_spinner->set_icon(gui_base->get_theme_icon("Progress1", "EditorIcons")); update_spinner->get_popup()->connect("id_pressed", callable_mp(this, &EditorNode::_menu_option)); p = update_spinner->get_popup(); p->add_radio_check_item(TTR("Update Continuously"), SETTINGS_UPDATE_CONTINUOUSLY); @@ -6367,7 +6494,7 @@ EditorNode::EditorNode() { // Bottom panels bottom_panel = memnew(PanelContainer); - bottom_panel->add_style_override("panel", gui_base->get_stylebox("panel", "TabContainer")); + bottom_panel->add_theme_style_override("panel", gui_base->get_theme_stylebox("panel", "TabContainer")); center_split->add_child(bottom_panel); center_split->set_dragger_visibility(SplitContainer::DRAGGER_HIDDEN); @@ -6389,7 +6516,7 @@ EditorNode::EditorNode() { bottom_panel_hb->add_child(version_label); bottom_panel_raise = memnew(ToolButton); - bottom_panel_raise->set_icon(gui_base->get_icon("ExpandBottomDock", "EditorIcons")); + bottom_panel_raise->set_icon(gui_base->get_theme_icon("ExpandBottomDock", "EditorIcons")); bottom_panel_raise->set_shortcut(ED_SHORTCUT("editor/bottom_panel_expand", TTR("Expand Bottom Panel"), KEY_MASK_SHIFT | KEY_F12)); @@ -6414,7 +6541,7 @@ EditorNode::EditorNode() { confirmation->connect("confirmed", callable_mp(this, &EditorNode::_menu_confirm_current)); save_confirmation = memnew(ConfirmationDialog); - save_confirmation->add_button(TTR("Don't Save"), OS::get_singleton()->get_swap_ok_cancel(), "discard"); + save_confirmation->add_button(TTR("Don't Save"), DisplayServer::get_singleton()->get_swap_ok_cancel(), "discard"); gui_base->add_child(save_confirmation); save_confirmation->connect("confirmed", callable_mp(this, &EditorNode::_menu_confirm_current)); save_confirmation->connect("custom_action", callable_mp(this, &EditorNode::_discard_changes)); @@ -6441,7 +6568,7 @@ EditorNode::EditorNode() { file_templates->set_title(TTR("Import Templates From ZIP File")); gui_base->add_child(file_templates); - file_templates->set_mode(EditorFileDialog::MODE_OPEN_FILE); + file_templates->set_file_mode(EditorFileDialog::FILE_MODE_OPEN_FILE); file_templates->set_access(EditorFileDialog::ACCESS_FILESYSTEM); file_templates->clear_filters(); file_templates->add_filter("*.tpz ; " + TTR("Template Package")); @@ -6452,7 +6579,7 @@ EditorNode::EditorNode() { file_export_lib = memnew(EditorFileDialog); file_export_lib->set_title(TTR("Export Library")); - file_export_lib->set_mode(EditorFileDialog::MODE_SAVE_FILE); + file_export_lib->set_file_mode(EditorFileDialog::FILE_MODE_SAVE_FILE); file_export_lib->connect("file_selected", callable_mp(this, &EditorNode::_dialog_action)); file_export_lib_merge = memnew(CheckBox); file_export_lib_merge->set_text(TTR("Merge With Existing")); @@ -6463,7 +6590,7 @@ EditorNode::EditorNode() { file_script = memnew(EditorFileDialog); file_script->set_title(TTR("Open & Run a Script")); file_script->set_access(EditorFileDialog::ACCESS_FILESYSTEM); - file_script->set_mode(EditorFileDialog::MODE_OPEN_FILE); + file_script->set_file_mode(EditorFileDialog::FILE_MODE_OPEN_FILE); List<String> sexts; ResourceLoader::get_recognized_extensions_for_type("Script", &sexts); for (List<String>::Element *E = sexts.front(); E; E = E->next()) { @@ -6473,7 +6600,7 @@ EditorNode::EditorNode() { file_script->connect("file_selected", callable_mp(this, &EditorNode::_dialog_action)); file_menu->get_popup()->connect("id_pressed", callable_mp(this, &EditorNode::_menu_option)); - file_menu->connect("about_to_show", callable_mp(this, &EditorNode::_update_file_menu_opened)); + file_menu->connect("about_to_popup", callable_mp(this, &EditorNode::_update_file_menu_opened)); file_menu->get_popup()->connect("popup_hide", callable_mp(this, &EditorNode::_update_file_menu_closed)); settings_menu->get_popup()->connect("id_pressed", callable_mp(this, &EditorNode::_menu_option)); @@ -6488,7 +6615,7 @@ EditorNode::EditorNode() { add_editor_plugin(memnew(DebuggerEditorPlugin(this, debug_menu))); add_editor_plugin(memnew(AnimationPlayerEditorPlugin(this))); add_editor_plugin(memnew(CanvasItemEditorPlugin(this))); - add_editor_plugin(memnew(SpatialEditorPlugin(this))); + add_editor_plugin(memnew(Node3DEditorPlugin(this))); add_editor_plugin(memnew(ScriptEditorPlugin(this))); EditorAudioBuses *audio_bus_editor = EditorAudioBuses::register_editor(); @@ -6512,20 +6639,22 @@ EditorNode::EditorNode() { add_editor_plugin(VersionControlEditorPlugin::get_singleton()); add_editor_plugin(memnew(ShaderEditorPlugin(this))); + add_editor_plugin(memnew(ShaderFileEditorPlugin(this))); add_editor_plugin(memnew(VisualShaderEditorPlugin(this))); - add_editor_plugin(memnew(CameraEditorPlugin(this))); + add_editor_plugin(memnew(Camera3DEditorPlugin(this))); add_editor_plugin(memnew(ThemeEditorPlugin(this))); add_editor_plugin(memnew(MultiMeshEditorPlugin(this))); - add_editor_plugin(memnew(MeshInstanceEditorPlugin(this))); + add_editor_plugin(memnew(MeshInstance3DEditorPlugin(this))); add_editor_plugin(memnew(AnimationTreeEditorPlugin(this))); add_editor_plugin(memnew(MeshLibraryEditorPlugin(this))); add_editor_plugin(memnew(StyleBoxEditorPlugin(this))); - add_editor_plugin(memnew(SpriteEditorPlugin(this))); + add_editor_plugin(memnew(Sprite2DEditorPlugin(this))); add_editor_plugin(memnew(Skeleton2DEditorPlugin(this))); - add_editor_plugin(memnew(ParticlesEditorPlugin(this))); + add_editor_plugin(memnew(GPUParticles2DEditorPlugin(this))); + add_editor_plugin(memnew(GPUParticles3DEditorPlugin(this))); add_editor_plugin(memnew(CPUParticles2DEditorPlugin(this))); - add_editor_plugin(memnew(CPUParticlesEditorPlugin(this))); + add_editor_plugin(memnew(CPUParticles3DEditorPlugin(this))); add_editor_plugin(memnew(ResourcePreloaderEditorPlugin(this))); add_editor_plugin(memnew(ItemListEditorPlugin(this))); add_editor_plugin(memnew(Polygon3DEditorPlugin(this))); @@ -6534,11 +6663,10 @@ EditorNode::EditorNode() { add_editor_plugin(memnew(TileMapEditorPlugin(this))); add_editor_plugin(memnew(SpriteFramesEditorPlugin(this))); add_editor_plugin(memnew(TextureRegionEditorPlugin(this))); - add_editor_plugin(memnew(Particles2DEditorPlugin(this))); add_editor_plugin(memnew(GIProbeEditorPlugin(this))); - // add_editor_plugin(memnew(BakedLightmapEditorPlugin(this))); + //add_editor_plugin(memnew(BakedLightmapEditorPlugin(this))); add_editor_plugin(memnew(Path2DEditorPlugin(this))); - add_editor_plugin(memnew(PathEditorPlugin(this))); + add_editor_plugin(memnew(Path3DEditorPlugin(this))); add_editor_plugin(memnew(Line2DEditorPlugin(this))); add_editor_plugin(memnew(Polygon2DEditorPlugin(this))); add_editor_plugin(memnew(LightOccluder2DEditorPlugin(this))); @@ -6549,9 +6677,9 @@ EditorNode::EditorNode() { add_editor_plugin(memnew(TextureEditorPlugin(this))); add_editor_plugin(memnew(AudioStreamEditorPlugin(this))); add_editor_plugin(memnew(AudioBusesEditorPlugin(audio_bus_editor))); - add_editor_plugin(memnew(SkeletonEditorPlugin(this))); - add_editor_plugin(memnew(SkeletonIKEditorPlugin(this))); - add_editor_plugin(memnew(PhysicalBonePlugin(this))); + add_editor_plugin(memnew(Skeleton3DEditorPlugin(this))); + add_editor_plugin(memnew(SkeletonIK3DEditorPlugin(this))); + add_editor_plugin(memnew(PhysicalBone3DEditorPlugin(this))); add_editor_plugin(memnew(MeshEditorPlugin(this))); add_editor_plugin(memnew(MaterialEditorPlugin(this))); @@ -6584,6 +6712,18 @@ EditorNode::EditorNode() { particles_mat_convert.instance(); resource_conversion_plugins.push_back(particles_mat_convert); + Ref<ProceduralSkyMaterialConversionPlugin> procedural_sky_mat_convert; + procedural_sky_mat_convert.instance(); + resource_conversion_plugins.push_back(procedural_sky_mat_convert); + + Ref<PanoramaSkyMaterialConversionPlugin> panorama_sky_mat_convert; + panorama_sky_mat_convert.instance(); + resource_conversion_plugins.push_back(panorama_sky_mat_convert); + + Ref<PhysicalSkyMaterialConversionPlugin> physical_sky_mat_convert; + physical_sky_mat_convert.instance(); + resource_conversion_plugins.push_back(physical_sky_mat_convert); + Ref<VisualShaderConversionPlugin> vshader_convert; vshader_convert.instance(); resource_conversion_plugins.push_back(vshader_convert); @@ -6592,7 +6732,7 @@ EditorNode::EditorNode() { update_spinner_step_frame = Engine::get_singleton()->get_frames_drawn(); update_spinner_step = 0; - editor_plugin_screen = NULL; + editor_plugin_screen = nullptr; editor_plugins_over = memnew(EditorPluginList); editor_plugins_force_over = memnew(EditorPluginList); editor_plugins_force_input_forwarding = memnew(EditorPluginList); @@ -6603,7 +6743,7 @@ EditorNode::EditorNode() { EditorExport::get_singleton()->add_export_plugin(export_text_to_binary_plugin); _edit_current(); - current = NULL; + current = nullptr; saving_resource = Ref<Resource>(); reference_resource_mem = true; @@ -6613,14 +6753,14 @@ EditorNode::EditorNode() { open_imported = memnew(ConfirmationDialog); open_imported->get_ok()->set_text(TTR("Open Anyway")); - new_inherited_button = open_imported->add_button(TTR("New Inherited"), !OS::get_singleton()->get_swap_ok_cancel(), "inherit"); + new_inherited_button = open_imported->add_button(TTR("New Inherited"), !DisplayServer::get_singleton()->get_swap_ok_cancel(), "inherit"); open_imported->connect("confirmed", callable_mp(this, &EditorNode::_open_imported)); open_imported->connect("custom_action", callable_mp(this, &EditorNode::_inherit_imported)); gui_base->add_child(open_imported); saved_version = 1; unsaved_cache = true; - _last_instanced_scene = NULL; + _last_instanced_scene = nullptr; quick_open = memnew(EditorQuickOpen); gui_base->add_child(quick_open); @@ -6756,7 +6896,7 @@ bool EditorPluginList::forward_gui_input(const Ref<InputEvent> &p_event) { return discard; } -bool EditorPluginList::forward_spatial_gui_input(Camera *p_camera, const Ref<InputEvent> &p_event, bool serve_when_force_input_enabled) { +bool EditorPluginList::forward_spatial_gui_input(Camera3D *p_camera, const Ref<InputEvent> &p_event, bool serve_when_force_input_enabled) { bool discard = false; for (int i = 0; i < plugins_list.size(); i++) { diff --git a/editor/editor_node.h b/editor/editor_node.h index bd285db224..c6f04b0749 100644 --- a/editor/editor_node.h +++ b/editor/editor_node.h @@ -84,6 +84,8 @@ class Tabs; class TextureProgress; class ToolButton; class VSplitContainer; +class Window; +class SubViewport; class EditorNode : public Node { @@ -192,7 +194,8 @@ private: HELP_SEARCH, HELP_DOCS, HELP_QA, - HELP_ISSUES, + HELP_REPORT_A_BUG, + HELP_SEND_DOCS_FEEDBACK, HELP_COMMUNITY, HELP_ABOUT, @@ -206,7 +209,7 @@ private: TOOL_MENU_BASE = 1000 }; - Viewport *scene_root; //root of the scene being edited + SubViewport *scene_root; //root of the scene being edited PanelContainer *scene_root_parent; Control *theme_base; @@ -348,11 +351,14 @@ private: Button *new_inherited_button; String open_import_request; + Vector<Control *> floating_docks; + TabContainer *dock_slot[DOCK_SLOT_MAX]; Rect2 dock_select_rect[DOCK_SLOT_MAX]; int dock_select_rect_over; PopupPanel *dock_select_popup; Control *dock_select; + Button *dock_float; ToolButton *dock_tab_move_left; ToolButton *dock_tab_move_right; int dock_popup_selected; @@ -493,7 +499,8 @@ private: void _add_to_recent_scenes(const String &p_scene); void _update_recent_scenes(); void _open_recent_scene(int p_idx); - void _global_menu_action(const Variant &p_id, const Variant &p_meta); + void _global_menu_scene(const Variant &p_tag); + void _global_menu_new_window(const Variant &p_tag); void _dropped_files(const Vector<String> &p_files, int p_screen); void _add_dropped_files_recursive(const Vector<String> &p_files, String to_path); String _recent_scene; @@ -560,6 +567,8 @@ private: bool _find_scene_in_use(Node *p_node, const String &p_path) const; + void _update_dock_containers(); + void _dock_select_input(const Ref<InputEvent> &p_input); void _dock_move_left(); void _dock_move_right(); @@ -567,6 +576,8 @@ private: void _dock_pre_popup(int p_which); void _dock_split_dragged(int ofs); void _dock_popup_exit(); + void _dock_floating_close_request(Control *p_control); + void _dock_make_float(); void _scene_tab_changed(int p_tab); void _scene_tab_closed(int p_tab, int option = SCENE_TAB_CLOSE); void _scene_tab_hover(int p_tab); @@ -724,7 +735,7 @@ public: Node *get_edited_scene() { return editor_data.get_edited_scene_root(); } - Viewport *get_scene_root() { return scene_root; } //root of the scene being edited + SubViewport *get_scene_root() { return scene_root; } //root of the scene being edited void fix_dependencies(const String &p_for_file); void clear_scene() { _cleanup_scene(); } @@ -884,7 +895,7 @@ public: bool forward_gui_input(const Ref<InputEvent> &p_event); void forward_canvas_draw_over_viewport(Control *p_overlay); void forward_canvas_force_draw_over_viewport(Control *p_overlay); - bool forward_spatial_gui_input(Camera *p_camera, const Ref<InputEvent> &p_event, bool serve_when_force_input_enabled); + bool forward_spatial_gui_input(Camera3D *p_camera, const Ref<InputEvent> &p_event, bool serve_when_force_input_enabled); void forward_spatial_draw_over_viewport(Control *p_overlay); void forward_spatial_force_draw_over_viewport(Control *p_overlay); void add_plugin(EditorPlugin *p_plugin); diff --git a/editor/editor_path.cpp b/editor/editor_path.cpp index 305dc03568..804ad62bbb 100644 --- a/editor/editor_path.cpp +++ b/editor/editor_path.cpp @@ -149,6 +149,6 @@ EditorPath::EditorPath(EditorHistory *p_history) { history = p_history; set_clip_text(true); set_text_align(ALIGN_LEFT); - get_popup()->connect("about_to_show", callable_mp(this, &EditorPath::_about_to_show)); + get_popup()->connect("about_to_popup", callable_mp(this, &EditorPath::_about_to_show)); get_popup()->connect("id_pressed", callable_mp(this, &EditorPath::_id_pressed)); } diff --git a/editor/editor_plugin.cpp b/editor/editor_plugin.cpp index 07a63c39ba..746ebc8292 100644 --- a/editor/editor_plugin.cpp +++ b/editor/editor_plugin.cpp @@ -38,10 +38,10 @@ #include "editor_resource_preview.h" #include "main/main.h" #include "plugins/canvas_item_editor_plugin.h" -#include "plugins/spatial_editor_plugin.h" -#include "scene/3d/camera.h" +#include "plugins/node_3d_editor_plugin.h" +#include "scene/3d/camera_3d.h" #include "scene/gui/popup_menu.h" -#include "servers/visual_server.h" +#include "servers/rendering_server.h" Array EditorInterface::_make_mesh_previews(const Array &p_meshes, int p_preview_size) { @@ -51,7 +51,7 @@ Array EditorInterface::_make_mesh_previews(const Array &p_meshes, int p_preview_ meshes.push_back(p_meshes[i]); } - Vector<Ref<Texture2D>> textures = make_mesh_previews(meshes, NULL, p_preview_size); + Vector<Ref<Texture2D>> textures = make_mesh_previews(meshes, nullptr, p_preview_size); Array ret; for (int i = 0; i < textures.size(); i++) { ret.push_back(textures[i]); @@ -64,25 +64,25 @@ Vector<Ref<Texture2D>> EditorInterface::make_mesh_previews(const Vector<Ref<Mesh int size = p_preview_size; - RID scenario = VS::get_singleton()->scenario_create(); + RID scenario = RS::get_singleton()->scenario_create(); - RID viewport = VS::get_singleton()->viewport_create(); - VS::get_singleton()->viewport_set_update_mode(viewport, VS::VIEWPORT_UPDATE_ALWAYS); - VS::get_singleton()->viewport_set_scenario(viewport, scenario); - VS::get_singleton()->viewport_set_size(viewport, size, size); - VS::get_singleton()->viewport_set_transparent_background(viewport, true); - VS::get_singleton()->viewport_set_active(viewport, true); - RID viewport_texture = VS::get_singleton()->viewport_get_texture(viewport); + RID viewport = RS::get_singleton()->viewport_create(); + RS::get_singleton()->viewport_set_update_mode(viewport, RS::VIEWPORT_UPDATE_ALWAYS); + RS::get_singleton()->viewport_set_scenario(viewport, scenario); + RS::get_singleton()->viewport_set_size(viewport, size, size); + RS::get_singleton()->viewport_set_transparent_background(viewport, true); + RS::get_singleton()->viewport_set_active(viewport, true); + RID viewport_texture = RS::get_singleton()->viewport_get_texture(viewport); - RID camera = VS::get_singleton()->camera_create(); - VS::get_singleton()->viewport_attach_camera(viewport, camera); + RID camera = RS::get_singleton()->camera_create(); + RS::get_singleton()->viewport_attach_camera(viewport, camera); - RID light = VS::get_singleton()->directional_light_create(); - RID light_instance = VS::get_singleton()->instance_create2(light, scenario); + RID light = RS::get_singleton()->directional_light_create(); + RID light_instance = RS::get_singleton()->instance_create2(light, scenario); - RID light2 = VS::get_singleton()->directional_light_create(); - VS::get_singleton()->light_set_color(light2, Color(0.7, 0.7, 0.7)); - RID light_instance2 = VS::get_singleton()->instance_create2(light2, scenario); + RID light2 = RS::get_singleton()->directional_light_create(); + RS::get_singleton()->light_set_color(light2, Color(0.7, 0.7, 0.7)); + RID light_instance2 = RS::get_singleton()->instance_create2(light2, scenario); EditorProgress ep("mlib", TTR("Creating Mesh Previews"), p_meshes.size()); @@ -97,12 +97,12 @@ Vector<Ref<Texture2D>> EditorInterface::make_mesh_previews(const Vector<Ref<Mesh } Transform mesh_xform; - if (p_transforms != NULL) { + if (p_transforms != nullptr) { mesh_xform = (*p_transforms)[i]; } - RID inst = VS::get_singleton()->instance_create2(mesh->get_rid(), scenario); - VS::get_singleton()->instance_set_transform(inst, mesh_xform); + RID inst = RS::get_singleton()->instance_create2(mesh->get_rid(), scenario); + RS::get_singleton()->instance_set_transform(inst, mesh_xform); AABB aabb = mesh->get_aabb(); Vector3 ofs = aabb.position + aabb.size * 0.5; @@ -121,32 +121,32 @@ Vector<Ref<Texture2D>> EditorInterface::make_mesh_previews(const Vector<Ref<Mesh xform.invert(); xform = mesh_xform * xform; - VS::get_singleton()->camera_set_transform(camera, xform * Transform(Basis(), Vector3(0, 0, 3))); - VS::get_singleton()->camera_set_orthogonal(camera, m * 2, 0.01, 1000.0); + RS::get_singleton()->camera_set_transform(camera, xform * Transform(Basis(), Vector3(0, 0, 3))); + RS::get_singleton()->camera_set_orthogonal(camera, m * 2, 0.01, 1000.0); - VS::get_singleton()->instance_set_transform(light_instance, xform * Transform().looking_at(Vector3(-2, -1, -1), Vector3(0, 1, 0))); - VS::get_singleton()->instance_set_transform(light_instance2, xform * Transform().looking_at(Vector3(+1, -1, -2), Vector3(0, 1, 0))); + RS::get_singleton()->instance_set_transform(light_instance, xform * Transform().looking_at(Vector3(-2, -1, -1), Vector3(0, 1, 0))); + RS::get_singleton()->instance_set_transform(light_instance2, xform * Transform().looking_at(Vector3(+1, -1, -2), Vector3(0, 1, 0))); ep.step(TTR("Thumbnail..."), i); Main::iteration(); Main::iteration(); - Ref<Image> img = VS::get_singleton()->texture_2d_get(viewport_texture); + Ref<Image> img = RS::get_singleton()->texture_2d_get(viewport_texture); ERR_CONTINUE(!img.is_valid() || img->empty()); Ref<ImageTexture> it(memnew(ImageTexture)); it->create_from_image(img); - VS::get_singleton()->free(inst); + RS::get_singleton()->free(inst); textures.push_back(it); } - VS::get_singleton()->free(viewport); - VS::get_singleton()->free(light); - VS::get_singleton()->free(light_instance); - VS::get_singleton()->free(light2); - VS::get_singleton()->free(light_instance2); - VS::get_singleton()->free(camera); - VS::get_singleton()->free(scenario); + RS::get_singleton()->free(viewport); + RS::get_singleton()->free(light); + RS::get_singleton()->free(light_instance); + RS::get_singleton()->free(light2); + RS::get_singleton()->free(light_instance2); + RS::get_singleton()->free(camera); + RS::get_singleton()->free(scenario); return textures; } @@ -194,7 +194,7 @@ Array EditorInterface::get_open_scenes() const { int scns_amount = scenes.size(); for (int idx_scn = 0; idx_scn < scns_amount; idx_scn++) { - if (scenes[idx_scn].root == NULL) + if (scenes[idx_scn].root == nullptr) continue; ret.push_back(scenes[idx_scn].root->get_filename()); } @@ -278,7 +278,7 @@ void EditorInterface::set_distraction_free_mode(bool p_enter) { EditorNode::get_singleton()->set_distraction_free_mode(p_enter); } -EditorInterface *EditorInterface::singleton = NULL; +EditorInterface *EditorInterface::singleton = nullptr; void EditorInterface::_bind_methods() { @@ -337,7 +337,7 @@ void EditorPlugin::remove_autoload_singleton(const String &p_name) { } ToolButton *EditorPlugin::add_control_to_bottom_panel(Control *p_control, const String &p_title) { - ERR_FAIL_NULL_V(p_control, NULL); + ERR_FAIL_NULL_V(p_control, nullptr); return EditorNode::get_singleton()->add_bottom_panel_item(p_title, p_control); } @@ -371,24 +371,24 @@ void EditorPlugin::add_control_to_container(CustomControlContainer p_location, C case CONTAINER_SPATIAL_EDITOR_MENU: { - SpatialEditor::get_singleton()->add_control_to_menu_panel(p_control); + Node3DEditor::get_singleton()->add_control_to_menu_panel(p_control); } break; case CONTAINER_SPATIAL_EDITOR_SIDE_LEFT: { - SpatialEditor::get_singleton()->get_palette_split()->add_child(p_control); - SpatialEditor::get_singleton()->get_palette_split()->move_child(p_control, 0); + Node3DEditor::get_singleton()->get_palette_split()->add_child(p_control); + Node3DEditor::get_singleton()->get_palette_split()->move_child(p_control, 0); } break; case CONTAINER_SPATIAL_EDITOR_SIDE_RIGHT: { - SpatialEditor::get_singleton()->get_palette_split()->add_child(p_control); - SpatialEditor::get_singleton()->get_palette_split()->move_child(p_control, 1); + Node3DEditor::get_singleton()->get_palette_split()->add_child(p_control); + Node3DEditor::get_singleton()->get_palette_split()->move_child(p_control, 1); } break; case CONTAINER_SPATIAL_EDITOR_BOTTOM: { - SpatialEditor::get_singleton()->get_shader_split()->add_child(p_control); + Node3DEditor::get_singleton()->get_shader_split()->add_child(p_control); } break; case CONTAINER_CANVAS_EDITOR_MENU: { @@ -445,18 +445,18 @@ void EditorPlugin::remove_control_from_container(CustomControlContainer p_locati case CONTAINER_SPATIAL_EDITOR_MENU: { - SpatialEditor::get_singleton()->remove_control_from_menu_panel(p_control); + Node3DEditor::get_singleton()->remove_control_from_menu_panel(p_control); } break; case CONTAINER_SPATIAL_EDITOR_SIDE_LEFT: case CONTAINER_SPATIAL_EDITOR_SIDE_RIGHT: { - SpatialEditor::get_singleton()->get_palette_split()->remove_child(p_control); + Node3DEditor::get_singleton()->get_palette_split()->remove_child(p_control); } break; case CONTAINER_SPATIAL_EDITOR_BOTTOM: { - SpatialEditor::get_singleton()->get_shader_split()->remove_child(p_control); + Node3DEditor::get_singleton()->get_shader_split()->remove_child(p_control); } break; case CONTAINER_CANVAS_EDITOR_MENU: { @@ -562,10 +562,10 @@ void EditorPlugin::forward_canvas_force_draw_over_viewport(Control *p_overlay) { // Updates the overlays of the 2D viewport or, if in 3D mode, of every 3D viewport. int EditorPlugin::update_overlays() const { - if (SpatialEditor::get_singleton()->is_visible()) { + if (Node3DEditor::get_singleton()->is_visible()) { int count = 0; - for (uint32_t i = 0; i < SpatialEditor::VIEWPORTS_COUNT; i++) { - SpatialEditorViewport *vp = SpatialEditor::get_singleton()->get_editor_viewport(i); + for (uint32_t i = 0; i < Node3DEditor::VIEWPORTS_COUNT; i++) { + Node3DEditorViewport *vp = Node3DEditor::get_singleton()->get_editor_viewport(i); if (vp->is_visible()) { vp->update_surface(); count++; @@ -579,7 +579,7 @@ int EditorPlugin::update_overlays() const { } } -bool EditorPlugin::forward_spatial_gui_input(Camera *p_camera, const Ref<InputEvent> &p_event) { +bool EditorPlugin::forward_spatial_gui_input(Camera3D *p_camera, const Ref<InputEvent> &p_event) { if (get_script_instance() && get_script_instance()->has_method("forward_spatial_gui_input")) { return get_script_instance()->call("forward_spatial_gui_input", p_camera, p_event); @@ -724,12 +724,12 @@ void EditorPlugin::remove_export_plugin(const Ref<EditorExportPlugin> &p_exporte EditorExport::get_singleton()->remove_export_plugin(p_exporter); } -void EditorPlugin::add_spatial_gizmo_plugin(const Ref<EditorSpatialGizmoPlugin> &p_gizmo_plugin) { - SpatialEditor::get_singleton()->add_gizmo_plugin(p_gizmo_plugin); +void EditorPlugin::add_spatial_gizmo_plugin(const Ref<EditorNode3DGizmoPlugin> &p_gizmo_plugin) { + Node3DEditor::get_singleton()->add_gizmo_plugin(p_gizmo_plugin); } -void EditorPlugin::remove_spatial_gizmo_plugin(const Ref<EditorSpatialGizmoPlugin> &p_gizmo_plugin) { - SpatialEditor::get_singleton()->remove_gizmo_plugin(p_gizmo_plugin); +void EditorPlugin::remove_spatial_gizmo_plugin(const Ref<EditorNode3DGizmoPlugin> &p_gizmo_plugin) { + Node3DEditor::get_singleton()->remove_gizmo_plugin(p_gizmo_plugin); } void EditorPlugin::add_inspector_plugin(const Ref<EditorInspectorPlugin> &p_plugin) { @@ -865,7 +865,7 @@ void EditorPlugin::_bind_methods() { ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::BOOL, "forward_canvas_gui_input", PropertyInfo(Variant::OBJECT, "event", PROPERTY_HINT_RESOURCE_TYPE, "InputEvent"))); ClassDB::add_virtual_method(get_class_static(), MethodInfo("forward_canvas_draw_over_viewport", PropertyInfo(Variant::OBJECT, "overlay", PROPERTY_HINT_RESOURCE_TYPE, "Control"))); ClassDB::add_virtual_method(get_class_static(), MethodInfo("forward_canvas_force_draw_over_viewport", PropertyInfo(Variant::OBJECT, "overlay", PROPERTY_HINT_RESOURCE_TYPE, "Control"))); - ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::BOOL, "forward_spatial_gui_input", PropertyInfo(Variant::OBJECT, "camera", PROPERTY_HINT_RESOURCE_TYPE, "Camera"), PropertyInfo(Variant::OBJECT, "event", PROPERTY_HINT_RESOURCE_TYPE, "InputEvent"))); + ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::BOOL, "forward_spatial_gui_input", PropertyInfo(Variant::OBJECT, "camera", PROPERTY_HINT_RESOURCE_TYPE, "Camera3D"), PropertyInfo(Variant::OBJECT, "event", PROPERTY_HINT_RESOURCE_TYPE, "InputEvent"))); ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::STRING, "get_plugin_name")); ClassDB::add_virtual_method(get_class_static(), MethodInfo(PropertyInfo(Variant::OBJECT, "icon", PROPERTY_HINT_RESOURCE_TYPE, "Texture2D"), "get_plugin_icon")); ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::BOOL, "has_main_screen")); @@ -914,7 +914,7 @@ void EditorPlugin::_bind_methods() { } EditorPlugin::EditorPlugin() : - undo_redo(NULL), + undo_redo(nullptr), input_event_forwarding_always_enabled(false), force_draw_over_forwarding_enabled(false), last_main_screen_name("") { diff --git a/editor/editor_plugin.h b/editor/editor_plugin.h index cd3f4d0638..2ca96ceed2 100644 --- a/editor/editor_plugin.h +++ b/editor/editor_plugin.h @@ -42,14 +42,14 @@ #include "scene/resources/texture.h" class EditorNode; -class Spatial; -class Camera; +class Node3D; +class Camera3D; class EditorSelection; class EditorExport; class EditorSettings; class EditorImportPlugin; class EditorExportPlugin; -class EditorSpatialGizmoPlugin; +class EditorNode3DGizmoPlugin; class EditorResourcePreview; class EditorFileSystem; class EditorToolAddons; @@ -185,7 +185,7 @@ public: virtual void forward_canvas_draw_over_viewport(Control *p_overlay); virtual void forward_canvas_force_draw_over_viewport(Control *p_overlay); - virtual bool forward_spatial_gui_input(Camera *p_camera, const Ref<InputEvent> &p_event); + virtual bool forward_spatial_gui_input(Camera3D *p_camera, const Ref<InputEvent> &p_event); virtual void forward_spatial_draw_over_viewport(Control *p_overlay); virtual void forward_spatial_force_draw_over_viewport(Control *p_overlay); @@ -227,8 +227,8 @@ public: void add_export_plugin(const Ref<EditorExportPlugin> &p_exporter); void remove_export_plugin(const Ref<EditorExportPlugin> &p_exporter); - void add_spatial_gizmo_plugin(const Ref<EditorSpatialGizmoPlugin> &p_gizmo_plugin); - void remove_spatial_gizmo_plugin(const Ref<EditorSpatialGizmoPlugin> &p_gizmo_plugin); + void add_spatial_gizmo_plugin(const Ref<EditorNode3DGizmoPlugin> &p_gizmo_plugin); + void remove_spatial_gizmo_plugin(const Ref<EditorNode3DGizmoPlugin> &p_gizmo_plugin); void add_inspector_plugin(const Ref<EditorInspectorPlugin> &p_plugin); void remove_inspector_plugin(const Ref<EditorInspectorPlugin> &p_plugin); @@ -268,7 +268,7 @@ class EditorPlugins { public: static int get_plugin_count() { return creation_func_count; } static EditorPlugin *create(int p_idx, EditorNode *p_editor) { - ERR_FAIL_INDEX_V(p_idx, creation_func_count, NULL); + ERR_FAIL_INDEX_V(p_idx, creation_func_count, nullptr); return creation_funcs[p_idx](p_editor); } diff --git a/editor/editor_plugin_settings.cpp b/editor/editor_plugin_settings.cpp index 33877f86c2..62a76786ae 100644 --- a/editor/editor_plugin_settings.cpp +++ b/editor/editor_plugin_settings.cpp @@ -40,7 +40,7 @@ void EditorPluginSettings::_notification(int p_what) { - if (p_what == MainLoop::NOTIFICATION_WM_FOCUS_IN) { + if (p_what == NOTIFICATION_WM_FOCUS_IN) { update_plugins(); } else if (p_what == Node::NOTIFICATION_READY) { plugin_config_dialog->connect_compat("plugin_ready", EditorNode::get_singleton(), "_on_plugin_ready"); @@ -142,7 +142,7 @@ void EditorPluginSettings::update_plugins() { bool is_active = EditorNode::get_singleton()->is_addon_plugin_enabled(d2); item->set_checked(3, is_active); item->set_editable(3, true); - item->add_button(4, get_icon("Edit", "EditorIcons"), BUTTON_PLUGIN_EDIT, false, TTR("Edit Plugin")); + item->add_button(4, get_theme_icon("Edit", "EditorIcons"), BUTTON_PLUGIN_EDIT, false, TTR("Edit Plugin")); } } } diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp index 9a474ed4af..5213d7ec15 100644 --- a/editor/editor_properties.cpp +++ b/editor/editor_properties.cpp @@ -35,7 +35,7 @@ #include "editor_node.h" #include "editor_properties_array_dict.h" #include "editor_scale.h" -#include "scene/main/viewport.h" +#include "scene/main/window.h" ///////////////////// NULL ///////////////////////// @@ -140,9 +140,9 @@ void EditorPropertyMultilineText::_notification(int p_what) { switch (p_what) { case NOTIFICATION_THEME_CHANGED: case NOTIFICATION_ENTER_TREE: { - Ref<Texture2D> df = get_icon("DistractionFree", "EditorIcons"); + Ref<Texture2D> df = get_theme_icon("DistractionFree", "EditorIcons"); open_big_text->set_icon(df); - Ref<Font> font = get_font("font", "Label"); + Ref<Font> font = get_theme_font("font", "Label"); text->set_custom_minimum_size(Vector2(0, font->get_height() * 6)); } break; @@ -165,8 +165,8 @@ EditorPropertyMultilineText::EditorPropertyMultilineText() { open_big_text = memnew(ToolButton); open_big_text->connect("pressed", callable_mp(this, &EditorPropertyMultilineText::_open_big_text)); hb->add_child(open_big_text); - big_text_dialog = NULL; - big_text = NULL; + big_text_dialog = nullptr; + big_text = nullptr; } ///////////////////// TEXT ENUM ///////////////////////// @@ -240,10 +240,10 @@ void EditorPropertyPath::_path_pressed() { } if (folder) { - dialog->set_mode(EditorFileDialog::MODE_OPEN_DIR); + dialog->set_file_mode(EditorFileDialog::FILE_MODE_OPEN_DIR); dialog->set_current_dir(full_path); } else { - dialog->set_mode(save_mode ? EditorFileDialog::MODE_SAVE_FILE : EditorFileDialog::MODE_OPEN_FILE); + dialog->set_file_mode(save_mode ? EditorFileDialog::FILE_MODE_SAVE_FILE : EditorFileDialog::FILE_MODE_OPEN_FILE); for (int i = 0; i < extensions.size(); i++) { String e = extensions[i].strip_edges(); if (e != String()) { @@ -278,7 +278,7 @@ void EditorPropertyPath::set_save_mode() { void EditorPropertyPath::_notification(int p_what) { if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED) { - path_edit->set_icon(get_icon("Folder", "EditorIcons")); + path_edit->set_icon(get_theme_icon("Folder", "EditorIcons")); } } @@ -303,7 +303,7 @@ EditorPropertyPath::EditorPropertyPath() { path_edit->set_clip_text(true); path_hb->add_child(path_edit); add_focusable(path); - dialog = NULL; + dialog = nullptr; path_edit->connect("pressed", callable_mp(this, &EditorPropertyPath::_path_pressed)); folder = false; global = false; @@ -448,7 +448,7 @@ void EditorPropertyMember::_bind_methods() { } EditorPropertyMember::EditorPropertyMember() { - selector = NULL; + selector = nullptr; property = memnew(Button); property->set_clip_text(true); add_child(property); @@ -604,7 +604,7 @@ public: Vector<String> tooltips; virtual Size2 get_minimum_size() const { - Ref<Font> font = get_font("font", "Label"); + Ref<Font> font = get_theme_font("font", "Label"); return Vector2(0, font->get_height() * 2); } @@ -646,7 +646,7 @@ public: int h = bsize * 2 + 1; int vofs = (rect.size.height - h) / 2; - Color color = get_color("highlight_color", "Editor"); + Color color = get_theme_color("highlight_color", "Editor"); for (int i = 0; i < 2; i++) { Point2 ofs(4, vofs); @@ -749,10 +749,10 @@ void EditorPropertyLayers::_button_pressed() { layers->set_item_checked(idx, grid->value & (1 << i)); } - Rect2 gp = button->get_global_rect(); + Rect2 gp = button->get_screen_rect(); layers->set_as_minsize(); - Vector2 popup_pos = gp.position - Vector2(layers->get_combined_minimum_size().x, 0); - layers->set_global_position(popup_pos); + Vector2 popup_pos = gp.position - Vector2(layers->get_contents_minimum_size().x, 0); + layers->set_position(popup_pos); layers->popup(); } @@ -920,7 +920,7 @@ void EditorPropertyEasing::_drag_easing(const Ref<InputEvent> &p_ev) { } if (mb->is_pressed() && mb->get_button_index() == BUTTON_RIGHT) { - preset->set_global_position(easing_draw->get_global_transform().xform(mb->get_position())); + preset->set_position(easing_draw->get_screen_transform().xform(mb->get_position())); preset->popup(); // Ensure the easing doesn't appear as being dragged @@ -976,13 +976,13 @@ void EditorPropertyEasing::_draw_easing() { float prev = 1.0; const float exp = get_edited_object()->get(get_edited_property()); - const Ref<Font> f = get_font("font", "Label"); - const Color font_color = get_color("font_color", "Label"); + const Ref<Font> f = get_theme_font("font", "Label"); + const Color font_color = get_theme_color("font_color", "Label"); Color line_color; if (dragging) { - line_color = get_color("accent_color", "Editor"); + line_color = get_theme_color("accent_color", "Editor"); } else { - line_color = get_color("font_color", "Label") * Color(1, 1, 1, 0.9); + line_color = get_theme_color("font_color", "Label") * Color(1, 1, 1, 0.9); } Vector<Point2> lines; @@ -1058,15 +1058,15 @@ void EditorPropertyEasing::_notification(int p_what) { case NOTIFICATION_THEME_CHANGED: case NOTIFICATION_ENTER_TREE: { preset->clear(); - preset->add_icon_item(get_icon("CurveConstant", "EditorIcons"), "Zero", EASING_ZERO); - preset->add_icon_item(get_icon("CurveLinear", "EditorIcons"), "Linear", EASING_LINEAR); - preset->add_icon_item(get_icon("CurveIn", "EditorIcons"), "In", EASING_IN); - preset->add_icon_item(get_icon("CurveOut", "EditorIcons"), "Out", EASING_OUT); + preset->add_icon_item(get_theme_icon("CurveConstant", "EditorIcons"), "Zero", EASING_ZERO); + preset->add_icon_item(get_theme_icon("CurveLinear", "EditorIcons"), "Linear", EASING_LINEAR); + preset->add_icon_item(get_theme_icon("CurveIn", "EditorIcons"), "In", EASING_IN); + preset->add_icon_item(get_theme_icon("CurveOut", "EditorIcons"), "Out", EASING_OUT); if (full) { - preset->add_icon_item(get_icon("CurveInOut", "EditorIcons"), "In-Out", EASING_IN_OUT); - preset->add_icon_item(get_icon("CurveOutIn", "EditorIcons"), "Out-In", EASING_OUT_IN); + preset->add_icon_item(get_theme_icon("CurveInOut", "EditorIcons"), "In-Out", EASING_IN_OUT); + preset->add_icon_item(get_theme_icon("CurveOutIn", "EditorIcons"), "Out-In", EASING_OUT_IN); } - easing_draw->set_custom_minimum_size(Size2(0, get_font("font", "Label")->get_height() * 2)); + easing_draw->set_custom_minimum_size(Size2(0, get_theme_font("font", "Label")->get_height() * 2)); } break; } } @@ -1126,7 +1126,7 @@ void EditorPropertyVector2::update_property() { void EditorPropertyVector2::_notification(int p_what) { if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED) { - Color base = get_color("accent_color", "Editor"); + Color base = get_theme_color("accent_color", "Editor"); for (int i = 0; i < 2; i++) { Color c = base; @@ -1150,12 +1150,15 @@ void EditorPropertyVector2::setup(double p_min, double p_max, double p_step, boo } } -EditorPropertyVector2::EditorPropertyVector2() { +EditorPropertyVector2::EditorPropertyVector2(bool p_force_wide) { bool horizontal = EDITOR_GET("interface/inspector/horizontal_vector2_editing"); BoxContainer *bc; - if (horizontal) { + if (p_force_wide) { + bc = memnew(HBoxContainer); + add_child(bc); + } else if (horizontal) { bc = memnew(HBoxContainer); add_child(bc); set_bottom_editor(bc); @@ -1208,7 +1211,7 @@ void EditorPropertyRect2::update_property() { } void EditorPropertyRect2::_notification(int p_what) { if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED) { - Color base = get_color("accent_color", "Editor"); + Color base = get_theme_color("accent_color", "Editor"); for (int i = 0; i < 4; i++) { Color c = base; @@ -1231,13 +1234,16 @@ void EditorPropertyRect2::setup(double p_min, double p_max, double p_step, bool } } -EditorPropertyRect2::EditorPropertyRect2() { +EditorPropertyRect2::EditorPropertyRect2(bool p_force_wide) { - bool horizontal = EDITOR_GET("interface/inspector/horizontal_vector_types_editing"); + bool horizontal = !p_force_wide && bool(EDITOR_GET("interface/inspector/horizontal_vector_types_editing")); BoxContainer *bc; - if (horizontal) { + if (p_force_wide) { + bc = memnew(HBoxContainer); + add_child(bc); + } else if (horizontal) { bc = memnew(HBoxContainer); add_child(bc); set_bottom_editor(bc); @@ -1288,7 +1294,7 @@ void EditorPropertyVector3::update_property() { } void EditorPropertyVector3::_notification(int p_what) { if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED) { - Color base = get_color("accent_color", "Editor"); + Color base = get_theme_color("accent_color", "Editor"); for (int i = 0; i < 3; i++) { Color c = base; @@ -1311,12 +1317,15 @@ void EditorPropertyVector3::setup(double p_min, double p_max, double p_step, boo } } -EditorPropertyVector3::EditorPropertyVector3() { +EditorPropertyVector3::EditorPropertyVector3(bool p_force_wide) { bool horizontal = EDITOR_GET("interface/inspector/horizontal_vector_types_editing"); BoxContainer *bc; - if (horizontal) { + if (p_force_wide) { + bc = memnew(HBoxContainer); + add_child(bc); + } else if (horizontal) { bc = memnew(HBoxContainer); add_child(bc); set_bottom_editor(bc); @@ -1343,6 +1352,255 @@ EditorPropertyVector3::EditorPropertyVector3() { } setting = false; } + +///////////////////// VECTOR2i ///////////////////////// + +void EditorPropertyVector2i::_value_changed(double val, const String &p_name) { + if (setting) + return; + + Vector2i v2; + v2.x = spin[0]->get_value(); + v2.y = spin[1]->get_value(); + emit_changed(get_edited_property(), v2, p_name); +} + +void EditorPropertyVector2i::update_property() { + Vector2i val = get_edited_object()->get(get_edited_property()); + setting = true; + spin[0]->set_value(val.x); + spin[1]->set_value(val.y); + setting = false; +} + +void EditorPropertyVector2i::_notification(int p_what) { + if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED) { + Color base = get_theme_color("accent_color", "Editor"); + for (int i = 0; i < 2; i++) { + + Color c = base; + c.set_hsv(float(i) / 3.0 + 0.05, c.get_s() * 0.75, c.get_v()); + spin[i]->set_custom_label_color(true, c); + } + } +} + +void EditorPropertyVector2i::_bind_methods() { +} + +void EditorPropertyVector2i::setup(int p_min, int p_max, bool p_no_slider) { + for (int i = 0; i < 2; i++) { + spin[i]->set_min(p_min); + spin[i]->set_max(p_max); + spin[i]->set_step(1); + spin[i]->set_hide_slider(p_no_slider); + spin[i]->set_allow_greater(true); + spin[i]->set_allow_lesser(true); + } +} + +EditorPropertyVector2i::EditorPropertyVector2i(bool p_force_wide) { + bool horizontal = EDITOR_GET("interface/inspector/horizontal_vector2_editing"); + + BoxContainer *bc; + + if (p_force_wide) { + bc = memnew(HBoxContainer); + add_child(bc); + } else if (horizontal) { + bc = memnew(HBoxContainer); + add_child(bc); + set_bottom_editor(bc); + } else { + bc = memnew(VBoxContainer); + add_child(bc); + } + + static const char *desc[2] = { "x", "y" }; + for (int i = 0; i < 2; i++) { + spin[i] = memnew(EditorSpinSlider); + spin[i]->set_flat(true); + spin[i]->set_label(desc[i]); + bc->add_child(spin[i]); + add_focusable(spin[i]); + spin[i]->connect("value_changed", callable_mp(this, &EditorPropertyVector2i::_value_changed), varray(desc[i])); + if (horizontal) { + spin[i]->set_h_size_flags(SIZE_EXPAND_FILL); + } + } + + if (!horizontal) { + set_label_reference(spin[0]); //show text and buttons around this + } + setting = false; +} + +///////////////////// RECT2 ///////////////////////// + +void EditorPropertyRect2i::_value_changed(double val, const String &p_name) { + if (setting) + return; + + Rect2i r2; + r2.position.x = spin[0]->get_value(); + r2.position.y = spin[1]->get_value(); + r2.size.x = spin[2]->get_value(); + r2.size.y = spin[3]->get_value(); + emit_changed(get_edited_property(), r2, p_name); +} + +void EditorPropertyRect2i::update_property() { + Rect2i val = get_edited_object()->get(get_edited_property()); + setting = true; + spin[0]->set_value(val.position.x); + spin[1]->set_value(val.position.y); + spin[2]->set_value(val.size.x); + spin[3]->set_value(val.size.y); + setting = false; +} +void EditorPropertyRect2i::_notification(int p_what) { + if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED) { + Color base = get_theme_color("accent_color", "Editor"); + for (int i = 0; i < 4; i++) { + + Color c = base; + c.set_hsv(float(i % 2) / 3.0 + 0.05, c.get_s() * 0.75, c.get_v()); + spin[i]->set_custom_label_color(true, c); + } + } +} +void EditorPropertyRect2i::_bind_methods() { +} + +void EditorPropertyRect2i::setup(int p_min, int p_max, bool p_no_slider) { + for (int i = 0; i < 4; i++) { + spin[i]->set_min(p_min); + spin[i]->set_max(p_max); + spin[i]->set_step(1); + spin[i]->set_hide_slider(p_no_slider); + spin[i]->set_allow_greater(true); + spin[i]->set_allow_lesser(true); + } +} + +EditorPropertyRect2i::EditorPropertyRect2i(bool p_force_wide) { + + bool horizontal = EDITOR_GET("interface/inspector/horizontal_vector_types_editing"); + + BoxContainer *bc; + + if (p_force_wide) { + bc = memnew(HBoxContainer); + add_child(bc); + } else if (horizontal) { + bc = memnew(HBoxContainer); + add_child(bc); + set_bottom_editor(bc); + } else { + bc = memnew(VBoxContainer); + add_child(bc); + } + + static const char *desc[4] = { "x", "y", "w", "h" }; + for (int i = 0; i < 4; i++) { + spin[i] = memnew(EditorSpinSlider); + spin[i]->set_label(desc[i]); + spin[i]->set_flat(true); + bc->add_child(spin[i]); + add_focusable(spin[i]); + spin[i]->connect("value_changed", callable_mp(this, &EditorPropertyRect2i::_value_changed), varray(desc[i])); + if (horizontal) { + spin[i]->set_h_size_flags(SIZE_EXPAND_FILL); + } + } + + if (!horizontal) { + set_label_reference(spin[0]); //show text and buttons around this + } + setting = false; +} + +///////////////////// VECTOR3 ///////////////////////// + +void EditorPropertyVector3i::_value_changed(double val, const String &p_name) { + if (setting) + return; + + Vector3i v3; + v3.x = spin[0]->get_value(); + v3.y = spin[1]->get_value(); + v3.z = spin[2]->get_value(); + emit_changed(get_edited_property(), v3, p_name); +} + +void EditorPropertyVector3i::update_property() { + Vector3i val = get_edited_object()->get(get_edited_property()); + setting = true; + spin[0]->set_value(val.x); + spin[1]->set_value(val.y); + spin[2]->set_value(val.z); + setting = false; +} +void EditorPropertyVector3i::_notification(int p_what) { + if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED) { + Color base = get_theme_color("accent_color", "Editor"); + for (int i = 0; i < 3; i++) { + + Color c = base; + c.set_hsv(float(i) / 3.0 + 0.05, c.get_s() * 0.75, c.get_v()); + spin[i]->set_custom_label_color(true, c); + } + } +} +void EditorPropertyVector3i::_bind_methods() { +} + +void EditorPropertyVector3i::setup(int p_min, int p_max, bool p_no_slider) { + for (int i = 0; i < 3; i++) { + spin[i]->set_min(p_min); + spin[i]->set_max(p_max); + spin[i]->set_step(1); + spin[i]->set_hide_slider(p_no_slider); + spin[i]->set_allow_greater(true); + spin[i]->set_allow_lesser(true); + } +} + +EditorPropertyVector3i::EditorPropertyVector3i(bool p_force_wide) { + bool horizontal = EDITOR_GET("interface/inspector/horizontal_vector_types_editing"); + + BoxContainer *bc; + if (p_force_wide) { + bc = memnew(HBoxContainer); + add_child(bc); + } else if (horizontal) { + bc = memnew(HBoxContainer); + add_child(bc); + set_bottom_editor(bc); + } else { + bc = memnew(VBoxContainer); + add_child(bc); + } + + static const char *desc[3] = { "x", "y", "z" }; + for (int i = 0; i < 3; i++) { + spin[i] = memnew(EditorSpinSlider); + spin[i]->set_flat(true); + spin[i]->set_label(desc[i]); + bc->add_child(spin[i]); + add_focusable(spin[i]); + spin[i]->connect("value_changed", callable_mp(this, &EditorPropertyVector3i::_value_changed), varray(desc[i])); + if (horizontal) { + spin[i]->set_h_size_flags(SIZE_EXPAND_FILL); + } + } + + if (!horizontal) { + set_label_reference(spin[0]); //show text and buttons around this + } + setting = false; +} + ///////////////////// PLANE ///////////////////////// void EditorPropertyPlane::_value_changed(double val, const String &p_name) { @@ -1368,7 +1626,7 @@ void EditorPropertyPlane::update_property() { } void EditorPropertyPlane::_notification(int p_what) { if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED) { - Color base = get_color("accent_color", "Editor"); + Color base = get_theme_color("accent_color", "Editor"); for (int i = 0; i < 3; i++) { Color c = base; @@ -1391,13 +1649,16 @@ void EditorPropertyPlane::setup(double p_min, double p_max, double p_step, bool } } -EditorPropertyPlane::EditorPropertyPlane() { +EditorPropertyPlane::EditorPropertyPlane(bool p_force_wide) { bool horizontal = EDITOR_GET("interface/inspector/horizontal_vector_types_editing"); BoxContainer *bc; - if (horizontal) { + if (p_force_wide) { + bc = memnew(HBoxContainer); + add_child(bc); + } else if (horizontal) { bc = memnew(HBoxContainer); add_child(bc); set_bottom_editor(bc); @@ -1450,7 +1711,7 @@ void EditorPropertyQuat::update_property() { } void EditorPropertyQuat::_notification(int p_what) { if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED) { - Color base = get_color("accent_color", "Editor"); + Color base = get_theme_color("accent_color", "Editor"); for (int i = 0; i < 3; i++) { Color c = base; @@ -1537,7 +1798,7 @@ void EditorPropertyAABB::update_property() { } void EditorPropertyAABB::_notification(int p_what) { if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED) { - Color base = get_color("accent_color", "Editor"); + Color base = get_theme_color("accent_color", "Editor"); for (int i = 0; i < 6; i++) { Color c = base; @@ -1611,7 +1872,7 @@ void EditorPropertyTransform2D::update_property() { } void EditorPropertyTransform2D::_notification(int p_what) { if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED) { - Color base = get_color("accent_color", "Editor"); + Color base = get_theme_color("accent_color", "Editor"); for (int i = 0; i < 6; i++) { Color c = base; @@ -1690,7 +1951,7 @@ void EditorPropertyBasis::update_property() { } void EditorPropertyBasis::_notification(int p_what) { if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED) { - Color base = get_color("accent_color", "Editor"); + Color base = get_theme_color("accent_color", "Editor"); for (int i = 0; i < 9; i++) { Color c = base; @@ -1775,7 +2036,7 @@ void EditorPropertyTransform::update_property() { } void EditorPropertyTransform::_notification(int p_what) { if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED) { - Color base = get_color("accent_color", "Editor"); + Color base = get_theme_color("accent_color", "Editor"); for (int i = 0; i < 12; i++) { Color c = base; @@ -1882,7 +2143,7 @@ EditorPropertyColor::EditorPropertyColor() { void EditorPropertyNodePath::_node_selected(const NodePath &p_path) { NodePath path = p_path; - Node *base_node = NULL; + Node *base_node = nullptr; if (!use_path_from_scene_root) { base_node = Object::cast_to<Node>(get_edited_object()); @@ -1945,7 +2206,7 @@ void EditorPropertyNodePath::update_property() { } assign->set_flat(true); - Node *base_node = NULL; + Node *base_node = nullptr; if (base_hint != NodePath()) { if (get_tree()->get_root()->has_node(base_hint)) { base_node = get_tree()->get_root()->get_node(base_hint); @@ -1983,7 +2244,7 @@ void EditorPropertyNodePath::setup(const NodePath &p_base_hint, Vector<StringNam void EditorPropertyNodePath::_notification(int p_what) { if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED) { - Ref<Texture2D> t = get_icon("Clear", "EditorIcons"); + Ref<Texture2D> t = get_theme_icon("Clear", "EditorIcons"); clear->set_icon(t); } } @@ -2008,7 +2269,7 @@ EditorPropertyNodePath::EditorPropertyNodePath() { hbc->add_child(clear); use_path_from_scene_root = false; - scene_tree = NULL; //do not allocate unnecessarily + scene_tree = nullptr; //do not allocate unnecessarily } ///////////////////// RID ///////////////////////// @@ -2074,7 +2335,7 @@ void EditorPropertyResource::_menu_option(int p_which) { file->connect("file_selected", callable_mp(this, &EditorPropertyResource::_file_selected)); add_child(file); } - file->set_mode(EditorFileDialog::MODE_OPEN_FILE); + file->set_file_mode(EditorFileDialog::FILE_MODE_OPEN_FILE); String type = base_type; List<String> extensions; @@ -2196,7 +2457,7 @@ void EditorPropertyResource::_menu_option(int p_which) { file_system_dock->navigate_to_path(res->get_path()); // Ensure that the FileSystem dock is visible. TabContainer *tab_container = (TabContainer *)file_system_dock->get_parent_control(); - tab_container->set_current_tab(file_system_dock->get_position_in_parent()); + tab_container->set_current_tab(file_system_dock->get_index()); } break; default: { @@ -2248,7 +2509,7 @@ void EditorPropertyResource::_menu_option(int p_which) { return; } - Object *obj = NULL; + Object *obj = nullptr; if (ScriptServer::is_global_class(intype)) { obj = ClassDB::instance(ScriptServer::get_global_class_native_base(intype)); @@ -2294,7 +2555,7 @@ void EditorPropertyResource::_resource_preview(const String &p_path, const Ref<T } if (p_preview.is_valid()) { - preview->set_margin(MARGIN_LEFT, assign->get_icon()->get_width() + assign->get_stylebox("normal")->get_default_margin(MARGIN_LEFT) + get_constant("hseparation", "Button")); + preview->set_margin(MARGIN_LEFT, assign->get_icon()->get_width() + assign->get_theme_stylebox("normal")->get_default_margin(MARGIN_LEFT) + get_theme_constant("hseparation", "Button")); if (type == "GradientTexture") { preview->set_stretch_mode(TextureRect::STRETCH_SCALE); assign->set_custom_minimum_size(Size2(1, 1)); @@ -2318,8 +2579,8 @@ void EditorPropertyResource::_update_menu_items() { menu->clear(); if (get_edited_property() == "script" && base_type == "Script" && Object::cast_to<Node>(get_edited_object())) { - menu->add_icon_item(get_icon("ScriptCreate", "EditorIcons"), TTR("New Script"), OBJ_MENU_NEW_SCRIPT); - menu->add_icon_item(get_icon("ScriptExtend", "EditorIcons"), TTR("Extend Script"), OBJ_MENU_EXTEND_SCRIPT); + menu->add_icon_item(get_theme_icon("ScriptCreate", "EditorIcons"), TTR("New Script"), OBJ_MENU_NEW_SCRIPT); + menu->add_icon_item(get_theme_icon("ScriptExtend", "EditorIcons"), TTR("Extend Script"), OBJ_MENU_EXTEND_SCRIPT); menu->add_separator(); } else if (base_type != "") { int idx = 0; @@ -2381,7 +2642,7 @@ void EditorPropertyResource::_update_menu_items() { inheritors_array.push_back(t); if (!icon.is_valid()) - icon = get_icon(has_icon(t, "EditorIcons") ? t : "Object", "EditorIcons"); + icon = get_theme_icon(has_theme_icon(t, "EditorIcons") ? t : "Object", "EditorIcons"); int id = TYPE_BASE_ID + idx; menu->add_icon_item(icon, vformat(TTR("New %s"), t), id); @@ -2394,14 +2655,14 @@ void EditorPropertyResource::_update_menu_items() { menu->add_separator(); } - menu->add_icon_item(get_icon("Load", "EditorIcons"), TTR("Load"), OBJ_MENU_LOAD); + menu->add_icon_item(get_theme_icon("Load", "EditorIcons"), TTR("Load"), OBJ_MENU_LOAD); if (!res.is_null()) { - menu->add_icon_item(get_icon("Edit", "EditorIcons"), TTR("Edit"), OBJ_MENU_EDIT); - menu->add_icon_item(get_icon("Clear", "EditorIcons"), TTR("Clear"), OBJ_MENU_CLEAR); - menu->add_icon_item(get_icon("Duplicate", "EditorIcons"), TTR("Make Unique"), OBJ_MENU_MAKE_UNIQUE); - menu->add_icon_item(get_icon("Save", "EditorIcons"), TTR("Save"), OBJ_MENU_SAVE); + menu->add_icon_item(get_theme_icon("Edit", "EditorIcons"), TTR("Edit"), OBJ_MENU_EDIT); + menu->add_icon_item(get_theme_icon("Clear", "EditorIcons"), TTR("Clear"), OBJ_MENU_CLEAR); + menu->add_icon_item(get_theme_icon("Duplicate", "EditorIcons"), TTR("Make Unique"), OBJ_MENU_MAKE_UNIQUE); + menu->add_icon_item(get_theme_icon("Save", "EditorIcons"), TTR("Save"), OBJ_MENU_SAVE); RES r = res; if (r.is_valid() && r->get_path().is_resource_file()) { menu->add_separator(); @@ -2445,12 +2706,12 @@ void EditorPropertyResource::_update_menu_items() { for (int i = 0; i < conversions.size(); i++) { String what = conversions[i]->converts_to(); Ref<Texture2D> icon; - if (has_icon(what, "EditorIcons")) { + if (has_theme_icon(what, "EditorIcons")) { - icon = get_icon(what, "EditorIcons"); + icon = get_theme_icon(what, "EditorIcons"); } else { - icon = get_icon(what, "Resource"); + icon = get_theme_icon(what, "Resource"); } menu->add_icon_item(icon, vformat(TTR("Convert To %s"), what), CONVERT_BASE_ID + i); @@ -2462,11 +2723,11 @@ void EditorPropertyResource::_update_menu() { _update_menu_items(); - Rect2 gt = edit->get_global_rect(); + Rect2 gt = edit->get_screen_rect(); menu->set_as_minsize(); - int ms = menu->get_combined_minimum_size().width; + int ms = menu->get_contents_minimum_size().width; Vector2 popup_pos = gt.position + gt.size - Vector2(ms, 0); - menu->set_global_position(popup_pos); + menu->set_position(popup_pos); menu->popup(); } @@ -2490,10 +2751,10 @@ void EditorPropertyResource::_button_input(const Ref<InputEvent> &p_event) { if (mb.is_valid()) { if (mb->is_pressed() && mb->get_button_index() == BUTTON_RIGHT) { _update_menu_items(); - Vector2 pos = mb->get_global_position(); + Vector2 pos = get_screen_position() + mb->get_position(); //pos = assign->get_global_transform().xform(pos); menu->set_as_minsize(); - menu->set_global_position(pos); + menu->set_position(pos); menu->popup(); } } @@ -2598,10 +2859,10 @@ void EditorPropertyResource::update_property() { sub_inspector->refresh(); } else { if (sub_inspector) { - set_bottom_editor(NULL); + set_bottom_editor(nullptr); memdelete(sub_inspector_vbox); - sub_inspector = NULL; - sub_inspector_vbox = NULL; + sub_inspector = nullptr; + sub_inspector_vbox = nullptr; if (opened_editor) { EditorNode::get_singleton()->hide_top_editors(); opened_editor = false; @@ -2663,7 +2924,7 @@ void EditorPropertyResource::setup(const String &p_base_type) { void EditorPropertyResource::_notification(int p_what) { if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED) { - Ref<Texture2D> t = get_icon("select_arrow", "Tree"); + Ref<Texture2D> t = get_theme_icon("select_arrow", "Tree"); edit->set_icon(t); } @@ -2718,7 +2979,7 @@ void EditorPropertyResource::expand_all_folding() { void EditorPropertyResource::_button_draw() { if (dropping) { - Color color = get_color("accent_color", "Editor"); + Color color = get_theme_color("accent_color", "Editor"); assign->draw_rect(Rect2(Point2(), assign->get_size()), color, false); } } @@ -2823,8 +3084,8 @@ void EditorPropertyResource::_bind_methods() { EditorPropertyResource::EditorPropertyResource() { opened_editor = false; - sub_inspector = NULL; - sub_inspector_vbox = NULL; + sub_inspector = nullptr; + sub_inspector_vbox = nullptr; use_sub_inspector = bool(EDITOR_GET("interface/inspector/open_resources_in_current_inspector")); HBoxContainer *hbc = memnew(HBoxContainer); @@ -2860,8 +3121,8 @@ EditorPropertyResource::EditorPropertyResource() { edit->connect("gui_input", callable_mp(this, &EditorPropertyResource::_button_input)); add_focusable(edit); - file = NULL; - scene_tree = NULL; + file = nullptr; + scene_tree = nullptr; dropping = false; add_to_group("_editor_resource_properties"); @@ -2877,7 +3138,7 @@ void EditorInspectorDefaultPlugin::parse_begin(Object *p_object) { //do none } -bool EditorInspectorDefaultPlugin::parse_property(Object *p_object, Variant::Type p_type, const String &p_path, PropertyHint p_hint, const String &p_hint_text, int p_usage) { +bool EditorInspectorDefaultPlugin::parse_property(Object *p_object, Variant::Type p_type, const String &p_path, PropertyHint p_hint, const String &p_hint_text, int p_usage, bool p_wide) { float default_float_step = EDITOR_GET("interface/inspector/default_float_step"); @@ -3083,7 +3344,7 @@ bool EditorInspectorDefaultPlugin::parse_property(Object *p_object, Variant::Typ // math types case Variant::VECTOR2: { - EditorPropertyVector2 *editor = memnew(EditorPropertyVector2); + EditorPropertyVector2 *editor = memnew(EditorPropertyVector2(p_wide)); double min = -65535, max = 65535, step = default_float_step; bool hide_slider = true; @@ -3100,8 +3361,23 @@ bool EditorInspectorDefaultPlugin::parse_property(Object *p_object, Variant::Typ add_property_editor(p_path, editor); } break; + case Variant::VECTOR2I: { + EditorPropertyVector2i *editor = memnew(EditorPropertyVector2i(p_wide)); + int min = -65535, max = 65535; + bool hide_slider = true; + + if (p_hint == PROPERTY_HINT_RANGE && p_hint_text.get_slice_count(",") >= 2) { + min = p_hint_text.get_slice(",", 0).to_double(); + max = p_hint_text.get_slice(",", 1).to_double(); + hide_slider = false; + } + + editor->setup(min, max, hide_slider); + add_property_editor(p_path, editor); + + } break; case Variant::RECT2: { - EditorPropertyRect2 *editor = memnew(EditorPropertyRect2); + EditorPropertyRect2 *editor = memnew(EditorPropertyRect2(p_wide)); double min = -65535, max = 65535, step = default_float_step; bool hide_slider = true; @@ -3117,8 +3393,22 @@ bool EditorInspectorDefaultPlugin::parse_property(Object *p_object, Variant::Typ editor->setup(min, max, step, hide_slider); add_property_editor(p_path, editor); } break; + case Variant::RECT2I: { + EditorPropertyRect2i *editor = memnew(EditorPropertyRect2i(p_wide)); + int min = -65535, max = 65535; + bool hide_slider = true; + + if (p_hint == PROPERTY_HINT_RANGE && p_hint_text.get_slice_count(",") >= 2) { + min = p_hint_text.get_slice(",", 0).to_double(); + max = p_hint_text.get_slice(",", 1).to_double(); + hide_slider = false; + } + + editor->setup(min, max, hide_slider); + add_property_editor(p_path, editor); + } break; case Variant::VECTOR3: { - EditorPropertyVector3 *editor = memnew(EditorPropertyVector3); + EditorPropertyVector3 *editor = memnew(EditorPropertyVector3(p_wide)); double min = -65535, max = 65535, step = default_float_step; bool hide_slider = true; @@ -3135,6 +3425,22 @@ bool EditorInspectorDefaultPlugin::parse_property(Object *p_object, Variant::Typ add_property_editor(p_path, editor); } break; + case Variant::VECTOR3I: { + EditorPropertyVector3i *editor = memnew(EditorPropertyVector3i(p_wide)); + int min = -65535, max = 65535; + bool hide_slider = true; + + if (p_hint == PROPERTY_HINT_RANGE && p_hint_text.get_slice_count(",") >= 2) { + min = p_hint_text.get_slice(",", 0).to_double(); + max = p_hint_text.get_slice(",", 1).to_double(); + + hide_slider = false; + } + + editor->setup(min, max, hide_slider); + add_property_editor(p_path, editor); + + } break; case Variant::TRANSFORM2D: { EditorPropertyTransform2D *editor = memnew(EditorPropertyTransform2D); double min = -65535, max = 65535, step = default_float_step; @@ -3154,7 +3460,7 @@ bool EditorInspectorDefaultPlugin::parse_property(Object *p_object, Variant::Typ } break; case Variant::PLANE: { - EditorPropertyPlane *editor = memnew(EditorPropertyPlane); + EditorPropertyPlane *editor = memnew(EditorPropertyPlane(p_wide)); double min = -65535, max = 65535, step = default_float_step; bool hide_slider = true; diff --git a/editor/editor_properties.h b/editor/editor_properties.h index c5fc8aaf77..61c11f4534 100644 --- a/editor/editor_properties.h +++ b/editor/editor_properties.h @@ -361,7 +361,7 @@ protected: public: virtual void update_property(); void setup(double p_min, double p_max, double p_step, bool p_no_slider); - EditorPropertyVector2(); + EditorPropertyVector2(bool p_force_wide = false); }; class EditorPropertyRect2 : public EditorProperty { @@ -377,7 +377,7 @@ protected: public: virtual void update_property(); void setup(double p_min, double p_max, double p_step, bool p_no_slider); - EditorPropertyRect2(); + EditorPropertyRect2(bool p_force_wide = false); }; class EditorPropertyVector3 : public EditorProperty { @@ -393,7 +393,55 @@ protected: public: virtual void update_property(); void setup(double p_min, double p_max, double p_step, bool p_no_slider); - EditorPropertyVector3(); + EditorPropertyVector3(bool p_force_wide = false); +}; + +class EditorPropertyVector2i : public EditorProperty { + GDCLASS(EditorPropertyVector2i, EditorProperty); + EditorSpinSlider *spin[2]; + bool setting; + void _value_changed(double p_val, const String &p_name); + +protected: + void _notification(int p_what); + static void _bind_methods(); + +public: + virtual void update_property(); + void setup(int p_min, int p_max, bool p_no_slider); + EditorPropertyVector2i(bool p_force_wide = false); +}; + +class EditorPropertyRect2i : public EditorProperty { + GDCLASS(EditorPropertyRect2i, EditorProperty); + EditorSpinSlider *spin[4]; + bool setting; + void _value_changed(double p_val, const String &p_name); + +protected: + void _notification(int p_what); + static void _bind_methods(); + +public: + virtual void update_property(); + void setup(int p_min, int p_max, bool p_no_slider); + EditorPropertyRect2i(bool p_force_wide = false); +}; + +class EditorPropertyVector3i : public EditorProperty { + GDCLASS(EditorPropertyVector3i, EditorProperty); + EditorSpinSlider *spin[3]; + bool setting; + void _value_changed(double p_val, const String &p_name); + +protected: + void _notification(int p_what); + static void _bind_methods(); + +public: + virtual void update_property(); + void setup(int p_min, int p_max, bool p_no_slider); + EditorPropertyVector3i(bool p_force_wide = false); }; class EditorPropertyPlane : public EditorProperty { @@ -409,7 +457,7 @@ protected: public: virtual void update_property(); void setup(double p_min, double p_max, double p_step, bool p_no_slider); - EditorPropertyPlane(); + EditorPropertyPlane(bool p_force_wide = false); }; class EditorPropertyQuat : public EditorProperty { @@ -626,7 +674,7 @@ class EditorInspectorDefaultPlugin : public EditorInspectorPlugin { public: virtual bool can_handle(Object *p_object); virtual void parse_begin(Object *p_object); - virtual bool parse_property(Object *p_object, Variant::Type p_type, const String &p_path, PropertyHint p_hint, const String &p_hint_text, int p_usage); + virtual bool parse_property(Object *p_object, Variant::Type p_type, const String &p_path, PropertyHint p_hint, const String &p_hint_text, int p_usage, bool p_wide = false); virtual void parse_end(); }; diff --git a/editor/editor_properties_array_dict.cpp b/editor/editor_properties_array_dict.cpp index c2a6aeb582..fdd5bd8db6 100644 --- a/editor/editor_properties_array_dict.cpp +++ b/editor/editor_properties_array_dict.cpp @@ -184,9 +184,9 @@ void EditorPropertyArray::_change_type(Object *p_button, int p_index) { Button *button = Object::cast_to<Button>(p_button); changing_type_idx = p_index; - Rect2 rect = button->get_global_rect(); + Rect2 rect = button->get_screen_rect(); change_type->set_as_minsize(); - change_type->set_global_position(rect.position + rect.size - Vector2(change_type->get_combined_minimum_size().x, 0)); + change_type->set_position(rect.position + rect.size - Vector2(change_type->get_contents_minimum_size().x, 0)); change_type->popup(); } @@ -199,7 +199,7 @@ void EditorPropertyArray::_change_type_menu(int p_index) { Variant value; Callable::CallError ce; - value = Variant::construct(Variant::Type(p_index), NULL, 0, ce); + value = Variant::construct(Variant::Type(p_index), nullptr, 0, ce); Variant array = object->get_array(); array.set(changing_type_idx, value); @@ -263,9 +263,9 @@ void EditorPropertyArray::update_property() { edit->set_text(String("(Nil) ") + arrtype); edit->set_pressed(false); if (vbox) { - set_bottom_editor(NULL); + set_bottom_editor(nullptr); memdelete(vbox); - vbox = NULL; + vbox = nullptr; } return; } @@ -340,7 +340,7 @@ void EditorPropertyArray::update_property() { for (int i = 0; i < amount; i++) { String prop_name = "indices/" + itos(i + offset); - EditorProperty *prop = NULL; + EditorProperty *prop = nullptr; Variant value = array.get(i + offset); Variant::Type value_type = value.get_type(); @@ -353,7 +353,7 @@ void EditorPropertyArray::update_property() { editor->setup("Object"); prop = editor; } else { - prop = EditorInspector::instantiate_property_editor(NULL, value_type, "", subtype_hint, subtype_hint_string, 0); + prop = EditorInspector::instantiate_property_editor(nullptr, value_type, "", subtype_hint, subtype_hint_string, 0); } prop->set_object_and_property(object.ptr(), prop_name); @@ -373,13 +373,13 @@ void EditorPropertyArray::update_property() { if (is_untyped_array) { Button *edit = memnew(Button); - edit->set_icon(get_icon("Edit", "EditorIcons")); + edit->set_icon(get_theme_icon("Edit", "EditorIcons")); hb->add_child(edit); edit->connect("pressed", callable_mp(this, &EditorPropertyArray::_change_type), varray(edit, i + offset)); } else { Button *remove = memnew(Button); - remove->set_icon(get_icon("Remove", "EditorIcons")); + remove->set_icon(get_theme_icon("Remove", "EditorIcons")); remove->connect("pressed", callable_mp(this, &EditorPropertyArray::_remove_pressed), varray(i + offset)); hb->add_child(remove); } @@ -391,9 +391,9 @@ void EditorPropertyArray::update_property() { } else { if (vbox) { - set_bottom_editor(NULL); + set_bottom_editor(nullptr); memdelete(vbox); - vbox = NULL; + vbox = nullptr; } } } @@ -419,7 +419,7 @@ void EditorPropertyArray::_edit_pressed() { Variant array = get_edited_object()->get(get_edited_property()); if (!array.is_array()) { Callable::CallError ce; - array = Variant::construct(array_type, NULL, 0, ce); + array = Variant::construct(array_type, nullptr, 0, ce); get_edited_object()->set(get_edited_property(), array); } @@ -450,7 +450,7 @@ void EditorPropertyArray::_length_changed(double p_page) { for (int i = previous_size; i < size; i++) { if (array.get(i).get_type() == Variant::NIL) { Callable::CallError ce; - array.set(i, Variant::construct(subtype, NULL, 0, ce)); + array.set(i, Variant::construct(subtype, nullptr, 0, ce)); } } } @@ -460,7 +460,7 @@ void EditorPropertyArray::_length_changed(double p_page) { // Pool*Array don't initialize their elements, have to do it manually for (int i = previous_size; i < size; i++) { Callable::CallError ce; - array.set(i, Variant::construct(array.get(i).get_type(), NULL, 0, ce)); + array.set(i, Variant::construct(array.get(i).get_type(), nullptr, 0, ce)); } } @@ -505,9 +505,9 @@ EditorPropertyArray::EditorPropertyArray() { edit->set_toggle_mode(true); add_child(edit); add_focusable(edit); - vbox = NULL; - page = NULL; - length = NULL; + vbox = nullptr; + page = nullptr; + length = nullptr; updating = false; change_type = memnew(PopupMenu); add_child(change_type); @@ -553,9 +553,9 @@ void EditorPropertyDictionary::_change_type(Object *p_button, int p_index) { Button *button = Object::cast_to<Button>(p_button); - Rect2 rect = button->get_global_rect(); + Rect2 rect = button->get_screen_rect(); change_type->set_as_minsize(); - change_type->set_global_position(rect.position + rect.size - Vector2(change_type->get_combined_minimum_size().x, 0)); + change_type->set_position(rect.position + rect.size - Vector2(change_type->get_contents_minimum_size().x, 0)); change_type->popup(); changing_type_idx = p_index; } @@ -585,7 +585,7 @@ void EditorPropertyDictionary::_change_type_menu(int p_index) { if (changing_type_idx < 0) { Variant value; Callable::CallError ce; - value = Variant::construct(Variant::Type(p_index), NULL, 0, ce); + value = Variant::construct(Variant::Type(p_index), nullptr, 0, ce); if (changing_type_idx == -1) { object->set_new_item_key(value); } else { @@ -601,7 +601,7 @@ void EditorPropertyDictionary::_change_type_menu(int p_index) { Variant value; Callable::CallError ce; - value = Variant::construct(Variant::Type(p_index), NULL, 0, ce); + value = Variant::construct(Variant::Type(p_index), nullptr, 0, ce); Variant key = dict.get_key_at_index(changing_type_idx); dict[key] = value; } else { @@ -624,9 +624,9 @@ void EditorPropertyDictionary::update_property() { edit->set_text("Dictionary (Nil)"); //This provides symmetry with the array property. edit->set_pressed(false); if (vbox) { - set_bottom_editor(NULL); + set_bottom_editor(nullptr); memdelete(vbox); - vbox = NULL; + vbox = nullptr; } return; } @@ -683,7 +683,7 @@ void EditorPropertyDictionary::update_property() { dict = dict.duplicate(); object->set_dict(dict); - VBoxContainer *add_vbox = NULL; + VBoxContainer *add_vbox = nullptr; for (int i = 0; i < amount + 2; i++) { String prop_name; @@ -702,7 +702,7 @@ void EditorPropertyDictionary::update_property() { value = object->get_new_item_value(); } - EditorProperty *prop = NULL; + EditorProperty *prop = nullptr; switch (value.get_type()) { case Variant::NIL: { @@ -742,6 +742,13 @@ void EditorPropertyDictionary::update_property() { prop = editor; } break; + case Variant::VECTOR2I: { + + EditorPropertyVector2i *editor = memnew(EditorPropertyVector2i); + editor->setup(-100000, 100000, true); + prop = editor; + + } break; case Variant::RECT2: { EditorPropertyRect2 *editor = memnew(EditorPropertyRect2); @@ -749,6 +756,13 @@ void EditorPropertyDictionary::update_property() { prop = editor; } break; + case Variant::RECT2I: { + + EditorPropertyRect2i *editor = memnew(EditorPropertyRect2i); + editor->setup(-100000, 100000, true); + prop = editor; + + } break; case Variant::VECTOR3: { EditorPropertyVector3 *editor = memnew(EditorPropertyVector3); @@ -756,6 +770,13 @@ void EditorPropertyDictionary::update_property() { prop = editor; } break; + case Variant::VECTOR3I: { + + EditorPropertyVector3i *editor = memnew(EditorPropertyVector3i); + editor->setup(-100000, 100000, true); + prop = editor; + + } break; case Variant::TRANSFORM2D: { EditorPropertyTransform2D *editor = memnew(EditorPropertyTransform2D); @@ -909,9 +930,9 @@ void EditorPropertyDictionary::update_property() { for (int j = 0; j < 4; j++) { flat->set_default_margin(Margin(j), 2 * EDSCALE); } - flat->set_bg_color(get_color("prop_subsection", "Editor")); + flat->set_bg_color(get_theme_color("prop_subsection", "Editor")); - pc->add_style_override("panel", flat); + pc->add_theme_style_override("panel", flat); add_vbox = memnew(VBoxContainer); pc->add_child(add_vbox); } @@ -944,7 +965,7 @@ void EditorPropertyDictionary::update_property() { hb->add_child(prop); prop->set_h_size_flags(SIZE_EXPAND_FILL); Button *edit = memnew(Button); - edit->set_icon(get_icon("Edit", "EditorIcons")); + edit->set_icon(get_theme_icon("Edit", "EditorIcons")); hb->add_child(edit); edit->connect("pressed", callable_mp(this, &EditorPropertyDictionary::_change_type), varray(edit, change_index)); @@ -962,9 +983,9 @@ void EditorPropertyDictionary::update_property() { } else { if (vbox) { - set_bottom_editor(NULL); + set_bottom_editor(nullptr); memdelete(vbox); - vbox = NULL; + vbox = nullptr; } } } @@ -981,7 +1002,7 @@ void EditorPropertyDictionary::_edit_pressed() { Variant prop_val = get_edited_object()->get(get_edited_property()); if (prop_val.get_type() == Variant::NIL) { Callable::CallError ce; - prop_val = Variant::construct(Variant::DICTIONARY, NULL, 0, ce); + prop_val = Variant::construct(Variant::DICTIONARY, nullptr, 0, ce); get_edited_object()->set(get_edited_property(), prop_val); } @@ -1012,8 +1033,8 @@ EditorPropertyDictionary::EditorPropertyDictionary() { edit->set_toggle_mode(true); add_child(edit); add_focusable(edit); - vbox = NULL; - page = NULL; + vbox = nullptr; + page = nullptr; updating = false; change_type = memnew(PopupMenu); add_child(change_type); diff --git a/editor/editor_resource_preview.cpp b/editor/editor_resource_preview.cpp index 98bc544478..2a4300f833 100644 --- a/editor/editor_resource_preview.cpp +++ b/editor/editor_resource_preview.cpp @@ -99,7 +99,7 @@ void EditorResourcePreviewGenerator::_bind_methods() { EditorResourcePreviewGenerator::EditorResourcePreviewGenerator() { } -EditorResourcePreview *EditorResourcePreview::singleton = NULL; +EditorResourcePreview *EditorResourcePreview::singleton = nullptr; void EditorResourcePreview::_thread_func(void *ud) { @@ -168,7 +168,7 @@ void EditorResourcePreview::_generate_preview(Ref<ImageTexture> &r_texture, Ref< } r_texture = generated; - int small_thumbnail_size = EditorNode::get_singleton()->get_theme_base()->get_icon("Object", "EditorIcons")->get_width(); // Kind of a workaround to retrieve the default icon size + int small_thumbnail_size = EditorNode::get_singleton()->get_theme_base()->get_theme_icon("Object", "EditorIcons")->get_width(); // Kind of a workaround to retrieve the default icon size small_thumbnail_size *= EDSCALE; if (preview_generators[i]->can_generate_small_preview()) { @@ -465,16 +465,16 @@ void EditorResourcePreview::stop() { preview_sem.post(); while (!exited) { OS::get_singleton()->delay_usec(10000); - VisualServer::get_singleton()->sync(); //sync pending stuff, as thread may be blocked on visual server + RenderingServer::get_singleton()->sync(); //sync pending stuff, as thread may be blocked on visual server } Thread::wait_to_finish(thread); memdelete(thread); - thread = NULL; + thread = nullptr; } } EditorResourcePreview::EditorResourcePreview() { - thread = NULL; + thread = nullptr; singleton = this; order = 0; exit = false; diff --git a/editor/editor_run.cpp b/editor/editor_run.cpp index 9f0e1f2349..b4ddb7ebfa 100644 --- a/editor/editor_run.cpp +++ b/editor/editor_run.cpp @@ -32,6 +32,7 @@ #include "core/project_settings.h" #include "editor_settings.h" +#include "servers/display_server.h" EditorRun::Status EditorRun::get_status() const { @@ -70,19 +71,19 @@ Error EditorRun::run(const String &p_scene, const String &p_custom_args, const L int screen = EditorSettings::get_singleton()->get("run/window_placement/screen"); if (screen == 0) { // Same as editor - screen = OS::get_singleton()->get_current_screen(); + screen = DisplayServer::get_singleton()->window_get_current_screen(); } else if (screen == 1) { // Previous monitor (wrap to the other end if needed) screen = Math::wrapi( - OS::get_singleton()->get_current_screen() - 1, + DisplayServer::get_singleton()->window_get_current_screen() - 1, 0, - OS::get_singleton()->get_screen_count()); + DisplayServer::get_singleton()->get_screen_count()); } else if (screen == 2) { // Next monitor (wrap to the other end if needed) screen = Math::wrapi( - OS::get_singleton()->get_current_screen() + 1, + DisplayServer::get_singleton()->window_get_current_screen() + 1, 0, - OS::get_singleton()->get_screen_count()); + DisplayServer::get_singleton()->get_screen_count()); } else { // Fixed monitor ID // There are 3 special options, so decrement the option ID by 3 to get the monitor ID @@ -94,8 +95,8 @@ Error EditorRun::run(const String &p_scene, const String &p_custom_args, const L } Rect2 screen_rect; - screen_rect.position = OS::get_singleton()->get_screen_position(screen); - screen_rect.size = OS::get_singleton()->get_screen_size(screen); + screen_rect.position = DisplayServer::get_singleton()->screen_get_position(screen); + screen_rect.size = DisplayServer::get_singleton()->screen_get_size(screen); Size2 desired_size; desired_size.x = ProjectSettings::get_singleton()->get("display/window/size/width"); @@ -120,7 +121,9 @@ Error EditorRun::run(const String &p_scene, const String &p_custom_args, const L case 1: { // centered int display_scale = 1; #ifdef OSX_ENABLED - if (OS::get_singleton()->get_screen_dpi(screen) >= 192 && OS::get_singleton()->get_screen_size(screen).x > 2000) { + display_scale = DisplayServer::get_singleton()->screen_get_scale(screen); +#else + if (DisplayServer::get_singleton()->screen_get_dpi(screen) >= 192 && DisplayServer::get_singleton()->screen_get_size(screen).x > 2000) { display_scale = 2; } #endif diff --git a/editor/editor_run_script.cpp b/editor/editor_run_script.cpp index 628055cac6..c03fd4f6f5 100644 --- a/editor/editor_run_script.cpp +++ b/editor/editor_run_script.cpp @@ -56,7 +56,7 @@ Node *EditorScript::get_scene() { if (!editor) { EditorNode::add_io_error("EditorScript::get_scene: " + TTR("Write your logic in the _run() method.")); - return NULL; + return nullptr; } return editor->get_edited_scene(); @@ -73,7 +73,7 @@ void EditorScript::_run() { Callable::CallError ce; ce.error = Callable::CallError::CALL_OK; - get_script_instance()->call("_run", NULL, 0, ce); + get_script_instance()->call("_run", nullptr, 0, ce); if (ce.error != Callable::CallError::CALL_OK) { EditorNode::add_io_error(TTR("Couldn't run script:") + "\n " + s->get_path() + "\n" + TTR("Did you forget the '_run' method?")); @@ -95,5 +95,5 @@ void EditorScript::_bind_methods() { EditorScript::EditorScript() { - editor = NULL; + editor = nullptr; } diff --git a/editor/editor_sectioned_inspector.cpp b/editor/editor_sectioned_inspector.cpp index fe28efedeb..bccc38ca1b 100644 --- a/editor/editor_sectioned_inspector.cpp +++ b/editor/editor_sectioned_inspector.cpp @@ -127,7 +127,7 @@ public: } SectionedInspectorFilter() { - edited = NULL; + edited = nullptr; } }; @@ -142,7 +142,7 @@ void SectionedInspector::_section_selected() { return; selected_category = sections->get_selected()->get_metadata(0); - filter->set_section(selected_category, sections->get_selected()->get_children() == NULL); + filter->set_section(selected_category, sections->get_selected()->get_children() == nullptr); inspector->set_property_prefix(selected_category + "/"); } @@ -177,8 +177,8 @@ void SectionedInspector::edit(Object *p_object) { obj = ObjectID(); sections->clear(); - filter->set_edited(NULL); - inspector->edit(NULL); + filter->set_edited(nullptr); + inspector->edit(nullptr); return; } @@ -257,7 +257,7 @@ void SectionedInspector::update_category_list() { for (int i = 0; i < sc; i++) { TreeItem *parent = section_map[metasection]; - parent->set_custom_bg_color(0, get_color("prop_subsection", "Editor")); + parent->set_custom_bg_color(0, get_theme_color("prop_subsection", "Editor")); if (i > 0) { metasection += "/" + sectionarr[i]; @@ -308,8 +308,8 @@ SectionedInspector::SectionedInspector() : sections(memnew(Tree)), filter(memnew(SectionedInspectorFilter)), inspector(memnew(EditorInspector)), - search_box(NULL) { - add_constant_override("autohide", 1); // Fixes the dragger always showing up + search_box(nullptr) { + add_theme_constant_override("autohide", 1); // Fixes the dragger always showing up VBoxContainer *left_vb = memnew(VBoxContainer); left_vb->set_custom_minimum_size(Size2(190, 0) * EDSCALE); diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp index a32b736851..9b58c18f51 100644 --- a/editor/editor_settings.cpp +++ b/editor/editor_settings.cpp @@ -49,11 +49,11 @@ #include "editor/editor_translations.gen.h" #include "scene/main/node.h" #include "scene/main/scene_tree.h" -#include "scene/main/viewport.h" +#include "scene/main/window.h" // PRIVATE METHODS -Ref<EditorSettings> EditorSettings::singleton = NULL; +Ref<EditorSettings> EditorSettings::singleton = nullptr; // Properties @@ -177,7 +177,7 @@ void EditorSettings::_get_property_list(List<PropertyInfo> *p_list) const { _THREAD_SAFE_METHOD_ - const String *k = NULL; + const String *k = nullptr; Set<_EVCSort> vclist; while ((k = props.next(k))) { @@ -341,6 +341,8 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) { hints["interface/editor/unfocused_low_processor_mode_sleep_usec"] = PropertyInfo(Variant::FLOAT, "interface/editor/unfocused_low_processor_mode_sleep_usec", PROPERTY_HINT_RANGE, "1,100000,1", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED); _initial_set("interface/editor/separate_distraction_mode", false); _initial_set("interface/editor/automatically_open_screenshots", true); + _initial_set("interface/editor/single_window_mode", false); + hints["interface/editor/single_window_mode"] = PropertyInfo(Variant::BOOL, "interface/editor/single_window_mode", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED); _initial_set("interface/editor/hide_console_window", false); _initial_set("interface/editor/save_each_scene_on_quit", true); // Regression _initial_set("interface/editor/quit_confirmation", true); @@ -557,6 +559,8 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) { hints["editors/3d/navigation_feel/manipulation_translation_inertia"] = PropertyInfo(Variant::FLOAT, "editors/3d/navigation_feel/manipulation_translation_inertia", PROPERTY_HINT_RANGE, "0.0, 1, 0.01"); // 3D: Freelook + _initial_set("editors/3d/freelook/freelook_navigation_scheme", false); + hints["editors/3d/freelook/freelook_navigation_scheme"] = PropertyInfo(Variant::INT, "editors/3d/freelook/freelook_navigation_scheme", PROPERTY_HINT_ENUM, "Default,Partially Axis-Locked (id Tech),Fully Axis-Locked (Minecraft)"); _initial_set("editors/3d/freelook/freelook_inertia", 0.1); hints["editors/3d/freelook/freelook_inertia"] = PropertyInfo(Variant::FLOAT, "editors/3d/freelook/freelook_inertia", PROPERTY_HINT_RANGE, "0.0, 1, 0.01"); _initial_set("editors/3d/freelook/freelook_base_speed", 5.0); @@ -599,7 +603,7 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) { _initial_set("run/window_placement/rect", 1); hints["run/window_placement/rect"] = PropertyInfo(Variant::INT, "run/window_placement/rect", PROPERTY_HINT_ENUM, "Top Left,Centered,Custom Position,Force Maximized,Force Fullscreen"); String screen_hints = "Same as Editor,Previous Monitor,Next Monitor"; - for (int i = 0; i < OS::get_singleton()->get_screen_count(); i++) { + for (int i = 0; i < DisplayServer::get_singleton()->get_screen_count(); i++) { screen_hints += ",Monitor " + itos(i + 1); } _initial_set("run/window_placement/rect_custom_position", Vector2()); @@ -778,7 +782,7 @@ void EditorSettings::create() { if (singleton.ptr()) return; //pointless - DirAccess *dir = NULL; + DirAccess *dir = nullptr; String data_path; String data_dir; @@ -1524,7 +1528,7 @@ void EditorSettings::get_shortcut_list(List<String> *r_shortcuts) { Ref<ShortCut> ED_GET_SHORTCUT(const String &p_path) { if (!EditorSettings::get_singleton()) { - return NULL; + return nullptr; } Ref<ShortCut> sc = EditorSettings::get_singleton()->get_shortcut(p_path); diff --git a/editor/editor_spin_slider.cpp b/editor/editor_spin_slider.cpp index 0ede0a3b7a..4eefe844d2 100644 --- a/editor/editor_spin_slider.cpp +++ b/editor/editor_spin_slider.cpp @@ -29,8 +29,9 @@ /*************************************************************************/ #include "editor_spin_slider.h" + +#include "core/input/input_filter.h" #include "core/math/expression.h" -#include "core/os/input.h" #include "editor_node.h" #include "editor_scale.h" @@ -67,7 +68,7 @@ void EditorSpinSlider::_gui_input(const Ref<InputEvent> &p_event) { grabbing_spinner_dist_cache = 0; pre_grab_value = get_value(); grabbing_spinner = false; - grabbing_spinner_mouse_pos = Input::get_singleton()->get_mouse_position(); + grabbing_spinner_mouse_pos = InputFilter::get_singleton()->get_mouse_position(); } } else { @@ -75,8 +76,8 @@ void EditorSpinSlider::_gui_input(const Ref<InputEvent> &p_event) { if (grabbing_spinner) { - Input::get_singleton()->set_mouse_mode(Input::MOUSE_MODE_VISIBLE); - Input::get_singleton()->warp_mouse_position(grabbing_spinner_mouse_pos); + InputFilter::get_singleton()->set_mouse_mode(InputFilter::MOUSE_MODE_VISIBLE); + InputFilter::get_singleton()->warp_mouse_position(grabbing_spinner_mouse_pos); update(); } else { _focus_entered(); @@ -105,7 +106,7 @@ void EditorSpinSlider::_gui_input(const Ref<InputEvent> &p_event) { grabbing_spinner_dist_cache += diff_x; if (!grabbing_spinner && ABS(grabbing_spinner_dist_cache) > 4 * EDSCALE) { - Input::get_singleton()->set_mouse_mode(Input::MOUSE_MODE_CAPTURED); + InputFilter::get_singleton()->set_mouse_mode(InputFilter::MOUSE_MODE_CAPTURED); grabbing_spinner = true; } @@ -176,11 +177,11 @@ void EditorSpinSlider::_grabber_gui_input(const Ref<InputEvent> &p_event) { void EditorSpinSlider::_notification(int p_what) { - if (p_what == MainLoop::NOTIFICATION_WM_FOCUS_OUT || - p_what == MainLoop::NOTIFICATION_WM_FOCUS_IN || + if (p_what == NOTIFICATION_WM_FOCUS_OUT || + p_what == NOTIFICATION_WM_FOCUS_IN || p_what == NOTIFICATION_EXIT_TREE) { if (grabbing_spinner) { - Input::get_singleton()->set_mouse_mode(Input::MOUSE_MODE_VISIBLE); + InputFilter::get_singleton()->set_mouse_mode(InputFilter::MOUSE_MODE_VISIBLE); grabbing_spinner = false; grabbing_spinner_attempt = false; } @@ -191,30 +192,30 @@ void EditorSpinSlider::_notification(int p_what) { // when it's edited. The LineEdit "focus" stylebox uses the "normal" stylebox's // default margins. Ref<StyleBoxFlat> stylebox = - EditorNode::get_singleton()->get_theme_base()->get_stylebox("normal", "LineEdit")->duplicate(); + EditorNode::get_singleton()->get_theme_base()->get_theme_stylebox("normal", "LineEdit")->duplicate(); // EditorSpinSliders with a label have more space on the left, so add an // higher margin to match the location where the text begins. // The margin values below were determined by empirical testing. stylebox->set_default_margin(MARGIN_LEFT, (get_label() != String() ? 23 : 16) * EDSCALE); - value_input->add_style_override("normal", stylebox); + value_input->add_theme_style_override("normal", stylebox); } if (p_what == NOTIFICATION_DRAW) { updown_offset = -1; - Ref<StyleBox> sb = get_stylebox("normal", "LineEdit"); + Ref<StyleBox> sb = get_theme_stylebox("normal", "LineEdit"); if (!flat) { draw_style_box(sb, Rect2(Vector2(), get_size())); } - Ref<Font> font = get_font("font", "LineEdit"); + Ref<Font> font = get_theme_font("font", "LineEdit"); int sep_base = 4 * EDSCALE; int sep = sep_base + sb->get_offset().x; //make it have the same margin on both sides, looks better int string_width = font->get_string_size(label).width; int number_width = get_size().width - sb->get_minimum_size().width - string_width - sep; - Ref<Texture2D> updown = get_icon("updown", "SpinBox"); + Ref<Texture2D> updown = get_theme_icon("updown", "SpinBox"); if (get_step() == 1) { number_width -= updown->get_width(); @@ -224,7 +225,7 @@ void EditorSpinSlider::_notification(int p_what) { int vofs = (get_size().height - font->get_height()) / 2 + font->get_ascent(); - Color fc = get_color("font_color", "LineEdit"); + Color fc = get_theme_color("font_color", "LineEdit"); Color lc; if (use_custom_label_color) { lc = custom_label_color; @@ -233,12 +234,12 @@ void EditorSpinSlider::_notification(int p_what) { } if (flat && label != String()) { - Color label_bg_color = get_color("dark_color_3", "Editor"); + Color label_bg_color = get_theme_color("dark_color_3", "Editor"); draw_rect(Rect2(Vector2(), Vector2(sb->get_offset().x * 2 + string_width, get_size().height)), label_bg_color); } if (has_focus()) { - Ref<StyleBox> focus = get_stylebox("focus", "LineEdit"); + Ref<StyleBox> focus = get_theme_stylebox("focus", "LineEdit"); draw_style_box(focus, Rect2(Vector2(), get_size())); } @@ -247,7 +248,7 @@ void EditorSpinSlider::_notification(int p_what) { draw_string(font, Vector2(Math::round(sb->get_offset().x + string_width + sep), vofs), numstr, fc, number_width); if (get_step() == 1) { - Ref<Texture2D> updown2 = get_icon("updown", "SpinBox"); + Ref<Texture2D> updown2 = get_theme_icon("updown", "SpinBox"); int updown_vofs = (get_size().height - updown2->get_height()) / 2; updown_offset = get_size().width - sb->get_margin(MARGIN_RIGHT) - updown2->get_width(); Color c(1, 1, 1); @@ -272,7 +273,7 @@ void EditorSpinSlider::_notification(int p_what) { Rect2 grabber_rect = Rect2(ofs + gofs, svofs + 1, grabber_w, 2 * EDSCALE); draw_rect(grabber_rect, c); - bool display_grabber = (mouse_over_spin || mouse_over_grabber) && !grabbing_spinner && !value_input->is_visible(); + bool display_grabber = (mouse_over_spin || mouse_over_grabber) && !grabbing_spinner && !value_input_popup->is_visible(); if (grabber->is_visible() != display_grabber) { if (display_grabber) { grabber->show(); @@ -284,9 +285,9 @@ void EditorSpinSlider::_notification(int p_what) { if (display_grabber) { Ref<Texture2D> grabber_tex; if (mouse_over_grabber) { - grabber_tex = get_icon("grabber_highlight", "HSlider"); + grabber_tex = get_theme_icon("grabber_highlight", "HSlider"); } else { - grabber_tex = get_icon("grabber", "HSlider"); + grabber_tex = get_theme_icon("grabber", "HSlider"); } if (grabber->get_texture() != grabber_tex) { @@ -297,7 +298,7 @@ void EditorSpinSlider::_notification(int p_what) { grabber->set_position(get_global_position() + grabber_rect.position + grabber_rect.size * 0.5 - grabber->get_size() * 0.5); if (mousewheel_over_grabber) { - Input::get_singleton()->warp_mouse_position(grabber->get_position() + grabber_rect.size); + InputFilter::get_singleton()->warp_mouse_position(grabber->get_position() + grabber_rect.size); } grabber_range = width; @@ -316,12 +317,7 @@ void EditorSpinSlider::_notification(int p_what) { update(); } if (p_what == NOTIFICATION_FOCUS_ENTER) { - /* Sorry, I don't like this, it makes navigating the different fields with arrows more difficult. - * Just press enter to edit. - * if (Input::get_singleton()->is_mouse_button_pressed(BUTTON_LEFT) && !value_input_just_closed) { - _focus_entered(); - }*/ - if ((Input::get_singleton()->is_action_pressed("ui_focus_next") || Input::get_singleton()->is_action_pressed("ui_focus_prev")) && !value_input_just_closed) { + if ((InputFilter::get_singleton()->is_action_pressed("ui_focus_next") || InputFilter::get_singleton()->is_action_pressed("ui_focus_prev")) && !value_input_just_closed) { _focus_entered(); } value_input_just_closed = false; @@ -330,8 +326,8 @@ void EditorSpinSlider::_notification(int p_what) { Size2 EditorSpinSlider::get_minimum_size() const { - Ref<StyleBox> sb = get_stylebox("normal", "LineEdit"); - Ref<Font> font = get_font("font", "LineEdit"); + Ref<StyleBox> sb = get_theme_stylebox("normal", "LineEdit"); + Ref<Font> font = get_theme_font("font", "LineEdit"); Size2 ms = sb->get_minimum_size(); ms.height += font->get_height(); @@ -366,7 +362,7 @@ void EditorSpinSlider::_evaluate_input_text() { return; } - Variant v = expr->execute(Array(), NULL, false); + Variant v = expr->execute(Array(), nullptr, false); if (v.get_type() == Variant::NIL) return; set_value(v); @@ -375,7 +371,7 @@ void EditorSpinSlider::_evaluate_input_text() { //text_entered signal void EditorSpinSlider::_value_input_entered(const String &p_text) { value_input_just_closed = true; - value_input->hide(); + value_input_popup->hide(); } //modal_closed signal @@ -398,7 +394,7 @@ void EditorSpinSlider::_value_focus_exited() { // -> modal_close was not called // -> need to close/hide manually if (!value_input_just_closed) { //value_input_just_closed should do the same - value_input->hide(); + value_input_popup->hide(); //tab was pressed } else { //enter, click, esc @@ -441,11 +437,11 @@ void EditorSpinSlider::set_custom_label_color(bool p_use_custom_label_color, Col } void EditorSpinSlider::_focus_entered() { - Rect2 gr = get_global_rect(); + Rect2 gr = get_screen_rect(); value_input->set_text(get_text_value()); - value_input->set_position(gr.position); - value_input->set_size(gr.size); - value_input->call_deferred("show_modal"); + value_input_popup->set_position(gr.position); + value_input_popup->set_size(gr.size); + value_input_popup->call_deferred("popup"); value_input->call_deferred("grab_focus"); value_input->call_deferred("select_all"); value_input->set_focus_next(find_next_valid_focus()->get_path()); @@ -492,11 +488,13 @@ EditorSpinSlider::EditorSpinSlider() { mousewheel_over_grabber = false; grabbing_grabber = false; grabber_range = 1; + value_input_popup = memnew(Popup); + add_child(value_input_popup); value_input = memnew(LineEdit); - add_child(value_input); - value_input->set_as_toplevel(true); - value_input->hide(); - value_input->connect("modal_closed", callable_mp(this, &EditorSpinSlider::_value_input_closed)); + value_input_popup->add_child(value_input); + value_input_popup->set_wrap_controls(true); + value_input->set_anchors_and_margins_preset(PRESET_WIDE); + value_input_popup->connect("popup_hide", callable_mp(this, &EditorSpinSlider::_value_input_closed)); value_input->connect("text_entered", callable_mp(this, &EditorSpinSlider::_value_input_entered)); value_input->connect("focus_exited", callable_mp(this, &EditorSpinSlider::_value_focus_exited)); value_input_just_closed = false; diff --git a/editor/editor_spin_slider.h b/editor/editor_spin_slider.h index 81a7b981cc..db74f5fb70 100644 --- a/editor/editor_spin_slider.h +++ b/editor/editor_spin_slider.h @@ -62,6 +62,7 @@ class EditorSpinSlider : public Range { Vector2 grabbing_spinner_mouse_pos; double pre_grab_value; + Popup *value_input_popup; LineEdit *value_input; bool value_input_just_closed; diff --git a/editor/editor_sub_scene.cpp b/editor/editor_sub_scene.cpp index 3ebd8f0475..1205e0b37c 100644 --- a/editor/editor_sub_scene.cpp +++ b/editor/editor_sub_scene.cpp @@ -46,7 +46,7 @@ void EditorSubScene::_path_changed(const String &p_path) { if (scene) { memdelete(scene); - scene = NULL; + scene = nullptr; } if (p_path == "") @@ -61,7 +61,7 @@ void EditorSubScene::_path_changed(const String &p_path) { if (!scene) return; - _fill_tree(scene, NULL); + _fill_tree(scene, nullptr); } void EditorSubScene::_path_browse() { @@ -70,11 +70,11 @@ void EditorSubScene::_path_browse() { } void EditorSubScene::_notification(int p_what) { - if (p_what == NOTIFICATION_VISIBILITY_CHANGED) { - if (is_visible() && scene == NULL) + if (is_visible() && scene == nullptr) { _path_browse(); + } } } @@ -209,7 +209,7 @@ void EditorSubScene::move(Node *p_new_parent, Node *p_new_owner) { if (!is_root) { memdelete(scene); } - scene = NULL; + scene = nullptr; //return selnode; } @@ -226,7 +226,7 @@ void EditorSubScene::_bind_methods() { EditorSubScene::EditorSubScene() { - scene = NULL; + scene = nullptr; is_root = false; set_title(TTR("Select Node(s) to Import")); @@ -240,7 +240,7 @@ EditorSubScene::EditorSubScene() { path = memnew(LineEdit); path->connect("text_entered", callable_mp(this, &EditorSubScene::_path_changed)); hb->add_child(path); - path->set_h_size_flags(SIZE_EXPAND_FILL); + path->set_h_size_flags(Control::SIZE_EXPAND_FILL); Button *b = memnew(Button); b->set_text(TTR("Browse")); hb->add_child(b); @@ -248,7 +248,7 @@ EditorSubScene::EditorSubScene() { vb->add_margin_child(TTR("Scene Path:"), hb); tree = memnew(Tree); - tree->set_v_size_flags(SIZE_EXPAND_FILL); + tree->set_v_size_flags(Control::SIZE_EXPAND_FILL); vb->add_margin_child(TTR("Import From Node:"), tree, true); tree->set_select_mode(Tree::SELECT_MULTI); tree->connect("multi_selected", callable_mp(this, &EditorSubScene::_item_multi_selected)); @@ -266,7 +266,7 @@ EditorSubScene::EditorSubScene() { file_dialog->add_filter("*." + E->get()); } - file_dialog->set_mode(EditorFileDialog::MODE_OPEN_FILE); + file_dialog->set_file_mode(EditorFileDialog::FILE_MODE_OPEN_FILE); add_child(file_dialog); file_dialog->connect("file_selected", callable_mp(this, &EditorSubScene::_path_selected)); } diff --git a/editor/editor_themes.cpp b/editor/editor_themes.cpp index 39d4b70a6a..576ee436de 100644 --- a/editor/editor_themes.cpp +++ b/editor/editor_themes.cpp @@ -187,8 +187,7 @@ void editor_register_and_generate_icons(Ref<Theme> p_theme, bool p_dark_theme = exceptions.insert("EditorHandle"); exceptions.insert("Editor3DHandle"); exceptions.insert("Godot"); - exceptions.insert("PanoramaSky"); - exceptions.insert("ProceduralSky"); + exceptions.insert("Sky"); exceptions.insert("EditorControlAnchor"); exceptions.insert("DefaultProjectIcon"); exceptions.insert("GuiCloseCustomizable"); @@ -249,7 +248,7 @@ void editor_register_and_generate_icons(Ref<Theme> p_theme, bool p_dark_theme = } } - ImageLoaderSVG::set_convert_colors(NULL); + ImageLoaderSVG::set_convert_colors(nullptr); #else WARN_PRINT("SVG support disabled, editor icons won't be rendered."); #endif @@ -419,7 +418,7 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) { //Register icons + font // the resolution and the icon color (dark_theme bool) has not changed, so we do not regenerate the icons - if (p_theme != NULL && fabs(p_theme->get_constant("scale", "Editor") - EDSCALE) < 0.00001 && (bool)p_theme->get_constant("dark_theme", "Editor") == dark_theme) { + if (p_theme != nullptr && fabs(p_theme->get_constant("scale", "Editor") - EDSCALE) < 0.00001 && (bool)p_theme->get_constant("dark_theme", "Editor") == dark_theme) { // register already generated icons for (int i = 0; i < editor_icons_count; i++) { theme->set_icon(editor_icons_names[i], "EditorIcons", p_theme->get_icon(editor_icons_names[i], "EditorIcons")); @@ -428,7 +427,7 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) { editor_register_and_generate_icons(theme, dark_theme, thumb_size); } // thumbnail size has changed, so we regenerate the medium sizes - if (p_theme != NULL && fabs((double)p_theme->get_constant("thumb_size", "Editor") - thumb_size) > 0.00001) { + if (p_theme != nullptr && fabs((double)p_theme->get_constant("thumb_size", "Editor") - thumb_size) > 0.00001) { editor_register_and_generate_icons(p_theme, dark_theme, thumb_size, true); } @@ -911,14 +910,17 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) { style_window->set_border_color(tab_color); style_window->set_border_width(MARGIN_TOP, 24 * EDSCALE); style_window->set_expand_margin_size(MARGIN_TOP, 24 * EDSCALE); - theme->set_stylebox("panel", "WindowDialog", style_window); - theme->set_color("title_color", "WindowDialog", font_color); - theme->set_icon("close", "WindowDialog", theme->get_icon("GuiClose", "EditorIcons")); - theme->set_icon("close_highlight", "WindowDialog", theme->get_icon("GuiClose", "EditorIcons")); - theme->set_constant("close_h_ofs", "WindowDialog", 22 * EDSCALE); - theme->set_constant("close_v_ofs", "WindowDialog", 20 * EDSCALE); - theme->set_constant("title_height", "WindowDialog", 24 * EDSCALE); - theme->set_font("title_font", "WindowDialog", theme->get_font("title", "EditorFonts")); + + theme->set_stylebox("panel", "Window", style_default); + theme->set_stylebox("panel_window", "Window", style_window); + theme->set_color("title_color", "Window", font_color); + theme->set_icon("close", "Window", theme->get_icon("GuiClose", "EditorIcons")); + theme->set_icon("close_highlight", "Window", theme->get_icon("GuiClose", "EditorIcons")); + theme->set_constant("close_h_ofs", "Window", 22 * EDSCALE); + theme->set_constant("close_v_ofs", "Window", 20 * EDSCALE); + theme->set_constant("title_height", "Window", 24 * EDSCALE); + theme->set_constant("resize_margin", "Window", 4 * EDSCALE); + theme->set_font("title_font", "Window", theme->get_font("title", "EditorFonts")); // complex window, for now only Editor settings and Project settings Ref<StyleBoxFlat> style_complex_window = style_window->duplicate(); @@ -959,12 +961,14 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) { theme->set_icon("grabber", "HSlider", theme->get_icon("GuiSliderGrabber", "EditorIcons")); theme->set_stylebox("slider", "HSlider", make_flat_stylebox(dark_color_3, 0, default_margin_size / 2, 0, default_margin_size / 2)); theme->set_stylebox("grabber_area", "HSlider", make_flat_stylebox(contrast_color_1, 0, default_margin_size / 2, 0, default_margin_size / 2)); + theme->set_stylebox("grabber_area_highlight", "HSlider", make_flat_stylebox(contrast_color_1, 0, default_margin_size / 2, 0, default_margin_size / 2)); // VSlider theme->set_icon("grabber", "VSlider", theme->get_icon("GuiSliderGrabber", "EditorIcons")); theme->set_icon("grabber_highlight", "VSlider", theme->get_icon("GuiSliderGrabberHl", "EditorIcons")); theme->set_stylebox("slider", "VSlider", make_flat_stylebox(dark_color_3, default_margin_size / 2, 0, default_margin_size / 2, 0)); theme->set_stylebox("grabber_area", "VSlider", make_flat_stylebox(contrast_color_1, default_margin_size / 2, 0, default_margin_size / 2, 0)); + theme->set_stylebox("grabber_area_highlight", "VSlider", make_flat_stylebox(contrast_color_1, default_margin_size / 2, 0, default_margin_size / 2, 0)); //RichTextLabel theme->set_color("default_color", "RichTextLabel", font_color); @@ -979,6 +983,7 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) { // Panel theme->set_stylebox("panel", "Panel", make_flat_stylebox(dark_color_1, 6, 4, 6, 4)); + theme->set_stylebox("panel_fg", "Panel", style_default); // Label theme->set_stylebox("normal", "Label", style_empty); @@ -992,6 +997,9 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) { // LinkButton theme->set_stylebox("focus", "LinkButton", style_empty); theme->set_color("font_color", "LinkButton", font_color); + theme->set_color("font_color_hover", "LinkButton", font_color_hl); + theme->set_color("font_color_pressed", "LinkButton", accent_color); + theme->set_color("font_color_disabled", "LinkButton", font_color_disabled); // TooltipPanel Ref<StyleBoxFlat> style_tooltip = style_popup->duplicate(); diff --git a/editor/editor_themes.h b/editor/editor_themes.h index 6e9630804f..4d9bfc56c8 100644 --- a/editor/editor_themes.h +++ b/editor/editor_themes.h @@ -33,8 +33,8 @@ #include "scene/resources/theme.h" -Ref<Theme> create_editor_theme(Ref<Theme> p_theme = NULL); +Ref<Theme> create_editor_theme(Ref<Theme> p_theme = nullptr); -Ref<Theme> create_custom_theme(Ref<Theme> p_theme = NULL); +Ref<Theme> create_custom_theme(Ref<Theme> p_theme = nullptr); #endif diff --git a/editor/editor_vcs_interface.cpp b/editor/editor_vcs_interface.cpp index c420cf44e7..6f3a8d9ea7 100644 --- a/editor/editor_vcs_interface.cpp +++ b/editor/editor_vcs_interface.cpp @@ -30,7 +30,7 @@ #include "editor_vcs_interface.h" -EditorVCSInterface *EditorVCSInterface::singleton = NULL; +EditorVCSInterface *EditorVCSInterface::singleton = nullptr; void EditorVCSInterface::_bind_methods() { diff --git a/editor/export_template_manager.cpp b/editor/export_template_manager.cpp index 9328a5e04d..7cb18432a7 100644 --- a/editor/export_template_manager.cpp +++ b/editor/export_template_manager.cpp @@ -30,10 +30,10 @@ #include "export_template_manager.h" +#include "core/input/input_filter.h" #include "core/io/json.h" #include "core/io/zip_io.h" #include "core/os/dir_access.h" -#include "core/os/input.h" #include "core/os/keyboard.h" #include "core/version.h" #include "editor_node.h" @@ -82,11 +82,11 @@ void ExportTemplateManager::_update_template_list() { String(VERSION_STATUS) != String("rc"); Label *current = memnew(Label); - current->set_h_size_flags(SIZE_EXPAND_FILL); + current->set_h_size_flags(Control::SIZE_EXPAND_FILL); current_hb->add_child(current); if (templates.has(current_version)) { - current->add_color_override("font_color", get_color("success_color", "Editor")); + current->add_theme_color_override("font_color", current->get_theme_color("success_color", "Editor")); // Only display a redownload button if it can be downloaded in the first place if (downloads_available) { @@ -103,7 +103,7 @@ void ExportTemplateManager::_update_template_list() { uninstall->connect("pressed", callable_mp(this, &ExportTemplateManager::_uninstall_template), varray(current_version)); } else { - current->add_color_override("font_color", get_color("error_color", "Editor")); + current->add_theme_color_override("font_color", current->get_theme_color("error_color", "Editor")); Button *redownload = memnew(Button); redownload->set_text(TTR("Download")); @@ -121,13 +121,13 @@ void ExportTemplateManager::_update_template_list() { HBoxContainer *hbc = memnew(HBoxContainer); Label *version = memnew(Label); - version->set_modulate(get_color("disabled_font_color", "Editor")); + version->set_modulate(current->get_theme_color("disabled_font_color", "Editor")); String text = E->get(); if (text == current_version) { text += " " + TTR("(Current)"); } version->set_text(text); - version->set_h_size_flags(SIZE_EXPAND_FILL); + version->set_h_size_flags(Control::SIZE_EXPAND_FILL); hbc->add_child(version); Button *uninstall = memnew(Button); @@ -145,7 +145,7 @@ void ExportTemplateManager::_download_template(const String &p_version) { while (template_list->get_child_count()) { memdelete(template_list->get_child(0)); } - template_downloader->popup_centered_minsize(); + template_downloader->popup_centered(); template_list_state->set_text(TTR("Retrieving mirrors, please wait...")); template_download_progress->set_max(100); template_download_progress->set_value(0); @@ -157,7 +157,7 @@ void ExportTemplateManager::_download_template(const String &p_version) { void ExportTemplateManager::_uninstall_template(const String &p_version) { remove_confirm->set_text(vformat(TTR("Remove template version '%s'?"), p_version)); - remove_confirm->popup_centered_minsize(); + remove_confirm->popup_centered(); to_remove = p_version; } @@ -184,7 +184,7 @@ bool ExportTemplateManager::_install_from_file(const String &p_file, bool p_use_ // unzClose() will take care of closing the file stored in the unzFile, // so we don't need to `memdelete(fa)` in this method. - FileAccess *fa = NULL; + FileAccess *fa = nullptr; zlib_filefunc_def io = zipio_create_io_from_file(&fa); unzFile pkg = unzOpen2(p_file.utf8().get_data(), &io); @@ -203,7 +203,7 @@ bool ExportTemplateManager::_install_from_file(const String &p_file, bool p_use_ unz_file_info info; char fname[16384]; - ret = unzGetCurrentFileInfo(pkg, &info, fname, 16384, NULL, 0, NULL, 0); + ret = unzGetCurrentFileInfo(pkg, &info, fname, 16384, nullptr, 0, nullptr, 0); String file = fname; @@ -258,7 +258,7 @@ bool ExportTemplateManager::_install_from_file(const String &p_file, bool p_use_ ret = unzGoToFirstFile(pkg); - EditorProgress *p = NULL; + EditorProgress *p = nullptr; if (p_use_progress) { p = memnew(EditorProgress("ltask", TTR("Extracting Export Templates"), fc)); } @@ -270,7 +270,7 @@ bool ExportTemplateManager::_install_from_file(const String &p_file, bool p_use_ //get filename unz_file_info info; char fname[16384]; - unzGetCurrentFileInfo(pkg, &info, fname, 16384, NULL, 0, NULL, 0); + unzGetCurrentFileInfo(pkg, &info, fname, 16384, nullptr, 0, nullptr, 0); String file_path(String(fname).simplify_path()); @@ -342,7 +342,7 @@ bool ExportTemplateManager::_install_from_file(const String &p_file, bool p_use_ void ExportTemplateManager::popup_manager() { _update_template_list(); - popup_centered_minsize(Size2(400, 400) * EDSCALE); + popup_centered(Size2(400, 400) * EDSCALE); } void ExportTemplateManager::ok_pressed() { @@ -446,7 +446,7 @@ void ExportTemplateManager::_http_download_templates_completed(int p_status, int void ExportTemplateManager::_begin_template_download(const String &p_url) { - if (Input::get_singleton()->is_key_pressed(KEY_SHIFT)) { + if (InputFilter::get_singleton()->is_key_pressed(KEY_SHIFT)) { OS::get_singleton()->shell_open(p_url); return; } @@ -483,6 +483,11 @@ void ExportTemplateManager::_window_template_downloader_closed() { void ExportTemplateManager::_notification(int p_what) { + if (p_what == NOTIFICATION_VISIBILITY_CHANGED) { + if (!is_visible()) { + set_process(false); + } + } if (p_what == NOTIFICATION_PROCESS) { update_countdown -= get_process_delta_time(); @@ -536,12 +541,6 @@ void ExportTemplateManager::_notification(int p_what) { set_process(false); } } - - if (p_what == NOTIFICATION_VISIBILITY_CHANGED) { - if (!is_visible_in_tree()) { - set_process(false); - } - } } bool ExportTemplateManager::can_install_android_template() { @@ -588,7 +587,7 @@ Error ExportTemplateManager::install_android_template() { const String &source_zip = templates_path.plus_file("android_source.zip"); ERR_FAIL_COND_V(!FileAccess::exists(source_zip), ERR_CANT_OPEN); - FileAccess *src_f = NULL; + FileAccess *src_f = nullptr; zlib_filefunc_def io = zipio_create_io_from_file(&src_f); unzFile pkg = unzOpen2(source_zip.utf8().get_data(), &io); @@ -612,7 +611,7 @@ Error ExportTemplateManager::install_android_template() { // Get file path. unz_file_info info; char fpath[16384]; - ret = unzGetCurrentFileInfo(pkg, &info, fpath, 16384, NULL, 0, NULL, 0); + ret = unzGetCurrentFileInfo(pkg, &info, fpath, 16384, nullptr, 0, nullptr, 0); String path = fpath; String base_dir = path.get_base_dir(); @@ -674,7 +673,7 @@ ExportTemplateManager::ExportTemplateManager() { installed_scroll->add_child(installed_vb); installed_scroll->set_enable_v_scroll(true); installed_scroll->set_enable_h_scroll(false); - installed_vb->set_h_size_flags(SIZE_EXPAND_FILL); + installed_vb->set_h_size_flags(Control::SIZE_EXPAND_FILL); get_cancel()->set_text(TTR("Close")); get_ok()->set_text(TTR("Install From File")); @@ -688,7 +687,7 @@ ExportTemplateManager::ExportTemplateManager() { template_open->set_title(TTR("Select Template File")); template_open->add_filter("*.tpz ; " + TTR("Godot Export Templates")); template_open->set_access(FileDialog::ACCESS_FILESYSTEM); - template_open->set_mode(FileDialog::MODE_OPEN_FILE); + template_open->set_file_mode(FileDialog::FILE_MODE_OPEN_FILE); template_open->connect("file_selected", callable_mp(this, &ExportTemplateManager::_install_from_file), varray(true)); add_child(template_open); @@ -708,7 +707,7 @@ ExportTemplateManager::ExportTemplateManager() { template_downloader->get_ok()->set_text(TTR("Close")); template_downloader->set_exclusive(true); add_child(template_downloader); - template_downloader->connect("popup_hide", callable_mp(this, &ExportTemplateManager::_window_template_downloader_closed)); + template_downloader->connect("cancelled", callable_mp(this, &ExportTemplateManager::_window_template_downloader_closed)); VBoxContainer *vbc = memnew(VBoxContainer); template_downloader->add_child(vbc); diff --git a/editor/file_type_cache.cpp b/editor/file_type_cache.cpp deleted file mode 100644 index 52ab80cc48..0000000000 --- a/editor/file_type_cache.cpp +++ /dev/null @@ -1,104 +0,0 @@ -/*************************************************************************/ -/* file_type_cache.cpp */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* https://godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */ -/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */ -/* */ -/* Permission is hereby granted, free of charge, to any person obtaining */ -/* a copy of this software and associated documentation files (the */ -/* "Software"), to deal in the Software without restriction, including */ -/* without limitation the rights to use, copy, modify, merge, publish, */ -/* distribute, sublicense, and/or sell copies of the Software, and to */ -/* permit persons to whom the Software is furnished to do so, subject to */ -/* the following conditions: */ -/* */ -/* The above copyright notice and this permission notice shall be */ -/* included in all copies or substantial portions of the Software. */ -/* */ -/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ -/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ -/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ -/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ -/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ -/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/*************************************************************************/ - -#include "file_type_cache.h" - -#include "core/os/file_access.h" -#include "core/project_settings.h" - -FileTypeCache *FileTypeCache::singleton = NULL; - -bool FileTypeCache::has_file(const String &p_path) const { - - GLOBAL_LOCK_FUNCTION - return file_type_map.has(p_path); -} - -String FileTypeCache::get_file_type(const String &p_path) const { - - GLOBAL_LOCK_FUNCTION - ERR_FAIL_COND_V(!file_type_map.has(p_path), ""); - return file_type_map[p_path]; -} -void FileTypeCache::set_file_type(const String &p_path, const String &p_type) { - - GLOBAL_LOCK_FUNCTION - file_type_map[p_path] = p_type; -} - -void FileTypeCache::load() { - - GLOBAL_LOCK_FUNCTION - String project = ProjectSettings::get_singleton()->get_resource_path(); - FileAccess *f = FileAccess::open(project + "/file_type_cache.cch", FileAccess::READ); - - if (!f) { - - WARN_PRINT("Can't open file_type_cache.cch."); - return; - } - - file_type_map.clear(); - while (!f->eof_reached()) { - - String path = f->get_line(); - if (f->eof_reached()) - break; - String type = f->get_line(); - set_file_type(path, type); - } - - memdelete(f); -} - -void FileTypeCache::save() { - - GLOBAL_LOCK_FUNCTION - String project = ProjectSettings::get_singleton()->get_resource_path(); - FileAccess *f = FileAccess::open(project + "/file_type_cache.cch", FileAccess::WRITE); - - ERR_FAIL_COND_MSG(!f, "Can't open file_type_cache.cch for writing, not saving file type cache!"); - - const String *K = NULL; - - while ((K = file_type_map.next(K))) { - - f->store_line(*K); - f->store_line(file_type_map[*K]); - } - - memdelete(f); -} - -FileTypeCache::FileTypeCache() { - - ERR_FAIL_COND_MSG(singleton, "FileTypeCache singleton already exist."); - singleton = this; -} diff --git a/editor/file_type_cache.h b/editor/file_type_cache.h deleted file mode 100644 index 216effea00..0000000000 --- a/editor/file_type_cache.h +++ /dev/null @@ -1,57 +0,0 @@ -/*************************************************************************/ -/* file_type_cache.h */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* https://godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */ -/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */ -/* */ -/* Permission is hereby granted, free of charge, to any person obtaining */ -/* a copy of this software and associated documentation files (the */ -/* "Software"), to deal in the Software without restriction, including */ -/* without limitation the rights to use, copy, modify, merge, publish, */ -/* distribute, sublicense, and/or sell copies of the Software, and to */ -/* permit persons to whom the Software is furnished to do so, subject to */ -/* the following conditions: */ -/* */ -/* The above copyright notice and this permission notice shall be */ -/* included in all copies or substantial portions of the Software. */ -/* */ -/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ -/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ -/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ -/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ -/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ -/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/*************************************************************************/ - -#ifndef FILE_TYPE_CACHE_H -#define FILE_TYPE_CACHE_H - -#include "core/object.h" - -class FileTypeCache : Object { - - GDCLASS(FileTypeCache, Object); - - HashMap<String, String> file_type_map; - - static FileTypeCache *singleton; - -public: - static FileTypeCache *get_singleton() { return singleton; } - - bool has_file(const String &p_path) const; - String get_file_type(const String &p_path) const; - void set_file_type(const String &p_path, const String &p_type); - - void load(); - void save(); - - FileTypeCache(); -}; - -#endif // FILE_TYPE_CACHE_H diff --git a/editor/fileserver/SCsub b/editor/fileserver/SCsub index 2b1e889fb0..359d04e5df 100644 --- a/editor/fileserver/SCsub +++ b/editor/fileserver/SCsub @@ -1,5 +1,5 @@ #!/usr/bin/env python -Import('env') +Import("env") env.add_source_files(env.editor_sources, "*.cpp") diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp index 962d95736f..236ae16ccf 100644 --- a/editor/filesystem_dock.cpp +++ b/editor/filesystem_dock.cpp @@ -42,16 +42,17 @@ #include "editor_scale.h" #include "editor_settings.h" #include "import_dock.h" -#include "scene/main/viewport.h" +#include "scene/main/window.h" #include "scene/resources/packed_scene.h" +#include "servers/display_server.h" Ref<Texture2D> FileSystemDock::_get_tree_item_icon(EditorFileSystemDirectory *p_dir, int p_idx) { Ref<Texture2D> file_icon; if (!p_dir->get_file_import_is_valid(p_idx)) { - file_icon = get_icon("ImportFail", "EditorIcons"); + file_icon = get_theme_icon("ImportFail", "EditorIcons"); } else { String file_type = p_dir->get_file_type(p_idx); - file_icon = (has_icon(file_type, "EditorIcons")) ? get_icon(file_type, "EditorIcons") : get_icon("File", "EditorIcons"); + file_icon = (has_theme_icon(file_type, "EditorIcons")) ? get_theme_icon(file_type, "EditorIcons") : get_theme_icon("File", "EditorIcons"); } return file_icon; } @@ -66,8 +67,8 @@ bool FileSystemDock::_create_tree(TreeItem *p_parent, EditorFileSystemDirectory dname = "res://"; subdirectory_item->set_text(0, dname); - subdirectory_item->set_icon(0, get_icon("Folder", "EditorIcons")); - subdirectory_item->set_icon_modulate(0, get_color("folder_icon_modulate", "FileDialog")); + subdirectory_item->set_icon(0, get_theme_icon("Folder", "EditorIcons")); + subdirectory_item->set_icon_modulate(0, get_theme_color("folder_icon_modulate", "FileDialog")); subdirectory_item->set_selectable(0, true); String lpath = p_dir->get_path(); subdirectory_item->set_metadata(0, lpath); @@ -121,7 +122,7 @@ bool FileSystemDock::_create_tree(TreeItem *p_parent, EditorFileSystemDirectory file_item->set_as_cursor(0); } if (main_scene == file_metadata) { - file_item->set_custom_color(0, get_color("accent_color", "Editor")); + file_item->set_custom_color(0, get_theme_color("accent_color", "Editor")); } Array udata; udata.push_back(tree_update_id); @@ -187,7 +188,7 @@ void FileSystemDock::_update_tree(const Vector<String> &p_uncollapsed_paths, boo // Handles the favorites. TreeItem *favorites = tree->create_item(root); - favorites->set_icon(0, get_icon("Favorites", "EditorIcons")); + favorites->set_icon(0, get_theme_icon("Favorites", "EditorIcons")); favorites->set_text(0, TTR("Favorites:")); favorites->set_metadata(0, "Favorites"); favorites->set_collapsed(p_uncollapsed_paths.find("Favorites") < 0); @@ -198,8 +199,8 @@ void FileSystemDock::_update_tree(const Vector<String> &p_uncollapsed_paths, boo if (!fave.begins_with("res://")) continue; - Ref<Texture2D> folder_icon = get_icon("Folder", "EditorIcons"); - const Color folder_color = get_color("folder_icon_modulate", "FileDialog"); + Ref<Texture2D> folder_icon = get_theme_icon("Folder", "EditorIcons"); + const Color folder_color = get_theme_color("folder_icon_modulate", "FileDialog"); String text; Ref<Texture2D> icon; @@ -219,7 +220,7 @@ void FileSystemDock::_update_tree(const Vector<String> &p_uncollapsed_paths, boo if (dir) { icon = _get_tree_item_icon(dir, index); } else { - icon = get_icon("File", "EditorIcons"); + icon = get_theme_icon("File", "EditorIcons"); } color = Color(1, 1, 1); } @@ -306,20 +307,21 @@ void FileSystemDock::_notification(int p_what) { EditorResourcePreview::get_singleton()->connect("preview_invalidated", callable_mp(this, &FileSystemDock::_preview_invalidated)); String ei = "EditorIcons"; - button_reload->set_icon(get_icon("Reload", ei)); - button_toggle_display_mode->set_icon(get_icon("Panels2", ei)); + + button_reload->set_icon(get_theme_icon("Reload", ei)); + button_toggle_display_mode->set_icon(get_theme_icon("Panels2", ei)); button_file_list_display_mode->connect("pressed", callable_mp(this, &FileSystemDock::_toggle_file_display)); files->connect("item_activated", callable_mp(this, &FileSystemDock::_file_list_activate_file)); button_hist_next->connect("pressed", callable_mp(this, &FileSystemDock::_fw_history)); button_hist_prev->connect("pressed", callable_mp(this, &FileSystemDock::_bw_history)); - tree_search_box->set_right_icon(get_icon("Search", ei)); + tree_search_box->set_right_icon(get_theme_icon("Search", ei)); tree_search_box->set_clear_button_enabled(true); - file_list_search_box->set_right_icon(get_icon("Search", ei)); + file_list_search_box->set_right_icon(get_theme_icon("Search", ei)); file_list_search_box->set_clear_button_enabled(true); - button_hist_next->set_icon(get_icon("Forward", ei)); - button_hist_prev->set_icon(get_icon("Back", ei)); + button_hist_next->set_icon(get_theme_icon("Forward", ei)); + button_hist_prev->set_icon(get_theme_icon("Back", ei)); file_list_popup->connect("id_pressed", callable_mp(this, &FileSystemDock::_file_list_rmb_option)); tree_popup->connect("id_pressed", callable_mp(this, &FileSystemDock::_tree_rmb_option)); @@ -369,19 +371,19 @@ void FileSystemDock::_notification(int p_what) { case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: { // Update icons. String ei = "EditorIcons"; - button_reload->set_icon(get_icon("Reload", ei)); - button_toggle_display_mode->set_icon(get_icon("Panels2", ei)); - button_hist_next->set_icon(get_icon("Forward", ei)); - button_hist_prev->set_icon(get_icon("Back", ei)); + button_reload->set_icon(get_theme_icon("Reload", ei)); + button_toggle_display_mode->set_icon(get_theme_icon("Panels2", ei)); + button_hist_next->set_icon(get_theme_icon("Forward", ei)); + button_hist_prev->set_icon(get_theme_icon("Back", ei)); if (file_list_display_mode == FILE_LIST_DISPLAY_LIST) { - button_file_list_display_mode->set_icon(get_icon("FileThumbnail", "EditorIcons")); + button_file_list_display_mode->set_icon(get_theme_icon("FileThumbnail", "EditorIcons")); } else { - button_file_list_display_mode->set_icon(get_icon("FileList", "EditorIcons")); + button_file_list_display_mode->set_icon(get_theme_icon("FileList", "EditorIcons")); } - tree_search_box->set_right_icon(get_icon("Search", ei)); + tree_search_box->set_right_icon(get_theme_icon("Search", ei)); tree_search_box->set_clear_button_enabled(true); - file_list_search_box->set_right_icon(get_icon("Search", ei)); + file_list_search_box->set_right_icon(get_theme_icon("Search", ei)); file_list_search_box->set_clear_button_enabled(true); // Update always show folders. @@ -532,11 +534,11 @@ void FileSystemDock::_toggle_file_display() { void FileSystemDock::_set_file_display(bool p_active) { if (p_active) { file_list_display_mode = FILE_LIST_DISPLAY_LIST; - button_file_list_display_mode->set_icon(get_icon("FileThumbnail", "EditorIcons")); + button_file_list_display_mode->set_icon(get_theme_icon("FileThumbnail", "EditorIcons")); button_file_list_display_mode->set_tooltip(TTR("View items as a grid of thumbnails.")); } else { file_list_display_mode = FILE_LIST_DISPLAY_THUMBNAILS; - button_file_list_display_mode->set_icon(get_icon("FileList", "EditorIcons")); + button_file_list_display_mode->set_icon(get_theme_icon("FileList", "EditorIcons")); button_file_list_display_mode->set_tooltip(TTR("View items as a list.")); } @@ -628,13 +630,13 @@ void FileSystemDock::_update_file_list(bool p_keep_selection) { files->set_fixed_icon_size(Size2(thumbnail_size, thumbnail_size)); if (thumbnail_size < 64) { - folder_thumbnail = get_icon("FolderMediumThumb", ei); - file_thumbnail = get_icon("FileMediumThumb", ei); - file_thumbnail_broken = get_icon("FileDeadMediumThumb", ei); + folder_thumbnail = get_theme_icon("FolderMediumThumb", ei); + file_thumbnail = get_theme_icon("FileMediumThumb", ei); + file_thumbnail_broken = get_theme_icon("FileDeadMediumThumb", ei); } else { - folder_thumbnail = get_icon("FolderBigThumb", ei); - file_thumbnail = get_icon("FileBigThumb", ei); - file_thumbnail_broken = get_icon("FileDeadBigThumb", ei); + folder_thumbnail = get_theme_icon("FolderBigThumb", ei); + file_thumbnail = get_theme_icon("FileBigThumb", ei); + file_thumbnail_broken = get_theme_icon("FileDeadBigThumb", ei); } } else { // No thumbnails. @@ -645,8 +647,8 @@ void FileSystemDock::_update_file_list(bool p_keep_selection) { files->set_fixed_icon_size(Size2()); } - Ref<Texture2D> folder_icon = (use_thumbnails) ? folder_thumbnail : get_icon("folder", "FileDialog"); - const Color folder_color = get_color("folder_icon_modulate", "FileDialog"); + Ref<Texture2D> folder_icon = (use_thumbnails) ? folder_thumbnail : get_theme_icon("folder", "FileDialog"); + const Color folder_color = get_theme_color("folder_icon_modulate", "FileDialog"); // Build the FileInfo list. List<FileInfo> filelist; @@ -766,10 +768,10 @@ void FileSystemDock::_update_file_list(bool p_keep_selection) { // Select the icons. if (!finfo->import_broken) { - type_icon = (has_icon(ftype, ei)) ? get_icon(ftype, ei) : get_icon(oi, ei); + type_icon = (has_theme_icon(ftype, ei)) ? get_theme_icon(ftype, ei) : get_theme_icon(oi, ei); big_icon = file_thumbnail; } else { - type_icon = get_icon("ImportFail", ei); + type_icon = get_theme_icon("ImportFail", ei); big_icon = file_thumbnail_broken; tooltip += "\n" + TTR("Status: Import of file failed. Please fix file and reimport manually."); } @@ -789,7 +791,7 @@ void FileSystemDock::_update_file_list(bool p_keep_selection) { } if (fpath == main_scene) { - files->set_item_custom_fg_color(item_index, get_color("accent_color", "Editor")); + files->set_item_custom_fg_color(item_index, get_theme_color("accent_color", "Editor")); } // Generate the preview. @@ -841,7 +843,7 @@ void FileSystemDock::_tree_activate_file() { if (selected) { String path = selected->get_metadata(0); TreeItem *parent = selected->get_parent(); - bool is_favorite = parent != NULL && parent->get_metadata(0) == "Favorites"; + bool is_favorite = parent != nullptr && parent->get_metadata(0) == "Favorites"; if ((!is_favorite && path.ends_with("/")) || path == "Favorites") { bool collapsed = selected->is_collapsed(); @@ -953,7 +955,7 @@ void FileSystemDock::_push_to_history() { } void FileSystemDock::_get_all_items_in_dir(EditorFileSystemDirectory *efsd, Vector<String> &files, Vector<String> &folders) const { - if (efsd == NULL) + if (efsd == nullptr) return; for (int i = 0; i < efsd->get_subdir_count(); i++) { @@ -1412,7 +1414,7 @@ void FileSystemDock::_move_operation_confirm(const String &p_to_path, bool p_ove bool can_move = _check_existing(); if (!can_move) { // Ask to do something. - overwrite_dialog->popup_centered_minsize(); + overwrite_dialog->popup_centered(); return; } } @@ -1676,7 +1678,7 @@ void FileSystemDock::_file_option(int p_option, const Vector<String> &p_selected rename_dialog_text->set_text(name); rename_dialog_text->select(0, name.length()); } - rename_dialog->popup_centered_minsize(Size2(250, 80) * EDSCALE); + rename_dialog->popup_centered(Size2(250, 80) * EDSCALE); rename_dialog_text->grab_focus(); } } @@ -1720,7 +1722,7 @@ void FileSystemDock::_file_option(int p_option, const Vector<String> &p_selected duplicate_dialog_text->set_text(name); duplicate_dialog_text->select(0, name.length()); } - duplicate_dialog->popup_centered_minsize(Size2(250, 80) * EDSCALE); + duplicate_dialog->popup_centered(Size2(250, 80) * EDSCALE); duplicate_dialog_text->grab_focus(); } } break; @@ -1742,14 +1744,14 @@ void FileSystemDock::_file_option(int p_option, const Vector<String> &p_selected case FILE_NEW_FOLDER: { make_dir_dialog_text->set_text("new folder"); make_dir_dialog_text->select_all(); - make_dir_dialog->popup_centered_minsize(Size2(250, 80) * EDSCALE); + make_dir_dialog->popup_centered(Size2(250, 80) * EDSCALE); make_dir_dialog_text->grab_focus(); } break; case FILE_NEW_SCENE: { make_scene_dialog_text->set_text("new scene"); make_scene_dialog_text->select_all(); - make_scene_dialog->popup_centered_minsize(Size2(250, 80) * EDSCALE); + make_scene_dialog->popup_centered(Size2(250, 80) * EDSCALE); make_scene_dialog_text->grab_focus(); } break; @@ -1765,7 +1767,7 @@ void FileSystemDock::_file_option(int p_option, const Vector<String> &p_selected case FILE_COPY_PATH: { if (!p_selected.empty()) { String fpath = p_selected[0]; - OS::get_singleton()->set_clipboard(fpath); + DisplayServer::get_singleton()->clipboard_set(fpath); } } break; @@ -1869,7 +1871,7 @@ Variant FileSystemDock::get_drag_data_fw(const Point2 &p_point, Control *p_from) return Variant(); } - bool is_favorite = selected->get_parent() != NULL && tree->get_root()->get_children() == selected->get_parent(); + bool is_favorite = selected->get_parent() != nullptr && tree->get_root()->get_children() == selected->get_parent(); all_favorites &= is_favorite; all_not_favorites &= !is_favorite; selected = tree->get_next_selected(selected); @@ -2178,28 +2180,28 @@ void FileSystemDock::_file_and_folders_fill_popup(PopupMenu *p_popup, Vector<Str if (all_files) { if (all_files_scenes) { if (filenames.size() == 1) { - p_popup->add_icon_item(get_icon("Load", "EditorIcons"), TTR("Open Scene"), FILE_OPEN); - p_popup->add_icon_item(get_icon("CreateNewSceneFrom", "EditorIcons"), TTR("New Inherited Scene"), FILE_INHERIT); + p_popup->add_icon_item(get_theme_icon("Load", "EditorIcons"), TTR("Open Scene"), FILE_OPEN); + p_popup->add_icon_item(get_theme_icon("CreateNewSceneFrom", "EditorIcons"), TTR("New Inherited Scene"), FILE_INHERIT); if (ProjectSettings::get_singleton()->get("application/run/main_scene") != filenames[0]) { - p_popup->add_icon_item(get_icon("PlayScene", "EditorIcons"), TTR("Set As Main Scene"), FILE_MAIN_SCENE); + p_popup->add_icon_item(get_theme_icon("PlayScene", "EditorIcons"), TTR("Set As Main Scene"), FILE_MAIN_SCENE); } } else { - p_popup->add_icon_item(get_icon("Load", "EditorIcons"), TTR("Open Scenes"), FILE_OPEN); + p_popup->add_icon_item(get_theme_icon("Load", "EditorIcons"), TTR("Open Scenes"), FILE_OPEN); } - p_popup->add_icon_item(get_icon("Instance", "EditorIcons"), TTR("Instance"), FILE_INSTANCE); + p_popup->add_icon_item(get_theme_icon("Instance", "EditorIcons"), TTR("Instance"), FILE_INSTANCE); p_popup->add_separator(); } else if (filenames.size() == 1) { - p_popup->add_icon_item(get_icon("Load", "EditorIcons"), TTR("Open"), FILE_OPEN); + p_popup->add_icon_item(get_theme_icon("Load", "EditorIcons"), TTR("Open"), FILE_OPEN); p_popup->add_separator(); } } if (p_paths.size() >= 1) { if (!all_favorites) { - p_popup->add_icon_item(get_icon("Favorites", "EditorIcons"), TTR("Add to Favorites"), FILE_ADD_FAVORITE); + p_popup->add_icon_item(get_theme_icon("Favorites", "EditorIcons"), TTR("Add to Favorites"), FILE_ADD_FAVORITE); } if (!all_not_favorites) { - p_popup->add_icon_item(get_icon("NonFavorite", "EditorIcons"), TTR("Remove from Favorites"), FILE_REMOVE_FAVORITE); + p_popup->add_icon_item(get_theme_icon("NonFavorite", "EditorIcons"), TTR("Remove from Favorites"), FILE_REMOVE_FAVORITE); } p_popup->add_separator(); } @@ -2212,36 +2214,36 @@ void FileSystemDock::_file_and_folders_fill_popup(PopupMenu *p_popup, Vector<Str } } else if (all_folders && foldernames.size() > 0) { - p_popup->add_icon_item(get_icon("Load", "EditorIcons"), TTR("Open"), FILE_OPEN); + p_popup->add_icon_item(get_theme_icon("Load", "EditorIcons"), TTR("Open"), FILE_OPEN); p_popup->add_separator(); } if (p_paths.size() == 1) { - p_popup->add_icon_item(get_icon("ActionCopy", "EditorIcons"), TTR("Copy Path"), FILE_COPY_PATH); + p_popup->add_icon_item(get_theme_icon("ActionCopy", "EditorIcons"), TTR("Copy Path"), FILE_COPY_PATH); if (p_paths[0] != "res://") { - p_popup->add_icon_item(get_icon("Rename", "EditorIcons"), TTR("Rename..."), FILE_RENAME); - p_popup->add_icon_item(get_icon("Duplicate", "EditorIcons"), TTR("Duplicate..."), FILE_DUPLICATE); + p_popup->add_icon_item(get_theme_icon("Rename", "EditorIcons"), TTR("Rename..."), FILE_RENAME); + p_popup->add_icon_item(get_theme_icon("Duplicate", "EditorIcons"), TTR("Duplicate..."), FILE_DUPLICATE); } } if (p_paths.size() > 1 || p_paths[0] != "res://") { - p_popup->add_icon_item(get_icon("MoveUp", "EditorIcons"), TTR("Move To..."), FILE_MOVE); - p_popup->add_icon_item(get_icon("Remove", "EditorIcons"), TTR("Delete"), FILE_REMOVE); + p_popup->add_icon_item(get_theme_icon("MoveUp", "EditorIcons"), TTR("Move To..."), FILE_MOVE); + p_popup->add_icon_item(get_theme_icon("Remove", "EditorIcons"), TTR("Delete"), FILE_REMOVE); } if (p_paths.size() == 1) { p_popup->add_separator(); if (p_display_path_dependent_options) { - p_popup->add_icon_item(get_icon("Folder", "EditorIcons"), TTR("New Folder..."), FILE_NEW_FOLDER); - p_popup->add_icon_item(get_icon("PackedScene", "EditorIcons"), TTR("New Scene..."), FILE_NEW_SCENE); - p_popup->add_icon_item(get_icon("Script", "EditorIcons"), TTR("New Script..."), FILE_NEW_SCRIPT); - p_popup->add_icon_item(get_icon("Object", "EditorIcons"), TTR("New Resource..."), FILE_NEW_RESOURCE); + p_popup->add_icon_item(get_theme_icon("Folder", "EditorIcons"), TTR("New Folder..."), FILE_NEW_FOLDER); + p_popup->add_icon_item(get_theme_icon("PackedScene", "EditorIcons"), TTR("New Scene..."), FILE_NEW_SCENE); + p_popup->add_icon_item(get_theme_icon("Script", "EditorIcons"), TTR("New Script..."), FILE_NEW_SCRIPT); + p_popup->add_icon_item(get_theme_icon("Object", "EditorIcons"), TTR("New Resource..."), FILE_NEW_RESOURCE); p_popup->add_separator(); } String fpath = p_paths[0]; String item_text = fpath.ends_with("/") ? TTR("Open in File Manager") : TTR("Show in File Manager"); - p_popup->add_icon_item(get_icon("Filesystem", "EditorIcons"), item_text, FILE_SHOW_IN_EXPLORER); + p_popup->add_icon_item(get_theme_icon("Filesystem", "EditorIcons"), item_text, FILE_SHOW_IN_EXPLORER); } } @@ -2251,8 +2253,8 @@ void FileSystemDock::_tree_rmb_select(const Vector2 &p_pos) { if (paths.size() == 1) { if (paths[0].ends_with("/")) { - tree_popup->add_icon_item(get_icon("GuiTreeArrowDown", "EditorIcons"), TTR("Expand All"), FOLDER_EXPAND_ALL); - tree_popup->add_icon_item(get_icon("GuiTreeArrowRight", "EditorIcons"), TTR("Collapse All"), FOLDER_COLLAPSE_ALL); + tree_popup->add_icon_item(get_theme_icon("GuiTreeArrowDown", "EditorIcons"), TTR("Expand All"), FOLDER_EXPAND_ALL); + tree_popup->add_icon_item(get_theme_icon("GuiTreeArrowRight", "EditorIcons"), TTR("Collapse All"), FOLDER_COLLAPSE_ALL); tree_popup->add_separator(); } } @@ -2272,10 +2274,10 @@ void FileSystemDock::_tree_rmb_empty(const Vector2 &p_pos) { path = "res://"; tree_popup->clear(); tree_popup->set_size(Size2(1, 1)); - tree_popup->add_icon_item(get_icon("Folder", "EditorIcons"), TTR("New Folder..."), FILE_NEW_FOLDER); - tree_popup->add_icon_item(get_icon("PackedScene", "EditorIcons"), TTR("New Scene..."), FILE_NEW_SCENE); - tree_popup->add_icon_item(get_icon("Script", "EditorIcons"), TTR("New Script..."), FILE_NEW_SCRIPT); - tree_popup->add_icon_item(get_icon("Object", "EditorIcons"), TTR("New Resource..."), FILE_NEW_RESOURCE); + tree_popup->add_icon_item(get_theme_icon("Folder", "EditorIcons"), TTR("New Folder..."), FILE_NEW_FOLDER); + tree_popup->add_icon_item(get_theme_icon("PackedScene", "EditorIcons"), TTR("New Scene..."), FILE_NEW_SCENE); + tree_popup->add_icon_item(get_theme_icon("Script", "EditorIcons"), TTR("New Script..."), FILE_NEW_SCRIPT); + tree_popup->add_icon_item(get_theme_icon("Object", "EditorIcons"), TTR("New Resource..."), FILE_NEW_RESOURCE); tree_popup->set_position(tree->get_global_position() + p_pos); tree_popup->popup(); } @@ -2315,12 +2317,12 @@ void FileSystemDock::_file_list_rmb_pressed(const Vector2 &p_pos) { file_list_popup->clear(); file_list_popup->set_size(Size2(1, 1)); - file_list_popup->add_icon_item(get_icon("Folder", "EditorIcons"), TTR("New Folder..."), FILE_NEW_FOLDER); - file_list_popup->add_icon_item(get_icon("PackedScene", "EditorIcons"), TTR("New Scene..."), FILE_NEW_SCENE); - file_list_popup->add_icon_item(get_icon("Script", "EditorIcons"), TTR("New Script..."), FILE_NEW_SCRIPT); - file_list_popup->add_icon_item(get_icon("Object", "EditorIcons"), TTR("New Resource..."), FILE_NEW_RESOURCE); + file_list_popup->add_icon_item(get_theme_icon("Folder", "EditorIcons"), TTR("New Folder..."), FILE_NEW_FOLDER); + file_list_popup->add_icon_item(get_theme_icon("PackedScene", "EditorIcons"), TTR("New Scene..."), FILE_NEW_SCENE); + file_list_popup->add_icon_item(get_theme_icon("Script", "EditorIcons"), TTR("New Script..."), FILE_NEW_SCRIPT); + file_list_popup->add_icon_item(get_theme_icon("Object", "EditorIcons"), TTR("New Resource..."), FILE_NEW_RESOURCE); file_list_popup->add_separator(); - file_list_popup->add_icon_item(get_icon("Filesystem", "EditorIcons"), TTR("Open in File Manager"), FILE_SHOW_IN_EXPLORER); + file_list_popup->add_icon_item(get_theme_icon("Filesystem", "EditorIcons"), TTR("Open in File Manager"), FILE_SHOW_IN_EXPLORER); file_list_popup->set_position(files->get_global_position() + p_pos); file_list_popup->popup(); } @@ -2348,8 +2350,6 @@ void FileSystemDock::_file_multi_selected(int p_index, bool p_selected) { } void FileSystemDock::_tree_gui_input(Ref<InputEvent> p_event) { - if (get_viewport()->get_modal_stack_top()) - return; // Ignore because of modal window. Ref<InputEventKey> key = p_event; if (key.is_valid() && key->is_pressed() && !key->is_echo()) { @@ -2366,8 +2366,6 @@ void FileSystemDock::_tree_gui_input(Ref<InputEvent> p_event) { } void FileSystemDock::_file_list_gui_input(Ref<InputEvent> p_event) { - if (get_viewport()->get_modal_stack_top()) - return; // Ignore because of modal window. Ref<InputEventKey> key = p_event; if (key.is_valid() && key->is_pressed() && !key->is_echo()) { @@ -2492,7 +2490,7 @@ FileSystemDock::FileSystemDock(EditorNode *p_editor) { add_child(top_vbc); HBoxContainer *toolbar_hbc = memnew(HBoxContainer); - toolbar_hbc->add_constant_override("separation", 0); + toolbar_hbc->add_theme_constant_override("separation", 0); top_vbc->add_child(toolbar_hbc); button_hist_prev = memnew(ToolButton); @@ -2529,7 +2527,7 @@ FileSystemDock::FileSystemDock(EditorNode *p_editor) { toolbar_hbc->add_child(button_toggle_display_mode); HBoxContainer *toolbar2_hbc = memnew(HBoxContainer); - toolbar2_hbc->add_constant_override("separation", 0); + toolbar2_hbc->add_theme_constant_override("separation", 0); top_vbc->add_child(toolbar2_hbc); tree_search_box = memnew(LineEdit); @@ -2539,11 +2537,11 @@ FileSystemDock::FileSystemDock(EditorNode *p_editor) { toolbar2_hbc->add_child(tree_search_box); file_list_popup = memnew(PopupMenu); - file_list_popup->set_hide_on_window_lose_focus(true); + add_child(file_list_popup); tree_popup = memnew(PopupMenu); - tree_popup->set_hide_on_window_lose_focus(true); + add_child(tree_popup); split_box = memnew(VSplitContainer); diff --git a/editor/find_in_files.cpp b/editor/find_in_files.cpp index 5a7d4cede7..d73180c831 100644 --- a/editor/find_in_files.cpp +++ b/editor/find_in_files.cpp @@ -299,14 +299,14 @@ const char *FindInFilesDialog::SIGNAL_REPLACE_REQUESTED = "replace_requested"; FindInFilesDialog::FindInFilesDialog() { - set_custom_minimum_size(Size2(500 * EDSCALE, 0)); + set_min_size(Size2(500 * EDSCALE, 0)); set_title(TTR("Find in Files")); VBoxContainer *vbc = memnew(VBoxContainer); - vbc->set_anchor_and_margin(MARGIN_LEFT, ANCHOR_BEGIN, 8 * EDSCALE); - vbc->set_anchor_and_margin(MARGIN_TOP, ANCHOR_BEGIN, 8 * EDSCALE); - vbc->set_anchor_and_margin(MARGIN_RIGHT, ANCHOR_END, -8 * EDSCALE); - vbc->set_anchor_and_margin(MARGIN_BOTTOM, ANCHOR_END, -8 * EDSCALE); + vbc->set_anchor_and_margin(MARGIN_LEFT, Control::ANCHOR_BEGIN, 8 * EDSCALE); + vbc->set_anchor_and_margin(MARGIN_TOP, Control::ANCHOR_BEGIN, 8 * EDSCALE); + vbc->set_anchor_and_margin(MARGIN_RIGHT, Control::ANCHOR_END, -8 * EDSCALE); + vbc->set_anchor_and_margin(MARGIN_BOTTOM, Control::ANCHOR_END, -8 * EDSCALE); add_child(vbc); GridContainer *gc = memnew(GridContainer); @@ -318,7 +318,7 @@ FindInFilesDialog::FindInFilesDialog() { gc->add_child(find_label); _search_text_line_edit = memnew(LineEdit); - _search_text_line_edit->set_h_size_flags(SIZE_EXPAND_FILL); + _search_text_line_edit->set_h_size_flags(Control::SIZE_EXPAND_FILL); _search_text_line_edit->connect("text_changed", callable_mp(this, &FindInFilesDialog::_on_search_text_modified)); _search_text_line_edit->connect("text_entered", callable_mp(this, &FindInFilesDialog::_on_search_text_entered)); gc->add_child(_search_text_line_edit); @@ -329,7 +329,7 @@ FindInFilesDialog::FindInFilesDialog() { gc->add_child(_replace_label); _replace_text_line_edit = memnew(LineEdit); - _replace_text_line_edit->set_h_size_flags(SIZE_EXPAND_FILL); + _replace_text_line_edit->set_h_size_flags(Control::SIZE_EXPAND_FILL); _replace_text_line_edit->connect("text_entered", callable_mp(this, &FindInFilesDialog::_on_replace_text_entered)); _replace_text_line_edit->hide(); gc->add_child(_replace_text_line_edit); @@ -362,7 +362,7 @@ FindInFilesDialog::FindInFilesDialog() { hbc->add_child(prefix_label); _folder_line_edit = memnew(LineEdit); - _folder_line_edit->set_h_size_flags(SIZE_EXPAND_FILL); + _folder_line_edit->set_h_size_flags(Control::SIZE_EXPAND_FILL); hbc->add_child(_folder_line_edit); Button *folder_button = memnew(Button); @@ -371,7 +371,7 @@ FindInFilesDialog::FindInFilesDialog() { hbc->add_child(folder_button); _folder_dialog = memnew(FileDialog); - _folder_dialog->set_mode(FileDialog::MODE_OPEN_DIR); + _folder_dialog->set_file_mode(FileDialog::FILE_MODE_OPEN_DIR); _folder_dialog->connect("dir_selected", callable_mp(this, &FindInFilesDialog::_on_folder_selected)); add_child(_folder_dialog); @@ -464,6 +464,7 @@ Set<String> FindInFilesDialog::get_filter() const { void FindInFilesDialog::_notification(int p_what) { if (p_what == NOTIFICATION_VISIBILITY_CHANGED) { + if (is_visible()) { // Doesn't work more than once if not deferred... _search_text_line_edit->call_deferred("grab_focus"); @@ -576,7 +577,7 @@ FindInFilesPanel::FindInFilesPanel() { hbc->add_child(find_label); _search_text_label = memnew(Label); - _search_text_label->add_font_override("font", EditorNode::get_singleton()->get_gui_base()->get_font("source", "EditorFonts")); + _search_text_label->add_theme_font_override("font", EditorNode::get_singleton()->get_gui_base()->get_theme_font("source", "EditorFonts")); hbc->add_child(_search_text_label); _progress_bar = memnew(ProgressBar); @@ -604,7 +605,7 @@ FindInFilesPanel::FindInFilesPanel() { } _results_display = memnew(Tree); - _results_display->add_font_override("font", EditorNode::get_singleton()->get_gui_base()->get_font("source", "EditorFonts")); + _results_display->add_theme_font_override("font", EditorNode::get_singleton()->get_gui_base()->get_theme_font("source", "EditorFonts")); _results_display->set_v_size_flags(SIZE_EXPAND_FILL); _results_display->connect("item_selected", callable_mp(this, &FindInFilesPanel::_on_result_selected)); _results_display->connect("item_edited", callable_mp(this, &FindInFilesPanel::_on_item_edited)); @@ -707,7 +708,7 @@ void FindInFilesPanel::_on_result_found(String fpath, int line_number, int begin TreeItem *file_item; Map<String, TreeItem *>::Element *E = _file_items.find(fpath); - if (E == NULL) { + if (E == nullptr) { file_item = _results_display->create_item(); file_item->set_text(0, fpath); file_item->set_metadata(0, fpath); @@ -734,7 +735,7 @@ void FindInFilesPanel::_on_result_found(String fpath, int line_number, int begin item->set_text(text_index, item_text); item->set_custom_draw(text_index, this, "_draw_result_text"); - Ref<Font> font = _results_display->get_font("font"); + Ref<Font> font = _results_display->get_theme_font("font"); float raw_text_width = font->get_string_size(text).x; float item_text_width = font->get_string_size(item_text).x; @@ -780,11 +781,11 @@ void FindInFilesPanel::_on_item_edited() { TreeItem *item = _results_display->get_selected(); if (item->is_checked(0)) { - item->set_custom_color(1, _results_display->get_color("font_color")); + item->set_custom_color(1, _results_display->get_theme_color("font_color")); } else { // Grey out - Color color = _results_display->get_color("font_color"); + Color color = _results_display->get_theme_color("font_color"); color.a /= 2.0; item->set_custom_color(1, color); } @@ -812,7 +813,7 @@ void FindInFilesPanel::_on_result_selected() { TreeItem *item = _results_display->get_selected(); Map<TreeItem *, Result>::Element *E = _result_items.find(item); - if (E == NULL) + if (E == nullptr) return; Result r = E->value(); @@ -844,7 +845,7 @@ void FindInFilesPanel::_on_replace_all_clicked() { continue; Map<TreeItem *, Result>::Element *F = _result_items.find(item); - ERR_FAIL_COND(F == NULL); + ERR_FAIL_COND(F == nullptr); locations.push_back(F->value()); } diff --git a/editor/find_in_files.h b/editor/find_in_files.h index 7002f750b7..41adb156b6 100644 --- a/editor/find_in_files.h +++ b/editor/find_in_files.h @@ -120,10 +120,11 @@ public: Set<String> get_filter() const; protected: - static void _bind_methods(); - void _notification(int p_what); + + void _visibility_changed(); void custom_action(const String &p_action); + static void _bind_methods(); private: void _on_folder_button_pressed(); diff --git a/editor/groups_editor.cpp b/editor/groups_editor.cpp index b4c9a01f2a..7e5d2e87d6 100644 --- a/editor/groups_editor.cpp +++ b/editor/groups_editor.cpp @@ -68,7 +68,7 @@ void GroupDialog::_load_nodes(Node *p_current) { keep = false; } - TreeItem *node = NULL; + TreeItem *node = nullptr; NodePath path = scene_tree->get_edited_scene_root()->get_path_to(p_current); if (keep && p_current->is_in_group(selected_group)) { if (remove_filter->get_text().is_subsequence_ofi(String(p_current->get_name()))) { @@ -94,7 +94,7 @@ void GroupDialog::_load_nodes(Node *p_current) { if (!_can_edit(p_current, selected_group)) { node->set_selectable(0, false); - node->set_custom_color(0, get_color("disabled_font_color", "Editor")); + node->set_custom_color(0, groups->get_theme_color("disabled_font_color", "Editor")); } } @@ -122,7 +122,7 @@ bool GroupDialog::_can_edit(Node *p_node, String p_group) { } void GroupDialog::_add_pressed() { - TreeItem *selected = nodes_to_add->get_next_selected(NULL); + TreeItem *selected = nodes_to_add->get_next_selected(nullptr); if (!selected) { return; @@ -151,7 +151,7 @@ void GroupDialog::_add_pressed() { } void GroupDialog::_removed_pressed() { - TreeItem *selected = nodes_to_remove->get_next_selected(NULL); + TreeItem *selected = nodes_to_remove->get_next_selected(nullptr); if (!selected) { return; @@ -204,7 +204,7 @@ void GroupDialog::_add_group(String p_name) { TreeItem *new_group = groups->create_item(groups_root); new_group->set_text(0, name); - new_group->add_button(0, get_icon("Remove", "EditorIcons"), 0); + new_group->add_button(0, groups->get_theme_icon("Remove", "EditorIcons"), 0); new_group->set_editable(0, true); new_group->select(0); groups->ensure_cursor_is_visible(); @@ -361,12 +361,12 @@ void GroupDialog::_delete_group_item(const String &p_name) { void GroupDialog::_notification(int p_what) { switch (p_what) { case NOTIFICATION_ENTER_TREE: { - add_button->set_icon(get_icon("Forward", "EditorIcons")); - remove_button->set_icon(get_icon("Back", "EditorIcons")); + add_button->set_icon(groups->get_theme_icon("Forward", "EditorIcons")); + remove_button->set_icon(groups->get_theme_icon("Back", "EditorIcons")); - add_filter->set_right_icon(get_icon("Search", "EditorIcons")); + add_filter->set_right_icon(groups->get_theme_icon("Search", "EditorIcons")); add_filter->set_clear_button_enabled(true); - remove_filter->set_right_icon(get_icon("Search", "EditorIcons")); + remove_filter->set_right_icon(groups->get_theme_icon("Search", "EditorIcons")); remove_filter->set_clear_button_enabled(true); } break; } @@ -399,21 +399,21 @@ void GroupDialog::_bind_methods() { } GroupDialog::GroupDialog() { - set_custom_minimum_size(Size2(600, 400) * EDSCALE); + set_min_size(Size2(600, 400) * EDSCALE); scene_tree = SceneTree::get_singleton(); VBoxContainer *vbc = memnew(VBoxContainer); add_child(vbc); - vbc->set_anchors_and_margins_preset(PRESET_WIDE, PRESET_MODE_KEEP_SIZE, 8 * EDSCALE); + vbc->set_anchors_and_margins_preset(Control::PRESET_WIDE, Control::PRESET_MODE_KEEP_SIZE, 8 * EDSCALE); HBoxContainer *hbc = memnew(HBoxContainer); vbc->add_child(hbc); - hbc->set_v_size_flags(SIZE_EXPAND_FILL); + hbc->set_v_size_flags(Control::SIZE_EXPAND_FILL); VBoxContainer *vbc_left = memnew(VBoxContainer); hbc->add_child(vbc_left); - vbc_left->set_h_size_flags(SIZE_EXPAND_FILL); + vbc_left->set_h_size_flags(Control::SIZE_EXPAND_FILL); Label *group_title = memnew(Label); group_title->set_text(TTR("Groups")); @@ -425,19 +425,19 @@ GroupDialog::GroupDialog() { groups->set_select_mode(Tree::SELECT_SINGLE); groups->set_allow_reselect(true); groups->set_allow_rmb_select(true); - groups->set_v_size_flags(SIZE_EXPAND_FILL); - groups->add_constant_override("draw_guides", 1); + groups->set_v_size_flags(Control::SIZE_EXPAND_FILL); + groups->add_theme_constant_override("draw_guides", 1); groups->connect("item_selected", callable_mp(this, &GroupDialog::_group_selected)); groups->connect("button_pressed", callable_mp(this, &GroupDialog::_delete_group_pressed)); groups->connect("item_edited", callable_mp(this, &GroupDialog::_group_renamed)); HBoxContainer *chbc = memnew(HBoxContainer); vbc_left->add_child(chbc); - chbc->set_h_size_flags(SIZE_EXPAND_FILL); + chbc->set_h_size_flags(Control::SIZE_EXPAND_FILL); add_group_text = memnew(LineEdit); chbc->add_child(add_group_text); - add_group_text->set_h_size_flags(SIZE_EXPAND_FILL); + add_group_text->set_h_size_flags(Control::SIZE_EXPAND_FILL); add_group_text->connect("text_entered", callable_mp(this, &GroupDialog::_add_group_pressed)); Button *add_group_button = memnew(Button); @@ -447,7 +447,7 @@ GroupDialog::GroupDialog() { VBoxContainer *vbc_add = memnew(VBoxContainer); hbc->add_child(vbc_add); - vbc_add->set_h_size_flags(SIZE_EXPAND_FILL); + vbc_add->set_h_size_flags(Control::SIZE_EXPAND_FILL); Label *out_of_group_title = memnew(Label); out_of_group_title->set_text(TTR("Nodes Not in Group")); @@ -458,23 +458,23 @@ GroupDialog::GroupDialog() { nodes_to_add->set_hide_root(true); nodes_to_add->set_hide_folding(true); nodes_to_add->set_select_mode(Tree::SELECT_MULTI); - nodes_to_add->set_v_size_flags(SIZE_EXPAND_FILL); - nodes_to_add->add_constant_override("draw_guides", 1); + nodes_to_add->set_v_size_flags(Control::SIZE_EXPAND_FILL); + nodes_to_add->add_theme_constant_override("draw_guides", 1); HBoxContainer *add_filter_hbc = memnew(HBoxContainer); - add_filter_hbc->add_constant_override("separate", 0); + add_filter_hbc->add_theme_constant_override("separate", 0); vbc_add->add_child(add_filter_hbc); add_filter = memnew(LineEdit); - add_filter->set_h_size_flags(SIZE_EXPAND_FILL); + add_filter->set_h_size_flags(Control::SIZE_EXPAND_FILL); add_filter->set_placeholder(TTR("Filter nodes")); add_filter_hbc->add_child(add_filter); add_filter->connect("text_changed", callable_mp(this, &GroupDialog::_add_filter_changed)); VBoxContainer *vbc_buttons = memnew(VBoxContainer); hbc->add_child(vbc_buttons); - vbc_buttons->set_h_size_flags(SIZE_SHRINK_CENTER); - vbc_buttons->set_v_size_flags(SIZE_SHRINK_CENTER); + vbc_buttons->set_h_size_flags(Control::SIZE_SHRINK_CENTER); + vbc_buttons->set_v_size_flags(Control::SIZE_SHRINK_CENTER); add_button = memnew(ToolButton); add_button->set_text(TTR("Add")); @@ -493,7 +493,7 @@ GroupDialog::GroupDialog() { VBoxContainer *vbc_remove = memnew(VBoxContainer); hbc->add_child(vbc_remove); - vbc_remove->set_h_size_flags(SIZE_EXPAND_FILL); + vbc_remove->set_h_size_flags(Control::SIZE_EXPAND_FILL); Label *in_group_title = memnew(Label); in_group_title->set_text(TTR("Nodes in Group")); @@ -501,18 +501,18 @@ GroupDialog::GroupDialog() { nodes_to_remove = memnew(Tree); vbc_remove->add_child(nodes_to_remove); - nodes_to_remove->set_v_size_flags(SIZE_EXPAND_FILL); + nodes_to_remove->set_v_size_flags(Control::SIZE_EXPAND_FILL); nodes_to_remove->set_hide_root(true); nodes_to_remove->set_hide_folding(true); nodes_to_remove->set_select_mode(Tree::SELECT_MULTI); - nodes_to_remove->add_constant_override("draw_guides", 1); + nodes_to_remove->add_theme_constant_override("draw_guides", 1); HBoxContainer *remove_filter_hbc = memnew(HBoxContainer); - remove_filter_hbc->add_constant_override("separate", 0); + remove_filter_hbc->add_theme_constant_override("separate", 0); vbc_remove->add_child(remove_filter_hbc); remove_filter = memnew(LineEdit); - remove_filter->set_h_size_flags(SIZE_EXPAND_FILL); + remove_filter->set_h_size_flags(Control::SIZE_EXPAND_FILL); remove_filter->set_placeholder(TTR("Filter nodes")); remove_filter_hbc->add_child(remove_filter); remove_filter->connect("text_changed", callable_mp(this, &GroupDialog::_remove_filter_changed)); @@ -524,11 +524,9 @@ GroupDialog::GroupDialog() { group_empty->set_autowrap(true); group_empty->set_custom_minimum_size(Size2(100 * EDSCALE, 0)); nodes_to_remove->add_child(group_empty); - group_empty->set_anchors_and_margins_preset(PRESET_WIDE, PRESET_MODE_KEEP_SIZE, 8 * EDSCALE); + group_empty->set_anchors_and_margins_preset(Control::PRESET_WIDE, Control::PRESET_MODE_KEEP_SIZE, 8 * EDSCALE); set_title(TTR("Group Editor")); - set_as_toplevel(true); - set_resizable(true); error = memnew(ConfirmationDialog); add_child(error); @@ -639,7 +637,7 @@ void GroupsEditor::update_tree() { TreeItem *item = tree->create_item(root); item->set_text(0, gi.name); if (can_be_deleted) { - item->add_button(0, get_icon("Remove", "EditorIcons"), 0); + item->add_button(0, get_theme_icon("Remove", "EditorIcons"), 0); } else { item->set_selectable(0, false); } @@ -664,12 +662,12 @@ void GroupsEditor::_bind_methods() { GroupsEditor::GroupsEditor() { - node = NULL; + node = nullptr; VBoxContainer *vbc = this; group_dialog = memnew(GroupDialog); - group_dialog->set_as_toplevel(true); + add_child(group_dialog); group_dialog->connect("group_edited", callable_mp(this, &GroupsEditor::update_tree)); @@ -682,7 +680,7 @@ GroupsEditor::GroupsEditor() { vbc->add_child(hbc); group_name = memnew(LineEdit); - group_name->set_h_size_flags(SIZE_EXPAND_FILL); + group_name->set_h_size_flags(Control::SIZE_EXPAND_FILL); hbc->add_child(group_name); group_name->connect("text_entered", callable_mp(this, &GroupsEditor::_add_group)); @@ -693,11 +691,11 @@ GroupsEditor::GroupsEditor() { tree = memnew(Tree); tree->set_hide_root(true); - tree->set_v_size_flags(SIZE_EXPAND_FILL); + tree->set_v_size_flags(Control::SIZE_EXPAND_FILL); vbc->add_child(tree); tree->connect("button_pressed", callable_mp(this, &GroupsEditor::_remove_group)); - tree->add_constant_override("draw_guides", 1); - add_constant_override("separation", 3 * EDSCALE); + tree->add_theme_constant_override("draw_guides", 1); + add_theme_constant_override("separation", 3 * EDSCALE); } GroupsEditor::~GroupsEditor() { diff --git a/editor/groups_editor.h b/editor/groups_editor.h index 84c653bdea..40c7b3c75a 100644 --- a/editor/groups_editor.h +++ b/editor/groups_editor.h @@ -41,9 +41,9 @@ #include "scene/gui/tool_button.h" #include "scene/gui/tree.h" -class GroupDialog : public WindowDialog { +class GroupDialog : public AcceptDialog { - GDCLASS(GroupDialog, WindowDialog); + GDCLASS(GroupDialog, AcceptDialog); ConfirmationDialog *error; diff --git a/editor/icons/AcceptDialog.svg b/editor/icons/AcceptDialog.svg index e0bf7b8336..07e54d722f 100644 --- a/editor/icons/AcceptDialog.svg +++ b/editor/icons/AcceptDialog.svg @@ -1 +1 @@ -<svg height="16" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"><path d="m3 1c-1.1046 0-2 .8954-2 2v1h14v-1c0-1.1046-.89543-2-2-2zm9 1h1v1h-1zm-11 3v8c0 1.1046.89543 2 2 2h10c1.1046 0 2-.8954 2-2v-8zm9.4746 1.6367 1.4141 1.4141-4.9492 4.9492-2.8281-2.8281 1.4141-1.4141 1.4141 1.4141z" fill="#a5efac"/></svg>
\ No newline at end of file +<svg height="16" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"><path d="m3 1c-1.1046 0-2 .8954-2 2v1h14v-1c0-1.1046-.89543-2-2-2zm9 1h1v1h-1zm-11 3v8c0 1.1046.89543 2 2 2h10c1.1046 0 2-.8954 2-2v-8zm9.4746 1.6367 1.4141 1.4141-4.9492 4.9492-2.8281-2.8281 1.4141-1.4141 1.4141 1.4141z" fill="#e0e0e0"/></svg>
\ No newline at end of file diff --git a/editor/icons/AnimatedSprite.svg b/editor/icons/AnimatedSprite2D.svg index 411ddda015..411ddda015 100644 --- a/editor/icons/AnimatedSprite.svg +++ b/editor/icons/AnimatedSprite2D.svg diff --git a/editor/icons/Area.svg b/editor/icons/Area3D.svg index 21ebe3c251..21ebe3c251 100644 --- a/editor/icons/Area.svg +++ b/editor/icons/Area3D.svg diff --git a/editor/icons/BoneAttachment.svg b/editor/icons/BoneAttachment3D.svg index 0b7dede0b6..0b7dede0b6 100644 --- a/editor/icons/BoneAttachment.svg +++ b/editor/icons/BoneAttachment3D.svg diff --git a/editor/icons/BoxShape.svg b/editor/icons/BoxShape3D.svg index 171e95f4fa..171e95f4fa 100644 --- a/editor/icons/BoxShape.svg +++ b/editor/icons/BoxShape3D.svg diff --git a/editor/icons/CPUParticles.svg b/editor/icons/CPUParticles3D.svg index af4115c93f..af4115c93f 100644 --- a/editor/icons/CPUParticles.svg +++ b/editor/icons/CPUParticles3D.svg diff --git a/editor/icons/Camera.svg b/editor/icons/Camera3D.svg index af1cb8a2e9..af1cb8a2e9 100644 --- a/editor/icons/Camera.svg +++ b/editor/icons/Camera3D.svg diff --git a/editor/icons/CapsuleShape.svg b/editor/icons/CapsuleShape3D.svg index ba035ca196..ba035ca196 100644 --- a/editor/icons/CapsuleShape.svg +++ b/editor/icons/CapsuleShape3D.svg diff --git a/editor/icons/ClippedCamera.svg b/editor/icons/ClippedCamera3D.svg index 8c80c04e27..8c80c04e27 100644 --- a/editor/icons/ClippedCamera.svg +++ b/editor/icons/ClippedCamera3D.svg diff --git a/editor/icons/CollisionPolygon.svg b/editor/icons/CollisionPolygon3D.svg index 5e849ae4e3..5e849ae4e3 100644 --- a/editor/icons/CollisionPolygon.svg +++ b/editor/icons/CollisionPolygon3D.svg diff --git a/editor/icons/CollisionShape.svg b/editor/icons/CollisionShape3D.svg index 8f14996a97..8f14996a97 100644 --- a/editor/icons/CollisionShape.svg +++ b/editor/icons/CollisionShape3D.svg diff --git a/editor/icons/ConcavePolygonShape.svg b/editor/icons/ConcavePolygonShape3D.svg index 001ab82826..001ab82826 100644 --- a/editor/icons/ConcavePolygonShape.svg +++ b/editor/icons/ConcavePolygonShape3D.svg diff --git a/editor/icons/ConeTwistJoint.svg b/editor/icons/ConeTwistJoint3D.svg index 0e5e98a17b..0e5e98a17b 100644 --- a/editor/icons/ConeTwistJoint.svg +++ b/editor/icons/ConeTwistJoint3D.svg diff --git a/editor/icons/ConfirmationDialog.svg b/editor/icons/ConfirmationDialog.svg index d1f13fbb3b..2d6e45b51f 100644 --- a/editor/icons/ConfirmationDialog.svg +++ b/editor/icons/ConfirmationDialog.svg @@ -1 +1 @@ -<svg height="16" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"><path d="m3 1c-1.1046 0-2 .8954-2 2v1h14v-1c0-1.1046-.89543-2-2-2zm9 1h1v1h-1zm-11 3v8c0 1.1046.89543 2 2 2h10c1.1046 0 2-.8954 2-2v-8zm6.9863 1.002c.34689-.0022844.6986.055762 1.0391.17969 1.3618.4956 2.1813 1.9126 1.9297 3.3398-.19105 1.0835-.96172 1.9461-1.9551 2.3008v.17773h-1-1v-.8418a1.0001 1.0001 0 0 1 1-1.1582c.49193 0 .89895-.34177.98438-.82617.085424-.4845-.18031-.94508-.64258-1.1133-.46227-.1683-.96106.013453-1.207.43945a1.0002 1.0002 0 0 1 -1.7324-1c.54346-.94148 1.5433-1.4912 2.584-1.498zm-.98633 6.998h2v1h-2z" fill="#a5efac"/></svg>
\ No newline at end of file +<svg height="16" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"><path d="m3 1c-1.1046 0-2 .8954-2 2v1h14v-1c0-1.1046-.89543-2-2-2zm9 1h1v1h-1zm-11 3v8c0 1.1046.89543 2 2 2h10c1.1046 0 2-.8954 2-2v-8zm6.9863 1.002c.34689-.0022844.6986.055762 1.0391.17969 1.3618.4956 2.1813 1.9126 1.9297 3.3398-.19105 1.0835-.96172 1.9461-1.9551 2.3008v.17773h-1-1v-.8418a1.0001 1.0001 0 0 1 1-1.1582c.49193 0 .89895-.34177.98438-.82617.085424-.4845-.18031-.94508-.64258-1.1133-.46227-.1683-.96106.013453-1.207.43945a1.0002 1.0002 0 0 1 -1.7324-1c.54346-.94148 1.5433-1.4912 2.584-1.498zm-.98633 6.998h2v1h-2z" fill="#e0e0e0"/></svg>
\ No newline at end of file diff --git a/editor/icons/ConvexPolygonShape.svg b/editor/icons/ConvexPolygonShape3D.svg index bfb9230586..bfb9230586 100644 --- a/editor/icons/ConvexPolygonShape.svg +++ b/editor/icons/ConvexPolygonShape3D.svg diff --git a/editor/icons/CylinderShape.svg b/editor/icons/CylinderShape3D.svg index f0aa5833d2..f0aa5833d2 100644 --- a/editor/icons/CylinderShape.svg +++ b/editor/icons/CylinderShape3D.svg diff --git a/editor/icons/DirectionalLight.svg b/editor/icons/DirectionalLight3D.svg index faac2be134..faac2be134 100644 --- a/editor/icons/DirectionalLight.svg +++ b/editor/icons/DirectionalLight3D.svg diff --git a/editor/icons/PopupDialog.svg b/editor/icons/EditorFileDialog.svg index d871e56a63..95906234ab 100644 --- a/editor/icons/PopupDialog.svg +++ b/editor/icons/EditorFileDialog.svg @@ -1 +1 @@ -<svg height="16" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"><path d="m3 1c-1.1046 0-2 .8954-2 2v1h14v-1c0-1.1046-.89543-2-2-2zm9 1h1v1h-1zm-11 3v8c0 1.1046.89543 2 2 2h10c1.1046 0 2-.8954 2-2v-8zm6 1h2v5h-2zm0 6h2v2h-2z" fill="#a5efac"/></svg>
\ No newline at end of file +<svg height="16" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"><path d="m3 1c-1.1046 0-2 .8954-2 2v1h14v-1c0-1.1046-.89543-2-2-2zm9 1h1v1h-1zm-11 3v8c0 1.1046.89543 2 2 2h10c1.1046 0 2-.8954 2-2v-8zm3 2h3c1 0 1 2 2 2h3v4h-8z" fill="#e0e0e0"/></svg>
\ No newline at end of file diff --git a/editor/icons/FileDialog.svg b/editor/icons/FileDialog.svg index 7708659c21..95906234ab 100644 --- a/editor/icons/FileDialog.svg +++ b/editor/icons/FileDialog.svg @@ -1 +1 @@ -<svg height="16" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"><path d="m3 1c-1.1046 0-2 .8954-2 2v1h14v-1c0-1.1046-.89543-2-2-2zm9 1h1v1h-1zm-11 3v8c0 1.1046.89543 2 2 2h10c1.1046 0 2-.8954 2-2v-8zm3 2h3c1 0 1 2 2 2h3v4h-8z" fill="#a5efac"/></svg>
\ No newline at end of file +<svg height="16" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"><path d="m3 1c-1.1046 0-2 .8954-2 2v1h14v-1c0-1.1046-.89543-2-2-2zm9 1h1v1h-1zm-11 3v8c0 1.1046.89543 2 2 2h10c1.1046 0 2-.8954 2-2v-8zm3 2h3c1 0 1 2 2 2h3v4h-8z" fill="#e0e0e0"/></svg>
\ No newline at end of file diff --git a/editor/icons/Particles2D.svg b/editor/icons/GPUParticles2D.svg index 7151194e36..7151194e36 100644 --- a/editor/icons/Particles2D.svg +++ b/editor/icons/GPUParticles2D.svg diff --git a/editor/icons/Particles.svg b/editor/icons/GPUParticles3D.svg index f1378e3f8c..f1378e3f8c 100644 --- a/editor/icons/Particles.svg +++ b/editor/icons/GPUParticles3D.svg diff --git a/editor/icons/Generic6DOFJoint.svg b/editor/icons/Generic6DOFJoint3D.svg index 30d892e7a1..30d892e7a1 100644 --- a/editor/icons/Generic6DOFJoint.svg +++ b/editor/icons/Generic6DOFJoint3D.svg diff --git a/editor/icons/GizmoSpatialSamplePlayer.svg b/editor/icons/Gizmo3DSamplePlayer.svg index ee471124dc..ee471124dc 100644 --- a/editor/icons/GizmoSpatialSamplePlayer.svg +++ b/editor/icons/Gizmo3DSamplePlayer.svg diff --git a/editor/icons/GizmoCPUParticles.svg b/editor/icons/GizmoCPUParticles3D.svg index d4e86d9c42..d4e86d9c42 100644 --- a/editor/icons/GizmoCPUParticles.svg +++ b/editor/icons/GizmoCPUParticles3D.svg diff --git a/editor/icons/GizmoParticles.svg b/editor/icons/GizmoGPUParticles3D.svg index 1c5d8c5f2d..1c5d8c5f2d 100644 --- a/editor/icons/GizmoParticles.svg +++ b/editor/icons/GizmoGPUParticles3D.svg diff --git a/editor/icons/HeightMapShape.svg b/editor/icons/HeightMapShape3D.svg index 2e0bf53565..2e0bf53565 100644 --- a/editor/icons/HeightMapShape.svg +++ b/editor/icons/HeightMapShape3D.svg diff --git a/editor/icons/HingeJoint.svg b/editor/icons/HingeJoint3D.svg index 21b3e29cb5..21b3e29cb5 100644 --- a/editor/icons/HingeJoint.svg +++ b/editor/icons/HingeJoint3D.svg diff --git a/editor/icons/ImmediateGeometry.svg b/editor/icons/ImmediateGeometry3D.svg index 5679d5906f..5679d5906f 100644 --- a/editor/icons/ImmediateGeometry.svg +++ b/editor/icons/ImmediateGeometry3D.svg diff --git a/editor/icons/KinematicBody.svg b/editor/icons/KinematicBody3D.svg index 16078fbdec..16078fbdec 100644 --- a/editor/icons/KinematicBody.svg +++ b/editor/icons/KinematicBody3D.svg diff --git a/editor/icons/Listener.svg b/editor/icons/Listener3D.svg index 96eaeaffa9..96eaeaffa9 100644 --- a/editor/icons/Listener.svg +++ b/editor/icons/Listener3D.svg diff --git a/editor/icons/MeshInstance.svg b/editor/icons/MeshInstance3D.svg index 68344b7dbd..68344b7dbd 100644 --- a/editor/icons/MeshInstance.svg +++ b/editor/icons/MeshInstance3D.svg diff --git a/editor/icons/MultiMeshInstance.svg b/editor/icons/MultiMeshInstance3D.svg index c114a725db..c114a725db 100644 --- a/editor/icons/MultiMeshInstance.svg +++ b/editor/icons/MultiMeshInstance3D.svg diff --git a/editor/icons/Navigation.svg b/editor/icons/Navigation3D.svg index d5a8f8618b..d5a8f8618b 100644 --- a/editor/icons/Navigation.svg +++ b/editor/icons/Navigation3D.svg diff --git a/editor/icons/NavigationAgent.svg b/editor/icons/NavigationAgent3D.svg index 44c991d44c..44c991d44c 100644 --- a/editor/icons/NavigationAgent.svg +++ b/editor/icons/NavigationAgent3D.svg diff --git a/editor/icons/NavigationObstacle.svg b/editor/icons/NavigationObstacle3D.svg index 42481a6067..42481a6067 100644 --- a/editor/icons/NavigationObstacle.svg +++ b/editor/icons/NavigationObstacle3D.svg diff --git a/editor/icons/NavigationRegion.svg b/editor/icons/NavigationRegion3D.svg index 61f43497b4..61f43497b4 100644 --- a/editor/icons/NavigationRegion.svg +++ b/editor/icons/NavigationRegion3D.svg diff --git a/editor/icons/Spatial.svg b/editor/icons/Node3D.svg index 6a469dde13..6a469dde13 100644 --- a/editor/icons/Spatial.svg +++ b/editor/icons/Node3D.svg diff --git a/editor/icons/OmniLight.svg b/editor/icons/OmniLight3D.svg index 6fa0454e8c..6fa0454e8c 100644 --- a/editor/icons/OmniLight.svg +++ b/editor/icons/OmniLight3D.svg diff --git a/editor/icons/Path.svg b/editor/icons/Path3D.svg index cde9a06903..cde9a06903 100644 --- a/editor/icons/Path.svg +++ b/editor/icons/Path3D.svg diff --git a/editor/icons/PathFollow.svg b/editor/icons/PathFollow3D.svg index 8e904ab5a5..8e904ab5a5 100644 --- a/editor/icons/PathFollow.svg +++ b/editor/icons/PathFollow3D.svg diff --git a/editor/icons/PhysicalBone.svg b/editor/icons/PhysicalBone3D.svg index 0a34eb6e48..0a34eb6e48 100644 --- a/editor/icons/PhysicalBone.svg +++ b/editor/icons/PhysicalBone3D.svg diff --git a/editor/icons/PinJoint.svg b/editor/icons/PinJoint3D.svg index 147553d316..147553d316 100644 --- a/editor/icons/PinJoint.svg +++ b/editor/icons/PinJoint3D.svg diff --git a/editor/icons/Popup.svg b/editor/icons/Popup.svg index 93f7e5000d..a497b7a7fc 100644 --- a/editor/icons/Popup.svg +++ b/editor/icons/Popup.svg @@ -1 +1 @@ -<svg height="16" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"><path d="m3 1c-1.1046 0-2 .89543-2 2v10c0 1.1046.89543 2 2 2h10c1.1046 0 2-.89543 2-2v-10c0-1.1046-.89543-2-2-2zm4 2h2v6h-2zm0 8h2v2h-2z" fill="#a5efac"/></svg>
\ No newline at end of file +<svg height="16" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"><path d="m3 1c-1.1046 0-2 .89543-2 2v10c0 1.1046.89543 2 2 2h10c1.1046 0 2-.89543 2-2v-10c0-1.1046-.89543-2-2-2zm4 2h2v6h-2zm0 8h2v2h-2z" fill="#e0e0e0"/></svg>
\ No newline at end of file diff --git a/editor/icons/PopupMenu.svg b/editor/icons/PopupMenu.svg index dd7b2bb0fd..ebf62208e0 100644 --- a/editor/icons/PopupMenu.svg +++ b/editor/icons/PopupMenu.svg @@ -1 +1 @@ -<svg height="16" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"><path d="m1 1v4h6v-4zm1 1h4l-2 2zm0 4a1 1 0 0 0 -1 1v7a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-7a1 1 0 0 0 -1-1zm1 2h10v2h-10zm0 3h10v2h-10z" fill="#a5efac"/></svg>
\ No newline at end of file +<svg height="16" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"><path d="m1 1v4h6v-4zm1 1h4l-2 2zm0 4a1 1 0 0 0 -1 1v7a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-7a1 1 0 0 0 -1-1zm1 2h10v2h-10zm0 3h10v2h-10z" fill="#e0e0e0"/></svg>
\ No newline at end of file diff --git a/editor/icons/PopupPanel.svg b/editor/icons/PopupPanel.svg index 47a5448f5b..b45a3c9c3c 100644 --- a/editor/icons/PopupPanel.svg +++ b/editor/icons/PopupPanel.svg @@ -1 +1 @@ -<svg height="16" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"><path d="m1 1v4h6v-4zm1 1h4l-2 2zm0 4c-.55228 0-1 .44772-1 1v7c0 .55228.44772 1 1 1h12c.55228 0 1-.44772 1-1v-7c0-.55228-.44772-1-1-1z" fill="#a5efac"/></svg>
\ No newline at end of file +<svg height="16" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"><path d="m1 1v4h6v-4zm1 1h4l-2 2zm0 4c-.55228 0-1 .44772-1 1v7c0 .55228.44772 1 1 1h12c.55228 0 1-.44772 1-1v-7c0-.55228-.44772-1-1-1z" fill="#e0e0e0"/></svg>
\ No newline at end of file diff --git a/editor/icons/ProximityGroup.svg b/editor/icons/ProximityGroup3D.svg index 7df1cc9093..7df1cc9093 100644 --- a/editor/icons/ProximityGroup.svg +++ b/editor/icons/ProximityGroup3D.svg diff --git a/editor/icons/RayCast.svg b/editor/icons/RayCast3D.svg index e782b27e9f..e782b27e9f 100644 --- a/editor/icons/RayCast.svg +++ b/editor/icons/RayCast3D.svg diff --git a/editor/icons/RayShape.svg b/editor/icons/RayShape3D.svg index 37c2206740..37c2206740 100644 --- a/editor/icons/RayShape.svg +++ b/editor/icons/RayShape3D.svg diff --git a/editor/icons/RemoteTransform.svg b/editor/icons/RemoteTransform3D.svg index 2bdf8cd858..2bdf8cd858 100644 --- a/editor/icons/RemoteTransform.svg +++ b/editor/icons/RemoteTransform3D.svg diff --git a/editor/icons/RigidBody.svg b/editor/icons/RigidBody3D.svg index 5d766f7c3d..5d766f7c3d 100644 --- a/editor/icons/RigidBody.svg +++ b/editor/icons/RigidBody3D.svg diff --git a/editor/icons/SCsub b/editor/icons/SCsub index b39c74c66a..f0d51999f0 100644 --- a/editor/icons/SCsub +++ b/editor/icons/SCsub @@ -1,21 +1,21 @@ #!/usr/bin/env python -Import('env') +Import("env") from platform_methods import run_in_subprocess import editor_icons_builders -make_editor_icons_builder = Builder(action=run_in_subprocess(editor_icons_builders.make_editor_icons_action), - suffix='.h', - src_suffix='.svg') +make_editor_icons_builder = Builder( + action=run_in_subprocess(editor_icons_builders.make_editor_icons_action), suffix=".h", src_suffix=".svg" +) -env['BUILDERS']['MakeEditorIconsBuilder'] = make_editor_icons_builder +env["BUILDERS"]["MakeEditorIconsBuilder"] = make_editor_icons_builder # Editor's own icons icon_sources = Glob("*.svg") # Module icons for module_icons in env.module_icons_paths: - icon_sources += Glob('#' + module_icons + "/*.svg") + icon_sources += Glob("#" + module_icons + "/*.svg") -env.Alias('editor_icons', [env.MakeEditorIconsBuilder('#editor/editor_icons.gen.h', icon_sources)]) +env.Alias("editor_icons", [env.MakeEditorIconsBuilder("#editor/editor_icons.gen.h", icon_sources)]) diff --git a/editor/icons/ScriptCreateDialog.svg b/editor/icons/ScriptCreateDialog.svg index 751b799ba9..78a69c5e59 100644 --- a/editor/icons/ScriptCreateDialog.svg +++ b/editor/icons/ScriptCreateDialog.svg @@ -1 +1 @@ -<svg height="17.067" viewBox="0 0 16 16" width="17.067" xmlns="http://www.w3.org/2000/svg"><g transform="translate(0 -1036.4)"><path d="m6 1v1c-.55228 0-1 .44772-1 1v10h-1v-2h-2v2c.0002826.35698.19084.68674.5.86523.15194.088045.32439.13452.5.13477v1h6v-5l3-2v-3h3v-2c0-1.1046-.89543-2-2-2z" fill="#a5efac" transform="translate(0 1036.4)"/><path d="m6 1c-1.1046 0-2 .89543-2 2v7h-3v3c0 1.1046.89543 2 2 2s2-.89543 2-2v-10c0-.55228.44772-1 1-1s1 .44772 1 1v3h5v-1h-4v-2c0-1.1046-.89543-2-2-2zm-4 10h2v2c0 .55228-.44772 1-1 1s-1-.44772-1-1z" fill="#87e29f" transform="translate(0 1036.4)"/><circle cx="3" cy="1048.4" fill="#e0e0e0" r="0"/><g fill="#87e29f"><ellipse cx="12" cy="1048.4" rx=".5" ry="3"/><ellipse cx="913.91" cy="513.79" rx=".5" ry="3" transform="matrix(.5 .8660254 -.8660254 .5 0 0)"/><ellipse cx="901.91" cy="-534.57" rx=".5" ry="3" transform="matrix(-.5 .8660254 -.8660254 -.5 0 0)"/></g></g></svg>
\ No newline at end of file +<svg height="16" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"><g fill="#e0e0e0"><path d="m3 1c-1.1046 0-2 .8954-2 2v1h14v-1c0-1.1046-.89543-2-2-2zm9 1h1v1h-1zm-11 3v8c0 1.1046.89543 2 2 2h10c1.1046 0 2-.8954 2-2v-8zm5.5722656 1h3.9980464a1.1426143 1.1426143 0 0 1 1.142579 1.1425781v1.1425781h-1.712891-2.2851562v-.5703124-.5722657c0-.6310659-.5115295-1.1425781-1.1425782-1.1425781zm0 .5722656c.3155215 0 .5703125.254791.5703125.5703125v.5722657.5703124.5722657h.5722657 2.2851562v3.9980471a1.1426143 1.1426143 0 0 1 -1.1425781 1.142578h-4c.6310487 0 1.1425781-.511529 1.1425781-1.142578v-5.7128909c0-.0785019.01823-.1545692.046875-.2226562v-.0019531c.02868-.0672829.0683226-.1266374.1191406-.1777344.00097-.00096.0029352-.0010048.0039063-.0019532.0513303-.0508898.1121075-.0944618.1796875-.1230468.0683505-.028909.1437752-.0429688.2226562-.0429688zm-2.2851562 5.1406254h1.1425781v1.142578c0 .315522-.2567441.572265-.5722656.572265-.0776611 0-.15125-.016852-.21875-.044922-.00206-.000799-.0038594-.003049-.0058594-.003906-.0656506-.028192-.1236101-.067817-.1738281-.117187a.57130715.57130715 0 0 1 -.0097656-.009766c-.0490902-.050487-.0893425-.107988-.1171876-.173828-.028908-.06835-.0449218-.143776-.0449218-.222656z"/><circle cx="-23.915255" cy="3.118624" r="0"/></g></svg>
\ No newline at end of file diff --git a/editor/icons/Skeleton.svg b/editor/icons/Skeleton3D.svg index 015c842125..015c842125 100644 --- a/editor/icons/Skeleton.svg +++ b/editor/icons/Skeleton3D.svg diff --git a/editor/icons/SkeletonIK.svg b/editor/icons/SkeletonIK3D.svg index e69f6e8bf3..e69f6e8bf3 100644 --- a/editor/icons/SkeletonIK.svg +++ b/editor/icons/SkeletonIK3D.svg diff --git a/editor/icons/Sky.svg b/editor/icons/Sky.svg new file mode 100644 index 0000000000..356a966fe9 --- /dev/null +++ b/editor/icons/Sky.svg @@ -0,0 +1 @@ +<svg height="16" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><linearGradient id="a" gradientUnits="userSpaceOnUse" x1="8" x2="8" y1="1040.4" y2="1050.4"><stop offset="0" stop-color="#1ec3ff"/><stop offset="1" stop-color="#b2e1ff"/></linearGradient><g transform="translate(0 -1037.4)"><path d="m8 1040.4a7 7 0 0 0 -7 7 7 7 0 0 0 .68555 3h12.631a7 7 0 0 0 .68359-3 7 7 0 0 0 -7-7z" fill="url(#a)"/><path d="m10 7c-.554 0-1 .446-1 1h-1c-.554 0-1 .446-1 1s.446 1 1 1h2c.554 0 1-.446 1-1h1c.554 0 1-.446 1-1s-.446-1-1-1zm-7 3c-.554 0-1 .446-1 1s.446 1 1 1h1c.554 0 1-.446 1-1s-.446-1-1-1z" fill="#fff" transform="translate(0 1037.4)"/></g></svg>
\ No newline at end of file diff --git a/editor/icons/SliderJoint.svg b/editor/icons/SliderJoint3D.svg index fdd7487bbf..fdd7487bbf 100644 --- a/editor/icons/SliderJoint.svg +++ b/editor/icons/SliderJoint3D.svg diff --git a/editor/icons/SoftBody.svg b/editor/icons/SoftBody3D.svg index 2c907df847..2c907df847 100644 --- a/editor/icons/SoftBody.svg +++ b/editor/icons/SoftBody3D.svg diff --git a/editor/icons/SpatialMaterial.svg b/editor/icons/SpatialMaterial.svg deleted file mode 100644 index cfd994a0fe..0000000000 --- a/editor/icons/SpatialMaterial.svg +++ /dev/null @@ -1 +0,0 @@ -<svg height="16" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"><path d="m7.9629 1.002a1.0001 1.0001 0 0 0 -.41016.10352l-3.7891 1.8945h8.4727l-3.7891-1.8945a1.0001 1.0001 0 0 0 -.48438-.10352z" fill="#ff7070"/><path d="m3.7637 3-2.2109 1.1055a1.0001 1.0001 0 0 0 -.55273.89453h3.2363l3.7637-1.8809 3.7637 1.8809h3.2363a1.0001 1.0001 0 0 0 -.55273-.89453l-2.2109-1.1055h-8.4727z" fill="#ffeb70"/><path d="m1 5v2h2v-.38086l.76172.38086h8.4766l.76172-.38086v.38086h2v-2h-3.2363l-3.7637 1.8828-3.7637-1.8828h-3.2363z" fill="#9dff70"/><path d="m1 7v2h2v-2zm2.7617 0 3.2383 1.6191v.38086h2v-.38086l3.2383-1.6191zm9.2383 0v2h2v-2z" fill="#70ffb9"/><path d="m1 9v2h3.2344l-1.2344-.61719v-1.3828h-2zm6 0v2h2v-2zm6 0v1.3828l-1.2344.61719h3.2344v-2h-2z" fill="#70deff"/><path d="m3.7637 13 3.7891 1.8945a1.0001 1.0001 0 0 0 .48438.10547 1.0001 1.0001 0 0 0 .41016-.10547l3.7891-1.8945h-8.4727z" fill="#ff70ac"/><path d="m1 11a1.0001 1.0001 0 0 0 .55273.89453l2.2109 1.1055h8.4727l2.2109-1.1055a1.0001 1.0001 0 0 0 .55273-.89453h-3.2344l-2.7656 1.3828v-1.3828h-2v1.3828l-2.7656-1.3828h-3.2344z" fill="#9f70ff"/></svg>
\ No newline at end of file diff --git a/editor/icons/SphereShape.svg b/editor/icons/SphereShape3D.svg index 4da18a1a38..4da18a1a38 100644 --- a/editor/icons/SphereShape.svg +++ b/editor/icons/SphereShape3D.svg diff --git a/editor/icons/SpotLight.svg b/editor/icons/SpotLight3D.svg index 6a35ee3890..6a35ee3890 100644 --- a/editor/icons/SpotLight.svg +++ b/editor/icons/SpotLight3D.svg diff --git a/editor/icons/SpringArm.svg b/editor/icons/SpringArm3D.svg index eb0c1ebd7d..eb0c1ebd7d 100644 --- a/editor/icons/SpringArm.svg +++ b/editor/icons/SpringArm3D.svg diff --git a/editor/icons/Sprite.svg b/editor/icons/Sprite2D.svg index 26a10625fc..26a10625fc 100644 --- a/editor/icons/Sprite.svg +++ b/editor/icons/Sprite2D.svg diff --git a/editor/icons/StaticBody.svg b/editor/icons/StaticBody3D.svg index de819bd76b..de819bd76b 100644 --- a/editor/icons/StaticBody.svg +++ b/editor/icons/StaticBody3D.svg diff --git a/editor/icons/SubViewport.svg b/editor/icons/SubViewport.svg new file mode 100644 index 0000000000..103b1006ad --- /dev/null +++ b/editor/icons/SubViewport.svg @@ -0,0 +1 @@ +<svg height="16" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"><path d="m3 2c-.5304.0000801-1.0390625.2108475-1.4140625.5859375-.37509.37501-.5858575.8836225-.5859375 1.4140625v8c.0000803.5304.2108475 1.039063.5859375 1.414062.37501.375091.8836225.585858 1.4140625.585938h10c1.1046 0 2-.89543 2-2v-8c0-1.1046-.89543-2-2-2zm0 1h10c.55228.0000096.99999.44772 1 1v8c-.00001.55228-.44772.99999-1 1h-10c-.55228-.00001-.99999-.44772-1-1v-8c.0000096-.55228.44772-.99999 1-1zm3 1c-.5304.0001-1.0390625.2108375-1.4140625.5859375-.37509.375-.5858575.8836225-.5859375 1.4140625v4c.00008.5304.2108475 1.039062.5859375 1.414062.37501.3751.8836225.585838 1.4140625.585938h4c1.1046 0 2-.8954 2-2v-4c0-1.1046-.89543-2-2-2zm0 1h4c.55228 0 .99999.4477 1 1v4c-.00001.5523-.44772 1-1 1h-4c-.55228 0-.99999-.4477-1-1v-4c.00001-.5523.44772-1 1-1z" fill="#e0e0e0" fill-opacity=".996078"/></svg>
\ No newline at end of file diff --git a/editor/icons/ViewportContainer.svg b/editor/icons/SubViewportContainer.svg index 18dcddc15f..18dcddc15f 100644 --- a/editor/icons/ViewportContainer.svg +++ b/editor/icons/SubViewportContainer.svg diff --git a/editor/icons/VehicleBody.svg b/editor/icons/VehicleBody3D.svg index a509730602..a509730602 100644 --- a/editor/icons/VehicleBody.svg +++ b/editor/icons/VehicleBody3D.svg diff --git a/editor/icons/VehicleWheel.svg b/editor/icons/VehicleWheel3D.svg index bd870c0118..bd870c0118 100644 --- a/editor/icons/VehicleWheel.svg +++ b/editor/icons/VehicleWheel3D.svg diff --git a/editor/icons/VisibilityEnabler.svg b/editor/icons/VisibilityEnabler3D.svg index 70e4f081c2..70e4f081c2 100644 --- a/editor/icons/VisibilityEnabler.svg +++ b/editor/icons/VisibilityEnabler3D.svg diff --git a/editor/icons/VisibilityNotifier.svg b/editor/icons/VisibilityNotifier3D.svg index c908d5c99d..c908d5c99d 100644 --- a/editor/icons/VisibilityNotifier.svg +++ b/editor/icons/VisibilityNotifier3D.svg diff --git a/editor/icons/WindowDialog.svg b/editor/icons/Window.svg index 3c7be2a58d..a02a86d56a 100644 --- a/editor/icons/WindowDialog.svg +++ b/editor/icons/Window.svg @@ -1 +1 @@ -<svg height="16" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"><path d="m3 1c-1.1046 0-2 .8954-2 2v1h14v-1c0-1.1046-.89543-2-2-2zm9 1h1v1h-1zm-11 3v8c0 1.1046.89543 2 2 2h10c1.1046 0 2-.8954 2-2v-8z" fill="#a5efac"/></svg>
\ No newline at end of file +<svg height="16" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"><path d="m3 1c-1.1046 0-2 .8954-2 2v1h14v-1c0-1.1046-.89543-2-2-2zm9 1h1v1h-1zm-11 3v8c0 1.1046.89543 2 2 2h10c1.1046 0 2-.8954 2-2v-8z" fill="#e0e0e0"/></svg>
\ No newline at end of file diff --git a/editor/icons/World.svg b/editor/icons/World3D.svg index 3db96a75a6..3db96a75a6 100644 --- a/editor/icons/World.svg +++ b/editor/icons/World3D.svg diff --git a/editor/icons/WorldMarginShape.svg b/editor/icons/WorldMarginShape.svg deleted file mode 100644 index 2c90cf6d53..0000000000 --- a/editor/icons/WorldMarginShape.svg +++ /dev/null @@ -1 +0,0 @@ -<svg height="16" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"><path d="m1 1044.4 7 3 7-3-7-3z" fill="#a2d2ff" fill-rule="evenodd" transform="translate(0 -1036.4)"/></svg>
\ No newline at end of file diff --git a/editor/icons/PlaneShape.svg b/editor/icons/WorldMarginShape3D.svg index 2c90cf6d53..2c90cf6d53 100644 --- a/editor/icons/PlaneShape.svg +++ b/editor/icons/WorldMarginShape3D.svg diff --git a/editor/icons/ARVRAnchor.svg b/editor/icons/XRAnchor3D.svg index f1571b3fcc..f1571b3fcc 100644 --- a/editor/icons/ARVRAnchor.svg +++ b/editor/icons/XRAnchor3D.svg diff --git a/editor/icons/ARVRCamera.svg b/editor/icons/XRCamera3D.svg index f59a8c8b4a..f59a8c8b4a 100644 --- a/editor/icons/ARVRCamera.svg +++ b/editor/icons/XRCamera3D.svg diff --git a/editor/icons/ARVRController.svg b/editor/icons/XRController3D.svg index 40e5b8dce1..40e5b8dce1 100644 --- a/editor/icons/ARVRController.svg +++ b/editor/icons/XRController3D.svg diff --git a/editor/icons/ARVROrigin.svg b/editor/icons/XROrigin3D.svg index dbb93ba7a5..dbb93ba7a5 100644 --- a/editor/icons/ARVROrigin.svg +++ b/editor/icons/XROrigin3D.svg diff --git a/editor/icons/editor_icons_builders.py b/editor/icons/editor_icons_builders.py index ea2c2e57d1..d7145abe50 100644 --- a/editor/icons/editor_icons_builders.py +++ b/editor/icons/editor_icons_builders.py @@ -3,9 +3,10 @@ All such functions are invoked in a subprocess on Windows to prevent build flakiness. """ + import os +from io import StringIO from platform_methods import subprocess_main -from compat import StringIO def make_editor_icons_action(target, source, env): @@ -21,16 +22,16 @@ def make_editor_icons_action(target, source, env): icons_string.write('\t"') - with open(fname, 'rb') as svgf: + with open(fname, "rb") as svgf: b = svgf.read(1) - while(len(b) == 1): + while len(b) == 1: icons_string.write("\\" + str(hex(ord(b)))[1:]) b = svgf.read(1) icons_string.write('"') if fname != svg_icons[-1]: icons_string.write(",") - icons_string.write('\n') + icons_string.write("\n") s = StringIO() s.write("/* THIS FILE IS GENERATED DO NOT EDIT */\n") @@ -39,7 +40,7 @@ def make_editor_icons_action(target, source, env): s.write("static const int editor_icons_count = {};\n".format(len(svg_icons))) s.write("static const char *editor_icons_sources[] = {\n") s.write(icons_string.getvalue()) - s.write('};\n\n') + s.write("};\n\n") s.write("static const char *editor_icons_names[] = {\n") # this is used to store the indices of thumbnail icons @@ -62,11 +63,11 @@ def make_editor_icons_action(target, source, env): if fname != svg_icons[-1]: s.write(",") - s.write('\n') + s.write("\n") index += 1 - s.write('};\n') + s.write("};\n") if thumb_medium_indices: s.write("\n\n") @@ -90,5 +91,5 @@ def make_editor_icons_action(target, source, env): icons_string.close() -if __name__ == '__main__': +if __name__ == "__main__": subprocess_main(globals()) diff --git a/editor/import/SCsub b/editor/import/SCsub index 2b1e889fb0..359d04e5df 100644 --- a/editor/import/SCsub +++ b/editor/import/SCsub @@ -1,5 +1,5 @@ #!/usr/bin/env python -Import('env') +Import("env") env.add_source_files(env.editor_sources, "*.cpp") diff --git a/editor/collada/collada.cpp b/editor/import/collada.cpp index 8ef9d17083..9e49fa9066 100644 --- a/editor/collada/collada.cpp +++ b/editor/import/collada.cpp @@ -1540,7 +1540,7 @@ Collada::Node *Collada::_parse_visual_node_instance_data(XMLParser &parser) { } if (parser.is_empty()) //nothing else to parse... - return NULL; + return nullptr; while (parser.read() == OK) { @@ -1548,7 +1548,7 @@ Collada::Node *Collada::_parse_visual_node_instance_data(XMLParser &parser) { break; } - return NULL; + return nullptr; } Collada::Node *Collada::_parse_visual_scene_node(XMLParser &parser) { @@ -1572,7 +1572,7 @@ Collada::Node *Collada::_parse_visual_scene_node(XMLParser &parser) { String empty_draw_type = ""; - Node *node = NULL; + Node *node = nullptr; name = parser.has_attribute("name") ? parser.get_attribute_value_safe("name") : parser.get_attribute_value_safe("id"); if (name == "") { @@ -2140,7 +2140,7 @@ void Collada::_create_skeletons(Collada::Node **p_node, NodeSkeleton *p_skeleton NodeJoint *nj = static_cast<NodeJoint *>(node); nj->owner = p_skeleton; } else { - p_skeleton = NULL; + p_skeleton = nullptr; } for (int i = 0; i < node->children.size(); i++) { @@ -2240,7 +2240,7 @@ void Collada::_merge_skeletons2(VisualScene *p_vscene) { SkinControllerData &cd = E->get(); - NodeSkeleton *skeleton = NULL; + NodeSkeleton *skeleton = nullptr; for (Map<String, Transform>::Element *F = cd.bone_rest_map.front(); F; F = F->next()) { @@ -2257,7 +2257,7 @@ void Collada::_merge_skeletons2(VisualScene *p_vscene) { Node *node = state.scene_map[name]; ERR_CONTINUE(node->type != Node::TYPE_JOINT); - NodeSkeleton *sk = NULL; + NodeSkeleton *sk = nullptr; while (node && !sk) { diff --git a/editor/collada/collada.h b/editor/import/collada.h index 4707d7d779..b74332fb22 100644 --- a/editor/collada/collada.h +++ b/editor/import/collada.h @@ -404,7 +404,7 @@ public: Node() { noname = false; type = TYPE_NODE; - parent = NULL; + parent = nullptr; ignore_anim = false; } virtual ~Node() { @@ -424,7 +424,7 @@ public: String sid; NodeJoint() { type = TYPE_JOINT; - owner = NULL; + owner = nullptr; } }; @@ -631,7 +631,7 @@ private: // private stuff String _read_empty_draw_type(XMLParser &parser); void _joint_set_owner(Collada::Node *p_node, NodeSkeleton *p_owner); - void _create_skeletons(Collada::Node **p_node, NodeSkeleton *p_skeleton = NULL); + void _create_skeletons(Collada::Node **p_node, NodeSkeleton *p_skeleton = nullptr); void _find_morph_nodes(VisualScene *p_vscene, Node *p_node); bool _remove_node(Node *p_parent, Node *p_node); void _remove_node(VisualScene *p_vscene, Node *p_node); diff --git a/editor/import/editor_import_collada.cpp b/editor/import/editor_import_collada.cpp index 3cc6e7a50c..697ddfba96 100644 --- a/editor/import/editor_import_collada.cpp +++ b/editor/import/editor_import_collada.cpp @@ -31,14 +31,14 @@ #include "editor_import_collada.h" #include "core/os/os.h" -#include "editor/collada/collada.h" #include "editor/editor_node.h" -#include "scene/3d/camera.h" -#include "scene/3d/light.h" -#include "scene/3d/mesh_instance.h" -#include "scene/3d/path.h" -#include "scene/3d/skeleton.h" -#include "scene/3d/spatial.h" +#include "editor/import/collada.h" +#include "scene/3d/camera_3d.h" +#include "scene/3d/light_3d.h" +#include "scene/3d/mesh_instance_3d.h" +#include "scene/3d/node_3d.h" +#include "scene/3d/path_3d.h" +#include "scene/3d/skeleton_3d.h" #include "scene/animation/animation_player.h" #include "scene/resources/animation.h" #include "scene/resources/packed_scene.h" @@ -47,18 +47,18 @@ struct ColladaImport { Collada collada; - Spatial *scene; + Node3D *scene; Vector<Ref<Animation>> animations; struct NodeMap { //String path; - Spatial *node; + Node3D *node; int bone; List<int> anim_tracks; NodeMap() { - node = NULL; + node = nullptr; bone = -1; } }; @@ -76,17 +76,17 @@ struct ColladaImport { Map<String, Ref<ArrayMesh>> mesh_cache; Map<String, Ref<Curve3D>> curve_cache; Map<String, Ref<Material>> material_cache; - Map<Collada::Node *, Skeleton *> skeleton_map; + Map<Collada::Node *, Skeleton3D *> skeleton_map; - Map<Skeleton *, Map<String, int>> skeleton_bone_map; + Map<Skeleton3D *, Map<String, int>> skeleton_bone_map; Set<String> valid_animated_nodes; Vector<int> valid_animated_properties; Map<String, bool> bones_with_animation; - Error _populate_skeleton(Skeleton *p_skeleton, Collada::Node *p_node, int &r_bone, int p_parent); + Error _populate_skeleton(Skeleton3D *p_skeleton, Collada::Node *p_node, int &r_bone, int p_parent); Error _create_scene_skeletons(Collada::Node *p_node); - Error _create_scene(Collada::Node *p_node, Spatial *p_parent); + Error _create_scene(Collada::Node *p_node, Node3D *p_parent); Error _create_resources(Collada::Node *p_node, bool p_use_compression); Error _create_material(const String &p_target); Error _create_mesh_surfaces(bool p_optimize, Ref<ArrayMesh> &p_mesh, const Map<String, Collada::NodeGeometry::Material> &p_material_map, const Collada::MeshData &meshdata, const Transform &p_local_xform, const Vector<int> &bone_remap, const Collada::SkinControllerData *p_skin_controller, const Collada::MorphControllerData *p_morph_data, Vector<Ref<ArrayMesh>> p_morph_meshes = Vector<Ref<ArrayMesh>>(), bool p_use_compression = false, bool p_use_mesh_material = false); @@ -110,7 +110,7 @@ struct ColladaImport { } }; -Error ColladaImport::_populate_skeleton(Skeleton *p_skeleton, Collada::Node *p_node, int &r_bone, int p_parent) { +Error ColladaImport::_populate_skeleton(Skeleton3D *p_skeleton, Collada::Node *p_node, int &r_bone, int p_parent) { if (p_node->type != Collada::Node::TYPE_JOINT) return OK; @@ -174,7 +174,7 @@ Error ColladaImport::_create_scene_skeletons(Collada::Node *p_node) { if (p_node->type == Collada::Node::TYPE_SKELETON) { - Skeleton *sk = memnew(Skeleton); + Skeleton3D *sk = memnew(Skeleton3D); int bone = 0; for (int i = 0; i < p_node->children.size(); i++) { @@ -193,15 +193,15 @@ Error ColladaImport::_create_scene_skeletons(Collada::Node *p_node) { return OK; } -Error ColladaImport::_create_scene(Collada::Node *p_node, Spatial *p_parent) { +Error ColladaImport::_create_scene(Collada::Node *p_node, Node3D *p_parent) { - Spatial *node = NULL; + Node3D *node = nullptr; switch (p_node->type) { case Collada::Node::TYPE_NODE: { - node = memnew(Spatial); + node = memnew(Node3D); } break; case Collada::Node::TYPE_JOINT: { @@ -223,7 +223,7 @@ Error ColladaImport::_create_scene(Collada::Node *p_node, Spatial *p_parent) { if (!bool(GLOBAL_DEF("collada/use_ambient", false))) return OK; //well, it's an ambient light.. - Light *l = memnew(DirectionalLight); + Light3D *l = memnew(DirectionalLight3D); //l->set_color(Light::COLOR_AMBIENT,ld.color); //l->set_color(Light::COLOR_DIFFUSE,Color(0,0,0)); //l->set_color(Light::COLOR_SPECULAR,Color(0,0,0)); @@ -232,7 +232,7 @@ Error ColladaImport::_create_scene(Collada::Node *p_node, Spatial *p_parent) { } else if (ld.mode == Collada::LightData::MODE_DIRECTIONAL) { //well, it's an ambient light.. - Light *l = memnew(DirectionalLight); + Light3D *l = memnew(DirectionalLight3D); /* if (found_ambient) //use it here l->set_color(Light::COLOR_AMBIENT,ambient); @@ -243,12 +243,12 @@ Error ColladaImport::_create_scene(Collada::Node *p_node, Spatial *p_parent) { node = l; } else { - Light *l; + Light3D *l; if (ld.mode == Collada::LightData::MODE_OMNI) - l = memnew(OmniLight); + l = memnew(OmniLight3D); else { - l = memnew(SpotLight); + l = memnew(SpotLight3D); //l->set_parameter(Light::PARAM_SPOT_ANGLE,ld.spot_angle); //l->set_parameter(Light::PARAM_SPOT_ATTENUATION,ld.spot_exp); } @@ -262,13 +262,13 @@ Error ColladaImport::_create_scene(Collada::Node *p_node, Spatial *p_parent) { } else { - node = memnew(Spatial); + node = memnew(Node3D); } } break; case Collada::Node::TYPE_CAMERA: { Collada::NodeCamera *cam = static_cast<Collada::NodeCamera *>(p_node); - Camera *camera = memnew(Camera); + Camera3D *camera = memnew(Camera3D); if (collada.state.camera_data_map.has(cam->camera)) { @@ -280,12 +280,12 @@ Error ColladaImport::_create_scene(Collada::Node *p_node, Spatial *p_parent) { if (cd.orthogonal.y_mag) { - camera->set_keep_aspect_mode(Camera::KEEP_HEIGHT); + camera->set_keep_aspect_mode(Camera3D::KEEP_HEIGHT); camera->set_orthogonal(cd.orthogonal.y_mag * 2.0, cd.z_near, cd.z_far); } else if (!cd.orthogonal.y_mag && cd.orthogonal.x_mag) { - camera->set_keep_aspect_mode(Camera::KEEP_WIDTH); + camera->set_keep_aspect_mode(Camera3D::KEEP_WIDTH); camera->set_orthogonal(cd.orthogonal.x_mag * 2.0, cd.z_near, cd.z_far); } @@ -314,17 +314,17 @@ Error ColladaImport::_create_scene(Collada::Node *p_node, Spatial *p_parent) { if (collada.state.curve_data_map.has(ng->source)) { - node = memnew(Path); + node = memnew(Path3D); } else { //mesh since nothing else - node = memnew(MeshInstance); - //Object::cast_to<MeshInstance>(node)->set_flag(GeometryInstance::FLAG_USE_BAKED_LIGHT, true); + node = memnew(MeshInstance3D); + //Object::cast_to<MeshInstance3D>(node)->set_flag(GeometryInstance3D::FLAG_USE_BAKED_LIGHT, true); } } break; case Collada::Node::TYPE_SKELETON: { ERR_FAIL_COND_V(!skeleton_map.has(p_node), ERR_CANT_CREATE); - Skeleton *sk = skeleton_map[p_node]; + Skeleton3D *sk = skeleton_map[p_node]; node = sk; } break; } @@ -536,7 +536,7 @@ Error ColladaImport::_create_mesh_surfaces(bool p_optimize, Ref<ArrayMesh> &p_me /* NORMAL SOURCE */ - const Collada::MeshData::Source *normal_src = NULL; + const Collada::MeshData::Source *normal_src = nullptr; int normal_ofs = 0; if (p.sources.has("NORMAL")) { @@ -547,7 +547,7 @@ Error ColladaImport::_create_mesh_surfaces(bool p_optimize, Ref<ArrayMesh> &p_me normal_src = &meshdata.sources[normal_source_id]; } - const Collada::MeshData::Source *binormal_src = NULL; + const Collada::MeshData::Source *binormal_src = nullptr; int binormal_ofs = 0; if (p.sources.has("TEXBINORMAL")) { @@ -558,7 +558,7 @@ Error ColladaImport::_create_mesh_surfaces(bool p_optimize, Ref<ArrayMesh> &p_me binormal_src = &meshdata.sources[binormal_source_id]; } - const Collada::MeshData::Source *tangent_src = NULL; + const Collada::MeshData::Source *tangent_src = nullptr; int tangent_ofs = 0; if (p.sources.has("TEXTANGENT")) { @@ -569,7 +569,7 @@ Error ColladaImport::_create_mesh_surfaces(bool p_optimize, Ref<ArrayMesh> &p_me tangent_src = &meshdata.sources[tangent_source_id]; } - const Collada::MeshData::Source *uv_src = NULL; + const Collada::MeshData::Source *uv_src = nullptr; int uv_ofs = 0; if (p.sources.has("TEXCOORD0")) { @@ -580,7 +580,7 @@ Error ColladaImport::_create_mesh_surfaces(bool p_optimize, Ref<ArrayMesh> &p_me uv_src = &meshdata.sources[uv_source_id]; } - const Collada::MeshData::Source *uv2_src = NULL; + const Collada::MeshData::Source *uv2_src = nullptr; int uv2_ofs = 0; if (p.sources.has("TEXCOORD1")) { @@ -591,7 +591,7 @@ Error ColladaImport::_create_mesh_surfaces(bool p_optimize, Ref<ArrayMesh> &p_me uv2_src = &meshdata.sources[uv2_source_id]; } - const Collada::MeshData::Source *color_src = NULL; + const Collada::MeshData::Source *color_src = nullptr; int color_ofs = 0; if (p.sources.has("COLOR")) { @@ -614,7 +614,7 @@ Error ColladaImport::_create_mesh_surfaces(bool p_optimize, Ref<ArrayMesh> &p_me if (p_skin_controller) { - const Collada::SkinControllerData::Source *weight_src = NULL; + const Collada::SkinControllerData::Source *weight_src = nullptr; int weight_ofs = 0; if (p_skin_controller->weights.sources.has("WEIGHT")) { @@ -922,10 +922,10 @@ Error ColladaImport::_create_mesh_surfaces(bool p_optimize, Ref<ArrayMesh> &p_me if (has_weights) { Vector<float> weights; Vector<int> bones; - weights.resize(VS::ARRAY_WEIGHTS_SIZE); - bones.resize(VS::ARRAY_WEIGHTS_SIZE); + weights.resize(RS::ARRAY_WEIGHTS_SIZE); + bones.resize(RS::ARRAY_WEIGHTS_SIZE); //float sum=0.0; - for (int l = 0; l < VS::ARRAY_WEIGHTS_SIZE; l++) { + for (int l = 0; l < RS::ARRAY_WEIGHTS_SIZE; l++) { if (l < vertex_array[k].weights.size()) { weights.write[l] = vertex_array[k].weights[l].weight; bones.write[l] = vertex_array[k].weights[l].bone_idx; @@ -963,7 +963,7 @@ Error ColladaImport::_create_mesh_surfaces(bool p_optimize, Ref<ArrayMesh> &p_me //////////////////////////// Array d = surftool->commit_to_arrays(); - d.resize(VS::ARRAY_MAX); + d.resize(RS::ARRAY_MAX); Array mr; @@ -1010,12 +1010,12 @@ Error ColladaImport::_create_resources(Collada::Node *p_node, bool p_use_compres if (p_node->type == Collada::Node::TYPE_GEOMETRY && node_map.has(p_node->id)) { - Spatial *node = node_map[p_node->id].node; + Node3D *node = node_map[p_node->id].node; Collada::NodeGeometry *ng = static_cast<Collada::NodeGeometry *>(p_node); - if (Object::cast_to<Path>(node)) { + if (Object::cast_to<Path3D>(node)) { - Path *path = Object::cast_to<Path>(node); + Path3D *path = Object::cast_to<Path3D>(node); if (curve_cache.has(ng->source)) { @@ -1047,7 +1047,7 @@ Error ColladaImport::_create_resources(Collada::Node *p_node, bool p_use_compres const Collada::CurveData::Source &interps = cd.sources[cd.control_vertices["INTERPOLATION"]]; ERR_FAIL_COND_V(interps.stride != 1, ERR_INVALID_DATA); - const Collada::CurveData::Source *tilts = NULL; + const Collada::CurveData::Source *tilts = nullptr; if (cd.control_vertices.has("TILT") && cd.sources.has(cd.control_vertices["TILT"])) tilts = &cd.sources[cd.control_vertices["TILT"]]; @@ -1083,16 +1083,16 @@ Error ColladaImport::_create_resources(Collada::Node *p_node, bool p_use_compres } } - if (Object::cast_to<MeshInstance>(node)) { + if (Object::cast_to<MeshInstance3D>(node)) { Collada::NodeGeometry *ng2 = static_cast<Collada::NodeGeometry *>(p_node); - MeshInstance *mi = Object::cast_to<MeshInstance>(node); + MeshInstance3D *mi = Object::cast_to<MeshInstance3D>(node); ERR_FAIL_COND_V(!mi, ERR_BUG); - Collada::SkinControllerData *skin = NULL; - Collada::MorphControllerData *morph = NULL; + Collada::SkinControllerData *skin = nullptr; + Collada::MorphControllerData *morph = nullptr; String meshid; Transform apply_xform; Vector<int> bone_remap; @@ -1114,7 +1114,7 @@ Error ColladaImport::_create_resources(Collada::Node *p_node, bool p_use_compres String skname = skeletons[0]; ERR_FAIL_COND_V(!node_map.has(skname), ERR_INVALID_DATA); NodeMap nmsk = node_map[skname]; - Skeleton *sk = Object::cast_to<Skeleton>(nmsk.node); + Skeleton3D *sk = Object::cast_to<Skeleton3D>(nmsk.node); ERR_FAIL_COND_V(!sk, ERR_INVALID_DATA); ERR_FAIL_COND_V(!skeleton_bone_map.has(sk), ERR_INVALID_DATA); Map<String, int> &bone_remap_map = skeleton_bone_map[sk]; @@ -1173,7 +1173,7 @@ Error ColladaImport::_create_resources(Collada::Node *p_node, bool p_use_compres Ref<ArrayMesh> mesh = Ref<ArrayMesh>(memnew(ArrayMesh)); const Collada::MeshData &meshdata = collada.state.mesh_data_map[meshid2]; mesh->set_name(meshdata.name); - Error err = _create_mesh_surfaces(false, mesh, ng2->material_map, meshdata, apply_xform, bone_remap, skin, NULL, Vector<Ref<ArrayMesh>>(), false); + Error err = _create_mesh_surfaces(false, mesh, ng2->material_map, meshdata, apply_xform, bone_remap, skin, nullptr, Vector<Ref<ArrayMesh>>(), false); ERR_FAIL_COND_V(err, err); morphs.push_back(mesh); @@ -1265,7 +1265,7 @@ Error ColladaImport::load(const String &p_path, int p_flags, bool p_force_make_t ERR_FAIL_COND_V(!collada.state.visual_scene_map.has(collada.state.root_visual_scene), ERR_INVALID_DATA); Collada::VisualScene &vs = collada.state.visual_scene_map[collada.state.root_visual_scene]; - scene = memnew(Spatial); // root + scene = memnew(Node3D); // root //determine what's going on with the lights for (int i = 0; i < vs.root_nodes.size(); i++) { @@ -1530,7 +1530,7 @@ void ColladaImport::create_animation(int p_clip, bool p_make_tracks_in_all_bones String path = scene->get_path_to(nm.node); if (nm.bone >= 0) { - Skeleton *sk = static_cast<Skeleton *>(nm.node); + Skeleton3D *sk = static_cast<Skeleton3D *>(nm.node); String name = sk->get_bone_name(nm.bone); path = path + ":" + name; } @@ -1621,7 +1621,7 @@ void ColladaImport::create_animation(int p_clip, bool p_make_tracks_in_all_bones if (nm.bone >= 0) { //make bone transform relative to rest (in case of skeleton) - Skeleton *sk = Object::cast_to<Skeleton>(nm.node); + Skeleton3D *sk = Object::cast_to<Skeleton3D>(nm.node); if (sk) { xform = sk->get_bone_rest(nm.bone).affine_inverse() * xform; @@ -1662,7 +1662,7 @@ void ColladaImport::create_animation(int p_clip, bool p_make_tracks_in_all_bones NodeMap &nm = node_map[E->key()]; String path = scene->get_path_to(nm.node); ERR_CONTINUE(nm.bone < 0); - Skeleton *sk = static_cast<Skeleton *>(nm.node); + Skeleton3D *sk = static_cast<Skeleton3D *>(nm.node); String name = sk->get_bone_name(nm.bone); path = path + ":" + name; @@ -1777,7 +1777,7 @@ Node *EditorSceneImporterCollada::import_scene(const String &p_path, uint32_t p_ Error err = state.load(p_path, flags, p_flags & EditorSceneImporter::IMPORT_GENERATE_TANGENT_ARRAYS, p_flags & EditorSceneImporter::IMPORT_USE_COMPRESSION); - ERR_FAIL_COND_V_MSG(err != OK, NULL, "Cannot load scene from file '" + p_path + "'."); + ERR_FAIL_COND_V_MSG(err != OK, nullptr, "Cannot load scene from file '" + p_path + "'."); if (state.missing_textures.size()) { diff --git a/editor/import/editor_import_collada.h b/editor/import/editor_import_collada.h index 822a6450be..932a064e76 100644 --- a/editor/import/editor_import_collada.h +++ b/editor/import/editor_import_collada.h @@ -40,7 +40,7 @@ class EditorSceneImporterCollada : public EditorSceneImporter { public: virtual uint32_t get_import_flags() const; virtual void get_extensions(List<String> *r_extensions) const; - virtual Node *import_scene(const String &p_path, uint32_t p_flags, int p_bake_fps, List<String> *r_missing_deps = NULL, Error *r_err = NULL); + virtual Node *import_scene(const String &p_path, uint32_t p_flags, int p_bake_fps, List<String> *r_missing_deps = nullptr, Error *r_err = nullptr); virtual Ref<Animation> import_animation(const String &p_path, uint32_t p_flags, int p_bake_fps); EditorSceneImporterCollada(); diff --git a/editor/import/editor_import_plugin.h b/editor/import/editor_import_plugin.h index 4383b1b084..be4679b6d3 100644 --- a/editor/import/editor_import_plugin.h +++ b/editor/import/editor_import_plugin.h @@ -52,7 +52,7 @@ public: virtual int get_import_order() const; virtual void get_import_options(List<ImportOption> *r_options, int p_preset) const; virtual bool get_option_visibility(const String &p_option, const Map<StringName, Variant> &p_options) const; - virtual Error import(const String &p_source_file, const String &p_save_path, const Map<StringName, Variant> &p_options, List<String> *r_platform_variants, List<String> *r_gen_files, Variant *r_metadata = NULL); + virtual Error import(const String &p_source_file, const String &p_save_path, const Map<StringName, Variant> &p_options, List<String> *r_platform_variants, List<String> *r_gen_files, Variant *r_metadata = nullptr); }; #endif //EDITOR_IMPORT_PLUGIN_H diff --git a/editor/import/editor_scene_importer_gltf.cpp b/editor/import/editor_scene_importer_gltf.cpp index 398fc9ff49..6ad2aa4142 100644 --- a/editor/import/editor_scene_importer_gltf.cpp +++ b/editor/import/editor_scene_importer_gltf.cpp @@ -37,9 +37,9 @@ #include "core/os/file_access.h" #include "core/os/os.h" #include "modules/regex/regex.h" -#include "scene/3d/bone_attachment.h" -#include "scene/3d/camera.h" -#include "scene/3d/mesh_instance.h" +#include "scene/3d/bone_attachment_3d.h" +#include "scene/3d/camera_3d.h" +#include "scene/3d/mesh_instance_3d.h" #include "scene/animation/animation_player.h" #include "scene/resources/surface_tool.h" @@ -1266,7 +1266,7 @@ Error EditorSceneImporterGLTF::_parse_images(GLTFState &state, const String &p_b } Vector<uint8_t> data; - const uint8_t *data_ptr = NULL; + const uint8_t *data_ptr = nullptr; int data_size = 0; if (d.has("uri")) { @@ -1307,7 +1307,7 @@ Error EditorSceneImporterGLTF::_parse_images(GLTFState &state, const String &p_b if (mimetype.findn("png") != -1) { //is a png - ERR_FAIL_COND_V(Image::_png_mem_loader_func == NULL, ERR_UNAVAILABLE); + ERR_FAIL_COND_V(Image::_png_mem_loader_func == nullptr, ERR_UNAVAILABLE); const Ref<Image> img = Image::_png_mem_loader_func(data_ptr, data_size); @@ -1323,7 +1323,7 @@ Error EditorSceneImporterGLTF::_parse_images(GLTFState &state, const String &p_b if (mimetype.findn("jpeg") != -1) { //is a jpg - ERR_FAIL_COND_V(Image::_jpg_mem_loader_func == NULL, ERR_UNAVAILABLE); + ERR_FAIL_COND_V(Image::_jpg_mem_loader_func == nullptr, ERR_UNAVAILABLE); const Ref<Image> img = Image::_jpg_mem_loader_func(data_ptr, data_size); @@ -2108,7 +2108,7 @@ Error EditorSceneImporterGLTF::_create_skeletons(GLTFState &state) { GLTFSkeleton &gltf_skeleton = state.skeletons.write[skel_i]; - Skeleton *skeleton = memnew(Skeleton); + Skeleton3D *skeleton = memnew(Skeleton3D); gltf_skeleton.godot_skeleton = skeleton; // Make a unique name, no gltf node represents this skeleton @@ -2485,12 +2485,12 @@ void EditorSceneImporterGLTF::_assign_scene_names(GLTFState &state) { } } -BoneAttachment *EditorSceneImporterGLTF::_generate_bone_attachment(GLTFState &state, Skeleton *skeleton, const GLTFNodeIndex node_index) { +BoneAttachment3D *EditorSceneImporterGLTF::_generate_bone_attachment(GLTFState &state, Skeleton3D *skeleton, const GLTFNodeIndex node_index) { const GLTFNode *gltf_node = state.nodes[node_index]; const GLTFNode *bone_node = state.nodes[gltf_node->parent]; - BoneAttachment *bone_attachment = memnew(BoneAttachment); + BoneAttachment3D *bone_attachment = memnew(BoneAttachment3D); print_verbose("glTF: Creating bone attachment for: " + gltf_node->name); ERR_FAIL_COND_V(!bone_node->joint, nullptr); @@ -2500,12 +2500,12 @@ BoneAttachment *EditorSceneImporterGLTF::_generate_bone_attachment(GLTFState &st return bone_attachment; } -MeshInstance *EditorSceneImporterGLTF::_generate_mesh_instance(GLTFState &state, Node *scene_parent, const GLTFNodeIndex node_index) { +MeshInstance3D *EditorSceneImporterGLTF::_generate_mesh_instance(GLTFState &state, Node *scene_parent, const GLTFNodeIndex node_index) { const GLTFNode *gltf_node = state.nodes[node_index]; ERR_FAIL_INDEX_V(gltf_node->mesh, state.meshes.size(), nullptr); - MeshInstance *mi = memnew(MeshInstance); + MeshInstance3D *mi = memnew(MeshInstance3D); print_verbose("glTF: Creating mesh for: " + gltf_node->name); GLTFMesh &mesh = state.meshes.write[gltf_node->mesh]; @@ -2522,12 +2522,12 @@ MeshInstance *EditorSceneImporterGLTF::_generate_mesh_instance(GLTFState &state, return mi; } -Camera *EditorSceneImporterGLTF::_generate_camera(GLTFState &state, Node *scene_parent, const GLTFNodeIndex node_index) { +Camera3D *EditorSceneImporterGLTF::_generate_camera(GLTFState &state, Node *scene_parent, const GLTFNodeIndex node_index) { const GLTFNode *gltf_node = state.nodes[node_index]; ERR_FAIL_INDEX_V(gltf_node->camera, state.cameras.size(), nullptr); - Camera *camera = memnew(Camera); + Camera3D *camera = memnew(Camera3D); print_verbose("glTF: Creating camera for: " + gltf_node->name); const GLTFCamera &c = state.cameras[gltf_node->camera]; @@ -2540,26 +2540,26 @@ Camera *EditorSceneImporterGLTF::_generate_camera(GLTFState &state, Node *scene_ return camera; } -Spatial *EditorSceneImporterGLTF::_generate_spatial(GLTFState &state, Node *scene_parent, const GLTFNodeIndex node_index) { +Node3D *EditorSceneImporterGLTF::_generate_spatial(GLTFState &state, Node *scene_parent, const GLTFNodeIndex node_index) { const GLTFNode *gltf_node = state.nodes[node_index]; - Spatial *spatial = memnew(Spatial); + Node3D *spatial = memnew(Node3D); print_verbose("glTF: Creating spatial for: " + gltf_node->name); return spatial; } -void EditorSceneImporterGLTF::_generate_scene_node(GLTFState &state, Node *scene_parent, Spatial *scene_root, const GLTFNodeIndex node_index) { +void EditorSceneImporterGLTF::_generate_scene_node(GLTFState &state, Node *scene_parent, Node3D *scene_root, const GLTFNodeIndex node_index) { const GLTFNode *gltf_node = state.nodes[node_index]; - Spatial *current_node = nullptr; + Node3D *current_node = nullptr; // Is our parent a skeleton - Skeleton *active_skeleton = Object::cast_to<Skeleton>(scene_parent); + Skeleton3D *active_skeleton = Object::cast_to<Skeleton3D>(scene_parent); if (gltf_node->skeleton >= 0) { - Skeleton *skeleton = state.skeletons[gltf_node->skeleton].godot_skeleton; + Skeleton3D *skeleton = state.skeletons[gltf_node->skeleton].godot_skeleton; if (active_skeleton != skeleton) { ERR_FAIL_COND_MSG(active_skeleton != nullptr, "glTF: Generating scene detected direct parented Skeletons"); @@ -2577,7 +2577,7 @@ void EditorSceneImporterGLTF::_generate_scene_node(GLTFState &state, Node *scene // If we have an active skeleton, and the node is node skinned, we need to create a bone attachment if (current_node == nullptr && active_skeleton != nullptr && gltf_node->skin < 0) { - BoneAttachment *bone_attachment = _generate_bone_attachment(state, active_skeleton, node_index); + BoneAttachment3D *bone_attachment = _generate_bone_attachment(state, active_skeleton, node_index); scene_parent->add_child(bone_attachment); bone_attachment->set_owner(scene_root); @@ -2776,7 +2776,7 @@ void EditorSceneImporterGLTF::_import_animation(GLTFState &state, AnimationPlaye const GLTFNode *node = state.nodes[E->key()]; if (node->skeleton >= 0) { - const Skeleton *sk = Object::cast_to<Skeleton>(state.scene_nodes.find(node_index)->get()); + const Skeleton3D *sk = Object::cast_to<Skeleton3D>(state.scene_nodes.find(node_index)->get()); ERR_FAIL_COND(sk == nullptr); const String path = ap->get_parent()->get_path_to(sk); @@ -2853,7 +2853,7 @@ void EditorSceneImporterGLTF::_import_animation(GLTFState &state, AnimationPlaye xform.basis.set_quat_scale(rot, scale); xform.origin = pos; - const Skeleton *skeleton = state.skeletons[node->skeleton].godot_skeleton; + const Skeleton3D *skeleton = state.skeletons[node->skeleton].godot_skeleton; const int bone_idx = skeleton->find_bone(node->name); xform = skeleton->get_bone_rest(bone_idx).affine_inverse() * xform; @@ -2922,7 +2922,7 @@ void EditorSceneImporterGLTF::_import_animation(GLTFState &state, AnimationPlaye ap->add_animation(name, animation); } -void EditorSceneImporterGLTF::_process_mesh_instances(GLTFState &state, Spatial *scene_root) { +void EditorSceneImporterGLTF::_process_mesh_instances(GLTFState &state, Node3D *scene_root) { for (GLTFNodeIndex node_i = 0; node_i < state.nodes.size(); ++node_i) { const GLTFNode *node = state.nodes[node_i]; @@ -2930,12 +2930,12 @@ void EditorSceneImporterGLTF::_process_mesh_instances(GLTFState &state, Spatial const GLTFSkinIndex skin_i = node->skin; Map<GLTFNodeIndex, Node *>::Element *mi_element = state.scene_nodes.find(node_i); - MeshInstance *mi = Object::cast_to<MeshInstance>(mi_element->get()); + MeshInstance3D *mi = Object::cast_to<MeshInstance3D>(mi_element->get()); ERR_FAIL_COND(mi == nullptr); const GLTFSkeletonIndex skel_i = state.skins[node->skin].skeleton; const GLTFSkeleton &gltf_skeleton = state.skeletons[skel_i]; - Skeleton *skeleton = gltf_skeleton.godot_skeleton; + Skeleton3D *skeleton = gltf_skeleton.godot_skeleton; ERR_FAIL_COND(skeleton == nullptr); mi->get_parent()->remove_child(mi); @@ -2949,9 +2949,9 @@ void EditorSceneImporterGLTF::_process_mesh_instances(GLTFState &state, Spatial } } -Spatial *EditorSceneImporterGLTF::_generate_scene(GLTFState &state, const int p_bake_fps) { +Node3D *EditorSceneImporterGLTF::_generate_scene(GLTFState &state, const int p_bake_fps) { - Spatial *root = memnew(Spatial); + Node3D *root = memnew(Node3D); // scene_name is already unique root->set_name(state.scene_name); @@ -2985,19 +2985,19 @@ Node *EditorSceneImporterGLTF::import_scene(const String &p_path, uint32_t p_fla //text file Error err = _parse_glb(p_path, state); if (err) - return NULL; + return nullptr; } else { //text file Error err = _parse_json(p_path, state); if (err) - return NULL; + return nullptr; } - ERR_FAIL_COND_V(!state.json.has("asset"), NULL); + ERR_FAIL_COND_V(!state.json.has("asset"), nullptr); Dictionary asset = state.json["asset"]; - ERR_FAIL_COND_V(!asset.has("version"), NULL); + ERR_FAIL_COND_V(!asset.has("version"), nullptr); String version = asset["version"]; @@ -3008,83 +3008,83 @@ Node *EditorSceneImporterGLTF::import_scene(const String &p_path, uint32_t p_fla /* STEP 0 PARSE SCENE */ Error err = _parse_scenes(state); if (err != OK) - return NULL; + return nullptr; /* STEP 1 PARSE NODES */ err = _parse_nodes(state); if (err != OK) - return NULL; + return nullptr; /* STEP 2 PARSE BUFFERS */ err = _parse_buffers(state, p_path.get_base_dir()); if (err != OK) - return NULL; + return nullptr; /* STEP 3 PARSE BUFFER VIEWS */ err = _parse_buffer_views(state); if (err != OK) - return NULL; + return nullptr; /* STEP 4 PARSE ACCESSORS */ err = _parse_accessors(state); if (err != OK) - return NULL; + return nullptr; /* STEP 5 PARSE IMAGES */ err = _parse_images(state, p_path.get_base_dir()); if (err != OK) - return NULL; + return nullptr; /* STEP 6 PARSE TEXTURES */ err = _parse_textures(state); if (err != OK) - return NULL; + return nullptr; /* STEP 7 PARSE TEXTURES */ err = _parse_materials(state); if (err != OK) - return NULL; + return nullptr; /* STEP 9 PARSE SKINS */ err = _parse_skins(state); if (err != OK) - return NULL; + return nullptr; /* STEP 10 DETERMINE SKELETONS */ err = _determine_skeletons(state); if (err != OK) - return NULL; + return nullptr; /* STEP 11 CREATE SKELETONS */ err = _create_skeletons(state); if (err != OK) - return NULL; + return nullptr; /* STEP 12 CREATE SKINS */ err = _create_skins(state); if (err != OK) - return NULL; + return nullptr; /* STEP 13 PARSE MESHES (we have enough info now) */ err = _parse_meshes(state); if (err != OK) - return NULL; + return nullptr; /* STEP 14 PARSE CAMERAS */ err = _parse_cameras(state); if (err != OK) - return NULL; + return nullptr; /* STEP 15 PARSE ANIMATIONS */ err = _parse_animations(state); if (err != OK) - return NULL; + return nullptr; /* STEP 16 ASSIGN SCENE NAMES */ _assign_scene_names(state); /* STEP 17 MAKE SCENE! */ - Spatial *scene = _generate_scene(state, p_bake_fps); + Node3D *scene = _generate_scene(state, p_bake_fps); return scene; } diff --git a/editor/import/editor_scene_importer_gltf.h b/editor/import/editor_scene_importer_gltf.h index 9f354fde2d..d127a87782 100644 --- a/editor/import/editor_scene_importer_gltf.h +++ b/editor/import/editor_scene_importer_gltf.h @@ -32,12 +32,12 @@ #define EDITOR_SCENE_IMPORTER_GLTF_H #include "editor/import/resource_importer_scene.h" -#include "scene/3d/skeleton.h" -#include "scene/3d/spatial.h" +#include "scene/3d/node_3d.h" +#include "scene/3d/skeleton_3d.h" class AnimationPlayer; -class BoneAttachment; -class MeshInstance; +class BoneAttachment3D; +class MeshInstance3D; class EditorSceneImporterGLTF : public EditorSceneImporter { @@ -192,7 +192,7 @@ class EditorSceneImporterGLTF : public EditorSceneImporter { Vector<GLTFNodeIndex> roots; // The created Skeleton for the scene - Skeleton *godot_skeleton; + Skeleton3D *godot_skeleton; // Set of unique bone names for the skeleton Set<String> unique_names; @@ -395,15 +395,15 @@ class EditorSceneImporterGLTF : public EditorSceneImporter { Error _parse_animations(GLTFState &state); - BoneAttachment *_generate_bone_attachment(GLTFState &state, Skeleton *skeleton, const GLTFNodeIndex node_index); - MeshInstance *_generate_mesh_instance(GLTFState &state, Node *scene_parent, const GLTFNodeIndex node_index); - Camera *_generate_camera(GLTFState &state, Node *scene_parent, const GLTFNodeIndex node_index); - Spatial *_generate_spatial(GLTFState &state, Node *scene_parent, const GLTFNodeIndex node_index); + BoneAttachment3D *_generate_bone_attachment(GLTFState &state, Skeleton3D *skeleton, const GLTFNodeIndex node_index); + MeshInstance3D *_generate_mesh_instance(GLTFState &state, Node *scene_parent, const GLTFNodeIndex node_index); + Camera3D *_generate_camera(GLTFState &state, Node *scene_parent, const GLTFNodeIndex node_index); + Node3D *_generate_spatial(GLTFState &state, Node *scene_parent, const GLTFNodeIndex node_index); - void _generate_scene_node(GLTFState &state, Node *scene_parent, Spatial *scene_root, const GLTFNodeIndex node_index); - Spatial *_generate_scene(GLTFState &state, const int p_bake_fps); + void _generate_scene_node(GLTFState &state, Node *scene_parent, Node3D *scene_root, const GLTFNodeIndex node_index); + Node3D *_generate_scene(GLTFState &state, const int p_bake_fps); - void _process_mesh_instances(GLTFState &state, Spatial *scene_root); + void _process_mesh_instances(GLTFState &state, Node3D *scene_root); void _assign_scene_names(GLTFState &state); @@ -415,7 +415,7 @@ class EditorSceneImporterGLTF : public EditorSceneImporter { public: virtual uint32_t get_import_flags() const; virtual void get_extensions(List<String> *r_extensions) const; - virtual Node *import_scene(const String &p_path, uint32_t p_flags, int p_bake_fps, List<String> *r_missing_deps = NULL, Error *r_err = NULL); + virtual Node *import_scene(const String &p_path, uint32_t p_flags, int p_bake_fps, List<String> *r_missing_deps = nullptr, Error *r_err = nullptr); virtual Ref<Animation> import_animation(const String &p_path, uint32_t p_flags, int p_bake_fps); EditorSceneImporterGLTF(); diff --git a/editor/import/resource_importer_bitmask.h b/editor/import/resource_importer_bitmask.h index dd95cb687a..927fac566e 100644 --- a/editor/import/resource_importer_bitmask.h +++ b/editor/import/resource_importer_bitmask.h @@ -51,7 +51,7 @@ public: virtual void get_import_options(List<ImportOption> *r_options, int p_preset = 0) const; virtual bool get_option_visibility(const String &p_option, const Map<StringName, Variant> &p_options) const; - virtual Error import(const String &p_source_file, const String &p_save_path, const Map<StringName, Variant> &p_options, List<String> *r_platform_variants, List<String> *r_gen_files = NULL, Variant *r_metadata = NULL); + virtual Error import(const String &p_source_file, const String &p_save_path, const Map<StringName, Variant> &p_options, List<String> *r_platform_variants, List<String> *r_gen_files = nullptr, Variant *r_metadata = nullptr); ResourceImporterBitMap(); ~ResourceImporterBitMap(); diff --git a/editor/import/resource_importer_csv.h b/editor/import/resource_importer_csv.h index 2030dd1f99..7aa48f68de 100644 --- a/editor/import/resource_importer_csv.h +++ b/editor/import/resource_importer_csv.h @@ -49,7 +49,7 @@ public: virtual void get_import_options(List<ImportOption> *r_options, int p_preset = 0) const; virtual bool get_option_visibility(const String &p_option, const Map<StringName, Variant> &p_options) const; - virtual Error import(const String &p_source_file, const String &p_save_path, const Map<StringName, Variant> &p_options, List<String> *r_platform_variants, List<String> *r_gen_files = NULL, Variant *r_metadata = NULL); + virtual Error import(const String &p_source_file, const String &p_save_path, const Map<StringName, Variant> &p_options, List<String> *r_platform_variants, List<String> *r_gen_files = nullptr, Variant *r_metadata = nullptr); ResourceImporterCSV(); }; diff --git a/editor/import/resource_importer_csv_translation.h b/editor/import/resource_importer_csv_translation.h index ec33d6aa16..742f6b8f60 100644 --- a/editor/import/resource_importer_csv_translation.h +++ b/editor/import/resource_importer_csv_translation.h @@ -49,7 +49,7 @@ public: virtual void get_import_options(List<ImportOption> *r_options, int p_preset = 0) const; virtual bool get_option_visibility(const String &p_option, const Map<StringName, Variant> &p_options) const; - virtual Error import(const String &p_source_file, const String &p_save_path, const Map<StringName, Variant> &p_options, List<String> *r_platform_variants, List<String> *r_gen_files = NULL, Variant *r_metadata = NULL); + virtual Error import(const String &p_source_file, const String &p_save_path, const Map<StringName, Variant> &p_options, List<String> *r_platform_variants, List<String> *r_gen_files = nullptr, Variant *r_metadata = nullptr); ResourceImporterCSVTranslation(); }; diff --git a/editor/import/resource_importer_image.h b/editor/import/resource_importer_image.h index 6ad77eec1b..abb74d0665 100644 --- a/editor/import/resource_importer_image.h +++ b/editor/import/resource_importer_image.h @@ -50,7 +50,7 @@ public: virtual void get_import_options(List<ImportOption> *r_options, int p_preset = 0) const; virtual bool get_option_visibility(const String &p_option, const Map<StringName, Variant> &p_options) const; - virtual Error import(const String &p_source_file, const String &p_save_path, const Map<StringName, Variant> &p_options, List<String> *r_platform_variants, List<String> *r_gen_files = NULL, Variant *r_metadata = NULL); + virtual Error import(const String &p_source_file, const String &p_save_path, const Map<StringName, Variant> &p_options, List<String> *r_platform_variants, List<String> *r_gen_files = nullptr, Variant *r_metadata = nullptr); ResourceImporterImage(); }; diff --git a/editor/import/resource_importer_layered_texture.cpp b/editor/import/resource_importer_layered_texture.cpp index d472070808..a4cbc81b26 100644 --- a/editor/import/resource_importer_layered_texture.cpp +++ b/editor/import/resource_importer_layered_texture.cpp @@ -259,7 +259,7 @@ Error ResourceImporterLayeredTexture::import(const String &p_source_file, const Ref<Image> image; image.instance(); - Error err = ImageLoader::load_image(p_source_file, image, NULL, false, 1.0); + Error err = ImageLoader::load_image(p_source_file, image, nullptr, false, 1.0); if (err != OK) return err; @@ -383,7 +383,7 @@ const char *ResourceImporterLayeredTexture::compression_formats[] = { "etc", "etc2", "pvrtc", - NULL + nullptr }; String ResourceImporterLayeredTexture::get_import_settings_string() const { @@ -438,7 +438,7 @@ bool ResourceImporterLayeredTexture::are_import_settings_valid(const String &p_p return valid; } -ResourceImporterLayeredTexture *ResourceImporterLayeredTexture::singleton = NULL; +ResourceImporterLayeredTexture *ResourceImporterLayeredTexture::singleton = nullptr; ResourceImporterLayeredTexture::ResourceImporterLayeredTexture() { diff --git a/editor/import/resource_importer_layered_texture.h b/editor/import/resource_importer_layered_texture.h index 6a6bc89a81..40e5c9023e 100644 --- a/editor/import/resource_importer_layered_texture.h +++ b/editor/import/resource_importer_layered_texture.h @@ -114,7 +114,7 @@ public: void _save_tex(const Vector<Ref<Image> > &p_images, const String &p_to_path, int p_compress_mode, Image::CompressMode p_vram_compression, bool p_mipmaps); - virtual Error import(const String &p_source_file, const String &p_save_path, const Map<StringName, Variant> &p_options, List<String> *r_platform_variants, List<String> *r_gen_files = NULL, Variant *r_metadata = NULL); + virtual Error import(const String &p_source_file, const String &p_save_path, const Map<StringName, Variant> &p_options, List<String> *r_platform_variants, List<String> *r_gen_files = nullptr, Variant *r_metadata = nullptr); void update_imports(); diff --git a/editor/import/resource_importer_obj.cpp b/editor/import/resource_importer_obj.cpp index fb1782cb65..6a6eadfa5c 100644 --- a/editor/import/resource_importer_obj.cpp +++ b/editor/import/resource_importer_obj.cpp @@ -32,8 +32,8 @@ #include "core/io/resource_saver.h" #include "core/os/file_access.h" -#include "scene/3d/mesh_instance.h" -#include "scene/3d/spatial.h" +#include "scene/3d/mesh_instance_3d.h" +#include "scene/3d/node_3d.h" #include "scene/resources/mesh.h" #include "scene/resources/surface_tool.h" @@ -428,14 +428,14 @@ Node *EditorOBJImporter::import_scene(const String &p_path, uint32_t p_flags, in if (r_err) { *r_err = err; } - return NULL; + return nullptr; } - Spatial *scene = memnew(Spatial); + Node3D *scene = memnew(Node3D); for (List<Ref<Mesh>>::Element *E = meshes.front(); E; E = E->next()) { - MeshInstance *mi = memnew(MeshInstance); + MeshInstance3D *mi = memnew(MeshInstance3D); mi->set_mesh(E->get()); mi->set_name(E->get()->get_name()); scene->add_child(mi); @@ -502,7 +502,7 @@ Error ResourceImporterOBJ::import(const String &p_source_file, const String &p_s List<Ref<Mesh>> meshes; - Error err = _parse_obj(p_source_file, meshes, true, p_options["generate_tangents"], p_options["optimize_mesh"], p_options["scale_mesh"], p_options["offset_mesh"], NULL); + Error err = _parse_obj(p_source_file, meshes, true, p_options["generate_tangents"], p_options["optimize_mesh"], p_options["scale_mesh"], p_options["offset_mesh"], nullptr); ERR_FAIL_COND_V(err != OK, err); ERR_FAIL_COND_V(meshes.size() != 1, ERR_BUG); diff --git a/editor/import/resource_importer_obj.h b/editor/import/resource_importer_obj.h index 678be45106..7485e60f7b 100644 --- a/editor/import/resource_importer_obj.h +++ b/editor/import/resource_importer_obj.h @@ -40,7 +40,7 @@ class EditorOBJImporter : public EditorSceneImporter { public: virtual uint32_t get_import_flags() const; virtual void get_extensions(List<String> *r_extensions) const; - virtual Node *import_scene(const String &p_path, uint32_t p_flags, int p_bake_fps, List<String> *r_missing_deps, Error *r_err = NULL); + virtual Node *import_scene(const String &p_path, uint32_t p_flags, int p_bake_fps, List<String> *r_missing_deps, Error *r_err = nullptr); virtual Ref<Animation> import_animation(const String &p_path, uint32_t p_flags, int p_bake_fps); EditorOBJImporter(); @@ -62,7 +62,7 @@ public: virtual void get_import_options(List<ImportOption> *r_options, int p_preset = 0) const; virtual bool get_option_visibility(const String &p_option, const Map<StringName, Variant> &p_options) const; - virtual Error import(const String &p_source_file, const String &p_save_path, const Map<StringName, Variant> &p_options, List<String> *r_platform_variants, List<String> *r_gen_files = NULL, Variant *r_metadata = NULL); + virtual Error import(const String &p_source_file, const String &p_save_path, const Map<StringName, Variant> &p_options, List<String> *r_platform_variants, List<String> *r_gen_files = nullptr, Variant *r_metadata = nullptr); ResourceImporterOBJ(); }; diff --git a/editor/import/resource_importer_scene.cpp b/editor/import/resource_importer_scene.cpp index 94a6fee6b7..b5766a48a0 100644 --- a/editor/import/resource_importer_scene.cpp +++ b/editor/import/resource_importer_scene.cpp @@ -32,19 +32,19 @@ #include "core/io/resource_saver.h" #include "editor/editor_node.h" -#include "scene/3d/collision_shape.h" -#include "scene/3d/mesh_instance.h" -#include "scene/3d/navigation.h" -#include "scene/3d/physics_body.h" -#include "scene/3d/vehicle_body.h" +#include "scene/3d/collision_shape_3d.h" +#include "scene/3d/mesh_instance_3d.h" +#include "scene/3d/navigation_3d.h" +#include "scene/3d/physics_body_3d.h" +#include "scene/3d/vehicle_body_3d.h" #include "scene/animation/animation_player.h" #include "scene/resources/animation.h" -#include "scene/resources/box_shape.h" +#include "scene/resources/box_shape_3d.h" #include "scene/resources/packed_scene.h" -#include "scene/resources/ray_shape.h" +#include "scene/resources/ray_shape_3d.h" #include "scene/resources/resource_format_text.h" -#include "scene/resources/sphere_shape.h" -#include "scene/resources/world_margin_shape.h" +#include "scene/resources/sphere_shape_3d.h" +#include "scene/resources/world_margin_shape_3d.h" uint32_t EditorSceneImporter::get_import_flags() const { @@ -72,7 +72,7 @@ Node *EditorSceneImporter::import_scene(const String &p_path, uint32_t p_flags, return get_script_instance()->call("_import_scene", p_path, p_flags, p_bake_fps); } - ERR_FAIL_V(NULL); + ERR_FAIL_V(nullptr); } Ref<Animation> EditorSceneImporter::import_animation(const String &p_path, uint32_t p_flags, int p_bake_fps) { @@ -81,7 +81,7 @@ Ref<Animation> EditorSceneImporter::import_animation(const String &p_path, uint3 return get_script_instance()->call("_import_animation", p_path, p_flags); } - ERR_FAIL_V(NULL); + ERR_FAIL_V(nullptr); } //for documenters, these functions are useful when an importer calls an external conversion helper (like, fbx2gltf), @@ -276,15 +276,15 @@ static String _fixstr(const String &p_what, const String &p_str) { return what; } -static void _gen_shape_list(const Ref<Mesh> &mesh, List<Ref<Shape>> &r_shape_list, bool p_convex) { +static void _gen_shape_list(const Ref<Mesh> &mesh, List<Ref<Shape3D>> &r_shape_list, bool p_convex) { if (!p_convex) { - Ref<Shape> shape = mesh->create_trimesh_shape(); + Ref<Shape3D> shape = mesh->create_trimesh_shape(); r_shape_list.push_back(shape); } else { - Vector<Ref<Shape>> cd = mesh->convex_decompose(); + Vector<Ref<Shape3D>> cd = mesh->convex_decompose(); if (cd.size()) { for (int i = 0; i < cd.size(); i++) { r_shape_list.push_back(cd[i]); @@ -293,7 +293,7 @@ static void _gen_shape_list(const Ref<Mesh> &mesh, List<Ref<Shape>> &r_shape_lis } } -Node *ResourceImporterScene::_fix_node(Node *p_node, Node *p_root, Map<Ref<Mesh>, List<Ref<Shape>>> &collision_map, LightBakeMode p_light_bake_mode) { +Node *ResourceImporterScene::_fix_node(Node *p_node, Node *p_root, Map<Ref<Mesh>, List<Ref<Shape3D>>> &collision_map, LightBakeMode p_light_bake_mode) { // children first for (int i = 0; i < p_node->get_child_count(); i++) { @@ -311,12 +311,12 @@ Node *ResourceImporterScene::_fix_node(Node *p_node, Node *p_root, Map<Ref<Mesh> if (!isroot && _teststr(name, "noimp")) { memdelete(p_node); - return NULL; + return nullptr; } - if (Object::cast_to<MeshInstance>(p_node)) { + if (Object::cast_to<MeshInstance3D>(p_node)) { - MeshInstance *mi = Object::cast_to<MeshInstance>(p_node); + MeshInstance3D *mi = Object::cast_to<MeshInstance3D>(p_node); Ref<ArrayMesh> m = mi->get_mesh(); @@ -344,7 +344,7 @@ Node *ResourceImporterScene::_fix_node(Node *p_node, Node *p_root, Map<Ref<Mesh> if (p_light_bake_mode != LIGHT_BAKE_DISABLED) { - mi->set_flag(GeometryInstance::FLAG_USE_BAKED_LIGHT, true); + mi->set_flag(GeometryInstance3D::FLAG_USE_BAKED_LIGHT, true); } } @@ -377,12 +377,12 @@ Node *ResourceImporterScene::_fix_node(Node *p_node, Node *p_root, Map<Ref<Mesh> if (isroot) return p_node; - MeshInstance *mi = Object::cast_to<MeshInstance>(p_node); + MeshInstance3D *mi = Object::cast_to<MeshInstance3D>(p_node); if (mi) { Ref<Mesh> mesh = mi->get_mesh(); if (mesh.is_valid()) { - List<Ref<Shape>> shapes; + List<Ref<Shape3D>> shapes; String fixed_name; if (collision_map.has(mesh)) { shapes = collision_map[mesh]; @@ -400,11 +400,11 @@ Node *ResourceImporterScene::_fix_node(Node *p_node, Node *p_root, Map<Ref<Mesh> fixed_name = _fixstr(name, "convcolonly"); } - ERR_FAIL_COND_V(fixed_name == String(), NULL); + ERR_FAIL_COND_V(fixed_name == String(), nullptr); if (shapes.size()) { - StaticBody *col = memnew(StaticBody); + StaticBody3D *col = memnew(StaticBody3D); col->set_transform(mi->get_transform()); col->set_name(fixed_name); p_node->replace_by(col); @@ -412,9 +412,9 @@ Node *ResourceImporterScene::_fix_node(Node *p_node, Node *p_root, Map<Ref<Mesh> p_node = col; int idx = 0; - for (List<Ref<Shape>>::Element *E = shapes.front(); E; E = E->next()) { + for (List<Ref<Shape3D>>::Element *E = shapes.front(); E; E = E->next()) { - CollisionShape *cshape = memnew(CollisionShape); + CollisionShape3D *cshape = memnew(CollisionShape3D); cshape->set_shape(E->get()); col->add_child(cshape); @@ -427,55 +427,55 @@ Node *ResourceImporterScene::_fix_node(Node *p_node, Node *p_root, Map<Ref<Mesh> } else if (p_node->has_meta("empty_draw_type")) { String empty_draw_type = String(p_node->get_meta("empty_draw_type")); - StaticBody *sb = memnew(StaticBody); + StaticBody3D *sb = memnew(StaticBody3D); sb->set_name(_fixstr(name, "colonly")); - Object::cast_to<Spatial>(sb)->set_transform(Object::cast_to<Spatial>(p_node)->get_transform()); + Object::cast_to<Node3D>(sb)->set_transform(Object::cast_to<Node3D>(p_node)->get_transform()); p_node->replace_by(sb); memdelete(p_node); - p_node = NULL; - CollisionShape *colshape = memnew(CollisionShape); + p_node = nullptr; + CollisionShape3D *colshape = memnew(CollisionShape3D); if (empty_draw_type == "CUBE") { - BoxShape *boxShape = memnew(BoxShape); + BoxShape3D *boxShape = memnew(BoxShape3D); boxShape->set_extents(Vector3(1, 1, 1)); colshape->set_shape(boxShape); - colshape->set_name("BoxShape"); + colshape->set_name("BoxShape3D"); } else if (empty_draw_type == "SINGLE_ARROW") { - RayShape *rayShape = memnew(RayShape); + RayShape3D *rayShape = memnew(RayShape3D); rayShape->set_length(1); colshape->set_shape(rayShape); - colshape->set_name("RayShape"); - Object::cast_to<Spatial>(sb)->rotate_x(Math_PI / 2); + colshape->set_name("RayShape3D"); + Object::cast_to<Node3D>(sb)->rotate_x(Math_PI / 2); } else if (empty_draw_type == "IMAGE") { - WorldMarginShape *world_margin_shape = memnew(WorldMarginShape); + WorldMarginShape3D *world_margin_shape = memnew(WorldMarginShape3D); colshape->set_shape(world_margin_shape); - colshape->set_name("WorldMarginShape"); + colshape->set_name("WorldMarginShape3D"); } else { - SphereShape *sphereShape = memnew(SphereShape); + SphereShape3D *sphereShape = memnew(SphereShape3D); sphereShape->set_radius(1); colshape->set_shape(sphereShape); - colshape->set_name("SphereShape"); + colshape->set_name("SphereShape3D"); } sb->add_child(colshape); colshape->set_owner(sb->get_owner()); } - } else if (_teststr(name, "rigid") && Object::cast_to<MeshInstance>(p_node)) { + } else if (_teststr(name, "rigid") && Object::cast_to<MeshInstance3D>(p_node)) { if (isroot) return p_node; - MeshInstance *mi = Object::cast_to<MeshInstance>(p_node); + MeshInstance3D *mi = Object::cast_to<MeshInstance3D>(p_node); Ref<Mesh> mesh = mi->get_mesh(); if (mesh.is_valid()) { - List<Ref<Shape>> shapes; + List<Ref<Shape3D>> shapes; if (collision_map.has(mesh)) { shapes = collision_map[mesh]; } else { _gen_shape_list(mesh, shapes, true); } - RigidBody *rigid_body = memnew(RigidBody); + RigidBody3D *rigid_body = memnew(RigidBody3D); rigid_body->set_name(_fixstr(name, "rigid")); p_node->replace_by(rigid_body); rigid_body->set_transform(mi->get_transform()); @@ -486,9 +486,9 @@ Node *ResourceImporterScene::_fix_node(Node *p_node, Node *p_root, Map<Ref<Mesh> mi->set_owner(rigid_body->get_owner()); int idx = 0; - for (List<Ref<Shape>>::Element *E = shapes.front(); E; E = E->next()) { + for (List<Ref<Shape3D>>::Element *E = shapes.front(); E; E = E->next()) { - CollisionShape *cshape = memnew(CollisionShape); + CollisionShape3D *cshape = memnew(CollisionShape3D); cshape->set_shape(E->get()); rigid_body->add_child(cshape); @@ -498,14 +498,14 @@ Node *ResourceImporterScene::_fix_node(Node *p_node, Node *p_root, Map<Ref<Mesh> } } - } else if ((_teststr(name, "col") || (_teststr(name, "convcol"))) && Object::cast_to<MeshInstance>(p_node)) { + } else if ((_teststr(name, "col") || (_teststr(name, "convcol"))) && Object::cast_to<MeshInstance3D>(p_node)) { - MeshInstance *mi = Object::cast_to<MeshInstance>(p_node); + MeshInstance3D *mi = Object::cast_to<MeshInstance3D>(p_node); Ref<Mesh> mesh = mi->get_mesh(); if (mesh.is_valid()) { - List<Ref<Shape>> shapes; + List<Ref<Shape3D>> shapes; String fixed_name; if (collision_map.has(mesh)) { shapes = collision_map[mesh]; @@ -530,15 +530,15 @@ Node *ResourceImporterScene::_fix_node(Node *p_node, Node *p_root, Map<Ref<Mesh> } if (shapes.size()) { - StaticBody *col = memnew(StaticBody); + StaticBody3D *col = memnew(StaticBody3D); col->set_name("static_collision"); mi->add_child(col); col->set_owner(mi->get_owner()); int idx = 0; - for (List<Ref<Shape>>::Element *E = shapes.front(); E; E = E->next()) { + for (List<Ref<Shape3D>>::Element *E = shapes.front(); E; E = E->next()) { - CollisionShape *cshape = memnew(CollisionShape); + CollisionShape3D *cshape = memnew(CollisionShape3D); cshape->set_shape(E->get()); col->add_child(cshape); @@ -550,22 +550,22 @@ Node *ResourceImporterScene::_fix_node(Node *p_node, Node *p_root, Map<Ref<Mesh> } } - } else if (_teststr(name, "navmesh") && Object::cast_to<MeshInstance>(p_node)) { + } else if (_teststr(name, "navmesh") && Object::cast_to<MeshInstance3D>(p_node)) { if (isroot) return p_node; - MeshInstance *mi = Object::cast_to<MeshInstance>(p_node); + MeshInstance3D *mi = Object::cast_to<MeshInstance3D>(p_node); Ref<ArrayMesh> mesh = mi->get_mesh(); - ERR_FAIL_COND_V(mesh.is_null(), NULL); - NavigationRegion *nmi = memnew(NavigationRegion); + ERR_FAIL_COND_V(mesh.is_null(), nullptr); + NavigationRegion3D *nmi = memnew(NavigationRegion3D); nmi->set_name(_fixstr(name, "navmesh")); Ref<NavigationMesh> nmesh = memnew(NavigationMesh); nmesh->create_from_mesh(mesh); nmi->set_navigation_mesh(nmesh); - Object::cast_to<Spatial>(nmi)->set_transform(mi->get_transform()); + Object::cast_to<Node3D>(nmi)->set_transform(mi->get_transform()); p_node->replace_by(nmi); memdelete(p_node); p_node = nmi; @@ -575,8 +575,8 @@ Node *ResourceImporterScene::_fix_node(Node *p_node, Node *p_root, Map<Ref<Mesh> return p_node; Node *owner = p_node->get_owner(); - Spatial *s = Object::cast_to<Spatial>(p_node); - VehicleBody *bv = memnew(VehicleBody); + Node3D *s = Object::cast_to<Node3D>(p_node); + VehicleBody3D *bv = memnew(VehicleBody3D); String n = _fixstr(p_node->get_name(), "vehicle"); bv->set_name(n); p_node->replace_by(bv); @@ -595,8 +595,8 @@ Node *ResourceImporterScene::_fix_node(Node *p_node, Node *p_root, Map<Ref<Mesh> return p_node; Node *owner = p_node->get_owner(); - Spatial *s = Object::cast_to<Spatial>(p_node); - VehicleWheel *bv = memnew(VehicleWheel); + Node3D *s = Object::cast_to<Node3D>(p_node); + VehicleWheel3D *bv = memnew(VehicleWheel3D); String n = _fixstr(p_node->get_name(), "wheel"); bv->set_name(n); p_node->replace_by(bv); @@ -609,16 +609,16 @@ Node *ResourceImporterScene::_fix_node(Node *p_node, Node *p_root, Map<Ref<Mesh> p_node = bv; - } else if (Object::cast_to<MeshInstance>(p_node)) { + } else if (Object::cast_to<MeshInstance3D>(p_node)) { //last attempt, maybe collision inside the mesh data - MeshInstance *mi = Object::cast_to<MeshInstance>(p_node); + MeshInstance3D *mi = Object::cast_to<MeshInstance3D>(p_node); Ref<ArrayMesh> mesh = mi->get_mesh(); if (!mesh.is_null()) { - List<Ref<Shape>> shapes; + List<Ref<Shape3D>> shapes; if (collision_map.has(mesh)) { shapes = collision_map[mesh]; } else if (_teststr(mesh->get_name(), "col")) { @@ -632,15 +632,15 @@ Node *ResourceImporterScene::_fix_node(Node *p_node, Node *p_root, Map<Ref<Mesh> } if (shapes.size()) { - StaticBody *col = memnew(StaticBody); + StaticBody3D *col = memnew(StaticBody3D); col->set_name("static_collision"); p_node->add_child(col); col->set_owner(p_node->get_owner()); int idx = 0; - for (List<Ref<Shape>>::Element *E = shapes.front(); E; E = E->next()) { + for (List<Ref<Shape3D>>::Element *E = shapes.front(); E; E = E->next()) { - CollisionShape *cshape = memnew(CollisionShape); + CollisionShape3D *cshape = memnew(CollisionShape3D); cshape->set_shape(E->get()); col->add_child(cshape); @@ -934,14 +934,14 @@ void ResourceImporterScene::_find_meshes(Node *p_node, Map<Ref<ArrayMesh>, Trans List<PropertyInfo> pi; p_node->get_property_list(&pi); - MeshInstance *mi = Object::cast_to<MeshInstance>(p_node); + MeshInstance3D *mi = Object::cast_to<MeshInstance3D>(p_node); if (mi) { Ref<ArrayMesh> mesh = mi->get_mesh(); if (mesh.is_valid() && !meshes.has(mesh)) { - Spatial *s = mi; + Node3D *s = mi; Transform transform; while (s) { transform = transform * s->get_transform(); @@ -1141,7 +1141,7 @@ void ResourceImporterScene::_make_external_resources(Node *p_node, const String void ResourceImporterScene::get_import_options(List<ImportOption> *r_options, int p_preset) const { - r_options->push_back(ImportOption(PropertyInfo(Variant::STRING, "nodes/root_type", PROPERTY_HINT_TYPE_STRING, "Node"), "Spatial")); + r_options->push_back(ImportOption(PropertyInfo(Variant::STRING, "nodes/root_type", PROPERTY_HINT_TYPE_STRING, "Node"), "Node3D")); r_options->push_back(ImportOption(PropertyInfo(Variant::STRING, "nodes/root_name"), "Scene Root")); List<String> script_extentions; @@ -1229,7 +1229,7 @@ Node *ResourceImporterScene::import_scene_from_other_importer(EditorSceneImporte break; } - ERR_FAIL_COND_V(!importer.is_valid(), NULL); + ERR_FAIL_COND_V(!importer.is_valid(), nullptr); List<String> missing; Error err; @@ -1261,7 +1261,7 @@ Ref<Animation> ResourceImporterScene::import_animation_from_other_importer(Edito break; } - ERR_FAIL_COND_V(!importer.is_valid(), NULL); + ERR_FAIL_COND_V(!importer.is_valid(), nullptr); return importer->import_animation(p_path, p_flags, p_bake_fps); } @@ -1327,13 +1327,13 @@ Error ResourceImporterScene::import(const String &p_source_file, const String &p String root_type = p_options["nodes/root_type"]; root_type = root_type.split(" ")[0]; // full root_type is "ClassName (filename.gd)" for a script global class. - Ref<Script> root_script = NULL; + Ref<Script> root_script = nullptr; if (ScriptServer::is_global_class(root_type)) { root_script = ResourceLoader::load(ScriptServer::get_global_class_path(root_type)); root_type = ScriptServer::get_global_class_base(root_type); } - if (root_type != "Spatial") { + if (root_type != "Node3D") { Node *base_node = Object::cast_to<Node>(ClassDB::instance(root_type)); if (base_node) { @@ -1348,9 +1348,9 @@ Error ResourceImporterScene::import(const String &p_source_file, const String &p scene->set_script(Variant(root_script)); } - if (Object::cast_to<Spatial>(scene)) { + if (Object::cast_to<Node3D>(scene)) { float root_scale = p_options["nodes/root_scale"]; - Object::cast_to<Spatial>(scene)->scale(Vector3(root_scale, root_scale, root_scale)); + Object::cast_to<Node3D>(scene)->scale(Vector3(root_scale, root_scale, root_scale)); } if (p_options["nodes/root_name"] != "Scene Root") @@ -1368,7 +1368,7 @@ Error ResourceImporterScene::import(const String &p_source_file, const String &p float anim_optimizer_maxang = p_options["animation/optimizer/max_angle"]; int light_bake_mode = p_options["meshes/light_baking"]; - Map<Ref<Mesh>, List<Ref<Shape>>> collision_map; + Map<Ref<Mesh>, List<Ref<Shape3D>>> collision_map; scene = _fix_node(scene, scene, collision_map, LightBakeMode(light_bake_mode)); @@ -1533,7 +1533,7 @@ Error ResourceImporterScene::import(const String &p_source_file, const String &p return OK; } -ResourceImporterScene *ResourceImporterScene::singleton = NULL; +ResourceImporterScene *ResourceImporterScene::singleton = nullptr; ResourceImporterScene::ResourceImporterScene() { singleton = this; @@ -1550,10 +1550,10 @@ Node *EditorSceneImporterESCN::import_scene(const String &p_path, uint32_t p_fla Error error; Ref<PackedScene> ps = ResourceFormatLoaderText::singleton->load(p_path, p_path, &error); - ERR_FAIL_COND_V_MSG(!ps.is_valid(), NULL, "Cannot load scene as text resource from path '" + p_path + "'."); + ERR_FAIL_COND_V_MSG(!ps.is_valid(), nullptr, "Cannot load scene as text resource from path '" + p_path + "'."); Node *scene = ps->instance(); - ERR_FAIL_COND_V(!scene, NULL); + ERR_FAIL_COND_V(!scene, nullptr); return scene; } diff --git a/editor/import/resource_importer_scene.h b/editor/import/resource_importer_scene.h index 6d1043eb28..f48f181951 100644 --- a/editor/import/resource_importer_scene.h +++ b/editor/import/resource_importer_scene.h @@ -34,7 +34,7 @@ #include "core/io/resource_importer.h" #include "scene/resources/animation.h" #include "scene/resources/mesh.h" -#include "scene/resources/shape.h" +#include "scene/resources/shape_3d.h" class Material; @@ -66,7 +66,7 @@ public: virtual uint32_t get_import_flags() const; virtual void get_extensions(List<String> *r_extensions) const; - virtual Node *import_scene(const String &p_path, uint32_t p_flags, int p_bake_fps, List<String> *r_missing_deps, Error *r_err = NULL); + virtual Node *import_scene(const String &p_path, uint32_t p_flags, int p_bake_fps, List<String> *r_missing_deps, Error *r_err = nullptr); virtual Ref<Animation> import_animation(const String &p_path, uint32_t p_flags, int p_bake_fps); EditorSceneImporter() {} @@ -147,14 +147,14 @@ public: void _make_external_resources(Node *p_node, const String &p_base_path, bool p_make_animations, bool p_animations_as_text, bool p_keep_animations, bool p_make_materials, bool p_materials_as_text, bool p_keep_materials, bool p_make_meshes, bool p_meshes_as_text, Map<Ref<Animation>, Ref<Animation>> &p_animations, Map<Ref<Material>, Ref<Material>> &p_materials, Map<Ref<ArrayMesh>, Ref<ArrayMesh>> &p_meshes); - Node *_fix_node(Node *p_node, Node *p_root, Map<Ref<Mesh>, List<Ref<Shape>>> &collision_map, LightBakeMode p_light_bake_mode); + Node *_fix_node(Node *p_node, Node *p_root, Map<Ref<Mesh>, List<Ref<Shape3D>>> &collision_map, LightBakeMode p_light_bake_mode); void _create_clips(Node *scene, const Array &p_clips, bool p_bake_all); void _filter_anim_tracks(Ref<Animation> anim, Set<String> &keep); void _filter_tracks(Node *scene, const String &p_text); void _optimize_animations(Node *scene, float p_max_lin_error, float p_max_ang_error, float p_max_angle); - virtual Error import(const String &p_source_file, const String &p_save_path, const Map<StringName, Variant> &p_options, List<String> *r_platform_variants, List<String> *r_gen_files = NULL, Variant *r_metadata = NULL); + virtual Error import(const String &p_source_file, const String &p_save_path, const Map<StringName, Variant> &p_options, List<String> *r_platform_variants, List<String> *r_gen_files = nullptr, Variant *r_metadata = nullptr); Node *import_scene_from_other_importer(EditorSceneImporter *p_exception, const String &p_path, uint32_t p_flags, int p_bake_fps); Ref<Animation> import_animation_from_other_importer(EditorSceneImporter *p_exception, const String &p_path, uint32_t p_flags, int p_bake_fps); @@ -168,7 +168,7 @@ class EditorSceneImporterESCN : public EditorSceneImporter { public: virtual uint32_t get_import_flags() const; virtual void get_extensions(List<String> *r_extensions) const; - virtual Node *import_scene(const String &p_path, uint32_t p_flags, int p_bake_fps, List<String> *r_missing_deps, Error *r_err = NULL); + virtual Node *import_scene(const String &p_path, uint32_t p_flags, int p_bake_fps, List<String> *r_missing_deps, Error *r_err = nullptr); virtual Ref<Animation> import_animation(const String &p_path, uint32_t p_flags, int p_bake_fps); }; diff --git a/editor/import/resource_importer_shader_file.cpp b/editor/import/resource_importer_shader_file.cpp new file mode 100644 index 0000000000..a2f178de12 --- /dev/null +++ b/editor/import/resource_importer_shader_file.cpp @@ -0,0 +1,90 @@ +#include "resource_importer_shader_file.h" + +#include "core/io/marshalls.h" +#include "core/io/resource_saver.h" +#include "core/os/file_access.h" +#include "editor/editor_node.h" +#include "editor/plugins/shader_file_editor_plugin.h" +#include "servers/rendering/rendering_device_binds.h" + +String ResourceImporterShaderFile::get_importer_name() const { + + return "glsl"; +} + +String ResourceImporterShaderFile::get_visible_name() const { + + return "GLSL Shader File"; +} +void ResourceImporterShaderFile::get_recognized_extensions(List<String> *p_extensions) const { + + p_extensions->push_back("glsl"); +} +String ResourceImporterShaderFile::get_save_extension() const { + return "res"; +} + +String ResourceImporterShaderFile::get_resource_type() const { + + return "RDShaderFile"; +} + +int ResourceImporterShaderFile::get_preset_count() const { + return 0; +} +String ResourceImporterShaderFile::get_preset_name(int p_idx) const { + + return String(); +} + +void ResourceImporterShaderFile::get_import_options(List<ImportOption> *r_options, int p_preset) const { +} + +bool ResourceImporterShaderFile::get_option_visibility(const String &p_option, const Map<StringName, Variant> &p_options) const { + return true; +} +static String _include_function(const String &p_path, void *userpointer) { + Error err; + + String *base_path = (String *)userpointer; + + String include = p_path; + if (include.is_rel_path()) { + include = base_path->plus_file(include); + } + + FileAccessRef file_inc = FileAccess::open(include, FileAccess::READ, &err); + if (err != OK) { + return String(); + } + return file_inc->get_as_utf8_string(); +} + +Error ResourceImporterShaderFile::import(const String &p_source_file, const String &p_save_path, const Map<StringName, Variant> &p_options, List<String> *r_platform_variants, List<String> *r_gen_files, Variant *r_metadata) { + + /* STEP 1, Read shader code */ + + Error err; + FileAccessRef file = FileAccess::open(p_source_file, FileAccess::READ, &err); + ERR_FAIL_COND_V(err != OK, ERR_CANT_OPEN); + ERR_FAIL_COND_V(!file.operator->(), ERR_CANT_OPEN); + + String file_txt = file->get_as_utf8_string(); + Ref<RDShaderFile> shader_file; + shader_file.instance(); + String base_path = p_source_file.get_base_dir(); + err = shader_file->parse_versions_from_text(file_txt, _include_function, &base_path); + + if (err != OK) { + if (!ShaderFileEditor::singleton->is_visible_in_tree()) { + EditorNode::get_singleton()->add_io_error(vformat(TTR("Error importing GLSL shader file: '%s'. Open the file in the filesystem dock in order to see the reason."), p_source_file)); + } + } + + ResourceSaver::save(p_save_path + ".res", shader_file); + + return OK; +} + +ResourceImporterShaderFile::ResourceImporterShaderFile() { +} diff --git a/editor/import/resource_importer_shader_file.h b/editor/import/resource_importer_shader_file.h new file mode 100644 index 0000000000..f6b50bee9e --- /dev/null +++ b/editor/import/resource_importer_shader_file.h @@ -0,0 +1,27 @@ +#ifndef RESOURCE_IMPORTER_SHADER_FILE_H +#define RESOURCE_IMPORTER_SHADER_FILE_H + +#include "core/io/resource_importer.h" + +class ResourceImporterShaderFile : public ResourceImporter { + GDCLASS(ResourceImporterShaderFile, ResourceImporter); + +public: + virtual String get_importer_name() const; + virtual String get_visible_name() const; + virtual void get_recognized_extensions(List<String> *p_extensions) const; + virtual String get_save_extension() const; + virtual String get_resource_type() const; + + virtual int get_preset_count() const; + virtual String get_preset_name(int p_idx) const; + + virtual void get_import_options(List<ImportOption> *r_options, int p_preset = 0) const; + virtual bool get_option_visibility(const String &p_option, const Map<StringName, Variant> &p_options) const; + + virtual Error import(const String &p_source_file, const String &p_save_path, const Map<StringName, Variant> &p_options, List<String> *r_platform_variants, List<String> *r_gen_files = nullptr, Variant *r_metadata = nullptr); + + ResourceImporterShaderFile(); +}; + +#endif // RESOURCE_IMPORTER_SHADER_FILE_H diff --git a/editor/import/resource_importer_texture.cpp b/editor/import/resource_importer_texture.cpp index 0090d30b9c..f8ed9304b6 100644 --- a/editor/import/resource_importer_texture.cpp +++ b/editor/import/resource_importer_texture.cpp @@ -36,7 +36,7 @@ #include "editor/editor_file_system.h" #include "editor/editor_node.h" -void ResourceImporterTexture::_texture_reimport_roughness(const Ref<StreamTexture> &p_tex, const String &p_normal_path, VS::TextureDetectRoughnessChannel p_channel) { +void ResourceImporterTexture::_texture_reimport_roughness(const Ref<StreamTexture> &p_tex, const String &p_normal_path, RS::TextureDetectRoughnessChannel p_channel) { MutexLock lock(singleton->mutex); @@ -424,7 +424,7 @@ Error ResourceImporterTexture::import(const String &p_source_file, const String String normal_map = p_options["roughness/src_normal"]; Ref<Image> normal_image; - Image::RoughnessChannel roughness_channel; + Image::RoughnessChannel roughness_channel = Image::ROUGHNESS_CHANNEL_R; if (mipmaps && roughness > 1 && FileAccess::exists(normal_map)) { normal_image.instance(); @@ -434,7 +434,7 @@ Error ResourceImporterTexture::import(const String &p_source_file, const String } Ref<Image> image; image.instance(); - Error err = ImageLoader::load_image(p_source_file, image, NULL, hdr_as_srgb, scale); + Error err = ImageLoader::load_image(p_source_file, image, nullptr, hdr_as_srgb, scale); if (err != OK) return err; @@ -575,7 +575,7 @@ const char *ResourceImporterTexture::compression_formats[] = { "etc", "etc2", "pvrtc", - NULL + nullptr }; String ResourceImporterTexture::get_import_settings_string() const { @@ -630,7 +630,7 @@ bool ResourceImporterTexture::are_import_settings_valid(const String &p_path) co return valid; } -ResourceImporterTexture *ResourceImporterTexture::singleton = NULL; +ResourceImporterTexture *ResourceImporterTexture::singleton = nullptr; ResourceImporterTexture::ResourceImporterTexture() { diff --git a/editor/import/resource_importer_texture.h b/editor/import/resource_importer_texture.h index ed0fe1be89..e1c71ff1b8 100644 --- a/editor/import/resource_importer_texture.h +++ b/editor/import/resource_importer_texture.h @@ -35,7 +35,7 @@ #include "core/io/resource_importer.h" #include "core/os/file_access.h" #include "scene/resources/texture.h" -#include "servers/visual_server.h" +#include "servers/rendering_server.h" class StreamTexture; @@ -63,16 +63,16 @@ protected: int flags; String normal_path_for_roughness; - VS::TextureDetectRoughnessChannel channel_for_roughness; + RS::TextureDetectRoughnessChannel channel_for_roughness; MakeInfo() { flags = 0; - channel_for_roughness = VS::TEXTURE_DETECT_ROUGNHESS_R; + channel_for_roughness = RS::TEXTURE_DETECT_ROUGNHESS_R; } }; Map<StringName, MakeInfo> make_flags; - static void _texture_reimport_roughness(const Ref<StreamTexture> &p_tex, const String &p_normal_path, VisualServer::TextureDetectRoughnessChannel p_channel); + static void _texture_reimport_roughness(const Ref<StreamTexture> &p_tex, const String &p_normal_path, RenderingServer::TextureDetectRoughnessChannel p_channel); static void _texture_reimport_3d(const Ref<StreamTexture> &p_tex); static void _texture_reimport_normal(const Ref<StreamTexture> &p_tex); @@ -104,7 +104,7 @@ public: virtual void get_import_options(List<ImportOption> *r_options, int p_preset = 0) const; virtual bool get_option_visibility(const String &p_option, const Map<StringName, Variant> &p_options) const; - virtual Error import(const String &p_source_file, const String &p_save_path, const Map<StringName, Variant> &p_options, List<String> *r_platform_variants, List<String> *r_gen_files = NULL, Variant *r_metadata = NULL); + virtual Error import(const String &p_source_file, const String &p_save_path, const Map<StringName, Variant> &p_options, List<String> *r_platform_variants, List<String> *r_gen_files = nullptr, Variant *r_metadata = nullptr); void update_imports(); diff --git a/editor/import/resource_importer_texture_atlas.h b/editor/import/resource_importer_texture_atlas.h index a36cae5872..c61fa5c040 100644 --- a/editor/import/resource_importer_texture_atlas.h +++ b/editor/import/resource_importer_texture_atlas.h @@ -63,7 +63,7 @@ public: virtual bool get_option_visibility(const String &p_option, const Map<StringName, Variant> &p_options) const; virtual String get_option_group_file() const; - virtual Error import(const String &p_source_file, const String &p_save_path, const Map<StringName, Variant> &p_options, List<String> *r_platform_variants, List<String> *r_gen_files = NULL, Variant *r_metadata = NULL); + virtual Error import(const String &p_source_file, const String &p_save_path, const Map<StringName, Variant> &p_options, List<String> *r_platform_variants, List<String> *r_gen_files = nullptr, Variant *r_metadata = nullptr); virtual Error import_group_file(const String &p_group_file, const Map<String, Map<StringName, Variant>> &p_source_file_options, const Map<String, String> &p_base_paths); ResourceImporterTextureAtlas(); diff --git a/editor/import/resource_importer_wav.h b/editor/import/resource_importer_wav.h index 6df5b88b13..bc2f023e6b 100644 --- a/editor/import/resource_importer_wav.h +++ b/editor/import/resource_importer_wav.h @@ -162,7 +162,7 @@ public: } } - virtual Error import(const String &p_source_file, const String &p_save_path, const Map<StringName, Variant> &p_options, List<String> *r_platform_variants, List<String> *r_gen_files = NULL, Variant *r_metadata = NULL); + virtual Error import(const String &p_source_file, const String &p_save_path, const Map<StringName, Variant> &p_options, List<String> *r_platform_variants, List<String> *r_gen_files = nullptr, Variant *r_metadata = nullptr); ResourceImporterWAV(); }; diff --git a/editor/import_dock.cpp b/editor/import_dock.cpp index e2e68f0f41..22f6aedeaa 100644 --- a/editor/import_dock.cpp +++ b/editor/import_dock.cpp @@ -424,7 +424,7 @@ void ImportDock::_reimport_attempt() { if (need_restart) { label_warning->set_visible(used_in_resources); - reimport_confirm->popup_centered_minsize(); + reimport_confirm->popup_centered(); return; } @@ -450,8 +450,8 @@ void ImportDock::_reimport() { String importer_name = params->importer->get_importer_name(); - if (params->checking) { - //update only what edited (checkboxes) + if (params->checking && config->get_value("remap", "importer") == params->importer->get_importer_name()) { + //update only what is edited (checkboxes) if the importer is the same for (List<PropertyInfo>::Element *E = params->properties.front(); E; E = E->next()) { if (params->checked.has(E->get().name)) { config->set_value("params", E->get().name, params->values[E->get().name]); @@ -492,13 +492,13 @@ void ImportDock::_notification(int p_what) { case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: { - imported->add_style_override("normal", get_stylebox("normal", "LineEdit")); + imported->add_theme_style_override("normal", get_theme_stylebox("normal", "LineEdit")); } break; case NOTIFICATION_ENTER_TREE: { import_opts->edit(params); - label_warning->add_color_override("font_color", get_color("warning_color", "Editor")); + label_warning->add_theme_color_override("font_color", get_theme_color("warning_color", "Editor")); } break; } } @@ -526,7 +526,7 @@ ImportDock::ImportDock() { set_name("Import"); imported = memnew(Label); - imported->add_style_override("normal", EditorNode::get_singleton()->get_gui_base()->get_stylebox("normal", "LineEdit")); + imported->add_theme_style_override("normal", EditorNode::get_singleton()->get_gui_base()->get_theme_stylebox("normal", "LineEdit")); imported->set_clip_text(true); add_child(imported); HBoxContainer *hb = memnew(HBoxContainer); @@ -558,7 +558,7 @@ ImportDock::ImportDock() { hb->add_spacer(); reimport_confirm = memnew(ConfirmationDialog); - reimport_confirm->get_ok()->set_text(TTR("Save scenes, re-import and restart")); + reimport_confirm->get_ok()->set_text(TTR("Save Scenes, Re-Import, and Restart")); add_child(reimport_confirm); reimport_confirm->connect("confirmed", callable_mp(this, &ImportDock::_reimport_and_restart)); diff --git a/editor/inspector_dock.cpp b/editor/inspector_dock.cpp index 2729d9ecb5..3715547bdc 100644 --- a/editor/inspector_dock.cpp +++ b/editor/inspector_dock.cpp @@ -112,7 +112,7 @@ void InspectorDock::_menu_option(int p_option) { editor_data->get_undo_redo().clear_history(); - editor->get_editor_plugins_over()->edit(NULL); + editor->get_editor_plugins_over()->edit(nullptr); editor->get_editor_plugins_over()->edit(current); } break; @@ -140,7 +140,7 @@ void InspectorDock::_new_resource() { } void InspectorDock::_load_resource(const String &p_type) { - load_resource_dialog->set_mode(EditorFileDialog::MODE_OPEN_FILE); + load_resource_dialog->set_file_mode(EditorFileDialog::FILE_MODE_OPEN_FILE); List<String> extensions; ResourceLoader::get_recognized_extensions_for_type(p_type, &extensions); @@ -166,7 +166,7 @@ void InspectorDock::_resource_file_selected(String p_file) { void InspectorDock::_save_resource(bool save_as) const { ObjectID current = EditorNode::get_singleton()->get_editor_history()->get_current(); - Object *current_obj = current.is_valid() ? ObjectDB::get_instance(current) : NULL; + Object *current_obj = current.is_valid() ? ObjectDB::get_instance(current) : nullptr; ERR_FAIL_COND(!Object::cast_to<Resource>(current_obj)); @@ -180,7 +180,7 @@ void InspectorDock::_save_resource(bool save_as) const { void InspectorDock::_unref_resource() const { ObjectID current = EditorNode::get_singleton()->get_editor_history()->get_current(); - Object *current_obj = current.is_valid() ? ObjectDB::get_instance(current) : NULL; + Object *current_obj = current.is_valid() ? ObjectDB::get_instance(current) : nullptr; ERR_FAIL_COND(!Object::cast_to<Resource>(current_obj)); @@ -191,7 +191,7 @@ void InspectorDock::_unref_resource() const { void InspectorDock::_copy_resource() const { ObjectID current = EditorNode::get_singleton()->get_editor_history()->get_current(); - Object *current_obj = current.is_valid() ? ObjectDB::get_instance(current) : NULL; + Object *current_obj = current.is_valid() ? ObjectDB::get_instance(current) : nullptr; ERR_FAIL_COND(!Object::cast_to<Resource>(current_obj)); @@ -214,7 +214,7 @@ void InspectorDock::_prepare_history() { history_menu->get_popup()->clear(); - Ref<Texture2D> base_icon = get_icon("Object", "EditorIcons"); + Ref<Texture2D> base_icon = get_theme_icon("Object", "EditorIcons"); Set<ObjectID> already; for (int i = editor_history->get_history_len() - 1; i >= history_to; i--) { @@ -310,14 +310,14 @@ void InspectorDock::_property_keyed(const String &p_keyed, const Variant &p_valu } void InspectorDock::_transform_keyed(Object *sp, const String &p_sub, const Transform &p_key) { - Spatial *s = Object::cast_to<Spatial>(sp); + Node3D *s = Object::cast_to<Node3D>(sp); if (!s) return; AnimationPlayerEditor::singleton->get_track_editor()->insert_transform_key(s, p_sub, p_key); } void InspectorDock::_warning_pressed() { - warning_dialog->popup_centered_minsize(); + warning_dialog->popup_centered(); } Container *InspectorDock::get_addon_area() { @@ -328,15 +328,15 @@ void InspectorDock::_notification(int p_what) { switch (p_what) { case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: { set_theme(editor->get_gui_base()->get_theme()); - resource_new_button->set_icon(get_icon("New", "EditorIcons")); - resource_load_button->set_icon(get_icon("Load", "EditorIcons")); - resource_save_button->set_icon(get_icon("Save", "EditorIcons")); - backward_button->set_icon(get_icon("Back", "EditorIcons")); - forward_button->set_icon(get_icon("Forward", "EditorIcons")); - history_menu->set_icon(get_icon("History", "EditorIcons")); - object_menu->set_icon(get_icon("Tools", "EditorIcons")); - warning->set_icon(get_icon("NodeWarning", "EditorIcons")); - warning->add_color_override("font_color", get_color("warning_color", "Editor")); + resource_new_button->set_icon(get_theme_icon("New", "EditorIcons")); + resource_load_button->set_icon(get_theme_icon("Load", "EditorIcons")); + resource_save_button->set_icon(get_theme_icon("Save", "EditorIcons")); + backward_button->set_icon(get_theme_icon("Back", "EditorIcons")); + forward_button->set_icon(get_theme_icon("Forward", "EditorIcons")); + history_menu->set_icon(get_theme_icon("History", "EditorIcons")); + object_menu->set_icon(get_theme_icon("Tools", "EditorIcons")); + warning->set_icon(get_theme_icon("NodeWarning", "EditorIcons")); + warning->add_theme_color_override("font_color", get_theme_color("warning_color", "Editor")); } break; } } @@ -397,7 +397,7 @@ void InspectorDock::update(Object *p_object) { editor_path->set_disabled(true); editor_path->set_text(""); editor_path->set_tooltip(""); - editor_path->set_icon(NULL); + editor_path->set_icon(nullptr); return; } @@ -435,7 +435,7 @@ void InspectorDock::update(Object *p_object) { p->add_separator(); p->add_shortcut(ED_SHORTCUT("property_editor/make_subresources_unique", TTR("Make Sub-Resources Unique")), OBJECT_UNIQUE_RESOURCES); p->add_separator(); - p->add_icon_shortcut(get_icon("HelpSearch", "EditorIcons"), ED_SHORTCUT("property_editor/open_help", TTR("Open in Help")), OBJECT_REQUEST_HELP); + p->add_icon_shortcut(get_theme_icon("HelpSearch", "EditorIcons"), ED_SHORTCUT("property_editor/open_help", TTR("Open in Help")), OBJECT_REQUEST_HELP); } List<MethodInfo> methods; @@ -496,21 +496,21 @@ InspectorDock::InspectorDock(EditorNode *p_editor, EditorData &p_editor_data) { resource_new_button = memnew(ToolButton); resource_new_button->set_tooltip(TTR("Create a new resource in memory and edit it.")); - resource_new_button->set_icon(get_icon("New", "EditorIcons")); + resource_new_button->set_icon(get_theme_icon("New", "EditorIcons")); general_options_hb->add_child(resource_new_button); resource_new_button->connect("pressed", callable_mp(this, &InspectorDock::_new_resource)); resource_new_button->set_focus_mode(Control::FOCUS_NONE); resource_load_button = memnew(ToolButton); resource_load_button->set_tooltip(TTR("Load an existing resource from disk and edit it.")); - resource_load_button->set_icon(get_icon("Load", "EditorIcons")); + resource_load_button->set_icon(get_theme_icon("Load", "EditorIcons")); general_options_hb->add_child(resource_load_button); resource_load_button->connect("pressed", callable_mp(this, &InspectorDock::_open_resource_selector)); resource_load_button->set_focus_mode(Control::FOCUS_NONE); resource_save_button = memnew(MenuButton); resource_save_button->set_tooltip(TTR("Save the currently edited resource.")); - resource_save_button->set_icon(get_icon("Save", "EditorIcons")); + resource_save_button->set_icon(get_theme_icon("Save", "EditorIcons")); general_options_hb->add_child(resource_save_button); resource_save_button->get_popup()->add_item(TTR("Save"), RESOURCE_SAVE); resource_save_button->get_popup()->add_item(TTR("Save As..."), RESOURCE_SAVE_AS); @@ -522,7 +522,7 @@ InspectorDock::InspectorDock(EditorNode *p_editor, EditorData &p_editor_data) { backward_button = memnew(ToolButton); general_options_hb->add_child(backward_button); - backward_button->set_icon(get_icon("Back", "EditorIcons")); + backward_button->set_icon(get_theme_icon("Back", "EditorIcons")); backward_button->set_flat(true); backward_button->set_tooltip(TTR("Go to the previous edited object in history.")); backward_button->set_disabled(true); @@ -530,7 +530,7 @@ InspectorDock::InspectorDock(EditorNode *p_editor, EditorData &p_editor_data) { forward_button = memnew(ToolButton); general_options_hb->add_child(forward_button); - forward_button->set_icon(get_icon("Forward", "EditorIcons")); + forward_button->set_icon(get_theme_icon("Forward", "EditorIcons")); forward_button->set_flat(true); forward_button->set_tooltip(TTR("Go to the next edited object in history.")); forward_button->set_disabled(true); @@ -538,9 +538,9 @@ InspectorDock::InspectorDock(EditorNode *p_editor, EditorData &p_editor_data) { history_menu = memnew(MenuButton); history_menu->set_tooltip(TTR("History of recently edited objects.")); - history_menu->set_icon(get_icon("History", "EditorIcons")); + history_menu->set_icon(get_theme_icon("History", "EditorIcons")); general_options_hb->add_child(history_menu); - history_menu->connect("about_to_show", callable_mp(this, &InspectorDock::_prepare_history)); + history_menu->connect("about_to_popup", callable_mp(this, &InspectorDock::_prepare_history)); history_menu->get_popup()->connect("id_pressed", callable_mp(this, &InspectorDock::_select_history)); HBoxContainer *node_info_hb = memnew(HBoxContainer); @@ -551,7 +551,7 @@ InspectorDock::InspectorDock(EditorNode *p_editor, EditorData &p_editor_data) { node_info_hb->add_child(editor_path); object_menu = memnew(MenuButton); - object_menu->set_icon(get_icon("Tools", "EditorIcons")); + object_menu->set_icon(get_theme_icon("Tools", "EditorIcons")); node_info_hb->add_child(object_menu); object_menu->set_tooltip(TTR("Object properties.")); object_menu->get_popup()->connect("id_pressed", callable_mp(this, &InspectorDock::_menu_option)); @@ -564,15 +564,15 @@ InspectorDock::InspectorDock(EditorNode *p_editor, EditorData &p_editor_data) { search = memnew(LineEdit); search->set_h_size_flags(Control::SIZE_EXPAND_FILL); search->set_placeholder(TTR("Filter properties")); - search->set_right_icon(get_icon("Search", "EditorIcons")); + search->set_right_icon(get_theme_icon("Search", "EditorIcons")); search->set_clear_button_enabled(true); add_child(search); warning = memnew(Button); add_child(warning); warning->set_text(TTR("Changes may be lost!")); - warning->set_icon(get_icon("NodeWarning", "EditorIcons")); - warning->add_color_override("font_color", get_color("warning_color", "Editor")); + warning->set_icon(get_theme_icon("NodeWarning", "EditorIcons")); + warning->add_theme_color_override("font_color", get_theme_color("warning_color", "Editor")); warning->set_clip_text(true); warning->hide(); warning->connect("pressed", callable_mp(this, &InspectorDock::_warning_pressed)); diff --git a/editor/spatial_editor_gizmos.cpp b/editor/node_3d_editor_gizmos.cpp index d6e443ec14..31a8320209 100644 --- a/editor/spatial_editor_gizmos.cpp +++ b/editor/node_3d_editor_gizmos.cpp @@ -1,5 +1,5 @@ /*************************************************************************/ -/* spatial_editor_gizmos.cpp */ +/* node_3d_editor_gizmos.cpp */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ @@ -28,45 +28,46 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#include "spatial_editor_gizmos.h" +#include "node_3d_editor_gizmos.h" #include "core/math/geometry.h" #include "core/math/quick_hull.h" #include "scene/3d/audio_stream_player_3d.h" #include "scene/3d/baked_lightmap.h" -#include "scene/3d/collision_polygon.h" -#include "scene/3d/collision_shape.h" -#include "scene/3d/cpu_particles.h" +#include "scene/3d/collision_polygon_3d.h" +#include "scene/3d/collision_shape_3d.h" +#include "scene/3d/cpu_particles_3d.h" +#include "scene/3d/decal.h" #include "scene/3d/gi_probe.h" -#include "scene/3d/light.h" -#include "scene/3d/listener.h" -#include "scene/3d/mesh_instance.h" -#include "scene/3d/navigation_region.h" -#include "scene/3d/particles.h" -#include "scene/3d/physics_joint.h" +#include "scene/3d/gpu_particles_3d.h" +#include "scene/3d/light_3d.h" +#include "scene/3d/listener_3d.h" +#include "scene/3d/mesh_instance_3d.h" +#include "scene/3d/navigation_region_3d.h" +#include "scene/3d/physics_joint_3d.h" #include "scene/3d/position_3d.h" -#include "scene/3d/ray_cast.h" +#include "scene/3d/ray_cast_3d.h" #include "scene/3d/reflection_probe.h" -#include "scene/3d/soft_body.h" -#include "scene/3d/spring_arm.h" +#include "scene/3d/soft_body_3d.h" +#include "scene/3d/spring_arm_3d.h" #include "scene/3d/sprite_3d.h" -#include "scene/3d/vehicle_body.h" -#include "scene/3d/visibility_notifier.h" -#include "scene/resources/box_shape.h" -#include "scene/resources/capsule_shape.h" -#include "scene/resources/concave_polygon_shape.h" -#include "scene/resources/convex_polygon_shape.h" -#include "scene/resources/cylinder_shape.h" -#include "scene/resources/height_map_shape.h" +#include "scene/3d/vehicle_body_3d.h" +#include "scene/3d/visibility_notifier_3d.h" +#include "scene/resources/box_shape_3d.h" +#include "scene/resources/capsule_shape_3d.h" +#include "scene/resources/concave_polygon_shape_3d.h" +#include "scene/resources/convex_polygon_shape_3d.h" +#include "scene/resources/cylinder_shape_3d.h" +#include "scene/resources/height_map_shape_3d.h" #include "scene/resources/primitive_meshes.h" -#include "scene/resources/ray_shape.h" -#include "scene/resources/sphere_shape.h" +#include "scene/resources/ray_shape_3d.h" +#include "scene/resources/sphere_shape_3d.h" #include "scene/resources/surface_tool.h" -#include "scene/resources/world_margin_shape.h" +#include "scene/resources/world_margin_shape_3d.h" #define HANDLE_HALF_SIZE 9.5 -bool EditorSpatialGizmo::is_editable() const { +bool EditorNode3DGizmo::is_editable() const { ERR_FAIL_COND_V(!spatial_node, false); Node *edited_root = spatial_node->get_tree()->get_edited_scene_root(); @@ -81,12 +82,12 @@ bool EditorSpatialGizmo::is_editable() const { return false; } -void EditorSpatialGizmo::clear() { +void EditorNode3DGizmo::clear() { for (int i = 0; i < instances.size(); i++) { if (instances[i].instance.is_valid()) - VS::get_singleton()->free(instances[i].instance); + RS::get_singleton()->free(instances[i].instance); } billboard_handle = false; @@ -97,7 +98,7 @@ void EditorSpatialGizmo::clear() { secondary_handles.clear(); } -void EditorSpatialGizmo::redraw() { +void EditorNode3DGizmo::redraw() { if (get_script_instance() && get_script_instance()->has_method("redraw")) { get_script_instance()->call("redraw"); @@ -108,7 +109,7 @@ void EditorSpatialGizmo::redraw() { gizmo_plugin->redraw(this); } -String EditorSpatialGizmo::get_handle_name(int p_idx) const { +String EditorNode3DGizmo::get_handle_name(int p_idx) const { if (get_script_instance() && get_script_instance()->has_method("get_handle_name")) { return get_script_instance()->call("get_handle_name", p_idx); @@ -118,7 +119,7 @@ String EditorSpatialGizmo::get_handle_name(int p_idx) const { return gizmo_plugin->get_handle_name(this, p_idx); } -bool EditorSpatialGizmo::is_handle_highlighted(int p_idx) const { +bool EditorNode3DGizmo::is_handle_highlighted(int p_idx) const { if (get_script_instance() && get_script_instance()->has_method("is_handle_highlighted")) { return get_script_instance()->call("is_handle_highlighted", p_idx); @@ -128,7 +129,7 @@ bool EditorSpatialGizmo::is_handle_highlighted(int p_idx) const { return gizmo_plugin->is_handle_highlighted(this, p_idx); } -Variant EditorSpatialGizmo::get_handle_value(int p_idx) { +Variant EditorNode3DGizmo::get_handle_value(int p_idx) { if (get_script_instance() && get_script_instance()->has_method("get_handle_value")) { return get_script_instance()->call("get_handle_value", p_idx); @@ -138,7 +139,7 @@ Variant EditorSpatialGizmo::get_handle_value(int p_idx) { return gizmo_plugin->get_handle_value(this, p_idx); } -void EditorSpatialGizmo::set_handle(int p_idx, Camera *p_camera, const Point2 &p_point) { +void EditorNode3DGizmo::set_handle(int p_idx, Camera3D *p_camera, const Point2 &p_point) { if (get_script_instance() && get_script_instance()->has_method("set_handle")) { get_script_instance()->call("set_handle", p_idx, p_camera, p_point); @@ -149,7 +150,7 @@ void EditorSpatialGizmo::set_handle(int p_idx, Camera *p_camera, const Point2 &p gizmo_plugin->set_handle(this, p_idx, p_camera, p_point); } -void EditorSpatialGizmo::commit_handle(int p_idx, const Variant &p_restore, bool p_cancel) { +void EditorNode3DGizmo::commit_handle(int p_idx, const Variant &p_restore, bool p_cancel) { if (get_script_instance() && get_script_instance()->has_method("commit_handle")) { get_script_instance()->call("commit_handle", p_idx, p_restore, p_cancel); @@ -160,27 +161,27 @@ void EditorSpatialGizmo::commit_handle(int p_idx, const Variant &p_restore, bool gizmo_plugin->commit_handle(this, p_idx, p_restore, p_cancel); } -void EditorSpatialGizmo::set_spatial_node(Spatial *p_node) { +void EditorNode3DGizmo::set_spatial_node(Node3D *p_node) { ERR_FAIL_NULL(p_node); spatial_node = p_node; } -void EditorSpatialGizmo::Instance::create_instance(Spatial *p_base, bool p_hidden) { +void EditorNode3DGizmo::Instance::create_instance(Node3D *p_base, bool p_hidden) { - instance = VS::get_singleton()->instance_create2(mesh->get_rid(), p_base->get_world()->get_scenario()); - VS::get_singleton()->instance_attach_object_instance_id(instance, p_base->get_instance_id()); + instance = RS::get_singleton()->instance_create2(mesh->get_rid(), p_base->get_world()->get_scenario()); + RS::get_singleton()->instance_attach_object_instance_id(instance, p_base->get_instance_id()); if (skin_reference.is_valid()) { - VS::get_singleton()->instance_attach_skeleton(instance, skin_reference->get_skeleton()); + RS::get_singleton()->instance_attach_skeleton(instance, skin_reference->get_skeleton()); } if (extra_margin) - VS::get_singleton()->instance_set_extra_visibility_margin(instance, 1); - VS::get_singleton()->instance_geometry_set_cast_shadows_setting(instance, VS::SHADOW_CASTING_SETTING_OFF); - int layer = p_hidden ? 0 : 1 << SpatialEditorViewport::GIZMO_EDIT_LAYER; - VS::get_singleton()->instance_set_layer_mask(instance, layer); //gizmos are 26 + RS::get_singleton()->instance_set_extra_visibility_margin(instance, 1); + RS::get_singleton()->instance_geometry_set_cast_shadows_setting(instance, RS::SHADOW_CASTING_SETTING_OFF); + int layer = p_hidden ? 0 : 1 << Node3DEditorViewport::GIZMO_EDIT_LAYER; + RS::get_singleton()->instance_set_layer_mask(instance, layer); //gizmos are 26 } -void EditorSpatialGizmo::add_mesh(const Ref<ArrayMesh> &p_mesh, bool p_billboard, const Ref<SkinReference> &p_skin_reference, const Ref<Material> &p_material) { +void EditorNode3DGizmo::add_mesh(const Ref<ArrayMesh> &p_mesh, bool p_billboard, const Ref<SkinReference> &p_skin_reference, const Ref<Material> &p_material) { ERR_FAIL_COND(!spatial_node); Instance ins; @@ -191,16 +192,16 @@ void EditorSpatialGizmo::add_mesh(const Ref<ArrayMesh> &p_mesh, bool p_billboard ins.material = p_material; if (valid) { ins.create_instance(spatial_node, hidden); - VS::get_singleton()->instance_set_transform(ins.instance, spatial_node->get_global_transform()); + RS::get_singleton()->instance_set_transform(ins.instance, spatial_node->get_global_transform()); if (ins.material.is_valid()) { - VS::get_singleton()->instance_geometry_set_material_override(ins.instance, p_material->get_rid()); + RS::get_singleton()->instance_geometry_set_material_override(ins.instance, p_material->get_rid()); } } instances.push_back(ins); } -void EditorSpatialGizmo::add_lines(const Vector<Vector3> &p_lines, const Ref<Material> &p_material, bool p_billboard, const Color &p_modulate) { +void EditorNode3DGizmo::add_lines(const Vector<Vector3> &p_lines, const Ref<Material> &p_material, bool p_billboard, const Color &p_modulate) { if (p_lines.empty()) { return; } @@ -246,13 +247,13 @@ void EditorSpatialGizmo::add_lines(const Vector<Vector3> &p_lines, const Ref<Mat ins.mesh = mesh; if (valid) { ins.create_instance(spatial_node, hidden); - VS::get_singleton()->instance_set_transform(ins.instance, spatial_node->get_global_transform()); + RS::get_singleton()->instance_set_transform(ins.instance, spatial_node->get_global_transform()); } instances.push_back(ins); } -void EditorSpatialGizmo::add_unscaled_billboard(const Ref<Material> &p_material, float p_scale, const Color &p_modulate) { +void EditorNode3DGizmo::add_unscaled_billboard(const Ref<Material> &p_material, float p_scale, const Color &p_modulate) { ERR_FAIL_COND(!spatial_node); Instance ins; @@ -310,7 +311,7 @@ void EditorSpatialGizmo::add_unscaled_billboard(const Ref<Material> &p_material, ins.billboard = true; if (valid) { ins.create_instance(spatial_node, hidden); - VS::get_singleton()->instance_set_transform(ins.instance, spatial_node->get_global_transform()); + RS::get_singleton()->instance_set_transform(ins.instance, spatial_node->get_global_transform()); } selectable_icon_size = p_scale; @@ -318,11 +319,11 @@ void EditorSpatialGizmo::add_unscaled_billboard(const Ref<Material> &p_material, instances.push_back(ins); } -void EditorSpatialGizmo::add_collision_triangles(const Ref<TriangleMesh> &p_tmesh) { +void EditorNode3DGizmo::add_collision_triangles(const Ref<TriangleMesh> &p_tmesh) { collision_mesh = p_tmesh; } -void EditorSpatialGizmo::add_collision_segments(const Vector<Vector3> &p_lines) { +void EditorNode3DGizmo::add_collision_segments(const Vector<Vector3> &p_lines) { int from = collision_segments.size(); collision_segments.resize(from + p_lines.size()); @@ -332,7 +333,7 @@ void EditorSpatialGizmo::add_collision_segments(const Vector<Vector3> &p_lines) } } -void EditorSpatialGizmo::add_handles(const Vector<Vector3> &p_handles, const Ref<Material> &p_material, bool p_billboard, bool p_secondary) { +void EditorNode3DGizmo::add_handles(const Vector<Vector3> &p_handles, const Ref<Material> &p_material, bool p_billboard, bool p_secondary) { billboard_handle = p_billboard; @@ -346,8 +347,8 @@ void EditorSpatialGizmo::add_handles(const Vector<Vector3> &p_handles, const Ref Ref<ArrayMesh> mesh = memnew(ArrayMesh); Array a; - a.resize(VS::ARRAY_MAX); - a[VS::ARRAY_VERTEX] = p_handles; + a.resize(RS::ARRAY_MAX); + a[RS::ARRAY_VERTEX] = p_handles; Vector<Color> colors; { colors.resize(p_handles.size()); @@ -358,13 +359,13 @@ void EditorSpatialGizmo::add_handles(const Vector<Vector3> &p_handles, const Ref if (is_handle_highlighted(i)) col = Color(0, 0, 1, 0.9); - if (SpatialEditor::get_singleton()->get_over_gizmo_handle() != i) + if (Node3DEditor::get_singleton()->get_over_gizmo_handle() != i) col.a = 0.8; w[i] = col; } } - a[VS::ARRAY_COLOR] = colors; + a[RS::ARRAY_COLOR] = colors; mesh->add_surface_from_arrays(Mesh::PRIMITIVE_POINTS, a); mesh->surface_set_material(0, p_material); @@ -384,7 +385,7 @@ void EditorSpatialGizmo::add_handles(const Vector<Vector3> &p_handles, const Ref ins.extra_margin = true; if (valid) { ins.create_instance(spatial_node, hidden); - VS::get_singleton()->instance_set_transform(ins.instance, spatial_node->get_global_transform()); + RS::get_singleton()->instance_set_transform(ins.instance, spatial_node->get_global_transform()); } instances.push_back(ins); if (!p_secondary) { @@ -403,21 +404,21 @@ void EditorSpatialGizmo::add_handles(const Vector<Vector3> &p_handles, const Ref } } -void EditorSpatialGizmo::add_solid_box(Ref<Material> &p_material, Vector3 p_size, Vector3 p_position) { +void EditorNode3DGizmo::add_solid_box(Ref<Material> &p_material, Vector3 p_size, Vector3 p_position) { ERR_FAIL_COND(!spatial_node); CubeMesh cubem; cubem.set_size(p_size); Array arrays = cubem.surface_get_arrays(0); - PackedVector3Array vertex = arrays[VS::ARRAY_VERTEX]; + PackedVector3Array vertex = arrays[RS::ARRAY_VERTEX]; Vector3 *w = vertex.ptrw(); for (int i = 0; i < vertex.size(); ++i) { w[i] += p_position; } - arrays[VS::ARRAY_VERTEX] = vertex; + arrays[RS::ARRAY_VERTEX] = vertex; Ref<ArrayMesh> m = memnew(ArrayMesh); m->add_surface_from_arrays(cubem.surface_get_primitive_type(0), arrays); @@ -425,7 +426,7 @@ void EditorSpatialGizmo::add_solid_box(Ref<Material> &p_material, Vector3 p_size add_mesh(m); } -bool EditorSpatialGizmo::intersect_frustum(const Camera *p_camera, const Vector<Plane> &p_frustum) { +bool EditorNode3DGizmo::intersect_frustum(const Camera3D *p_camera, const Vector<Plane> &p_frustum) { ERR_FAIL_COND_V(!spatial_node, false); ERR_FAIL_COND_V(!valid, false); @@ -497,7 +498,7 @@ bool EditorSpatialGizmo::intersect_frustum(const Camera *p_camera, const Vector< return false; } -bool EditorSpatialGizmo::intersect_ray(Camera *p_camera, const Point2 &p_point, Vector3 &r_pos, Vector3 &r_normal, int *r_gizmo_handle, bool p_sec_first) { +bool EditorNode3DGizmo::intersect_ray(Camera3D *p_camera, const Point2 &p_point, Vector3 &r_pos, Vector3 &r_normal, int *r_gizmo_handle, bool p_sec_first) { ERR_FAIL_COND_V(!spatial_node, false); ERR_FAIL_COND_V(!valid, false); @@ -574,7 +575,7 @@ bool EditorSpatialGizmo::intersect_ray(Camera *p_camera, const Point2 &p_point, float scale = t.origin.distance_to(p_camera->get_camera_transform().origin); - if (p_camera->get_projection() == Camera::PROJECTION_ORTHOGONAL) { + if (p_camera->get_projection() == Camera3D::PROJECTION_ORTHOGONAL) { float aspect = p_camera->get_viewport()->get_visible_rect().size.aspect(); float size = p_camera->get_size(); scale = size / aspect; @@ -689,7 +690,7 @@ bool EditorSpatialGizmo::intersect_ray(Camera *p_camera, const Point2 &p_point, return false; } -void EditorSpatialGizmo::create() { +void EditorNode3DGizmo::create() { ERR_FAIL_COND(!spatial_node); ERR_FAIL_COND(valid); @@ -703,16 +704,16 @@ void EditorSpatialGizmo::create() { transform(); } -void EditorSpatialGizmo::transform() { +void EditorNode3DGizmo::transform() { ERR_FAIL_COND(!spatial_node); ERR_FAIL_COND(!valid); for (int i = 0; i < instances.size(); i++) { - VS::get_singleton()->instance_set_transform(instances[i].instance, spatial_node->get_global_transform()); + RS::get_singleton()->instance_set_transform(instances[i].instance, spatial_node->get_global_transform()); } } -void EditorSpatialGizmo::free() { +void EditorNode3DGizmo::free() { ERR_FAIL_COND(!spatial_node); ERR_FAIL_COND(!valid); @@ -720,7 +721,7 @@ void EditorSpatialGizmo::free() { for (int i = 0; i < instances.size(); i++) { if (instances[i].instance.is_valid()) - VS::get_singleton()->free(instances[i].instance); + RS::get_singleton()->free(instances[i].instance); instances.write[i].instance = RID(); } @@ -729,31 +730,31 @@ void EditorSpatialGizmo::free() { valid = false; } -void EditorSpatialGizmo::set_hidden(bool p_hidden) { +void EditorNode3DGizmo::set_hidden(bool p_hidden) { hidden = p_hidden; - int layer = hidden ? 0 : 1 << SpatialEditorViewport::GIZMO_EDIT_LAYER; + int layer = hidden ? 0 : 1 << Node3DEditorViewport::GIZMO_EDIT_LAYER; for (int i = 0; i < instances.size(); ++i) { - VS::get_singleton()->instance_set_layer_mask(instances[i].instance, layer); + RS::get_singleton()->instance_set_layer_mask(instances[i].instance, layer); } } -void EditorSpatialGizmo::set_plugin(EditorSpatialGizmoPlugin *p_plugin) { +void EditorNode3DGizmo::set_plugin(EditorNode3DGizmoPlugin *p_plugin) { gizmo_plugin = p_plugin; } -void EditorSpatialGizmo::_bind_methods() { +void EditorNode3DGizmo::_bind_methods() { - ClassDB::bind_method(D_METHOD("add_lines", "lines", "material", "billboard", "modulate"), &EditorSpatialGizmo::add_lines, DEFVAL(false), DEFVAL(Color(1, 1, 1))); - ClassDB::bind_method(D_METHOD("add_mesh", "mesh", "billboard", "skeleton", "material"), &EditorSpatialGizmo::add_mesh, DEFVAL(false), DEFVAL(Ref<SkinReference>()), DEFVAL(Variant())); - ClassDB::bind_method(D_METHOD("add_collision_segments", "segments"), &EditorSpatialGizmo::add_collision_segments); - ClassDB::bind_method(D_METHOD("add_collision_triangles", "triangles"), &EditorSpatialGizmo::add_collision_triangles); - ClassDB::bind_method(D_METHOD("add_unscaled_billboard", "material", "default_scale", "modulate"), &EditorSpatialGizmo::add_unscaled_billboard, DEFVAL(1), DEFVAL(Color(1, 1, 1))); - ClassDB::bind_method(D_METHOD("add_handles", "handles", "material", "billboard", "secondary"), &EditorSpatialGizmo::add_handles, DEFVAL(false), DEFVAL(false)); - ClassDB::bind_method(D_METHOD("set_spatial_node", "node"), &EditorSpatialGizmo::_set_spatial_node); - ClassDB::bind_method(D_METHOD("get_spatial_node"), &EditorSpatialGizmo::get_spatial_node); - ClassDB::bind_method(D_METHOD("get_plugin"), &EditorSpatialGizmo::get_plugin); - ClassDB::bind_method(D_METHOD("clear"), &EditorSpatialGizmo::clear); - ClassDB::bind_method(D_METHOD("set_hidden", "hidden"), &EditorSpatialGizmo::set_hidden); + ClassDB::bind_method(D_METHOD("add_lines", "lines", "material", "billboard", "modulate"), &EditorNode3DGizmo::add_lines, DEFVAL(false), DEFVAL(Color(1, 1, 1))); + ClassDB::bind_method(D_METHOD("add_mesh", "mesh", "billboard", "skeleton", "material"), &EditorNode3DGizmo::add_mesh, DEFVAL(false), DEFVAL(Ref<SkinReference>()), DEFVAL(Variant())); + ClassDB::bind_method(D_METHOD("add_collision_segments", "segments"), &EditorNode3DGizmo::add_collision_segments); + ClassDB::bind_method(D_METHOD("add_collision_triangles", "triangles"), &EditorNode3DGizmo::add_collision_triangles); + ClassDB::bind_method(D_METHOD("add_unscaled_billboard", "material", "default_scale", "modulate"), &EditorNode3DGizmo::add_unscaled_billboard, DEFVAL(1), DEFVAL(Color(1, 1, 1))); + ClassDB::bind_method(D_METHOD("add_handles", "handles", "material", "billboard", "secondary"), &EditorNode3DGizmo::add_handles, DEFVAL(false), DEFVAL(false)); + ClassDB::bind_method(D_METHOD("set_spatial_node", "node"), &EditorNode3DGizmo::_set_spatial_node); + ClassDB::bind_method(D_METHOD("get_spatial_node"), &EditorNode3DGizmo::get_spatial_node); + ClassDB::bind_method(D_METHOD("get_plugin"), &EditorNode3DGizmo::get_plugin); + ClassDB::bind_method(D_METHOD("clear"), &EditorNode3DGizmo::clear); + ClassDB::bind_method(D_METHOD("set_hidden", "hidden"), &EditorNode3DGizmo::set_hidden); BIND_VMETHOD(MethodInfo("redraw")); BIND_VMETHOD(MethodInfo(Variant::STRING, "get_handle_name", PropertyInfo(Variant::INT, "index"))); @@ -763,31 +764,31 @@ void EditorSpatialGizmo::_bind_methods() { hvget.return_val.usage |= PROPERTY_USAGE_NIL_IS_VARIANT; BIND_VMETHOD(hvget); - BIND_VMETHOD(MethodInfo("set_handle", PropertyInfo(Variant::INT, "index"), PropertyInfo(Variant::OBJECT, "camera", PROPERTY_HINT_RESOURCE_TYPE, "Camera"), PropertyInfo(Variant::VECTOR2, "point"))); + BIND_VMETHOD(MethodInfo("set_handle", PropertyInfo(Variant::INT, "index"), PropertyInfo(Variant::OBJECT, "camera", PROPERTY_HINT_RESOURCE_TYPE, "Camera3D"), PropertyInfo(Variant::VECTOR2, "point"))); MethodInfo cm = MethodInfo("commit_handle", PropertyInfo(Variant::INT, "index"), PropertyInfo(Variant::NIL, "restore"), PropertyInfo(Variant::BOOL, "cancel")); cm.default_arguments.push_back(false); BIND_VMETHOD(cm); } -EditorSpatialGizmo::EditorSpatialGizmo() { +EditorNode3DGizmo::EditorNode3DGizmo() { valid = false; billboard_handle = false; hidden = false; - base = NULL; + base = nullptr; selected = false; instanced = false; - spatial_node = NULL; - gizmo_plugin = NULL; + spatial_node = nullptr; + gizmo_plugin = nullptr; selectable_icon_size = -1.0f; } -EditorSpatialGizmo::~EditorSpatialGizmo() { +EditorNode3DGizmo::~EditorNode3DGizmo() { - if (gizmo_plugin != NULL) gizmo_plugin->unregister_gizmo(this); + if (gizmo_plugin != nullptr) gizmo_plugin->unregister_gizmo(this); clear(); } -Vector3 EditorSpatialGizmo::get_handle_pos(int p_idx) const { +Vector3 EditorNode3DGizmo::get_handle_pos(int p_idx) const { ERR_FAIL_INDEX_V(p_idx, handles.size(), Vector3()); @@ -796,34 +797,34 @@ Vector3 EditorSpatialGizmo::get_handle_pos(int p_idx) const { //// light gizmo -LightSpatialGizmoPlugin::LightSpatialGizmoPlugin() { +Light3DGizmoPlugin::Light3DGizmoPlugin() { // Enable vertex colors for the materials below as the gizmo color depends on the light color. create_material("lines_primary", Color(1, 1, 1), false, false, true); create_material("lines_secondary", Color(1, 1, 1, 0.35), false, false, true); create_material("lines_billboard", Color(1, 1, 1), true, false, true); - create_icon_material("light_directional_icon", SpatialEditor::get_singleton()->get_icon("GizmoDirectionalLight", "EditorIcons")); - create_icon_material("light_omni_icon", SpatialEditor::get_singleton()->get_icon("GizmoLight", "EditorIcons")); - create_icon_material("light_spot_icon", SpatialEditor::get_singleton()->get_icon("GizmoSpotLight", "EditorIcons")); + create_icon_material("light_directional_icon", Node3DEditor::get_singleton()->get_theme_icon("GizmoDirectionalLight", "EditorIcons")); + create_icon_material("light_omni_icon", Node3DEditor::get_singleton()->get_theme_icon("GizmoLight", "EditorIcons")); + create_icon_material("light_spot_icon", Node3DEditor::get_singleton()->get_theme_icon("GizmoSpotLight", "EditorIcons")); create_handle_material("handles"); create_handle_material("handles_billboard", true); } -bool LightSpatialGizmoPlugin::has_gizmo(Spatial *p_spatial) { - return Object::cast_to<Light>(p_spatial) != NULL; +bool Light3DGizmoPlugin::has_gizmo(Node3D *p_spatial) { + return Object::cast_to<Light3D>(p_spatial) != nullptr; } -String LightSpatialGizmoPlugin::get_name() const { - return "Lights"; +String Light3DGizmoPlugin::get_name() const { + return "Light3D"; } -int LightSpatialGizmoPlugin::get_priority() const { +int Light3DGizmoPlugin::get_priority() const { return -1; } -String LightSpatialGizmoPlugin::get_handle_name(const EditorSpatialGizmo *p_gizmo, int p_idx) const { +String Light3DGizmoPlugin::get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_idx) const { if (p_idx == 0) return "Radius"; @@ -831,13 +832,13 @@ String LightSpatialGizmoPlugin::get_handle_name(const EditorSpatialGizmo *p_gizm return "Aperture"; } -Variant LightSpatialGizmoPlugin::get_handle_value(EditorSpatialGizmo *p_gizmo, int p_idx) const { +Variant Light3DGizmoPlugin::get_handle_value(EditorNode3DGizmo *p_gizmo, int p_idx) const { - Light *light = Object::cast_to<Light>(p_gizmo->get_spatial_node()); + Light3D *light = Object::cast_to<Light3D>(p_gizmo->get_spatial_node()); if (p_idx == 0) - return light->get_param(Light::PARAM_RANGE); + return light->get_param(Light3D::PARAM_RANGE); if (p_idx == 1) - return light->get_param(Light::PARAM_SPOT_ANGLE); + return light->get_param(Light3D::PARAM_SPOT_ANGLE); return Variant(); } @@ -871,9 +872,9 @@ static float _find_closest_angle_to_half_pi_arc(const Vector3 &p_from, const Vec return a * 180.0 / Math_PI; } -void LightSpatialGizmoPlugin::set_handle(EditorSpatialGizmo *p_gizmo, int p_idx, Camera *p_camera, const Point2 &p_point) { +void Light3DGizmoPlugin::set_handle(EditorNode3DGizmo *p_gizmo, int p_idx, Camera3D *p_camera, const Point2 &p_point) { - Light *light = Object::cast_to<Light>(p_gizmo->get_spatial_node()); + Light3D *light = Object::cast_to<Light3D>(p_gizmo->get_spatial_node()); Transform gt = light->get_global_transform(); Transform gi = gt.affine_inverse(); @@ -883,20 +884,20 @@ void LightSpatialGizmoPlugin::set_handle(EditorSpatialGizmo *p_gizmo, int p_idx, Vector3 s[2] = { gi.xform(ray_from), gi.xform(ray_from + ray_dir * 4096) }; if (p_idx == 0) { - if (Object::cast_to<SpotLight>(light)) { + if (Object::cast_to<SpotLight3D>(light)) { Vector3 ra, rb; Geometry::get_closest_points_between_segments(Vector3(), Vector3(0, 0, -4096), s[0], s[1], ra, rb); float d = -ra.z; - if (SpatialEditor::get_singleton()->is_snap_enabled()) { - d = Math::stepify(d, SpatialEditor::get_singleton()->get_translate_snap()); + if (Node3DEditor::get_singleton()->is_snap_enabled()) { + d = Math::stepify(d, Node3DEditor::get_singleton()->get_translate_snap()); } if (d <= 0) // Equal is here for negative zero. d = 0; - light->set_param(Light::PARAM_RANGE, d); - } else if (Object::cast_to<OmniLight>(light)) { + light->set_param(Light3D::PARAM_RANGE, d); + } else if (Object::cast_to<OmniLight3D>(light)) { Plane cp = Plane(gt.origin, p_camera->get_transform().basis.get_axis(2)); @@ -904,48 +905,48 @@ void LightSpatialGizmoPlugin::set_handle(EditorSpatialGizmo *p_gizmo, int p_idx, if (cp.intersects_ray(ray_from, ray_dir, &inters)) { float r = inters.distance_to(gt.origin); - if (SpatialEditor::get_singleton()->is_snap_enabled()) { - r = Math::stepify(r, SpatialEditor::get_singleton()->get_translate_snap()); + if (Node3DEditor::get_singleton()->is_snap_enabled()) { + r = Math::stepify(r, Node3DEditor::get_singleton()->get_translate_snap()); } - light->set_param(Light::PARAM_RANGE, r); + light->set_param(Light3D::PARAM_RANGE, r); } } } else if (p_idx == 1) { - float a = _find_closest_angle_to_half_pi_arc(s[0], s[1], light->get_param(Light::PARAM_RANGE), gt); - light->set_param(Light::PARAM_SPOT_ANGLE, CLAMP(a, 0.01, 89.99)); + float a = _find_closest_angle_to_half_pi_arc(s[0], s[1], light->get_param(Light3D::PARAM_RANGE), gt); + light->set_param(Light3D::PARAM_SPOT_ANGLE, CLAMP(a, 0.01, 89.99)); } } -void LightSpatialGizmoPlugin::commit_handle(EditorSpatialGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel) { +void Light3DGizmoPlugin::commit_handle(EditorNode3DGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel) { - Light *light = Object::cast_to<Light>(p_gizmo->get_spatial_node()); + Light3D *light = Object::cast_to<Light3D>(p_gizmo->get_spatial_node()); if (p_cancel) { - light->set_param(p_idx == 0 ? Light::PARAM_RANGE : Light::PARAM_SPOT_ANGLE, p_restore); + light->set_param(p_idx == 0 ? Light3D::PARAM_RANGE : Light3D::PARAM_SPOT_ANGLE, p_restore); } else if (p_idx == 0) { - UndoRedo *ur = SpatialEditor::get_singleton()->get_undo_redo(); + UndoRedo *ur = Node3DEditor::get_singleton()->get_undo_redo(); ur->create_action(TTR("Change Light Radius")); - ur->add_do_method(light, "set_param", Light::PARAM_RANGE, light->get_param(Light::PARAM_RANGE)); - ur->add_undo_method(light, "set_param", Light::PARAM_RANGE, p_restore); + ur->add_do_method(light, "set_param", Light3D::PARAM_RANGE, light->get_param(Light3D::PARAM_RANGE)); + ur->add_undo_method(light, "set_param", Light3D::PARAM_RANGE, p_restore); ur->commit_action(); } else if (p_idx == 1) { - UndoRedo *ur = SpatialEditor::get_singleton()->get_undo_redo(); + UndoRedo *ur = Node3DEditor::get_singleton()->get_undo_redo(); ur->create_action(TTR("Change Light Radius")); - ur->add_do_method(light, "set_param", Light::PARAM_SPOT_ANGLE, light->get_param(Light::PARAM_SPOT_ANGLE)); - ur->add_undo_method(light, "set_param", Light::PARAM_SPOT_ANGLE, p_restore); + ur->add_do_method(light, "set_param", Light3D::PARAM_SPOT_ANGLE, light->get_param(Light3D::PARAM_SPOT_ANGLE)); + ur->add_undo_method(light, "set_param", Light3D::PARAM_SPOT_ANGLE, p_restore); ur->commit_action(); } } -void LightSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { +void Light3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { - Light *light = Object::cast_to<Light>(p_gizmo->get_spatial_node()); + Light3D *light = Object::cast_to<Light3D>(p_gizmo->get_spatial_node()); Color color = light->get_color(); // Make the gizmo color as bright as possible for better visibility @@ -953,7 +954,7 @@ void LightSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { p_gizmo->clear(); - if (Object::cast_to<DirectionalLight>(light)) { + if (Object::cast_to<DirectionalLight3D>(light)) { Ref<Material> material = get_material("lines_primary", p_gizmo); Ref<Material> icon = get_material("light_directional_icon", p_gizmo); @@ -991,15 +992,15 @@ void LightSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { p_gizmo->add_unscaled_billboard(icon, 0.05, color); } - if (Object::cast_to<OmniLight>(light)) { + if (Object::cast_to<OmniLight3D>(light)) { // Use both a billboard circle and 3 non-billboard circles for a better sphere-like representation const Ref<Material> lines_material = get_material("lines_secondary", p_gizmo); const Ref<Material> lines_billboard_material = get_material("lines_billboard", p_gizmo); const Ref<Material> icon = get_material("light_omni_icon", p_gizmo); - OmniLight *on = Object::cast_to<OmniLight>(light); - const float r = on->get_param(Light::PARAM_RANGE); + OmniLight3D *on = Object::cast_to<OmniLight3D>(light); + const float r = on->get_param(Light3D::PARAM_RANGE); Vector<Vector3> points; Vector<Vector3> points_billboard; @@ -1033,7 +1034,7 @@ void LightSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { p_gizmo->add_handles(handles, get_material("handles_billboard"), true); } - if (Object::cast_to<SpotLight>(light)) { + if (Object::cast_to<SpotLight3D>(light)) { const Ref<Material> material_primary = get_material("lines_primary", p_gizmo); const Ref<Material> material_secondary = get_material("lines_secondary", p_gizmo); @@ -1041,11 +1042,11 @@ void LightSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { Vector<Vector3> points_primary; Vector<Vector3> points_secondary; - SpotLight *sl = Object::cast_to<SpotLight>(light); + SpotLight3D *sl = Object::cast_to<SpotLight3D>(light); - float r = sl->get_param(Light::PARAM_RANGE); - float w = r * Math::sin(Math::deg2rad(sl->get_param(Light::PARAM_SPOT_ANGLE))); - float d = r * Math::cos(Math::deg2rad(sl->get_param(Light::PARAM_SPOT_ANGLE))); + float r = sl->get_param(Light3D::PARAM_RANGE); + float w = r * Math::sin(Math::deg2rad(sl->get_param(Light3D::PARAM_SPOT_ANGLE))); + float d = r * Math::cos(Math::deg2rad(sl->get_param(Light3D::PARAM_SPOT_ANGLE))); for (int i = 0; i < 120; i++) { @@ -1086,39 +1087,39 @@ void LightSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { ////// //// player gizmo -AudioStreamPlayer3DSpatialGizmoPlugin::AudioStreamPlayer3DSpatialGizmoPlugin() { +AudioStreamPlayer3DGizmoPlugin::AudioStreamPlayer3DGizmoPlugin() { Color gizmo_color = EDITOR_DEF("editors/3d_gizmos/gizmo_colors/stream_player_3d", Color(0.4, 0.8, 1)); - create_icon_material("stream_player_3d_icon", SpatialEditor::get_singleton()->get_icon("GizmoSpatialSamplePlayer", "EditorIcons")); + create_icon_material("stream_player_3d_icon", Node3DEditor::get_singleton()->get_theme_icon("Gizmo3DSamplePlayer", "EditorIcons")); create_material("stream_player_3d_material_primary", gizmo_color); create_material("stream_player_3d_material_secondary", gizmo_color * Color(1, 1, 1, 0.35)); create_handle_material("handles"); } -bool AudioStreamPlayer3DSpatialGizmoPlugin::has_gizmo(Spatial *p_spatial) { - return Object::cast_to<AudioStreamPlayer3D>(p_spatial) != NULL; +bool AudioStreamPlayer3DGizmoPlugin::has_gizmo(Node3D *p_spatial) { + return Object::cast_to<AudioStreamPlayer3D>(p_spatial) != nullptr; } -String AudioStreamPlayer3DSpatialGizmoPlugin::get_name() const { +String AudioStreamPlayer3DGizmoPlugin::get_name() const { return "AudioStreamPlayer3D"; } -int AudioStreamPlayer3DSpatialGizmoPlugin::get_priority() const { +int AudioStreamPlayer3DGizmoPlugin::get_priority() const { return -1; } -String AudioStreamPlayer3DSpatialGizmoPlugin::get_handle_name(const EditorSpatialGizmo *p_gizmo, int p_idx) const { +String AudioStreamPlayer3DGizmoPlugin::get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_idx) const { return "Emission Radius"; } -Variant AudioStreamPlayer3DSpatialGizmoPlugin::get_handle_value(EditorSpatialGizmo *p_gizmo, int p_idx) const { +Variant AudioStreamPlayer3DGizmoPlugin::get_handle_value(EditorNode3DGizmo *p_gizmo, int p_idx) const { AudioStreamPlayer3D *player = Object::cast_to<AudioStreamPlayer3D>(p_gizmo->get_spatial_node()); return player->get_emission_angle(); } -void AudioStreamPlayer3DSpatialGizmoPlugin::set_handle(EditorSpatialGizmo *p_gizmo, int p_idx, Camera *p_camera, const Point2 &p_point) { +void AudioStreamPlayer3DGizmoPlugin::set_handle(EditorNode3DGizmo *p_gizmo, int p_idx, Camera3D *p_camera, const Point2 &p_point) { AudioStreamPlayer3D *player = Object::cast_to<AudioStreamPlayer3D>(p_gizmo->get_spatial_node()); @@ -1157,7 +1158,7 @@ void AudioStreamPlayer3DSpatialGizmoPlugin::set_handle(EditorSpatialGizmo *p_giz } } -void AudioStreamPlayer3DSpatialGizmoPlugin::commit_handle(EditorSpatialGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel) { +void AudioStreamPlayer3DGizmoPlugin::commit_handle(EditorNode3DGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel) { AudioStreamPlayer3D *player = Object::cast_to<AudioStreamPlayer3D>(p_gizmo->get_spatial_node()); @@ -1167,7 +1168,7 @@ void AudioStreamPlayer3DSpatialGizmoPlugin::commit_handle(EditorSpatialGizmo *p_ } else { - UndoRedo *ur = SpatialEditor::get_singleton()->get_undo_redo(); + UndoRedo *ur = Node3DEditor::get_singleton()->get_undo_redo(); ur->create_action(TTR("Change AudioStreamPlayer3D Emission Angle")); ur->add_do_method(player, "set_emission_angle", player->get_emission_angle()); ur->add_undo_method(player, "set_emission_angle", p_restore); @@ -1175,7 +1176,7 @@ void AudioStreamPlayer3DSpatialGizmoPlugin::commit_handle(EditorSpatialGizmo *p_ } } -void AudioStreamPlayer3DSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { +void AudioStreamPlayer3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { const AudioStreamPlayer3D *player = Object::cast_to<AudioStreamPlayer3D>(p_gizmo->get_spatial_node()); @@ -1233,7 +1234,7 @@ void AudioStreamPlayer3DSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) ////// -CameraSpatialGizmoPlugin::CameraSpatialGizmoPlugin() { +Camera3DGizmoPlugin::Camera3DGizmoPlugin() { Color gizmo_color = EDITOR_DEF("editors/3d_gizmos/gizmo_colors/camera", Color(0.8, 0.4, 0.8)); @@ -1241,34 +1242,34 @@ CameraSpatialGizmoPlugin::CameraSpatialGizmoPlugin() { create_handle_material("handles"); } -bool CameraSpatialGizmoPlugin::has_gizmo(Spatial *p_spatial) { - return Object::cast_to<Camera>(p_spatial) != NULL; +bool Camera3DGizmoPlugin::has_gizmo(Node3D *p_spatial) { + return Object::cast_to<Camera3D>(p_spatial) != nullptr; } -String CameraSpatialGizmoPlugin::get_name() const { - return "Camera"; +String Camera3DGizmoPlugin::get_name() const { + return "Camera3D"; } -int CameraSpatialGizmoPlugin::get_priority() const { +int Camera3DGizmoPlugin::get_priority() const { return -1; } -String CameraSpatialGizmoPlugin::get_handle_name(const EditorSpatialGizmo *p_gizmo, int p_idx) const { +String Camera3DGizmoPlugin::get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_idx) const { - Camera *camera = Object::cast_to<Camera>(p_gizmo->get_spatial_node()); + Camera3D *camera = Object::cast_to<Camera3D>(p_gizmo->get_spatial_node()); - if (camera->get_projection() == Camera::PROJECTION_PERSPECTIVE) { + if (camera->get_projection() == Camera3D::PROJECTION_PERSPECTIVE) { return "FOV"; } else { return "Size"; } } -Variant CameraSpatialGizmoPlugin::get_handle_value(EditorSpatialGizmo *p_gizmo, int p_idx) const { +Variant Camera3DGizmoPlugin::get_handle_value(EditorNode3DGizmo *p_gizmo, int p_idx) const { - Camera *camera = Object::cast_to<Camera>(p_gizmo->get_spatial_node()); + Camera3D *camera = Object::cast_to<Camera3D>(p_gizmo->get_spatial_node()); - if (camera->get_projection() == Camera::PROJECTION_PERSPECTIVE) { + if (camera->get_projection() == Camera3D::PROJECTION_PERSPECTIVE) { return camera->get_fov(); } else { @@ -1276,9 +1277,9 @@ Variant CameraSpatialGizmoPlugin::get_handle_value(EditorSpatialGizmo *p_gizmo, } } -void CameraSpatialGizmoPlugin::set_handle(EditorSpatialGizmo *p_gizmo, int p_idx, Camera *p_camera, const Point2 &p_point) { +void Camera3DGizmoPlugin::set_handle(EditorNode3DGizmo *p_gizmo, int p_idx, Camera3D *p_camera, const Point2 &p_point) { - Camera *camera = Object::cast_to<Camera>(p_gizmo->get_spatial_node()); + Camera3D *camera = Object::cast_to<Camera3D>(p_gizmo->get_spatial_node()); Transform gt = camera->get_global_transform(); Transform gi = gt.affine_inverse(); @@ -1288,7 +1289,7 @@ void CameraSpatialGizmoPlugin::set_handle(EditorSpatialGizmo *p_gizmo, int p_idx Vector3 s[2] = { gi.xform(ray_from), gi.xform(ray_from + ray_dir * 4096) }; - if (camera->get_projection() == Camera::PROJECTION_PERSPECTIVE) { + if (camera->get_projection() == Camera3D::PROJECTION_PERSPECTIVE) { Transform gt2 = camera->get_global_transform(); float a = _find_closest_angle_to_half_pi_arc(s[0], s[1], 1.0, gt2); camera->set("fov", CLAMP(a * 2.0, 1, 179)); @@ -1297,8 +1298,8 @@ void CameraSpatialGizmoPlugin::set_handle(EditorSpatialGizmo *p_gizmo, int p_idx Vector3 ra, rb; Geometry::get_closest_points_between_segments(Vector3(0, 0, -1), Vector3(4096, 0, -1), s[0], s[1], ra, rb); float d = ra.x * 2.0; - if (SpatialEditor::get_singleton()->is_snap_enabled()) { - d = Math::stepify(d, SpatialEditor::get_singleton()->get_translate_snap()); + if (Node3DEditor::get_singleton()->is_snap_enabled()) { + d = Math::stepify(d, Node3DEditor::get_singleton()->get_translate_snap()); } d = CLAMP(d, 0.1, 16384); @@ -1307,17 +1308,17 @@ void CameraSpatialGizmoPlugin::set_handle(EditorSpatialGizmo *p_gizmo, int p_idx } } -void CameraSpatialGizmoPlugin::commit_handle(EditorSpatialGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel) { +void Camera3DGizmoPlugin::commit_handle(EditorNode3DGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel) { - Camera *camera = Object::cast_to<Camera>(p_gizmo->get_spatial_node()); + Camera3D *camera = Object::cast_to<Camera3D>(p_gizmo->get_spatial_node()); - if (camera->get_projection() == Camera::PROJECTION_PERSPECTIVE) { + if (camera->get_projection() == Camera3D::PROJECTION_PERSPECTIVE) { if (p_cancel) { camera->set("fov", p_restore); } else { - UndoRedo *ur = SpatialEditor::get_singleton()->get_undo_redo(); + UndoRedo *ur = Node3DEditor::get_singleton()->get_undo_redo(); ur->create_action(TTR("Change Camera FOV")); ur->add_do_property(camera, "fov", camera->get_fov()); ur->add_undo_property(camera, "fov", p_restore); @@ -1330,7 +1331,7 @@ void CameraSpatialGizmoPlugin::commit_handle(EditorSpatialGizmo *p_gizmo, int p_ camera->set("size", p_restore); } else { - UndoRedo *ur = SpatialEditor::get_singleton()->get_undo_redo(); + UndoRedo *ur = Node3DEditor::get_singleton()->get_undo_redo(); ur->create_action(TTR("Change Camera Size")); ur->add_do_property(camera, "size", camera->get_size()); ur->add_undo_property(camera, "size", p_restore); @@ -1339,9 +1340,9 @@ void CameraSpatialGizmoPlugin::commit_handle(EditorSpatialGizmo *p_gizmo, int p_ } } -void CameraSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { +void Camera3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { - Camera *camera = Object::cast_to<Camera>(p_gizmo->get_spatial_node()); + Camera3D *camera = Object::cast_to<Camera3D>(p_gizmo->get_spatial_node()); p_gizmo->clear(); @@ -1374,7 +1375,7 @@ void CameraSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { switch (camera->get_projection()) { - case Camera::PROJECTION_PERSPECTIVE: { + case Camera3D::PROJECTION_PERSPECTIVE: { // The real FOV is halved for accurate representation float fov = camera->get_fov() / 2.0; @@ -1396,7 +1397,7 @@ void CameraSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { ADD_TRIANGLE(tup, side + up, nside + up); } break; - case Camera::PROJECTION_ORTHOGONAL: { + case Camera3D::PROJECTION_ORTHOGONAL: { float size = camera->get_size(); @@ -1418,7 +1419,7 @@ void CameraSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { ADD_TRIANGLE(tup, right + up + back, -right + up + back); } break; - case Camera::PROJECTION_FRUSTUM: { + case Camera3D::PROJECTION_FRUSTUM: { float hsize = camera->get_size() / 2.0; Vector3 side = Vector3(hsize, 0, -camera->get_znear()).normalized(); @@ -1445,9 +1446,9 @@ void CameraSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { p_gizmo->add_lines(lines, material); p_gizmo->add_handles(handles, get_material("handles")); - ClippedCamera *clipcam = Object::cast_to<ClippedCamera>(camera); + ClippedCamera3D *clipcam = Object::cast_to<ClippedCamera3D>(camera); if (clipcam) { - Spatial *parent = Object::cast_to<Spatial>(camera->get_parent()); + Node3D *parent = Object::cast_to<Node3D>(camera->get_parent()); if (!parent) { return; } @@ -1489,28 +1490,28 @@ void CameraSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { ////// -MeshInstanceSpatialGizmoPlugin::MeshInstanceSpatialGizmoPlugin() { +MeshInstance3DGizmoPlugin::MeshInstance3DGizmoPlugin() { } -bool MeshInstanceSpatialGizmoPlugin::has_gizmo(Spatial *p_spatial) { - return Object::cast_to<MeshInstance>(p_spatial) != NULL && Object::cast_to<SoftBody>(p_spatial) == NULL; +bool MeshInstance3DGizmoPlugin::has_gizmo(Node3D *p_spatial) { + return Object::cast_to<MeshInstance3D>(p_spatial) != nullptr && Object::cast_to<SoftBody3D>(p_spatial) == nullptr; } -String MeshInstanceSpatialGizmoPlugin::get_name() const { - return "MeshInstance"; +String MeshInstance3DGizmoPlugin::get_name() const { + return "MeshInstance3D"; } -int MeshInstanceSpatialGizmoPlugin::get_priority() const { +int MeshInstance3DGizmoPlugin::get_priority() const { return -1; } -bool MeshInstanceSpatialGizmoPlugin::can_be_hidden() const { +bool MeshInstance3DGizmoPlugin::can_be_hidden() const { return false; } -void MeshInstanceSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { +void MeshInstance3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { - MeshInstance *mesh = Object::cast_to<MeshInstance>(p_gizmo->get_spatial_node()); + MeshInstance3D *mesh = Object::cast_to<MeshInstance3D>(p_gizmo->get_spatial_node()); p_gizmo->clear(); @@ -1526,26 +1527,26 @@ void MeshInstanceSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { } ///// -Sprite3DSpatialGizmoPlugin::Sprite3DSpatialGizmoPlugin() { +Sprite3DGizmoPlugin::Sprite3DGizmoPlugin() { } -bool Sprite3DSpatialGizmoPlugin::has_gizmo(Spatial *p_spatial) { - return Object::cast_to<Sprite3D>(p_spatial) != NULL; +bool Sprite3DGizmoPlugin::has_gizmo(Node3D *p_spatial) { + return Object::cast_to<Sprite3D>(p_spatial) != nullptr; } -String Sprite3DSpatialGizmoPlugin::get_name() const { +String Sprite3DGizmoPlugin::get_name() const { return "Sprite3D"; } -int Sprite3DSpatialGizmoPlugin::get_priority() const { +int Sprite3DGizmoPlugin::get_priority() const { return -1; } -bool Sprite3DSpatialGizmoPlugin::can_be_hidden() const { +bool Sprite3DGizmoPlugin::can_be_hidden() const { return false; } -void Sprite3DSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { +void Sprite3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { Sprite3D *sprite = Object::cast_to<Sprite3D>(p_gizmo->get_spatial_node()); @@ -1559,7 +1560,7 @@ void Sprite3DSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { /// -Position3DSpatialGizmoPlugin::Position3DSpatialGizmoPlugin() { +Position3DGizmoPlugin::Position3DGizmoPlugin() { pos3d_mesh = Ref<ArrayMesh>(memnew(ArrayMesh)); cursor_points = Vector<Vector3>(); @@ -1571,12 +1572,12 @@ Position3DSpatialGizmoPlugin::Position3DSpatialGizmoPlugin() { cursor_points.push_back(Vector3(0, -cs, 0)); cursor_points.push_back(Vector3(0, 0, +cs)); cursor_points.push_back(Vector3(0, 0, -cs)); - cursor_colors.push_back(EditorNode::get_singleton()->get_gui_base()->get_color("axis_x_color", "Editor")); - cursor_colors.push_back(EditorNode::get_singleton()->get_gui_base()->get_color("axis_x_color", "Editor")); - cursor_colors.push_back(EditorNode::get_singleton()->get_gui_base()->get_color("axis_y_color", "Editor")); - cursor_colors.push_back(EditorNode::get_singleton()->get_gui_base()->get_color("axis_y_color", "Editor")); - cursor_colors.push_back(EditorNode::get_singleton()->get_gui_base()->get_color("axis_z_color", "Editor")); - cursor_colors.push_back(EditorNode::get_singleton()->get_gui_base()->get_color("axis_z_color", "Editor")); + cursor_colors.push_back(EditorNode::get_singleton()->get_gui_base()->get_theme_color("axis_x_color", "Editor")); + cursor_colors.push_back(EditorNode::get_singleton()->get_gui_base()->get_theme_color("axis_x_color", "Editor")); + cursor_colors.push_back(EditorNode::get_singleton()->get_gui_base()->get_theme_color("axis_y_color", "Editor")); + cursor_colors.push_back(EditorNode::get_singleton()->get_gui_base()->get_theme_color("axis_y_color", "Editor")); + cursor_colors.push_back(EditorNode::get_singleton()->get_gui_base()->get_theme_color("axis_z_color", "Editor")); + cursor_colors.push_back(EditorNode::get_singleton()->get_gui_base()->get_theme_color("axis_z_color", "Editor")); Ref<StandardMaterial3D> mat = memnew(StandardMaterial3D); mat->set_shading_mode(StandardMaterial3D::SHADING_MODE_UNSHADED); @@ -1585,26 +1586,26 @@ Position3DSpatialGizmoPlugin::Position3DSpatialGizmoPlugin() { mat->set_transparency(StandardMaterial3D::TRANSPARENCY_ALPHA); Array d; - d.resize(VS::ARRAY_MAX); + d.resize(RS::ARRAY_MAX); d[Mesh::ARRAY_VERTEX] = cursor_points; d[Mesh::ARRAY_COLOR] = cursor_colors; pos3d_mesh->add_surface_from_arrays(Mesh::PRIMITIVE_LINES, d); pos3d_mesh->surface_set_material(0, mat); } -bool Position3DSpatialGizmoPlugin::has_gizmo(Spatial *p_spatial) { - return Object::cast_to<Position3D>(p_spatial) != NULL; +bool Position3DGizmoPlugin::has_gizmo(Node3D *p_spatial) { + return Object::cast_to<Position3D>(p_spatial) != nullptr; } -String Position3DSpatialGizmoPlugin::get_name() const { +String Position3DGizmoPlugin::get_name() const { return "Position3D"; } -int Position3DSpatialGizmoPlugin::get_priority() const { +int Position3DGizmoPlugin::get_priority() const { return -1; } -void Position3DSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { +void Position3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { p_gizmo->clear(); p_gizmo->add_mesh(pos3d_mesh); @@ -1613,27 +1614,27 @@ void Position3DSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { ///// -SkeletonSpatialGizmoPlugin::SkeletonSpatialGizmoPlugin() { +Skeleton3DGizmoPlugin::Skeleton3DGizmoPlugin() { Color gizmo_color = EDITOR_DEF("editors/3d_gizmos/gizmo_colors/skeleton", Color(1, 0.8, 0.4)); create_material("skeleton_material", gizmo_color); } -bool SkeletonSpatialGizmoPlugin::has_gizmo(Spatial *p_spatial) { - return Object::cast_to<Skeleton>(p_spatial) != NULL; +bool Skeleton3DGizmoPlugin::has_gizmo(Node3D *p_spatial) { + return Object::cast_to<Skeleton3D>(p_spatial) != nullptr; } -String SkeletonSpatialGizmoPlugin::get_name() const { - return "Skeleton"; +String Skeleton3DGizmoPlugin::get_name() const { + return "Skeleton3D"; } -int SkeletonSpatialGizmoPlugin::get_priority() const { +int Skeleton3DGizmoPlugin::get_priority() const { return -1; } -void SkeletonSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { +void Skeleton3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { - Skeleton *skel = Object::cast_to<Skeleton>(p_gizmo->get_spatial_node()); + Skeleton3D *skel = Object::cast_to<Skeleton3D>(p_gizmo->get_spatial_node()); p_gizmo->clear(); @@ -1822,54 +1823,54 @@ void SkeletonSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { //// -PhysicalBoneSpatialGizmoPlugin::PhysicalBoneSpatialGizmoPlugin() { +PhysicalBone3DGizmoPlugin::PhysicalBone3DGizmoPlugin() { create_material("joint_material", EDITOR_DEF("editors/3d_gizmos/gizmo_colors/joint", Color(0.5, 0.8, 1))); } -bool PhysicalBoneSpatialGizmoPlugin::has_gizmo(Spatial *p_spatial) { - return Object::cast_to<PhysicalBone>(p_spatial) != NULL; +bool PhysicalBone3DGizmoPlugin::has_gizmo(Node3D *p_spatial) { + return Object::cast_to<PhysicalBone3D>(p_spatial) != nullptr; } -String PhysicalBoneSpatialGizmoPlugin::get_name() const { - return "PhysicalBones"; +String PhysicalBone3DGizmoPlugin::get_name() const { + return "PhysicalBone3D"; } -int PhysicalBoneSpatialGizmoPlugin::get_priority() const { +int PhysicalBone3DGizmoPlugin::get_priority() const { return -1; } -void PhysicalBoneSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { +void PhysicalBone3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { p_gizmo->clear(); - PhysicalBone *physical_bone = Object::cast_to<PhysicalBone>(p_gizmo->get_spatial_node()); + PhysicalBone3D *physical_bone = Object::cast_to<PhysicalBone3D>(p_gizmo->get_spatial_node()); if (!physical_bone) return; - Skeleton *sk(physical_bone->find_skeleton_parent()); + Skeleton3D *sk(physical_bone->find_skeleton_parent()); if (!sk) return; - PhysicalBone *pb(sk->get_physical_bone(physical_bone->get_bone_id())); + PhysicalBone3D *pb(sk->get_physical_bone(physical_bone->get_bone_id())); if (!pb) return; - PhysicalBone *pbp(sk->get_physical_bone_parent(physical_bone->get_bone_id())); + PhysicalBone3D *pbp(sk->get_physical_bone_parent(physical_bone->get_bone_id())); if (!pbp) return; Vector<Vector3> points; switch (physical_bone->get_joint_type()) { - case PhysicalBone::JOINT_TYPE_PIN: { + case PhysicalBone3D::JOINT_TYPE_PIN: { - JointSpatialGizmoPlugin::CreatePinJointGizmo(physical_bone->get_joint_offset(), points); + Joint3DGizmoPlugin::CreatePinJointGizmo(physical_bone->get_joint_offset(), points); } break; - case PhysicalBone::JOINT_TYPE_CONE: { + case PhysicalBone3D::JOINT_TYPE_CONE: { - const PhysicalBone::ConeJointData *cjd(static_cast<const PhysicalBone::ConeJointData *>(physical_bone->get_joint_data())); - JointSpatialGizmoPlugin::CreateConeTwistJointGizmo( + const PhysicalBone3D::ConeJointData *cjd(static_cast<const PhysicalBone3D::ConeJointData *>(physical_bone->get_joint_data())); + Joint3DGizmoPlugin::CreateConeTwistJointGizmo( physical_bone->get_joint_offset(), physical_bone->get_global_transform() * physical_bone->get_joint_offset(), pb->get_global_transform(), @@ -1879,10 +1880,10 @@ void PhysicalBoneSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { &points, &points); } break; - case PhysicalBone::JOINT_TYPE_HINGE: { + case PhysicalBone3D::JOINT_TYPE_HINGE: { - const PhysicalBone::HingeJointData *hjd(static_cast<const PhysicalBone::HingeJointData *>(physical_bone->get_joint_data())); - JointSpatialGizmoPlugin::CreateHingeJointGizmo( + const PhysicalBone3D::HingeJointData *hjd(static_cast<const PhysicalBone3D::HingeJointData *>(physical_bone->get_joint_data())); + Joint3DGizmoPlugin::CreateHingeJointGizmo( physical_bone->get_joint_offset(), physical_bone->get_global_transform() * physical_bone->get_joint_offset(), pb->get_global_transform(), @@ -1894,10 +1895,10 @@ void PhysicalBoneSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { &points, &points); } break; - case PhysicalBone::JOINT_TYPE_SLIDER: { + case PhysicalBone3D::JOINT_TYPE_SLIDER: { - const PhysicalBone::SliderJointData *sjd(static_cast<const PhysicalBone::SliderJointData *>(physical_bone->get_joint_data())); - JointSpatialGizmoPlugin::CreateSliderJointGizmo( + const PhysicalBone3D::SliderJointData *sjd(static_cast<const PhysicalBone3D::SliderJointData *>(physical_bone->get_joint_data())); + Joint3DGizmoPlugin::CreateSliderJointGizmo( physical_bone->get_joint_offset(), physical_bone->get_global_transform() * physical_bone->get_joint_offset(), pb->get_global_transform(), @@ -1910,10 +1911,10 @@ void PhysicalBoneSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { &points, &points); } break; - case PhysicalBone::JOINT_TYPE_6DOF: { + case PhysicalBone3D::JOINT_TYPE_6DOF: { - const PhysicalBone::SixDOFJointData *sdofjd(static_cast<const PhysicalBone::SixDOFJointData *>(physical_bone->get_joint_data())); - JointSpatialGizmoPlugin::CreateGeneric6DOFJointGizmo( + const PhysicalBone3D::SixDOFJointData *sdofjd(static_cast<const PhysicalBone3D::SixDOFJointData *>(physical_bone->get_joint_data())); + Joint3DGizmoPlugin::CreateGeneric6DOFJointGizmo( physical_bone->get_joint_offset(), physical_bone->get_global_transform() * physical_bone->get_joint_offset(), @@ -1957,7 +1958,7 @@ void PhysicalBoneSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { ///// -RayCastSpatialGizmoPlugin::RayCastSpatialGizmoPlugin() { +RayCast3DGizmoPlugin::RayCast3DGizmoPlugin() { const Color gizmo_color = EDITOR_DEF("editors/3d_gizmos/gizmo_colors/shape", Color(0.5, 0.7, 1)); create_material("shape_material", gizmo_color); @@ -1966,21 +1967,21 @@ RayCastSpatialGizmoPlugin::RayCastSpatialGizmoPlugin() { create_material("shape_material_disabled", gizmo_color_disabled); } -bool RayCastSpatialGizmoPlugin::has_gizmo(Spatial *p_spatial) { - return Object::cast_to<RayCast>(p_spatial) != NULL; +bool RayCast3DGizmoPlugin::has_gizmo(Node3D *p_spatial) { + return Object::cast_to<RayCast3D>(p_spatial) != nullptr; } -String RayCastSpatialGizmoPlugin::get_name() const { - return "RayCast"; +String RayCast3DGizmoPlugin::get_name() const { + return "RayCast3D"; } -int RayCastSpatialGizmoPlugin::get_priority() const { +int RayCast3DGizmoPlugin::get_priority() const { return -1; } -void RayCastSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { +void RayCast3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { - RayCast *raycast = Object::cast_to<RayCast>(p_gizmo->get_spatial_node()); + RayCast3D *raycast = Object::cast_to<RayCast3D>(p_gizmo->get_spatial_node()); p_gizmo->clear(); @@ -1998,9 +1999,9 @@ void RayCastSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { ///// -void SpringArmSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { +void SpringArm3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { - SpringArm *spring_arm = Object::cast_to<SpringArm>(p_gizmo->get_spatial_node()); + SpringArm3D *spring_arm = Object::cast_to<SpringArm3D>(p_gizmo->get_spatial_node()); p_gizmo->clear(); @@ -2015,46 +2016,46 @@ void SpringArmSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { p_gizmo->add_collision_segments(lines); } -SpringArmSpatialGizmoPlugin::SpringArmSpatialGizmoPlugin() { +SpringArm3DGizmoPlugin::SpringArm3DGizmoPlugin() { Color gizmo_color = EDITOR_DEF("editors/3d_gizmos/gizmo_colors/shape", Color(0.5, 0.7, 1)); create_material("shape_material", gizmo_color); } -bool SpringArmSpatialGizmoPlugin::has_gizmo(Spatial *p_spatial) { - return Object::cast_to<SpringArm>(p_spatial) != NULL; +bool SpringArm3DGizmoPlugin::has_gizmo(Node3D *p_spatial) { + return Object::cast_to<SpringArm3D>(p_spatial) != nullptr; } -String SpringArmSpatialGizmoPlugin::get_name() const { - return "SpringArm"; +String SpringArm3DGizmoPlugin::get_name() const { + return "SpringArm3D"; } -int SpringArmSpatialGizmoPlugin::get_priority() const { +int SpringArm3DGizmoPlugin::get_priority() const { return -1; } ///// -VehicleWheelSpatialGizmoPlugin::VehicleWheelSpatialGizmoPlugin() { +VehicleWheel3DGizmoPlugin::VehicleWheel3DGizmoPlugin() { Color gizmo_color = EDITOR_DEF("editors/3d_gizmos/gizmo_colors/shape", Color(0.5, 0.7, 1)); create_material("shape_material", gizmo_color); } -bool VehicleWheelSpatialGizmoPlugin::has_gizmo(Spatial *p_spatial) { - return Object::cast_to<VehicleWheel>(p_spatial) != NULL; +bool VehicleWheel3DGizmoPlugin::has_gizmo(Node3D *p_spatial) { + return Object::cast_to<VehicleWheel3D>(p_spatial) != nullptr; } -String VehicleWheelSpatialGizmoPlugin::get_name() const { - return "VehicleWheel"; +String VehicleWheel3DGizmoPlugin::get_name() const { + return "VehicleWheel3D"; } -int VehicleWheelSpatialGizmoPlugin::get_priority() const { +int VehicleWheel3DGizmoPlugin::get_priority() const { return -1; } -void VehicleWheelSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { +void VehicleWheel3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { - VehicleWheel *car_wheel = Object::cast_to<VehicleWheel>(p_gizmo->get_spatial_node()); + VehicleWheel3D *car_wheel = Object::cast_to<VehicleWheel3D>(p_gizmo->get_spatial_node()); p_gizmo->clear(); @@ -2108,30 +2109,30 @@ void VehicleWheelSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { /////////// -SoftBodySpatialGizmoPlugin::SoftBodySpatialGizmoPlugin() { +SoftBody3DGizmoPlugin::SoftBody3DGizmoPlugin() { Color gizmo_color = EDITOR_DEF("editors/3d_gizmos/gizmo_colors/shape", Color(0.5, 0.7, 1)); create_material("shape_material", gizmo_color); create_handle_material("handles"); } -bool SoftBodySpatialGizmoPlugin::has_gizmo(Spatial *p_spatial) { - return Object::cast_to<SoftBody>(p_spatial) != NULL; +bool SoftBody3DGizmoPlugin::has_gizmo(Node3D *p_spatial) { + return Object::cast_to<SoftBody3D>(p_spatial) != nullptr; } -String SoftBodySpatialGizmoPlugin::get_name() const { - return "SoftBody"; +String SoftBody3DGizmoPlugin::get_name() const { + return "SoftBody3D"; } -int SoftBodySpatialGizmoPlugin::get_priority() const { +int SoftBody3DGizmoPlugin::get_priority() const { return -1; } -bool SoftBodySpatialGizmoPlugin::is_selectable_when_hidden() const { +bool SoftBody3DGizmoPlugin::is_selectable_when_hidden() const { return true; } -void SoftBodySpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { - SoftBody *soft_body = Object::cast_to<SoftBody>(p_gizmo->get_spatial_node()); +void SoftBody3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { + SoftBody3D *soft_body = Object::cast_to<SoftBody3D>(p_gizmo->get_spatial_node()); p_gizmo->clear(); @@ -2161,28 +2162,28 @@ void SoftBodySpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { p_gizmo->add_collision_triangles(tm); } -String SoftBodySpatialGizmoPlugin::get_handle_name(const EditorSpatialGizmo *p_gizmo, int p_idx) const { - return "SoftBody pin point"; +String SoftBody3DGizmoPlugin::get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_idx) const { + return "SoftBody3D pin point"; } -Variant SoftBodySpatialGizmoPlugin::get_handle_value(EditorSpatialGizmo *p_gizmo, int p_idx) const { - SoftBody *soft_body = Object::cast_to<SoftBody>(p_gizmo->get_spatial_node()); +Variant SoftBody3DGizmoPlugin::get_handle_value(EditorNode3DGizmo *p_gizmo, int p_idx) const { + SoftBody3D *soft_body = Object::cast_to<SoftBody3D>(p_gizmo->get_spatial_node()); return Variant(soft_body->is_point_pinned(p_idx)); } -void SoftBodySpatialGizmoPlugin::commit_handle(EditorSpatialGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel) { - SoftBody *soft_body = Object::cast_to<SoftBody>(p_gizmo->get_spatial_node()); +void SoftBody3DGizmoPlugin::commit_handle(EditorNode3DGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel) { + SoftBody3D *soft_body = Object::cast_to<SoftBody3D>(p_gizmo->get_spatial_node()); soft_body->pin_point_toggle(p_idx); } -bool SoftBodySpatialGizmoPlugin::is_handle_highlighted(const EditorSpatialGizmo *p_gizmo, int idx) const { - SoftBody *soft_body = Object::cast_to<SoftBody>(p_gizmo->get_spatial_node()); +bool SoftBody3DGizmoPlugin::is_handle_highlighted(const EditorNode3DGizmo *p_gizmo, int idx) const { + SoftBody3D *soft_body = Object::cast_to<SoftBody3D>(p_gizmo->get_spatial_node()); return soft_body->is_point_pinned(idx); } /////////// -VisibilityNotifierGizmoPlugin::VisibilityNotifierGizmoPlugin() { +VisibilityNotifier3DGizmoPlugin::VisibilityNotifier3DGizmoPlugin() { Color gizmo_color = EDITOR_DEF("editors/3d_gizmos/gizmo_colors/visibility_notifier", Color(0.8, 0.5, 0.7)); create_material("visibility_notifier_material", gizmo_color); gizmo_color.a = 0.1; @@ -2190,19 +2191,19 @@ VisibilityNotifierGizmoPlugin::VisibilityNotifierGizmoPlugin() { create_handle_material("handles"); } -bool VisibilityNotifierGizmoPlugin::has_gizmo(Spatial *p_spatial) { - return Object::cast_to<VisibilityNotifier>(p_spatial) != NULL; +bool VisibilityNotifier3DGizmoPlugin::has_gizmo(Node3D *p_spatial) { + return Object::cast_to<VisibilityNotifier3D>(p_spatial) != nullptr; } -String VisibilityNotifierGizmoPlugin::get_name() const { - return "VisibilityNotifier"; +String VisibilityNotifier3DGizmoPlugin::get_name() const { + return "VisibilityNotifier3D"; } -int VisibilityNotifierGizmoPlugin::get_priority() const { +int VisibilityNotifier3DGizmoPlugin::get_priority() const { return -1; } -String VisibilityNotifierGizmoPlugin::get_handle_name(const EditorSpatialGizmo *p_gizmo, int p_idx) const { +String VisibilityNotifier3DGizmoPlugin::get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_idx) const { switch (p_idx) { case 0: return "Size X"; @@ -2216,14 +2217,14 @@ String VisibilityNotifierGizmoPlugin::get_handle_name(const EditorSpatialGizmo * return ""; } -Variant VisibilityNotifierGizmoPlugin::get_handle_value(EditorSpatialGizmo *p_gizmo, int p_idx) const { +Variant VisibilityNotifier3DGizmoPlugin::get_handle_value(EditorNode3DGizmo *p_gizmo, int p_idx) const { - VisibilityNotifier *notifier = Object::cast_to<VisibilityNotifier>(p_gizmo->get_spatial_node()); + VisibilityNotifier3D *notifier = Object::cast_to<VisibilityNotifier3D>(p_gizmo->get_spatial_node()); return notifier->get_aabb(); } -void VisibilityNotifierGizmoPlugin::set_handle(EditorSpatialGizmo *p_gizmo, int p_idx, Camera *p_camera, const Point2 &p_point) { +void VisibilityNotifier3DGizmoPlugin::set_handle(EditorNode3DGizmo *p_gizmo, int p_idx, Camera3D *p_camera, const Point2 &p_point) { - VisibilityNotifier *notifier = Object::cast_to<VisibilityNotifier>(p_gizmo->get_spatial_node()); + VisibilityNotifier3D *notifier = Object::cast_to<VisibilityNotifier3D>(p_gizmo->get_spatial_node()); Transform gt = notifier->get_global_transform(); @@ -2249,8 +2250,8 @@ void VisibilityNotifierGizmoPlugin::set_handle(EditorSpatialGizmo *p_gizmo, int Geometry::get_closest_points_between_segments(ofs - axis * 4096, ofs + axis * 4096, sg[0], sg[1], ra, rb); float d = ra[p_idx]; - if (SpatialEditor::get_singleton()->is_snap_enabled()) { - d = Math::stepify(d, SpatialEditor::get_singleton()->get_translate_snap()); + if (Node3DEditor::get_singleton()->is_snap_enabled()) { + d = Math::stepify(d, Node3DEditor::get_singleton()->get_translate_snap()); } aabb.position[p_idx] = d - 1.0 - aabb.size[p_idx] * 0.5; @@ -2261,8 +2262,8 @@ void VisibilityNotifierGizmoPlugin::set_handle(EditorSpatialGizmo *p_gizmo, int Geometry::get_closest_points_between_segments(ofs, ofs + axis * 4096, sg[0], sg[1], ra, rb); float d = ra[p_idx] - ofs[p_idx]; - if (SpatialEditor::get_singleton()->is_snap_enabled()) { - d = Math::stepify(d, SpatialEditor::get_singleton()->get_translate_snap()); + if (Node3DEditor::get_singleton()->is_snap_enabled()) { + d = Math::stepify(d, Node3DEditor::get_singleton()->get_translate_snap()); } if (d < 0.001) @@ -2274,25 +2275,25 @@ void VisibilityNotifierGizmoPlugin::set_handle(EditorSpatialGizmo *p_gizmo, int } } -void VisibilityNotifierGizmoPlugin::commit_handle(EditorSpatialGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel) { +void VisibilityNotifier3DGizmoPlugin::commit_handle(EditorNode3DGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel) { - VisibilityNotifier *notifier = Object::cast_to<VisibilityNotifier>(p_gizmo->get_spatial_node()); + VisibilityNotifier3D *notifier = Object::cast_to<VisibilityNotifier3D>(p_gizmo->get_spatial_node()); if (p_cancel) { notifier->set_aabb(p_restore); return; } - UndoRedo *ur = SpatialEditor::get_singleton()->get_undo_redo(); + UndoRedo *ur = Node3DEditor::get_singleton()->get_undo_redo(); ur->create_action(TTR("Change Notifier AABB")); ur->add_do_method(notifier, "set_aabb", notifier->get_aabb()); ur->add_undo_method(notifier, "set_aabb", p_restore); ur->commit_action(); } -void VisibilityNotifierGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { +void VisibilityNotifier3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { - VisibilityNotifier *notifier = Object::cast_to<VisibilityNotifier>(p_gizmo->get_spatial_node()); + VisibilityNotifier3D *notifier = Object::cast_to<VisibilityNotifier3D>(p_gizmo->get_spatial_node()); p_gizmo->clear(); @@ -2342,59 +2343,59 @@ void VisibilityNotifierGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { //// -CPUParticlesGizmoPlugin::CPUParticlesGizmoPlugin() { - create_icon_material("particles_icon", SpatialEditor::get_singleton()->get_icon("GizmoCPUParticles", "EditorIcons")); +CPUParticles3DGizmoPlugin::CPUParticles3DGizmoPlugin() { + create_icon_material("particles_icon", Node3DEditor::get_singleton()->get_theme_icon("GizmoCPUParticles3D", "EditorIcons")); } -bool CPUParticlesGizmoPlugin::has_gizmo(Spatial *p_spatial) { - return Object::cast_to<CPUParticles>(p_spatial) != NULL; +bool CPUParticles3DGizmoPlugin::has_gizmo(Node3D *p_spatial) { + return Object::cast_to<CPUParticles3D>(p_spatial) != nullptr; } -String CPUParticlesGizmoPlugin::get_name() const { - return "CPUParticles"; +String CPUParticles3DGizmoPlugin::get_name() const { + return "CPUParticles3D"; } -int CPUParticlesGizmoPlugin::get_priority() const { +int CPUParticles3DGizmoPlugin::get_priority() const { return -1; } -bool CPUParticlesGizmoPlugin::is_selectable_when_hidden() const { +bool CPUParticles3DGizmoPlugin::is_selectable_when_hidden() const { return true; } -void CPUParticlesGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { +void CPUParticles3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { Ref<Material> icon = get_material("particles_icon", p_gizmo); p_gizmo->add_unscaled_billboard(icon, 0.05); } //// -ParticlesGizmoPlugin::ParticlesGizmoPlugin() { +GPUParticles3DGizmoPlugin::GPUParticles3DGizmoPlugin() { Color gizmo_color = EDITOR_DEF("editors/3d_gizmos/gizmo_colors/particles", Color(0.8, 0.7, 0.4)); create_material("particles_material", gizmo_color); gizmo_color.a = 0.1; create_material("particles_solid_material", gizmo_color); - create_icon_material("particles_icon", SpatialEditor::get_singleton()->get_icon("GizmoParticles", "EditorIcons")); + create_icon_material("particles_icon", Node3DEditor::get_singleton()->get_theme_icon("GizmoGPUParticles3D", "EditorIcons")); create_handle_material("handles"); } -bool ParticlesGizmoPlugin::has_gizmo(Spatial *p_spatial) { - return Object::cast_to<Particles>(p_spatial) != NULL; +bool GPUParticles3DGizmoPlugin::has_gizmo(Node3D *p_spatial) { + return Object::cast_to<GPUParticles3D>(p_spatial) != nullptr; } -String ParticlesGizmoPlugin::get_name() const { - return "Particles"; +String GPUParticles3DGizmoPlugin::get_name() const { + return "GPUParticles3D"; } -int ParticlesGizmoPlugin::get_priority() const { +int GPUParticles3DGizmoPlugin::get_priority() const { return -1; } -bool ParticlesGizmoPlugin::is_selectable_when_hidden() const { +bool GPUParticles3DGizmoPlugin::is_selectable_when_hidden() const { return true; } -String ParticlesGizmoPlugin::get_handle_name(const EditorSpatialGizmo *p_gizmo, int p_idx) const { +String GPUParticles3DGizmoPlugin::get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_idx) const { switch (p_idx) { case 0: return "Size X"; @@ -2407,14 +2408,14 @@ String ParticlesGizmoPlugin::get_handle_name(const EditorSpatialGizmo *p_gizmo, return ""; } -Variant ParticlesGizmoPlugin::get_handle_value(EditorSpatialGizmo *p_gizmo, int p_idx) const { +Variant GPUParticles3DGizmoPlugin::get_handle_value(EditorNode3DGizmo *p_gizmo, int p_idx) const { - Particles *particles = Object::cast_to<Particles>(p_gizmo->get_spatial_node()); + GPUParticles3D *particles = Object::cast_to<GPUParticles3D>(p_gizmo->get_spatial_node()); return particles->get_visibility_aabb(); } -void ParticlesGizmoPlugin::set_handle(EditorSpatialGizmo *p_gizmo, int p_idx, Camera *p_camera, const Point2 &p_point) { +void GPUParticles3DGizmoPlugin::set_handle(EditorNode3DGizmo *p_gizmo, int p_idx, Camera3D *p_camera, const Point2 &p_point) { - Particles *particles = Object::cast_to<Particles>(p_gizmo->get_spatial_node()); + GPUParticles3D *particles = Object::cast_to<GPUParticles3D>(p_gizmo->get_spatial_node()); Transform gt = particles->get_global_transform(); Transform gi = gt.affine_inverse(); @@ -2439,8 +2440,8 @@ void ParticlesGizmoPlugin::set_handle(EditorSpatialGizmo *p_gizmo, int p_idx, Ca Geometry::get_closest_points_between_segments(ofs - axis * 4096, ofs + axis * 4096, sg[0], sg[1], ra, rb); float d = ra[p_idx]; - if (SpatialEditor::get_singleton()->is_snap_enabled()) { - d = Math::stepify(d, SpatialEditor::get_singleton()->get_translate_snap()); + if (Node3DEditor::get_singleton()->is_snap_enabled()) { + d = Math::stepify(d, Node3DEditor::get_singleton()->get_translate_snap()); } aabb.position[p_idx] = d - 1.0 - aabb.size[p_idx] * 0.5; @@ -2451,8 +2452,8 @@ void ParticlesGizmoPlugin::set_handle(EditorSpatialGizmo *p_gizmo, int p_idx, Ca Geometry::get_closest_points_between_segments(ofs, ofs + axis * 4096, sg[0], sg[1], ra, rb); float d = ra[p_idx] - ofs[p_idx]; - if (SpatialEditor::get_singleton()->is_snap_enabled()) { - d = Math::stepify(d, SpatialEditor::get_singleton()->get_translate_snap()); + if (Node3DEditor::get_singleton()->is_snap_enabled()) { + d = Math::stepify(d, Node3DEditor::get_singleton()->get_translate_snap()); } if (d < 0.001) @@ -2464,25 +2465,25 @@ void ParticlesGizmoPlugin::set_handle(EditorSpatialGizmo *p_gizmo, int p_idx, Ca } } -void ParticlesGizmoPlugin::commit_handle(EditorSpatialGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel) { +void GPUParticles3DGizmoPlugin::commit_handle(EditorNode3DGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel) { - Particles *particles = Object::cast_to<Particles>(p_gizmo->get_spatial_node()); + GPUParticles3D *particles = Object::cast_to<GPUParticles3D>(p_gizmo->get_spatial_node()); if (p_cancel) { particles->set_visibility_aabb(p_restore); return; } - UndoRedo *ur = SpatialEditor::get_singleton()->get_undo_redo(); + UndoRedo *ur = Node3DEditor::get_singleton()->get_undo_redo(); ur->create_action(TTR("Change Particles AABB")); ur->add_do_method(particles, "set_visibility_aabb", particles->get_visibility_aabb()); ur->add_undo_method(particles, "set_visibility_aabb", p_restore); ur->commit_action(); } -void ParticlesGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { +void GPUParticles3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { - Particles *particles = Object::cast_to<Particles>(p_gizmo->get_spatial_node()); + GPUParticles3D *particles = Object::cast_to<GPUParticles3D>(p_gizmo->get_spatial_node()); p_gizmo->clear(); @@ -2543,12 +2544,12 @@ ReflectionProbeGizmoPlugin::ReflectionProbeGizmoPlugin() { gizmo_color.a = 0.1; create_material("reflection_probe_solid_material", gizmo_color); - create_icon_material("reflection_probe_icon", SpatialEditor::get_singleton()->get_icon("GizmoReflectionProbe", "EditorIcons")); + create_icon_material("reflection_probe_icon", Node3DEditor::get_singleton()->get_theme_icon("GizmoReflectionProbe", "EditorIcons")); create_handle_material("handles"); } -bool ReflectionProbeGizmoPlugin::has_gizmo(Spatial *p_spatial) { - return Object::cast_to<ReflectionProbe>(p_spatial) != NULL; +bool ReflectionProbeGizmoPlugin::has_gizmo(Node3D *p_spatial) { + return Object::cast_to<ReflectionProbe>(p_spatial) != nullptr; } String ReflectionProbeGizmoPlugin::get_name() const { @@ -2559,7 +2560,7 @@ int ReflectionProbeGizmoPlugin::get_priority() const { return -1; } -String ReflectionProbeGizmoPlugin::get_handle_name(const EditorSpatialGizmo *p_gizmo, int p_idx) const { +String ReflectionProbeGizmoPlugin::get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_idx) const { switch (p_idx) { case 0: return "Extents X"; @@ -2572,12 +2573,12 @@ String ReflectionProbeGizmoPlugin::get_handle_name(const EditorSpatialGizmo *p_g return ""; } -Variant ReflectionProbeGizmoPlugin::get_handle_value(EditorSpatialGizmo *p_gizmo, int p_idx) const { +Variant ReflectionProbeGizmoPlugin::get_handle_value(EditorNode3DGizmo *p_gizmo, int p_idx) const { ReflectionProbe *probe = Object::cast_to<ReflectionProbe>(p_gizmo->get_spatial_node()); return AABB(probe->get_extents(), probe->get_origin_offset()); } -void ReflectionProbeGizmoPlugin::set_handle(EditorSpatialGizmo *p_gizmo, int p_idx, Camera *p_camera, const Point2 &p_point) { +void ReflectionProbeGizmoPlugin::set_handle(EditorNode3DGizmo *p_gizmo, int p_idx, Camera3D *p_camera, const Point2 &p_point) { ReflectionProbe *probe = Object::cast_to<ReflectionProbe>(p_gizmo->get_spatial_node()); Transform gt = probe->get_global_transform(); @@ -2598,8 +2599,8 @@ void ReflectionProbeGizmoPlugin::set_handle(EditorSpatialGizmo *p_gizmo, int p_i Vector3 ra, rb; Geometry::get_closest_points_between_segments(Vector3(), axis * 16384, sg[0], sg[1], ra, rb); float d = ra[p_idx]; - if (SpatialEditor::get_singleton()->is_snap_enabled()) { - d = Math::stepify(d, SpatialEditor::get_singleton()->get_translate_snap()); + if (Node3DEditor::get_singleton()->is_snap_enabled()) { + d = Math::stepify(d, Node3DEditor::get_singleton()->get_translate_snap()); } if (d < 0.001) @@ -2626,8 +2627,8 @@ void ReflectionProbeGizmoPlugin::set_handle(EditorSpatialGizmo *p_gizmo, int p_i Geometry::get_closest_points_between_segments(origin - axis * 16384, origin + axis * 16384, sg[0], sg[1], ra, rb); // Adjust the actual position to account for the gizmo handle position float d = ra[p_idx] + 0.25; - if (SpatialEditor::get_singleton()->is_snap_enabled()) { - d = Math::stepify(d, SpatialEditor::get_singleton()->get_translate_snap()); + if (Node3DEditor::get_singleton()->is_snap_enabled()) { + d = Math::stepify(d, Node3DEditor::get_singleton()->get_translate_snap()); } origin[p_idx] = d; @@ -2635,7 +2636,7 @@ void ReflectionProbeGizmoPlugin::set_handle(EditorSpatialGizmo *p_gizmo, int p_i } } -void ReflectionProbeGizmoPlugin::commit_handle(EditorSpatialGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel) { +void ReflectionProbeGizmoPlugin::commit_handle(EditorNode3DGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel) { ReflectionProbe *probe = Object::cast_to<ReflectionProbe>(p_gizmo->get_spatial_node()); @@ -2647,7 +2648,7 @@ void ReflectionProbeGizmoPlugin::commit_handle(EditorSpatialGizmo *p_gizmo, int return; } - UndoRedo *ur = SpatialEditor::get_singleton()->get_undo_redo(); + UndoRedo *ur = Node3DEditor::get_singleton()->get_undo_redo(); ur->create_action(TTR("Change Probe Extents")); ur->add_do_method(probe, "set_extents", probe->get_extents()); ur->add_do_method(probe, "set_origin_offset", probe->get_origin_offset()); @@ -2656,7 +2657,7 @@ void ReflectionProbeGizmoPlugin::commit_handle(EditorSpatialGizmo *p_gizmo, int ur->commit_action(); } -void ReflectionProbeGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { +void ReflectionProbeGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { ReflectionProbe *probe = Object::cast_to<ReflectionProbe>(p_gizmo->get_spatial_node()); @@ -2718,7 +2719,143 @@ void ReflectionProbeGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { p_gizmo->add_unscaled_billboard(icon, 0.05); p_gizmo->add_handles(handles, get_material("handles")); } +/////////////////////////////// +//// + +DecalGizmoPlugin::DecalGizmoPlugin() { + Color gizmo_color = EDITOR_DEF("editors/3d_gizmos/gizmo_colors/decal", Color(0.6, 0.5, 1.0)); + + create_material("decal_material", gizmo_color); + + create_handle_material("handles"); +} + +bool DecalGizmoPlugin::has_gizmo(Node3D *p_spatial) { + return Object::cast_to<Decal>(p_spatial) != nullptr; +} + +String DecalGizmoPlugin::get_name() const { + return "Decal"; +} + +int DecalGizmoPlugin::get_priority() const { + return -1; +} + +String DecalGizmoPlugin::get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_idx) const { + + switch (p_idx) { + case 0: return "Extents X"; + case 1: return "Extents Y"; + case 2: return "Extents Z"; + } + + return ""; +} +Variant DecalGizmoPlugin::get_handle_value(EditorNode3DGizmo *p_gizmo, int p_idx) const { + + Decal *decal = Object::cast_to<Decal>(p_gizmo->get_spatial_node()); + return decal->get_extents(); +} +void DecalGizmoPlugin::set_handle(EditorNode3DGizmo *p_gizmo, int p_idx, Camera3D *p_camera, const Point2 &p_point) { + + Decal *decal = Object::cast_to<Decal>(p_gizmo->get_spatial_node()); + Transform gt = decal->get_global_transform(); + + Transform gi = gt.affine_inverse(); + + Vector3 extents = decal->get_extents(); + + Vector3 ray_from = p_camera->project_ray_origin(p_point); + Vector3 ray_dir = p_camera->project_ray_normal(p_point); + + Vector3 sg[2] = { gi.xform(ray_from), gi.xform(ray_from + ray_dir * 16384) }; + + Vector3 axis; + axis[p_idx] = 1.0; + + Vector3 ra, rb; + Geometry::get_closest_points_between_segments(Vector3(), axis * 16384, sg[0], sg[1], ra, rb); + float d = ra[p_idx]; + if (Node3DEditor::get_singleton()->is_snap_enabled()) { + d = Math::stepify(d, Node3DEditor::get_singleton()->get_translate_snap()); + } + + if (d < 0.001) + d = 0.001; + + extents[p_idx] = d; + decal->set_extents(extents); +} + +void DecalGizmoPlugin::commit_handle(EditorNode3DGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel) { + + Decal *decal = Object::cast_to<Decal>(p_gizmo->get_spatial_node()); + + Vector3 restore = p_restore; + + if (p_cancel) { + decal->set_extents(restore); + return; + } + + UndoRedo *ur = Node3DEditor::get_singleton()->get_undo_redo(); + ur->create_action(TTR("Change Decal Extents")); + ur->add_do_method(decal, "set_extents", decal->get_extents()); + ur->add_undo_method(decal, "set_extents", restore); + ur->commit_action(); +} + +void DecalGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { + + Decal *decal = Object::cast_to<Decal>(p_gizmo->get_spatial_node()); + + p_gizmo->clear(); + + Vector<Vector3> lines; + Vector3 extents = decal->get_extents(); + + AABB aabb; + aabb.position = -extents; + aabb.size = extents * 2; + + for (int i = 0; i < 12; i++) { + Vector3 a, b; + aabb.get_edge(i, a, b); + if (a.y == b.y) { + lines.push_back(a); + lines.push_back(b); + } else { + Vector3 ah = a.linear_interpolate(b, 0.2); + lines.push_back(a); + lines.push_back(ah); + Vector3 bh = b.linear_interpolate(a, 0.2); + lines.push_back(b); + lines.push_back(bh); + } + } + + lines.push_back(Vector3(0, extents.y, 0)); + lines.push_back(Vector3(0, extents.y * 1.2, 0)); + + Vector<Vector3> handles; + + for (int i = 0; i < 3; i++) { + + Vector3 ax; + ax[i] = aabb.position[i] + aabb.size[i]; + handles.push_back(ax); + } + + Ref<Material> material = get_material("decal_material", p_gizmo); + + p_gizmo->add_lines(lines, material); + + p_gizmo->add_handles(handles, get_material("handles")); +} + +/////////////////////////////// GIProbeGizmoPlugin::GIProbeGizmoPlugin() { Color gizmo_color = EDITOR_DEF("editors/3d_gizmos/gizmo_colors/gi_probe", Color(0.5, 1, 0.6)); @@ -2731,12 +2868,12 @@ GIProbeGizmoPlugin::GIProbeGizmoPlugin() { gizmo_color.a = 0.05; create_material("gi_probe_solid_material", gizmo_color); - create_icon_material("gi_probe_icon", SpatialEditor::get_singleton()->get_icon("GizmoGIProbe", "EditorIcons")); + create_icon_material("gi_probe_icon", Node3DEditor::get_singleton()->get_theme_icon("GizmoGIProbe", "EditorIcons")); create_handle_material("handles"); } -bool GIProbeGizmoPlugin::has_gizmo(Spatial *p_spatial) { - return Object::cast_to<GIProbe>(p_spatial) != NULL; +bool GIProbeGizmoPlugin::has_gizmo(Node3D *p_spatial) { + return Object::cast_to<GIProbe>(p_spatial) != nullptr; } String GIProbeGizmoPlugin::get_name() const { @@ -2747,7 +2884,7 @@ int GIProbeGizmoPlugin::get_priority() const { return -1; } -String GIProbeGizmoPlugin::get_handle_name(const EditorSpatialGizmo *p_gizmo, int p_idx) const { +String GIProbeGizmoPlugin::get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_idx) const { switch (p_idx) { case 0: return "Extents X"; @@ -2757,12 +2894,12 @@ String GIProbeGizmoPlugin::get_handle_name(const EditorSpatialGizmo *p_gizmo, in return ""; } -Variant GIProbeGizmoPlugin::get_handle_value(EditorSpatialGizmo *p_gizmo, int p_idx) const { +Variant GIProbeGizmoPlugin::get_handle_value(EditorNode3DGizmo *p_gizmo, int p_idx) const { GIProbe *probe = Object::cast_to<GIProbe>(p_gizmo->get_spatial_node()); return probe->get_extents(); } -void GIProbeGizmoPlugin::set_handle(EditorSpatialGizmo *p_gizmo, int p_idx, Camera *p_camera, const Point2 &p_point) { +void GIProbeGizmoPlugin::set_handle(EditorNode3DGizmo *p_gizmo, int p_idx, Camera3D *p_camera, const Point2 &p_point) { GIProbe *probe = Object::cast_to<GIProbe>(p_gizmo->get_spatial_node()); @@ -2782,8 +2919,8 @@ void GIProbeGizmoPlugin::set_handle(EditorSpatialGizmo *p_gizmo, int p_idx, Came Vector3 ra, rb; Geometry::get_closest_points_between_segments(Vector3(), axis * 16384, sg[0], sg[1], ra, rb); float d = ra[p_idx]; - if (SpatialEditor::get_singleton()->is_snap_enabled()) { - d = Math::stepify(d, SpatialEditor::get_singleton()->get_translate_snap()); + if (Node3DEditor::get_singleton()->is_snap_enabled()) { + d = Math::stepify(d, Node3DEditor::get_singleton()->get_translate_snap()); } if (d < 0.001) @@ -2793,7 +2930,7 @@ void GIProbeGizmoPlugin::set_handle(EditorSpatialGizmo *p_gizmo, int p_idx, Came probe->set_extents(extents); } -void GIProbeGizmoPlugin::commit_handle(EditorSpatialGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel) { +void GIProbeGizmoPlugin::commit_handle(EditorNode3DGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel) { GIProbe *probe = Object::cast_to<GIProbe>(p_gizmo->get_spatial_node()); @@ -2804,14 +2941,14 @@ void GIProbeGizmoPlugin::commit_handle(EditorSpatialGizmo *p_gizmo, int p_idx, c return; } - UndoRedo *ur = SpatialEditor::get_singleton()->get_undo_redo(); + UndoRedo *ur = Node3DEditor::get_singleton()->get_undo_redo(); ur->create_action(TTR("Change Probe Extents")); ur->add_do_method(probe, "set_extents", probe->get_extents()); ur->add_undo_method(probe, "set_extents", restore); ur->commit_action(); } -void GIProbeGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { +void GIProbeGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { GIProbe *probe = Object::cast_to<GIProbe>(p_gizmo->get_spatial_node()); @@ -2911,11 +3048,11 @@ BakedIndirectLightGizmoPlugin::BakedIndirectLightGizmoPlugin() { gizmo_color.a = 0.1; create_material("baked_indirect_light_internal_material", gizmo_color); - create_icon_material("baked_indirect_light_icon", SpatialEditor::get_singleton()->get_icon("GizmoBakedLightmap", "EditorIcons")); + create_icon_material("baked_indirect_light_icon", Node3DEditor::get_singleton()->get_icon("GizmoBakedLightmap", "EditorIcons")); create_handle_material("handles"); } -String BakedIndirectLightGizmoPlugin::get_handle_name(const EditorSpatialGizmo *p_gizmo, int p_idx) const { +String BakedIndirectLightGizmoPlugin::get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_idx) const { switch (p_idx) { case 0: return "Extents X"; @@ -2925,12 +3062,12 @@ String BakedIndirectLightGizmoPlugin::get_handle_name(const EditorSpatialGizmo * return ""; } -Variant BakedIndirectLightGizmoPlugin::get_handle_value(EditorSpatialGizmo *p_gizmo, int p_idx) const { +Variant BakedIndirectLightGizmoPlugin::get_handle_value(EditorNode3DGizmo *p_gizmo, int p_idx) const { BakedLightmap *baker = Object::cast_to<BakedLightmap>(p_gizmo->get_spatial_node()); return baker->get_extents(); } -void BakedIndirectLightGizmoPlugin::set_handle(EditorSpatialGizmo *p_gizmo, int p_idx, Camera *p_camera, const Point2 &p_point) { +void BakedIndirectLightGizmoPlugin::set_handle(EditorNode3DGizmo *p_gizmo, int p_idx, Camera *p_camera, const Point2 &p_point) { BakedLightmap *baker = Object::cast_to<BakedLightmap>(p_gizmo->get_spatial_node()); @@ -2950,8 +3087,8 @@ void BakedIndirectLightGizmoPlugin::set_handle(EditorSpatialGizmo *p_gizmo, int Vector3 ra, rb; Geometry::get_closest_points_between_segments(Vector3(), axis * 16384, sg[0], sg[1], ra, rb); float d = ra[p_idx]; - if (SpatialEditor::get_singleton()->is_snap_enabled()) { - d = Math::stepify(d, SpatialEditor::get_singleton()->get_translate_snap()); + if (Node3DEditor::get_singleton()->is_snap_enabled()) { + d = Math::stepify(d, Node3DEditor::get_singleton()->get_translate_snap()); } if (d < 0.001) @@ -2961,7 +3098,7 @@ void BakedIndirectLightGizmoPlugin::set_handle(EditorSpatialGizmo *p_gizmo, int baker->set_extents(extents); } -void BakedIndirectLightGizmoPlugin::commit_handle(EditorSpatialGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel) { +void BakedIndirectLightGizmoPlugin::commit_handle(EditorNode3DGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel) { BakedLightmap *baker = Object::cast_to<BakedLightmap>(p_gizmo->get_spatial_node()); @@ -2972,7 +3109,7 @@ void BakedIndirectLightGizmoPlugin::commit_handle(EditorSpatialGizmo *p_gizmo, i return; } - UndoRedo *ur = SpatialEditor::get_singleton()->get_undo_redo(); + UndoRedo *ur = Node3DEditor::get_singleton()->get_undo_redo(); ur->create_action(TTR("Change Probe Extents")); ur->add_do_method(baker, "set_extents", baker->get_extents()); ur->add_undo_method(baker, "set_extents", restore); @@ -2980,7 +3117,7 @@ void BakedIndirectLightGizmoPlugin::commit_handle(EditorSpatialGizmo *p_gizmo, i } bool BakedIndirectLightGizmoPlugin::has_gizmo(Spatial *p_spatial) { - return Object::cast_to<BakedLightmap>(p_spatial) != NULL; + return Object::cast_to<BakedLightmap>(p_spatial) != nullptr; } String BakedIndirectLightGizmoPlugin::get_name() const { @@ -2991,7 +3128,7 @@ int BakedIndirectLightGizmoPlugin::get_priority() const { return -1; } -void BakedIndirectLightGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { +void BakedIndirectLightGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { BakedLightmap *baker = Object::cast_to<BakedLightmap>(p_gizmo->get_spatial_node()); @@ -3034,7 +3171,7 @@ void BakedIndirectLightGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { #endif //// -CollisionShapeSpatialGizmoPlugin::CollisionShapeSpatialGizmoPlugin() { +CollisionShape3DGizmoPlugin::CollisionShape3DGizmoPlugin() { const Color gizmo_color = EDITOR_DEF("editors/3d_gizmos/gizmo_colors/shape", Color(0.5, 0.7, 1)); create_material("shape_material", gizmo_color); const float gizmo_value = gizmo_color.get_v(); @@ -3043,47 +3180,47 @@ CollisionShapeSpatialGizmoPlugin::CollisionShapeSpatialGizmoPlugin() { create_handle_material("handles"); } -bool CollisionShapeSpatialGizmoPlugin::has_gizmo(Spatial *p_spatial) { - return Object::cast_to<CollisionShape>(p_spatial) != NULL; +bool CollisionShape3DGizmoPlugin::has_gizmo(Node3D *p_spatial) { + return Object::cast_to<CollisionShape3D>(p_spatial) != nullptr; } -String CollisionShapeSpatialGizmoPlugin::get_name() const { - return "CollisionShape"; +String CollisionShape3DGizmoPlugin::get_name() const { + return "CollisionShape3D"; } -int CollisionShapeSpatialGizmoPlugin::get_priority() const { +int CollisionShape3DGizmoPlugin::get_priority() const { return -1; } -String CollisionShapeSpatialGizmoPlugin::get_handle_name(const EditorSpatialGizmo *p_gizmo, int p_idx) const { +String CollisionShape3DGizmoPlugin::get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_idx) const { - const CollisionShape *cs = Object::cast_to<CollisionShape>(p_gizmo->get_spatial_node()); + const CollisionShape3D *cs = Object::cast_to<CollisionShape3D>(p_gizmo->get_spatial_node()); - Ref<Shape> s = cs->get_shape(); + Ref<Shape3D> s = cs->get_shape(); if (s.is_null()) return ""; - if (Object::cast_to<SphereShape>(*s)) { + if (Object::cast_to<SphereShape3D>(*s)) { return "Radius"; } - if (Object::cast_to<BoxShape>(*s)) { + if (Object::cast_to<BoxShape3D>(*s)) { return "Extents"; } - if (Object::cast_to<CapsuleShape>(*s)) { + if (Object::cast_to<CapsuleShape3D>(*s)) { return p_idx == 0 ? "Radius" : "Height"; } - if (Object::cast_to<CylinderShape>(*s)) { + if (Object::cast_to<CylinderShape3D>(*s)) { return p_idx == 0 ? "Radius" : "Height"; } - if (Object::cast_to<RayShape>(*s)) { + if (Object::cast_to<RayShape3D>(*s)) { return "Length"; } @@ -3091,51 +3228,51 @@ String CollisionShapeSpatialGizmoPlugin::get_handle_name(const EditorSpatialGizm return ""; } -Variant CollisionShapeSpatialGizmoPlugin::get_handle_value(EditorSpatialGizmo *p_gizmo, int p_idx) const { +Variant CollisionShape3DGizmoPlugin::get_handle_value(EditorNode3DGizmo *p_gizmo, int p_idx) const { - CollisionShape *cs = Object::cast_to<CollisionShape>(p_gizmo->get_spatial_node()); + CollisionShape3D *cs = Object::cast_to<CollisionShape3D>(p_gizmo->get_spatial_node()); - Ref<Shape> s = cs->get_shape(); + Ref<Shape3D> s = cs->get_shape(); if (s.is_null()) return Variant(); - if (Object::cast_to<SphereShape>(*s)) { + if (Object::cast_to<SphereShape3D>(*s)) { - Ref<SphereShape> ss = s; + Ref<SphereShape3D> ss = s; return ss->get_radius(); } - if (Object::cast_to<BoxShape>(*s)) { + if (Object::cast_to<BoxShape3D>(*s)) { - Ref<BoxShape> bs = s; + Ref<BoxShape3D> bs = s; return bs->get_extents(); } - if (Object::cast_to<CapsuleShape>(*s)) { + if (Object::cast_to<CapsuleShape3D>(*s)) { - Ref<CapsuleShape> cs2 = s; + Ref<CapsuleShape3D> cs2 = s; return p_idx == 0 ? cs2->get_radius() : cs2->get_height(); } - if (Object::cast_to<CylinderShape>(*s)) { + if (Object::cast_to<CylinderShape3D>(*s)) { - Ref<CylinderShape> cs2 = s; + Ref<CylinderShape3D> cs2 = s; return p_idx == 0 ? cs2->get_radius() : cs2->get_height(); } - if (Object::cast_to<RayShape>(*s)) { + if (Object::cast_to<RayShape3D>(*s)) { - Ref<RayShape> cs2 = s; + Ref<RayShape3D> cs2 = s; return cs2->get_length(); } return Variant(); } -void CollisionShapeSpatialGizmoPlugin::set_handle(EditorSpatialGizmo *p_gizmo, int p_idx, Camera *p_camera, const Point2 &p_point) { +void CollisionShape3DGizmoPlugin::set_handle(EditorNode3DGizmo *p_gizmo, int p_idx, Camera3D *p_camera, const Point2 &p_point) { - CollisionShape *cs = Object::cast_to<CollisionShape>(p_gizmo->get_spatial_node()); + CollisionShape3D *cs = Object::cast_to<CollisionShape3D>(p_gizmo->get_spatial_node()); - Ref<Shape> s = cs->get_shape(); + Ref<Shape3D> s = cs->get_shape(); if (s.is_null()) return; @@ -3147,14 +3284,14 @@ void CollisionShapeSpatialGizmoPlugin::set_handle(EditorSpatialGizmo *p_gizmo, i Vector3 sg[2] = { gi.xform(ray_from), gi.xform(ray_from + ray_dir * 4096) }; - if (Object::cast_to<SphereShape>(*s)) { + if (Object::cast_to<SphereShape3D>(*s)) { - Ref<SphereShape> ss = s; + Ref<SphereShape3D> ss = s; Vector3 ra, rb; Geometry::get_closest_points_between_segments(Vector3(), Vector3(4096, 0, 0), sg[0], sg[1], ra, rb); float d = ra.x; - if (SpatialEditor::get_singleton()->is_snap_enabled()) { - d = Math::stepify(d, SpatialEditor::get_singleton()->get_translate_snap()); + if (Node3DEditor::get_singleton()->is_snap_enabled()) { + d = Math::stepify(d, Node3DEditor::get_singleton()->get_translate_snap()); } if (d < 0.001) @@ -3163,14 +3300,14 @@ void CollisionShapeSpatialGizmoPlugin::set_handle(EditorSpatialGizmo *p_gizmo, i ss->set_radius(d); } - if (Object::cast_to<RayShape>(*s)) { + if (Object::cast_to<RayShape3D>(*s)) { - Ref<RayShape> rs = s; + Ref<RayShape3D> rs = s; Vector3 ra, rb; Geometry::get_closest_points_between_segments(Vector3(), Vector3(0, 0, 4096), sg[0], sg[1], ra, rb); float d = ra.z; - if (SpatialEditor::get_singleton()->is_snap_enabled()) { - d = Math::stepify(d, SpatialEditor::get_singleton()->get_translate_snap()); + if (Node3DEditor::get_singleton()->is_snap_enabled()) { + d = Math::stepify(d, Node3DEditor::get_singleton()->get_translate_snap()); } if (d < 0.001) @@ -3179,16 +3316,16 @@ void CollisionShapeSpatialGizmoPlugin::set_handle(EditorSpatialGizmo *p_gizmo, i rs->set_length(d); } - if (Object::cast_to<BoxShape>(*s)) { + if (Object::cast_to<BoxShape3D>(*s)) { Vector3 axis; axis[p_idx] = 1.0; - Ref<BoxShape> bs = s; + Ref<BoxShape3D> bs = s; Vector3 ra, rb; Geometry::get_closest_points_between_segments(Vector3(), axis * 4096, sg[0], sg[1], ra, rb); float d = ra[p_idx]; - if (SpatialEditor::get_singleton()->is_snap_enabled()) { - d = Math::stepify(d, SpatialEditor::get_singleton()->get_translate_snap()); + if (Node3DEditor::get_singleton()->is_snap_enabled()) { + d = Math::stepify(d, Node3DEditor::get_singleton()->get_translate_snap()); } if (d < 0.001) @@ -3199,19 +3336,19 @@ void CollisionShapeSpatialGizmoPlugin::set_handle(EditorSpatialGizmo *p_gizmo, i bs->set_extents(he); } - if (Object::cast_to<CapsuleShape>(*s)) { + if (Object::cast_to<CapsuleShape3D>(*s)) { Vector3 axis; axis[p_idx == 0 ? 0 : 2] = 1.0; - Ref<CapsuleShape> cs2 = s; + Ref<CapsuleShape3D> cs2 = s; Vector3 ra, rb; Geometry::get_closest_points_between_segments(Vector3(), axis * 4096, sg[0], sg[1], ra, rb); float d = axis.dot(ra); if (p_idx == 1) d -= cs2->get_radius(); - if (SpatialEditor::get_singleton()->is_snap_enabled()) { - d = Math::stepify(d, SpatialEditor::get_singleton()->get_translate_snap()); + if (Node3DEditor::get_singleton()->is_snap_enabled()) { + d = Math::stepify(d, Node3DEditor::get_singleton()->get_translate_snap()); } if (d < 0.001) @@ -3223,16 +3360,16 @@ void CollisionShapeSpatialGizmoPlugin::set_handle(EditorSpatialGizmo *p_gizmo, i cs2->set_height(d * 2.0); } - if (Object::cast_to<CylinderShape>(*s)) { + if (Object::cast_to<CylinderShape3D>(*s)) { Vector3 axis; axis[p_idx == 0 ? 0 : 1] = 1.0; - Ref<CylinderShape> cs2 = s; + Ref<CylinderShape3D> cs2 = s; Vector3 ra, rb; Geometry::get_closest_points_between_segments(Vector3(), axis * 4096, sg[0], sg[1], ra, rb); float d = axis.dot(ra); - if (SpatialEditor::get_singleton()->is_snap_enabled()) { - d = Math::stepify(d, SpatialEditor::get_singleton()->get_translate_snap()); + if (Node3DEditor::get_singleton()->is_snap_enabled()) { + d = Math::stepify(d, Node3DEditor::get_singleton()->get_translate_snap()); } if (d < 0.001) @@ -3244,47 +3381,47 @@ void CollisionShapeSpatialGizmoPlugin::set_handle(EditorSpatialGizmo *p_gizmo, i cs2->set_height(d * 2.0); } } -void CollisionShapeSpatialGizmoPlugin::commit_handle(EditorSpatialGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel) { +void CollisionShape3DGizmoPlugin::commit_handle(EditorNode3DGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel) { - CollisionShape *cs = Object::cast_to<CollisionShape>(p_gizmo->get_spatial_node()); + CollisionShape3D *cs = Object::cast_to<CollisionShape3D>(p_gizmo->get_spatial_node()); - Ref<Shape> s = cs->get_shape(); + Ref<Shape3D> s = cs->get_shape(); if (s.is_null()) return; - if (Object::cast_to<SphereShape>(*s)) { + if (Object::cast_to<SphereShape3D>(*s)) { - Ref<SphereShape> ss = s; + Ref<SphereShape3D> ss = s; if (p_cancel) { ss->set_radius(p_restore); return; } - UndoRedo *ur = SpatialEditor::get_singleton()->get_undo_redo(); + UndoRedo *ur = Node3DEditor::get_singleton()->get_undo_redo(); ur->create_action(TTR("Change Sphere Shape Radius")); ur->add_do_method(ss.ptr(), "set_radius", ss->get_radius()); ur->add_undo_method(ss.ptr(), "set_radius", p_restore); ur->commit_action(); } - if (Object::cast_to<BoxShape>(*s)) { + if (Object::cast_to<BoxShape3D>(*s)) { - Ref<BoxShape> ss = s; + Ref<BoxShape3D> ss = s; if (p_cancel) { ss->set_extents(p_restore); return; } - UndoRedo *ur = SpatialEditor::get_singleton()->get_undo_redo(); + UndoRedo *ur = Node3DEditor::get_singleton()->get_undo_redo(); ur->create_action(TTR("Change Box Shape Extents")); ur->add_do_method(ss.ptr(), "set_extents", ss->get_extents()); ur->add_undo_method(ss.ptr(), "set_extents", p_restore); ur->commit_action(); } - if (Object::cast_to<CapsuleShape>(*s)) { + if (Object::cast_to<CapsuleShape3D>(*s)) { - Ref<CapsuleShape> ss = s; + Ref<CapsuleShape3D> ss = s; if (p_cancel) { if (p_idx == 0) ss->set_radius(p_restore); @@ -3293,7 +3430,7 @@ void CollisionShapeSpatialGizmoPlugin::commit_handle(EditorSpatialGizmo *p_gizmo return; } - UndoRedo *ur = SpatialEditor::get_singleton()->get_undo_redo(); + UndoRedo *ur = Node3DEditor::get_singleton()->get_undo_redo(); if (p_idx == 0) { ur->create_action(TTR("Change Capsule Shape Radius")); ur->add_do_method(ss.ptr(), "set_radius", ss->get_radius()); @@ -3307,9 +3444,9 @@ void CollisionShapeSpatialGizmoPlugin::commit_handle(EditorSpatialGizmo *p_gizmo ur->commit_action(); } - if (Object::cast_to<CylinderShape>(*s)) { + if (Object::cast_to<CylinderShape3D>(*s)) { - Ref<CylinderShape> ss = s; + Ref<CylinderShape3D> ss = s; if (p_cancel) { if (p_idx == 0) ss->set_radius(p_restore); @@ -3318,7 +3455,7 @@ void CollisionShapeSpatialGizmoPlugin::commit_handle(EditorSpatialGizmo *p_gizmo return; } - UndoRedo *ur = SpatialEditor::get_singleton()->get_undo_redo(); + UndoRedo *ur = Node3DEditor::get_singleton()->get_undo_redo(); if (p_idx == 0) { ur->create_action(TTR("Change Cylinder Shape Radius")); ur->add_do_method(ss.ptr(), "set_radius", ss->get_radius()); @@ -3336,28 +3473,28 @@ void CollisionShapeSpatialGizmoPlugin::commit_handle(EditorSpatialGizmo *p_gizmo ur->commit_action(); } - if (Object::cast_to<RayShape>(*s)) { + if (Object::cast_to<RayShape3D>(*s)) { - Ref<RayShape> ss = s; + Ref<RayShape3D> ss = s; if (p_cancel) { ss->set_length(p_restore); return; } - UndoRedo *ur = SpatialEditor::get_singleton()->get_undo_redo(); + UndoRedo *ur = Node3DEditor::get_singleton()->get_undo_redo(); ur->create_action(TTR("Change Ray Shape Length")); ur->add_do_method(ss.ptr(), "set_length", ss->get_length()); ur->add_undo_method(ss.ptr(), "set_length", p_restore); ur->commit_action(); } } -void CollisionShapeSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { +void CollisionShape3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { - CollisionShape *cs = Object::cast_to<CollisionShape>(p_gizmo->get_spatial_node()); + CollisionShape3D *cs = Object::cast_to<CollisionShape3D>(p_gizmo->get_spatial_node()); p_gizmo->clear(); - Ref<Shape> s = cs->get_shape(); + Ref<Shape3D> s = cs->get_shape(); if (s.is_null()) return; @@ -3365,9 +3502,9 @@ void CollisionShapeSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { get_material(!cs->is_disabled() ? "shape_material" : "shape_material_disabled", p_gizmo); Ref<Material> handles_material = get_material("handles"); - if (Object::cast_to<SphereShape>(*s)) { + if (Object::cast_to<SphereShape3D>(*s)) { - Ref<SphereShape> sp = s; + Ref<SphereShape3D> sp = s; float r = sp->get_radius(); Vector<Vector3> points; @@ -3411,9 +3548,9 @@ void CollisionShapeSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { p_gizmo->add_handles(handles, handles_material); } - if (Object::cast_to<BoxShape>(*s)) { + if (Object::cast_to<BoxShape3D>(*s)) { - Ref<BoxShape> bs = s; + Ref<BoxShape3D> bs = s; Vector<Vector3> lines; AABB aabb; aabb.position = -bs->get_extents(); @@ -3440,9 +3577,9 @@ void CollisionShapeSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { p_gizmo->add_handles(handles, handles_material); } - if (Object::cast_to<CapsuleShape>(*s)) { + if (Object::cast_to<CapsuleShape3D>(*s)) { - Ref<CapsuleShape> cs2 = s; + Ref<CapsuleShape3D> cs2 = s; float radius = cs2->get_radius(); float height = cs2->get_height(); @@ -3515,9 +3652,9 @@ void CollisionShapeSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { p_gizmo->add_handles(handles, handles_material); } - if (Object::cast_to<CylinderShape>(*s)) { + if (Object::cast_to<CylinderShape3D>(*s)) { - Ref<CylinderShape> cs2 = s; + Ref<CylinderShape3D> cs2 = s; float radius = cs2->get_radius(); float height = cs2->get_height(); @@ -3576,9 +3713,9 @@ void CollisionShapeSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { p_gizmo->add_handles(handles, handles_material); } - if (Object::cast_to<WorldMarginShape>(*s)) { + if (Object::cast_to<WorldMarginShape3D>(*s)) { - Ref<WorldMarginShape> ps = s; + Ref<WorldMarginShape3D> ps = s; Plane p = ps->get_plane(); Vector<Vector3> points; @@ -3607,9 +3744,9 @@ void CollisionShapeSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { p_gizmo->add_collision_segments(points); } - if (Object::cast_to<ConvexPolygonShape>(*s)) { + if (Object::cast_to<ConvexPolygonShape3D>(*s)) { - Vector<Vector3> points = Object::cast_to<ConvexPolygonShape>(*s)->get_points(); + Vector<Vector3> points = Object::cast_to<ConvexPolygonShape3D>(*s)->get_points(); if (points.size() > 3) { @@ -3630,17 +3767,17 @@ void CollisionShapeSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { } } - if (Object::cast_to<ConcavePolygonShape>(*s)) { + if (Object::cast_to<ConcavePolygonShape3D>(*s)) { - Ref<ConcavePolygonShape> cs2 = s; + Ref<ConcavePolygonShape3D> cs2 = s; Ref<ArrayMesh> mesh = cs2->get_debug_mesh(); p_gizmo->add_mesh(mesh, false, Ref<SkinReference>(), material); p_gizmo->add_collision_segments(cs2->get_debug_mesh_lines()); } - if (Object::cast_to<RayShape>(*s)) { + if (Object::cast_to<RayShape3D>(*s)) { - Ref<RayShape> rs = s; + Ref<RayShape3D> rs = s; Vector<Vector3> points; points.push_back(Vector3()); @@ -3652,9 +3789,9 @@ void CollisionShapeSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { p_gizmo->add_handles(handles, handles_material); } - if (Object::cast_to<HeightMapShape>(*s)) { + if (Object::cast_to<HeightMapShape3D>(*s)) { - Ref<HeightMapShape> hms = s; + Ref<HeightMapShape3D> hms = s; Ref<ArrayMesh> mesh = hms->get_debug_mesh(); p_gizmo->add_mesh(mesh, false, Ref<SkinReference>(), material); @@ -3663,7 +3800,7 @@ void CollisionShapeSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { ///// -CollisionPolygonSpatialGizmoPlugin::CollisionPolygonSpatialGizmoPlugin() { +CollisionPolygon3DGizmoPlugin::CollisionPolygon3DGizmoPlugin() { const Color gizmo_color = EDITOR_DEF("editors/3d_gizmos/gizmo_colors/shape", Color(0.5, 0.7, 1)); create_material("shape_material", gizmo_color); const float gizmo_value = gizmo_color.get_v(); @@ -3671,21 +3808,21 @@ CollisionPolygonSpatialGizmoPlugin::CollisionPolygonSpatialGizmoPlugin() { create_material("shape_material_disabled", gizmo_color_disabled); } -bool CollisionPolygonSpatialGizmoPlugin::has_gizmo(Spatial *p_spatial) { - return Object::cast_to<CollisionPolygon>(p_spatial) != NULL; +bool CollisionPolygon3DGizmoPlugin::has_gizmo(Node3D *p_spatial) { + return Object::cast_to<CollisionPolygon3D>(p_spatial) != nullptr; } -String CollisionPolygonSpatialGizmoPlugin::get_name() const { - return "CollisionPolygon"; +String CollisionPolygon3DGizmoPlugin::get_name() const { + return "CollisionPolygon3D"; } -int CollisionPolygonSpatialGizmoPlugin::get_priority() const { +int CollisionPolygon3DGizmoPlugin::get_priority() const { return -1; } -void CollisionPolygonSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { +void CollisionPolygon3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { - CollisionPolygon *polygon = Object::cast_to<CollisionPolygon>(p_gizmo->get_spatial_node()); + CollisionPolygon3D *polygon = Object::cast_to<CollisionPolygon3D>(p_gizmo->get_spatial_node()); p_gizmo->clear(); @@ -3713,28 +3850,28 @@ void CollisionPolygonSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { //// -NavigationMeshSpatialGizmoPlugin::NavigationMeshSpatialGizmoPlugin() { +NavigationRegion3DGizmoPlugin::NavigationRegion3DGizmoPlugin() { create_material("navigation_edge_material", EDITOR_DEF("editors/3d_gizmos/gizmo_colors/navigation_edge", Color(0.5, 1, 1))); create_material("navigation_edge_material_disabled", EDITOR_DEF("editors/3d_gizmos/gizmo_colors/navigation_edge_disabled", Color(0.7, 0.7, 0.7))); create_material("navigation_solid_material", EDITOR_DEF("editors/3d_gizmos/gizmo_colors/navigation_solid", Color(0.5, 1, 1, 0.4))); create_material("navigation_solid_material_disabled", EDITOR_DEF("editors/3d_gizmos/gizmo_colors/navigation_solid_disabled", Color(0.7, 0.7, 0.7, 0.4))); } -bool NavigationMeshSpatialGizmoPlugin::has_gizmo(Spatial *p_spatial) { - return Object::cast_to<NavigationRegion>(p_spatial) != NULL; +bool NavigationRegion3DGizmoPlugin::has_gizmo(Node3D *p_spatial) { + return Object::cast_to<NavigationRegion3D>(p_spatial) != nullptr; } -String NavigationMeshSpatialGizmoPlugin::get_name() const { - return "NavigationRegion"; +String NavigationRegion3DGizmoPlugin::get_name() const { + return "NavigationRegion3D"; } -int NavigationMeshSpatialGizmoPlugin::get_priority() const { +int NavigationRegion3DGizmoPlugin::get_priority() const { return -1; } -void NavigationMeshSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { +void NavigationRegion3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { - NavigationRegion *navmesh = Object::cast_to<NavigationRegion>(p_gizmo->get_spatial_node()); + NavigationRegion3D *navmesh = Object::cast_to<NavigationRegion3D>(p_gizmo->get_spatial_node()); Ref<Material> edge_material = get_material("navigation_edge_material", p_gizmo); Ref<Material> edge_material_disabled = get_material("navigation_edge_material_disabled", p_gizmo); @@ -4078,37 +4215,52 @@ void JointGizmosDrawer::draw_cone(const Transform &p_offset, const Basis &p_base //// -JointSpatialGizmoPlugin::JointSpatialGizmoPlugin() { +Joint3DGizmoPlugin::Joint3DGizmoPlugin() { create_material("joint_material", EDITOR_DEF("editors/3d_gizmos/gizmo_colors/joint", Color(0.5, 0.8, 1))); create_material("joint_body_a_material", EDITOR_DEF("editors/3d_gizmos/gizmo_colors/joint_body_a", Color(0.6, 0.8, 1))); create_material("joint_body_b_material", EDITOR_DEF("editors/3d_gizmos/gizmo_colors/joint_body_b", Color(0.6, 0.9, 1))); + + update_timer = memnew(Timer); + update_timer->set_name("JointGizmoUpdateTimer"); + update_timer->set_wait_time(1.0 / 120.0); + update_timer->connect("timeout", callable_mp(this, &Joint3DGizmoPlugin::incremental_update_gizmos)); + update_timer->set_autostart(true); + EditorNode::get_singleton()->call_deferred("add_child", update_timer); +} + +void Joint3DGizmoPlugin::incremental_update_gizmos() { + if (!current_gizmos.empty()) { + update_idx++; + update_idx = update_idx % current_gizmos.size(); + redraw(current_gizmos[update_idx]); + } } -bool JointSpatialGizmoPlugin::has_gizmo(Spatial *p_spatial) { - return Object::cast_to<Joint>(p_spatial) != NULL; +bool Joint3DGizmoPlugin::has_gizmo(Node3D *p_spatial) { + return Object::cast_to<Joint3D>(p_spatial) != nullptr; } -String JointSpatialGizmoPlugin::get_name() const { - return "Joints"; +String Joint3DGizmoPlugin::get_name() const { + return "Joint3D"; } -int JointSpatialGizmoPlugin::get_priority() const { +int Joint3DGizmoPlugin::get_priority() const { return -1; } -void JointSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { - Joint *joint = Object::cast_to<Joint>(p_gizmo->get_spatial_node()); +void Joint3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { + Joint3D *joint = Object::cast_to<Joint3D>(p_gizmo->get_spatial_node()); p_gizmo->clear(); - Spatial *node_body_a = NULL; + Node3D *node_body_a = nullptr; if (!joint->get_node_a().is_empty()) { - node_body_a = Object::cast_to<Spatial>(joint->get_node(joint->get_node_a())); + node_body_a = Object::cast_to<Node3D>(joint->get_node(joint->get_node_a())); } - Spatial *node_body_b = NULL; + Node3D *node_body_b = nullptr; if (!joint->get_node_b().is_empty()) { - node_body_b = Object::cast_to<Spatial>(joint->get_node(joint->get_node_b())); + node_body_b = Object::cast_to<Node3D>(joint->get_node(joint->get_node_b())); } if (!node_body_a && !node_body_b) { @@ -4123,13 +4275,13 @@ void JointSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { Vector<Vector3> body_a_points; Vector<Vector3> body_b_points; - if (Object::cast_to<PinJoint>(joint)) { + if (Object::cast_to<PinJoint3D>(joint)) { CreatePinJointGizmo(Transform(), points); p_gizmo->add_collision_segments(points); p_gizmo->add_lines(points, common_material); } - HingeJoint *hinge = Object::cast_to<HingeJoint>(joint); + HingeJoint3D *hinge = Object::cast_to<HingeJoint3D>(joint); if (hinge) { CreateHingeJointGizmo( @@ -4137,12 +4289,12 @@ void JointSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { hinge->get_global_transform(), node_body_a ? node_body_a->get_global_transform() : Transform(), node_body_b ? node_body_b->get_global_transform() : Transform(), - hinge->get_param(HingeJoint::PARAM_LIMIT_LOWER), - hinge->get_param(HingeJoint::PARAM_LIMIT_UPPER), - hinge->get_flag(HingeJoint::FLAG_USE_LIMIT), + hinge->get_param(HingeJoint3D::PARAM_LIMIT_LOWER), + hinge->get_param(HingeJoint3D::PARAM_LIMIT_UPPER), + hinge->get_flag(HingeJoint3D::FLAG_USE_LIMIT), points, - node_body_a ? &body_a_points : NULL, - node_body_b ? &body_b_points : NULL); + node_body_a ? &body_a_points : nullptr, + node_body_b ? &body_b_points : nullptr); p_gizmo->add_collision_segments(points); p_gizmo->add_collision_segments(body_a_points); @@ -4153,7 +4305,7 @@ void JointSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { p_gizmo->add_lines(body_b_points, body_b_material); } - SliderJoint *slider = Object::cast_to<SliderJoint>(joint); + SliderJoint3D *slider = Object::cast_to<SliderJoint3D>(joint); if (slider) { CreateSliderJointGizmo( @@ -4161,13 +4313,13 @@ void JointSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { slider->get_global_transform(), node_body_a ? node_body_a->get_global_transform() : Transform(), node_body_b ? node_body_b->get_global_transform() : Transform(), - slider->get_param(SliderJoint::PARAM_ANGULAR_LIMIT_LOWER), - slider->get_param(SliderJoint::PARAM_ANGULAR_LIMIT_UPPER), - slider->get_param(SliderJoint::PARAM_LINEAR_LIMIT_LOWER), - slider->get_param(SliderJoint::PARAM_LINEAR_LIMIT_UPPER), + slider->get_param(SliderJoint3D::PARAM_ANGULAR_LIMIT_LOWER), + slider->get_param(SliderJoint3D::PARAM_ANGULAR_LIMIT_UPPER), + slider->get_param(SliderJoint3D::PARAM_LINEAR_LIMIT_LOWER), + slider->get_param(SliderJoint3D::PARAM_LINEAR_LIMIT_UPPER), points, - node_body_a ? &body_a_points : NULL, - node_body_b ? &body_b_points : NULL); + node_body_a ? &body_a_points : nullptr, + node_body_b ? &body_b_points : nullptr); p_gizmo->add_collision_segments(points); p_gizmo->add_collision_segments(body_a_points); @@ -4178,7 +4330,7 @@ void JointSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { p_gizmo->add_lines(body_b_points, body_b_material); } - ConeTwistJoint *cone = Object::cast_to<ConeTwistJoint>(joint); + ConeTwistJoint3D *cone = Object::cast_to<ConeTwistJoint3D>(joint); if (cone) { CreateConeTwistJointGizmo( @@ -4186,10 +4338,10 @@ void JointSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { cone->get_global_transform(), node_body_a ? node_body_a->get_global_transform() : Transform(), node_body_b ? node_body_b->get_global_transform() : Transform(), - cone->get_param(ConeTwistJoint::PARAM_SWING_SPAN), - cone->get_param(ConeTwistJoint::PARAM_TWIST_SPAN), - node_body_a ? &body_a_points : NULL, - node_body_b ? &body_b_points : NULL); + cone->get_param(ConeTwistJoint3D::PARAM_SWING_SPAN), + cone->get_param(ConeTwistJoint3D::PARAM_TWIST_SPAN), + node_body_a ? &body_a_points : nullptr, + node_body_b ? &body_b_points : nullptr); p_gizmo->add_collision_segments(body_a_points); p_gizmo->add_collision_segments(body_b_points); @@ -4198,7 +4350,7 @@ void JointSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { p_gizmo->add_lines(body_b_points, body_b_material); } - Generic6DOFJoint *gen = Object::cast_to<Generic6DOFJoint>(joint); + Generic6DOFJoint3D *gen = Object::cast_to<Generic6DOFJoint3D>(joint); if (gen) { CreateGeneric6DOFJointGizmo( @@ -4207,30 +4359,30 @@ void JointSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { node_body_a ? node_body_a->get_global_transform() : Transform(), node_body_b ? node_body_b->get_global_transform() : Transform(), - gen->get_param_x(Generic6DOFJoint::PARAM_ANGULAR_LOWER_LIMIT), - gen->get_param_x(Generic6DOFJoint::PARAM_ANGULAR_UPPER_LIMIT), - gen->get_param_x(Generic6DOFJoint::PARAM_LINEAR_LOWER_LIMIT), - gen->get_param_x(Generic6DOFJoint::PARAM_LINEAR_UPPER_LIMIT), - gen->get_flag_x(Generic6DOFJoint::FLAG_ENABLE_ANGULAR_LIMIT), - gen->get_flag_x(Generic6DOFJoint::FLAG_ENABLE_LINEAR_LIMIT), - - gen->get_param_y(Generic6DOFJoint::PARAM_ANGULAR_LOWER_LIMIT), - gen->get_param_y(Generic6DOFJoint::PARAM_ANGULAR_UPPER_LIMIT), - gen->get_param_y(Generic6DOFJoint::PARAM_LINEAR_LOWER_LIMIT), - gen->get_param_y(Generic6DOFJoint::PARAM_LINEAR_UPPER_LIMIT), - gen->get_flag_y(Generic6DOFJoint::FLAG_ENABLE_ANGULAR_LIMIT), - gen->get_flag_y(Generic6DOFJoint::FLAG_ENABLE_LINEAR_LIMIT), - - gen->get_param_z(Generic6DOFJoint::PARAM_ANGULAR_LOWER_LIMIT), - gen->get_param_z(Generic6DOFJoint::PARAM_ANGULAR_UPPER_LIMIT), - gen->get_param_z(Generic6DOFJoint::PARAM_LINEAR_LOWER_LIMIT), - gen->get_param_z(Generic6DOFJoint::PARAM_LINEAR_UPPER_LIMIT), - gen->get_flag_z(Generic6DOFJoint::FLAG_ENABLE_ANGULAR_LIMIT), - gen->get_flag_z(Generic6DOFJoint::FLAG_ENABLE_LINEAR_LIMIT), + gen->get_param_x(Generic6DOFJoint3D::PARAM_ANGULAR_LOWER_LIMIT), + gen->get_param_x(Generic6DOFJoint3D::PARAM_ANGULAR_UPPER_LIMIT), + gen->get_param_x(Generic6DOFJoint3D::PARAM_LINEAR_LOWER_LIMIT), + gen->get_param_x(Generic6DOFJoint3D::PARAM_LINEAR_UPPER_LIMIT), + gen->get_flag_x(Generic6DOFJoint3D::FLAG_ENABLE_ANGULAR_LIMIT), + gen->get_flag_x(Generic6DOFJoint3D::FLAG_ENABLE_LINEAR_LIMIT), + + gen->get_param_y(Generic6DOFJoint3D::PARAM_ANGULAR_LOWER_LIMIT), + gen->get_param_y(Generic6DOFJoint3D::PARAM_ANGULAR_UPPER_LIMIT), + gen->get_param_y(Generic6DOFJoint3D::PARAM_LINEAR_LOWER_LIMIT), + gen->get_param_y(Generic6DOFJoint3D::PARAM_LINEAR_UPPER_LIMIT), + gen->get_flag_y(Generic6DOFJoint3D::FLAG_ENABLE_ANGULAR_LIMIT), + gen->get_flag_y(Generic6DOFJoint3D::FLAG_ENABLE_LINEAR_LIMIT), + + gen->get_param_z(Generic6DOFJoint3D::PARAM_ANGULAR_LOWER_LIMIT), + gen->get_param_z(Generic6DOFJoint3D::PARAM_ANGULAR_UPPER_LIMIT), + gen->get_param_z(Generic6DOFJoint3D::PARAM_LINEAR_LOWER_LIMIT), + gen->get_param_z(Generic6DOFJoint3D::PARAM_LINEAR_UPPER_LIMIT), + gen->get_flag_z(Generic6DOFJoint3D::FLAG_ENABLE_ANGULAR_LIMIT), + gen->get_flag_z(Generic6DOFJoint3D::FLAG_ENABLE_LINEAR_LIMIT), points, - node_body_a ? &body_a_points : NULL, - node_body_a ? &body_b_points : NULL); + node_body_a ? &body_a_points : nullptr, + node_body_a ? &body_b_points : nullptr); p_gizmo->add_collision_segments(points); p_gizmo->add_collision_segments(body_a_points); @@ -4242,7 +4394,7 @@ void JointSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { } } -void JointSpatialGizmoPlugin::CreatePinJointGizmo(const Transform &p_offset, Vector<Vector3> &r_cursor_points) { +void Joint3DGizmoPlugin::CreatePinJointGizmo(const Transform &p_offset, Vector<Vector3> &r_cursor_points) { float cs = 0.25; r_cursor_points.push_back(p_offset.translated(Vector3(+cs, 0, 0)).origin); @@ -4253,7 +4405,7 @@ void JointSpatialGizmoPlugin::CreatePinJointGizmo(const Transform &p_offset, Vec r_cursor_points.push_back(p_offset.translated(Vector3(0, 0, -cs)).origin); } -void JointSpatialGizmoPlugin::CreateHingeJointGizmo(const Transform &p_offset, const Transform &p_trs_joint, const Transform &p_trs_body_a, const Transform &p_trs_body_b, real_t p_limit_lower, real_t p_limit_upper, bool p_use_limit, Vector<Vector3> &r_common_points, Vector<Vector3> *r_body_a_points, Vector<Vector3> *r_body_b_points) { +void Joint3DGizmoPlugin::CreateHingeJointGizmo(const Transform &p_offset, const Transform &p_trs_joint, const Transform &p_trs_body_a, const Transform &p_trs_body_b, real_t p_limit_lower, real_t p_limit_upper, bool p_use_limit, Vector<Vector3> &r_common_points, Vector<Vector3> *r_body_a_points, Vector<Vector3> *r_body_b_points) { r_common_points.push_back(p_offset.translated(Vector3(0, 0, 0.5)).origin); r_common_points.push_back(p_offset.translated(Vector3(0, 0, -0.5)).origin); @@ -4285,7 +4437,7 @@ void JointSpatialGizmoPlugin::CreateHingeJointGizmo(const Transform &p_offset, c } } -void JointSpatialGizmoPlugin::CreateSliderJointGizmo(const Transform &p_offset, const Transform &p_trs_joint, const Transform &p_trs_body_a, const Transform &p_trs_body_b, real_t p_angular_limit_lower, real_t p_angular_limit_upper, real_t p_linear_limit_lower, real_t p_linear_limit_upper, Vector<Vector3> &r_points, Vector<Vector3> *r_body_a_points, Vector<Vector3> *r_body_b_points) { +void Joint3DGizmoPlugin::CreateSliderJointGizmo(const Transform &p_offset, const Transform &p_trs_joint, const Transform &p_trs_body_a, const Transform &p_trs_body_b, real_t p_angular_limit_lower, real_t p_angular_limit_upper, real_t p_linear_limit_lower, real_t p_linear_limit_upper, Vector<Vector3> &r_points, Vector<Vector3> *r_body_a_points, Vector<Vector3> *r_body_b_points) { p_linear_limit_lower = -p_linear_limit_lower; p_linear_limit_upper = -p_linear_limit_upper; @@ -4345,7 +4497,7 @@ void JointSpatialGizmoPlugin::CreateSliderJointGizmo(const Transform &p_offset, true); } -void JointSpatialGizmoPlugin::CreateConeTwistJointGizmo(const Transform &p_offset, const Transform &p_trs_joint, const Transform &p_trs_body_a, const Transform &p_trs_body_b, real_t p_swing, real_t p_twist, Vector<Vector3> *r_body_a_points, Vector<Vector3> *r_body_b_points) { +void Joint3DGizmoPlugin::CreateConeTwistJointGizmo(const Transform &p_offset, const Transform &p_trs_joint, const Transform &p_trs_body_a, const Transform &p_trs_body_b, real_t p_swing, real_t p_twist, Vector<Vector3> *r_body_a_points, Vector<Vector3> *r_body_b_points) { if (r_body_a_points) JointGizmosDrawer::draw_cone( @@ -4364,7 +4516,7 @@ void JointSpatialGizmoPlugin::CreateConeTwistJointGizmo(const Transform &p_offse *r_body_b_points); } -void JointSpatialGizmoPlugin::CreateGeneric6DOFJointGizmo( +void Joint3DGizmoPlugin::CreateGeneric6DOFJointGizmo( const Transform &p_offset, const Transform &p_trs_joint, const Transform &p_trs_body_a, diff --git a/editor/node_3d_editor_gizmos.h b/editor/node_3d_editor_gizmos.h new file mode 100644 index 0000000000..6432feeecb --- /dev/null +++ b/editor/node_3d_editor_gizmos.h @@ -0,0 +1,457 @@ +/*************************************************************************/ +/* node_3d_editor_gizmos.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ + +#ifndef SPATIAL_EDITOR_GIZMOS_H +#define SPATIAL_EDITOR_GIZMOS_H + +#include "editor/plugins/node_3d_editor_plugin.h" +#include "scene/3d/camera_3d.h" + +class Camera3D; + +class Light3DGizmoPlugin : public EditorNode3DGizmoPlugin { + + GDCLASS(Light3DGizmoPlugin, EditorNode3DGizmoPlugin); + +public: + bool has_gizmo(Node3D *p_spatial); + String get_name() const; + int get_priority() const; + + String get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_idx) const; + Variant get_handle_value(EditorNode3DGizmo *p_gizmo, int p_idx) const; + void set_handle(EditorNode3DGizmo *p_gizmo, int p_idx, Camera3D *p_camera, const Point2 &p_point); + void commit_handle(EditorNode3DGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel = false); + void redraw(EditorNode3DGizmo *p_gizmo); + + Light3DGizmoPlugin(); +}; + +class AudioStreamPlayer3DGizmoPlugin : public EditorNode3DGizmoPlugin { + + GDCLASS(AudioStreamPlayer3DGizmoPlugin, EditorNode3DGizmoPlugin); + +public: + bool has_gizmo(Node3D *p_spatial); + String get_name() const; + int get_priority() const; + + String get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_idx) const; + Variant get_handle_value(EditorNode3DGizmo *p_gizmo, int p_idx) const; + void set_handle(EditorNode3DGizmo *p_gizmo, int p_idx, Camera3D *p_camera, const Point2 &p_point); + void commit_handle(EditorNode3DGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel = false); + void redraw(EditorNode3DGizmo *p_gizmo); + + AudioStreamPlayer3DGizmoPlugin(); +}; + +class Camera3DGizmoPlugin : public EditorNode3DGizmoPlugin { + + GDCLASS(Camera3DGizmoPlugin, EditorNode3DGizmoPlugin); + +public: + bool has_gizmo(Node3D *p_spatial); + String get_name() const; + int get_priority() const; + + String get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_idx) const; + Variant get_handle_value(EditorNode3DGizmo *p_gizmo, int p_idx) const; + void set_handle(EditorNode3DGizmo *p_gizmo, int p_idx, Camera3D *p_camera, const Point2 &p_point); + void commit_handle(EditorNode3DGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel = false); + void redraw(EditorNode3DGizmo *p_gizmo); + + Camera3DGizmoPlugin(); +}; + +class MeshInstance3DGizmoPlugin : public EditorNode3DGizmoPlugin { + + GDCLASS(MeshInstance3DGizmoPlugin, EditorNode3DGizmoPlugin); + +public: + bool has_gizmo(Node3D *p_spatial); + String get_name() const; + int get_priority() const; + bool can_be_hidden() const; + void redraw(EditorNode3DGizmo *p_gizmo); + + MeshInstance3DGizmoPlugin(); +}; + +class Sprite3DGizmoPlugin : public EditorNode3DGizmoPlugin { + + GDCLASS(Sprite3DGizmoPlugin, EditorNode3DGizmoPlugin); + +public: + bool has_gizmo(Node3D *p_spatial); + String get_name() const; + int get_priority() const; + bool can_be_hidden() const; + void redraw(EditorNode3DGizmo *p_gizmo); + + Sprite3DGizmoPlugin(); +}; + +class Position3DGizmoPlugin : public EditorNode3DGizmoPlugin { + + GDCLASS(Position3DGizmoPlugin, EditorNode3DGizmoPlugin); + + Ref<ArrayMesh> pos3d_mesh; + Vector<Vector3> cursor_points; + +public: + bool has_gizmo(Node3D *p_spatial); + String get_name() const; + int get_priority() const; + void redraw(EditorNode3DGizmo *p_gizmo); + + Position3DGizmoPlugin(); +}; + +class Skeleton3DGizmoPlugin : public EditorNode3DGizmoPlugin { + + GDCLASS(Skeleton3DGizmoPlugin, EditorNode3DGizmoPlugin); + +public: + bool has_gizmo(Node3D *p_spatial); + String get_name() const; + int get_priority() const; + void redraw(EditorNode3DGizmo *p_gizmo); + + Skeleton3DGizmoPlugin(); +}; + +class PhysicalBone3DGizmoPlugin : public EditorNode3DGizmoPlugin { + + GDCLASS(PhysicalBone3DGizmoPlugin, EditorNode3DGizmoPlugin); + +public: + bool has_gizmo(Node3D *p_spatial); + String get_name() const; + int get_priority() const; + void redraw(EditorNode3DGizmo *p_gizmo); + + PhysicalBone3DGizmoPlugin(); +}; + +class RayCast3DGizmoPlugin : public EditorNode3DGizmoPlugin { + + GDCLASS(RayCast3DGizmoPlugin, EditorNode3DGizmoPlugin); + +public: + bool has_gizmo(Node3D *p_spatial); + String get_name() const; + int get_priority() const; + void redraw(EditorNode3DGizmo *p_gizmo); + + RayCast3DGizmoPlugin(); +}; + +class SpringArm3DGizmoPlugin : public EditorNode3DGizmoPlugin { + + GDCLASS(SpringArm3DGizmoPlugin, EditorNode3DGizmoPlugin); + +public: + bool has_gizmo(Node3D *p_spatial); + String get_name() const; + int get_priority() const; + void redraw(EditorNode3DGizmo *p_gizmo); + + SpringArm3DGizmoPlugin(); +}; + +class VehicleWheel3DGizmoPlugin : public EditorNode3DGizmoPlugin { + + GDCLASS(VehicleWheel3DGizmoPlugin, EditorNode3DGizmoPlugin); + +public: + bool has_gizmo(Node3D *p_spatial); + String get_name() const; + int get_priority() const; + void redraw(EditorNode3DGizmo *p_gizmo); + + VehicleWheel3DGizmoPlugin(); +}; + +class SoftBody3DGizmoPlugin : public EditorNode3DGizmoPlugin { + + GDCLASS(SoftBody3DGizmoPlugin, EditorNode3DGizmoPlugin); + +public: + bool has_gizmo(Node3D *p_spatial); + String get_name() const; + int get_priority() const; + bool is_selectable_when_hidden() const; + void redraw(EditorNode3DGizmo *p_gizmo); + + String get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_idx) const; + Variant get_handle_value(EditorNode3DGizmo *p_gizmo, int p_idx) const; + void commit_handle(EditorNode3DGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel); + bool is_handle_highlighted(const EditorNode3DGizmo *p_gizmo, int idx) const; + + SoftBody3DGizmoPlugin(); +}; + +class VisibilityNotifier3DGizmoPlugin : public EditorNode3DGizmoPlugin { + + GDCLASS(VisibilityNotifier3DGizmoPlugin, EditorNode3DGizmoPlugin); + +public: + bool has_gizmo(Node3D *p_spatial); + String get_name() const; + int get_priority() const; + void redraw(EditorNode3DGizmo *p_gizmo); + + String get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_idx) const; + Variant get_handle_value(EditorNode3DGizmo *p_gizmo, int p_idx) const; + void set_handle(EditorNode3DGizmo *p_gizmo, int p_idx, Camera3D *p_camera, const Point2 &p_point); + void commit_handle(EditorNode3DGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel = false); + + VisibilityNotifier3DGizmoPlugin(); +}; + +class CPUParticles3DGizmoPlugin : public EditorNode3DGizmoPlugin { + GDCLASS(CPUParticles3DGizmoPlugin, EditorNode3DGizmoPlugin); + +public: + bool has_gizmo(Node3D *p_spatial); + String get_name() const; + int get_priority() const; + bool is_selectable_when_hidden() const; + void redraw(EditorNode3DGizmo *p_gizmo); + CPUParticles3DGizmoPlugin(); +}; + +class GPUParticles3DGizmoPlugin : public EditorNode3DGizmoPlugin { + + GDCLASS(GPUParticles3DGizmoPlugin, EditorNode3DGizmoPlugin); + +public: + bool has_gizmo(Node3D *p_spatial); + String get_name() const; + int get_priority() const; + bool is_selectable_when_hidden() const; + void redraw(EditorNode3DGizmo *p_gizmo); + + String get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_idx) const; + Variant get_handle_value(EditorNode3DGizmo *p_gizmo, int p_idx) const; + void set_handle(EditorNode3DGizmo *p_gizmo, int p_idx, Camera3D *p_camera, const Point2 &p_point); + void commit_handle(EditorNode3DGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel = false); + + GPUParticles3DGizmoPlugin(); +}; + +class ReflectionProbeGizmoPlugin : public EditorNode3DGizmoPlugin { + + GDCLASS(ReflectionProbeGizmoPlugin, EditorNode3DGizmoPlugin); + +public: + bool has_gizmo(Node3D *p_spatial); + String get_name() const; + int get_priority() const; + void redraw(EditorNode3DGizmo *p_gizmo); + + String get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_idx) const; + Variant get_handle_value(EditorNode3DGizmo *p_gizmo, int p_idx) const; + void set_handle(EditorNode3DGizmo *p_gizmo, int p_idx, Camera3D *p_camera, const Point2 &p_point); + void commit_handle(EditorNode3DGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel = false); + + ReflectionProbeGizmoPlugin(); +}; + +class DecalGizmoPlugin : public EditorNode3DGizmoPlugin { + + GDCLASS(DecalGizmoPlugin, EditorNode3DGizmoPlugin); + +public: + bool has_gizmo(Node3D *p_spatial); + String get_name() const; + int get_priority() const; + void redraw(EditorNode3DGizmo *p_gizmo); + + String get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_idx) const; + Variant get_handle_value(EditorNode3DGizmo *p_gizmo, int p_idx) const; + void set_handle(EditorNode3DGizmo *p_gizmo, int p_idx, Camera3D *p_camera, const Point2 &p_point); + void commit_handle(EditorNode3DGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel = false); + + DecalGizmoPlugin(); +}; + +class GIProbeGizmoPlugin : public EditorNode3DGizmoPlugin { + + GDCLASS(GIProbeGizmoPlugin, EditorNode3DGizmoPlugin); + +public: + bool has_gizmo(Node3D *p_spatial); + String get_name() const; + int get_priority() const; + void redraw(EditorNode3DGizmo *p_gizmo); + + String get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_idx) const; + Variant get_handle_value(EditorNode3DGizmo *p_gizmo, int p_idx) const; + void set_handle(EditorNode3DGizmo *p_gizmo, int p_idx, Camera3D *p_camera, const Point2 &p_point); + void commit_handle(EditorNode3DGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel = false); + + GIProbeGizmoPlugin(); +}; + +#if 0 +class BakedIndirectLightGizmoPlugin : public EditorNode3DGizmoPlugin { + + GDCLASS(BakedIndirectLightGizmoPlugin, EditorNode3DGizmoPlugin); + +public: + bool has_gizmo(Spatial *p_spatial); + String get_name() const; + int get_priority() const; + void redraw(EditorNode3DGizmo *p_gizmo); + + String get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_idx) const; + Variant get_handle_value(EditorNode3DGizmo *p_gizmo, int p_idx) const; + void set_handle(EditorNode3DGizmo *p_gizmo, int p_idx, Camera *p_camera, const Point2 &p_point); + void commit_handle(EditorNode3DGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel = false); + + BakedIndirectLightGizmoPlugin(); +}; +#endif +class CollisionShape3DGizmoPlugin : public EditorNode3DGizmoPlugin { + + GDCLASS(CollisionShape3DGizmoPlugin, EditorNode3DGizmoPlugin); + +public: + bool has_gizmo(Node3D *p_spatial); + String get_name() const; + int get_priority() const; + void redraw(EditorNode3DGizmo *p_gizmo); + + String get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_idx) const; + Variant get_handle_value(EditorNode3DGizmo *p_gizmo, int p_idx) const; + void set_handle(EditorNode3DGizmo *p_gizmo, int p_idx, Camera3D *p_camera, const Point2 &p_point); + void commit_handle(EditorNode3DGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel = false); + + CollisionShape3DGizmoPlugin(); +}; + +class CollisionPolygon3DGizmoPlugin : public EditorNode3DGizmoPlugin { + GDCLASS(CollisionPolygon3DGizmoPlugin, EditorNode3DGizmoPlugin); + +public: + bool has_gizmo(Node3D *p_spatial); + String get_name() const; + int get_priority() const; + void redraw(EditorNode3DGizmo *p_gizmo); + CollisionPolygon3DGizmoPlugin(); +}; + +class NavigationRegion3DGizmoPlugin : public EditorNode3DGizmoPlugin { + + GDCLASS(NavigationRegion3DGizmoPlugin, EditorNode3DGizmoPlugin); + + struct _EdgeKey { + + Vector3 from; + Vector3 to; + + bool operator<(const _EdgeKey &p_with) const { return from == p_with.from ? to < p_with.to : from < p_with.from; } + }; + +public: + bool has_gizmo(Node3D *p_spatial); + String get_name() const; + int get_priority() const; + void redraw(EditorNode3DGizmo *p_gizmo); + + NavigationRegion3DGizmoPlugin(); +}; + +class JointGizmosDrawer { +public: + static Basis look_body(const Transform &p_joint_transform, const Transform &p_body_transform); + static Basis look_body_toward(Vector3::Axis p_axis, const Transform &joint_transform, const Transform &body_transform); + static Basis look_body_toward_x(const Transform &p_joint_transform, const Transform &p_body_transform); + static Basis look_body_toward_y(const Transform &p_joint_transform, const Transform &p_body_transform); + /// Special function just used for physics joints, it returns a basis constrained toward Joint Z axis + /// with axis X and Y that are looking toward the body and oriented toward up + static Basis look_body_toward_z(const Transform &p_joint_transform, const Transform &p_body_transform); + + // Draw circle around p_axis + static void draw_circle(Vector3::Axis p_axis, real_t p_radius, const Transform &p_offset, const Basis &p_base, real_t p_limit_lower, real_t p_limit_upper, Vector<Vector3> &r_points, bool p_inverse = false); + static void draw_cone(const Transform &p_offset, const Basis &p_base, real_t p_swing, real_t p_twist, Vector<Vector3> &r_points); +}; + +class Joint3DGizmoPlugin : public EditorNode3DGizmoPlugin { + + GDCLASS(Joint3DGizmoPlugin, EditorNode3DGizmoPlugin); + + Timer *update_timer; + uint64_t update_idx = 0; + + void incremental_update_gizmos(); + +public: + bool has_gizmo(Node3D *p_spatial); + String get_name() const; + int get_priority() const; + void redraw(EditorNode3DGizmo *p_gizmo); + + static void CreatePinJointGizmo(const Transform &p_offset, Vector<Vector3> &r_cursor_points); + static void CreateHingeJointGizmo(const Transform &p_offset, const Transform &p_trs_joint, const Transform &p_trs_body_a, const Transform &p_trs_body_b, real_t p_limit_lower, real_t p_limit_upper, bool p_use_limit, Vector<Vector3> &r_common_points, Vector<Vector3> *r_body_a_points, Vector<Vector3> *r_body_b_points); + static void CreateSliderJointGizmo(const Transform &p_offset, const Transform &p_trs_joint, const Transform &p_trs_body_a, const Transform &p_trs_body_b, real_t p_angular_limit_lower, real_t p_angular_limit_upper, real_t p_linear_limit_lower, real_t p_linear_limit_upper, Vector<Vector3> &r_points, Vector<Vector3> *r_body_a_points, Vector<Vector3> *r_body_b_points); + static void CreateConeTwistJointGizmo(const Transform &p_offset, const Transform &p_trs_joint, const Transform &p_trs_body_a, const Transform &p_trs_body_b, real_t p_swing, real_t p_twist, Vector<Vector3> *r_body_a_points, Vector<Vector3> *r_body_b_points); + static void CreateGeneric6DOFJointGizmo( + const Transform &p_offset, + const Transform &p_trs_joint, + const Transform &p_trs_body_a, + const Transform &p_trs_body_b, + real_t p_angular_limit_lower_x, + real_t p_angular_limit_upper_x, + real_t p_linear_limit_lower_x, + real_t p_linear_limit_upper_x, + bool p_enable_angular_limit_x, + bool p_enable_linear_limit_x, + real_t p_angular_limit_lower_y, + real_t p_angular_limit_upper_y, + real_t p_linear_limit_lower_y, + real_t p_linear_limit_upper_y, + bool p_enable_angular_limit_y, + bool p_enable_linear_limit_y, + real_t p_angular_limit_lower_z, + real_t p_angular_limit_upper_z, + real_t p_linear_limit_lower_z, + real_t p_linear_limit_upper_z, + bool p_enable_angular_limit_z, + bool p_enable_linear_limit_z, + Vector<Vector3> &r_points, + Vector<Vector3> *r_body_a_points, + Vector<Vector3> *r_body_b_points); + + Joint3DGizmoPlugin(); +}; + +#endif // SPATIAL_EDITOR_GIZMOS_H diff --git a/editor/node_dock.cpp b/editor/node_dock.cpp index 3013406152..a076b1eecc 100644 --- a/editor/node_dock.cpp +++ b/editor/node_dock.cpp @@ -55,12 +55,12 @@ void NodeDock::_bind_methods() { void NodeDock::_notification(int p_what) { if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED) { - connections_button->set_icon(get_icon("Signals", "EditorIcons")); - groups_button->set_icon(get_icon("Groups", "EditorIcons")); + connections_button->set_icon(get_theme_icon("Signals", "EditorIcons")); + groups_button->set_icon(get_theme_icon("Groups", "EditorIcons")); } } -NodeDock *NodeDock::singleton = NULL; +NodeDock *NodeDock::singleton = nullptr; void NodeDock::update_lists() { diff --git a/editor/pane_drag.cpp b/editor/pane_drag.cpp index b143f86ada..ce90fa94dc 100644 --- a/editor/pane_drag.cpp +++ b/editor/pane_drag.cpp @@ -45,7 +45,7 @@ void PaneDrag::_notification(int p_what) { case NOTIFICATION_DRAW: { - Ref<Texture2D> icon = mouse_over ? get_icon("PaneDragHover", "EditorIcons") : get_icon("PaneDrag", "EditorIcons"); + Ref<Texture2D> icon = mouse_over ? get_theme_icon("PaneDragHover", "EditorIcons") : get_theme_icon("PaneDrag", "EditorIcons"); if (!icon.is_null()) icon->draw(get_canvas_item(), Point2(0, 0)); @@ -62,7 +62,7 @@ void PaneDrag::_notification(int p_what) { } Size2 PaneDrag::get_minimum_size() const { - Ref<Texture2D> icon = get_icon("PaneDrag", "EditorIcons"); + Ref<Texture2D> icon = get_theme_icon("PaneDrag", "EditorIcons"); if (!icon.is_null()) return icon->get_size(); return Size2(); diff --git a/editor/plugin_config_dialog.cpp b/editor/plugin_config_dialog.cpp index 1e7c625abb..4317a5e80f 100644 --- a/editor/plugin_config_dialog.cpp +++ b/editor/plugin_config_dialog.cpp @@ -131,14 +131,15 @@ void PluginConfigDialog::_on_required_text_changed(const String &) { void PluginConfigDialog::_notification(int p_what) { switch (p_what) { + case NOTIFICATION_VISIBILITY_CHANGED: { + if (is_visible()) { + name_edit->grab_focus(); + } + } break; case NOTIFICATION_READY: { connect("confirmed", callable_mp(this, &PluginConfigDialog::_on_confirmed)); get_cancel()->connect("pressed", callable_mp(this, &PluginConfigDialog::_on_cancelled)); } break; - - case NOTIFICATION_POST_POPUP: { - name_edit->grab_focus(); - } break; } } diff --git a/editor/plugins/SCsub b/editor/plugins/SCsub index 2b1e889fb0..359d04e5df 100644 --- a/editor/plugins/SCsub +++ b/editor/plugins/SCsub @@ -1,5 +1,5 @@ #!/usr/bin/env python -Import('env') +Import("env") env.add_source_files(env.editor_sources, "*.cpp") diff --git a/editor/plugins/abstract_polygon_2d_editor.cpp b/editor/plugins/abstract_polygon_2d_editor.cpp index 8d5444db73..c26daa3857 100644 --- a/editor/plugins/abstract_polygon_2d_editor.cpp +++ b/editor/plugins/abstract_polygon_2d_editor.cpp @@ -204,9 +204,9 @@ void AbstractPolygon2DEditor::_notification(int p_what) { disable_polygon_editing(false, String()); - button_create->set_icon(EditorNode::get_singleton()->get_gui_base()->get_icon("CurveCreate", "EditorIcons")); - button_edit->set_icon(EditorNode::get_singleton()->get_gui_base()->get_icon("CurveEdit", "EditorIcons")); - button_delete->set_icon(EditorNode::get_singleton()->get_gui_base()->get_icon("CurveDelete", "EditorIcons")); + button_create->set_icon(EditorNode::get_singleton()->get_gui_base()->get_theme_icon("CurveCreate", "EditorIcons")); + button_edit->set_icon(EditorNode::get_singleton()->get_gui_base()->get_theme_icon("CurveEdit", "EditorIcons")); + button_delete->set_icon(EditorNode::get_singleton()->get_gui_base()->get_theme_icon("CurveDelete", "EditorIcons")); button_edit->set_pressed(true); get_tree()->connect("node_removed", callable_mp(this, &AbstractPolygon2DEditor::_node_removed)); @@ -218,7 +218,7 @@ void AbstractPolygon2DEditor::_notification(int p_what) { void AbstractPolygon2DEditor::_node_removed(Node *p_node) { if (p_node == _get_node()) { - edit(NULL); + edit(nullptr); hide(); canvas_item_editor->update_viewport(); @@ -310,7 +310,7 @@ bool AbstractPolygon2DEditor::forward_gui_input(const Ref<InputEvent> &p_event) if (mb.is_valid() && mb->get_button_index() == 1 && mb->is_pressed()) { create_resource->set_text(String("No polygon resource on this node.\nCreate and assign one?")); - create_resource->popup_centered_minsize(); + create_resource->popup_centered(); } return (mb.is_valid() && mb->get_button_index() == 1); } @@ -573,7 +573,7 @@ void AbstractPolygon2DEditor::forward_canvas_draw_over_viewport(Control *p_overl Transform2D xform = canvas_item_editor->get_canvas_transform() * _get_node()->get_global_transform(); // All polygon points are sharp, so use the sharp handle icon - const Ref<Texture2D> handle = get_icon("EditorPathSharpHandle", "EditorIcons"); + const Ref<Texture2D> handle = get_theme_icon("EditorPathSharpHandle", "EditorIcons"); const Vertex active_point = get_active_point(); const int n_polygons = _get_polygon_count(); @@ -651,7 +651,7 @@ void AbstractPolygon2DEditor::forward_canvas_draw_over_viewport(Control *p_overl p_overlay->draw_texture(handle, point - handle->get_size() * 0.5, modulate); if (vertex == hover_point) { - Ref<Font> font = get_font("font", "Label"); + Ref<Font> font = get_theme_font("font", "Label"); String num = String::num(vertex.vertex); Size2 num_size = font->get_string_size(num); p_overlay->draw_string(font, point - num_size * 0.5, num, Color(1.0, 1.0, 1.0, 0.5)); @@ -661,7 +661,7 @@ void AbstractPolygon2DEditor::forward_canvas_draw_over_viewport(Control *p_overl if (edge_point.valid()) { - Ref<Texture2D> add_handle = get_icon("EditorHandleAdd", "EditorIcons"); + Ref<Texture2D> add_handle = get_theme_icon("EditorHandleAdd", "EditorIcons"); p_overlay->draw_texture(add_handle, edge_point.pos - add_handle->get_size() * 0.5); } } @@ -690,7 +690,7 @@ void AbstractPolygon2DEditor::edit(Node *p_polygon) { canvas_item_editor->update_viewport(); } else { - _set_node(NULL); + _set_node(nullptr); } } @@ -801,7 +801,7 @@ AbstractPolygon2DEditor::PosVertex AbstractPolygon2DEditor::closest_edge_point(c AbstractPolygon2DEditor::AbstractPolygon2DEditor(EditorNode *p_editor, bool p_wip_destructive) { - canvas_item_editor = NULL; + canvas_item_editor = nullptr; editor = p_editor; undo_redo = EditorNode::get_undo_redo(); @@ -854,7 +854,7 @@ void AbstractPolygon2DEditorPlugin::make_visible(bool p_visible) { } else { polygon_editor->hide(); - polygon_editor->edit(NULL); + polygon_editor->edit(nullptr); } } diff --git a/editor/plugins/animation_blend_space_1d_editor.cpp b/editor/plugins/animation_blend_space_1d_editor.cpp index 7916ac71ea..eb50df2166 100644 --- a/editor/plugins/animation_blend_space_1d_editor.cpp +++ b/editor/plugins/animation_blend_space_1d_editor.cpp @@ -73,7 +73,7 @@ void AnimationNodeBlendSpace1DEditor::_blend_space_gui_input(const Ref<InputEven ap->get_animation_list(&names); for (List<StringName>::Element *E = names.front(); E; E = E->next()) { - animations_menu->add_icon_item(get_icon("Animation", "EditorIcons"), E->get()); + animations_menu->add_icon_item(get_theme_icon("Animation", "EditorIcons"), E->get()); animations_to_add.push_back(E->get()); } } @@ -97,7 +97,7 @@ void AnimationNodeBlendSpace1DEditor::_blend_space_gui_input(const Ref<InputEven menu->add_separator(); menu->add_item(TTR("Load..."), MENU_LOAD_FILE); - menu->set_global_position(blend_space_draw->get_global_transform().xform(mb->get_position())); + menu->set_position(blend_space_draw->get_screen_transform().xform(mb->get_position())); menu->popup(); add_point_pos = (mb->get_position() / blend_space_draw->get_size()).x; @@ -197,18 +197,18 @@ void AnimationNodeBlendSpace1DEditor::_blend_space_gui_input(const Ref<InputEven void AnimationNodeBlendSpace1DEditor::_blend_space_draw() { - Color linecolor = get_color("font_color", "Label"); + Color linecolor = get_theme_color("font_color", "Label"); Color linecolor_soft = linecolor; linecolor_soft.a *= 0.5; - Ref<Font> font = get_font("font", "Label"); - Ref<Texture2D> icon = get_icon("KeyValue", "EditorIcons"); - Ref<Texture2D> icon_selected = get_icon("KeySelected", "EditorIcons"); + Ref<Font> font = get_theme_font("font", "Label"); + Ref<Texture2D> icon = get_theme_icon("KeyValue", "EditorIcons"); + Ref<Texture2D> icon_selected = get_theme_icon("KeySelected", "EditorIcons"); Size2 s = blend_space_draw->get_size(); if (blend_space_draw->has_focus()) { - Color color = get_color("accent_color", "Editor"); + Color color = get_theme_color("accent_color", "Editor"); blend_space_draw->draw_rect(Rect2(Point2(), s), color, false); } @@ -280,7 +280,7 @@ void AnimationNodeBlendSpace1DEditor::_blend_space_draw() { { Color color; if (tool_blend->is_pressed()) { - color = get_color("accent_color", "Editor"); + color = get_theme_color("accent_color", "Editor"); } else { color = linecolor; color.a *= 0.5; @@ -532,15 +532,15 @@ void AnimationNodeBlendSpace1DEditor::_open_editor() { void AnimationNodeBlendSpace1DEditor::_notification(int p_what) { if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED) { - error_panel->add_style_override("panel", get_stylebox("bg", "Tree")); - error_label->add_color_override("font_color", get_color("error_color", "Editor")); - panel->add_style_override("panel", get_stylebox("bg", "Tree")); - tool_blend->set_icon(get_icon("EditPivot", "EditorIcons")); - tool_select->set_icon(get_icon("ToolSelect", "EditorIcons")); - tool_create->set_icon(get_icon("EditKey", "EditorIcons")); - tool_erase->set_icon(get_icon("Remove", "EditorIcons")); - snap->set_icon(get_icon("SnapGrid", "EditorIcons")); - open_editor->set_icon(get_icon("Edit", "EditorIcons")); + error_panel->add_theme_style_override("panel", get_theme_stylebox("bg", "Tree")); + error_label->add_theme_color_override("font_color", get_theme_color("error_color", "Editor")); + panel->add_theme_style_override("panel", get_theme_stylebox("bg", "Tree")); + tool_blend->set_icon(get_theme_icon("EditPivot", "EditorIcons")); + tool_select->set_icon(get_theme_icon("ToolSelect", "EditorIcons")); + tool_create->set_icon(get_theme_icon("EditKey", "EditorIcons")); + tool_erase->set_icon(get_theme_icon("Remove", "EditorIcons")); + snap->set_icon(get_theme_icon("SnapGrid", "EditorIcons")); + open_editor->set_icon(get_theme_icon("Edit", "EditorIcons")); } if (p_what == NOTIFICATION_PROCESS) { @@ -589,7 +589,7 @@ void AnimationNodeBlendSpace1DEditor::edit(const Ref<AnimationNode> &p_node) { } } -AnimationNodeBlendSpace1DEditor *AnimationNodeBlendSpace1DEditor::singleton = NULL; +AnimationNodeBlendSpace1DEditor *AnimationNodeBlendSpace1DEditor::singleton = nullptr; AnimationNodeBlendSpace1DEditor::AnimationNodeBlendSpace1DEditor() { singleton = this; @@ -735,7 +735,7 @@ AnimationNodeBlendSpace1DEditor::AnimationNodeBlendSpace1DEditor() { open_file = memnew(EditorFileDialog); add_child(open_file); open_file->set_title(TTR("Open Animation Node")); - open_file->set_mode(EditorFileDialog::MODE_OPEN_FILE); + open_file->set_file_mode(EditorFileDialog::FILE_MODE_OPEN_FILE); open_file->connect("file_selected", callable_mp(this, &AnimationNodeBlendSpace1DEditor::_file_opened)); undo_redo = EditorNode::get_undo_redo(); diff --git a/editor/plugins/animation_blend_space_2d_editor.cpp b/editor/plugins/animation_blend_space_2d_editor.cpp index 663f2dde05..4343535eb6 100644 --- a/editor/plugins/animation_blend_space_2d_editor.cpp +++ b/editor/plugins/animation_blend_space_2d_editor.cpp @@ -30,9 +30,9 @@ #include "animation_blend_space_2d_editor.h" +#include "core/input/input_filter.h" #include "core/io/resource_loader.h" #include "core/math/delaunay.h" -#include "core/os/input.h" #include "core/os/keyboard.h" #include "core/project_settings.h" #include "editor/editor_scale.h" @@ -40,7 +40,7 @@ #include "scene/animation/animation_player.h" #include "scene/gui/menu_button.h" #include "scene/gui/panel.h" -#include "scene/main/viewport.h" +#include "scene/main/window.h" bool AnimationNodeBlendSpace2DEditor::can_edit(const Ref<AnimationNode> &p_node) { @@ -100,7 +100,7 @@ void AnimationNodeBlendSpace2DEditor::_blend_space_gui_input(const Ref<InputEven List<StringName> names; ap->get_animation_list(&names); for (List<StringName>::Element *E = names.front(); E; E = E->next()) { - animations_menu->add_icon_item(get_icon("Animation", "EditorIcons"), E->get()); + animations_menu->add_icon_item(get_theme_icon("Animation", "EditorIcons"), E->get()); animations_to_add.push_back(E->get()); } } @@ -124,7 +124,7 @@ void AnimationNodeBlendSpace2DEditor::_blend_space_gui_input(const Ref<InputEven menu->add_separator(); menu->add_item(TTR("Load..."), MENU_LOAD_FILE); - menu->set_global_position(blend_space_draw->get_global_transform().xform(mb->get_position())); + menu->set_position(blend_space_draw->get_screen_transform().xform(mb->get_position())); menu->popup(); add_point_pos = (mb->get_position() / blend_space_draw->get_size()); add_point_pos.y = 1.0 - add_point_pos.y; @@ -406,17 +406,17 @@ void AnimationNodeBlendSpace2DEditor::_tool_switch(int p_tool) { void AnimationNodeBlendSpace2DEditor::_blend_space_draw() { - Color linecolor = get_color("font_color", "Label"); + Color linecolor = get_theme_color("font_color", "Label"); Color linecolor_soft = linecolor; linecolor_soft.a *= 0.5; - Ref<Font> font = get_font("font", "Label"); - Ref<Texture2D> icon = get_icon("KeyValue", "EditorIcons"); - Ref<Texture2D> icon_selected = get_icon("KeySelected", "EditorIcons"); + Ref<Font> font = get_theme_font("font", "Label"); + Ref<Texture2D> icon = get_theme_icon("KeyValue", "EditorIcons"); + Ref<Texture2D> icon_selected = get_theme_icon("KeySelected", "EditorIcons"); Size2 s = blend_space_draw->get_size(); if (blend_space_draw->has_focus()) { - Color color = get_color("accent_color", "Editor"); + Color color = get_theme_color("accent_color", "Editor"); blend_space_draw->draw_rect(Rect2(Point2(), s), color, false); } blend_space_draw->draw_line(Point2(1, 0), Point2(1, s.height - 1), linecolor); @@ -502,7 +502,7 @@ void AnimationNodeBlendSpace2DEditor::_blend_space_draw() { Color color; if (i == selected_triangle) { - color = get_color("accent_color", "Editor"); + color = get_theme_color("accent_color", "Editor"); color.a *= 0.5; } else { color = linecolor; @@ -563,7 +563,7 @@ void AnimationNodeBlendSpace2DEditor::_blend_space_draw() { { Color color; if (tool_blend->is_pressed()) { - color = get_color("accent_color", "Editor"); + color = get_theme_color("accent_color", "Editor"); } else { color = linecolor; color.a *= 0.5; @@ -754,21 +754,21 @@ void AnimationNodeBlendSpace2DEditor::_edit_point_pos(double) { void AnimationNodeBlendSpace2DEditor::_notification(int p_what) { if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED) { - error_panel->add_style_override("panel", get_stylebox("bg", "Tree")); - error_label->add_color_override("font_color", get_color("error_color", "Editor")); - panel->add_style_override("panel", get_stylebox("bg", "Tree")); - tool_blend->set_icon(get_icon("EditPivot", "EditorIcons")); - tool_select->set_icon(get_icon("ToolSelect", "EditorIcons")); - tool_create->set_icon(get_icon("EditKey", "EditorIcons")); - tool_triangle->set_icon(get_icon("ToolTriangle", "EditorIcons")); - tool_erase->set_icon(get_icon("Remove", "EditorIcons")); - snap->set_icon(get_icon("SnapGrid", "EditorIcons")); - open_editor->set_icon(get_icon("Edit", "EditorIcons")); - auto_triangles->set_icon(get_icon("AutoTriangle", "EditorIcons")); + error_panel->add_theme_style_override("panel", get_theme_stylebox("bg", "Tree")); + error_label->add_theme_color_override("font_color", get_theme_color("error_color", "Editor")); + panel->add_theme_style_override("panel", get_theme_stylebox("bg", "Tree")); + tool_blend->set_icon(get_theme_icon("EditPivot", "EditorIcons")); + tool_select->set_icon(get_theme_icon("ToolSelect", "EditorIcons")); + tool_create->set_icon(get_theme_icon("EditKey", "EditorIcons")); + tool_triangle->set_icon(get_theme_icon("ToolTriangle", "EditorIcons")); + tool_erase->set_icon(get_theme_icon("Remove", "EditorIcons")); + snap->set_icon(get_theme_icon("SnapGrid", "EditorIcons")); + open_editor->set_icon(get_theme_icon("Edit", "EditorIcons")); + auto_triangles->set_icon(get_theme_icon("AutoTriangle", "EditorIcons")); interpolation->clear(); - interpolation->add_icon_item(get_icon("TrackContinuous", "EditorIcons"), "", 0); - interpolation->add_icon_item(get_icon("TrackDiscrete", "EditorIcons"), "", 1); - interpolation->add_icon_item(get_icon("TrackCapture", "EditorIcons"), "", 2); + interpolation->add_icon_item(get_theme_icon("TrackContinuous", "EditorIcons"), "", 0); + interpolation->add_icon_item(get_theme_icon("TrackDiscrete", "EditorIcons"), "", 1); + interpolation->add_icon_item(get_theme_icon("TrackCapture", "EditorIcons"), "", 2); } if (p_what == NOTIFICATION_PROCESS) { @@ -810,7 +810,7 @@ void AnimationNodeBlendSpace2DEditor::_open_editor() { } void AnimationNodeBlendSpace2DEditor::_removed_from_graph() { - EditorNode::get_singleton()->edit_item(NULL); + EditorNode::get_singleton()->edit_item(nullptr); } void AnimationNodeBlendSpace2DEditor::_auto_triangles_toggled() { @@ -833,7 +833,7 @@ void AnimationNodeBlendSpace2DEditor::_bind_methods() { ClassDB::bind_method("_removed_from_graph", &AnimationNodeBlendSpace2DEditor::_removed_from_graph); } -AnimationNodeBlendSpace2DEditor *AnimationNodeBlendSpace2DEditor::singleton = NULL; +AnimationNodeBlendSpace2DEditor *AnimationNodeBlendSpace2DEditor::singleton = nullptr; AnimationNodeBlendSpace2DEditor::AnimationNodeBlendSpace2DEditor() { @@ -1042,7 +1042,7 @@ AnimationNodeBlendSpace2DEditor::AnimationNodeBlendSpace2DEditor() { open_file = memnew(EditorFileDialog); add_child(open_file); open_file->set_title(TTR("Open Animation Node")); - open_file->set_mode(EditorFileDialog::MODE_OPEN_FILE); + open_file->set_file_mode(EditorFileDialog::FILE_MODE_OPEN_FILE); open_file->connect("file_selected", callable_mp(this, &AnimationNodeBlendSpace2DEditor::_file_opened)); undo_redo = EditorNode::get_undo_redo(); diff --git a/editor/plugins/animation_blend_tree_editor_plugin.cpp b/editor/plugins/animation_blend_tree_editor_plugin.cpp index e79909fae1..54c60aba71 100644 --- a/editor/plugins/animation_blend_tree_editor_plugin.cpp +++ b/editor/plugins/animation_blend_tree_editor_plugin.cpp @@ -30,8 +30,8 @@ #include "animation_blend_tree_editor_plugin.h" +#include "core/input/input_filter.h" #include "core/io/resource_loader.h" -#include "core/os/input.h" #include "core/os/keyboard.h" #include "core/project_settings.h" #include "editor/editor_inspector.h" @@ -40,7 +40,7 @@ #include "scene/gui/menu_button.h" #include "scene/gui/panel.h" #include "scene/gui/progress_bar.h" -#include "scene/main/viewport.h" +#include "scene/main/window.h" void AnimationNodeBlendTreeEditor::add_custom_type(const String &p_name, const Ref<Script> &p_script) { @@ -145,7 +145,7 @@ void AnimationNodeBlendTreeEditor::_update_graph() { name->set_text(E->get()); name->set_expand_to_text_length(true); node->add_child(name); - node->set_slot(0, false, 0, Color(), true, 0, get_color("font_color", "Label")); + node->set_slot(0, false, 0, Color(), true, 0, get_theme_color("font_color", "Label")); name->connect("text_entered", callable_mp(this, &AnimationNodeBlendTreeEditor::_node_renamed), varray(agnode)); name->connect("focus_exited", callable_mp(this, &AnimationNodeBlendTreeEditor::_node_renamed_focus_out), varray(name, agnode), CONNECT_DEFERRED); base = 1; @@ -157,7 +157,7 @@ void AnimationNodeBlendTreeEditor::_update_graph() { Label *in_name = memnew(Label); node->add_child(in_name); in_name->set_text(agnode->get_input_name(i)); - node->set_slot(base + i, true, 0, get_color("font_color", "Label"), false, 0, Color()); + node->set_slot(base + i, true, 0, get_theme_color("font_color", "Label"), false, 0, Color()); } List<PropertyInfo> pinfo; @@ -185,7 +185,7 @@ void AnimationNodeBlendTreeEditor::_update_graph() { node->add_child(memnew(HSeparator)); Button *open_in_editor = memnew(Button); open_in_editor->set_text(TTR("Open Editor")); - open_in_editor->set_icon(get_icon("Edit", "EditorIcons")); + open_in_editor->set_icon(get_theme_icon("Edit", "EditorIcons")); node->add_child(open_in_editor); open_in_editor->connect("pressed", callable_mp(this, &AnimationNodeBlendTreeEditor::_open_in_editor), varray(E->get()), CONNECT_DEFERRED); open_in_editor->set_h_size_flags(SIZE_SHRINK_CENTER); @@ -196,7 +196,7 @@ void AnimationNodeBlendTreeEditor::_update_graph() { node->add_child(memnew(HSeparator)); Button *edit_filters = memnew(Button); edit_filters->set_text(TTR("Edit Filters")); - edit_filters->set_icon(get_icon("AnimationFilter", "EditorIcons")); + edit_filters->set_icon(get_theme_icon("AnimationFilter", "EditorIcons")); node->add_child(edit_filters); edit_filters->connect("pressed", callable_mp(this, &AnimationNodeBlendTreeEditor::_edit_filters), varray(E->get()), CONNECT_DEFERRED); edit_filters->set_h_size_flags(SIZE_SHRINK_CENTER); @@ -207,7 +207,7 @@ void AnimationNodeBlendTreeEditor::_update_graph() { MenuButton *mb = memnew(MenuButton); mb->set_text(anim->get_animation()); - mb->set_icon(get_icon("Animation", "EditorIcons")); + mb->set_icon(get_theme_icon("Animation", "EditorIcons")); Array options; node->add_child(memnew(HSeparator)); @@ -242,16 +242,16 @@ void AnimationNodeBlendTreeEditor::_update_graph() { } if (EditorSettings::get_singleton()->get("interface/theme/use_graph_node_headers")) { - Ref<StyleBoxFlat> sb = node->get_stylebox("frame", "GraphNode"); + Ref<StyleBoxFlat> sb = node->get_theme_stylebox("frame", "GraphNode"); Color c = sb->get_border_color(); Color mono_color = ((c.r + c.g + c.b) / 3) < 0.7 ? Color(1.0, 1.0, 1.0) : Color(0.0, 0.0, 0.0); mono_color.a = 0.85; c = mono_color; - node->add_color_override("title_color", c); + node->add_theme_color_override("title_color", c); c.a = 0.7; - node->add_color_override("close_color", c); - node->add_color_override("resizer_color", c); + node->add_theme_color_override("close_color", c); + node->add_theme_color_override("resizer_color", c); } } @@ -579,7 +579,7 @@ bool AnimationNodeBlendTreeEditor::_update_filters(const Ref<AnimationNode> &ano for (Set<String>::Element *E = paths.front(); E; E = E->next()) { NodePath path = E->get(); - TreeItem *ti = NULL; + TreeItem *ti = nullptr; String accum; for (int i = 0; i < path.get_name_count(); i++) { String name = path.get_name(i); @@ -608,7 +608,7 @@ bool AnimationNodeBlendTreeEditor::_update_filters(const Ref<AnimationNode> &ano } } - Node *node = NULL; + Node *node = nullptr; if (base->has_node(accum)) { node = base->get_node(accum); } @@ -619,7 +619,7 @@ bool AnimationNodeBlendTreeEditor::_update_filters(const Ref<AnimationNode> &ano String concat = path.get_concatenated_subnames(); - Skeleton *skeleton = Object::cast_to<Skeleton>(node); + Skeleton3D *skeleton = Object::cast_to<Skeleton3D>(node); if (skeleton && skeleton->find_bone(concat) != -1) { //path in skeleton const String &bone = concat; @@ -643,7 +643,7 @@ bool AnimationNodeBlendTreeEditor::_update_filters(const Ref<AnimationNode> &ano ti->set_text(0, F->get()); ti->set_selectable(0, false); ti->set_editable(0, false); - ti->set_icon(0, get_icon("BoneAttachment", "EditorIcons")); + ti->set_icon(0, get_theme_icon("BoneAttachment3D", "EditorIcons")); } else { ti = parenthood[accum]; } @@ -654,7 +654,7 @@ bool AnimationNodeBlendTreeEditor::_update_filters(const Ref<AnimationNode> &ano ti->set_cell_mode(0, TreeItem::CELL_MODE_CHECK); ti->set_text(0, concat); ti->set_checked(0, anode->is_path_filtered(path)); - ti->set_icon(0, get_icon("BoneAttachment", "EditorIcons")); + ti->set_icon(0, get_theme_icon("BoneAttachment3D", "EditorIcons")); ti->set_metadata(0, path); } else { @@ -705,12 +705,12 @@ void AnimationNodeBlendTreeEditor::_edit_filters(const String &p_which) { if (!_update_filters(anode)) return; - filter_dialog->popup_centered_minsize(Size2(500, 500) * EDSCALE); + filter_dialog->popup_centered(Size2(500, 500) * EDSCALE); } void AnimationNodeBlendTreeEditor::_removed_from_graph() { if (is_visible()) { - EditorNode::get_singleton()->edit_item(NULL); + EditorNode::get_singleton()->edit_item(nullptr); } } @@ -718,8 +718,8 @@ void AnimationNodeBlendTreeEditor::_notification(int p_what) { if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED) { - error_panel->add_style_override("panel", get_stylebox("bg", "Tree")); - error_label->add_color_override("font_color", get_color("error_color", "Editor")); + error_panel->add_theme_style_override("panel", get_theme_stylebox("bg", "Tree")); + error_label->add_theme_color_override("font_color", get_theme_color("error_color", "Editor")); if (p_what == NOTIFICATION_THEME_CHANGED && is_visible_in_tree()) _update_graph(); @@ -756,7 +756,7 @@ void AnimationNodeBlendTreeEditor::_notification(int p_what) { } AnimationTree *graph_player = AnimationTreeEditor::get_singleton()->get_tree(); - AnimationPlayer *player = NULL; + AnimationPlayer *player = nullptr; if (graph_player->has_node(graph_player->get_animation_player())) { player = Object::cast_to<AnimationPlayer>(graph_player->get_node(graph_player->get_animation_player())); } @@ -802,7 +802,7 @@ void AnimationNodeBlendTreeEditor::_bind_methods() { ClassDB::bind_method("_update_filters", &AnimationNodeBlendTreeEditor::_update_filters); } -AnimationNodeBlendTreeEditor *AnimationNodeBlendTreeEditor::singleton = NULL; +AnimationNodeBlendTreeEditor *AnimationNodeBlendTreeEditor::singleton = nullptr; void AnimationNodeBlendTreeEditor::_node_renamed(const String &p_text, Ref<AnimationNode> p_node) { @@ -931,7 +931,7 @@ AnimationNodeBlendTreeEditor::AnimationNodeBlendTreeEditor() { add_node->set_text(TTR("Add Node...")); graph->get_zoom_hbox()->move_child(add_node, 0); add_node->get_popup()->connect("id_pressed", callable_mp(this, &AnimationNodeBlendTreeEditor::_add_node)); - add_node->connect("about_to_show", callable_mp(this, &AnimationNodeBlendTreeEditor::_update_options_menu)); + add_node->connect("about_to_popup", callable_mp(this, &AnimationNodeBlendTreeEditor::_update_options_menu)); add_options.push_back(AddOption("Animation", "AnimationNodeAnimation")); add_options.push_back(AddOption("OneShot", "AnimationNodeOneShot")); @@ -975,7 +975,7 @@ AnimationNodeBlendTreeEditor::AnimationNodeBlendTreeEditor() { open_file = memnew(EditorFileDialog); add_child(open_file); open_file->set_title(TTR("Open Animation Node")); - open_file->set_mode(EditorFileDialog::MODE_OPEN_FILE); + open_file->set_file_mode(EditorFileDialog::FILE_MODE_OPEN_FILE); open_file->connect("file_selected", callable_mp(this, &AnimationNodeBlendTreeEditor::_file_opened)); undo_redo = EditorNode::get_undo_redo(); } diff --git a/editor/plugins/animation_player_editor_plugin.cpp b/editor/plugins/animation_player_editor_plugin.cpp index af12335a27..d96a3b0bab 100644 --- a/editor/plugins/animation_player_editor_plugin.cpp +++ b/editor/plugins/animation_player_editor_plugin.cpp @@ -30,28 +30,28 @@ #include "animation_player_editor_plugin.h" +#include "core/input/input_filter.h" #include "core/io/resource_loader.h" #include "core/io/resource_saver.h" -#include "core/os/input.h" #include "core/os/keyboard.h" #include "core/project_settings.h" #include "editor/animation_track_editor.h" #include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/plugins/canvas_item_editor_plugin.h" // For onion skinning. -#include "editor/plugins/spatial_editor_plugin.h" // For onion skinning. -#include "scene/main/viewport.h" -#include "servers/visual_server.h" +#include "editor/plugins/node_3d_editor_plugin.h" // For onion skinning. +#include "scene/main/window.h" +#include "servers/rendering_server.h" void AnimationPlayerEditor::_node_removed(Node *p_node) { if (player && player == p_node) { - player = NULL; + player = nullptr; set_process(false); track_editor->set_animation(Ref<Animation>()); - track_editor->set_root(NULL); + track_editor->set_root(nullptr); track_editor->show_select_node_warning(true); _update_player(); } @@ -105,33 +105,33 @@ void AnimationPlayerEditor::_notification(int p_what) { get_tree()->connect("node_removed", callable_mp(this, &AnimationPlayerEditor::_node_removed)); - add_style_override("panel", editor->get_gui_base()->get_stylebox("panel", "Panel")); + add_theme_style_override("panel", editor->get_gui_base()->get_theme_stylebox("panel", "Panel")); } break; case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: { - add_style_override("panel", editor->get_gui_base()->get_stylebox("panel", "Panel")); + add_theme_style_override("panel", editor->get_gui_base()->get_theme_stylebox("panel", "Panel")); } break; case NOTIFICATION_THEME_CHANGED: { - autoplay->set_icon(get_icon("AutoPlay", "EditorIcons")); + autoplay->set_icon(get_theme_icon("AutoPlay", "EditorIcons")); - play->set_icon(get_icon("PlayStart", "EditorIcons")); - play_from->set_icon(get_icon("Play", "EditorIcons")); - play_bw->set_icon(get_icon("PlayStartBackwards", "EditorIcons")); - play_bw_from->set_icon(get_icon("PlayBackwards", "EditorIcons")); + play->set_icon(get_theme_icon("PlayStart", "EditorIcons")); + play_from->set_icon(get_theme_icon("Play", "EditorIcons")); + play_bw->set_icon(get_theme_icon("PlayStartBackwards", "EditorIcons")); + play_bw_from->set_icon(get_theme_icon("PlayBackwards", "EditorIcons")); - autoplay_icon = get_icon("AutoPlay", "EditorIcons"); - stop->set_icon(get_icon("Stop", "EditorIcons")); + autoplay_icon = get_theme_icon("AutoPlay", "EditorIcons"); + stop->set_icon(get_theme_icon("Stop", "EditorIcons")); - onion_toggle->set_icon(get_icon("Onion", "EditorIcons")); - onion_skinning->set_icon(get_icon("GuiTabMenu", "EditorIcons")); + onion_toggle->set_icon(get_theme_icon("Onion", "EditorIcons")); + onion_skinning->set_icon(get_theme_icon("GuiTabMenu", "EditorIcons")); - pin->set_icon(get_icon("Pin", "EditorIcons")); + pin->set_icon(get_theme_icon("Pin", "EditorIcons")); - tool_anim->add_style_override("normal", get_stylebox("normal", "Button")); - track_editor->get_edit_menu()->add_style_override("normal", get_stylebox("normal", "Button")); + tool_anim->add_theme_style_override("normal", get_theme_stylebox("normal", "Button")); + track_editor->get_edit_menu()->add_theme_style_override("normal", get_theme_stylebox("normal", "Button")); -#define ITEM_ICON(m_item, m_icon) tool_anim->get_popup()->set_item_icon(tool_anim->get_popup()->get_item_index(m_item), get_icon(m_icon, "EditorIcons")) +#define ITEM_ICON(m_item, m_icon) tool_anim->get_popup()->set_item_icon(tool_anim->get_popup()->get_item_index(m_item), get_theme_icon(m_icon, "EditorIcons")) ITEM_ICON(TOOL_NEW_ANIM, "New"); ITEM_ICON(TOOL_LOAD_ANIM, "Load"); @@ -299,7 +299,7 @@ void AnimationPlayerEditor::_animation_selected(int p_which) { } else { track_editor->set_animation(Ref<Animation>()); - track_editor->set_root(NULL); + track_editor->set_root(nullptr); } autoplay->set_pressed(current == player->get_autoplay()); @@ -349,7 +349,7 @@ void AnimationPlayerEditor::_animation_rename() { } void AnimationPlayerEditor::_animation_load() { ERR_FAIL_COND(!player); - file->set_mode(EditorFileDialog::MODE_OPEN_FILE); + file->set_file_mode(EditorFileDialog::FILE_MODE_OPEN_FILE); file->clear_filters(); List<String> extensions; @@ -392,7 +392,7 @@ void AnimationPlayerEditor::_animation_save(const Ref<Resource> &p_resource) { void AnimationPlayerEditor::_animation_save_as(const Ref<Resource> &p_resource) { - file->set_mode(EditorFileDialog::MODE_SAVE_FILE); + file->set_file_mode(EditorFileDialog::FILE_MODE_SAVE_FILE); List<String> extensions; ResourceSaver::get_recognized_extensions(p_resource, &extensions); @@ -407,7 +407,7 @@ void AnimationPlayerEditor::_animation_save_as(const Ref<Resource> &p_resource) file->set_current_path(p_resource->get_path()); if (extensions.size()) { String ext = p_resource->get_path().get_extension().to_lower(); - if (extensions.find(ext) == NULL) { + if (extensions.find(ext) == nullptr) { file->set_current_path(p_resource->get_path().replacen("." + ext, "." + extensions.front()->get())); } } @@ -434,7 +434,7 @@ void AnimationPlayerEditor::_animation_remove() { return; delete_dialog->set_text(TTR("Delete Animation?")); - delete_dialog->popup_centered_minsize(); + delete_dialog->popup_centered(); } void AnimationPlayerEditor::_animation_remove_confirmed() { @@ -488,7 +488,7 @@ double AnimationPlayerEditor::_get_editor_step() const { ERR_FAIL_COND_V(!anim.is_valid(), 0.0); // Use more precise snapping when holding Shift - return Input::get_singleton()->is_key_pressed(KEY_SHIFT) ? anim->get_step() * 0.25 : anim->get_step(); + return InputFilter::get_singleton()->is_key_pressed(KEY_SHIFT) ? anim->get_step() * 0.25 : anim->get_step(); } return 0.0; @@ -501,7 +501,7 @@ void AnimationPlayerEditor::_animation_name_edited() { String new_name = name->get_text(); if (new_name == "" || new_name.find(":") != -1 || new_name.find("/") != -1) { error_dialog->set_text(TTR("Invalid animation name!")); - error_dialog->popup_centered_minsize(); + error_dialog->popup_centered(); return; } @@ -512,7 +512,7 @@ void AnimationPlayerEditor::_animation_name_edited() { if (player->has_animation(new_name)) { error_dialog->set_text(TTR("Animation name already exists!")); - error_dialog->popup_centered_minsize(); + error_dialog->popup_centered(); return; } @@ -729,7 +729,7 @@ void AnimationPlayerEditor::_animation_edit() { } } else { track_editor->set_animation(Ref<Animation>()); - track_editor->set_root(NULL); + track_editor->set_root(nullptr); } } @@ -845,10 +845,10 @@ void AnimationPlayerEditor::_update_player() { frame->set_editable(animlist.size() != 0); animation->set_disabled(animlist.size() == 0); autoplay->set_disabled(animlist.size() == 0); - tool_anim->set_disabled(player == NULL); + tool_anim->set_disabled(player == nullptr); onion_toggle->set_disabled(animlist.size() == 0); onion_skinning->set_disabled(animlist.size() == 0); - pin->set_disabled(player == NULL); + pin->set_disabled(player == nullptr); if (!player) { AnimationPlayerEditor::singleton->get_track_editor()->update_keying(); @@ -947,8 +947,8 @@ void AnimationPlayerEditor::forward_canvas_force_draw_over_viewport(Control *p_o alpha += alpha_step; if (onion.captures_valid[cidx]) { - VS::get_singleton()->canvas_item_add_texture_rect_region( - ci, dst_rect, VS::get_singleton()->viewport_get_texture(onion.captures[cidx]), src_rect, Color(1, 1, 1, alpha)); + RS::get_singleton()->canvas_item_add_texture_rect_region( + ci, dst_rect, RS::get_singleton()->viewport_get_texture(onion.captures[cidx]), src_rect, Color(1, 1, 1, alpha)); } cidx++; @@ -961,8 +961,8 @@ void AnimationPlayerEditor::forward_canvas_force_draw_over_viewport(Control *p_o alpha -= alpha_step; if (onion.captures_valid[cidx]) { - VS::get_singleton()->canvas_item_add_texture_rect_region( - ci, dst_rect, VS::get_singleton()->viewport_get_texture(onion.captures[cidx]), src_rect, Color(1, 1, 1, alpha)); + RS::get_singleton()->canvas_item_add_texture_rect_region( + ci, dst_rect, RS::get_singleton()->viewport_get_texture(onion.captures[cidx]), src_rect, Color(1, 1, 1, alpha)); } cidx++; @@ -1058,7 +1058,7 @@ void AnimationPlayerEditor::_animation_player_changed(Object *p_pl) { if (player == p_pl && is_visible_in_tree()) { _update_player(); - if (blend_editor.dialog->is_visible_in_tree()) + if (blend_editor.dialog->is_visible()) _animation_blend(); // Update. } } @@ -1152,7 +1152,7 @@ void AnimationPlayerEditor::_animation_tool_menu(int p_option) { if (!animation->get_item_count()) { error_dialog->set_text(TTR("No animation to copy!")); - error_dialog->popup_centered_minsize(); + error_dialog->popup_centered(); return; } @@ -1165,7 +1165,7 @@ void AnimationPlayerEditor::_animation_tool_menu(int p_option) { Ref<Animation> anim2 = EditorSettings::get_singleton()->get_resource_clipboard(); if (!anim2.is_valid()) { error_dialog->set_text(TTR("No animation resource on clipboard!")); - error_dialog->popup_centered_minsize(); + error_dialog->popup_centered(); return; } @@ -1195,7 +1195,7 @@ void AnimationPlayerEditor::_animation_tool_menu(int p_option) { if (!animation->get_item_count()) { error_dialog->set_text(TTR("No animation to edit!")); - error_dialog->popup_centered_minsize(); + error_dialog->popup_centered(); return; } @@ -1318,17 +1318,17 @@ void AnimationPlayerEditor::_allocate_onion_layers() { bool is_present = onion.differences_only && i == captures - 1; // Each capture is a viewport with a canvas item attached that renders a full-size rect with the contents of the main viewport. - onion.captures.write[i] = VS::get_singleton()->viewport_create(); + onion.captures.write[i] = RS::get_singleton()->viewport_create(); - VS::get_singleton()->viewport_set_size(onion.captures[i], capture_size.width, capture_size.height); - VS::get_singleton()->viewport_set_update_mode(onion.captures[i], VS::VIEWPORT_UPDATE_ALWAYS); - VS::get_singleton()->viewport_set_transparent_background(onion.captures[i], !is_present); - VS::get_singleton()->viewport_attach_canvas(onion.captures[i], onion.capture.canvas); + RS::get_singleton()->viewport_set_size(onion.captures[i], capture_size.width, capture_size.height); + RS::get_singleton()->viewport_set_update_mode(onion.captures[i], RS::VIEWPORT_UPDATE_ALWAYS); + RS::get_singleton()->viewport_set_transparent_background(onion.captures[i], !is_present); + RS::get_singleton()->viewport_attach_canvas(onion.captures[i], onion.capture.canvas); } // Reset the capture canvas item to the current root viewport texture (defensive). - VS::get_singleton()->canvas_item_clear(onion.capture.canvas_item); - VS::get_singleton()->canvas_item_add_texture_rect(onion.capture.canvas_item, Rect2(Point2(), capture_size), get_tree()->get_root()->get_texture()->get_rid()); + RS::get_singleton()->canvas_item_clear(onion.capture.canvas_item); + RS::get_singleton()->canvas_item_add_texture_rect(onion.capture.canvas_item, Rect2(Point2(), capture_size), get_tree()->get_root()->get_texture()->get_rid()); onion.capture_size = capture_size; } @@ -1337,7 +1337,7 @@ void AnimationPlayerEditor::_free_onion_layers() { for (int i = 0; i < onion.captures.size(); i++) { if (onion.captures[i].is_valid()) { - VS::get_singleton()->free(onion.captures[i]); + RS::get_singleton()->free(onion.captures[i]); } } onion.captures.clear(); @@ -1385,9 +1385,9 @@ void AnimationPlayerEditor::_prepare_onion_layers_2() { // Hide superfluous elements that would make the overlay unnecessary cluttered. Dictionary canvas_edit_state; Dictionary spatial_edit_state; - if (SpatialEditor::get_singleton()->is_visible()) { + if (Node3DEditor::get_singleton()->is_visible()) { // 3D - spatial_edit_state = SpatialEditor::get_singleton()->get_state(); + spatial_edit_state = Node3DEditor::get_singleton()->get_state(); Dictionary new_state = spatial_edit_state.duplicate(); new_state["show_grid"] = false; new_state["show_origin"] = false; @@ -1404,7 +1404,7 @@ void AnimationPlayerEditor::_prepare_onion_layers_2() { } new_state["viewports"] = vp; // TODO: Save/restore only affected entries. - SpatialEditor::get_singleton()->set_state(new_state); + Node3DEditor::get_singleton()->set_state(new_state); } else { // CanvasItemEditor // 2D canvas_edit_state = CanvasItemEditor::get_singleton()->get_state(); @@ -1420,19 +1420,19 @@ void AnimationPlayerEditor::_prepare_onion_layers_2() { // Tweak the root viewport to ensure it's rendered before our target. RID root_vp = get_tree()->get_root()->get_viewport_rid(); - Rect2 root_vp_screen_rect = get_tree()->get_root()->get_attach_to_screen_rect(); - VS::get_singleton()->viewport_attach_to_screen(root_vp, Rect2()); - VS::get_singleton()->viewport_set_update_mode(root_vp, VS::VIEWPORT_UPDATE_ALWAYS); + Rect2 root_vp_screen_rect = Rect2(Vector2(), get_tree()->get_root()->get_size()); + RS::get_singleton()->viewport_attach_to_screen(root_vp, Rect2()); + RS::get_singleton()->viewport_set_update_mode(root_vp, RS::VIEWPORT_UPDATE_ALWAYS); RID present_rid; if (onion.differences_only) { // Capture present scene as it is. - VS::get_singleton()->canvas_item_set_material(onion.capture.canvas_item, RID()); + RS::get_singleton()->canvas_item_set_material(onion.capture.canvas_item, RID()); present_rid = onion.captures[onion.captures.size() - 1]; - VS::get_singleton()->viewport_set_active(present_rid, true); - VS::get_singleton()->viewport_set_parent_viewport(root_vp, present_rid); - VS::get_singleton()->draw(false); - VS::get_singleton()->viewport_set_active(present_rid, false); + RS::get_singleton()->viewport_set_active(present_rid, true); + RS::get_singleton()->viewport_set_parent_viewport(root_vp, present_rid); + RS::get_singleton()->draw(false); + RS::get_singleton()->viewport_set_active(present_rid, false); } // Backup current animation state. @@ -1441,10 +1441,10 @@ void AnimationPlayerEditor::_prepare_onion_layers_2() { // Render every past/future step with the capture shader. - VS::get_singleton()->canvas_item_set_material(onion.capture.canvas_item, onion.capture.material->get_rid()); + RS::get_singleton()->canvas_item_set_material(onion.capture.canvas_item, onion.capture.material->get_rid()); onion.capture.material->set_shader_param("bkg_color", GLOBAL_GET("rendering/environment/default_clear_color")); onion.capture.material->set_shader_param("differences_only", onion.differences_only); - onion.capture.material->set_shader_param("present", onion.differences_only ? VS::get_singleton()->viewport_get_texture(present_rid) : RID()); + onion.capture.material->set_shader_param("present", onion.differences_only ? RS::get_singleton()->viewport_get_texture(present_rid) : RID()); int step_off_a = onion.past ? -onion.steps : 0; int step_off_b = onion.future ? onion.steps : 0; @@ -1465,22 +1465,22 @@ void AnimationPlayerEditor::_prepare_onion_layers_2() { onion.captures_valid.write[cidx] = valid; if (valid) { player->seek(pos, true); - get_tree()->flush_transform_notifications(); // Needed for transforms of Spatials. + get_tree()->flush_transform_notifications(); // Needed for transforms of Node3Ds. values_backup.update_skeletons(); // Needed for Skeletons (2D & 3D). - VS::get_singleton()->viewport_set_active(onion.captures[cidx], true); - VS::get_singleton()->viewport_set_parent_viewport(root_vp, onion.captures[cidx]); - VS::get_singleton()->draw(false); - VS::get_singleton()->viewport_set_active(onion.captures[cidx], false); + RS::get_singleton()->viewport_set_active(onion.captures[cidx], true); + RS::get_singleton()->viewport_set_parent_viewport(root_vp, onion.captures[cidx]); + RS::get_singleton()->draw(false); + RS::get_singleton()->viewport_set_active(onion.captures[cidx], false); } cidx++; } // Restore root viewport. - VS::get_singleton()->viewport_set_parent_viewport(root_vp, RID()); - VS::get_singleton()->viewport_attach_to_screen(root_vp, root_vp_screen_rect); - VS::get_singleton()->viewport_set_update_mode(root_vp, VS::VIEWPORT_UPDATE_WHEN_VISIBLE); + RS::get_singleton()->viewport_set_parent_viewport(root_vp, RID()); + RS::get_singleton()->viewport_attach_to_screen(root_vp, root_vp_screen_rect); + RS::get_singleton()->viewport_set_update_mode(root_vp, RS::VIEWPORT_UPDATE_WHEN_VISIBLE); // Restore animation state // (Seeking with update=true wouldn't do the trick because the current value of the properties @@ -1489,9 +1489,9 @@ void AnimationPlayerEditor::_prepare_onion_layers_2() { player->restore_animated_values(values_backup); // Restore state of main editors. - if (SpatialEditor::get_singleton()->is_visible()) { + if (Node3DEditor::get_singleton()->is_visible()) { // 3D - SpatialEditor::get_singleton()->set_state(spatial_edit_state); + Node3DEditor::get_singleton()->set_state(spatial_edit_state); } else { // CanvasItemEditor // 2D CanvasItemEditor::get_singleton()->set_state(canvas_edit_state); @@ -1549,7 +1549,7 @@ void AnimationPlayerEditor::_bind_methods() { ClassDB::bind_method(D_METHOD("_stop_onion_skinning"), &AnimationPlayerEditor::_stop_onion_skinning); } -AnimationPlayerEditor *AnimationPlayerEditor::singleton = NULL; +AnimationPlayerEditor *AnimationPlayerEditor::singleton = nullptr; AnimationPlayer *AnimationPlayerEditor::get_player() const { @@ -1565,7 +1565,7 @@ AnimationPlayerEditor::AnimationPlayerEditor(EditorNode *p_editor, AnimationPlay set_focus_mode(FOCUS_ALL); - player = NULL; + player = nullptr; HBoxContainer *hb = memnew(HBoxContainer); add_child(hb); @@ -1764,9 +1764,9 @@ AnimationPlayerEditor::AnimationPlayerEditor(EditorNode *p_editor, AnimationPlay onion.last_frame = 0; onion.can_overlay = false; onion.capture_size = Size2(); - onion.capture.canvas = VS::get_singleton()->canvas_create(); - onion.capture.canvas_item = VS::get_singleton()->canvas_item_create(); - VS::get_singleton()->canvas_item_set_parent(onion.capture.canvas_item, onion.capture.canvas); + onion.capture.canvas = RS::get_singleton()->canvas_create(); + onion.capture.canvas_item = RS::get_singleton()->canvas_item_create(); + RS::get_singleton()->canvas_item_set_parent(onion.capture.canvas_item, onion.capture.canvas); onion.capture.material = Ref<ShaderMaterial>(memnew(ShaderMaterial)); @@ -1792,14 +1792,14 @@ AnimationPlayerEditor::AnimationPlayerEditor(EditorNode *p_editor, AnimationPlay COLOR = vec4(capture_samp.rgb * dir_color.rgb, bkg_mask * diff_mask); \ } \ "); - VS::get_singleton()->material_set_shader(onion.capture.material->get_rid(), onion.capture.shader->get_rid()); + RS::get_singleton()->material_set_shader(onion.capture.material->get_rid(), onion.capture.shader->get_rid()); } AnimationPlayerEditor::~AnimationPlayerEditor() { _free_onion_layers(); - VS::get_singleton()->free(onion.capture.canvas); - VS::get_singleton()->free(onion.capture.canvas_item); + RS::get_singleton()->free(onion.capture.canvas); + RS::get_singleton()->free(onion.capture.canvas_item); } void AnimationPlayerEditorPlugin::_notification(int p_what) { diff --git a/editor/plugins/animation_state_machine_editor.cpp b/editor/plugins/animation_state_machine_editor.cpp index cae959e1f4..c06f62a8c1 100644 --- a/editor/plugins/animation_state_machine_editor.cpp +++ b/editor/plugins/animation_state_machine_editor.cpp @@ -30,9 +30,9 @@ #include "animation_state_machine_editor.h" +#include "core/input/input_filter.h" #include "core/io/resource_loader.h" #include "core/math/delaunay.h" -#include "core/os/input.h" #include "core/os/keyboard.h" #include "core/project_settings.h" #include "editor/editor_scale.h" @@ -40,7 +40,7 @@ #include "scene/animation/animation_player.h" #include "scene/gui/menu_button.h" #include "scene/gui/panel.h" -#include "scene/main/viewport.h" +#include "scene/main/window.h" bool AnimationNodeStateMachineEditor::can_edit(const Ref<AnimationNode> &p_node) { @@ -97,7 +97,7 @@ void AnimationNodeStateMachineEditor::_state_machine_gui_input(const Ref<InputEv List<StringName> names; ap->get_animation_list(&names); for (List<StringName>::Element *E = names.front(); E; E = E->next()) { - animations_menu->add_icon_item(get_icon("Animation", "EditorIcons"), E->get()); + animations_menu->add_icon_item(get_theme_icon("Animation", "EditorIcons"), E->get()); animations_to_add.push_back(E->get()); } } @@ -121,7 +121,7 @@ void AnimationNodeStateMachineEditor::_state_machine_gui_input(const Ref<InputEv menu->add_separator(); menu->add_item(TTR("Load..."), MENU_LOAD_FILE); - menu->set_global_position(state_machine_draw->get_global_transform().xform(mb->get_position())); + menu->set_position(state_machine_draw->get_screen_transform().xform(mb->get_position())); menu->popup(); add_node_pos = mb->get_position() / EDSCALE + state_machine->get_graph_offset(); } @@ -149,16 +149,16 @@ void AnimationNodeStateMachineEditor::_state_machine_gui_input(const Ref<InputEv if (node_rects[i].name.has_point(mb->get_position())) { //edit name - Ref<StyleBox> line_sb = get_stylebox("normal", "LineEdit"); + Ref<StyleBox> line_sb = get_theme_stylebox("normal", "LineEdit"); Rect2 edit_rect = node_rects[i].name; edit_rect.position -= line_sb->get_offset(); edit_rect.size += line_sb->get_minimum_size(); - name_edit->set_global_position(state_machine_draw->get_global_transform().xform(edit_rect.position)); - name_edit->set_size(edit_rect.size); + name_edit_popup->set_position(state_machine_draw->get_screen_transform().xform(edit_rect.position)); + name_edit_popup->set_size(edit_rect.size); name_edit->set_text(node_rects[i].node_name); - name_edit->show_modal(); + name_edit_popup->popup(); name_edit->grab_focus(); name_edit->select_all(); @@ -504,9 +504,9 @@ void AnimationNodeStateMachineEditor::_add_animation_type(int p_index) { void AnimationNodeStateMachineEditor::_connection_draw(const Vector2 &p_from, const Vector2 &p_to, AnimationNodeStateMachineTransition::SwitchMode p_mode, bool p_enabled, bool p_selected, bool p_travel, bool p_auto_advance) { - Color linecolor = get_color("font_color", "Label"); + Color linecolor = get_theme_color("font_color", "Label"); Color icon_color(1, 1, 1); - Color accent = get_color("accent_color", "Editor"); + Color accent = get_theme_color("accent_color", "Editor"); if (!p_enabled) { linecolor.a *= 0.2; @@ -515,12 +515,12 @@ void AnimationNodeStateMachineEditor::_connection_draw(const Vector2 &p_from, co } Ref<Texture2D> icons[6] = { - get_icon("TransitionImmediateBig", "EditorIcons"), - get_icon("TransitionSyncBig", "EditorIcons"), - get_icon("TransitionEndBig", "EditorIcons"), - get_icon("TransitionImmediateAutoBig", "EditorIcons"), - get_icon("TransitionSyncAutoBig", "EditorIcons"), - get_icon("TransitionEndAutoBig", "EditorIcons") + get_theme_icon("TransitionImmediateBig", "EditorIcons"), + get_theme_icon("TransitionSyncBig", "EditorIcons"), + get_theme_icon("TransitionEndBig", "EditorIcons"), + get_theme_icon("TransitionImmediateAutoBig", "EditorIcons"), + get_theme_icon("TransitionSyncAutoBig", "EditorIcons"), + get_theme_icon("TransitionEndAutoBig", "EditorIcons") }; if (p_selected) { @@ -573,18 +573,18 @@ void AnimationNodeStateMachineEditor::_state_machine_draw() { Ref<AnimationNodeStateMachinePlayback> playback = AnimationTreeEditor::get_singleton()->get_tree()->get(AnimationTreeEditor::get_singleton()->get_base_path() + "playback"); - Ref<StyleBox> style = get_stylebox("state_machine_frame", "GraphNode"); - Ref<StyleBox> style_selected = get_stylebox("state_machine_selectedframe", "GraphNode"); + Ref<StyleBox> style = get_theme_stylebox("state_machine_frame", "GraphNode"); + Ref<StyleBox> style_selected = get_theme_stylebox("state_machine_selectedframe", "GraphNode"); - Ref<Font> font = get_font("title_font", "GraphNode"); - Color font_color = get_color("title_color", "GraphNode"); - Ref<Texture2D> play = get_icon("Play", "EditorIcons"); - Ref<Texture2D> auto_play = get_icon("AutoPlay", "EditorIcons"); - Ref<Texture2D> edit = get_icon("Edit", "EditorIcons"); - Color accent = get_color("accent_color", "Editor"); - Color linecolor = get_color("font_color", "Label"); + Ref<Font> font = get_theme_font("title_font", "GraphNode"); + Color font_color = get_theme_color("title_color", "GraphNode"); + Ref<Texture2D> play = get_theme_icon("Play", "EditorIcons"); + Ref<Texture2D> auto_play = get_theme_icon("AutoPlay", "EditorIcons"); + Ref<Texture2D> edit = get_theme_icon("Edit", "EditorIcons"); + Color accent = get_theme_color("accent_color", "Editor"); + Color linecolor = get_theme_color("font_color", "Label"); linecolor.a *= 0.3; - Ref<StyleBox> playing_overlay = get_stylebox("position", "GraphNode"); + Ref<StyleBox> playing_overlay = get_theme_stylebox("position", "GraphNode"); bool playing = false; StringName current; @@ -686,7 +686,7 @@ void AnimationNodeStateMachineEditor::_state_machine_draw() { _connection_draw(from, to, AnimationNodeStateMachineTransition::SwitchMode(transition_mode->get_selected()), true, false, false, false); } - Ref<Texture2D> tr_reference_icon = get_icon("TransitionImmediateBig", "EditorIcons"); + Ref<Texture2D> tr_reference_icon = get_theme_icon("TransitionImmediateBig", "EditorIcons"); float tr_bidi_offset = int(tr_reference_icon->get_height() * 0.8); //draw transition lines @@ -879,7 +879,7 @@ void AnimationNodeStateMachineEditor::_state_machine_pos_draw() { float pos = CLAMP(play_pos, 0, len); float c = pos / len; - Color fg = get_color("font_color", "Label"); + Color fg = get_theme_color("font_color", "Label"); Color bg = fg; bg.a *= 0.3; @@ -905,26 +905,26 @@ void AnimationNodeStateMachineEditor::_update_graph() { void AnimationNodeStateMachineEditor::_notification(int p_what) { if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED) { - error_panel->add_style_override("panel", get_stylebox("bg", "Tree")); - error_label->add_color_override("font_color", get_color("error_color", "Editor")); - panel->add_style_override("panel", get_stylebox("bg", "Tree")); + error_panel->add_theme_style_override("panel", get_theme_stylebox("bg", "Tree")); + error_label->add_theme_color_override("font_color", get_theme_color("error_color", "Editor")); + panel->add_theme_style_override("panel", get_theme_stylebox("bg", "Tree")); - tool_select->set_icon(get_icon("ToolSelect", "EditorIcons")); - tool_create->set_icon(get_icon("ToolAddNode", "EditorIcons")); - tool_connect->set_icon(get_icon("ToolConnect", "EditorIcons")); + tool_select->set_icon(get_theme_icon("ToolSelect", "EditorIcons")); + tool_create->set_icon(get_theme_icon("ToolAddNode", "EditorIcons")); + tool_connect->set_icon(get_theme_icon("ToolConnect", "EditorIcons")); transition_mode->clear(); - transition_mode->add_icon_item(get_icon("TransitionImmediate", "EditorIcons"), TTR("Immediate")); - transition_mode->add_icon_item(get_icon("TransitionSync", "EditorIcons"), TTR("Sync")); - transition_mode->add_icon_item(get_icon("TransitionEnd", "EditorIcons"), TTR("At End")); + transition_mode->add_icon_item(get_theme_icon("TransitionImmediate", "EditorIcons"), TTR("Immediate")); + transition_mode->add_icon_item(get_theme_icon("TransitionSync", "EditorIcons"), TTR("Sync")); + transition_mode->add_icon_item(get_theme_icon("TransitionEnd", "EditorIcons"), TTR("At End")); - tool_erase->set_icon(get_icon("Remove", "EditorIcons")); - tool_autoplay->set_icon(get_icon("AutoPlay", "EditorIcons")); - tool_end->set_icon(get_icon("AutoEnd", "EditorIcons")); + tool_erase->set_icon(get_theme_icon("Remove", "EditorIcons")); + tool_autoplay->set_icon(get_theme_icon("AutoPlay", "EditorIcons")); + tool_end->set_icon(get_theme_icon("AutoEnd", "EditorIcons")); play_mode->clear(); - play_mode->add_icon_item(get_icon("PlayTravel", "EditorIcons"), TTR("Travel")); - play_mode->add_icon_item(get_icon("Play", "EditorIcons"), TTR("Immediate")); + play_mode->add_icon_item(get_theme_icon("PlayTravel", "EditorIcons"), TTR("Travel")); + play_mode->add_icon_item(get_theme_icon("Play", "EditorIcons"), TTR("Immediate")); } if (p_what == NOTIFICATION_PROCESS) { @@ -1082,7 +1082,7 @@ void AnimationNodeStateMachineEditor::_open_editor(const String &p_name) { void AnimationNodeStateMachineEditor::_removed_from_graph() { - EditorNode::get_singleton()->edit_item(NULL); + EditorNode::get_singleton()->edit_item(nullptr); } void AnimationNodeStateMachineEditor::_name_edited(const String &p_text) { @@ -1110,7 +1110,7 @@ void AnimationNodeStateMachineEditor::_name_edited(const String &p_text) { undo_redo->add_do_method(this, "_update_graph"); undo_redo->add_undo_method(this, "_update_graph"); undo_redo->commit_action(); - name_edit->hide(); + name_edit_popup->hide(); updating = false; state_machine_draw->update(); @@ -1241,7 +1241,7 @@ void AnimationNodeStateMachineEditor::_bind_methods() { ClassDB::bind_method("_open_editor", &AnimationNodeStateMachineEditor::_open_editor); } -AnimationNodeStateMachineEditor *AnimationNodeStateMachineEditor::singleton = NULL; +AnimationNodeStateMachineEditor *AnimationNodeStateMachineEditor::singleton = nullptr; AnimationNodeStateMachineEditor::AnimationNodeStateMachineEditor() { @@ -1357,17 +1357,18 @@ AnimationNodeStateMachineEditor::AnimationNodeStateMachineEditor() { animations_menu->set_name("animations"); animations_menu->connect("index_pressed", callable_mp(this, &AnimationNodeStateMachineEditor::_add_animation_type)); + name_edit_popup = memnew(Popup); + add_child(name_edit_popup); name_edit = memnew(LineEdit); - state_machine_draw->add_child(name_edit); - name_edit->hide(); + name_edit_popup->add_child(name_edit); + name_edit->set_anchors_and_margins_preset(PRESET_WIDE); name_edit->connect("text_entered", callable_mp(this, &AnimationNodeStateMachineEditor::_name_edited)); name_edit->connect("focus_exited", callable_mp(this, &AnimationNodeStateMachineEditor::_name_edited_focus_out)); - name_edit->set_as_toplevel(true); open_file = memnew(EditorFileDialog); add_child(open_file); open_file->set_title(TTR("Open Animation Node")); - open_file->set_mode(EditorFileDialog::MODE_OPEN_FILE); + open_file->set_file_mode(EditorFileDialog::FILE_MODE_OPEN_FILE); open_file->connect("file_selected", callable_mp(this, &AnimationNodeStateMachineEditor::_file_opened)); undo_redo = EditorNode::get_undo_redo(); diff --git a/editor/plugins/animation_state_machine_editor.h b/editor/plugins/animation_state_machine_editor.h index 132e66b28d..5c4fc87df5 100644 --- a/editor/plugins/animation_state_machine_editor.h +++ b/editor/plugins/animation_state_machine_editor.h @@ -50,6 +50,7 @@ class AnimationNodeStateMachineEditor : public AnimationTreeNodeEditorPlugin { ToolButton *tool_select; ToolButton *tool_create; ToolButton *tool_connect; + Popup *name_edit_popup; LineEdit *name_edit; HBoxContainer *tool_erase_hb; diff --git a/editor/plugins/animation_tree_editor_plugin.cpp b/editor/plugins/animation_tree_editor_plugin.cpp index c9706a7f68..e771c5610f 100644 --- a/editor/plugins/animation_tree_editor_plugin.cpp +++ b/editor/plugins/animation_tree_editor_plugin.cpp @@ -34,9 +34,9 @@ #include "animation_blend_space_2d_editor.h" #include "animation_blend_tree_editor_plugin.h" #include "animation_state_machine_editor.h" +#include "core/input/input_filter.h" #include "core/io/resource_loader.h" #include "core/math/delaunay.h" -#include "core/os/input.h" #include "core/os/keyboard.h" #include "core/project_settings.h" #include "editor/editor_scale.h" @@ -44,7 +44,7 @@ #include "scene/animation/animation_player.h" #include "scene/gui/menu_button.h" #include "scene/gui/panel.h" -#include "scene/main/viewport.h" +#include "scene/main/window.h" #include "scene/scene_string_names.h" void AnimationTreeEditor::edit(AnimationTree *p_tree) { @@ -169,7 +169,7 @@ void AnimationTreeEditor::_notification(int p_what) { void AnimationTreeEditor::_bind_methods() { } -AnimationTreeEditor *AnimationTreeEditor::singleton = NULL; +AnimationTreeEditor *AnimationTreeEditor::singleton = nullptr; void AnimationTreeEditor::add_plugin(AnimationTreeNodeEditorPlugin *p_editor) { ERR_FAIL_COND(p_editor->get_parent()); diff --git a/editor/plugins/asset_library_editor_plugin.cpp b/editor/plugins/asset_library_editor_plugin.cpp index 80b7e6ffc8..14c44b7973 100644 --- a/editor/plugins/asset_library_editor_plugin.cpp +++ b/editor/plugins/asset_library_editor_plugin.cpp @@ -30,8 +30,8 @@ #include "asset_library_editor_plugin.h" +#include "core/input/input_filter.h" #include "core/io/json.h" -#include "core/os/input.h" #include "core/os/keyboard.h" #include "core/version.h" #include "editor/editor_node.h" @@ -62,10 +62,10 @@ void EditorAssetLibraryItem::_notification(int p_what) { if (p_what == NOTIFICATION_ENTER_TREE) { - icon->set_normal_texture(get_icon("ProjectIconLoading", "EditorIcons")); - category->add_color_override("font_color", Color(0.5, 0.5, 0.5)); - author->add_color_override("font_color", Color(0.5, 0.5, 0.5)); - price->add_color_override("font_color", Color(0.5, 0.5, 0.5)); + icon->set_normal_texture(get_theme_icon("ProjectIconLoading", "EditorIcons")); + category->add_theme_color_override("font_color", Color(0.5, 0.5, 0.5)); + author->add_theme_color_override("font_color", Color(0.5, 0.5, 0.5)); + price->add_theme_color_override("font_color", Color(0.5, 0.5, 0.5)); } } @@ -99,11 +99,11 @@ EditorAssetLibraryItem::EditorAssetLibraryItem() { border->set_default_margin(MARGIN_RIGHT, 5 * EDSCALE); border->set_default_margin(MARGIN_BOTTOM, 5 * EDSCALE); border->set_default_margin(MARGIN_TOP, 5 * EDSCALE); - add_style_override("panel", border); + add_theme_style_override("panel", border); HBoxContainer *hb = memnew(HBoxContainer); // Add some spacing to visually separate the icon from the asset details. - hb->add_constant_override("separation", 15 * EDSCALE); + hb->add_theme_constant_override("separation", 15 * EDSCALE); add_child(hb); icon = memnew(TextureButton); @@ -116,7 +116,7 @@ EditorAssetLibraryItem::EditorAssetLibraryItem() { VBoxContainer *vb = memnew(VBoxContainer); hb->add_child(vb); - vb->set_h_size_flags(SIZE_EXPAND_FILL); + vb->set_h_size_flags(Control::SIZE_EXPAND_FILL); title = memnew(LinkButton); title->set_underline_mode(LinkButton::UNDERLINE_MODE_ON_HOVER); @@ -137,7 +137,7 @@ EditorAssetLibraryItem::EditorAssetLibraryItem() { vb->add_child(price); set_custom_minimum_size(Size2(250, 100) * EDSCALE); - set_h_size_flags(SIZE_EXPAND_FILL); + set_h_size_flags(Control::SIZE_EXPAND_FILL); } ////////////////////////////////////////////////////////////////////////////// @@ -156,7 +156,7 @@ void EditorAssetLibraryItemDescription::set_image(int p_type, int p_index, const for (int i = 0; i < preview_images.size(); i++) { if (preview_images[i].id == p_index) { if (preview_images[i].is_video) { - Ref<Image> overlay = get_icon("PlayOverlay", "EditorIcons")->get_data(); + Ref<Image> overlay = previews->get_theme_icon("PlayOverlay", "EditorIcons")->get_data(); Ref<Image> thumbnail = p_image->get_data(); thumbnail = thumbnail->duplicate(); Point2 overlay_pos = Point2((thumbnail->get_width() - overlay->get_width()) / 2, (thumbnail->get_height() - overlay->get_height()) / 2); @@ -172,7 +172,7 @@ void EditorAssetLibraryItemDescription::set_image(int p_type, int p_index, const preview_images[i].button->set_icon(tex); // Make it clearer that clicking it will open an external link - preview_images[i].button->set_default_cursor_shape(CURSOR_POINTING_HAND); + preview_images[i].button->set_default_cursor_shape(Control::CURSOR_POINTING_HAND); } else { preview_images[i].button->set_icon(p_image); } @@ -198,7 +198,7 @@ void EditorAssetLibraryItemDescription::set_image(int p_type, int p_index, const void EditorAssetLibraryItemDescription::_notification(int p_what) { switch (p_what) { case NOTIFICATION_ENTER_TREE: { - previews_bg->add_style_override("panel", get_stylebox("normal", "TextEdit")); + previews_bg->add_theme_style_override("panel", previews->get_theme_stylebox("normal", "TextEdit")); } break; } } @@ -219,7 +219,7 @@ void EditorAssetLibraryItemDescription::_preview_click(int p_id) { if (!preview_images[i].is_video) { if (preview_images[i].image.is_valid()) { preview->set_texture(preview_images[i].image); - minimum_size_changed(); + child_controls_changed(); } } else { _link_click(preview_images[i].video_link); @@ -256,12 +256,12 @@ void EditorAssetLibraryItemDescription::add_preview(int p_id, bool p_video, cons preview.is_video = p_video; preview.button = memnew(Button); preview.button->set_flat(true); - preview.button->set_icon(get_icon("ThumbnailWait", "EditorIcons")); + preview.button->set_icon(previews->get_theme_icon("ThumbnailWait", "EditorIcons")); preview.button->set_toggle_mode(true); preview.button->connect("pressed", callable_mp(this, &EditorAssetLibraryItemDescription::_preview_click), varray(p_id)); preview_hb->add_child(preview.button); if (!p_video) { - preview.image = get_icon("ThumbnailWait", "EditorIcons"); + preview.image = previews->get_theme_icon("ThumbnailWait", "EditorIcons"); } preview_images.push_back(preview); if (preview_images.size() == 1 && !p_video) { @@ -275,7 +275,7 @@ EditorAssetLibraryItemDescription::EditorAssetLibraryItemDescription() { add_child(hbox); VBoxContainer *desc_vbox = memnew(VBoxContainer); hbox->add_child(desc_vbox); - hbox->add_constant_override("separation", 15 * EDSCALE); + hbox->add_theme_constant_override("separation", 15 * EDSCALE); item = memnew(EditorAssetLibraryItem); @@ -284,14 +284,14 @@ EditorAssetLibraryItemDescription::EditorAssetLibraryItemDescription() { description = memnew(RichTextLabel); desc_vbox->add_child(description); - description->set_v_size_flags(SIZE_EXPAND_FILL); + description->set_v_size_flags(Control::SIZE_EXPAND_FILL); description->connect("meta_clicked", callable_mp(this, &EditorAssetLibraryItemDescription::_link_click)); - description->add_constant_override("line_separation", Math::round(5 * EDSCALE)); + description->add_theme_constant_override("line_separation", Math::round(5 * EDSCALE)); VBoxContainer *previews_vbox = memnew(VBoxContainer); hbox->add_child(previews_vbox); - previews_vbox->add_constant_override("separation", 15 * EDSCALE); - previews_vbox->set_v_size_flags(SIZE_EXPAND_FILL); + previews_vbox->add_theme_constant_override("separation", 15 * EDSCALE); + previews_vbox->set_v_size_flags(Control::SIZE_EXPAND_FILL); preview = memnew(TextureRect); previews_vbox->add_child(preview); @@ -308,7 +308,7 @@ EditorAssetLibraryItemDescription::EditorAssetLibraryItemDescription() { previews->set_enable_v_scroll(false); previews->set_enable_h_scroll(true); preview_hb = memnew(HBoxContainer); - preview_hb->set_v_size_flags(SIZE_EXPAND_FILL); + preview_hb->set_v_size_flags(Control::SIZE_EXPAND_FILL); previews->add_child(preview_hb); get_ok()->set_text(TTR("Download")); @@ -375,7 +375,7 @@ void EditorAssetLibraryItemDownload::_http_download_completed(int p_status, int if (error_text != String()) { download_error->set_text(TTR("Asset Download Error:") + "\n" + error_text); - download_error->popup_centered_minsize(); + download_error->popup_centered(); return; } @@ -393,7 +393,7 @@ void EditorAssetLibraryItemDownload::configure(const String &p_title, int p_asse icon->set_texture(p_preview); asset_id = p_asset_id; if (!p_preview.is_valid()) - icon->set_texture(get_icon("FileBrokenBigThumb", "EditorIcons")); + icon->set_texture(get_theme_icon("FileBrokenBigThumb", "EditorIcons")); host = p_download_url; sha256 = p_sha256_hash; _make_request(); @@ -406,8 +406,8 @@ void EditorAssetLibraryItemDownload::_notification(int p_what) { // FIXME: The editor crashes if 'NOTICATION_THEME_CHANGED' is used. case NOTIFICATION_ENTER_TREE: { - add_style_override("panel", get_stylebox("panel", "TabContainer")); - dismiss->set_normal_texture(get_icon("Close", "EditorIcons")); + add_theme_style_override("panel", get_theme_stylebox("panel", "TabContainer")); + dismiss->set_normal_texture(get_theme_icon("Close", "EditorIcons")); } break; case NOTIFICATION_PROCESS: { @@ -507,13 +507,13 @@ EditorAssetLibraryItemDownload::EditorAssetLibraryItemDownload() { VBoxContainer *vb = memnew(VBoxContainer); hb->add_child(vb); - vb->set_h_size_flags(SIZE_EXPAND_FILL); + vb->set_h_size_flags(Control::SIZE_EXPAND_FILL); HBoxContainer *title_hb = memnew(HBoxContainer); vb->add_child(title_hb); title = memnew(Label); title_hb->add_child(title); - title->set_h_size_flags(SIZE_EXPAND_FILL); + title->set_h_size_flags(Control::SIZE_EXPAND_FILL); dismiss = memnew(TextureButton); dismiss->connect("pressed", callable_mp(this, &EditorAssetLibraryItemDownload::_close)); @@ -525,7 +525,7 @@ EditorAssetLibraryItemDownload::EditorAssetLibraryItemDownload() { status = memnew(Label(TTR("Idle"))); vb->add_child(status); - status->add_color_override("font_color", Color(0.5, 0.5, 0.5)); + status->add_theme_color_override("font_color", Color(0.5, 0.5, 0.5)); progress = memnew(ProgressBar); vb->add_child(progress); @@ -571,8 +571,8 @@ void EditorAssetLibrary::_notification(int p_what) { case NOTIFICATION_READY: { - error_tr->set_texture(get_icon("Error", "EditorIcons")); - filter->set_right_icon(get_icon("Search", "EditorIcons")); + error_tr->set_texture(get_theme_icon("Error", "EditorIcons")); + filter->set_right_icon(get_theme_icon("Search", "EditorIcons")); filter->set_clear_button_enabled(true); error_label->raise(); @@ -602,10 +602,10 @@ void EditorAssetLibrary::_notification(int p_what) { } break; case NOTIFICATION_THEME_CHANGED: { - library_scroll_bg->add_style_override("panel", get_stylebox("bg", "Tree")); - downloads_scroll->add_style_override("bg", get_stylebox("bg", "Tree")); - error_tr->set_texture(get_icon("Error", "EditorIcons")); - filter->set_right_icon(get_icon("Search", "EditorIcons")); + library_scroll_bg->add_theme_style_override("panel", get_theme_stylebox("bg", "Tree")); + downloads_scroll->add_theme_style_override("bg", get_theme_stylebox("bg", "Tree")); + error_tr->set_texture(get_theme_icon("Error", "EditorIcons")); + filter->set_right_icon(get_theme_icon("Search", "EditorIcons")); filter->set_clear_button_enabled(true); } break; } @@ -635,7 +635,7 @@ void EditorAssetLibrary::_install_asset() { EditorAssetLibraryItemDownload *d = Object::cast_to<EditorAssetLibraryItemDownload>(downloads_hb->get_child(i)); if (d && d->get_asset_id() == description->get_asset_id()) { - if (EditorNode::get_singleton() != NULL) + if (EditorNode::get_singleton() != nullptr) EditorNode::get_singleton()->show_warning(TTR("Download for this asset is already in progress!")); return; } @@ -774,7 +774,7 @@ void EditorAssetLibrary::_image_update(bool use_cache, bool final, const PackedB } if (!image_set && final) { - obj->call("set_image", image_queue[p_queue_id].image_type, image_queue[p_queue_id].image_index, get_icon("FileBrokenBigThumb", "EditorIcons")); + obj->call("set_image", image_queue[p_queue_id].image_type, image_queue[p_queue_id].image_index, get_theme_icon("FileBrokenBigThumb", "EditorIcons")); } } } @@ -819,7 +819,7 @@ void EditorAssetLibrary::_image_request_completed(int p_status, int p_code, cons WARN_PRINT("Error getting image file from URL: " + image_queue[p_queue_id].image_url); Object *obj = ObjectDB::get_instance(image_queue[p_queue_id].target); if (obj) { - obj->call("set_image", image_queue[p_queue_id].image_type, image_queue[p_queue_id].image_index, get_icon("FileBrokenBigThumb", "EditorIcons")); + obj->call("set_image", image_queue[p_queue_id].image_type, image_queue[p_queue_id].image_index, get_theme_icon("FileBrokenBigThumb", "EditorIcons")); } } @@ -976,7 +976,7 @@ HBoxContainer *EditorAssetLibrary::_make_pages(int p_page, int p_page_count, int to = p_page_count; hbc->add_spacer(); - hbc->add_constant_override("separation", 5 * EDSCALE); + hbc->add_theme_constant_override("separation", 5 * EDSCALE); Button *first = memnew(Button); first->set_text(TTR("First")); @@ -1191,8 +1191,8 @@ void EditorAssetLibrary::_http_request_completed(int p_status, int p_code, const asset_items = memnew(GridContainer); asset_items->set_columns(2); - asset_items->add_constant_override("hseparation", 10 * EDSCALE); - asset_items->add_constant_override("vseparation", 10 * EDSCALE); + asset_items->add_theme_constant_override("hseparation", 10 * EDSCALE); + asset_items->add_theme_constant_override("vseparation", 10 * EDSCALE); library_vb->add_child(asset_items); @@ -1260,7 +1260,7 @@ void EditorAssetLibrary::_http_request_completed(int p_status, int p_code, const description = memnew(EditorAssetLibraryItemDescription); add_child(description); - description->popup_centered_minsize(); + description->popup_centered(); description->connect("confirmed", callable_mp(this, &EditorAssetLibrary::_install_asset)); description->configure(r["title"], r["asset_id"], category_map[r["category_id"]], r["category_id"], r["author"], r["author_id"], r["cost"], r["version"], r["version_string"], r["description"], r["download_url"], r["browse_url"], r["download_hash"]); @@ -1305,7 +1305,7 @@ void EditorAssetLibrary::_asset_file_selected(const String &p_file) { if (asset_installer) { memdelete(asset_installer); - asset_installer = NULL; + asset_installer = nullptr; } asset_installer = memnew(EditorAssetInstaller); @@ -1353,11 +1353,11 @@ EditorAssetLibrary::EditorAssetLibrary(bool p_templates_only) { HBoxContainer *search_hb = memnew(HBoxContainer); library_main->add_child(search_hb); - library_main->add_constant_override("separation", 10 * EDSCALE); + library_main->add_theme_constant_override("separation", 10 * EDSCALE); filter = memnew(LineEdit); search_hb->add_child(filter); - filter->set_h_size_flags(SIZE_EXPAND_FILL); + filter->set_h_size_flags(Control::SIZE_EXPAND_FILL); filter->connect("text_entered", callable_mp(this, &EditorAssetLibrary::_search_text_entered)); search = memnew(Button(TTR("Search"))); search->connect("pressed", callable_mp(this, &EditorAssetLibrary::_search), make_binds(0)); @@ -1392,7 +1392,7 @@ EditorAssetLibrary::EditorAssetLibrary(bool p_templates_only) { search_hb2->add_child(sort); - sort->set_h_size_flags(SIZE_EXPAND_FILL); + sort->set_h_size_flags(Control::SIZE_EXPAND_FILL); sort->connect("item_selected", callable_mp(this, &EditorAssetLibrary::_rerun_search)); search_hb2->add_child(memnew(VSeparator)); @@ -1401,7 +1401,7 @@ EditorAssetLibrary::EditorAssetLibrary(bool p_templates_only) { categories = memnew(OptionButton); categories->add_item(TTR("All")); search_hb2->add_child(categories); - categories->set_h_size_flags(SIZE_EXPAND_FILL); + categories->set_h_size_flags(Control::SIZE_EXPAND_FILL); categories->connect("item_selected", callable_mp(this, &EditorAssetLibrary::_rerun_search)); search_hb2->add_child(memnew(VSeparator)); @@ -1417,7 +1417,7 @@ EditorAssetLibrary::EditorAssetLibrary(bool p_templates_only) { repository->connect("item_selected", callable_mp(this, &EditorAssetLibrary::_repository_changed)); search_hb2->add_child(repository); - repository->set_h_size_flags(SIZE_EXPAND_FILL); + repository->set_h_size_flags(Control::SIZE_EXPAND_FILL); search_hb2->add_child(memnew(VSeparator)); @@ -1435,7 +1435,7 @@ EditorAssetLibrary::EditorAssetLibrary(bool p_templates_only) { library_scroll_bg = memnew(PanelContainer); library_main->add_child(library_scroll_bg); - library_scroll_bg->set_v_size_flags(SIZE_EXPAND_FILL); + library_scroll_bg->set_v_size_flags(Control::SIZE_EXPAND_FILL); library_scroll = memnew(ScrollContainer); library_scroll->set_enable_v_scroll(true); @@ -1452,11 +1452,11 @@ EditorAssetLibrary::EditorAssetLibrary(bool p_templates_only) { PanelContainer *library_vb_border = memnew(PanelContainer); library_scroll->add_child(library_vb_border); - library_vb_border->add_style_override("panel", border2); - library_vb_border->set_h_size_flags(SIZE_EXPAND_FILL); + library_vb_border->add_theme_style_override("panel", border2); + library_vb_border->set_h_size_flags(Control::SIZE_EXPAND_FILL); library_vb = memnew(VBoxContainer); - library_vb->set_h_size_flags(SIZE_EXPAND_FILL); + library_vb->set_h_size_flags(Control::SIZE_EXPAND_FILL); library_vb_border->add_child(library_vb); @@ -1474,8 +1474,8 @@ EditorAssetLibrary::EditorAssetLibrary(bool p_templates_only) { asset_items = memnew(GridContainer); asset_items->set_columns(2); - asset_items->add_constant_override("hseparation", 10 * EDSCALE); - asset_items->add_constant_override("vseparation", 10 * EDSCALE); + asset_items->add_theme_constant_override("hseparation", 10 * EDSCALE); + asset_items->add_theme_constant_override("vseparation", 10 * EDSCALE); library_vb->add_child(asset_items); @@ -1489,18 +1489,18 @@ EditorAssetLibrary::EditorAssetLibrary(bool p_templates_only) { last_queue_id = 0; - library_vb->add_constant_override("separation", 20 * EDSCALE); + library_vb->add_theme_constant_override("separation", 20 * EDSCALE); error_hb = memnew(HBoxContainer); library_main->add_child(error_hb); error_label = memnew(Label); - error_label->add_color_override("color", get_color("error_color", "Editor")); + error_label->add_theme_color_override("color", get_theme_color("error_color", "Editor")); error_hb->add_child(error_label); error_tr = memnew(TextureRect); error_tr->set_v_size_flags(Control::SIZE_SHRINK_CENTER); error_hb->add_child(error_tr); - description = NULL; + description = nullptr; set_process(true); set_process_unhandled_input(true); @@ -1516,11 +1516,11 @@ EditorAssetLibrary::EditorAssetLibrary(bool p_templates_only) { asset_open->set_access(EditorFileDialog::ACCESS_FILESYSTEM); asset_open->add_filter("*.zip ; " + TTR("Assets ZIP File")); - asset_open->set_mode(EditorFileDialog::MODE_OPEN_FILE); + asset_open->set_file_mode(EditorFileDialog::FILE_MODE_OPEN_FILE); add_child(asset_open); asset_open->connect("file_selected", callable_mp(this, &EditorAssetLibrary::_asset_file_selected)); - asset_installer = NULL; + asset_installer = nullptr; } /////// diff --git a/editor/plugins/audio_stream_editor_plugin.cpp b/editor/plugins/audio_stream_editor_plugin.cpp index 7a1722c73b..0459ac7618 100644 --- a/editor/plugins/audio_stream_editor_plugin.cpp +++ b/editor/plugins/audio_stream_editor_plugin.cpp @@ -43,10 +43,10 @@ void AudioStreamEditor::_notification(int p_what) { } if (p_what == NOTIFICATION_THEME_CHANGED || p_what == NOTIFICATION_ENTER_TREE) { - _play_button->set_icon(get_icon("MainPlay", "EditorIcons")); - _stop_button->set_icon(get_icon("Stop", "EditorIcons")); - _preview->set_frame_color(get_color("dark_color_2", "Editor")); - set_frame_color(get_color("dark_color_1", "Editor")); + _play_button->set_icon(get_theme_icon("MainPlay", "EditorIcons")); + _stop_button->set_icon(get_theme_icon("Stop", "EditorIcons")); + _preview->set_frame_color(get_theme_color("dark_color_2", "Editor")); + set_frame_color(get_theme_color("dark_color_1", "Editor")); _indicator->update(); _preview->update(); @@ -87,9 +87,9 @@ void AudioStreamEditor::_draw_preview() { } Vector<Color> color; - color.push_back(get_color("contrast_color_2", "Editor")); + color.push_back(get_theme_color("contrast_color_2", "Editor")); - VS::get_singleton()->canvas_item_add_multiline(_preview->get_canvas_item(), lines, color); + RS::get_singleton()->canvas_item_add_multiline(_preview->get_canvas_item(), lines, color); } void AudioStreamEditor::_preview_changed(ObjectID p_which) { @@ -110,11 +110,11 @@ void AudioStreamEditor::_play() { if (_player->is_playing()) { _player->stop(); - _play_button->set_icon(get_icon("MainPlay", "EditorIcons")); + _play_button->set_icon(get_theme_icon("MainPlay", "EditorIcons")); set_process(false); } else { _player->play(_current); - _play_button->set_icon(get_icon("Pause", "EditorIcons")); + _play_button->set_icon(get_theme_icon("Pause", "EditorIcons")); set_process(true); } } @@ -122,7 +122,7 @@ void AudioStreamEditor::_play() { void AudioStreamEditor::_stop() { _player->stop(); - _play_button->set_icon(get_icon("MainPlay", "EditorIcons")); + _play_button->set_icon(get_theme_icon("MainPlay", "EditorIcons")); _current = 0; _indicator->update(); set_process(false); @@ -130,7 +130,7 @@ void AudioStreamEditor::_stop() { void AudioStreamEditor::_on_finished() { - _play_button->set_icon(get_icon("MainPlay", "EditorIcons")); + _play_button->set_icon(get_theme_icon("MainPlay", "EditorIcons")); if (_current == _player->get_stream()->get_length()) { _current = 0; _indicator->update(); @@ -146,7 +146,7 @@ void AudioStreamEditor::_draw_indicator() { Rect2 rect = _preview->get_rect(); float len = stream->get_length(); float ofs_x = _current / len * rect.size.width; - _indicator->draw_line(Point2(ofs_x, 0), Point2(ofs_x, rect.size.height), get_color("accent_color", "Editor"), 1); + _indicator->draw_line(Point2(ofs_x, 0), Point2(ofs_x, rect.size.height), get_theme_color("accent_color", "Editor"), 1); _current_label->set_text(String::num(_current, 2).pad_decimals(2) + " /"); } @@ -225,7 +225,7 @@ AudioStreamEditor::AudioStreamEditor() { _preview->add_child(_indicator); HBoxContainer *hbox = memnew(HBoxContainer); - hbox->add_constant_override("separation", 0); + hbox->add_theme_constant_override("separation", 0); vbox->add_child(hbox); _play_button = memnew(ToolButton); @@ -241,12 +241,12 @@ AudioStreamEditor::AudioStreamEditor() { _current_label = memnew(Label); _current_label->set_align(Label::ALIGN_RIGHT); _current_label->set_h_size_flags(SIZE_EXPAND_FILL); - _current_label->add_font_override("font", EditorNode::get_singleton()->get_gui_base()->get_font("status_source", "EditorFonts")); + _current_label->add_theme_font_override("font", EditorNode::get_singleton()->get_gui_base()->get_theme_font("status_source", "EditorFonts")); _current_label->set_modulate(Color(1, 1, 1, 0.5)); hbox->add_child(_current_label); _duration_label = memnew(Label); - _duration_label->add_font_override("font", EditorNode::get_singleton()->get_gui_base()->get_font("status_source", "EditorFonts")); + _duration_label->add_theme_font_override("font", EditorNode::get_singleton()->get_gui_base()->get_theme_font("status_source", "EditorFonts")); hbox->add_child(_duration_label); } diff --git a/editor/plugins/baked_lightmap_editor_plugin.cpp b/editor/plugins/baked_lightmap_editor_plugin.cpp index 6bc9562c5a..ba161244d6 100644 --- a/editor/plugins/baked_lightmap_editor_plugin.cpp +++ b/editor/plugins/baked_lightmap_editor_plugin.cpp @@ -81,25 +81,25 @@ void BakedLightmapEditorPlugin::make_visible(bool p_visible) { } } -EditorProgress *BakedLightmapEditorPlugin::tmp_progress = NULL; +EditorProgress *BakedLightmapEditorPlugin::tmp_progress = nullptr; void BakedLightmapEditorPlugin::bake_func_begin(int p_steps) { - ERR_FAIL_COND(tmp_progress != NULL); + ERR_FAIL_COND(tmp_progress != nullptr); tmp_progress = memnew(EditorProgress("bake_lightmaps", TTR("Bake Lightmaps"), p_steps, true)); } bool BakedLightmapEditorPlugin::bake_func_step(int p_step, const String &p_description) { - ERR_FAIL_COND_V(tmp_progress == NULL, false); + ERR_FAIL_COND_V(tmp_progress == nullptr, false); return tmp_progress->step(p_description, p_step, false); } void BakedLightmapEditorPlugin::bake_func_end() { - ERR_FAIL_COND(tmp_progress == NULL); + ERR_FAIL_COND(tmp_progress == nullptr); memdelete(tmp_progress); - tmp_progress = NULL; + tmp_progress = nullptr; } void BakedLightmapEditorPlugin::_bind_methods() { @@ -116,7 +116,7 @@ BakedLightmapEditorPlugin::BakedLightmapEditorPlugin(EditorNode *p_node) { bake->hide(); bake->connect("pressed", this, "_bake"); add_control_to_container(CONTAINER_SPATIAL_EDITOR_MENU, bake); - lightmap = NULL; + lightmap = nullptr; BakedLightmap::bake_begin_function = bake_func_begin; BakedLightmap::bake_step_function = bake_func_step; diff --git a/editor/plugins/camera_editor_plugin.cpp b/editor/plugins/camera_3d_editor_plugin.cpp index 8726c8c552..8bc1374269 100644 --- a/editor/plugins/camera_editor_plugin.cpp +++ b/editor/plugins/camera_3d_editor_plugin.cpp @@ -1,5 +1,5 @@ /*************************************************************************/ -/* camera_editor_plugin.cpp */ +/* camera_3d_editor_plugin.cpp */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ @@ -28,45 +28,45 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#include "camera_editor_plugin.h" +#include "camera_3d_editor_plugin.h" -#include "spatial_editor_plugin.h" +#include "node_3d_editor_plugin.h" -void CameraEditor::_node_removed(Node *p_node) { +void Camera3DEditor::_node_removed(Node *p_node) { if (p_node == node) { - node = NULL; - SpatialEditor::get_singleton()->set_custom_camera(NULL); + node = nullptr; + Node3DEditor::get_singleton()->set_custom_camera(nullptr); hide(); } } -void CameraEditor::_pressed() { +void Camera3DEditor::_pressed() { - Node *sn = (node && preview->is_pressed()) ? node : NULL; - SpatialEditor::get_singleton()->set_custom_camera(sn); + Node *sn = (node && preview->is_pressed()) ? node : nullptr; + Node3DEditor::get_singleton()->set_custom_camera(sn); } -void CameraEditor::_bind_methods() { +void Camera3DEditor::_bind_methods() { } -void CameraEditor::edit(Node *p_camera) { +void Camera3DEditor::edit(Node *p_camera) { node = p_camera; if (!node) { preview->set_pressed(false); - SpatialEditor::get_singleton()->set_custom_camera(NULL); + Node3DEditor::get_singleton()->set_custom_camera(nullptr); } else { if (preview->is_pressed()) - SpatialEditor::get_singleton()->set_custom_camera(p_camera); + Node3DEditor::get_singleton()->set_custom_camera(p_camera); else - SpatialEditor::get_singleton()->set_custom_camera(NULL); + Node3DEditor::get_singleton()->set_custom_camera(nullptr); } } -CameraEditor::CameraEditor() { +Camera3DEditor::Camera3DEditor() { preview = memnew(Button); add_child(preview); @@ -79,30 +79,30 @@ CameraEditor::CameraEditor() { preview->set_margin(MARGIN_RIGHT, 0); preview->set_margin(MARGIN_TOP, 0); preview->set_margin(MARGIN_BOTTOM, 10); - preview->connect("pressed", callable_mp(this, &CameraEditor::_pressed)); + preview->connect("pressed", callable_mp(this, &Camera3DEditor::_pressed)); } -void CameraEditorPlugin::edit(Object *p_object) { +void Camera3DEditorPlugin::edit(Object *p_object) { - SpatialEditor::get_singleton()->set_can_preview(Object::cast_to<Camera>(p_object)); + Node3DEditor::get_singleton()->set_can_preview(Object::cast_to<Camera3D>(p_object)); //camera_editor->edit(Object::cast_to<Node>(p_object)); } -bool CameraEditorPlugin::handles(Object *p_object) const { +bool Camera3DEditorPlugin::handles(Object *p_object) const { - return p_object->is_class("Camera"); + return p_object->is_class("Camera3D"); } -void CameraEditorPlugin::make_visible(bool p_visible) { +void Camera3DEditorPlugin::make_visible(bool p_visible) { if (p_visible) { - //SpatialEditor::get_singleton()->set_can_preview(Object::cast_to<Camera>(p_object)); + //Node3DEditor::get_singleton()->set_can_preview(Object::cast_to<Camera3D>(p_object)); } else { - SpatialEditor::get_singleton()->set_can_preview(NULL); + Node3DEditor::get_singleton()->set_can_preview(nullptr); } } -CameraEditorPlugin::CameraEditorPlugin(EditorNode *p_node) { +Camera3DEditorPlugin::Camera3DEditorPlugin(EditorNode *p_node) { editor = p_node; /* camera_editor = memnew( CameraEditor ); @@ -120,5 +120,5 @@ CameraEditorPlugin::CameraEditorPlugin(EditorNode *p_node) { */ } -CameraEditorPlugin::~CameraEditorPlugin() { +Camera3DEditorPlugin::~Camera3DEditorPlugin() { } diff --git a/editor/plugins/camera_editor_plugin.h b/editor/plugins/camera_3d_editor_plugin.h index 9758a1ffbd..1e57ac7cd2 100644 --- a/editor/plugins/camera_editor_plugin.h +++ b/editor/plugins/camera_3d_editor_plugin.h @@ -1,5 +1,5 @@ /*************************************************************************/ -/* camera_editor_plugin.h */ +/* camera_3d_editor_plugin.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ @@ -33,11 +33,11 @@ #include "editor/editor_node.h" #include "editor/editor_plugin.h" -#include "scene/3d/camera.h" +#include "scene/3d/camera_3d.h" -class CameraEditor : public Control { +class Camera3DEditor : public Control { - GDCLASS(CameraEditor, Control); + GDCLASS(Camera3DEditor, Control); Panel *panel; Button *preview; @@ -51,25 +51,25 @@ protected: public: void edit(Node *p_camera); - CameraEditor(); + Camera3DEditor(); }; -class CameraEditorPlugin : public EditorPlugin { +class Camera3DEditorPlugin : public EditorPlugin { - GDCLASS(CameraEditorPlugin, EditorPlugin); + GDCLASS(Camera3DEditorPlugin, EditorPlugin); //CameraEditor *camera_editor; EditorNode *editor; public: - virtual String get_name() const { return "Camera"; } + virtual String get_name() const { return "Camera3D"; } bool has_main_screen() const { return false; } virtual void edit(Object *p_object); virtual bool handles(Object *p_object) const; virtual void make_visible(bool p_visible); - CameraEditorPlugin(EditorNode *p_node); - ~CameraEditorPlugin(); + Camera3DEditorPlugin(EditorNode *p_node); + ~Camera3DEditorPlugin(); }; #endif // CAMERA_EDITOR_PLUGIN_H diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index 9f66672f4a..cd3df08276 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -30,7 +30,7 @@ #include "canvas_item_editor_plugin.h" -#include "core/os/input.h" +#include "core/input/input_filter.h" #include "core/os/keyboard.h" #include "core/print_string.h" #include "core/project_settings.h" @@ -40,17 +40,17 @@ #include "editor/editor_settings.h" #include "editor/plugins/animation_player_editor_plugin.h" #include "editor/plugins/script_editor_plugin.h" +#include "scene/2d/gpu_particles_2d.h" #include "scene/2d/light_2d.h" -#include "scene/2d/particles_2d.h" #include "scene/2d/polygon_2d.h" #include "scene/2d/skeleton_2d.h" -#include "scene/2d/sprite.h" +#include "scene/2d/sprite_2d.h" #include "scene/2d/touch_screen_button.h" #include "scene/gui/grid_container.h" #include "scene/gui/nine_patch_rect.h" -#include "scene/gui/viewport_container.h" +#include "scene/gui/subviewport_container.h" #include "scene/main/canvas_layer.h" -#include "scene/main/viewport.h" +#include "scene/main/window.h" #include "scene/resources/packed_scene.h" #define MIN_ZOOM 0.01 @@ -99,7 +99,7 @@ public: label = memnew(Label); label->set_text(TTR("Grid Offset:")); child_container->add_child(label); - label->set_h_size_flags(SIZE_EXPAND_FILL); + label->set_h_size_flags(Control::SIZE_EXPAND_FILL); grid_offset_x = memnew(SpinBox); grid_offset_x->set_min(-SPIN_BOX_GRID_RANGE); @@ -107,7 +107,7 @@ public: grid_offset_x->set_allow_lesser(true); grid_offset_x->set_allow_greater(true); grid_offset_x->set_suffix("px"); - grid_offset_x->set_h_size_flags(SIZE_EXPAND_FILL); + grid_offset_x->set_h_size_flags(Control::SIZE_EXPAND_FILL); child_container->add_child(grid_offset_x); grid_offset_y = memnew(SpinBox); @@ -116,20 +116,20 @@ public: grid_offset_y->set_allow_lesser(true); grid_offset_y->set_allow_greater(true); grid_offset_y->set_suffix("px"); - grid_offset_y->set_h_size_flags(SIZE_EXPAND_FILL); + grid_offset_y->set_h_size_flags(Control::SIZE_EXPAND_FILL); child_container->add_child(grid_offset_y); label = memnew(Label); label->set_text(TTR("Grid Step:")); child_container->add_child(label); - label->set_h_size_flags(SIZE_EXPAND_FILL); + label->set_h_size_flags(Control::SIZE_EXPAND_FILL); grid_step_x = memnew(SpinBox); grid_step_x->set_min(0.01); grid_step_x->set_max(SPIN_BOX_GRID_RANGE); grid_step_x->set_allow_greater(true); grid_step_x->set_suffix("px"); - grid_step_x->set_h_size_flags(SIZE_EXPAND_FILL); + grid_step_x->set_h_size_flags(Control::SIZE_EXPAND_FILL); child_container->add_child(grid_step_x); grid_step_y = memnew(SpinBox); @@ -137,7 +137,7 @@ public: grid_step_y->set_max(SPIN_BOX_GRID_RANGE); grid_step_y->set_allow_greater(true); grid_step_y->set_suffix("px"); - grid_step_y->set_h_size_flags(SIZE_EXPAND_FILL); + grid_step_y->set_h_size_flags(Control::SIZE_EXPAND_FILL); child_container->add_child(grid_step_y); child_container = memnew(GridContainer); @@ -146,7 +146,7 @@ public: label = memnew(Label); label->set_text(TTR("Primary Line Every:")); - label->set_h_size_flags(SIZE_EXPAND_FILL); + label->set_h_size_flags(Control::SIZE_EXPAND_FILL); child_container->add_child(label); primary_grid_steps = memnew(SpinBox); @@ -155,7 +155,7 @@ public: primary_grid_steps->set_max(100); primary_grid_steps->set_allow_greater(true); primary_grid_steps->set_suffix(TTR("steps")); - primary_grid_steps->set_h_size_flags(SIZE_EXPAND_FILL); + primary_grid_steps->set_h_size_flags(Control::SIZE_EXPAND_FILL); child_container->add_child(primary_grid_steps); container->add_child(memnew(HSeparator)); @@ -169,25 +169,25 @@ public: label = memnew(Label); label->set_text(TTR("Rotation Offset:")); child_container->add_child(label); - label->set_h_size_flags(SIZE_EXPAND_FILL); + label->set_h_size_flags(Control::SIZE_EXPAND_FILL); rotation_offset = memnew(SpinBox); rotation_offset->set_min(-SPIN_BOX_ROTATION_RANGE); rotation_offset->set_max(SPIN_BOX_ROTATION_RANGE); rotation_offset->set_suffix("deg"); - rotation_offset->set_h_size_flags(SIZE_EXPAND_FILL); + rotation_offset->set_h_size_flags(Control::SIZE_EXPAND_FILL); child_container->add_child(rotation_offset); label = memnew(Label); label->set_text(TTR("Rotation Step:")); child_container->add_child(label); - label->set_h_size_flags(SIZE_EXPAND_FILL); + label->set_h_size_flags(Control::SIZE_EXPAND_FILL); rotation_step = memnew(SpinBox); rotation_step->set_min(-SPIN_BOX_ROTATION_RANGE); rotation_step->set_max(SPIN_BOX_ROTATION_RANGE); rotation_step->set_suffix("deg"); - rotation_step->set_h_size_flags(SIZE_EXPAND_FILL); + rotation_step->set_h_size_flags(Control::SIZE_EXPAND_FILL); child_container->add_child(rotation_step); container->add_child(memnew(HSeparator)); @@ -198,13 +198,13 @@ public: label = memnew(Label); label->set_text(TTR("Scale Step:")); child_container->add_child(label); - label->set_h_size_flags(SIZE_EXPAND_FILL); + label->set_h_size_flags(Control::SIZE_EXPAND_FILL); scale_step = memnew(SpinBox); scale_step->set_min(SPIN_BOX_SCALE_MIN); scale_step->set_max(SPIN_BOX_SCALE_MAX); scale_step->set_allow_greater(true); - scale_step->set_h_size_flags(SIZE_EXPAND_FILL); + scale_step->set_h_size_flags(Control::SIZE_EXPAND_FILL); scale_step->set_step(0.01f); child_container->add_child(scale_step); } @@ -334,7 +334,7 @@ Point2 CanvasItemEditor::snap_point(Point2 p_target, unsigned int p_modes, unsig snap_target[0] = SNAP_TARGET_NONE; snap_target[1] = SNAP_TARGET_NONE; - bool is_snap_active = smart_snap_active ^ Input::get_singleton()->is_key_pressed(KEY_CONTROL); + bool is_snap_active = smart_snap_active ^ InputFilter::get_singleton()->is_key_pressed(KEY_CONTROL); // Smart snap using the canvas position Vector2 output = p_target; @@ -462,7 +462,7 @@ Point2 CanvasItemEditor::snap_point(Point2 p_target, unsigned int p_modes, unsig } float CanvasItemEditor::snap_angle(float p_target, float p_start) const { - if (((smart_snap_active || snap_rotation) ^ Input::get_singleton()->is_key_pressed(KEY_CONTROL)) && snap_rotation_step != 0) { + if (((smart_snap_active || snap_rotation) ^ InputFilter::get_singleton()->is_key_pressed(KEY_CONTROL)) && snap_rotation_step != 0) { if (snap_relative) { return Math::stepify(p_target - snap_rotation_offset, snap_rotation_step) + snap_rotation_offset + (p_start - (int)(p_start / snap_rotation_step) * snap_rotation_step); } else { @@ -477,7 +477,7 @@ void CanvasItemEditor::_unhandled_key_input(const Ref<InputEvent> &p_ev) { Ref<InputEventKey> k = p_ev; - if (!is_visible_in_tree() || get_viewport()->gui_has_modal_stack()) + if (!is_visible_in_tree()) return; if (k->get_keycode() == KEY_CONTROL || k->get_keycode() == KEY_ALT || k->get_keycode() == KEY_SHIFT) { @@ -503,7 +503,7 @@ Object *CanvasItemEditor::_get_editor_data(Object *p_what) { CanvasItem *ci = Object::cast_to<CanvasItem>(p_what); if (!ci) - return NULL; + return nullptr; return memnew(CanvasItemEditorSelectedItem); } @@ -667,7 +667,7 @@ void CanvasItemEditor::_get_bones_at_pos(const Point2 &p_pos, Vector<_SelectResu Node2D *from_node = Object::cast_to<Node2D>(ObjectDB::get_instance(E->key().from)); Vector<Vector2> bone_shape; - if (!_get_bone_shape(&bone_shape, NULL, E)) + if (!_get_bone_shape(&bone_shape, nullptr, E)) continue; // Check if the point is inside the Polygon2D @@ -1284,7 +1284,7 @@ bool CanvasItemEditor::_gui_input_zoom_or_pan(const Ref<InputEvent> &p_event, bo // Pan the viewport Point2i relative; if (bool(EditorSettings::get_singleton()->get("editors/2d/warped_mouse_panning"))) { - relative = Input::get_singleton()->warp_mouse_motion(m, viewport->get_global_rect()); + relative = InputFilter::get_singleton()->warp_mouse_motion(m, viewport->get_global_rect()); } else { relative = m->get_relative(); } @@ -1343,7 +1343,7 @@ bool CanvasItemEditor::_gui_input_pivot(const Ref<InputEvent> &p_event) { if (drag_selection.size() == 1) { new_pos = snap_point(drag_from, SNAP_NODE_SIDES | SNAP_NODE_CENTER | SNAP_NODE_ANCHORS | SNAP_OTHER_NODES | SNAP_GRID | SNAP_PIXEL, 0, drag_selection[0]); } else { - new_pos = snap_point(drag_from, SNAP_OTHER_NODES | SNAP_GRID | SNAP_PIXEL, 0, NULL, drag_selection); + new_pos = snap_point(drag_from, SNAP_OTHER_NODES | SNAP_GRID | SNAP_PIXEL, 0, nullptr, drag_selection); } for (List<CanvasItem *>::Element *E = drag_selection.front(); E; E = E->next()) { CanvasItem *canvas_item = E->get(); @@ -1912,13 +1912,14 @@ bool CanvasItemEditor::_gui_input_scale(const Ref<InputEvent> &p_event) { Transform2D simple_xform = (viewport->get_transform() * unscaled_transform).affine_inverse() * transform; bool uniform = m->get_shift(); - bool is_ctrl = Input::get_singleton()->is_key_pressed(KEY_CONTROL); + bool is_ctrl = InputFilter::get_singleton()->is_key_pressed(KEY_CONTROL); Point2 drag_from_local = simple_xform.xform(drag_from); Point2 drag_to_local = simple_xform.xform(drag_to); Point2 offset = drag_to_local - drag_from_local; Size2 scale = canvas_item->call("get_scale"); + Size2 original_scale = scale; float ratio = scale.y / scale.x; if (drag_type == DRAG_SCALE_BOTH) { Size2 scale_factor = drag_to_local / drag_from_local; @@ -1931,6 +1932,7 @@ bool CanvasItemEditor::_gui_input_scale(const Ref<InputEvent> &p_event) { Size2 scale_factor = Vector2(offset.x, -offset.y) / SCALE_HANDLE_DISTANCE; Size2 parent_scale = parent_xform.get_scale(); scale_factor *= Vector2(1.0 / parent_scale.x, 1.0 / parent_scale.y); + if (drag_type == DRAG_SCALE_X) { scale.x += scale_factor.x; if (uniform) { @@ -1945,8 +1947,13 @@ bool CanvasItemEditor::_gui_input_scale(const Ref<InputEvent> &p_event) { } if (snap_scale && !is_ctrl) { - scale.x = roundf(scale.x / snap_scale_step) * snap_scale_step; - scale.y = roundf(scale.y / snap_scale_step) * snap_scale_step; + if (snap_relative) { + scale.x = original_scale.x * (roundf((scale.x / original_scale.x) / snap_scale_step) * snap_scale_step); + scale.y = original_scale.y * (roundf((scale.y / original_scale.y) / snap_scale_step) * snap_scale_step); + } else { + scale.x = roundf(scale.x / snap_scale_step) * snap_scale_step; + scale.y = roundf(scale.y / snap_scale_step) * snap_scale_step; + } } canvas_item->call("set_scale", scale); @@ -2031,7 +2038,7 @@ bool CanvasItemEditor::_gui_input_move(const Ref<InputEvent> &p_event) { Vector<List<Dictionary>> all_bones_ik_states; for (List<CanvasItem *>::Element *E = drag_selection.front(); E; E = E->next()) { List<Dictionary> bones_ik_states; - _save_canvas_item_ik_chain(E->get(), NULL, &bones_ik_states); + _save_canvas_item_ik_chain(E->get(), nullptr, &bones_ik_states); all_bones_ik_states.push_back(bones_ik_states); } @@ -2046,7 +2053,7 @@ bool CanvasItemEditor::_gui_input_move(const Ref<InputEvent> &p_event) { previous_pos = _get_encompassing_rect_from_list(drag_selection).position; } - Point2 new_pos = snap_point(previous_pos + (drag_to - drag_from), SNAP_GRID | SNAP_GUIDES | SNAP_PIXEL | SNAP_NODE_PARENT | SNAP_NODE_ANCHORS | SNAP_OTHER_NODES, 0, NULL, drag_selection); + Point2 new_pos = snap_point(previous_pos + (drag_to - drag_from), SNAP_GRID | SNAP_GUIDES | SNAP_PIXEL | SNAP_NODE_PARENT | SNAP_NODE_ANCHORS | SNAP_OTHER_NODES, 0, nullptr, drag_selection); if (drag_type == DRAG_MOVE_X) { new_pos.y = previous_pos.y; @@ -2133,7 +2140,7 @@ bool CanvasItemEditor::_gui_input_move(const Ref<InputEvent> &p_event) { Vector<List<Dictionary>> all_bones_ik_states; for (List<CanvasItem *>::Element *E = drag_selection.front(); E; E = E->next()) { List<Dictionary> bones_ik_states; - _save_canvas_item_ik_chain(E->get(), NULL, &bones_ik_states); + _save_canvas_item_ik_chain(E->get(), nullptr, &bones_ik_states); all_bones_ik_states.push_back(bones_ik_states); } @@ -2207,10 +2214,10 @@ bool CanvasItemEditor::_gui_input_move(const Ref<InputEvent> &p_event) { if (k.is_valid() && !k->is_pressed() && drag_type == DRAG_KEY_MOVE && tool == TOOL_SELECT && (k->get_keycode() == KEY_UP || k->get_keycode() == KEY_DOWN || k->get_keycode() == KEY_LEFT || k->get_keycode() == KEY_RIGHT)) { // Confirm canvas items move by arrow keys - if ((!Input::get_singleton()->is_key_pressed(KEY_UP)) && - (!Input::get_singleton()->is_key_pressed(KEY_DOWN)) && - (!Input::get_singleton()->is_key_pressed(KEY_LEFT)) && - (!Input::get_singleton()->is_key_pressed(KEY_RIGHT))) { + if ((!InputFilter::get_singleton()->is_key_pressed(KEY_UP)) && + (!InputFilter::get_singleton()->is_key_pressed(KEY_DOWN)) && + (!InputFilter::get_singleton()->is_key_pressed(KEY_LEFT)) && + (!InputFilter::get_singleton()->is_key_pressed(KEY_RIGHT))) { _commit_canvas_item_state(drag_selection, TTR("Move CanvasItem"), true); drag_type = DRAG_NONE; } @@ -2284,7 +2291,7 @@ bool CanvasItemEditor::_gui_input_select(const Ref<InputEvent> &p_event) { } selection_menu_additive_selection = b->get_shift(); - selection_menu->set_global_position(b->get_global_position()); + selection_menu->set_position(get_screen_transform().xform(b->get_position())); selection_menu->popup(); return true; } @@ -2299,7 +2306,7 @@ bool CanvasItemEditor::_gui_input_select(const Ref<InputEvent> &p_event) { return true; // Find the item to select - CanvasItem *canvas_item = NULL; + CanvasItem *canvas_item = nullptr; // Retrieve the bones Vector<_SelectResult> selection = Vector<_SelectResult>(); @@ -2588,9 +2595,9 @@ void CanvasItemEditor::_gui_input_viewport(const Ref<InputEvent> &p_event) { } void CanvasItemEditor::_draw_text_at_position(Point2 p_position, String p_string, Margin p_side) { - Color color = get_color("font_color", "Editor"); + Color color = get_theme_color("font_color", "Editor"); color.a = 0.8; - Ref<Font> font = get_font("font", "Label"); + Ref<Font> font = get_theme_font("font", "Label"); Size2 text_size = font->get_string_size(p_string); switch (p_side) { case MARGIN_LEFT: @@ -2626,7 +2633,7 @@ void CanvasItemEditor::_draw_percentage_at_position(float p_value, Point2 p_posi void CanvasItemEditor::_draw_focus() { // Draw the focus around the base viewport if (viewport->has_focus()) { - get_stylebox("Focus", "EditorStyles")->draw(viewport->get_canvas_item(), Rect2(Point2(), viewport->get_size())); + get_theme_stylebox("Focus", "EditorStyles")->draw(viewport->get_canvas_item(), Rect2(Point2(), viewport->get_size())); } } @@ -2657,18 +2664,18 @@ void CanvasItemEditor::_draw_guides() { } // Dragged guide - Color text_color = get_color("font_color", "Editor"); + Color text_color = get_theme_color("font_color", "Editor"); text_color.a = 0.5; if (drag_type == DRAG_DOUBLE_GUIDE || drag_type == DRAG_V_GUIDE) { String str = vformat("%d px", Math::round(xform.affine_inverse().xform(dragged_guide_pos).x)); - Ref<Font> font = get_font("font", "Label"); + Ref<Font> font = get_theme_font("font", "Label"); Size2 text_size = font->get_string_size(str); viewport->draw_string(font, Point2(dragged_guide_pos.x + 10, RULER_WIDTH + text_size.y / 2 + 10), str, text_color); viewport->draw_line(Point2(dragged_guide_pos.x, 0), Point2(dragged_guide_pos.x, viewport->get_size().y), guide_color, Math::round(EDSCALE)); } if (drag_type == DRAG_DOUBLE_GUIDE || drag_type == DRAG_H_GUIDE) { String str = vformat("%d px", Math::round(xform.affine_inverse().xform(dragged_guide_pos).y)); - Ref<Font> font = get_font("font", "Label"); + Ref<Font> font = get_theme_font("font", "Label"); Size2 text_size = font->get_string_size(str); viewport->draw_string(font, Point2(RULER_WIDTH + 10, dragged_guide_pos.y + text_size.y / 2 + 10), str, text_color); viewport->draw_line(Point2(0, dragged_guide_pos.y), Point2(viewport->get_size().x, dragged_guide_pos.y), guide_color, Math::round(EDSCALE)); @@ -2690,11 +2697,11 @@ void CanvasItemEditor::_draw_smart_snapping() { } void CanvasItemEditor::_draw_rulers() { - Color bg_color = get_color("dark_color_2", "Editor"); - Color graduation_color = get_color("font_color", "Editor").linear_interpolate(bg_color, 0.5); - Color font_color = get_color("font_color", "Editor"); + Color bg_color = get_theme_color("dark_color_2", "Editor"); + Color graduation_color = get_theme_color("font_color", "Editor").linear_interpolate(bg_color, 0.5); + Color font_color = get_theme_color("font_color", "Editor"); font_color.a = 0.8; - Ref<Font> font = get_font("rulers", "EditorFonts"); + Ref<Font> font = get_theme_font("rulers", "EditorFonts"); // The rule transform Transform2D ruler_transform = Transform2D(); @@ -2856,7 +2863,7 @@ void CanvasItemEditor::_draw_ruler_tool() { return; if (ruler_tool_active) { - Color ruler_primary_color = get_color("accent_color", "Editor"); + Color ruler_primary_color = get_theme_color("accent_color", "Editor"); Color ruler_secondary_color = ruler_primary_color; ruler_secondary_color.a = 0.5; @@ -2873,8 +2880,8 @@ void CanvasItemEditor::_draw_ruler_tool() { viewport->draw_line(corner, end, ruler_secondary_color, Math::round(EDSCALE)); } - Ref<Font> font = get_font("bold", "EditorFonts"); - Color font_color = get_color("font_color", "Editor"); + Ref<Font> font = get_theme_font("bold", "EditorFonts"); + Color font_color = get_theme_color("font_color", "Editor"); Color font_secondary_color = font_color; font_secondary_color.a = 0.5; float text_height = font->get_height(); @@ -2974,8 +2981,8 @@ void CanvasItemEditor::_draw_ruler_tool() { } else { if (grid_snap_active) { - Ref<Texture2D> position_icon = get_icon("EditorPosition", "EditorIcons"); - viewport->draw_texture(get_icon("EditorPosition", "EditorIcons"), (ruler_tool_origin - view_offset) * zoom - position_icon->get_size() / 2); + Ref<Texture2D> position_icon = get_theme_icon("EditorPosition", "EditorIcons"); + viewport->draw_texture(get_theme_icon("EditorPosition", "EditorIcons"), (ruler_tool_origin - view_offset) * zoom - position_icon->get_size() / 2); } } } @@ -3187,19 +3194,21 @@ void CanvasItemEditor::_draw_control_helpers(Control *control) { } void CanvasItemEditor::_draw_selection() { - Ref<Texture2D> pivot_icon = get_icon("EditorPivot", "EditorIcons"); - Ref<Texture2D> position_icon = get_icon("EditorPosition", "EditorIcons"); - Ref<Texture2D> previous_position_icon = get_icon("EditorPositionPrevious", "EditorIcons"); + Ref<Texture2D> pivot_icon = get_theme_icon("EditorPivot", "EditorIcons"); + Ref<Texture2D> position_icon = get_theme_icon("EditorPosition", "EditorIcons"); + Ref<Texture2D> previous_position_icon = get_theme_icon("EditorPositionPrevious", "EditorIcons"); RID ci = viewport->get_canvas_item(); - List<CanvasItem *> selection = _get_edited_canvas_items(false, false); + List<CanvasItem *> selection = _get_edited_canvas_items(true, false); bool single = selection.size() == 1; for (List<CanvasItem *>::Element *E = selection.front(); E; E = E->next()) { CanvasItem *canvas_item = Object::cast_to<CanvasItem>(E->get()); CanvasItemEditorSelectedItem *se = editor_selection->get_node_editor_data<CanvasItemEditorSelectedItem>(canvas_item); + bool item_locked = canvas_item->has_meta("_edit_lock_"); + // Draw the previous position if we are dragging the node if (show_helpers && (drag_type == DRAG_MOVE || drag_type == DRAG_ROTATE || @@ -3239,6 +3248,10 @@ void CanvasItemEditor::_draw_selection() { Color c = Color(1, 0.6, 0.4, 0.7); + if (item_locked) { + c = Color(0.7, 0.7, 0.7, 0.7); + } + for (int i = 0; i < 4; i++) { viewport->draw_line(endpoints[i], endpoints[(i + 1) % 4], c, Math::round(2 * EDSCALE)); } @@ -3251,7 +3264,7 @@ void CanvasItemEditor::_draw_selection() { viewport->draw_set_transform_matrix(viewport->get_transform()); } - if (single && (tool == TOOL_SELECT || tool == TOOL_MOVE || tool == TOOL_SCALE || tool == TOOL_ROTATE || tool == TOOL_EDIT_PIVOT)) { //kind of sucks + if (single && !item_locked && (tool == TOOL_SELECT || tool == TOOL_MOVE || tool == TOOL_SCALE || tool == TOOL_ROTATE || tool == TOOL_EDIT_PIVOT)) { //kind of sucks // Draw the pivot if (canvas_item->_edit_use_pivot()) { @@ -3297,8 +3310,8 @@ void CanvasItemEditor::_draw_selection() { } // Draw the move handles - bool is_ctrl = Input::get_singleton()->is_key_pressed(KEY_CONTROL); - bool is_alt = Input::get_singleton()->is_key_pressed(KEY_ALT); + bool is_ctrl = InputFilter::get_singleton()->is_key_pressed(KEY_CONTROL); + bool is_alt = InputFilter::get_singleton()->is_key_pressed(KEY_ALT); if (tool == TOOL_MOVE && show_transformation_gizmos) { if (_is_node_movable(canvas_item)) { Transform2D unscaled_transform = (xform * canvas_item->get_transform().affine_inverse() * canvas_item->_edit_get_transform()).orthonormalized(); @@ -3312,16 +3325,16 @@ void CanvasItemEditor::_draw_selection() { points.push_back(Vector2(move_factor.x * EDSCALE, -5 * EDSCALE)); points.push_back(Vector2((move_factor.x + 10) * EDSCALE, 0)); - viewport->draw_colored_polygon(points, get_color("axis_x_color", "Editor")); - viewport->draw_line(Point2(), Point2(move_factor.x * EDSCALE, 0), get_color("axis_x_color", "Editor"), Math::round(EDSCALE)); + viewport->draw_colored_polygon(points, get_theme_color("axis_x_color", "Editor")); + viewport->draw_line(Point2(), Point2(move_factor.x * EDSCALE, 0), get_theme_color("axis_x_color", "Editor"), Math::round(EDSCALE)); points.clear(); points.push_back(Vector2(5 * EDSCALE, move_factor.y * EDSCALE)); points.push_back(Vector2(-5 * EDSCALE, move_factor.y * EDSCALE)); points.push_back(Vector2(0, (move_factor.y + 10) * EDSCALE)); - viewport->draw_colored_polygon(points, get_color("axis_y_color", "Editor")); - viewport->draw_line(Point2(), Point2(0, move_factor.y * EDSCALE), get_color("axis_y_color", "Editor"), Math::round(EDSCALE)); + viewport->draw_colored_polygon(points, get_theme_color("axis_y_color", "Editor")); + viewport->draw_line(Point2(), Point2(0, move_factor.y * EDSCALE), get_theme_color("axis_y_color", "Editor"), Math::round(EDSCALE)); viewport->draw_set_transform_matrix(viewport->get_transform()); } @@ -3334,7 +3347,7 @@ void CanvasItemEditor::_draw_selection() { Transform2D simple_xform = viewport->get_transform() * unscaled_transform; Size2 scale_factor = Size2(SCALE_HANDLE_DISTANCE, SCALE_HANDLE_DISTANCE); - bool uniform = Input::get_singleton()->is_key_pressed(KEY_SHIFT); + bool uniform = InputFilter::get_singleton()->is_key_pressed(KEY_SHIFT); Point2 offset = (simple_xform.affine_inverse().xform(drag_to) - simple_xform.affine_inverse().xform(drag_from)) * zoom; if (drag_type == DRAG_SCALE_X) { @@ -3351,12 +3364,12 @@ void CanvasItemEditor::_draw_selection() { viewport->draw_set_transform_matrix(simple_xform); Rect2 x_handle_rect = Rect2(scale_factor.x * EDSCALE, -5 * EDSCALE, 10 * EDSCALE, 10 * EDSCALE); - viewport->draw_rect(x_handle_rect, get_color("axis_x_color", "Editor")); - viewport->draw_line(Point2(), Point2(scale_factor.x * EDSCALE, 0), get_color("axis_x_color", "Editor"), Math::round(EDSCALE)); + viewport->draw_rect(x_handle_rect, get_theme_color("axis_x_color", "Editor")); + viewport->draw_line(Point2(), Point2(scale_factor.x * EDSCALE, 0), get_theme_color("axis_x_color", "Editor"), Math::round(EDSCALE)); Rect2 y_handle_rect = Rect2(-5 * EDSCALE, scale_factor.y * EDSCALE, 10 * EDSCALE, 10 * EDSCALE); - viewport->draw_rect(y_handle_rect, get_color("axis_y_color", "Editor")); - viewport->draw_line(Point2(), Point2(0, scale_factor.y * EDSCALE), get_color("axis_y_color", "Editor"), Math::round(EDSCALE)); + viewport->draw_rect(y_handle_rect, get_theme_color("axis_y_color", "Editor")); + viewport->draw_line(Point2(), Point2(0, scale_factor.y * EDSCALE), get_theme_color("axis_y_color", "Editor"), Math::round(EDSCALE)); viewport->draw_set_transform_matrix(viewport->get_transform()); } @@ -3371,11 +3384,11 @@ void CanvasItemEditor::_draw_selection() { viewport->draw_rect( Rect2(bsfrom, bsto - bsfrom), - get_color("box_selection_fill_color", "Editor")); + get_theme_color("box_selection_fill_color", "Editor")); viewport->draw_rect( Rect2(bsfrom, bsto - bsfrom), - get_color("box_selection_stroke_color", "Editor"), + get_theme_color("box_selection_stroke_color", "Editor"), false, Math::round(EDSCALE)); } @@ -3385,7 +3398,7 @@ void CanvasItemEditor::_draw_selection() { viewport->draw_line( transform.xform(drag_rotation_center), transform.xform(drag_to), - get_color("accent_color", "Editor") * Color(1, 1, 1, 0.6), + get_theme_color("accent_color", "Editor") * Color(1, 1, 1, 0.6), Math::round(2 * EDSCALE)); } } @@ -3427,7 +3440,7 @@ void CanvasItemEditor::_draw_straight_line(Point2 p_from, Point2 p_to, Color p_c } } if (points.size() >= 2) { - VisualServer::get_singleton()->canvas_item_add_line(ci, points[0], points[1], p_color); + RenderingServer::get_singleton()->canvas_item_add_line(ci, points[0], points[1], p_color); } } @@ -3435,8 +3448,8 @@ void CanvasItemEditor::_draw_axis() { if (show_origin) { - _draw_straight_line(Point2(), Point2(1, 0), get_color("axis_x_color", "Editor") * Color(1, 1, 1, 0.75)); - _draw_straight_line(Point2(), Point2(0, 1), get_color("axis_y_color", "Editor") * Color(1, 1, 1, 0.75)); + _draw_straight_line(Point2(), Point2(1, 0), get_theme_color("axis_x_color", "Editor") * Color(1, 1, 1, 0.75)); + _draw_straight_line(Point2(), Point2(0, 1), get_theme_color("axis_y_color", "Editor") * Color(1, 1, 1, 0.75)); } if (show_viewport) { @@ -3455,7 +3468,7 @@ void CanvasItemEditor::_draw_axis() { }; for (int i = 0; i < 4; i++) { - VisualServer::get_singleton()->canvas_item_add_line(ci, screen_endpoints[i], screen_endpoints[(i + 1) % 4], area_axis_color); + RenderingServer::get_singleton()->canvas_item_add_line(ci, screen_endpoints[i], screen_endpoints[(i + 1) % 4], area_axis_color); } } } @@ -3512,8 +3525,8 @@ void CanvasItemEditor::_draw_bones() { outline_colors.push_back(bone_outline_color); } - VisualServer::get_singleton()->canvas_item_add_polygon(ci, bone_shape_outline, outline_colors); - VisualServer::get_singleton()->canvas_item_add_primitive(ci, bone_shape, colors, Vector<Vector2>(), RID()); + RenderingServer::get_singleton()->canvas_item_add_polygon(ci, bone_shape_outline, outline_colors); + RenderingServer::get_singleton()->canvas_item_add_primitive(ci, bone_shape, colors, Vector<Vector2>(), RID()); } } } @@ -3547,7 +3560,7 @@ void CanvasItemEditor::_draw_invisible_nodes_positions(Node *p_node, const Trans Transform2D xform = transform * canvas_xform * parent_xform; // Draw the node's position - Ref<Texture2D> position_icon = get_icon("EditorPositionUnselected", "EditorIcons"); + Ref<Texture2D> position_icon = get_theme_icon("EditorPositionUnselected", "EditorIcons"); Transform2D unscaled_transform = (xform * canvas_item->get_transform().affine_inverse() * canvas_item->_edit_get_transform()).orthonormalized(); Transform2D simple_xform = viewport->get_transform() * unscaled_transform; viewport->draw_set_transform_matrix(simple_xform); @@ -3564,7 +3577,7 @@ void CanvasItemEditor::_draw_hover() { Ref<Texture2D> node_icon = hovering_results[i].icon; String node_name = hovering_results[i].name; - Ref<Font> font = get_font("font", "Label"); + Ref<Font> font = get_theme_font("font", "Label"); Size2 node_name_size = font->get_string_size(node_name); Size2 item_size = Size2(node_icon->get_size().x + 4 + node_name_size.x, MAX(node_icon->get_size().y, node_name_size.y - 3)); @@ -3615,13 +3628,13 @@ void CanvasItemEditor::_draw_locks_and_groups(Node *p_node, const Transform2D &p if (canvas_item) { float offset = 0; - Ref<Texture2D> lock = get_icon("LockViewport", "EditorIcons"); + Ref<Texture2D> lock = get_theme_icon("LockViewport", "EditorIcons"); if (p_node->has_meta("_edit_lock_") && show_edit_locks) { lock->draw(viewport_canvas_item, (transform * canvas_xform * parent_xform).xform(Point2(0, 0)) + Point2(offset, 0)); offset += lock->get_size().x; } - Ref<Texture2D> group = get_icon("GroupViewport", "EditorIcons"); + Ref<Texture2D> group = get_theme_icon("GroupViewport", "EditorIcons"); if (canvas_item->has_meta("_edit_group_") && show_edit_locks) { group->draw(viewport_canvas_item, (transform * canvas_xform * parent_xform).xform(Point2(0, 0)) + Point2(offset, 0)); //offset += group->get_size().x; @@ -3744,7 +3757,7 @@ void CanvasItemEditor::_draw_viewport() { } RID ci = viewport->get_canvas_item(); - VisualServer::get_singleton()->canvas_item_add_set_transform(ci, Transform2D()); + RenderingServer::get_singleton()->canvas_item_add_set_transform(ci, Transform2D()); EditorPluginList *over_plugin_list = editor->get_editor_plugins_over(); if (!over_plugin_list->empty()) { @@ -3893,7 +3906,7 @@ void CanvasItemEditor::_notification(int p_what) { if (p_what == NOTIFICATION_ENTER_TREE) { - select_sb->set_texture(get_icon("EditorRect2D", "EditorIcons")); + select_sb->set_texture(get_theme_icon("EditorRect2D", "EditorIcons")); for (int i = 0; i < 4; i++) { select_sb->set_margin_size(Margin(i), 4); select_sb->set_default_margin(Margin(i), 4); @@ -3906,7 +3919,7 @@ void CanvasItemEditor::_notification(int p_what) { } else if (p_what == EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED) { - select_sb->set_texture(get_icon("EditorRect2D", "EditorIcons")); + select_sb->set_texture(get_theme_icon("EditorRect2D", "EditorIcons")); } if (p_what == NOTIFICATION_EXIT_TREE) { @@ -3915,85 +3928,85 @@ void CanvasItemEditor::_notification(int p_what) { } if (p_what == NOTIFICATION_ENTER_TREE || p_what == EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED) { - select_button->set_icon(get_icon("ToolSelect", "EditorIcons")); - list_select_button->set_icon(get_icon("ListSelect", "EditorIcons")); - move_button->set_icon(get_icon("ToolMove", "EditorIcons")); - scale_button->set_icon(get_icon("ToolScale", "EditorIcons")); - rotate_button->set_icon(get_icon("ToolRotate", "EditorIcons")); - smart_snap_button->set_icon(get_icon("Snap", "EditorIcons")); - grid_snap_button->set_icon(get_icon("SnapGrid", "EditorIcons")); - snap_config_menu->set_icon(get_icon("GuiTabMenu", "EditorIcons")); - skeleton_menu->set_icon(get_icon("Bone", "EditorIcons")); - override_camera_button->set_icon(get_icon("Camera2D", "EditorIcons")); - pan_button->set_icon(get_icon("ToolPan", "EditorIcons")); - ruler_button->set_icon(get_icon("Ruler", "EditorIcons")); - pivot_button->set_icon(get_icon("EditPivot", "EditorIcons")); - select_handle = get_icon("EditorHandle", "EditorIcons"); - anchor_handle = get_icon("EditorControlAnchor", "EditorIcons"); - lock_button->set_icon(get_icon("Lock", "EditorIcons")); - unlock_button->set_icon(get_icon("Unlock", "EditorIcons")); - group_button->set_icon(get_icon("Group", "EditorIcons")); - ungroup_button->set_icon(get_icon("Ungroup", "EditorIcons")); - key_loc_button->set_icon(get_icon("KeyPosition", "EditorIcons")); - key_rot_button->set_icon(get_icon("KeyRotation", "EditorIcons")); - key_scale_button->set_icon(get_icon("KeyScale", "EditorIcons")); - key_insert_button->set_icon(get_icon("Key", "EditorIcons")); - key_auto_insert_button->set_icon(get_icon("AutoKey", "EditorIcons")); - animation_menu->set_icon(get_icon("GuiTabMenu", "EditorIcons")); - - zoom_minus->set_icon(get_icon("ZoomLess", "EditorIcons")); - zoom_plus->set_icon(get_icon("ZoomMore", "EditorIcons")); - - presets_menu->set_icon(get_icon("ControlLayout", "EditorIcons")); + select_button->set_icon(get_theme_icon("ToolSelect", "EditorIcons")); + list_select_button->set_icon(get_theme_icon("ListSelect", "EditorIcons")); + move_button->set_icon(get_theme_icon("ToolMove", "EditorIcons")); + scale_button->set_icon(get_theme_icon("ToolScale", "EditorIcons")); + rotate_button->set_icon(get_theme_icon("ToolRotate", "EditorIcons")); + smart_snap_button->set_icon(get_theme_icon("Snap", "EditorIcons")); + grid_snap_button->set_icon(get_theme_icon("SnapGrid", "EditorIcons")); + snap_config_menu->set_icon(get_theme_icon("GuiTabMenu", "EditorIcons")); + skeleton_menu->set_icon(get_theme_icon("Bone", "EditorIcons")); + override_camera_button->set_icon(get_theme_icon("Camera2D", "EditorIcons")); + pan_button->set_icon(get_theme_icon("ToolPan", "EditorIcons")); + ruler_button->set_icon(get_theme_icon("Ruler", "EditorIcons")); + pivot_button->set_icon(get_theme_icon("EditPivot", "EditorIcons")); + select_handle = get_theme_icon("EditorHandle", "EditorIcons"); + anchor_handle = get_theme_icon("EditorControlAnchor", "EditorIcons"); + lock_button->set_icon(get_theme_icon("Lock", "EditorIcons")); + unlock_button->set_icon(get_theme_icon("Unlock", "EditorIcons")); + group_button->set_icon(get_theme_icon("Group", "EditorIcons")); + ungroup_button->set_icon(get_theme_icon("Ungroup", "EditorIcons")); + key_loc_button->set_icon(get_theme_icon("KeyPosition", "EditorIcons")); + key_rot_button->set_icon(get_theme_icon("KeyRotation", "EditorIcons")); + key_scale_button->set_icon(get_theme_icon("KeyScale", "EditorIcons")); + key_insert_button->set_icon(get_theme_icon("Key", "EditorIcons")); + key_auto_insert_button->set_icon(get_theme_icon("AutoKey", "EditorIcons")); + animation_menu->set_icon(get_theme_icon("GuiTabMenu", "EditorIcons")); + + zoom_minus->set_icon(get_theme_icon("ZoomLess", "EditorIcons")); + zoom_plus->set_icon(get_theme_icon("ZoomMore", "EditorIcons")); + + presets_menu->set_icon(get_theme_icon("ControlLayout", "EditorIcons")); PopupMenu *p = presets_menu->get_popup(); p->clear(); - p->add_icon_item(get_icon("ControlAlignTopLeft", "EditorIcons"), TTR("Top Left"), ANCHORS_AND_MARGINS_PRESET_TOP_LEFT); - p->add_icon_item(get_icon("ControlAlignTopRight", "EditorIcons"), TTR("Top Right"), ANCHORS_AND_MARGINS_PRESET_TOP_RIGHT); - p->add_icon_item(get_icon("ControlAlignBottomRight", "EditorIcons"), TTR("Bottom Right"), ANCHORS_AND_MARGINS_PRESET_BOTTOM_RIGHT); - p->add_icon_item(get_icon("ControlAlignBottomLeft", "EditorIcons"), TTR("Bottom Left"), ANCHORS_AND_MARGINS_PRESET_BOTTOM_LEFT); + p->add_icon_item(get_theme_icon("ControlAlignTopLeft", "EditorIcons"), TTR("Top Left"), ANCHORS_AND_MARGINS_PRESET_TOP_LEFT); + p->add_icon_item(get_theme_icon("ControlAlignTopRight", "EditorIcons"), TTR("Top Right"), ANCHORS_AND_MARGINS_PRESET_TOP_RIGHT); + p->add_icon_item(get_theme_icon("ControlAlignBottomRight", "EditorIcons"), TTR("Bottom Right"), ANCHORS_AND_MARGINS_PRESET_BOTTOM_RIGHT); + p->add_icon_item(get_theme_icon("ControlAlignBottomLeft", "EditorIcons"), TTR("Bottom Left"), ANCHORS_AND_MARGINS_PRESET_BOTTOM_LEFT); p->add_separator(); - p->add_icon_item(get_icon("ControlAlignLeftCenter", "EditorIcons"), TTR("Center Left"), ANCHORS_AND_MARGINS_PRESET_CENTER_LEFT); - p->add_icon_item(get_icon("ControlAlignTopCenter", "EditorIcons"), TTR("Center Top"), ANCHORS_AND_MARGINS_PRESET_CENTER_TOP); - p->add_icon_item(get_icon("ControlAlignRightCenter", "EditorIcons"), TTR("Center Right"), ANCHORS_AND_MARGINS_PRESET_CENTER_RIGHT); - p->add_icon_item(get_icon("ControlAlignBottomCenter", "EditorIcons"), TTR("Center Bottom"), ANCHORS_AND_MARGINS_PRESET_CENTER_BOTTOM); - p->add_icon_item(get_icon("ControlAlignCenter", "EditorIcons"), TTR("Center"), ANCHORS_AND_MARGINS_PRESET_CENTER); + p->add_icon_item(get_theme_icon("ControlAlignLeftCenter", "EditorIcons"), TTR("Center Left"), ANCHORS_AND_MARGINS_PRESET_CENTER_LEFT); + p->add_icon_item(get_theme_icon("ControlAlignTopCenter", "EditorIcons"), TTR("Center Top"), ANCHORS_AND_MARGINS_PRESET_CENTER_TOP); + p->add_icon_item(get_theme_icon("ControlAlignRightCenter", "EditorIcons"), TTR("Center Right"), ANCHORS_AND_MARGINS_PRESET_CENTER_RIGHT); + p->add_icon_item(get_theme_icon("ControlAlignBottomCenter", "EditorIcons"), TTR("Center Bottom"), ANCHORS_AND_MARGINS_PRESET_CENTER_BOTTOM); + p->add_icon_item(get_theme_icon("ControlAlignCenter", "EditorIcons"), TTR("Center"), ANCHORS_AND_MARGINS_PRESET_CENTER); p->add_separator(); - p->add_icon_item(get_icon("ControlAlignLeftWide", "EditorIcons"), TTR("Left Wide"), ANCHORS_AND_MARGINS_PRESET_LEFT_WIDE); - p->add_icon_item(get_icon("ControlAlignTopWide", "EditorIcons"), TTR("Top Wide"), ANCHORS_AND_MARGINS_PRESET_TOP_WIDE); - p->add_icon_item(get_icon("ControlAlignRightWide", "EditorIcons"), TTR("Right Wide"), ANCHORS_AND_MARGINS_PRESET_RIGHT_WIDE); - p->add_icon_item(get_icon("ControlAlignBottomWide", "EditorIcons"), TTR("Bottom Wide"), ANCHORS_AND_MARGINS_PRESET_BOTTOM_WIDE); - p->add_icon_item(get_icon("ControlVcenterWide", "EditorIcons"), TTR("VCenter Wide"), ANCHORS_AND_MARGINS_PRESET_VCENTER_WIDE); - p->add_icon_item(get_icon("ControlHcenterWide", "EditorIcons"), TTR("HCenter Wide"), ANCHORS_AND_MARGINS_PRESET_HCENTER_WIDE); + p->add_icon_item(get_theme_icon("ControlAlignLeftWide", "EditorIcons"), TTR("Left Wide"), ANCHORS_AND_MARGINS_PRESET_LEFT_WIDE); + p->add_icon_item(get_theme_icon("ControlAlignTopWide", "EditorIcons"), TTR("Top Wide"), ANCHORS_AND_MARGINS_PRESET_TOP_WIDE); + p->add_icon_item(get_theme_icon("ControlAlignRightWide", "EditorIcons"), TTR("Right Wide"), ANCHORS_AND_MARGINS_PRESET_RIGHT_WIDE); + p->add_icon_item(get_theme_icon("ControlAlignBottomWide", "EditorIcons"), TTR("Bottom Wide"), ANCHORS_AND_MARGINS_PRESET_BOTTOM_WIDE); + p->add_icon_item(get_theme_icon("ControlVcenterWide", "EditorIcons"), TTR("VCenter Wide"), ANCHORS_AND_MARGINS_PRESET_VCENTER_WIDE); + p->add_icon_item(get_theme_icon("ControlHcenterWide", "EditorIcons"), TTR("HCenter Wide"), ANCHORS_AND_MARGINS_PRESET_HCENTER_WIDE); p->add_separator(); - p->add_icon_item(get_icon("ControlAlignWide", "EditorIcons"), TTR("Full Rect"), ANCHORS_AND_MARGINS_PRESET_WIDE); - p->add_icon_item(get_icon("Anchor", "EditorIcons"), TTR("Keep Ratio"), ANCHORS_AND_MARGINS_PRESET_KEEP_RATIO); + p->add_icon_item(get_theme_icon("ControlAlignWide", "EditorIcons"), TTR("Full Rect"), ANCHORS_AND_MARGINS_PRESET_WIDE); + p->add_icon_item(get_theme_icon("Anchor", "EditorIcons"), TTR("Keep Ratio"), ANCHORS_AND_MARGINS_PRESET_KEEP_RATIO); p->add_separator(); p->add_submenu_item(TTR("Anchors only"), "Anchors"); - p->set_item_icon(21, get_icon("Anchor", "EditorIcons")); + p->set_item_icon(21, get_theme_icon("Anchor", "EditorIcons")); anchors_popup->clear(); - anchors_popup->add_icon_item(get_icon("ControlAlignTopLeft", "EditorIcons"), TTR("Top Left"), ANCHORS_PRESET_TOP_LEFT); - anchors_popup->add_icon_item(get_icon("ControlAlignTopRight", "EditorIcons"), TTR("Top Right"), ANCHORS_PRESET_TOP_RIGHT); - anchors_popup->add_icon_item(get_icon("ControlAlignBottomRight", "EditorIcons"), TTR("Bottom Right"), ANCHORS_PRESET_BOTTOM_RIGHT); - anchors_popup->add_icon_item(get_icon("ControlAlignBottomLeft", "EditorIcons"), TTR("Bottom Left"), ANCHORS_PRESET_BOTTOM_LEFT); + anchors_popup->add_icon_item(get_theme_icon("ControlAlignTopLeft", "EditorIcons"), TTR("Top Left"), ANCHORS_PRESET_TOP_LEFT); + anchors_popup->add_icon_item(get_theme_icon("ControlAlignTopRight", "EditorIcons"), TTR("Top Right"), ANCHORS_PRESET_TOP_RIGHT); + anchors_popup->add_icon_item(get_theme_icon("ControlAlignBottomRight", "EditorIcons"), TTR("Bottom Right"), ANCHORS_PRESET_BOTTOM_RIGHT); + anchors_popup->add_icon_item(get_theme_icon("ControlAlignBottomLeft", "EditorIcons"), TTR("Bottom Left"), ANCHORS_PRESET_BOTTOM_LEFT); anchors_popup->add_separator(); - anchors_popup->add_icon_item(get_icon("ControlAlignLeftCenter", "EditorIcons"), TTR("Center Left"), ANCHORS_PRESET_CENTER_LEFT); - anchors_popup->add_icon_item(get_icon("ControlAlignTopCenter", "EditorIcons"), TTR("Center Top"), ANCHORS_PRESET_CENTER_TOP); - anchors_popup->add_icon_item(get_icon("ControlAlignRightCenter", "EditorIcons"), TTR("Center Right"), ANCHORS_PRESET_CENTER_RIGHT); - anchors_popup->add_icon_item(get_icon("ControlAlignBottomCenter", "EditorIcons"), TTR("Center Bottom"), ANCHORS_PRESET_CENTER_BOTTOM); - anchors_popup->add_icon_item(get_icon("ControlAlignCenter", "EditorIcons"), TTR("Center"), ANCHORS_PRESET_CENTER); + anchors_popup->add_icon_item(get_theme_icon("ControlAlignLeftCenter", "EditorIcons"), TTR("Center Left"), ANCHORS_PRESET_CENTER_LEFT); + anchors_popup->add_icon_item(get_theme_icon("ControlAlignTopCenter", "EditorIcons"), TTR("Center Top"), ANCHORS_PRESET_CENTER_TOP); + anchors_popup->add_icon_item(get_theme_icon("ControlAlignRightCenter", "EditorIcons"), TTR("Center Right"), ANCHORS_PRESET_CENTER_RIGHT); + anchors_popup->add_icon_item(get_theme_icon("ControlAlignBottomCenter", "EditorIcons"), TTR("Center Bottom"), ANCHORS_PRESET_CENTER_BOTTOM); + anchors_popup->add_icon_item(get_theme_icon("ControlAlignCenter", "EditorIcons"), TTR("Center"), ANCHORS_PRESET_CENTER); anchors_popup->add_separator(); - anchors_popup->add_icon_item(get_icon("ControlAlignLeftWide", "EditorIcons"), TTR("Left Wide"), ANCHORS_PRESET_LEFT_WIDE); - anchors_popup->add_icon_item(get_icon("ControlAlignTopWide", "EditorIcons"), TTR("Top Wide"), ANCHORS_PRESET_TOP_WIDE); - anchors_popup->add_icon_item(get_icon("ControlAlignRightWide", "EditorIcons"), TTR("Right Wide"), ANCHORS_PRESET_RIGHT_WIDE); - anchors_popup->add_icon_item(get_icon("ControlAlignBottomWide", "EditorIcons"), TTR("Bottom Wide"), ANCHORS_PRESET_BOTTOM_WIDE); - anchors_popup->add_icon_item(get_icon("ControlVcenterWide", "EditorIcons"), TTR("VCenter Wide"), ANCHORS_PRESET_VCENTER_WIDE); - anchors_popup->add_icon_item(get_icon("ControlHcenterWide", "EditorIcons"), TTR("HCenter Wide"), ANCHORS_PRESET_HCENTER_WIDE); + anchors_popup->add_icon_item(get_theme_icon("ControlAlignLeftWide", "EditorIcons"), TTR("Left Wide"), ANCHORS_PRESET_LEFT_WIDE); + anchors_popup->add_icon_item(get_theme_icon("ControlAlignTopWide", "EditorIcons"), TTR("Top Wide"), ANCHORS_PRESET_TOP_WIDE); + anchors_popup->add_icon_item(get_theme_icon("ControlAlignRightWide", "EditorIcons"), TTR("Right Wide"), ANCHORS_PRESET_RIGHT_WIDE); + anchors_popup->add_icon_item(get_theme_icon("ControlAlignBottomWide", "EditorIcons"), TTR("Bottom Wide"), ANCHORS_PRESET_BOTTOM_WIDE); + anchors_popup->add_icon_item(get_theme_icon("ControlVcenterWide", "EditorIcons"), TTR("VCenter Wide"), ANCHORS_PRESET_VCENTER_WIDE); + anchors_popup->add_icon_item(get_theme_icon("ControlHcenterWide", "EditorIcons"), TTR("HCenter Wide"), ANCHORS_PRESET_HCENTER_WIDE); anchors_popup->add_separator(); - anchors_popup->add_icon_item(get_icon("ControlAlignWide", "EditorIcons"), TTR("Full Rect"), ANCHORS_PRESET_WIDE); + anchors_popup->add_icon_item(get_theme_icon("ControlAlignWide", "EditorIcons"), TTR("Full Rect"), ANCHORS_PRESET_WIDE); - anchor_mode_button->set_icon(get_icon("Anchor", "EditorIcons")); + anchor_mode_button->set_icon(get_theme_icon("Anchor", "EditorIcons")); } if (p_what == NOTIFICATION_VISIBILITY_CHANGED) { @@ -4911,7 +4924,7 @@ void CanvasItemEditor::_popup_callback(int p_op) { bool preview = view_menu->get_popup()->is_item_checked(view_menu->get_popup()->get_item_index(PREVIEW_CANVAS_SCALE)); preview = !preview; - VS::get_singleton()->canvas_set_disable_scale(!preview); + RS::get_singleton()->canvas_set_disable_scale(!preview); view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(PREVIEW_CANVAS_SCALE), preview); } break; @@ -5420,21 +5433,21 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { bottom_split = memnew(VSplitContainer); add_child(bottom_split); - bottom_split->set_v_size_flags(SIZE_EXPAND_FILL); + bottom_split->set_v_size_flags(Control::SIZE_EXPAND_FILL); palette_split = memnew(HSplitContainer); bottom_split->add_child(palette_split); - palette_split->set_v_size_flags(SIZE_EXPAND_FILL); + palette_split->set_v_size_flags(Control::SIZE_EXPAND_FILL); viewport_scrollable = memnew(Control); palette_split->add_child(viewport_scrollable); viewport_scrollable->set_mouse_filter(MOUSE_FILTER_PASS); viewport_scrollable->set_clip_contents(true); - viewport_scrollable->set_v_size_flags(SIZE_EXPAND_FILL); - viewport_scrollable->set_h_size_flags(SIZE_EXPAND_FILL); + viewport_scrollable->set_v_size_flags(Control::SIZE_EXPAND_FILL); + viewport_scrollable->set_h_size_flags(Control::SIZE_EXPAND_FILL); viewport_scrollable->connect("draw", callable_mp(this, &CanvasItemEditor::_update_scrollbars)); - ViewportContainer *scene_tree = memnew(ViewportContainer); + SubViewportContainer *scene_tree = memnew(SubViewportContainer); viewport_scrollable->add_child(scene_tree); scene_tree->set_stretch(true); scene_tree->set_anchors_and_margins_preset(Control::PRESET_WIDE); @@ -5445,7 +5458,7 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { zoom_hb = memnew(HBoxContainer); // Bring the zoom percentage closer to the zoom buttons - zoom_hb->add_constant_override("separation", Math::round(-8 * EDSCALE)); + zoom_hb->add_theme_constant_override("separation", Math::round(-8 * EDSCALE)); controls_vb->add_child(zoom_hb); viewport = memnew(CanvasItemEditorViewport(p_editor, this)); @@ -5462,7 +5475,7 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { info_overlay->set_margin(MARGIN_LEFT, 10); info_overlay->set_margin(MARGIN_BOTTOM, -15); info_overlay->set_v_grow_direction(Control::GROW_DIRECTION_BEGIN); - info_overlay->add_constant_override("separation", 10); + info_overlay->add_theme_constant_override("separation", 10); viewport_scrollable->add_child(info_overlay); Theme *info_overlay_theme = memnew(Theme); @@ -5477,8 +5490,8 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { warning_child_of_container = memnew(Label); warning_child_of_container->hide(); warning_child_of_container->set_text(TTR("Warning: Children of a container get their position and size determined only by their parent.")); - warning_child_of_container->add_color_override("font_color", EditorNode::get_singleton()->get_gui_base()->get_color("warning_color", "Editor")); - warning_child_of_container->add_font_override("font", EditorNode::get_singleton()->get_gui_base()->get_font("main", "EditorFonts")); + warning_child_of_container->add_theme_color_override("font_color", EditorNode::get_singleton()->get_gui_base()->get_theme_color("warning_color", "Editor")); + warning_child_of_container->add_theme_font_override("font", EditorNode::get_singleton()->get_gui_base()->get_theme_font("main", "EditorFonts")); add_control_to_info_overlay(warning_child_of_container); h_scroll = memnew(HScrollBar); @@ -5783,7 +5796,7 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { selection_menu = memnew(PopupMenu); add_child(selection_menu); - selection_menu->set_custom_minimum_size(Vector2(100, 0)); + selection_menu->set_min_size(Vector2(100, 0)); selection_menu->connect("id_pressed", callable_mp(this, &CanvasItemEditor::_selection_result_pressed)); selection_menu->connect("popup_hide", callable_mp(this, &CanvasItemEditor::_selection_menu_hide)); @@ -5800,7 +5813,7 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { call_deferred("set_state", get_state()); } -CanvasItemEditor *CanvasItemEditor::singleton = NULL; +CanvasItemEditor *CanvasItemEditor::singleton = nullptr; void CanvasItemEditorPlugin::edit(Object *p_object) { @@ -5818,13 +5831,13 @@ void CanvasItemEditorPlugin::make_visible(bool p_visible) { if (p_visible) { canvas_item_editor->show(); canvas_item_editor->set_physics_process(true); - VisualServer::get_singleton()->viewport_set_hide_canvas(editor->get_scene_root()->get_viewport_rid(), false); + RenderingServer::get_singleton()->viewport_set_hide_canvas(editor->get_scene_root()->get_viewport_rid(), false); } else { canvas_item_editor->hide(); canvas_item_editor->set_physics_process(false); - VisualServer::get_singleton()->viewport_set_hide_canvas(editor->get_scene_root()->get_viewport_rid(), true); + RenderingServer::get_singleton()->viewport_set_hide_canvas(editor->get_scene_root()->get_viewport_rid(), true); } } @@ -5886,9 +5899,9 @@ void CanvasItemEditorViewport::_create_preview(const Vector<String> &files) cons ERR_FAIL_COND(res.is_null()); Ref<Texture2D> texture = Ref<Texture2D>(Object::cast_to<Texture2D>(*res)); Ref<PackedScene> scene = Ref<PackedScene>(Object::cast_to<PackedScene>(*res)); - if (texture != NULL || scene != NULL) { - if (texture != NULL) { - Sprite *sprite = memnew(Sprite); + if (texture != nullptr || scene != nullptr) { + if (texture != nullptr) { + Sprite2D *sprite = memnew(Sprite2D); sprite->set_texture(texture); sprite->set_modulate(Color(1, 1, 1, 0.7f)); preview_node->add_child(sprite); @@ -5953,7 +5966,7 @@ void CanvasItemEditorViewport::_create_nodes(Node *parent, Node *child, String & editor_data->get_undo_redo().add_do_method(editor, "set_edited_scene", child); editor_data->get_undo_redo().add_do_method(child, "set_owner", editor->get_edited_scene()); editor_data->get_undo_redo().add_do_reference(child); - editor_data->get_undo_redo().add_undo_method(editor, "set_edited_scene", (Object *)NULL); + editor_data->get_undo_redo().add_undo_method(editor, "set_edited_scene", (Object *)nullptr); } if (parent) { @@ -6049,7 +6062,7 @@ void CanvasItemEditorViewport::_perform_drop_data() { // Without root dropping multiple files is not allowed if (!target_node && selected_files.size() > 1) { accept->set_text(TTR("Cannot instantiate multiple nodes without root.")); - accept->popup_centered_minsize(); + accept->popup_centered(); return; } @@ -6064,7 +6077,7 @@ void CanvasItemEditorViewport::_perform_drop_data() { continue; } Ref<PackedScene> scene = Ref<PackedScene>(Object::cast_to<PackedScene>(*res)); - if (scene != NULL && scene.is_valid()) { + if (scene != nullptr && scene.is_valid()) { if (!target_node) { // Without root node act the same as "Load Inherited Scene" Error err = EditorNode::get_singleton()->load_scene(path, false, true); @@ -6079,12 +6092,12 @@ void CanvasItemEditorViewport::_perform_drop_data() { } } else { Ref<Texture2D> texture = Ref<Texture2D>(Object::cast_to<Texture2D>(*res)); - if (texture != NULL && texture.is_valid()) { + if (texture != nullptr && texture.is_valid()) { Node *child; if (default_type == "Light2D") child = memnew(Light2D); - else if (default_type == "Particles2D") - child = memnew(Particles2D); + else if (default_type == "GPUParticles2D") + child = memnew(GPUParticles2D); else if (default_type == "Polygon2D") child = memnew(Polygon2D); else if (default_type == "TouchScreenButton") @@ -6094,7 +6107,7 @@ void CanvasItemEditorViewport::_perform_drop_data() { else if (default_type == "NinePatchRect") child = memnew(NinePatchRect); else - child = memnew(Sprite); // default + child = memnew(Sprite2D); // default _create_nodes(target_node, child, path, drop_pos); } @@ -6110,7 +6123,7 @@ void CanvasItemEditorViewport::_perform_drop_data() { } files_str = files_str.substr(0, files_str.length() - 1); accept->set_text(vformat(TTR("Error instancing scene from %s"), files_str.c_str())); - accept->popup_centered_minsize(); + accept->popup_centered(); } } @@ -6176,7 +6189,7 @@ void CanvasItemEditorViewport::_show_resource_type_selector() { check->set_pressed(check->get_text() == default_type); } selector->set_title(vformat(TTR("Add %s"), default_type)); - selector->popup_centered_minsize(); + selector->popup_centered(); } bool CanvasItemEditorViewport::_only_packed_scenes_selected() const { @@ -6191,8 +6204,8 @@ bool CanvasItemEditorViewport::_only_packed_scenes_selected() const { } void CanvasItemEditorViewport::drop_data(const Point2 &p_point, const Variant &p_data) { - bool is_shift = Input::get_singleton()->is_key_pressed(KEY_SHIFT); - bool is_alt = Input::get_singleton()->is_key_pressed(KEY_ALT); + bool is_shift = InputFilter::get_singleton()->is_key_pressed(KEY_SHIFT); + bool is_alt = InputFilter::get_singleton()->is_key_pressed(KEY_ALT); selected_files.clear(); Dictionary d = p_data; @@ -6209,7 +6222,7 @@ void CanvasItemEditorViewport::drop_data(const Point2 &p_point, const Variant &p list.push_back(root_node); } else { drop_pos = p_point; - target_node = NULL; + target_node = nullptr; } } @@ -6233,7 +6246,7 @@ void CanvasItemEditorViewport::_notification(int p_what) { switch (p_what) { case NOTIFICATION_ENTER_TREE: { connect("mouse_exited", callable_mp(this, &CanvasItemEditorViewport::_on_mouse_exit)); - label->add_color_override("font_color", get_color("warning_color", "Editor")); + label->add_theme_color_override("font_color", get_theme_color("warning_color", "Editor")); } break; case NOTIFICATION_EXIT_TREE: { disconnect("mouse_exited", callable_mp(this, &CanvasItemEditorViewport::_on_mouse_exit)); @@ -6247,18 +6260,18 @@ void CanvasItemEditorViewport::_bind_methods() { } CanvasItemEditorViewport::CanvasItemEditorViewport(EditorNode *p_node, CanvasItemEditor *p_canvas_item_editor) { - default_type = "Sprite"; + default_type = "Sprite2D"; // Node2D - types.push_back("Sprite"); + types.push_back("Sprite2D"); types.push_back("Light2D"); - types.push_back("Particles2D"); + types.push_back("GPUParticles2D"); types.push_back("Polygon2D"); types.push_back("TouchScreenButton"); // Control types.push_back("TextureRect"); types.push_back("NinePatchRect"); - target_node = NULL; + target_node = nullptr; editor = p_node; editor_data = editor->get_scene_tree_dock()->get_editor_data(); canvas_item_editor = p_canvas_item_editor; @@ -6271,12 +6284,12 @@ CanvasItemEditorViewport::CanvasItemEditorViewport(EditorNode *p_node, CanvasIte editor->get_gui_base()->add_child(selector); selector->set_title(TTR("Change Default Type")); selector->connect("confirmed", callable_mp(this, &CanvasItemEditorViewport::_on_change_type_confirmed)); - selector->connect("popup_hide", callable_mp(this, &CanvasItemEditorViewport::_on_change_type_closed)); + selector->connect("cancelled", callable_mp(this, &CanvasItemEditorViewport::_on_change_type_closed)); VBoxContainer *vbc = memnew(VBoxContainer); selector->add_child(vbc); - vbc->set_h_size_flags(SIZE_EXPAND_FILL); - vbc->set_v_size_flags(SIZE_EXPAND_FILL); + vbc->set_h_size_flags(Control::SIZE_EXPAND_FILL); + vbc->set_v_size_flags(Control::SIZE_EXPAND_FILL); vbc->set_custom_minimum_size(Size2(200, 260) * EDSCALE); btn_group = memnew(VBoxContainer); @@ -6293,21 +6306,21 @@ CanvasItemEditorViewport::CanvasItemEditorViewport(EditorNode *p_node, CanvasIte } label = memnew(Label); - label->add_color_override("font_color_shadow", Color(0, 0, 0, 1)); - label->add_constant_override("shadow_as_outline", 1 * EDSCALE); + label->add_theme_color_override("font_color_shadow", Color(0, 0, 0, 1)); + label->add_theme_constant_override("shadow_as_outline", 1 * EDSCALE); label->hide(); canvas_item_editor->get_controls_container()->add_child(label); label_desc = memnew(Label); label_desc->set_text(TTR("Drag & drop + Shift : Add node as sibling\nDrag & drop + Alt : Change node type")); - label_desc->add_color_override("font_color", Color(0.6f, 0.6f, 0.6f, 1)); - label_desc->add_color_override("font_color_shadow", Color(0.2f, 0.2f, 0.2f, 1)); - label_desc->add_constant_override("shadow_as_outline", 1 * EDSCALE); - label_desc->add_constant_override("line_spacing", 0); + label_desc->add_theme_color_override("font_color", Color(0.6f, 0.6f, 0.6f, 1)); + label_desc->add_theme_color_override("font_color_shadow", Color(0.2f, 0.2f, 0.2f, 1)); + label_desc->add_theme_constant_override("shadow_as_outline", 1 * EDSCALE); + label_desc->add_theme_constant_override("line_spacing", 0); label_desc->hide(); canvas_item_editor->get_controls_container()->add_child(label_desc); - VS::get_singleton()->canvas_set_disable_scale(true); + RS::get_singleton()->canvas_set_disable_scale(true); } CanvasItemEditorViewport::~CanvasItemEditorViewport() { diff --git a/editor/plugins/canvas_item_editor_plugin.h b/editor/plugins/canvas_item_editor_plugin.h index 3c4cacf5c8..9f1a92f563 100644 --- a/editor/plugins/canvas_item_editor_plugin.h +++ b/editor/plugins/canvas_item_editor_plugin.h @@ -33,12 +33,12 @@ #include "editor/editor_node.h" #include "editor/editor_plugin.h" -#include "scene/2d/canvas_item.h" #include "scene/gui/box_container.h" #include "scene/gui/check_box.h" #include "scene/gui/label.h" #include "scene/gui/panel_container.h" #include "scene/gui/spin_box.h" +#include "scene/main/canvas_item.h" class CanvasItemEditorViewport; @@ -613,7 +613,7 @@ public: SNAP_DEFAULT = SNAP_GRID | SNAP_GUIDES | SNAP_PIXEL, }; - Point2 snap_point(Point2 p_target, unsigned int p_modes = SNAP_DEFAULT, unsigned int p_forced_modes = 0, const CanvasItem *p_self_canvas_item = NULL, List<CanvasItem *> p_other_nodes_exceptions = List<CanvasItem *>()); + Point2 snap_point(Point2 p_target, unsigned int p_modes = SNAP_DEFAULT, unsigned int p_forced_modes = 0, const CanvasItem *p_self_canvas_item = nullptr, List<CanvasItem *> p_other_nodes_exceptions = List<CanvasItem *>()); float snap_angle(float p_target, float p_start = 0) const; Transform2D get_canvas_transform() const { return transform; } @@ -687,7 +687,7 @@ class CanvasItemEditorViewport : public Control { CanvasItemEditor *canvas_item_editor; Node2D *preview_node; AcceptDialog *accept; - WindowDialog *selector; + AcceptDialog *selector; Label *selector_label; Label *label; Label *label_desc; diff --git a/editor/plugins/collision_polygon_2d_editor_plugin.cpp b/editor/plugins/collision_polygon_2d_editor_plugin.cpp index 3d32c0b698..87e9987aa1 100644 --- a/editor/plugins/collision_polygon_2d_editor_plugin.cpp +++ b/editor/plugins/collision_polygon_2d_editor_plugin.cpp @@ -42,7 +42,7 @@ void CollisionPolygon2DEditor::_set_node(Node *p_polygon) { CollisionPolygon2DEditor::CollisionPolygon2DEditor(EditorNode *p_editor) : AbstractPolygon2DEditor(p_editor) { - node = NULL; + node = nullptr; } CollisionPolygon2DEditorPlugin::CollisionPolygon2DEditorPlugin(EditorNode *p_node) : diff --git a/editor/plugins/collision_polygon_editor_plugin.cpp b/editor/plugins/collision_polygon_3d_editor_plugin.cpp index 1562286073..26adc5156b 100644 --- a/editor/plugins/collision_polygon_editor_plugin.cpp +++ b/editor/plugins/collision_polygon_3d_editor_plugin.cpp @@ -1,5 +1,5 @@ /*************************************************************************/ -/* collision_polygon_editor_plugin.cpp */ +/* collision_polygon_3d_editor_plugin.cpp */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ @@ -28,26 +28,26 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#include "collision_polygon_editor_plugin.h" +#include "collision_polygon_3d_editor_plugin.h" #include "canvas_item_editor_plugin.h" +#include "core/input/input_filter.h" #include "core/os/file_access.h" -#include "core/os/input.h" #include "core/os/keyboard.h" #include "editor/editor_settings.h" -#include "scene/3d/camera.h" -#include "spatial_editor_plugin.h" +#include "node_3d_editor_plugin.h" +#include "scene/3d/camera_3d.h" -void Polygon3DEditor::_notification(int p_what) { +void CollisionPolygon3DEditor::_notification(int p_what) { switch (p_what) { case NOTIFICATION_READY: { - button_create->set_icon(get_icon("Edit", "EditorIcons")); - button_edit->set_icon(get_icon("MovePoint", "EditorIcons")); + button_create->set_icon(get_theme_icon("Edit", "EditorIcons")); + button_edit->set_icon(get_theme_icon("MovePoint", "EditorIcons")); button_edit->set_pressed(true); - get_tree()->connect("node_removed", callable_mp(this, &Polygon3DEditor::_node_removed)); + get_tree()->connect("node_removed", callable_mp(this, &CollisionPolygon3DEditor::_node_removed)); } break; case NOTIFICATION_PROCESS: { @@ -63,10 +63,10 @@ void Polygon3DEditor::_notification(int p_what) { } break; } } -void Polygon3DEditor::_node_removed(Node *p_node) { +void CollisionPolygon3DEditor::_node_removed(Node *p_node) { if (p_node == node) { - node = NULL; + node = nullptr; if (imgeom->get_parent() == p_node) p_node->remove_child(imgeom); hide(); @@ -74,7 +74,7 @@ void Polygon3DEditor::_node_removed(Node *p_node) { } } -void Polygon3DEditor::_menu_option(int p_option) { +void CollisionPolygon3DEditor::_menu_option(int p_option) { switch (p_option) { @@ -93,7 +93,7 @@ void Polygon3DEditor::_menu_option(int p_option) { } } -void Polygon3DEditor::_wip_close() { +void CollisionPolygon3DEditor::_wip_close() { undo_redo->create_action(TTR("Create Polygon3D")); undo_redo->add_undo_method(node, "set_polygon", node->call("get_polygon")); @@ -109,7 +109,7 @@ void Polygon3DEditor::_wip_close() { undo_redo->commit_action(); } -bool Polygon3DEditor::forward_spatial_gui_input(Camera *p_camera, const Ref<InputEvent> &p_event) { +bool CollisionPolygon3DEditor::forward_spatial_gui_input(Camera3D *p_camera, const Ref<InputEvent> &p_event) { if (!node) return false; @@ -342,14 +342,14 @@ bool Polygon3DEditor::forward_spatial_gui_input(Camera *p_camera, const Ref<Inpu Vector2 cpoint(spoint.x, spoint.y); - if (snap_ignore && !Input::get_singleton()->is_key_pressed(KEY_CONTROL)) { + if (snap_ignore && !InputFilter::get_singleton()->is_key_pressed(KEY_CONTROL)) { snap_ignore = false; } - if (!snap_ignore && SpatialEditor::get_singleton()->is_snap_enabled()) { + if (!snap_ignore && Node3DEditor::get_singleton()->is_snap_enabled()) { cpoint = cpoint.snapped(Vector2( - SpatialEditor::get_singleton()->get_translate_snap(), - SpatialEditor::get_singleton()->get_translate_snap())); + Node3DEditor::get_singleton()->get_translate_snap(), + Node3DEditor::get_singleton()->get_translate_snap())); } edited_point_pos = cpoint; @@ -360,7 +360,7 @@ bool Polygon3DEditor::forward_spatial_gui_input(Camera *p_camera, const Ref<Inpu return false; } -float Polygon3DEditor::_get_depth() { +float CollisionPolygon3DEditor::_get_depth() { if (bool(node->call("_has_editable_3d_polygon_no_depth"))) return 0; @@ -368,7 +368,7 @@ float Polygon3DEditor::_get_depth() { return float(node->call("get_depth")); } -void Polygon3DEditor::_polygon_draw() { +void CollisionPolygon3DEditor::_polygon_draw() { if (!node) return; @@ -489,11 +489,11 @@ void Polygon3DEditor::_polygon_draw() { m->surface_set_material(0, handle_material); } -void Polygon3DEditor::edit(Node *p_collision_polygon) { +void CollisionPolygon3DEditor::edit(Node *p_collision_polygon) { if (p_collision_polygon) { - node = Object::cast_to<Spatial>(p_collision_polygon); + node = Object::cast_to<Node3D>(p_collision_polygon); //Enable the pencil tool if the polygon is empty if (Vector<Vector2>(node->call("get_polygon")).size() == 0) { _menu_option(MODE_CREATE); @@ -507,7 +507,7 @@ void Polygon3DEditor::edit(Node *p_collision_polygon) { prev_depth = -1; } else { - node = NULL; + node = nullptr; if (imgeom->get_parent()) imgeom->get_parent()->remove_child(imgeom); @@ -516,31 +516,31 @@ void Polygon3DEditor::edit(Node *p_collision_polygon) { } } -void Polygon3DEditor::_bind_methods() { +void CollisionPolygon3DEditor::_bind_methods() { - ClassDB::bind_method(D_METHOD("_polygon_draw"), &Polygon3DEditor::_polygon_draw); + ClassDB::bind_method(D_METHOD("_polygon_draw"), &CollisionPolygon3DEditor::_polygon_draw); } -Polygon3DEditor::Polygon3DEditor(EditorNode *p_editor) { +CollisionPolygon3DEditor::CollisionPolygon3DEditor(EditorNode *p_editor) { - node = NULL; + node = nullptr; editor = p_editor; undo_redo = EditorNode::get_undo_redo(); add_child(memnew(VSeparator)); button_create = memnew(ToolButton); add_child(button_create); - button_create->connect("pressed", callable_mp(this, &Polygon3DEditor::_menu_option), varray(MODE_CREATE)); + button_create->connect("pressed", callable_mp(this, &CollisionPolygon3DEditor::_menu_option), varray(MODE_CREATE)); button_create->set_toggle_mode(true); button_edit = memnew(ToolButton); add_child(button_edit); - button_edit->connect("pressed", callable_mp(this, &Polygon3DEditor::_menu_option), varray(MODE_EDIT)); + button_edit->connect("pressed", callable_mp(this, &CollisionPolygon3DEditor::_menu_option), varray(MODE_EDIT)); button_edit->set_toggle_mode(true); mode = MODE_EDIT; wip_active = false; - imgeom = memnew(ImmediateGeometry); + imgeom = memnew(ImmediateGeometry3D); imgeom->set_transform(Transform(Basis(), Vector3(0, 0, 0.00001))); line_material = Ref<StandardMaterial3D>(memnew(StandardMaterial3D)); @@ -556,11 +556,11 @@ Polygon3DEditor::Polygon3DEditor(EditorNode *p_editor) { handle_material->set_transparency(StandardMaterial3D::TRANSPARENCY_ALPHA); handle_material->set_flag(StandardMaterial3D::FLAG_ALBEDO_FROM_VERTEX_COLOR, true); handle_material->set_flag(StandardMaterial3D::FLAG_SRGB_VERTEX_COLOR, true); - Ref<Texture2D> handle = editor->get_gui_base()->get_icon("Editor3DHandle", "EditorIcons"); + Ref<Texture2D> handle = editor->get_gui_base()->get_theme_icon("Editor3DHandle", "EditorIcons"); handle_material->set_point_size(handle->get_width()); handle_material->set_texture(StandardMaterial3D::TEXTURE_ALBEDO, handle); - pointsm = memnew(MeshInstance); + pointsm = memnew(MeshInstance3D); imgeom->add_child(pointsm); m.instance(); pointsm->set_mesh(m); @@ -569,7 +569,7 @@ Polygon3DEditor::Polygon3DEditor(EditorNode *p_editor) { snap_ignore = false; } -Polygon3DEditor::~Polygon3DEditor() { +CollisionPolygon3DEditor::~CollisionPolygon3DEditor() { memdelete(imgeom); } @@ -581,7 +581,7 @@ void Polygon3DEditorPlugin::edit(Object *p_object) { bool Polygon3DEditorPlugin::handles(Object *p_object) const { - return Object::cast_to<Spatial>(p_object) && bool(p_object->call("_is_editable_3d_polygon")); + return Object::cast_to<Node3D>(p_object) && bool(p_object->call("_is_editable_3d_polygon")); } void Polygon3DEditorPlugin::make_visible(bool p_visible) { @@ -591,15 +591,15 @@ void Polygon3DEditorPlugin::make_visible(bool p_visible) { } else { collision_polygon_editor->hide(); - collision_polygon_editor->edit(NULL); + collision_polygon_editor->edit(nullptr); } } Polygon3DEditorPlugin::Polygon3DEditorPlugin(EditorNode *p_node) { editor = p_node; - collision_polygon_editor = memnew(Polygon3DEditor(p_node)); - SpatialEditor::get_singleton()->add_control_to_menu_panel(collision_polygon_editor); + collision_polygon_editor = memnew(CollisionPolygon3DEditor(p_node)); + Node3DEditor::get_singleton()->add_control_to_menu_panel(collision_polygon_editor); collision_polygon_editor->hide(); } diff --git a/editor/plugins/collision_polygon_editor_plugin.h b/editor/plugins/collision_polygon_3d_editor_plugin.h index 3b6c25ac17..9751b1f79e 100644 --- a/editor/plugins/collision_polygon_editor_plugin.h +++ b/editor/plugins/collision_polygon_3d_editor_plugin.h @@ -1,5 +1,5 @@ /*************************************************************************/ -/* collision_polygon_editor_plugin.h */ +/* collision_polygon_3d_editor_plugin.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ @@ -33,16 +33,16 @@ #include "editor/editor_node.h" #include "editor/editor_plugin.h" -#include "scene/3d/collision_polygon.h" -#include "scene/3d/immediate_geometry.h" -#include "scene/3d/mesh_instance.h" +#include "scene/3d/collision_polygon_3d.h" +#include "scene/3d/immediate_geometry_3d.h" +#include "scene/3d/mesh_instance_3d.h" #include "scene/gui/tool_button.h" class CanvasItemEditor; -class Polygon3DEditor : public HBoxContainer { +class CollisionPolygon3DEditor : public HBoxContainer { - GDCLASS(Polygon3DEditor, HBoxContainer); + GDCLASS(CollisionPolygon3DEditor, HBoxContainer); UndoRedo *undo_redo; enum Mode { @@ -62,9 +62,9 @@ class Polygon3DEditor : public HBoxContainer { EditorNode *editor; Panel *panel; - Spatial *node; - ImmediateGeometry *imgeom; - MeshInstance *pointsm; + Node3D *node; + ImmediateGeometry3D *imgeom; + MeshInstance3D *pointsm; Ref<ArrayMesh> m; MenuButton *options; @@ -90,21 +90,21 @@ protected: static void _bind_methods(); public: - virtual bool forward_spatial_gui_input(Camera *p_camera, const Ref<InputEvent> &p_event); + virtual bool forward_spatial_gui_input(Camera3D *p_camera, const Ref<InputEvent> &p_event); void edit(Node *p_collision_polygon); - Polygon3DEditor(EditorNode *p_editor); - ~Polygon3DEditor(); + CollisionPolygon3DEditor(EditorNode *p_editor); + ~CollisionPolygon3DEditor(); }; class Polygon3DEditorPlugin : public EditorPlugin { GDCLASS(Polygon3DEditorPlugin, EditorPlugin); - Polygon3DEditor *collision_polygon_editor; + CollisionPolygon3DEditor *collision_polygon_editor; EditorNode *editor; public: - virtual bool forward_spatial_gui_input(Camera *p_camera, const Ref<InputEvent> &p_event) { return collision_polygon_editor->forward_spatial_gui_input(p_camera, p_event); } + virtual bool forward_spatial_gui_input(Camera3D *p_camera, const Ref<InputEvent> &p_event) { return collision_polygon_editor->forward_spatial_gui_input(p_camera, p_event); } virtual String get_name() const { return "Polygon3DEditor"; } bool has_main_screen() const { return false; } diff --git a/editor/plugins/collision_shape_2d_editor_plugin.cpp b/editor/plugins/collision_shape_2d_editor_plugin.cpp index 01b4a61a85..594dd0d0cb 100644 --- a/editor/plugins/collision_shape_2d_editor_plugin.cpp +++ b/editor/plugins/collision_shape_2d_editor_plugin.cpp @@ -39,6 +39,13 @@ #include "scene/resources/rectangle_shape_2d.h" #include "scene/resources/segment_shape_2d.h" +void CollisionShape2DEditor::_node_removed(Node *p_node) { + + if (p_node == node) { + node = nullptr; + } +} + Variant CollisionShape2DEditor::get_handle_value(int idx) const { switch (shape_type) { @@ -435,7 +442,7 @@ void CollisionShape2DEditor::forward_canvas_draw_over_viewport(Control *p_overla Transform2D gt = canvas_item_editor->get_canvas_transform() * node->get_global_transform(); - Ref<Texture2D> h = get_icon("EditorHandle", "EditorIcons"); + Ref<Texture2D> h = get_theme_icon("EditorHandle", "EditorIcons"); Vector2 size = h->get_size() * 0.5; handles.clear(); @@ -525,6 +532,20 @@ void CollisionShape2DEditor::forward_canvas_draw_over_viewport(Control *p_overla } } +void CollisionShape2DEditor::_notification(int p_what) { + + switch (p_what) { + + case NOTIFICATION_ENTER_TREE: { + get_tree()->connect("node_removed", callable_mp(this, &CollisionShape2DEditor::_node_removed)); + } break; + + case NOTIFICATION_EXIT_TREE: { + get_tree()->disconnect("node_removed", callable_mp(this, &CollisionShape2DEditor::_node_removed)); + } break; + } +} + void CollisionShape2DEditor::edit(Node *p_node) { if (!canvas_item_editor) { @@ -540,7 +561,7 @@ void CollisionShape2DEditor::edit(Node *p_node) { edit_handle = -1; shape_type = -1; - node = NULL; + node = nullptr; } canvas_item_editor->update_viewport(); @@ -553,8 +574,8 @@ void CollisionShape2DEditor::_bind_methods() { CollisionShape2DEditor::CollisionShape2DEditor(EditorNode *p_editor) { - node = NULL; - canvas_item_editor = NULL; + node = nullptr; + canvas_item_editor = nullptr; editor = p_editor; undo_redo = p_editor->get_undo_redo(); @@ -576,7 +597,7 @@ bool CollisionShape2DEditorPlugin::handles(Object *p_obj) const { void CollisionShape2DEditorPlugin::make_visible(bool visible) { if (!visible) { - edit(NULL); + edit(nullptr); } } diff --git a/editor/plugins/collision_shape_2d_editor_plugin.h b/editor/plugins/collision_shape_2d_editor_plugin.h index 025420a886..6bb621c476 100644 --- a/editor/plugins/collision_shape_2d_editor_plugin.h +++ b/editor/plugins/collision_shape_2d_editor_plugin.h @@ -71,6 +71,8 @@ class CollisionShape2DEditor : public Control { void _get_current_shape_type(); protected: + void _notification(int p_what); + void _node_removed(Node *p_node); static void _bind_methods(); public: diff --git a/editor/plugins/cpu_particles_2d_editor_plugin.cpp b/editor/plugins/cpu_particles_2d_editor_plugin.cpp index 119528dfc8..ef4d7d7646 100644 --- a/editor/plugins/cpu_particles_2d_editor_plugin.cpp +++ b/editor/plugins/cpu_particles_2d_editor_plugin.cpp @@ -60,7 +60,7 @@ void CPUParticles2DEditorPlugin::make_visible(bool p_visible) { void CPUParticles2DEditorPlugin::_file_selected(const String &p_file) { source_emission_file = p_file; - emission_mask->popup_centered_minsize(); + emission_mask->popup_centered(); } void CPUParticles2DEditorPlugin::_menu_callback(int p_idx) { @@ -73,7 +73,7 @@ void CPUParticles2DEditorPlugin::_menu_callback(int p_idx) { } break; case MENU_CLEAR_EMISSION_MASK: { - emission_mask->popup_centered_minsize(); + emission_mask->popup_centered(); } break; case MENU_RESTART: { @@ -241,7 +241,7 @@ void CPUParticles2DEditorPlugin::_notification(int p_what) { if (p_what == NOTIFICATION_ENTER_TREE) { menu->get_popup()->connect("id_pressed", callable_mp(this, &CPUParticles2DEditorPlugin::_menu_callback)); - menu->set_icon(menu->get_popup()->get_icon("Particles2D", "EditorIcons")); + menu->set_icon(epoints->get_theme_icon("CPUParticles2D", "EditorIcons")); file->connect("file_selected", callable_mp(this, &CPUParticles2DEditorPlugin::_file_selected)); } } @@ -251,7 +251,7 @@ void CPUParticles2DEditorPlugin::_bind_methods() { CPUParticles2DEditorPlugin::CPUParticles2DEditorPlugin(EditorNode *p_node) { - particles = NULL; + particles = nullptr; editor = p_node; undo_redo = editor->get_undo_redo(); @@ -262,11 +262,9 @@ CPUParticles2DEditorPlugin::CPUParticles2DEditorPlugin(EditorNode *p_node) { toolbar->add_child(memnew(VSeparator)); menu = memnew(MenuButton); - menu->get_popup()->add_item(TTR("Load Emission Mask"), MENU_LOAD_EMISSION_MASK); - menu->get_popup()->add_separator(); menu->get_popup()->add_item(TTR("Restart"), MENU_RESTART); - // menu->get_popup()->add_item(TTR("Clear Emission Mask"), MENU_CLEAR_EMISSION_MASK); - menu->set_text(TTR("Particles")); + menu->get_popup()->add_item(TTR("Load Emission Mask"), MENU_LOAD_EMISSION_MASK); + menu->set_text(TTR("CPUParticles2D")); menu->set_switch_on_hover(true); toolbar->add_child(menu); @@ -276,7 +274,7 @@ CPUParticles2DEditorPlugin::CPUParticles2DEditorPlugin(EditorNode *p_node) { for (List<String>::Element *E = ext.front(); E; E = E->next()) { file->add_filter("*." + E->get() + "; " + E->get().to_upper()); } - file->set_mode(EditorFileDialog::MODE_OPEN_FILE); + file->set_file_mode(EditorFileDialog::FILE_MODE_OPEN_FILE); toolbar->add_child(file); epoints = memnew(SpinBox); diff --git a/editor/plugins/cpu_particles_editor_plugin.cpp b/editor/plugins/cpu_particles_3d_editor_plugin.cpp index 2161041ee6..59a353a581 100644 --- a/editor/plugins/cpu_particles_editor_plugin.cpp +++ b/editor/plugins/cpu_particles_3d_editor_plugin.cpp @@ -1,5 +1,5 @@ /*************************************************************************/ -/* cpu_particles_editor_plugin.cpp */ +/* cpu_particles_3d_editor_plugin.cpp */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ @@ -28,26 +28,26 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#include "cpu_particles_editor_plugin.h" +#include "cpu_particles_3d_editor_plugin.h" -#include "editor/plugins/spatial_editor_plugin.h" +#include "editor/plugins/node_3d_editor_plugin.h" -void CPUParticlesEditor::_node_removed(Node *p_node) { +void CPUParticles3DEditor::_node_removed(Node *p_node) { if (p_node == node) { - node = NULL; + node = nullptr; hide(); } } -void CPUParticlesEditor::_notification(int p_notification) { +void CPUParticles3DEditor::_notification(int p_notification) { if (p_notification == NOTIFICATION_ENTER_TREE) { - options->set_icon(options->get_popup()->get_icon("CPUParticles", "EditorIcons")); + options->set_icon(get_theme_icon("CPUParticles3D", "EditorIcons")); } } -void CPUParticlesEditor::_menu_option(int p_option) { +void CPUParticles3DEditor::_menu_option(int p_option) { switch (p_option) { @@ -65,13 +65,13 @@ void CPUParticlesEditor::_menu_option(int p_option) { } } -void CPUParticlesEditor::edit(CPUParticles *p_particles) { +void CPUParticles3DEditor::edit(CPUParticles3D *p_particles) { base_node = p_particles; node = p_particles; } -void CPUParticlesEditor::_generate_emission_points() { +void CPUParticles3DEditor::_generate_emission_points() { /// hacer codigo aca Vector<Vector3> points; @@ -82,45 +82,44 @@ void CPUParticlesEditor::_generate_emission_points() { } if (normals.size() == 0) { - node->set_emission_shape(CPUParticles::EMISSION_SHAPE_POINTS); + node->set_emission_shape(CPUParticles3D::EMISSION_SHAPE_POINTS); node->set_emission_points(points); } else { - node->set_emission_shape(CPUParticles::EMISSION_SHAPE_DIRECTED_POINTS); + node->set_emission_shape(CPUParticles3D::EMISSION_SHAPE_DIRECTED_POINTS); node->set_emission_points(points); node->set_emission_normals(normals); } } -void CPUParticlesEditor::_bind_methods() { +void CPUParticles3DEditor::_bind_methods() { } -CPUParticlesEditor::CPUParticlesEditor() { +CPUParticles3DEditor::CPUParticles3DEditor() { particles_editor_hb = memnew(HBoxContainer); - SpatialEditor::get_singleton()->add_control_to_menu_panel(particles_editor_hb); + Node3DEditor::get_singleton()->add_control_to_menu_panel(particles_editor_hb); options = memnew(MenuButton); options->set_switch_on_hover(true); particles_editor_hb->add_child(options); particles_editor_hb->hide(); - options->set_text(TTR("CPUParticles")); - options->get_popup()->add_item(TTR("Create Emission Points From Node"), MENU_OPTION_CREATE_EMISSION_VOLUME_FROM_NODE); - options->get_popup()->add_separator(); + options->set_text(TTR("CPUParticles3D")); options->get_popup()->add_item(TTR("Restart"), MENU_OPTION_RESTART); - options->get_popup()->connect("id_pressed", callable_mp(this, &CPUParticlesEditor::_menu_option)); + options->get_popup()->add_item(TTR("Create Emission Points From Node"), MENU_OPTION_CREATE_EMISSION_VOLUME_FROM_NODE); + options->get_popup()->connect("id_pressed", callable_mp(this, &CPUParticles3DEditor::_menu_option)); } -void CPUParticlesEditorPlugin::edit(Object *p_object) { +void CPUParticles3DEditorPlugin::edit(Object *p_object) { - particles_editor->edit(Object::cast_to<CPUParticles>(p_object)); + particles_editor->edit(Object::cast_to<CPUParticles3D>(p_object)); } -bool CPUParticlesEditorPlugin::handles(Object *p_object) const { +bool CPUParticles3DEditorPlugin::handles(Object *p_object) const { - return p_object->is_class("CPUParticles"); + return p_object->is_class("CPUParticles3D"); } -void CPUParticlesEditorPlugin::make_visible(bool p_visible) { +void CPUParticles3DEditorPlugin::make_visible(bool p_visible) { if (p_visible) { particles_editor->show(); @@ -128,18 +127,18 @@ void CPUParticlesEditorPlugin::make_visible(bool p_visible) { } else { particles_editor->particles_editor_hb->hide(); particles_editor->hide(); - particles_editor->edit(NULL); + particles_editor->edit(nullptr); } } -CPUParticlesEditorPlugin::CPUParticlesEditorPlugin(EditorNode *p_node) { +CPUParticles3DEditorPlugin::CPUParticles3DEditorPlugin(EditorNode *p_node) { editor = p_node; - particles_editor = memnew(CPUParticlesEditor); + particles_editor = memnew(CPUParticles3DEditor); editor->get_viewport()->add_child(particles_editor); particles_editor->hide(); } -CPUParticlesEditorPlugin::~CPUParticlesEditorPlugin() { +CPUParticles3DEditorPlugin::~CPUParticles3DEditorPlugin() { } diff --git a/editor/plugins/cpu_particles_editor_plugin.h b/editor/plugins/cpu_particles_3d_editor_plugin.h index 4cf143fc0c..796c842e07 100644 --- a/editor/plugins/cpu_particles_editor_plugin.h +++ b/editor/plugins/cpu_particles_3d_editor_plugin.h @@ -1,5 +1,5 @@ /*************************************************************************/ -/* cpu_particles_editor_plugin.h */ +/* cpu_particles_3d_editor_plugin.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ @@ -31,12 +31,12 @@ #ifndef CPU_PARTICLES_EDITOR_PLUGIN_H #define CPU_PARTICLES_EDITOR_PLUGIN_H -#include "editor/plugins/particles_editor_plugin.h" -#include "scene/3d/cpu_particles.h" +#include "editor/plugins/gpu_particles_3d_editor_plugin.h" +#include "scene/3d/cpu_particles_3d.h" -class CPUParticlesEditor : public ParticlesEditorBase { +class CPUParticles3DEditor : public GPUParticles3DEditorBase { - GDCLASS(CPUParticlesEditor, ParticlesEditorBase); + GDCLASS(CPUParticles3DEditor, GPUParticles3DEditorBase); enum Menu { @@ -46,11 +46,11 @@ class CPUParticlesEditor : public ParticlesEditorBase { }; - CPUParticles *node; + CPUParticles3D *node; void _menu_option(int); - friend class CPUParticlesEditorPlugin; + friend class CPUParticles3DEditorPlugin; virtual void _generate_emission_points(); @@ -60,26 +60,26 @@ protected: static void _bind_methods(); public: - void edit(CPUParticles *p_particles); - CPUParticlesEditor(); + void edit(CPUParticles3D *p_particles); + CPUParticles3DEditor(); }; -class CPUParticlesEditorPlugin : public EditorPlugin { +class CPUParticles3DEditorPlugin : public EditorPlugin { - GDCLASS(CPUParticlesEditorPlugin, EditorPlugin); + GDCLASS(CPUParticles3DEditorPlugin, EditorPlugin); - CPUParticlesEditor *particles_editor; + CPUParticles3DEditor *particles_editor; EditorNode *editor; public: - virtual String get_name() const { return "CPUParticles"; } + virtual String get_name() const { return "CPUParticles3D"; } bool has_main_screen() const { return false; } virtual void edit(Object *p_object); virtual bool handles(Object *p_object) const; virtual void make_visible(bool p_visible); - CPUParticlesEditorPlugin(EditorNode *p_node); - ~CPUParticlesEditorPlugin(); + CPUParticles3DEditorPlugin(EditorNode *p_node); + ~CPUParticles3DEditorPlugin(); }; #endif // CPU_PARTICLES_EDITOR_PLUGIN_H diff --git a/editor/plugins/curve_editor_plugin.cpp b/editor/plugins/curve_editor_plugin.cpp index 878787231d..71c5a78e0b 100644 --- a/editor/plugins/curve_editor_plugin.cpp +++ b/editor/plugins/curve_editor_plugin.cpp @@ -32,7 +32,7 @@ #include "canvas_item_editor_plugin.h" #include "core/core_string_names.h" -#include "core/os/input.h" +#include "core/input/input_filter.h" #include "core/os/keyboard.h" #include "editor/editor_scale.h" @@ -210,7 +210,7 @@ void CurveEditor::on_gui_input(const Ref<InputEvent> &p_event) { else tangent = 9999 * (dir.y >= 0 ? 1 : -1); - bool link = !Input::get_singleton()->is_key_pressed(KEY_SHIFT); + bool link = !InputFilter::get_singleton()->is_key_pressed(KEY_SHIFT); if (_selected_tangent == TANGENT_LEFT) { curve.set_point_left_tangent(_selected_point, tangent); @@ -511,7 +511,7 @@ void CurveEditor::set_hover_point_index(int index) { } void CurveEditor::update_view_transform() { - Ref<Font> font = get_font("font", "Label"); + Ref<Font> font = get_theme_font("font", "Label"); const real_t margin = font->get_height() + 2 * EDSCALE; float min_y = 0; @@ -626,7 +626,7 @@ void CurveEditor::_draw() { // Background Vector2 view_size = get_rect().size; - draw_style_box(get_stylebox("bg", "Tree"), Rect2(Point2(), view_size)); + draw_style_box(get_theme_stylebox("bg", "Tree"), Rect2(Point2(), view_size)); // Grid @@ -635,8 +635,8 @@ void CurveEditor::_draw() { Vector2 min_edge = get_world_pos(Vector2(0, view_size.y)); Vector2 max_edge = get_world_pos(Vector2(view_size.x, 0)); - const Color grid_color0 = get_color("mono_color", "Editor") * Color(1, 1, 1, 0.15); - const Color grid_color1 = get_color("mono_color", "Editor") * Color(1, 1, 1, 0.07); + const Color grid_color0 = get_theme_color("mono_color", "Editor") * Color(1, 1, 1, 0.15); + const Color grid_color1 = get_theme_color("mono_color", "Editor") * Color(1, 1, 1, 0.07); draw_line(Vector2(min_edge.x, curve.get_min_value()), Vector2(max_edge.x, curve.get_min_value()), grid_color0); draw_line(Vector2(max_edge.x, curve.get_max_value()), Vector2(min_edge.x, curve.get_max_value()), grid_color0); draw_line(Vector2(0, min_edge.y), Vector2(0, max_edge.y), grid_color0); @@ -656,9 +656,9 @@ void CurveEditor::_draw() { draw_set_transform_matrix(Transform2D()); - Ref<Font> font = get_font("font", "Label"); + Ref<Font> font = get_theme_font("font", "Label"); float font_height = font->get_height(); - Color text_color = get_color("font_color", "Editor"); + Color text_color = get_theme_color("font_color", "Editor"); { // X axis @@ -686,7 +686,7 @@ void CurveEditor::_draw() { if (_selected_point >= 0) { - const Color tangent_color = get_color("accent_color", "Editor"); + const Color tangent_color = get_theme_color("accent_color", "Editor"); int i = _selected_point; Vector2 pos = curve.get_point_position(i); @@ -708,8 +708,8 @@ void CurveEditor::_draw() { draw_set_transform_matrix(_world_to_view); - const Color line_color = get_color("font_color", "Editor"); - const Color edge_line_color = get_color("highlight_color", "Editor"); + const Color line_color = get_theme_color("font_color", "Editor"); + const Color edge_line_color = get_theme_color("highlight_color", "Editor"); CanvasItemPlotCurve plot_func(*this, line_color, edge_line_color); plot_curve_accurate(curve, 4.f / view_size.x, plot_func); @@ -718,8 +718,8 @@ void CurveEditor::_draw() { draw_set_transform_matrix(Transform2D()); - const Color point_color = get_color("font_color", "Editor"); - const Color selected_point_color = get_color("accent_color", "Editor"); + const Color point_color = get_theme_color("font_color", "Editor"); + const Color selected_point_color = get_theme_color("accent_color", "Editor"); for (int i = 0; i < curve.get_point_count(); ++i) { Vector2 pos = curve.get_point_position(i); @@ -755,7 +755,7 @@ void CurveEditor::_bind_methods() { bool EditorInspectorPluginCurve::can_handle(Object *p_object) { - return Object::cast_to<Curve>(p_object) != NULL; + return Object::cast_to<Curve>(p_object) != nullptr; } void EditorInspectorPluginCurve::parse_begin(Object *p_object) { diff --git a/editor/plugins/debugger_editor_plugin.cpp b/editor/plugins/debugger_editor_plugin.cpp index c4069ac2ab..566ff378c3 100644 --- a/editor/plugins/debugger_editor_plugin.cpp +++ b/editor/plugins/debugger_editor_plugin.cpp @@ -54,7 +54,6 @@ DebuggerEditorPlugin::DebuggerEditorPlugin(EditorNode *p_editor, MenuButton *p_d // Main editor debug menu. debug_menu = p_debug_menu; PopupMenu *p = debug_menu->get_popup(); - p->set_hide_on_window_lose_focus(true); p->set_hide_on_checkable_item_selection(false); p->add_check_shortcut(ED_SHORTCUT("editor/deploy_with_remote_debug", TTR("Deploy with Remote Debug")), RUN_DEPLOY_REMOTE_DEBUG); p->set_item_tooltip(p->get_item_count() - 1, TTR("When exporting or deploying, the resulting executable will attempt to connect to the IP of this computer in order to be debugged.")); diff --git a/editor/plugins/editor_preview_plugins.cpp b/editor/plugins/editor_preview_plugins.cpp index 3c173ab783..a8c4bddccf 100644 --- a/editor/plugins/editor_preview_plugins.cpp +++ b/editor/plugins/editor_preview_plugins.cpp @@ -328,19 +328,19 @@ Ref<Texture2D> EditorMaterialPreviewPlugin::generate(const RES &p_from, const Si if (material->get_shader_mode() == Shader::MODE_SPATIAL) { - VS::get_singleton()->mesh_surface_set_material(sphere, 0, material->get_rid()); + RS::get_singleton()->mesh_surface_set_material(sphere, 0, material->get_rid()); - VS::get_singleton()->viewport_set_update_mode(viewport, VS::VIEWPORT_UPDATE_ONCE); //once used for capture + RS::get_singleton()->viewport_set_update_mode(viewport, RS::VIEWPORT_UPDATE_ONCE); //once used for capture preview_done = false; - VS::get_singleton()->request_frame_drawn_callback(const_cast<EditorMaterialPreviewPlugin *>(this), "_preview_done", Variant()); + RS::get_singleton()->request_frame_drawn_callback(const_cast<EditorMaterialPreviewPlugin *>(this), "_preview_done", Variant()); while (!preview_done) { OS::get_singleton()->delay_usec(10); } - Ref<Image> img = VS::get_singleton()->texture_2d_get(viewport_texture); - VS::get_singleton()->mesh_surface_set_material(sphere, 0, RID()); + Ref<Image> img = RS::get_singleton()->texture_2d_get(viewport_texture); + RS::get_singleton()->mesh_surface_set_material(sphere, 0, RID()); ERR_FAIL_COND_V(!img.is_valid(), Ref<ImageTexture>()); @@ -358,35 +358,35 @@ Ref<Texture2D> EditorMaterialPreviewPlugin::generate(const RES &p_from, const Si EditorMaterialPreviewPlugin::EditorMaterialPreviewPlugin() { - scenario = VS::get_singleton()->scenario_create(); + scenario = RS::get_singleton()->scenario_create(); - viewport = VS::get_singleton()->viewport_create(); - VS::get_singleton()->viewport_set_update_mode(viewport, VS::VIEWPORT_UPDATE_DISABLED); - VS::get_singleton()->viewport_set_scenario(viewport, scenario); - VS::get_singleton()->viewport_set_size(viewport, 128, 128); - VS::get_singleton()->viewport_set_transparent_background(viewport, true); - VS::get_singleton()->viewport_set_active(viewport, true); - viewport_texture = VS::get_singleton()->viewport_get_texture(viewport); + viewport = RS::get_singleton()->viewport_create(); + RS::get_singleton()->viewport_set_update_mode(viewport, RS::VIEWPORT_UPDATE_DISABLED); + RS::get_singleton()->viewport_set_scenario(viewport, scenario); + RS::get_singleton()->viewport_set_size(viewport, 128, 128); + RS::get_singleton()->viewport_set_transparent_background(viewport, true); + RS::get_singleton()->viewport_set_active(viewport, true); + viewport_texture = RS::get_singleton()->viewport_get_texture(viewport); - camera = VS::get_singleton()->camera_create(); - VS::get_singleton()->viewport_attach_camera(viewport, camera); - VS::get_singleton()->camera_set_transform(camera, Transform(Basis(), Vector3(0, 0, 3))); - VS::get_singleton()->camera_set_perspective(camera, 45, 0.1, 10); + camera = RS::get_singleton()->camera_create(); + RS::get_singleton()->viewport_attach_camera(viewport, camera); + RS::get_singleton()->camera_set_transform(camera, Transform(Basis(), Vector3(0, 0, 3))); + RS::get_singleton()->camera_set_perspective(camera, 45, 0.1, 10); - light = VS::get_singleton()->directional_light_create(); - light_instance = VS::get_singleton()->instance_create2(light, scenario); - VS::get_singleton()->instance_set_transform(light_instance, Transform().looking_at(Vector3(-1, -1, -1), Vector3(0, 1, 0))); + light = RS::get_singleton()->directional_light_create(); + light_instance = RS::get_singleton()->instance_create2(light, scenario); + RS::get_singleton()->instance_set_transform(light_instance, Transform().looking_at(Vector3(-1, -1, -1), Vector3(0, 1, 0))); - light2 = VS::get_singleton()->directional_light_create(); - VS::get_singleton()->light_set_color(light2, Color(0.7, 0.7, 0.7)); - //VS::get_singleton()->light_set_color(light2, Color(0.7, 0.7, 0.7)); + light2 = RS::get_singleton()->directional_light_create(); + RS::get_singleton()->light_set_color(light2, Color(0.7, 0.7, 0.7)); + //RS::get_singleton()->light_set_color(light2, Color(0.7, 0.7, 0.7)); - light_instance2 = VS::get_singleton()->instance_create2(light2, scenario); + light_instance2 = RS::get_singleton()->instance_create2(light2, scenario); - VS::get_singleton()->instance_set_transform(light_instance2, Transform().looking_at(Vector3(0, 1, 0), Vector3(0, 0, 1))); + RS::get_singleton()->instance_set_transform(light_instance2, Transform().looking_at(Vector3(0, 1, 0), Vector3(0, 0, 1))); - sphere = VS::get_singleton()->mesh_create(); - sphere_instance = VS::get_singleton()->instance_create2(sphere, scenario); + sphere = RS::get_singleton()->mesh_create(); + sphere_instance = RS::get_singleton()->instance_create2(sphere, scenario); int lats = 32; int lons = 32; @@ -453,25 +453,25 @@ EditorMaterialPreviewPlugin::EditorMaterialPreviewPlugin() { } Array arr; - arr.resize(VS::ARRAY_MAX); - arr[VS::ARRAY_VERTEX] = vertices; - arr[VS::ARRAY_NORMAL] = normals; - arr[VS::ARRAY_TANGENT] = tangents; - arr[VS::ARRAY_TEX_UV] = uvs; - VS::get_singleton()->mesh_add_surface_from_arrays(sphere, VS::PRIMITIVE_TRIANGLES, arr); + arr.resize(RS::ARRAY_MAX); + arr[RS::ARRAY_VERTEX] = vertices; + arr[RS::ARRAY_NORMAL] = normals; + arr[RS::ARRAY_TANGENT] = tangents; + arr[RS::ARRAY_TEX_UV] = uvs; + RS::get_singleton()->mesh_add_surface_from_arrays(sphere, RS::PRIMITIVE_TRIANGLES, arr); } EditorMaterialPreviewPlugin::~EditorMaterialPreviewPlugin() { - VS::get_singleton()->free(sphere); - VS::get_singleton()->free(sphere_instance); - VS::get_singleton()->free(viewport); - VS::get_singleton()->free(light); - VS::get_singleton()->free(light_instance); - VS::get_singleton()->free(light2); - VS::get_singleton()->free(light_instance2); - VS::get_singleton()->free(camera); - VS::get_singleton()->free(scenario); + RS::get_singleton()->free(sphere); + RS::get_singleton()->free(sphere_instance); + RS::get_singleton()->free(viewport); + RS::get_singleton()->free(light); + RS::get_singleton()->free(light_instance); + RS::get_singleton()->free(light2); + RS::get_singleton()->free(light_instance2); + RS::get_singleton()->free(camera); + RS::get_singleton()->free(scenario); } /////////////////////////////////////////////////////////////////////////// @@ -706,7 +706,7 @@ Ref<Texture2D> EditorMeshPreviewPlugin::generate(const RES &p_from, const Size2 Ref<Mesh> mesh = p_from; ERR_FAIL_COND_V(mesh.is_null(), Ref<Texture2D>()); - VS::get_singleton()->instance_set_base(mesh_instance, mesh->get_rid()); + RS::get_singleton()->instance_set_base(mesh_instance, mesh->get_rid()); AABB aabb = mesh->get_aabb(); Vector3 ofs = aabb.position + aabb.size * 0.5; @@ -723,21 +723,21 @@ Ref<Texture2D> EditorMeshPreviewPlugin::generate(const RES &p_from, const Size2 xform.basis.scale(Vector3(m, m, m)); xform.origin = -xform.basis.xform(ofs); //-ofs*m; xform.origin.z -= rot_aabb.size.z * 2; - VS::get_singleton()->instance_set_transform(mesh_instance, xform); + RS::get_singleton()->instance_set_transform(mesh_instance, xform); - VS::get_singleton()->viewport_set_update_mode(viewport, VS::VIEWPORT_UPDATE_ONCE); //once used for capture + RS::get_singleton()->viewport_set_update_mode(viewport, RS::VIEWPORT_UPDATE_ONCE); //once used for capture preview_done = false; - VS::get_singleton()->request_frame_drawn_callback(const_cast<EditorMeshPreviewPlugin *>(this), "_preview_done", Variant()); + RS::get_singleton()->request_frame_drawn_callback(const_cast<EditorMeshPreviewPlugin *>(this), "_preview_done", Variant()); while (!preview_done) { OS::get_singleton()->delay_usec(10); } - Ref<Image> img = VS::get_singleton()->texture_2d_get(viewport_texture); + Ref<Image> img = RS::get_singleton()->texture_2d_get(viewport_texture); ERR_FAIL_COND_V(img.is_null(), Ref<ImageTexture>()); - VS::get_singleton()->instance_set_base(mesh_instance, RID()); + RS::get_singleton()->instance_set_base(mesh_instance, RID()); img->convert(Image::FORMAT_RGBA8); @@ -759,49 +759,49 @@ Ref<Texture2D> EditorMeshPreviewPlugin::generate(const RES &p_from, const Size2 EditorMeshPreviewPlugin::EditorMeshPreviewPlugin() { - scenario = VS::get_singleton()->scenario_create(); + scenario = RS::get_singleton()->scenario_create(); - viewport = VS::get_singleton()->viewport_create(); - VS::get_singleton()->viewport_set_update_mode(viewport, VS::VIEWPORT_UPDATE_DISABLED); - VS::get_singleton()->viewport_set_scenario(viewport, scenario); - VS::get_singleton()->viewport_set_size(viewport, 128, 128); - VS::get_singleton()->viewport_set_transparent_background(viewport, true); - VS::get_singleton()->viewport_set_active(viewport, true); - viewport_texture = VS::get_singleton()->viewport_get_texture(viewport); + viewport = RS::get_singleton()->viewport_create(); + RS::get_singleton()->viewport_set_update_mode(viewport, RS::VIEWPORT_UPDATE_DISABLED); + RS::get_singleton()->viewport_set_scenario(viewport, scenario); + RS::get_singleton()->viewport_set_size(viewport, 128, 128); + RS::get_singleton()->viewport_set_transparent_background(viewport, true); + RS::get_singleton()->viewport_set_active(viewport, true); + viewport_texture = RS::get_singleton()->viewport_get_texture(viewport); - camera = VS::get_singleton()->camera_create(); - VS::get_singleton()->viewport_attach_camera(viewport, camera); - VS::get_singleton()->camera_set_transform(camera, Transform(Basis(), Vector3(0, 0, 3))); - //VS::get_singleton()->camera_set_perspective(camera,45,0.1,10); - VS::get_singleton()->camera_set_orthogonal(camera, 1.0, 0.01, 1000.0); + camera = RS::get_singleton()->camera_create(); + RS::get_singleton()->viewport_attach_camera(viewport, camera); + RS::get_singleton()->camera_set_transform(camera, Transform(Basis(), Vector3(0, 0, 3))); + //RS::get_singleton()->camera_set_perspective(camera,45,0.1,10); + RS::get_singleton()->camera_set_orthogonal(camera, 1.0, 0.01, 1000.0); - light = VS::get_singleton()->directional_light_create(); - light_instance = VS::get_singleton()->instance_create2(light, scenario); - VS::get_singleton()->instance_set_transform(light_instance, Transform().looking_at(Vector3(-1, -1, -1), Vector3(0, 1, 0))); + light = RS::get_singleton()->directional_light_create(); + light_instance = RS::get_singleton()->instance_create2(light, scenario); + RS::get_singleton()->instance_set_transform(light_instance, Transform().looking_at(Vector3(-1, -1, -1), Vector3(0, 1, 0))); - light2 = VS::get_singleton()->directional_light_create(); - VS::get_singleton()->light_set_color(light2, Color(0.7, 0.7, 0.7)); - //VS::get_singleton()->light_set_color(light2, VS::LIGHT_COLOR_SPECULAR, Color(0.0, 0.0, 0.0)); - light_instance2 = VS::get_singleton()->instance_create2(light2, scenario); + light2 = RS::get_singleton()->directional_light_create(); + RS::get_singleton()->light_set_color(light2, Color(0.7, 0.7, 0.7)); + //RS::get_singleton()->light_set_color(light2, RS::LIGHT_COLOR_SPECULAR, Color(0.0, 0.0, 0.0)); + light_instance2 = RS::get_singleton()->instance_create2(light2, scenario); - VS::get_singleton()->instance_set_transform(light_instance2, Transform().looking_at(Vector3(0, 1, 0), Vector3(0, 0, 1))); + RS::get_singleton()->instance_set_transform(light_instance2, Transform().looking_at(Vector3(0, 1, 0), Vector3(0, 0, 1))); - //sphere = VS::get_singleton()->mesh_create(); - mesh_instance = VS::get_singleton()->instance_create(); - VS::get_singleton()->instance_set_scenario(mesh_instance, scenario); + //sphere = RS::get_singleton()->mesh_create(); + mesh_instance = RS::get_singleton()->instance_create(); + RS::get_singleton()->instance_set_scenario(mesh_instance, scenario); } EditorMeshPreviewPlugin::~EditorMeshPreviewPlugin() { - //VS::get_singleton()->free(sphere); - VS::get_singleton()->free(mesh_instance); - VS::get_singleton()->free(viewport); - VS::get_singleton()->free(light); - VS::get_singleton()->free(light_instance); - VS::get_singleton()->free(light2); - VS::get_singleton()->free(light_instance2); - VS::get_singleton()->free(camera); - VS::get_singleton()->free(scenario); + //RS::get_singleton()->free(sphere); + RS::get_singleton()->free(mesh_instance); + RS::get_singleton()->free(viewport); + RS::get_singleton()->free(light); + RS::get_singleton()->free(light_instance); + RS::get_singleton()->free(light2); + RS::get_singleton()->free(light_instance2); + RS::get_singleton()->free(camera); + RS::get_singleton()->free(scenario); } /////////////////////////////////////////////////////////////////////////// @@ -849,16 +849,16 @@ Ref<Texture2D> EditorFontPreviewPlugin::generate_from_path(const String &p_path, font->draw(canvas_item, pos, sampled_text); preview_done = false; - VS::get_singleton()->viewport_set_update_mode(viewport, VS::VIEWPORT_UPDATE_ONCE); //once used for capture - VS::get_singleton()->request_frame_drawn_callback(const_cast<EditorFontPreviewPlugin *>(this), "_preview_done", Variant()); + RS::get_singleton()->viewport_set_update_mode(viewport, RS::VIEWPORT_UPDATE_ONCE); //once used for capture + RS::get_singleton()->request_frame_drawn_callback(const_cast<EditorFontPreviewPlugin *>(this), "_preview_done", Variant()); while (!preview_done) { OS::get_singleton()->delay_usec(10); } - VS::get_singleton()->canvas_item_clear(canvas_item); + RS::get_singleton()->canvas_item_clear(canvas_item); - Ref<Image> img = VS::get_singleton()->texture_2d_get(viewport_texture); + Ref<Image> img = RS::get_singleton()->texture_2d_get(viewport_texture); ERR_FAIL_COND_V(img.is_null(), Ref<ImageTexture>()); img->convert(Image::FORMAT_RGBA8); @@ -891,22 +891,22 @@ Ref<Texture2D> EditorFontPreviewPlugin::generate(const RES &p_from, const Size2 EditorFontPreviewPlugin::EditorFontPreviewPlugin() { - viewport = VS::get_singleton()->viewport_create(); - VS::get_singleton()->viewport_set_update_mode(viewport, VS::VIEWPORT_UPDATE_DISABLED); - VS::get_singleton()->viewport_set_size(viewport, 128, 128); - VS::get_singleton()->viewport_set_active(viewport, true); - viewport_texture = VS::get_singleton()->viewport_get_texture(viewport); + viewport = RS::get_singleton()->viewport_create(); + RS::get_singleton()->viewport_set_update_mode(viewport, RS::VIEWPORT_UPDATE_DISABLED); + RS::get_singleton()->viewport_set_size(viewport, 128, 128); + RS::get_singleton()->viewport_set_active(viewport, true); + viewport_texture = RS::get_singleton()->viewport_get_texture(viewport); - canvas = VS::get_singleton()->canvas_create(); - canvas_item = VS::get_singleton()->canvas_item_create(); + canvas = RS::get_singleton()->canvas_create(); + canvas_item = RS::get_singleton()->canvas_item_create(); - VS::get_singleton()->viewport_attach_canvas(viewport, canvas); - VS::get_singleton()->canvas_item_set_parent(canvas_item, canvas); + RS::get_singleton()->viewport_attach_canvas(viewport, canvas); + RS::get_singleton()->canvas_item_set_parent(canvas_item, canvas); } EditorFontPreviewPlugin::~EditorFontPreviewPlugin() { - VS::get_singleton()->free(canvas_item); - VS::get_singleton()->free(canvas); - VS::get_singleton()->free(viewport); + RS::get_singleton()->free(canvas_item); + RS::get_singleton()->free(canvas); + RS::get_singleton()->free(viewport); } diff --git a/editor/plugins/gi_probe_editor_plugin.cpp b/editor/plugins/gi_probe_editor_plugin.cpp index c077c23e8a..6a171c4703 100644 --- a/editor/plugins/gi_probe_editor_plugin.cpp +++ b/editor/plugins/gi_probe_editor_plugin.cpp @@ -87,16 +87,16 @@ void GIProbeEditorPlugin::_notification(int p_what) { Color color; if (size_mb <= 16.0 + CMP_EPSILON) { // Fast. - color = bake_info->get_color("success_color", "Editor"); + color = bake_info->get_theme_color("success_color", "Editor"); } else if (size_mb <= 64.0 + CMP_EPSILON) { // Medium. - color = bake_info->get_color("warning_color", "Editor"); + color = bake_info->get_theme_color("warning_color", "Editor"); } else { // Slow. - color = bake_info->get_color("error_color", "Editor"); + color = bake_info->get_theme_color("error_color", "Editor"); } + bake_info->add_theme_color_override("font_color", color); - bake_info->add_color_override("font_color", color); bake_info->set_text(text); } } @@ -113,25 +113,25 @@ void GIProbeEditorPlugin::make_visible(bool p_visible) { } } -EditorProgress *GIProbeEditorPlugin::tmp_progress = NULL; +EditorProgress *GIProbeEditorPlugin::tmp_progress = nullptr; void GIProbeEditorPlugin::bake_func_begin(int p_steps) { - ERR_FAIL_COND(tmp_progress != NULL); + ERR_FAIL_COND(tmp_progress != nullptr); tmp_progress = memnew(EditorProgress("bake_gi", TTR("Bake GI Probe"), p_steps)); } void GIProbeEditorPlugin::bake_func_step(int p_step, const String &p_description) { - ERR_FAIL_COND(tmp_progress == NULL); + ERR_FAIL_COND(tmp_progress == nullptr); tmp_progress->step(p_description, p_step, false); } void GIProbeEditorPlugin::bake_func_end() { - ERR_FAIL_COND(tmp_progress == NULL); + ERR_FAIL_COND(tmp_progress == nullptr); memdelete(tmp_progress); - tmp_progress = NULL; + tmp_progress = nullptr; } void GIProbeEditorPlugin::_giprobe_save_path_and_bake(const String &p_path) { @@ -153,7 +153,7 @@ GIProbeEditorPlugin::GIProbeEditorPlugin(EditorNode *p_node) { bake_hb->set_h_size_flags(Control::SIZE_EXPAND_FILL); bake_hb->hide(); bake = memnew(ToolButton); - bake->set_icon(editor->get_gui_base()->get_icon("Bake", "EditorIcons")); + bake->set_icon(editor->get_gui_base()->get_theme_icon("Bake", "EditorIcons")); bake->set_text(TTR("Bake GI Probe")); bake->connect("pressed", callable_mp(this, &GIProbeEditorPlugin::_bake)); bake_hb->add_child(bake); @@ -163,9 +163,9 @@ GIProbeEditorPlugin::GIProbeEditorPlugin(EditorNode *p_node) { bake_hb->add_child(bake_info); add_control_to_container(CONTAINER_SPATIAL_EDITOR_MENU, bake_hb); - gi_probe = NULL; + gi_probe = nullptr; probe_file = memnew(EditorFileDialog); - probe_file->set_mode(EditorFileDialog::MODE_SAVE_FILE); + probe_file->set_file_mode(EditorFileDialog::FILE_MODE_SAVE_FILE); probe_file->add_filter("*.res"); probe_file->connect("file_selected", callable_mp(this, &GIProbeEditorPlugin::_giprobe_save_path_and_bake)); get_editor_interface()->get_base_control()->add_child(probe_file); diff --git a/editor/plugins/particles_2d_editor_plugin.cpp b/editor/plugins/gpu_particles_2d_editor_plugin.cpp index 812144742f..5c35285c22 100644 --- a/editor/plugins/particles_2d_editor_plugin.cpp +++ b/editor/plugins/gpu_particles_2d_editor_plugin.cpp @@ -1,5 +1,5 @@ /*************************************************************************/ -/* particles_2d_editor_plugin.cpp */ +/* gpu_particles_2d_editor_plugin.cpp */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ @@ -28,7 +28,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#include "particles_2d_editor_plugin.h" +#include "gpu_particles_2d_editor_plugin.h" #include "canvas_item_editor_plugin.h" #include "core/io/image_loader.h" @@ -36,17 +36,17 @@ #include "scene/gui/separator.h" #include "scene/resources/particles_material.h" -void Particles2DEditorPlugin::edit(Object *p_object) { +void GPUParticles2DEditorPlugin::edit(Object *p_object) { - particles = Object::cast_to<Particles2D>(p_object); + particles = Object::cast_to<GPUParticles2D>(p_object); } -bool Particles2DEditorPlugin::handles(Object *p_object) const { +bool GPUParticles2DEditorPlugin::handles(Object *p_object) const { - return p_object->is_class("Particles2D"); + return p_object->is_class("GPUParticles2D"); } -void Particles2DEditorPlugin::make_visible(bool p_visible) { +void GPUParticles2DEditorPlugin::make_visible(bool p_visible) { if (p_visible) { @@ -57,13 +57,13 @@ void Particles2DEditorPlugin::make_visible(bool p_visible) { } } -void Particles2DEditorPlugin::_file_selected(const String &p_file) { +void GPUParticles2DEditorPlugin::_file_selected(const String &p_file) { source_emission_file = p_file; - emission_mask->popup_centered_minsize(); + emission_mask->popup_centered(); } -void Particles2DEditorPlugin::_menu_callback(int p_idx) { +void GPUParticles2DEditorPlugin::_menu_callback(int p_idx) { switch (p_idx) { case MENU_GENERATE_VISIBILITY_RECT: { @@ -72,7 +72,7 @@ void Particles2DEditorPlugin::_menu_callback(int p_idx) { generate_seconds->set_value(1.0); else generate_seconds->set_value(trunc(gen_time) + 1.0); - generate_visibility_rect->popup_centered_minsize(); + generate_visibility_rect->popup_centered(); } break; case MENU_LOAD_EMISSION_MASK: { @@ -81,7 +81,7 @@ void Particles2DEditorPlugin::_menu_callback(int p_idx) { } break; case MENU_CLEAR_EMISSION_MASK: { - emission_mask->popup_centered_minsize(); + emission_mask->popup_centered(); } break; case MENU_OPTION_CONVERT_TO_CPU_PARTICLES: { @@ -94,7 +94,7 @@ void Particles2DEditorPlugin::_menu_callback(int p_idx) { cpu_particles->set_z_index(particles->get_z_index()); UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo(); - ur->create_action(TTR("Convert to CPUParticles")); + ur->create_action(TTR("Convert to CPUParticles2D")); ur->add_do_method(EditorNode::get_singleton()->get_scene_tree_dock(), "replace_node", particles, cpu_particles, true, false); ur->add_do_reference(cpu_particles); ur->add_undo_method(EditorNode::get_singleton()->get_scene_tree_dock(), "replace_node", cpu_particles, particles, false, false); @@ -109,7 +109,7 @@ void Particles2DEditorPlugin::_menu_callback(int p_idx) { } } -void Particles2DEditorPlugin::_generate_visibility_rect() { +void GPUParticles2DEditorPlugin::_generate_visibility_rect() { float time = generate_seconds->get_value(); @@ -149,7 +149,7 @@ void Particles2DEditorPlugin::_generate_visibility_rect() { undo_redo->commit_action(); } -void Particles2DEditorPlugin::_generate_emission_mask() { +void GPUParticles2DEditorPlugin::_generate_emission_mask() { Ref<ParticlesMaterial> pm = particles->get_process_material(); if (!pm.is_valid()) { @@ -345,22 +345,22 @@ void Particles2DEditorPlugin::_generate_emission_mask() { } } -void Particles2DEditorPlugin::_notification(int p_what) { +void GPUParticles2DEditorPlugin::_notification(int p_what) { if (p_what == NOTIFICATION_ENTER_TREE) { - menu->get_popup()->connect("id_pressed", callable_mp(this, &Particles2DEditorPlugin::_menu_callback)); - menu->set_icon(menu->get_popup()->get_icon("Particles2D", "EditorIcons")); - file->connect("file_selected", callable_mp(this, &Particles2DEditorPlugin::_file_selected)); + menu->get_popup()->connect("id_pressed", callable_mp(this, &GPUParticles2DEditorPlugin::_menu_callback)); + menu->set_icon(menu->get_theme_icon("GPUParticles2D", "EditorIcons")); + file->connect("file_selected", callable_mp(this, &GPUParticles2DEditorPlugin::_file_selected)); } } -void Particles2DEditorPlugin::_bind_methods() { +void GPUParticles2DEditorPlugin::_bind_methods() { } -Particles2DEditorPlugin::Particles2DEditorPlugin(EditorNode *p_node) { +GPUParticles2DEditorPlugin::GPUParticles2DEditorPlugin(EditorNode *p_node) { - particles = NULL; + particles = nullptr; editor = p_node; undo_redo = editor->get_undo_redo(); @@ -371,15 +371,12 @@ Particles2DEditorPlugin::Particles2DEditorPlugin(EditorNode *p_node) { toolbar->add_child(memnew(VSeparator)); menu = memnew(MenuButton); + menu->get_popup()->add_item(TTR("Restart"), MENU_RESTART); menu->get_popup()->add_item(TTR("Generate Visibility Rect"), MENU_GENERATE_VISIBILITY_RECT); - menu->get_popup()->add_separator(); menu->get_popup()->add_item(TTR("Load Emission Mask"), MENU_LOAD_EMISSION_MASK); // menu->get_popup()->add_item(TTR("Clear Emission Mask"), MENU_CLEAR_EMISSION_MASK); - menu->get_popup()->add_separator(); - menu->get_popup()->add_item(TTR("Convert to CPUParticles"), MENU_OPTION_CONVERT_TO_CPU_PARTICLES); - menu->get_popup()->add_separator(); - menu->get_popup()->add_item(TTR("Restart"), MENU_RESTART); - menu->set_text(TTR("Particles")); + menu->get_popup()->add_item(TTR("Convert to CPUParticles2D"), MENU_OPTION_CONVERT_TO_CPU_PARTICLES); + menu->set_text(TTR("GPUParticles2D")); menu->set_switch_on_hover(true); toolbar->add_child(menu); @@ -389,7 +386,7 @@ Particles2DEditorPlugin::Particles2DEditorPlugin(EditorNode *p_node) { for (List<String>::Element *E = ext.front(); E; E = E->next()) { file->add_filter("*." + E->get() + "; " + E->get().to_upper()); } - file->set_mode(EditorFileDialog::MODE_OPEN_FILE); + file->set_file_mode(EditorFileDialog::FILE_MODE_OPEN_FILE); toolbar->add_child(file); epoints = memnew(SpinBox); @@ -411,7 +408,7 @@ Particles2DEditorPlugin::Particles2DEditorPlugin(EditorNode *p_node) { toolbar->add_child(generate_visibility_rect); - generate_visibility_rect->connect("confirmed", callable_mp(this, &Particles2DEditorPlugin::_generate_visibility_rect)); + generate_visibility_rect->connect("confirmed", callable_mp(this, &GPUParticles2DEditorPlugin::_generate_visibility_rect)); emission_mask = memnew(ConfirmationDialog); emission_mask->set_title(TTR("Load Emission Mask")); @@ -428,8 +425,8 @@ Particles2DEditorPlugin::Particles2DEditorPlugin(EditorNode *p_node) { toolbar->add_child(emission_mask); - emission_mask->connect("confirmed", callable_mp(this, &Particles2DEditorPlugin::_generate_emission_mask)); + emission_mask->connect("confirmed", callable_mp(this, &GPUParticles2DEditorPlugin::_generate_emission_mask)); } -Particles2DEditorPlugin::~Particles2DEditorPlugin() { +GPUParticles2DEditorPlugin::~GPUParticles2DEditorPlugin() { } diff --git a/editor/plugins/particles_2d_editor_plugin.h b/editor/plugins/gpu_particles_2d_editor_plugin.h index 29652a1826..008d04a211 100644 --- a/editor/plugins/particles_2d_editor_plugin.h +++ b/editor/plugins/gpu_particles_2d_editor_plugin.h @@ -1,5 +1,5 @@ /*************************************************************************/ -/* particles_2d_editor_plugin.h */ +/* gpu_particles_2d_editor_plugin.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ @@ -34,13 +34,13 @@ #include "editor/editor_node.h" #include "editor/editor_plugin.h" #include "scene/2d/collision_polygon_2d.h" -#include "scene/2d/particles_2d.h" +#include "scene/2d/gpu_particles_2d.h" #include "scene/gui/box_container.h" #include "scene/gui/file_dialog.h" -class Particles2DEditorPlugin : public EditorPlugin { +class GPUParticles2DEditorPlugin : public EditorPlugin { - GDCLASS(Particles2DEditorPlugin, EditorPlugin); + GDCLASS(GPUParticles2DEditorPlugin, EditorPlugin); enum { @@ -57,7 +57,7 @@ class Particles2DEditorPlugin : public EditorPlugin { EMISSION_MODE_BORDER_DIRECTED }; - Particles2D *particles; + GPUParticles2D *particles; EditorFileDialog *file; EditorNode *editor; @@ -87,14 +87,14 @@ protected: static void _bind_methods(); public: - virtual String get_name() const { return "Particles2D"; } + virtual String get_name() const { return "GPUParticles2D"; } bool has_main_screen() const { return false; } virtual void edit(Object *p_object); virtual bool handles(Object *p_object) const; virtual void make_visible(bool p_visible); - Particles2DEditorPlugin(EditorNode *p_node); - ~Particles2DEditorPlugin(); + GPUParticles2DEditorPlugin(EditorNode *p_node); + ~GPUParticles2DEditorPlugin(); }; #endif // PARTICLES_2D_EDITOR_PLUGIN_H diff --git a/editor/plugins/particles_editor_plugin.cpp b/editor/plugins/gpu_particles_3d_editor_plugin.cpp index a4d704c6e1..7f80acc176 100644 --- a/editor/plugins/particles_editor_plugin.cpp +++ b/editor/plugins/gpu_particles_3d_editor_plugin.cpp @@ -1,5 +1,5 @@ /*************************************************************************/ -/* particles_editor_plugin.cpp */ +/* gpu_particles_3d_editor_plugin.cpp */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ @@ -28,14 +28,14 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#include "particles_editor_plugin.h" +#include "gpu_particles_3d_editor_plugin.h" #include "core/io/resource_loader.h" -#include "editor/plugins/spatial_editor_plugin.h" -#include "scene/3d/cpu_particles.h" +#include "editor/plugins/node_3d_editor_plugin.h" +#include "scene/3d/cpu_particles_3d.h" #include "scene/resources/particles_material.h" -bool ParticlesEditorBase::_generate(Vector<Vector3> &points, Vector<Vector3> &normals) { +bool GPUParticles3DEditorBase::_generate(Vector<Vector3> &points, Vector<Vector3> &normals) { bool use_normals = emission_fill->get_selected() == 1; @@ -161,26 +161,26 @@ bool ParticlesEditorBase::_generate(Vector<Vector3> &points, Vector<Vector3> &no return true; } -void ParticlesEditorBase::_node_selected(const NodePath &p_path) { +void GPUParticles3DEditorBase::_node_selected(const NodePath &p_path) { Node *sel = get_node(p_path); if (!sel) return; - if (!sel->is_class("Spatial")) { + if (!sel->is_class("Node3D")) { - EditorNode::get_singleton()->show_warning(vformat(TTR("\"%s\" doesn't inherit from Spatial."), sel->get_name())); + EditorNode::get_singleton()->show_warning(vformat(TTR("\"%s\" doesn't inherit from Node3D."), sel->get_name())); return; } - VisualInstance *vi = Object::cast_to<VisualInstance>(sel); + VisualInstance3D *vi = Object::cast_to<VisualInstance3D>(sel); if (!vi) { EditorNode::get_singleton()->show_warning(vformat(TTR("\"%s\" doesn't contain geometry."), sel->get_name())); return; } - geometry = vi->get_faces(VisualInstance::FACES_SOLID); + geometry = vi->get_faces(VisualInstance3D::FACES_SOLID); if (geometry.size() == 0) { @@ -202,10 +202,10 @@ void ParticlesEditorBase::_node_selected(const NodePath &p_path) { emission_dialog->popup_centered(Size2(300, 130)); } -void ParticlesEditorBase::_bind_methods() { +void GPUParticles3DEditorBase::_bind_methods() { } -ParticlesEditorBase::ParticlesEditorBase() { +GPUParticles3DEditorBase::GPUParticles3DEditorBase() { emission_dialog = memnew(ConfirmationDialog); emission_dialog->set_title(TTR("Create Emitter")); @@ -226,30 +226,30 @@ ParticlesEditorBase::ParticlesEditorBase() { emd_vb->add_margin_child(TTR("Emission Source: "), emission_fill); emission_dialog->get_ok()->set_text(TTR("Create")); - emission_dialog->connect("confirmed", callable_mp(this, &ParticlesEditorBase::_generate_emission_points)); + emission_dialog->connect("confirmed", callable_mp(this, &GPUParticles3DEditorBase::_generate_emission_points)); emission_tree_dialog = memnew(SceneTreeDialog); add_child(emission_tree_dialog); - emission_tree_dialog->connect("selected", callable_mp(this, &ParticlesEditorBase::_node_selected)); + emission_tree_dialog->connect("selected", callable_mp(this, &GPUParticles3DEditorBase::_node_selected)); } -void ParticlesEditor::_node_removed(Node *p_node) { +void GPUParticles3DEditor::_node_removed(Node *p_node) { if (p_node == node) { - node = NULL; + node = nullptr; hide(); } } -void ParticlesEditor::_notification(int p_notification) { +void GPUParticles3DEditor::_notification(int p_notification) { if (p_notification == NOTIFICATION_ENTER_TREE) { - options->set_icon(options->get_popup()->get_icon("Particles", "EditorIcons")); - get_tree()->connect("node_removed", callable_mp(this, &ParticlesEditor::_node_removed)); + options->set_icon(options->get_popup()->get_theme_icon("GPUParticles3D", "EditorIcons")); + get_tree()->connect("node_removed", callable_mp(this, &GPUParticles3DEditor::_node_removed)); } } -void ParticlesEditor::_menu_option(int p_option) { +void GPUParticles3DEditor::_menu_option(int p_option) { switch (p_option) { @@ -260,7 +260,7 @@ void ParticlesEditor::_menu_option(int p_option) { generate_seconds->set_value(1.0); else generate_seconds->set_value(trunc(gen_time) + 1.0); - generate_aabb->popup_centered_minsize(); + generate_aabb->popup_centered(); } break; case MENU_OPTION_CREATE_EMISSION_VOLUME_FROM_NODE: { Ref<ParticlesMaterial> material = node->get_process_material(); @@ -274,7 +274,7 @@ void ParticlesEditor::_menu_option(int p_option) { } break; case MENU_OPTION_CONVERT_TO_CPU_PARTICLES: { - CPUParticles *cpu_particles = memnew(CPUParticles); + CPUParticles3D *cpu_particles = memnew(CPUParticles3D); cpu_particles->convert_from_particles(node); cpu_particles->set_name(node->get_name()); cpu_particles->set_transform(node->get_transform()); @@ -282,7 +282,7 @@ void ParticlesEditor::_menu_option(int p_option) { cpu_particles->set_pause_mode(node->get_pause_mode()); UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo(); - ur->create_action(TTR("Convert to CPUParticles")); + ur->create_action(TTR("Convert to CPUParticles3D")); ur->add_do_method(EditorNode::get_singleton()->get_scene_tree_dock(), "replace_node", node, cpu_particles, true, false); ur->add_do_reference(cpu_particles); ur->add_undo_method(EditorNode::get_singleton()->get_scene_tree_dock(), "replace_node", cpu_particles, node, false, false); @@ -298,7 +298,7 @@ void ParticlesEditor::_menu_option(int p_option) { } } -void ParticlesEditor::_generate_aabb() { +void GPUParticles3DEditor::_generate_aabb() { float time = generate_seconds->get_value(); @@ -340,13 +340,13 @@ void ParticlesEditor::_generate_aabb() { ur->commit_action(); } -void ParticlesEditor::edit(Particles *p_particles) { +void GPUParticles3DEditor::edit(GPUParticles3D *p_particles) { base_node = p_particles; node = p_particles; } -void ParticlesEditor::_generate_emission_points() { +void GPUParticles3DEditor::_generate_emission_points() { /// hacer codigo aca Vector<Vector3> points; @@ -419,29 +419,26 @@ void ParticlesEditor::_generate_emission_points() { } } -void ParticlesEditor::_bind_methods() { +void GPUParticles3DEditor::_bind_methods() { } -ParticlesEditor::ParticlesEditor() { +GPUParticles3DEditor::GPUParticles3DEditor() { - node = NULL; + node = nullptr; particles_editor_hb = memnew(HBoxContainer); - SpatialEditor::get_singleton()->add_control_to_menu_panel(particles_editor_hb); + Node3DEditor::get_singleton()->add_control_to_menu_panel(particles_editor_hb); options = memnew(MenuButton); options->set_switch_on_hover(true); particles_editor_hb->add_child(options); particles_editor_hb->hide(); - options->set_text(TTR("Particles")); + options->set_text(TTR("GPUParticles3D")); + options->get_popup()->add_item(TTR("Restart"), MENU_OPTION_RESTART); options->get_popup()->add_item(TTR("Generate AABB"), MENU_OPTION_GENERATE_AABB); - options->get_popup()->add_separator(); options->get_popup()->add_item(TTR("Create Emission Points From Node"), MENU_OPTION_CREATE_EMISSION_VOLUME_FROM_NODE); - options->get_popup()->add_separator(); - options->get_popup()->add_item(TTR("Convert to CPUParticles"), MENU_OPTION_CONVERT_TO_CPU_PARTICLES); - options->get_popup()->add_separator(); - options->get_popup()->add_item(TTR("Restart"), MENU_OPTION_RESTART); + options->get_popup()->add_item(TTR("Convert to CPUParticles3D"), MENU_OPTION_CONVERT_TO_CPU_PARTICLES); - options->get_popup()->connect("id_pressed", callable_mp(this, &ParticlesEditor::_menu_option)); + options->get_popup()->connect("id_pressed", callable_mp(this, &GPUParticles3DEditor::_menu_option)); generate_aabb = memnew(ConfirmationDialog); generate_aabb->set_title(TTR("Generate Visibility AABB")); @@ -455,20 +452,20 @@ ParticlesEditor::ParticlesEditor() { add_child(generate_aabb); - generate_aabb->connect("confirmed", callable_mp(this, &ParticlesEditor::_generate_aabb)); + generate_aabb->connect("confirmed", callable_mp(this, &GPUParticles3DEditor::_generate_aabb)); } -void ParticlesEditorPlugin::edit(Object *p_object) { +void GPUParticles3DEditorPlugin::edit(Object *p_object) { - particles_editor->edit(Object::cast_to<Particles>(p_object)); + particles_editor->edit(Object::cast_to<GPUParticles3D>(p_object)); } -bool ParticlesEditorPlugin::handles(Object *p_object) const { +bool GPUParticles3DEditorPlugin::handles(Object *p_object) const { - return p_object->is_class("Particles"); + return p_object->is_class("GPUParticles3D"); } -void ParticlesEditorPlugin::make_visible(bool p_visible) { +void GPUParticles3DEditorPlugin::make_visible(bool p_visible) { if (p_visible) { particles_editor->show(); @@ -476,18 +473,18 @@ void ParticlesEditorPlugin::make_visible(bool p_visible) { } else { particles_editor->particles_editor_hb->hide(); particles_editor->hide(); - particles_editor->edit(NULL); + particles_editor->edit(nullptr); } } -ParticlesEditorPlugin::ParticlesEditorPlugin(EditorNode *p_node) { +GPUParticles3DEditorPlugin::GPUParticles3DEditorPlugin(EditorNode *p_node) { editor = p_node; - particles_editor = memnew(ParticlesEditor); + particles_editor = memnew(GPUParticles3DEditor); editor->get_viewport()->add_child(particles_editor); particles_editor->hide(); } -ParticlesEditorPlugin::~ParticlesEditorPlugin() { +GPUParticles3DEditorPlugin::~GPUParticles3DEditorPlugin() { } diff --git a/editor/plugins/particles_editor_plugin.h b/editor/plugins/gpu_particles_3d_editor_plugin.h index fb5ce17560..cf1cff32c0 100644 --- a/editor/plugins/particles_editor_plugin.h +++ b/editor/plugins/gpu_particles_3d_editor_plugin.h @@ -1,5 +1,5 @@ /*************************************************************************/ -/* particles_editor_plugin.h */ +/* gpu_particles_3d_editor_plugin.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ @@ -33,15 +33,15 @@ #include "editor/editor_node.h" #include "editor/editor_plugin.h" -#include "scene/3d/particles.h" +#include "scene/3d/gpu_particles_3d.h" #include "scene/gui/spin_box.h" -class ParticlesEditorBase : public Control { +class GPUParticles3DEditorBase : public Control { - GDCLASS(ParticlesEditorBase, Control); + GDCLASS(GPUParticles3DEditorBase, Control); protected: - Spatial *base_node; + Node3D *base_node; Panel *panel; MenuButton *options; HBoxContainer *particles_editor_hb; @@ -61,16 +61,16 @@ protected: static void _bind_methods(); public: - ParticlesEditorBase(); + GPUParticles3DEditorBase(); }; -class ParticlesEditor : public ParticlesEditorBase { +class GPUParticles3DEditor : public GPUParticles3DEditorBase { - GDCLASS(ParticlesEditor, ParticlesEditorBase); + GDCLASS(GPUParticles3DEditor, GPUParticles3DEditorBase); ConfirmationDialog *generate_aabb; SpinBox *generate_seconds; - Particles *node; + GPUParticles3D *node; enum Menu { @@ -86,7 +86,7 @@ class ParticlesEditor : public ParticlesEditorBase { void _menu_option(int); - friend class ParticlesEditorPlugin; + friend class GPUParticles3DEditorPlugin; virtual void _generate_emission_points(); @@ -96,26 +96,26 @@ protected: static void _bind_methods(); public: - void edit(Particles *p_particles); - ParticlesEditor(); + void edit(GPUParticles3D *p_particles); + GPUParticles3DEditor(); }; -class ParticlesEditorPlugin : public EditorPlugin { +class GPUParticles3DEditorPlugin : public EditorPlugin { - GDCLASS(ParticlesEditorPlugin, EditorPlugin); + GDCLASS(GPUParticles3DEditorPlugin, EditorPlugin); - ParticlesEditor *particles_editor; + GPUParticles3DEditor *particles_editor; EditorNode *editor; public: - virtual String get_name() const { return "Particles"; } + virtual String get_name() const { return "GPUParticles3D"; } bool has_main_screen() const { return false; } virtual void edit(Object *p_object); virtual bool handles(Object *p_object) const; virtual void make_visible(bool p_visible); - ParticlesEditorPlugin(EditorNode *p_node); - ~ParticlesEditorPlugin(); + GPUParticles3DEditorPlugin(EditorNode *p_node); + ~GPUParticles3DEditorPlugin(); }; #endif // PARTICLES_EDITOR_PLUGIN_H diff --git a/editor/plugins/gradient_editor_plugin.cpp b/editor/plugins/gradient_editor_plugin.cpp index ff03fcf159..67de610ae7 100644 --- a/editor/plugins/gradient_editor_plugin.cpp +++ b/editor/plugins/gradient_editor_plugin.cpp @@ -32,7 +32,7 @@ #include "canvas_item_editor_plugin.h" #include "editor/editor_scale.h" -#include "spatial_editor_plugin.h" +#include "node_3d_editor_plugin.h" Size2 GradientEditor::get_minimum_size() const { return Size2(0, 60) * EDSCALE; @@ -79,7 +79,7 @@ GradientEditor::GradientEditor() { bool EditorInspectorPluginGradient::can_handle(Object *p_object) { - return Object::cast_to<Gradient>(p_object) != NULL; + return Object::cast_to<Gradient>(p_object) != nullptr; } void EditorInspectorPluginGradient::parse_begin(Object *p_object) { diff --git a/editor/plugins/item_list_editor_plugin.cpp b/editor/plugins/item_list_editor_plugin.cpp index ba640883c7..1dbc78804b 100644 --- a/editor/plugins/item_list_editor_plugin.cpp +++ b/editor/plugins/item_list_editor_plugin.cpp @@ -163,7 +163,7 @@ void ItemListOptionButtonPlugin::erase(int p_idx) { ItemListOptionButtonPlugin::ItemListOptionButtonPlugin() { - ob = NULL; + ob = nullptr; } /////////////////////////////////////////////////////////////// @@ -205,7 +205,7 @@ void ItemListPopupMenuPlugin::erase(int p_idx) { ItemListPopupMenuPlugin::ItemListPopupMenuPlugin() { - pp = NULL; + pp = nullptr; } /////////////////////////////////////////////////////////////// @@ -244,7 +244,7 @@ void ItemListItemListPlugin::erase(int p_idx) { ItemListItemListPlugin::ItemListItemListPlugin() { - pp = NULL; + pp = nullptr; } /////////////////////////////////////////////////////////////// @@ -254,7 +254,7 @@ ItemListItemListPlugin::ItemListItemListPlugin() { void ItemListEditor::_node_removed(Node *p_node) { if (p_node == item_list) { - item_list = NULL; + item_list = nullptr; hide(); dialog->hide(); } @@ -264,8 +264,8 @@ void ItemListEditor::_notification(int p_notification) { if (p_notification == NOTIFICATION_ENTER_TREE || p_notification == NOTIFICATION_THEME_CHANGED) { - add_button->set_icon(get_icon("Add", "EditorIcons")); - del_button->set_icon(get_icon("Remove", "EditorIcons")); + add_button->set_icon(get_theme_icon("Add", "EditorIcons")); + del_button->set_icon(get_theme_icon("Remove", "EditorIcons")); } else if (p_notification == NOTIFICATION_READY) { get_tree()->connect("node_removed", callable_mp(this, &ItemListEditor::_node_removed)); @@ -311,7 +311,7 @@ void ItemListEditor::edit(Node *p_item_list) { if (!item_list) { selected_idx = -1; - property_editor->edit(NULL); + property_editor->edit(nullptr); return; } @@ -329,7 +329,7 @@ void ItemListEditor::edit(Node *p_item_list) { } selected_idx = -1; - property_editor->edit(NULL); + property_editor->edit(nullptr); } bool ItemListEditor::handles(Object *p_object) const { @@ -349,7 +349,7 @@ void ItemListEditor::_bind_methods() { ItemListEditor::ItemListEditor() { selected_idx = -1; - item_list = NULL; + item_list = nullptr; toolbar_button = memnew(ToolButton); toolbar_button->set_text(TTR("Items")); @@ -408,7 +408,7 @@ void ItemListEditorPlugin::make_visible(bool p_visible) { } else { item_list_editor->hide(); - item_list_editor->edit(NULL); + item_list_editor->edit(nullptr); } } diff --git a/editor/plugins/light_occluder_2d_editor_plugin.cpp b/editor/plugins/light_occluder_2d_editor_plugin.cpp index 22df287f97..f8550a884b 100644 --- a/editor/plugins/light_occluder_2d_editor_plugin.cpp +++ b/editor/plugins/light_occluder_2d_editor_plugin.cpp @@ -112,7 +112,7 @@ void LightOccluder2DEditor::_create_resource() { LightOccluder2DEditor::LightOccluder2DEditor(EditorNode *p_editor) : AbstractPolygon2DEditor(p_editor) { - node = NULL; + node = nullptr; } LightOccluder2DEditorPlugin::LightOccluder2DEditorPlugin(EditorNode *p_node) : diff --git a/editor/plugins/line_2d_editor_plugin.cpp b/editor/plugins/line_2d_editor_plugin.cpp index 4ac9d0af3b..5b887390a6 100644 --- a/editor/plugins/line_2d_editor_plugin.cpp +++ b/editor/plugins/line_2d_editor_plugin.cpp @@ -64,7 +64,7 @@ void Line2DEditor::_action_set_polygon(int p_idx, const Variant &p_previous, con Line2DEditor::Line2DEditor(EditorNode *p_editor) : AbstractPolygon2DEditor(p_editor) { - node = NULL; + node = nullptr; } Line2DEditorPlugin::Line2DEditorPlugin(EditorNode *p_node) : diff --git a/editor/plugins/material_editor_plugin.cpp b/editor/plugins/material_editor_plugin.cpp index b39465f618..eb14495b9c 100644 --- a/editor/plugins/material_editor_plugin.cpp +++ b/editor/plugins/material_editor_plugin.cpp @@ -31,8 +31,9 @@ #include "material_editor_plugin.h" #include "editor/editor_scale.h" -#include "scene/gui/viewport_container.h" +#include "scene/gui/subviewport_container.h" #include "scene/resources/particles_material.h" +#include "scene/resources/sky_material.h" void MaterialEditor::_notification(int p_what) { @@ -43,15 +44,15 @@ void MaterialEditor::_notification(int p_what) { if (first_enter) { //it's in propertyeditor so.. could be moved around - light_1_switch->set_normal_texture(get_icon("MaterialPreviewLight1", "EditorIcons")); - light_1_switch->set_pressed_texture(get_icon("MaterialPreviewLight1Off", "EditorIcons")); - light_2_switch->set_normal_texture(get_icon("MaterialPreviewLight2", "EditorIcons")); - light_2_switch->set_pressed_texture(get_icon("MaterialPreviewLight2Off", "EditorIcons")); + light_1_switch->set_normal_texture(get_theme_icon("MaterialPreviewLight1", "EditorIcons")); + light_1_switch->set_pressed_texture(get_theme_icon("MaterialPreviewLight1Off", "EditorIcons")); + light_2_switch->set_normal_texture(get_theme_icon("MaterialPreviewLight2", "EditorIcons")); + light_2_switch->set_pressed_texture(get_theme_icon("MaterialPreviewLight2Off", "EditorIcons")); - sphere_switch->set_normal_texture(get_icon("MaterialPreviewSphereOff", "EditorIcons")); - sphere_switch->set_pressed_texture(get_icon("MaterialPreviewSphere", "EditorIcons")); - box_switch->set_normal_texture(get_icon("MaterialPreviewCubeOff", "EditorIcons")); - box_switch->set_pressed_texture(get_icon("MaterialPreviewCube", "EditorIcons")); + sphere_switch->set_normal_texture(get_theme_icon("MaterialPreviewSphereOff", "EditorIcons")); + sphere_switch->set_pressed_texture(get_theme_icon("MaterialPreviewSphere", "EditorIcons")); + box_switch->set_normal_texture(get_theme_icon("MaterialPreviewCubeOff", "EditorIcons")); + box_switch->set_pressed_texture(get_theme_icon("MaterialPreviewCube", "EditorIcons")); first_enter = false; } @@ -59,7 +60,7 @@ void MaterialEditor::_notification(int p_what) { if (p_what == NOTIFICATION_DRAW) { - Ref<Texture2D> checkerboard = get_icon("Checkerboard", "EditorIcons"); + Ref<Texture2D> checkerboard = get_theme_icon("Checkerboard", "EditorIcons"); Size2 size = get_size(); draw_texture_rect(checkerboard, Rect2(Point2(), size), true); @@ -94,6 +95,7 @@ void MaterialEditor::_button_pressed(Node *p_button) { sphere_instance->hide(); box_switch->set_pressed(true); sphere_switch->set_pressed(false); + EditorSettings::get_singleton()->set_project_metadata("inspector_options", "material_preview_on_sphere", false); } if (p_button == sphere_switch) { @@ -101,6 +103,7 @@ void MaterialEditor::_button_pressed(Node *p_button) { sphere_instance->show(); box_switch->set_pressed(false); sphere_switch->set_pressed(true); + EditorSettings::get_singleton()->set_project_metadata("inspector_options", "material_preview_on_sphere", true); } } @@ -109,12 +112,12 @@ void MaterialEditor::_bind_methods() { MaterialEditor::MaterialEditor() { - vc = memnew(ViewportContainer); + vc = memnew(SubViewportContainer); vc->set_stretch(true); add_child(vc); vc->set_anchors_and_margins_preset(PRESET_WIDE); - viewport = memnew(Viewport); - Ref<World> world; + viewport = memnew(SubViewport); + Ref<World3D> world; world.instance(); viewport->set_world(world); //use own world vc->add_child(viewport); @@ -122,25 +125,25 @@ MaterialEditor::MaterialEditor() { viewport->set_transparent_background(true); viewport->set_msaa(Viewport::MSAA_4X); - camera = memnew(Camera); + camera = memnew(Camera3D); camera->set_transform(Transform(Basis(), Vector3(0, 0, 3))); camera->set_perspective(45, 0.1, 10); camera->make_current(); viewport->add_child(camera); - light1 = memnew(DirectionalLight); + light1 = memnew(DirectionalLight3D); light1->set_transform(Transform().looking_at(Vector3(-1, -1, -1), Vector3(0, 1, 0))); viewport->add_child(light1); - light2 = memnew(DirectionalLight); + light2 = memnew(DirectionalLight3D); light2->set_transform(Transform().looking_at(Vector3(0, 1, 0), Vector3(0, 0, 1))); light2->set_color(Color(0.7, 0.7, 0.7)); viewport->add_child(light2); - sphere_instance = memnew(MeshInstance); + sphere_instance = memnew(MeshInstance3D); viewport->add_child(sphere_instance); - box_instance = memnew(MeshInstance); + box_instance = memnew(MeshInstance3D); viewport->add_child(box_instance); Transform box_xform; @@ -154,7 +157,6 @@ MaterialEditor::MaterialEditor() { sphere_instance->set_mesh(sphere_mesh); box_mesh.instance(); box_instance->set_mesh(box_mesh); - box_instance->hide(); set_custom_minimum_size(Size2(1, 150) * EDSCALE); @@ -193,6 +195,15 @@ MaterialEditor::MaterialEditor() { light_2_switch->connect("pressed", callable_mp(this, &MaterialEditor::_button_pressed), varray(light_2_switch)); first_enter = true; + + if (EditorSettings::get_singleton()->get_project_metadata("inspector_options", "material_preview_on_sphere", true)) { + box_instance->hide(); + } else { + box_instance->show(); + sphere_instance->hide(); + box_switch->set_pressed(true); + sphere_switch->set_pressed(false); + } } /////////////////////// @@ -221,8 +232,8 @@ void EditorInspectorPluginMaterial::parse_begin(Object *p_object) { EditorInspectorPluginMaterial::EditorInspectorPluginMaterial() { env.instance(); - Ref<ProceduralSky> proc_sky = memnew(ProceduralSky(true)); - env->set_sky(proc_sky); + Ref<Sky> sky = memnew(Sky()); + env->set_sky(sky); env->set_background(Environment::BG_COLOR); env->set_ambient_source(Environment::AMBIENT_SOURCE_SKY); env->set_reflection_source(Environment::REFLECTION_SOURCE_SKY); @@ -255,14 +266,14 @@ Ref<Resource> StandardMaterial3DConversionPlugin::convert(const Ref<Resource> &p Ref<Shader> shader; shader.instance(); - String code = VS::get_singleton()->shader_get_code(mat->get_shader_rid()); + String code = RS::get_singleton()->shader_get_code(mat->get_shader_rid()); shader->set_code(code); smat->set_shader(shader); List<PropertyInfo> params; - VS::get_singleton()->shader_get_param_list(mat->get_shader_rid(), ¶ms); + RS::get_singleton()->shader_get_param_list(mat->get_shader_rid(), ¶ms); for (List<PropertyInfo>::Element *E = params.front(); E; E = E->next()) { @@ -272,7 +283,7 @@ Ref<Resource> StandardMaterial3DConversionPlugin::convert(const Ref<Resource> &p if (texture.is_valid()) { smat->set_shader_param(E->get().name, texture); } else { - Variant value = VS::get_singleton()->material_get_param(mat->get_rid(), E->get().name); + Variant value = RS::get_singleton()->material_get_param(mat->get_rid(), E->get().name); smat->set_shader_param(E->get().name, value); } } @@ -301,17 +312,17 @@ Ref<Resource> ParticlesMaterialConversionPlugin::convert(const Ref<Resource> &p_ Ref<Shader> shader; shader.instance(); - String code = VS::get_singleton()->shader_get_code(mat->get_shader_rid()); + String code = RS::get_singleton()->shader_get_code(mat->get_shader_rid()); shader->set_code(code); smat->set_shader(shader); List<PropertyInfo> params; - VS::get_singleton()->shader_get_param_list(mat->get_shader_rid(), ¶ms); + RS::get_singleton()->shader_get_param_list(mat->get_shader_rid(), ¶ms); for (List<PropertyInfo>::Element *E = params.front(); E; E = E->next()) { - Variant value = VS::get_singleton()->material_get_param(mat->get_rid(), E->get().name); + Variant value = RS::get_singleton()->material_get_param(mat->get_rid(), E->get().name); smat->set_shader_param(E->get().name, value); } @@ -339,17 +350,131 @@ Ref<Resource> CanvasItemMaterialConversionPlugin::convert(const Ref<Resource> &p Ref<Shader> shader; shader.instance(); - String code = VS::get_singleton()->shader_get_code(mat->get_shader_rid()); + String code = RS::get_singleton()->shader_get_code(mat->get_shader_rid()); + + shader->set_code(code); + + smat->set_shader(shader); + + List<PropertyInfo> params; + RS::get_singleton()->shader_get_param_list(mat->get_shader_rid(), ¶ms); + + for (List<PropertyInfo>::Element *E = params.front(); E; E = E->next()) { + Variant value = RS::get_singleton()->material_get_param(mat->get_rid(), E->get().name); + smat->set_shader_param(E->get().name, value); + } + + smat->set_render_priority(mat->get_render_priority()); + return smat; +} + +String ProceduralSkyMaterialConversionPlugin::converts_to() const { + + return "ShaderMaterial"; +} +bool ProceduralSkyMaterialConversionPlugin::handles(const Ref<Resource> &p_resource) const { + + Ref<ProceduralSkyMaterial> mat = p_resource; + return mat.is_valid(); +} +Ref<Resource> ProceduralSkyMaterialConversionPlugin::convert(const Ref<Resource> &p_resource) const { + + Ref<ProceduralSkyMaterial> mat = p_resource; + ERR_FAIL_COND_V(!mat.is_valid(), Ref<Resource>()); + + Ref<ShaderMaterial> smat; + smat.instance(); + + Ref<Shader> shader; + shader.instance(); + + String code = RS::get_singleton()->shader_get_code(mat->get_shader_rid()); + + shader->set_code(code); + + smat->set_shader(shader); + + List<PropertyInfo> params; + RS::get_singleton()->shader_get_param_list(mat->get_shader_rid(), ¶ms); + + for (List<PropertyInfo>::Element *E = params.front(); E; E = E->next()) { + Variant value = RS::get_singleton()->material_get_param(mat->get_rid(), E->get().name); + smat->set_shader_param(E->get().name, value); + } + + smat->set_render_priority(mat->get_render_priority()); + return smat; +} + +String PanoramaSkyMaterialConversionPlugin::converts_to() const { + + return "ShaderMaterial"; +} +bool PanoramaSkyMaterialConversionPlugin::handles(const Ref<Resource> &p_resource) const { + + Ref<PanoramaSkyMaterial> mat = p_resource; + return mat.is_valid(); +} +Ref<Resource> PanoramaSkyMaterialConversionPlugin::convert(const Ref<Resource> &p_resource) const { + + Ref<PanoramaSkyMaterial> mat = p_resource; + ERR_FAIL_COND_V(!mat.is_valid(), Ref<Resource>()); + + Ref<ShaderMaterial> smat; + smat.instance(); + + Ref<Shader> shader; + shader.instance(); + + String code = RS::get_singleton()->shader_get_code(mat->get_shader_rid()); + + shader->set_code(code); + + smat->set_shader(shader); + + List<PropertyInfo> params; + RS::get_singleton()->shader_get_param_list(mat->get_shader_rid(), ¶ms); + + for (List<PropertyInfo>::Element *E = params.front(); E; E = E->next()) { + Variant value = RS::get_singleton()->material_get_param(mat->get_rid(), E->get().name); + smat->set_shader_param(E->get().name, value); + } + + smat->set_render_priority(mat->get_render_priority()); + return smat; +} + +String PhysicalSkyMaterialConversionPlugin::converts_to() const { + + return "ShaderMaterial"; +} +bool PhysicalSkyMaterialConversionPlugin::handles(const Ref<Resource> &p_resource) const { + + Ref<PhysicalSkyMaterial> mat = p_resource; + return mat.is_valid(); +} +Ref<Resource> PhysicalSkyMaterialConversionPlugin::convert(const Ref<Resource> &p_resource) const { + + Ref<PhysicalSkyMaterial> mat = p_resource; + ERR_FAIL_COND_V(!mat.is_valid(), Ref<Resource>()); + + Ref<ShaderMaterial> smat; + smat.instance(); + + Ref<Shader> shader; + shader.instance(); + + String code = RS::get_singleton()->shader_get_code(mat->get_shader_rid()); shader->set_code(code); smat->set_shader(shader); List<PropertyInfo> params; - VS::get_singleton()->shader_get_param_list(mat->get_shader_rid(), ¶ms); + RS::get_singleton()->shader_get_param_list(mat->get_shader_rid(), ¶ms); for (List<PropertyInfo>::Element *E = params.front(); E; E = E->next()) { - Variant value = VS::get_singleton()->material_get_param(mat->get_rid(), E->get().name); + Variant value = RS::get_singleton()->material_get_param(mat->get_rid(), E->get().name); smat->set_shader_param(E->get().name, value); } diff --git a/editor/plugins/material_editor_plugin.h b/editor/plugins/material_editor_plugin.h index 95a6c4bf8f..50036e4f72 100644 --- a/editor/plugins/material_editor_plugin.h +++ b/editor/plugins/material_editor_plugin.h @@ -36,24 +36,24 @@ #include "editor/editor_node.h" #include "editor/editor_plugin.h" -#include "scene/3d/camera.h" -#include "scene/3d/light.h" -#include "scene/3d/mesh_instance.h" +#include "scene/3d/camera_3d.h" +#include "scene/3d/light_3d.h" +#include "scene/3d/mesh_instance_3d.h" #include "scene/resources/material.h" -class ViewportContainer; +class SubViewportContainer; class MaterialEditor : public Control { GDCLASS(MaterialEditor, Control); - ViewportContainer *vc; - Viewport *viewport; - MeshInstance *sphere_instance; - MeshInstance *box_instance; - DirectionalLight *light1; - DirectionalLight *light2; - Camera *camera; + SubViewportContainer *vc; + SubViewport *viewport; + MeshInstance3D *sphere_instance; + MeshInstance3D *box_instance; + DirectionalLight3D *light1; + DirectionalLight3D *light2; + Camera3D *camera; Ref<SphereMesh> sphere_mesh; Ref<CubeMesh> box_mesh; @@ -127,4 +127,31 @@ public: virtual Ref<Resource> convert(const Ref<Resource> &p_resource) const; }; +class ProceduralSkyMaterialConversionPlugin : public EditorResourceConversionPlugin { + GDCLASS(ProceduralSkyMaterialConversionPlugin, EditorResourceConversionPlugin); + +public: + virtual String converts_to() const; + virtual bool handles(const Ref<Resource> &p_resource) const; + virtual Ref<Resource> convert(const Ref<Resource> &p_resource) const; +}; + +class PanoramaSkyMaterialConversionPlugin : public EditorResourceConversionPlugin { + GDCLASS(PanoramaSkyMaterialConversionPlugin, EditorResourceConversionPlugin); + +public: + virtual String converts_to() const; + virtual bool handles(const Ref<Resource> &p_resource) const; + virtual Ref<Resource> convert(const Ref<Resource> &p_resource) const; +}; + +class PhysicalSkyMaterialConversionPlugin : public EditorResourceConversionPlugin { + GDCLASS(PhysicalSkyMaterialConversionPlugin, EditorResourceConversionPlugin); + +public: + virtual String converts_to() const; + virtual bool handles(const Ref<Resource> &p_resource) const; + virtual Ref<Resource> convert(const Ref<Resource> &p_resource) const; +}; + #endif // MATERIAL_EDITOR_PLUGIN_H diff --git a/editor/plugins/mesh_editor_plugin.cpp b/editor/plugins/mesh_editor_plugin.cpp index 5a17f0d4f1..5e657c3b71 100644 --- a/editor/plugins/mesh_editor_plugin.cpp +++ b/editor/plugins/mesh_editor_plugin.cpp @@ -57,10 +57,10 @@ void MeshEditor::_notification(int p_what) { if (first_enter) { //it's in propertyeditor so. could be moved around - light_1_switch->set_normal_texture(get_icon("MaterialPreviewLight1", "EditorIcons")); - light_1_switch->set_pressed_texture(get_icon("MaterialPreviewLight1Off", "EditorIcons")); - light_2_switch->set_normal_texture(get_icon("MaterialPreviewLight2", "EditorIcons")); - light_2_switch->set_pressed_texture(get_icon("MaterialPreviewLight2Off", "EditorIcons")); + light_1_switch->set_normal_texture(get_theme_icon("MaterialPreviewLight1", "EditorIcons")); + light_1_switch->set_pressed_texture(get_theme_icon("MaterialPreviewLight1Off", "EditorIcons")); + light_2_switch->set_normal_texture(get_theme_icon("MaterialPreviewLight2", "EditorIcons")); + light_2_switch->set_pressed_texture(get_theme_icon("MaterialPreviewLight2Off", "EditorIcons")); first_enter = false; } } @@ -115,31 +115,31 @@ void MeshEditor::_bind_methods() { MeshEditor::MeshEditor() { - viewport = memnew(Viewport); - Ref<World> world; + viewport = memnew(SubViewport); + Ref<World3D> world; world.instance(); viewport->set_world(world); //use own world add_child(viewport); viewport->set_disable_input(true); viewport->set_msaa(Viewport::MSAA_2X); set_stretch(true); - camera = memnew(Camera); + camera = memnew(Camera3D); camera->set_transform(Transform(Basis(), Vector3(0, 0, 1.1))); camera->set_perspective(45, 0.1, 10); viewport->add_child(camera); - light1 = memnew(DirectionalLight); + light1 = memnew(DirectionalLight3D); light1->set_transform(Transform().looking_at(Vector3(-1, -1, -1), Vector3(0, 1, 0))); viewport->add_child(light1); - light2 = memnew(DirectionalLight); + light2 = memnew(DirectionalLight3D); light2->set_transform(Transform().looking_at(Vector3(0, 1, 0), Vector3(0, 0, 1))); light2->set_color(Color(0.7, 0.7, 0.7)); viewport->add_child(light2); - rotation = memnew(Spatial); + rotation = memnew(Node3D); viewport->add_child(rotation); - mesh_instance = memnew(MeshInstance); + mesh_instance = memnew(MeshInstance3D); rotation->add_child(mesh_instance); set_custom_minimum_size(Size2(1, 150) * EDSCALE); @@ -173,7 +173,7 @@ MeshEditor::MeshEditor() { bool EditorInspectorPluginMesh::can_handle(Object *p_object) { - return Object::cast_to<Mesh>(p_object) != NULL; + return Object::cast_to<Mesh>(p_object) != nullptr; } void EditorInspectorPluginMesh::parse_begin(Object *p_object) { diff --git a/editor/plugins/mesh_editor_plugin.h b/editor/plugins/mesh_editor_plugin.h index 87c4a1776b..072e21f260 100644 --- a/editor/plugins/mesh_editor_plugin.h +++ b/editor/plugins/mesh_editor_plugin.h @@ -33,25 +33,25 @@ #include "editor/editor_node.h" #include "editor/editor_plugin.h" -#include "scene/3d/camera.h" -#include "scene/3d/light.h" -#include "scene/3d/mesh_instance.h" -#include "scene/gui/viewport_container.h" +#include "scene/3d/camera_3d.h" +#include "scene/3d/light_3d.h" +#include "scene/3d/mesh_instance_3d.h" +#include "scene/gui/subviewport_container.h" #include "scene/resources/material.h" -class MeshEditor : public ViewportContainer { +class MeshEditor : public SubViewportContainer { - GDCLASS(MeshEditor, ViewportContainer); + GDCLASS(MeshEditor, SubViewportContainer); float rot_x; float rot_y; - Viewport *viewport; - MeshInstance *mesh_instance; - Spatial *rotation; - DirectionalLight *light1; - DirectionalLight *light2; - Camera *camera; + SubViewport *viewport; + MeshInstance3D *mesh_instance; + Node3D *rotation; + DirectionalLight3D *light1; + DirectionalLight3D *light2; + Camera3D *camera; Ref<Mesh> mesh; diff --git a/editor/plugins/mesh_instance_editor_plugin.cpp b/editor/plugins/mesh_instance_3d_editor_plugin.cpp index 6025e7dd9d..7819f62bc7 100644 --- a/editor/plugins/mesh_instance_editor_plugin.cpp +++ b/editor/plugins/mesh_instance_3d_editor_plugin.cpp @@ -1,5 +1,5 @@ /*************************************************************************/ -/* mesh_instance_editor_plugin.cpp */ +/* mesh_instance_3d_editor_plugin.cpp */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ @@ -28,34 +28,34 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#include "mesh_instance_editor_plugin.h" +#include "mesh_instance_3d_editor_plugin.h" #include "editor/editor_scale.h" -#include "scene/3d/collision_shape.h" -#include "scene/3d/navigation_region.h" -#include "scene/3d/physics_body.h" +#include "node_3d_editor_plugin.h" +#include "scene/3d/collision_shape_3d.h" +#include "scene/3d/navigation_region_3d.h" +#include "scene/3d/physics_body_3d.h" #include "scene/gui/box_container.h" -#include "spatial_editor_plugin.h" -void MeshInstanceEditor::_node_removed(Node *p_node) { +void MeshInstance3DEditor::_node_removed(Node *p_node) { if (p_node == node) { - node = NULL; + node = nullptr; options->hide(); } } -void MeshInstanceEditor::edit(MeshInstance *p_mesh) { +void MeshInstance3DEditor::edit(MeshInstance3D *p_mesh) { node = p_mesh; } -void MeshInstanceEditor::_menu_option(int p_option) { +void MeshInstance3DEditor::_menu_option(int p_option) { Ref<Mesh> mesh = node->get_mesh(); if (mesh.is_null()) { err_dialog->set_text(TTR("Mesh is empty!")); - err_dialog->popup_centered_minsize(); + err_dialog->popup_centered(); return; } @@ -68,16 +68,16 @@ void MeshInstanceEditor::_menu_option(int p_option) { List<Node *> selection = editor_selection->get_selected_node_list(); if (selection.empty()) { - Ref<Shape> shape = mesh->create_trimesh_shape(); + Ref<Shape3D> shape = mesh->create_trimesh_shape(); if (shape.is_null()) { err_dialog->set_text(TTR("Couldn't create a Trimesh collision shape.")); - err_dialog->popup_centered_minsize(); + err_dialog->popup_centered(); return; } - CollisionShape *cshape = memnew(CollisionShape); + CollisionShape3D *cshape = memnew(CollisionShape3D); cshape->set_shape(shape); - StaticBody *body = memnew(StaticBody); + StaticBody3D *body = memnew(StaticBody3D); body->add_child(cshape); Node *owner = node == get_tree()->get_edited_scene_root() ? node : node->get_owner(); @@ -96,7 +96,7 @@ void MeshInstanceEditor::_menu_option(int p_option) { for (List<Node *>::Element *E = selection.front(); E; E = E->next()) { - MeshInstance *instance = Object::cast_to<MeshInstance>(E->get()); + MeshInstance3D *instance = Object::cast_to<MeshInstance3D>(E->get()); if (!instance) continue; @@ -104,13 +104,13 @@ void MeshInstanceEditor::_menu_option(int p_option) { if (m.is_null()) continue; - Ref<Shape> shape = m->create_trimesh_shape(); + Ref<Shape3D> shape = m->create_trimesh_shape(); if (shape.is_null()) continue; - CollisionShape *cshape = memnew(CollisionShape); + CollisionShape3D *cshape = memnew(CollisionShape3D); cshape->set_shape(shape); - StaticBody *body = memnew(StaticBody); + StaticBody3D *body = memnew(StaticBody3D); body->add_child(cshape); Node *owner = instance == get_tree()->get_edited_scene_root() ? instance : instance->get_owner(); @@ -130,15 +130,15 @@ void MeshInstanceEditor::_menu_option(int p_option) { if (node == get_tree()->get_edited_scene_root()) { err_dialog->set_text(TTR("This doesn't work on scene root!")); - err_dialog->popup_centered_minsize(); + err_dialog->popup_centered(); return; } - Ref<Shape> shape = mesh->create_trimesh_shape(); + Ref<Shape3D> shape = mesh->create_trimesh_shape(); if (shape.is_null()) return; - CollisionShape *cshape = memnew(CollisionShape); + CollisionShape3D *cshape = memnew(CollisionShape3D); cshape->set_shape(shape); Node *owner = node->get_owner(); @@ -158,22 +158,22 @@ void MeshInstanceEditor::_menu_option(int p_option) { if (node == get_tree()->get_edited_scene_root()) { err_dialog->set_text(TTR("Can't create a single convex collision shape for the scene root.")); - err_dialog->popup_centered_minsize(); + err_dialog->popup_centered(); return; } - Ref<Shape> shape = mesh->create_convex_shape(); + Ref<Shape3D> shape = mesh->create_convex_shape(); if (shape.is_null()) { err_dialog->set_text(TTR("Couldn't create a single convex collision shape.")); - err_dialog->popup_centered_minsize(); + err_dialog->popup_centered(); return; } UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo(); ur->create_action(TTR("Create Single Convex Shape")); - CollisionShape *cshape = memnew(CollisionShape); + CollisionShape3D *cshape = memnew(CollisionShape3D); cshape->set_shape(shape); cshape->set_transform(node->get_transform()); @@ -192,15 +192,15 @@ void MeshInstanceEditor::_menu_option(int p_option) { if (node == get_tree()->get_edited_scene_root()) { err_dialog->set_text(TTR("Can't create multiple convex collision shapes for the scene root.")); - err_dialog->popup_centered_minsize(); + err_dialog->popup_centered(); return; } - Vector<Ref<Shape>> shapes = mesh->convex_decompose(); + Vector<Ref<Shape3D>> shapes = mesh->convex_decompose(); if (!shapes.size()) { err_dialog->set_text(TTR("Couldn't create any collision shapes.")); - err_dialog->popup_centered_minsize(); + err_dialog->popup_centered(); return; } UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo(); @@ -209,7 +209,7 @@ void MeshInstanceEditor::_menu_option(int p_option) { for (int i = 0; i < shapes.size(); i++) { - CollisionShape *cshape = memnew(CollisionShape); + CollisionShape3D *cshape = memnew(CollisionShape3D); cshape->set_shape(shapes[i]); cshape->set_transform(node->get_transform()); @@ -233,7 +233,7 @@ void MeshInstanceEditor::_menu_option(int p_option) { return; nmesh->create_from_mesh(mesh); - NavigationRegion *nmi = memnew(NavigationRegion); + NavigationRegion3D *nmi = memnew(NavigationRegion3D); nmi->set_navigation_mesh(nmesh); Node *owner = node == get_tree()->get_edited_scene_root() ? node : node->get_owner(); @@ -258,14 +258,14 @@ void MeshInstanceEditor::_menu_option(int p_option) { Ref<ArrayMesh> mesh2 = node->get_mesh(); if (!mesh2.is_valid()) { err_dialog->set_text(TTR("Contained Mesh is not of type ArrayMesh.")); - err_dialog->popup_centered_minsize(); + err_dialog->popup_centered(); return; } Error err = mesh2->lightmap_unwrap(node->get_global_transform()); if (err != OK) { err_dialog->set_text(TTR("UV Unwrap failed, mesh may not be manifold?")); - err_dialog->popup_centered_minsize(); + err_dialog->popup_centered(); return; } @@ -274,7 +274,7 @@ void MeshInstanceEditor::_menu_option(int p_option) { Ref<Mesh> mesh2 = node->get_mesh(); if (!mesh2.is_valid()) { err_dialog->set_text(TTR("No mesh to debug.")); - err_dialog->popup_centered_minsize(); + err_dialog->popup_centered(); return; } _create_uv_lines(0); @@ -283,7 +283,7 @@ void MeshInstanceEditor::_menu_option(int p_option) { Ref<Mesh> mesh2 = node->get_mesh(); if (!mesh2.is_valid()) { err_dialog->set_text(TTR("No mesh to debug.")); - err_dialog->popup_centered_minsize(); + err_dialog->popup_centered(); return; } _create_uv_lines(1); @@ -291,20 +291,20 @@ void MeshInstanceEditor::_menu_option(int p_option) { } } -struct MeshInstanceEditorEdgeSort { +struct MeshInstance3DEditorEdgeSort { Vector2 a; Vector2 b; - bool operator<(const MeshInstanceEditorEdgeSort &p_b) const { + bool operator<(const MeshInstance3DEditorEdgeSort &p_b) const { if (a == p_b.a) return b < p_b.b; else return a < p_b.a; } - MeshInstanceEditorEdgeSort() {} - MeshInstanceEditorEdgeSort(const Vector2 &p_a, const Vector2 &p_b) { + MeshInstance3DEditorEdgeSort() {} + MeshInstance3DEditorEdgeSort(const Vector2 &p_a, const Vector2 &p_b) { if (p_a < p_b) { a = p_a; b = p_b; @@ -315,12 +315,12 @@ struct MeshInstanceEditorEdgeSort { } }; -void MeshInstanceEditor::_create_uv_lines(int p_layer) { +void MeshInstance3DEditor::_create_uv_lines(int p_layer) { Ref<Mesh> mesh = node->get_mesh(); ERR_FAIL_COND(!mesh.is_valid()); - Set<MeshInstanceEditorEdgeSort> edges; + Set<MeshInstance3DEditorEdgeSort> edges; uv_lines.clear(); for (int i = 0; i < mesh->get_surface_count(); i++) { if (mesh->surface_get_primitive_type(i) != Mesh::PRIMITIVE_TRIANGLES) @@ -330,33 +330,30 @@ void MeshInstanceEditor::_create_uv_lines(int p_layer) { Vector<Vector2> uv = a[p_layer == 0 ? Mesh::ARRAY_TEX_UV : Mesh::ARRAY_TEX_UV2]; if (uv.size() == 0) { err_dialog->set_text(TTR("Model has no UV in this layer")); - err_dialog->popup_centered_minsize(); + err_dialog->popup_centered(); return; } const Vector2 *r = uv.ptr(); Vector<int> indices = a[Mesh::ARRAY_INDEX]; - const int *ri; + const int *ri = nullptr; int ic; - bool use_indices; if (indices.size()) { ic = indices.size(); ri = indices.ptr(); - use_indices = true; } else { ic = uv.size(); - use_indices = false; } for (int j = 0; j < ic; j += 3) { for (int k = 0; k < 3; k++) { - MeshInstanceEditorEdgeSort edge; - if (use_indices) { + MeshInstance3DEditorEdgeSort edge; + if (ri) { edge.a = r[ri[j + k]]; edge.b = r[ri[j + ((k + 1) % 3)]]; } else { @@ -374,10 +371,10 @@ void MeshInstanceEditor::_create_uv_lines(int p_layer) { } } - debug_uv_dialog->popup_centered_minsize(); + debug_uv_dialog->popup_centered(); } -void MeshInstanceEditor::_debug_uv_draw() { +void MeshInstance3DEditor::_debug_uv_draw() { if (uv_lines.size() == 0) return; @@ -388,34 +385,34 @@ void MeshInstanceEditor::_debug_uv_draw() { debug_uv->draw_multiline(uv_lines, Color(1.0, 0.8, 0.7)); } -void MeshInstanceEditor::_create_outline_mesh() { +void MeshInstance3DEditor::_create_outline_mesh() { Ref<Mesh> mesh = node->get_mesh(); if (mesh.is_null()) { - err_dialog->set_text(TTR("MeshInstance lacks a Mesh!")); - err_dialog->popup_centered_minsize(); + err_dialog->set_text(TTR("MeshInstance3D lacks a Mesh.")); + err_dialog->popup_centered(); return; } if (mesh->get_surface_count() == 0) { - err_dialog->set_text(TTR("Mesh has not surface to create outlines from!")); - err_dialog->popup_centered_minsize(); + err_dialog->set_text(TTR("Mesh has not surface to create outlines from.")); + err_dialog->popup_centered(); return; } else if (mesh->get_surface_count() == 1 && mesh->surface_get_primitive_type(0) != Mesh::PRIMITIVE_TRIANGLES) { - err_dialog->set_text(TTR("Mesh primitive type is not PRIMITIVE_TRIANGLES!")); - err_dialog->popup_centered_minsize(); + err_dialog->set_text(TTR("Mesh primitive type is not PRIMITIVE_TRIANGLES.")); + err_dialog->popup_centered(); return; } Ref<Mesh> mesho = mesh->create_outline(outline_size->get_value()); if (mesho.is_null()) { - err_dialog->set_text(TTR("Could not create outline!")); - err_dialog->popup_centered_minsize(); + err_dialog->set_text(TTR("Could not create outline.")); + err_dialog->popup_centered(); return; } - MeshInstance *mi = memnew(MeshInstance); + MeshInstance3D *mi = memnew(MeshInstance3D); mi->set_mesh(mesho); Node *owner = node->get_owner(); if (get_tree()->get_edited_scene_root() == node) { @@ -434,20 +431,20 @@ void MeshInstanceEditor::_create_outline_mesh() { ur->commit_action(); } -void MeshInstanceEditor::_bind_methods() { +void MeshInstance3DEditor::_bind_methods() { } -MeshInstanceEditor::MeshInstanceEditor() { +MeshInstance3DEditor::MeshInstance3DEditor() { options = memnew(MenuButton); options->set_switch_on_hover(true); - SpatialEditor::get_singleton()->add_control_to_menu_panel(options); + Node3DEditor::get_singleton()->add_control_to_menu_panel(options); options->set_text(TTR("Mesh")); - options->set_icon(EditorNode::get_singleton()->get_gui_base()->get_icon("MeshInstance", "EditorIcons")); + options->set_icon(EditorNode::get_singleton()->get_gui_base()->get_theme_icon("MeshInstance3D", "EditorIcons")); options->get_popup()->add_item(TTR("Create Trimesh Static Body"), MENU_OPTION_CREATE_STATIC_TRIMESH_BODY); - options->get_popup()->set_item_tooltip(options->get_popup()->get_item_count() - 1, TTR("Creates a StaticBody and assigns a polygon-based collision shape to it automatically.\nThis is the most accurate (but slowest) option for collision detection.")); + options->get_popup()->set_item_tooltip(options->get_popup()->get_item_count() - 1, TTR("Creates a StaticBody3D and assigns a polygon-based collision shape to it automatically.\nThis is the most accurate (but slowest) option for collision detection.")); options->get_popup()->add_separator(); options->get_popup()->add_item(TTR("Create Trimesh Collision Sibling"), MENU_OPTION_CREATE_TRIMESH_COLLISION_SHAPE); options->get_popup()->set_item_tooltip(options->get_popup()->get_item_count() - 1, TTR("Creates a polygon-based collision shape.\nThis is the most accurate (but slowest) option for collision detection.")); @@ -459,13 +456,13 @@ MeshInstanceEditor::MeshInstanceEditor() { options->get_popup()->add_item(TTR("Create Navigation Mesh"), MENU_OPTION_CREATE_NAVMESH); options->get_popup()->add_separator(); options->get_popup()->add_item(TTR("Create Outline Mesh..."), MENU_OPTION_CREATE_OUTLINE_MESH); - options->get_popup()->set_item_tooltip(options->get_popup()->get_item_count() - 1, TTR("Creates a static outline mesh. The outline mesh will have its normals flipped automatically.\nThis can be used instead of the SpatialMaterial Grow property when using that property isn't possible.")); + options->get_popup()->set_item_tooltip(options->get_popup()->get_item_count() - 1, TTR("Creates a static outline mesh. The outline mesh will have its normals flipped automatically.\nThis can be used instead of the StandardMaterial Grow property when using that property isn't possible.")); options->get_popup()->add_separator(); options->get_popup()->add_item(TTR("View UV1"), MENU_OPTION_DEBUG_UV1); options->get_popup()->add_item(TTR("View UV2"), MENU_OPTION_DEBUG_UV2); options->get_popup()->add_item(TTR("Unwrap UV2 for Lightmap/AO"), MENU_OPTION_CREATE_UV2); - options->get_popup()->connect("id_pressed", callable_mp(this, &MeshInstanceEditor::_menu_option)); + options->get_popup()->connect("id_pressed", callable_mp(this, &MeshInstance3DEditor::_menu_option)); outline_dialog = memnew(ConfirmationDialog); outline_dialog->set_title(TTR("Create Outline Mesh")); @@ -483,7 +480,7 @@ MeshInstanceEditor::MeshInstanceEditor() { outline_dialog_vbc->add_margin_child(TTR("Outline Size:"), outline_size); add_child(outline_dialog); - outline_dialog->connect("confirmed", callable_mp(this, &MeshInstanceEditor::_create_outline_mesh)); + outline_dialog->connect("confirmed", callable_mp(this, &MeshInstance3DEditor::_create_outline_mesh)); err_dialog = memnew(AcceptDialog); add_child(err_dialog); @@ -493,39 +490,39 @@ MeshInstanceEditor::MeshInstanceEditor() { add_child(debug_uv_dialog); debug_uv = memnew(Control); debug_uv->set_custom_minimum_size(Size2(600, 600) * EDSCALE); - debug_uv->connect("draw", callable_mp(this, &MeshInstanceEditor::_debug_uv_draw)); + debug_uv->connect("draw", callable_mp(this, &MeshInstance3DEditor::_debug_uv_draw)); debug_uv_dialog->add_child(debug_uv); } -void MeshInstanceEditorPlugin::edit(Object *p_object) { +void MeshInstance3DEditorPlugin::edit(Object *p_object) { - mesh_editor->edit(Object::cast_to<MeshInstance>(p_object)); + mesh_editor->edit(Object::cast_to<MeshInstance3D>(p_object)); } -bool MeshInstanceEditorPlugin::handles(Object *p_object) const { +bool MeshInstance3DEditorPlugin::handles(Object *p_object) const { - return p_object->is_class("MeshInstance"); + return p_object->is_class("MeshInstance3D"); } -void MeshInstanceEditorPlugin::make_visible(bool p_visible) { +void MeshInstance3DEditorPlugin::make_visible(bool p_visible) { if (p_visible) { mesh_editor->options->show(); } else { mesh_editor->options->hide(); - mesh_editor->edit(NULL); + mesh_editor->edit(nullptr); } } -MeshInstanceEditorPlugin::MeshInstanceEditorPlugin(EditorNode *p_node) { +MeshInstance3DEditorPlugin::MeshInstance3DEditorPlugin(EditorNode *p_node) { editor = p_node; - mesh_editor = memnew(MeshInstanceEditor); + mesh_editor = memnew(MeshInstance3DEditor); editor->get_viewport()->add_child(mesh_editor); mesh_editor->options->hide(); } -MeshInstanceEditorPlugin::~MeshInstanceEditorPlugin() { +MeshInstance3DEditorPlugin::~MeshInstance3DEditorPlugin() { } diff --git a/editor/plugins/mesh_instance_editor_plugin.h b/editor/plugins/mesh_instance_3d_editor_plugin.h index 5ca9aa3fec..a5d90c42d5 100644 --- a/editor/plugins/mesh_instance_editor_plugin.h +++ b/editor/plugins/mesh_instance_3d_editor_plugin.h @@ -1,5 +1,5 @@ /*************************************************************************/ -/* mesh_instance_editor_plugin.h */ +/* mesh_instance_3d_editor_plugin.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ @@ -33,12 +33,12 @@ #include "editor/editor_node.h" #include "editor/editor_plugin.h" -#include "scene/3d/mesh_instance.h" +#include "scene/3d/mesh_instance_3d.h" #include "scene/gui/spin_box.h" -class MeshInstanceEditor : public Control { +class MeshInstance3DEditor : public Control { - GDCLASS(MeshInstanceEditor, Control); + GDCLASS(MeshInstance3DEditor, Control); enum Menu { @@ -53,7 +53,7 @@ class MeshInstanceEditor : public Control { MENU_OPTION_DEBUG_UV2, }; - MeshInstance *node; + MeshInstance3D *node; MenuButton *options; @@ -70,7 +70,7 @@ class MeshInstanceEditor : public Control { void _create_outline_mesh(); void _create_uv_lines(int p_layer); - friend class MeshInstanceEditorPlugin; + friend class MeshInstance3DEditorPlugin; void _debug_uv_draw(); @@ -79,26 +79,26 @@ protected: static void _bind_methods(); public: - void edit(MeshInstance *p_mesh); - MeshInstanceEditor(); + void edit(MeshInstance3D *p_mesh); + MeshInstance3DEditor(); }; -class MeshInstanceEditorPlugin : public EditorPlugin { +class MeshInstance3DEditorPlugin : public EditorPlugin { - GDCLASS(MeshInstanceEditorPlugin, EditorPlugin); + GDCLASS(MeshInstance3DEditorPlugin, EditorPlugin); - MeshInstanceEditor *mesh_editor; + MeshInstance3DEditor *mesh_editor; EditorNode *editor; public: - virtual String get_name() const { return "MeshInstance"; } + virtual String get_name() const { return "MeshInstance3D"; } bool has_main_screen() const { return false; } virtual void edit(Object *p_object); virtual bool handles(Object *p_object) const; virtual void make_visible(bool p_visible); - MeshInstanceEditorPlugin(EditorNode *p_node); - ~MeshInstanceEditorPlugin(); + MeshInstance3DEditorPlugin(EditorNode *p_node); + ~MeshInstance3DEditorPlugin(); }; #endif // MESH_EDITOR_PLUGIN_H diff --git a/editor/plugins/mesh_library_editor_plugin.cpp b/editor/plugins/mesh_library_editor_plugin.cpp index 4e63a498b8..a3e3d88ae2 100644 --- a/editor/plugins/mesh_library_editor_plugin.cpp +++ b/editor/plugins/mesh_library_editor_plugin.cpp @@ -33,12 +33,12 @@ #include "editor/editor_node.h" #include "editor/editor_settings.h" #include "main/main.h" -#include "scene/3d/mesh_instance.h" -#include "scene/3d/navigation_region.h" -#include "scene/3d/physics_body.h" -#include "scene/main/viewport.h" +#include "node_3d_editor_plugin.h" +#include "scene/3d/mesh_instance_3d.h" +#include "scene/3d/navigation_region_3d.h" +#include "scene/3d/physics_body_3d.h" +#include "scene/main/window.h" #include "scene/resources/packed_scene.h" -#include "spatial_editor_plugin.h" void MeshLibraryEditor::edit(const Ref<MeshLibrary> &p_mesh_library) { @@ -71,16 +71,16 @@ void MeshLibraryEditor::_import_scene(Node *p_scene, Ref<MeshLibrary> p_library, if (!p_merge) p_library->clear(); - Map<int, MeshInstance *> mesh_instances; + Map<int, MeshInstance3D *> mesh_instances; for (int i = 0; i < p_scene->get_child_count(); i++) { Node *child = p_scene->get_child(i); - if (!Object::cast_to<MeshInstance>(child)) { + if (!Object::cast_to<MeshInstance3D>(child)) { if (child->get_child_count() > 0) { child = child->get_child(0); - if (!Object::cast_to<MeshInstance>(child)) { + if (!Object::cast_to<MeshInstance3D>(child)) { continue; } @@ -88,7 +88,7 @@ void MeshLibraryEditor::_import_scene(Node *p_scene, Ref<MeshLibrary> p_library, continue; } - MeshInstance *mi = Object::cast_to<MeshInstance>(child); + MeshInstance3D *mi = Object::cast_to<MeshInstance3D>(child); Ref<Mesh> mesh = mi->get_mesh(); if (mesh.is_null()) continue; @@ -118,10 +118,10 @@ void MeshLibraryEditor::_import_scene(Node *p_scene, Ref<MeshLibrary> p_library, for (int j = 0; j < mi->get_child_count(); j++) { Node *child2 = mi->get_child(j); - if (!Object::cast_to<StaticBody>(child2)) + if (!Object::cast_to<StaticBody3D>(child2)) continue; - StaticBody *sb = Object::cast_to<StaticBody>(child2); + StaticBody3D *sb = Object::cast_to<StaticBody3D>(child2); List<uint32_t> shapes; sb->get_shape_owners(&shapes); @@ -135,7 +135,7 @@ void MeshLibraryEditor::_import_scene(Node *p_scene, Ref<MeshLibrary> p_library, for (int k = 0; k < sb->shape_owner_get_shape_count(E->get()); k++) { - Ref<Shape> collision = sb->shape_owner_get_shape(E->get(), k); + Ref<Shape3D> collision = sb->shape_owner_get_shape(E->get(), k); if (!collision.is_valid()) continue; MeshLibrary::ShapeData shape_data; @@ -152,9 +152,9 @@ void MeshLibraryEditor::_import_scene(Node *p_scene, Ref<MeshLibrary> p_library, Transform navmesh_transform; for (int j = 0; j < mi->get_child_count(); j++) { Node *child2 = mi->get_child(j); - if (!Object::cast_to<NavigationRegion>(child2)) + if (!Object::cast_to<NavigationRegion3D>(child2)) continue; - NavigationRegion *sb = Object::cast_to<NavigationRegion>(child2); + NavigationRegion3D *sb = Object::cast_to<NavigationRegion3D>(child2); navmesh = sb->get_navigation_mesh(); navmesh_transform = sb->get_transform(); if (!navmesh.is_null()) @@ -253,7 +253,7 @@ void MeshLibraryEditor::_bind_methods() { MeshLibraryEditor::MeshLibraryEditor(EditorNode *p_editor) { file = memnew(EditorFileDialog); - file->set_mode(EditorFileDialog::MODE_OPEN_FILE); + file->set_file_mode(EditorFileDialog::FILE_MODE_OPEN_FILE); //not for now? List<String> extensions; ResourceLoader::get_recognized_extensions_for_type("PackedScene", &extensions); @@ -267,10 +267,10 @@ MeshLibraryEditor::MeshLibraryEditor(EditorNode *p_editor) { file->connect("file_selected", callable_mp(this, &MeshLibraryEditor::_import_scene_cbk)); menu = memnew(MenuButton); - SpatialEditor::get_singleton()->add_control_to_menu_panel(menu); + Node3DEditor::get_singleton()->add_control_to_menu_panel(menu); menu->set_position(Point2(1, 1)); menu->set_text(TTR("Mesh Library")); - menu->set_icon(EditorNode::get_singleton()->get_gui_base()->get_icon("MeshLibrary", "EditorIcons")); + menu->set_icon(EditorNode::get_singleton()->get_gui_base()->get_theme_icon("MeshLibrary", "EditorIcons")); menu->get_popup()->add_item(TTR("Add Item"), MENU_OPTION_ADD_ITEM); menu->get_popup()->add_item(TTR("Remove Selected Item"), MENU_OPTION_REMOVE_ITEM); menu->get_popup()->add_separator(); diff --git a/editor/plugins/multimesh_editor_plugin.cpp b/editor/plugins/multimesh_editor_plugin.cpp index 27d400c035..4f482c2b43 100644 --- a/editor/plugins/multimesh_editor_plugin.cpp +++ b/editor/plugins/multimesh_editor_plugin.cpp @@ -30,14 +30,14 @@ #include "multimesh_editor_plugin.h" -#include "scene/3d/mesh_instance.h" +#include "node_3d_editor_plugin.h" +#include "scene/3d/mesh_instance_3d.h" #include "scene/gui/box_container.h" -#include "spatial_editor_plugin.h" void MultiMeshEditor::_node_removed(Node *p_node) { if (p_node == node) { - node = NULL; + node = nullptr; hide(); } } @@ -56,13 +56,13 @@ void MultiMeshEditor::_populate() { if (multimesh.is_null()) { err_dialog->set_text(TTR("No mesh source specified (and no MultiMesh set in node).")); - err_dialog->popup_centered_minsize(); + err_dialog->popup_centered(); return; } if (multimesh->get_mesh().is_null()) { err_dialog->set_text(TTR("No mesh source specified (and MultiMesh contains no Mesh).")); - err_dialog->popup_centered_minsize(); + err_dialog->popup_centered(); return; } @@ -74,16 +74,16 @@ void MultiMeshEditor::_populate() { if (!ms_node) { err_dialog->set_text(TTR("Mesh source is invalid (invalid path).")); - err_dialog->popup_centered_minsize(); + err_dialog->popup_centered(); return; } - MeshInstance *ms_instance = Object::cast_to<MeshInstance>(ms_node); + MeshInstance3D *ms_instance = Object::cast_to<MeshInstance3D>(ms_node); if (!ms_instance) { - err_dialog->set_text(TTR("Mesh source is invalid (not a MeshInstance).")); - err_dialog->popup_centered_minsize(); + err_dialog->set_text(TTR("Mesh source is invalid (not a MeshInstance3D).")); + err_dialog->popup_centered(); return; } @@ -92,7 +92,7 @@ void MultiMeshEditor::_populate() { if (mesh.is_null()) { err_dialog->set_text(TTR("Mesh source is invalid (contains no Mesh resource).")); - err_dialog->popup_centered_minsize(); + err_dialog->popup_centered(); return; } } @@ -100,7 +100,7 @@ void MultiMeshEditor::_populate() { if (surface_source->get_text() == "") { err_dialog->set_text(TTR("No surface source specified.")); - err_dialog->popup_centered_minsize(); + err_dialog->popup_centered(); return; } @@ -109,27 +109,27 @@ void MultiMeshEditor::_populate() { if (!ss_node) { err_dialog->set_text(TTR("Surface source is invalid (invalid path).")); - err_dialog->popup_centered_minsize(); + err_dialog->popup_centered(); return; } - GeometryInstance *ss_instance = Object::cast_to<MeshInstance>(ss_node); + GeometryInstance3D *ss_instance = Object::cast_to<MeshInstance3D>(ss_node); if (!ss_instance) { err_dialog->set_text(TTR("Surface source is invalid (no geometry).")); - err_dialog->popup_centered_minsize(); + err_dialog->popup_centered(); return; } Transform geom_xform = node->get_global_transform().affine_inverse() * ss_instance->get_global_transform(); - Vector<Face3> geometry = ss_instance->get_faces(VisualInstance::FACES_SOLID); + Vector<Face3> geometry = ss_instance->get_faces(VisualInstance3D::FACES_SOLID); if (geometry.size() == 0) { err_dialog->set_text(TTR("Surface source is invalid (no faces).")); - err_dialog->popup_centered_minsize(); + err_dialog->popup_centered(); return; } @@ -261,7 +261,7 @@ void MultiMeshEditor::_menu_option(int p_option) { } } -void MultiMeshEditor::edit(MultiMeshInstance *p_multimesh) { +void MultiMeshEditor::edit(MultiMeshInstance3D *p_multimesh) { node = p_multimesh; } @@ -284,10 +284,10 @@ MultiMeshEditor::MultiMeshEditor() { options = memnew(MenuButton); options->set_switch_on_hover(true); - SpatialEditor::get_singleton()->add_control_to_menu_panel(options); + Node3DEditor::get_singleton()->add_control_to_menu_panel(options); options->set_text("MultiMesh"); - options->set_icon(EditorNode::get_singleton()->get_gui_base()->get_icon("MultiMeshInstance", "EditorIcons")); + options->set_icon(EditorNode::get_singleton()->get_gui_base()->get_theme_icon("MultiMeshInstance3D", "EditorIcons")); options->get_popup()->add_item(TTR("Populate Surface")); options->get_popup()->connect("id_pressed", callable_mp(this, &MultiMeshEditor::_menu_option)); @@ -371,7 +371,7 @@ MultiMeshEditor::MultiMeshEditor() { populate_dialog->add_child(std); std->connect("selected", callable_mp(this, &MultiMeshEditor::_browsed)); - _last_pp_node = NULL; + _last_pp_node = nullptr; err_dialog = memnew(AcceptDialog); add_child(err_dialog); @@ -379,12 +379,12 @@ MultiMeshEditor::MultiMeshEditor() { void MultiMeshEditorPlugin::edit(Object *p_object) { - multimesh_editor->edit(Object::cast_to<MultiMeshInstance>(p_object)); + multimesh_editor->edit(Object::cast_to<MultiMeshInstance3D>(p_object)); } bool MultiMeshEditorPlugin::handles(Object *p_object) const { - return p_object->is_class("MultiMeshInstance"); + return p_object->is_class("MultiMeshInstance3D"); } void MultiMeshEditorPlugin::make_visible(bool p_visible) { @@ -394,7 +394,7 @@ void MultiMeshEditorPlugin::make_visible(bool p_visible) { } else { multimesh_editor->options->hide(); - multimesh_editor->edit(NULL); + multimesh_editor->edit(nullptr); } } diff --git a/editor/plugins/multimesh_editor_plugin.h b/editor/plugins/multimesh_editor_plugin.h index 2c7b98cfbc..15c9b91fee 100644 --- a/editor/plugins/multimesh_editor_plugin.h +++ b/editor/plugins/multimesh_editor_plugin.h @@ -33,7 +33,7 @@ #include "editor/editor_node.h" #include "editor/editor_plugin.h" -#include "scene/3d/multimesh_instance.h" +#include "scene/3d/multimesh_instance_3d.h" #include "scene/gui/spin_box.h" class MultiMeshEditor : public Control { @@ -44,11 +44,11 @@ class MultiMeshEditor : public Control { AcceptDialog *err_dialog; MenuButton *options; - MultiMeshInstance *_last_pp_node; + MultiMeshInstance3D *_last_pp_node; bool browsing_source; Panel *panel; - MultiMeshInstance *node; + MultiMeshInstance3D *node; LineEdit *surface_source; LineEdit *mesh_source; @@ -78,7 +78,7 @@ protected: static void _bind_methods(); public: - void edit(MultiMeshInstance *p_multimesh); + void edit(MultiMeshInstance3D *p_multimesh); MultiMeshEditor(); }; diff --git a/editor/plugins/navigation_polygon_editor_plugin.cpp b/editor/plugins/navigation_polygon_editor_plugin.cpp index 6671d0b6b4..e41b32ac86 100644 --- a/editor/plugins/navigation_polygon_editor_plugin.cpp +++ b/editor/plugins/navigation_polygon_editor_plugin.cpp @@ -123,7 +123,7 @@ void NavigationPolygonEditor::_create_resource() { NavigationPolygonEditor::NavigationPolygonEditor(EditorNode *p_editor) : AbstractPolygon2DEditor(p_editor) { - node = NULL; + node = nullptr; } NavigationPolygonEditorPlugin::NavigationPolygonEditorPlugin(EditorNode *p_node) : diff --git a/editor/plugins/navigation_polygon_editor_plugin.h b/editor/plugins/navigation_polygon_editor_plugin.h index 10f8cbc0a5..0bc35e2498 100644 --- a/editor/plugins/navigation_polygon_editor_plugin.h +++ b/editor/plugins/navigation_polygon_editor_plugin.h @@ -32,7 +32,7 @@ #define NAVIGATIONPOLYGONEDITORPLUGIN_H #include "editor/plugins/abstract_polygon_2d_editor.h" -#include "scene/2d/navigation_polygon.h" +#include "scene/2d/navigation_region_2d.h" class NavigationPolygonEditor : public AbstractPolygon2DEditor { diff --git a/editor/plugins/spatial_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp index 2f1274a99a..f51b9b20e4 100644 --- a/editor/plugins/spatial_editor_plugin.cpp +++ b/editor/plugins/node_3d_editor_plugin.cpp @@ -1,5 +1,5 @@ /*************************************************************************/ -/* spatial_editor_plugin.cpp */ +/* node_3d_editor_plugin.cpp */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ @@ -28,10 +28,10 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#include "spatial_editor_plugin.h" +#include "node_3d_editor_plugin.h" +#include "core/input/input_filter.h" #include "core/math/camera_matrix.h" -#include "core/os/input.h" #include "core/os/keyboard.h" #include "core/print_string.h" #include "core/project_settings.h" @@ -40,17 +40,18 @@ #include "editor/editor_node.h" #include "editor/editor_scale.h" #include "editor/editor_settings.h" +#include "editor/node_3d_editor_gizmos.h" #include "editor/plugins/animation_player_editor_plugin.h" #include "editor/plugins/script_editor_plugin.h" -#include "editor/spatial_editor_gizmos.h" -#include "scene/3d/camera.h" -#include "scene/3d/collision_shape.h" -#include "scene/3d/mesh_instance.h" -#include "scene/3d/physics_body.h" -#include "scene/3d/visual_instance.h" -#include "scene/gui/viewport_container.h" +#include "scene/3d/camera_3d.h" +#include "scene/3d/collision_shape_3d.h" +#include "scene/3d/mesh_instance_3d.h" +#include "scene/3d/physics_body_3d.h" +#include "scene/3d/visual_instance_3d.h" +#include "scene/gui/subviewport_container.h" #include "scene/resources/packed_scene.h" #include "scene/resources/surface_tool.h" +#include "servers/display_server.h" #define DISTANCE_DEFAULT 4 @@ -80,17 +81,17 @@ void ViewportRotationControl::_notification(int p_what) { if (p_what == NOTIFICATION_ENTER_TREE) { axis_menu_options.clear(); - axis_menu_options.push_back(SpatialEditorViewport::VIEW_RIGHT); - axis_menu_options.push_back(SpatialEditorViewport::VIEW_TOP); - axis_menu_options.push_back(SpatialEditorViewport::VIEW_FRONT); - axis_menu_options.push_back(SpatialEditorViewport::VIEW_LEFT); - axis_menu_options.push_back(SpatialEditorViewport::VIEW_BOTTOM); - axis_menu_options.push_back(SpatialEditorViewport::VIEW_REAR); + axis_menu_options.push_back(Node3DEditorViewport::VIEW_RIGHT); + axis_menu_options.push_back(Node3DEditorViewport::VIEW_TOP); + axis_menu_options.push_back(Node3DEditorViewport::VIEW_FRONT); + axis_menu_options.push_back(Node3DEditorViewport::VIEW_LEFT); + axis_menu_options.push_back(Node3DEditorViewport::VIEW_BOTTOM); + axis_menu_options.push_back(Node3DEditorViewport::VIEW_REAR); axis_colors.clear(); - axis_colors.push_back(get_color("axis_x_color", "Editor")); - axis_colors.push_back(get_color("axis_y_color", "Editor")); - axis_colors.push_back(get_color("axis_z_color", "Editor")); + axis_colors.push_back(get_theme_color("axis_x_color", "Editor")); + axis_colors.push_back(get_theme_color("axis_y_color", "Editor")); + axis_colors.push_back(get_theme_color("axis_z_color", "Editor")); update(); if (!is_connected("mouse_exited", callable_mp(this, &ViewportRotationControl::_on_mouse_exited))) { @@ -139,7 +140,7 @@ void ViewportRotationControl::_draw_axis(const Axis2D &p_axis) { if (front) { String axis_name = direction == 0 ? "X" : (direction == 1 ? "Y" : "Z"); draw_circle(p_axis.screen_point, AXIS_CIRCLE_RADIUS, c); - draw_char(get_font("rotation_control", "EditorFonts"), p_axis.screen_point + Vector2i(-4, 5) * EDSCALE, axis_name, "", Color(0.3, 0.3, 0.3)); + draw_char(get_theme_font("rotation_control", "EditorFonts"), p_axis.screen_point + Vector2i(-4, 5) * EDSCALE, axis_name, "", Color(0.3, 0.3, 0.3)); } else { draw_circle(p_axis.screen_point, AXIS_CIRCLE_RADIUS * (0.55 + (0.2 * (1.0 + p_axis.z_axis))), c); } @@ -238,7 +239,7 @@ void ViewportRotationControl::_on_mouse_exited() { update(); } -void ViewportRotationControl::set_viewport(SpatialEditorViewport *p_viewport) { +void ViewportRotationControl::set_viewport(Node3DEditorViewport *p_viewport) { viewport = p_viewport; } @@ -246,9 +247,9 @@ void ViewportRotationControl::_bind_methods() { ClassDB::bind_method(D_METHOD("_gui_input"), &ViewportRotationControl::_gui_input); } -void SpatialEditorViewport::_update_camera(float p_interp_delta) { +void Node3DEditorViewport::_update_camera(float p_interp_delta) { - bool is_orthogonal = camera->get_projection() == Camera::PROJECTION_ORTHOGONAL; + bool is_orthogonal = camera->get_projection() == Camera3D::PROJECTION_ORTHOGONAL; Cursor old_camera_cursor = camera_cursor; camera_cursor = cursor; @@ -297,10 +298,10 @@ void SpatialEditorViewport::_update_camera(float p_interp_delta) { float zoom_inertia = EDITOR_GET("editors/3d/navigation_feel/zoom_inertia"); //determine if being manipulated - bool manipulated = Input::get_singleton()->get_mouse_button_mask() & (2 | 4); - manipulated |= Input::get_singleton()->is_key_pressed(KEY_SHIFT); - manipulated |= Input::get_singleton()->is_key_pressed(KEY_ALT); - manipulated |= Input::get_singleton()->is_key_pressed(KEY_CONTROL); + bool manipulated = InputFilter::get_singleton()->get_mouse_button_mask() & (2 | 4); + manipulated |= InputFilter::get_singleton()->is_key_pressed(KEY_SHIFT); + manipulated |= InputFilter::get_singleton()->is_key_pressed(KEY_ALT); + manipulated |= InputFilter::get_singleton()->is_key_pressed(KEY_CONTROL); float orbit_inertia = MAX(0.00001, manipulated ? manip_orbit_inertia : free_orbit_inertia); float translation_inertia = MAX(0.0001, manipulated ? manip_translation_inertia : free_translation_inertia); @@ -346,7 +347,7 @@ void SpatialEditorViewport::_update_camera(float p_interp_delta) { if (orthogonal) { float half_fov = Math::deg2rad(get_fov()) / 2.0; float height = 2.0 * cursor.distance * Math::tan(half_fov); - camera->set_orthogonal(height, 0.1, 8192); + camera->set_orthogonal(height, get_znear(), get_zfar()); } else { camera->set_perspective(get_fov(), get_znear(), get_zfar()); } @@ -356,21 +357,21 @@ void SpatialEditorViewport::_update_camera(float p_interp_delta) { } } -Transform SpatialEditorViewport::to_camera_transform(const Cursor &p_cursor) const { +Transform Node3DEditorViewport::to_camera_transform(const Cursor &p_cursor) const { Transform camera_transform; camera_transform.translate(p_cursor.pos); camera_transform.basis.rotate(Vector3(1, 0, 0), -p_cursor.x_rot); camera_transform.basis.rotate(Vector3(0, 1, 0), -p_cursor.y_rot); if (orthogonal) - camera_transform.translate(0, 0, 4096); + camera_transform.translate(0, 0, (get_zfar() - get_znear()) / 2.0); else camera_transform.translate(0, 0, p_cursor.distance); return camera_transform; } -int SpatialEditorViewport::get_selected_count() const { +int Node3DEditorViewport::get_selected_count() const { Map<Node *, Object *> &selection = editor_selection->get_selection(); @@ -378,11 +379,11 @@ int SpatialEditorViewport::get_selected_count() const { for (Map<Node *, Object *>::Element *E = selection.front(); E; E = E->next()) { - Spatial *sp = Object::cast_to<Spatial>(E->key()); + Node3D *sp = Object::cast_to<Node3D>(E->key()); if (!sp) continue; - SpatialEditorSelectedItem *se = editor_selection->get_node_editor_data<SpatialEditorSelectedItem>(sp); + Node3DEditorSelectedItem *se = editor_selection->get_node_editor_data<Node3DEditorSelectedItem>(sp); if (!se) continue; @@ -392,68 +393,68 @@ int SpatialEditorViewport::get_selected_count() const { return count; } -float SpatialEditorViewport::get_znear() const { +float Node3DEditorViewport::get_znear() const { return CLAMP(spatial_editor->get_znear(), MIN_Z, MAX_Z); } -float SpatialEditorViewport::get_zfar() const { +float Node3DEditorViewport::get_zfar() const { return CLAMP(spatial_editor->get_zfar(), MIN_Z, MAX_Z); } -float SpatialEditorViewport::get_fov() const { +float Node3DEditorViewport::get_fov() const { return CLAMP(spatial_editor->get_fov(), MIN_FOV, MAX_FOV); } -Transform SpatialEditorViewport::_get_camera_transform() const { +Transform Node3DEditorViewport::_get_camera_transform() const { return camera->get_global_transform(); } -Vector3 SpatialEditorViewport::_get_camera_position() const { +Vector3 Node3DEditorViewport::_get_camera_position() const { return _get_camera_transform().origin; } -Point2 SpatialEditorViewport::_point_to_screen(const Vector3 &p_point) { +Point2 Node3DEditorViewport::_point_to_screen(const Vector3 &p_point) { - return camera->unproject_position(p_point) * viewport_container->get_stretch_shrink(); + return camera->unproject_position(p_point) * subviewport_container->get_stretch_shrink(); } -Vector3 SpatialEditorViewport::_get_ray_pos(const Vector2 &p_pos) const { +Vector3 Node3DEditorViewport::_get_ray_pos(const Vector2 &p_pos) const { - return camera->project_ray_origin(p_pos / viewport_container->get_stretch_shrink()); + return camera->project_ray_origin(p_pos / subviewport_container->get_stretch_shrink()); } -Vector3 SpatialEditorViewport::_get_camera_normal() const { +Vector3 Node3DEditorViewport::_get_camera_normal() const { return -_get_camera_transform().basis.get_axis(2); } -Vector3 SpatialEditorViewport::_get_ray(const Vector2 &p_pos) const { +Vector3 Node3DEditorViewport::_get_ray(const Vector2 &p_pos) const { - return camera->project_ray_normal(p_pos / viewport_container->get_stretch_shrink()); + return camera->project_ray_normal(p_pos / subviewport_container->get_stretch_shrink()); } -void SpatialEditorViewport::_clear_selected() { +void Node3DEditorViewport::_clear_selected() { editor_selection->clear(); } -void SpatialEditorViewport::_select_clicked(bool p_append, bool p_single, bool p_allow_locked) { +void Node3DEditorViewport::_select_clicked(bool p_append, bool p_single, bool p_allow_locked) { if (clicked.is_null()) return; Node *node = Object::cast_to<Node>(ObjectDB::get_instance(clicked)); - Spatial *selected = Object::cast_to<Spatial>(node); + Node3D *selected = Object::cast_to<Node3D>(node); if (!selected) return; if (!p_allow_locked) { // Replace the node by the group if grouped while (node && node != editor->get_edited_scene()->get_parent()) { - Spatial *selected_tmp = Object::cast_to<Spatial>(node); + Node3D *selected_tmp = Object::cast_to<Node3D>(node); if (selected_tmp && node->has_meta("_edit_group_")) { selected = selected_tmp; } @@ -466,7 +467,7 @@ void SpatialEditorViewport::_select_clicked(bool p_append, bool p_single, bool p } } -void SpatialEditorViewport::_select(Node *p_node, bool p_append, bool p_single) { +void Node3DEditorViewport::_select(Node *p_node, bool p_append, bool p_single) { if (!p_append) { editor_selection->clear(); @@ -486,32 +487,32 @@ void SpatialEditorViewport::_select(Node *p_node, bool p_append, bool p_single) } } -ObjectID SpatialEditorViewport::_select_ray(const Point2 &p_pos, bool p_append, bool &r_includes_current, int *r_gizmo_handle, bool p_alt_select) { +ObjectID Node3DEditorViewport::_select_ray(const Point2 &p_pos, bool p_append, bool &r_includes_current, int *r_gizmo_handle, bool p_alt_select) { if (r_gizmo_handle) *r_gizmo_handle = -1; Vector3 ray = _get_ray(p_pos); Vector3 pos = _get_ray_pos(p_pos); - Vector2 shrinked_pos = p_pos / viewport_container->get_stretch_shrink(); + Vector2 shrinked_pos = p_pos / subviewport_container->get_stretch_shrink(); - Vector<ObjectID> instances = VisualServer::get_singleton()->instances_cull_ray(pos, ray, get_tree()->get_root()->get_world()->get_scenario()); - Set<Ref<EditorSpatialGizmo>> found_gizmos; + Vector<ObjectID> instances = RenderingServer::get_singleton()->instances_cull_ray(pos, ray, get_tree()->get_root()->get_world()->get_scenario()); + Set<Ref<EditorNode3DGizmo>> found_gizmos; Node *edited_scene = get_tree()->get_edited_scene_root(); ObjectID closest; - Node *item = NULL; + Node *item = nullptr; float closest_dist = 1e20; int selected_handle = -1; for (int i = 0; i < instances.size(); i++) { - Spatial *spat = Object::cast_to<Spatial>(ObjectDB::get_instance(instances[i])); + Node3D *spat = Object::cast_to<Node3D>(ObjectDB::get_instance(instances[i])); if (!spat) continue; - Ref<EditorSpatialGizmo> seg = spat->get_gizmo(); + Ref<EditorNode3DGizmo> seg = spat->get_gizmo(); if ((!seg.is_valid()) || found_gizmos.has(seg)) { continue; @@ -557,24 +558,24 @@ ObjectID SpatialEditorViewport::_select_ray(const Point2 &p_pos, bool p_append, return closest; } -void SpatialEditorViewport::_find_items_at_pos(const Point2 &p_pos, bool &r_includes_current, Vector<_RayResult> &results, bool p_alt_select) { +void Node3DEditorViewport::_find_items_at_pos(const Point2 &p_pos, bool &r_includes_current, Vector<_RayResult> &results, bool p_alt_select) { Vector3 ray = _get_ray(p_pos); Vector3 pos = _get_ray_pos(p_pos); - Vector<ObjectID> instances = VisualServer::get_singleton()->instances_cull_ray(pos, ray, get_tree()->get_root()->get_world()->get_scenario()); - Set<Ref<EditorSpatialGizmo>> found_gizmos; + Vector<ObjectID> instances = RenderingServer::get_singleton()->instances_cull_ray(pos, ray, get_tree()->get_root()->get_world()->get_scenario()); + Set<Ref<EditorNode3DGizmo>> found_gizmos; r_includes_current = false; for (int i = 0; i < instances.size(); i++) { - Spatial *spat = Object::cast_to<Spatial>(ObjectDB::get_instance(instances[i])); + Node3D *spat = Object::cast_to<Node3D>(ObjectDB::get_instance(instances[i])); if (!spat) continue; - Ref<EditorSpatialGizmo> seg = spat->get_gizmo(); + Ref<EditorNode3DGizmo> seg = spat->get_gizmo(); if (!seg.is_valid()) continue; @@ -587,7 +588,7 @@ void SpatialEditorViewport::_find_items_at_pos(const Point2 &p_pos, bool &r_incl Vector3 normal; int handle = -1; - bool inters = seg->intersect_ray(camera, p_pos, point, normal, NULL, p_alt_select); + bool inters = seg->intersect_ray(camera, p_pos, point, normal, nullptr, p_alt_select); if (!inters) continue; @@ -613,7 +614,7 @@ void SpatialEditorViewport::_find_items_at_pos(const Point2 &p_pos, bool &r_incl results.sort(); } -Vector3 SpatialEditorViewport::_get_screen_to_space(const Vector3 &p_vector3) { +Vector3 Node3DEditorViewport::_get_screen_to_space(const Vector3 &p_vector3) { CameraMatrix cm; if (orthogonal) { @@ -632,7 +633,7 @@ Vector3 SpatialEditorViewport::_get_screen_to_space(const Vector3 &p_vector3) { return camera_transform.xform(Vector3(((p_vector3.x / get_size().width) * 2.0 - 1.0) * screen_he.x, ((1.0 - (p_vector3.y / get_size().height)) * 2.0 - 1.0) * screen_he.y, -(get_znear() + p_vector3.z))); } -void SpatialEditorViewport::_select_region() { +void Node3DEditorViewport::_select_region() { if (cursor.region_begin == cursor.region_end) return; //nothing really @@ -685,14 +686,14 @@ void SpatialEditorViewport::_select_region() { frustum.push_back(far); } - Vector<ObjectID> instances = VisualServer::get_singleton()->instances_cull_convex(frustum, get_tree()->get_root()->get_world()->get_scenario()); + Vector<ObjectID> instances = RenderingServer::get_singleton()->instances_cull_convex(frustum, get_tree()->get_root()->get_world()->get_scenario()); Vector<Node *> selected; Node *edited_scene = get_tree()->get_edited_scene_root(); for (int i = 0; i < instances.size(); i++) { - Spatial *sp = Object::cast_to<Spatial>(ObjectDB::get_instance(instances[i])); + Node3D *sp = Object::cast_to<Node3D>(ObjectDB::get_instance(instances[i])); if (!sp || _is_node_locked(sp)) continue; @@ -702,10 +703,10 @@ void SpatialEditorViewport::_select_region() { } // Replace the node by the group if grouped - if (item->is_class("Spatial")) { - Spatial *sel = Object::cast_to<Spatial>(item); + if (item->is_class("Node3D")) { + Node3D *sel = Object::cast_to<Node3D>(item); while (item && item != editor->get_edited_scene()->get_parent()) { - Spatial *selected_tmp = Object::cast_to<Spatial>(item); + Node3D *selected_tmp = Object::cast_to<Node3D>(item); if (selected_tmp && item->has_meta("_edit_group_")) { sel = selected_tmp; } @@ -718,7 +719,7 @@ void SpatialEditorViewport::_select_region() { if (_is_node_locked(item)) continue; - Ref<EditorSpatialGizmo> seg = sp->get_gizmo(); + Ref<EditorNode3DGizmo> seg = sp->get_gizmo(); if (!seg.is_valid()) continue; @@ -734,7 +735,7 @@ void SpatialEditorViewport::_select_region() { } } -void SpatialEditorViewport::_update_name() { +void Node3DEditorViewport::_update_name() { String view_mode = orthogonal ? TTR("Orthogonal") : TTR("Perspective"); @@ -750,7 +751,7 @@ void SpatialEditorViewport::_update_name() { view_menu->set_size(Vector2(0, 0)); // resets the button size } -void SpatialEditorViewport::_compute_edit(const Point2 &p_point) { +void Node3DEditorViewport::_compute_edit(const Point2 &p_point) { _edit.click_ray = _get_ray(Vector2(p_point.x, p_point.y)); _edit.click_ray_pos = _get_ray_pos(Vector2(p_point.x, p_point.y)); @@ -762,11 +763,11 @@ void SpatialEditorViewport::_compute_edit(const Point2 &p_point) { for (List<Node *>::Element *E = selection.front(); E; E = E->next()) { - Spatial *sp = Object::cast_to<Spatial>(E->get()); + Node3D *sp = Object::cast_to<Node3D>(E->get()); if (!sp) continue; - SpatialEditorSelectedItem *se = editor_selection->get_node_editor_data<SpatialEditorSelectedItem>(sp); + Node3DEditorSelectedItem *se = editor_selection->get_node_editor_data<Node3DEditorSelectedItem>(sp); if (!se) continue; @@ -800,7 +801,7 @@ static int _get_key_modifier(Ref<InputEventWithModifiers> e) { return 0; } -bool SpatialEditorViewport::_gizmo_select(const Vector2 &p_screenpos, bool p_highlight_only) { +bool Node3DEditorViewport::_gizmo_select(const Vector2 &p_screenpos, bool p_highlight_only) { if (!spatial_editor->is_gizmo_visible()) return false; @@ -816,7 +817,7 @@ bool SpatialEditorViewport::_gizmo_select(const Vector2 &p_screenpos, bool p_hig Transform gt = spatial_editor->get_gizmo_transform(); float gs = gizmo_scale; - if (spatial_editor->get_tool_mode() == SpatialEditor::TOOL_MODE_SELECT || spatial_editor->get_tool_mode() == SpatialEditor::TOOL_MODE_MOVE) { + if (spatial_editor->get_tool_mode() == Node3DEditor::TOOL_MODE_SELECT || spatial_editor->get_tool_mode() == Node3DEditor::TOOL_MODE_MOVE) { int col_axis = -1; float col_d = 1e20; @@ -885,7 +886,7 @@ bool SpatialEditorViewport::_gizmo_select(const Vector2 &p_screenpos, bool p_hig } } - if (spatial_editor->get_tool_mode() == SpatialEditor::TOOL_MODE_SELECT || spatial_editor->get_tool_mode() == SpatialEditor::TOOL_MODE_ROTATE) { + if (spatial_editor->get_tool_mode() == Node3DEditor::TOOL_MODE_SELECT || spatial_editor->get_tool_mode() == Node3DEditor::TOOL_MODE_ROTATE) { int col_axis = -1; float col_d = 1e20; @@ -924,7 +925,7 @@ bool SpatialEditorViewport::_gizmo_select(const Vector2 &p_screenpos, bool p_hig } } - if (spatial_editor->get_tool_mode() == SpatialEditor::TOOL_MODE_SCALE) { + if (spatial_editor->get_tool_mode() == Node3DEditor::TOOL_MODE_SCALE) { int col_axis = -1; float col_d = 1e20; @@ -999,37 +1000,37 @@ bool SpatialEditorViewport::_gizmo_select(const Vector2 &p_screenpos, bool p_hig return false; } -void SpatialEditorViewport::_surface_mouse_enter() { +void Node3DEditorViewport::_surface_mouse_enter() { if (!surface->has_focus() && (!get_focus_owner() || !get_focus_owner()->is_text_field())) surface->grab_focus(); } -void SpatialEditorViewport::_surface_mouse_exit() { +void Node3DEditorViewport::_surface_mouse_exit() { _remove_preview(); } -void SpatialEditorViewport::_surface_focus_enter() { +void Node3DEditorViewport::_surface_focus_enter() { view_menu->set_disable_shortcuts(false); } -void SpatialEditorViewport::_surface_focus_exit() { +void Node3DEditorViewport::_surface_focus_exit() { view_menu->set_disable_shortcuts(true); } -bool SpatialEditorViewport ::_is_node_locked(const Node *p_node) { +bool Node3DEditorViewport ::_is_node_locked(const Node *p_node) { return p_node->has_meta("_edit_lock_") && p_node->get_meta("_edit_lock_"); } -void SpatialEditorViewport::_list_select(Ref<InputEventMouseButton> b) { +void Node3DEditorViewport::_list_select(Ref<InputEventMouseButton> b) { _find_items_at_pos(b->get_position(), clicked_includes_current, selection_results, b->get_shift()); Node *scene = editor->get_edited_scene(); for (int i = 0; i < selection_results.size(); i++) { - Spatial *item = selection_results[i].item; + Node3D *item = selection_results[i].item; if (item != scene && item->get_owner() != scene && !scene->is_editable_instance(item->get_owner())) { //invalid result selection_results.remove(i); @@ -1045,7 +1046,7 @@ void SpatialEditorViewport::_list_select(Ref<InputEventMouseButton> b) { selection_results.clear(); if (clicked.is_valid()) { - _select_clicked(clicked_wants_append, true, spatial_editor->get_tool_mode() != SpatialEditor::TOOL_MODE_LIST_SELECT); + _select_clicked(clicked_wants_append, true, spatial_editor->get_tool_mode() != Node3DEditor::TOOL_MODE_LIST_SELECT); clicked = ObjectID(); } @@ -1056,7 +1057,7 @@ void SpatialEditorViewport::_list_select(Ref<InputEventMouseButton> b) { for (int i = 0; i < selection_results.size(); i++) { - Spatial *spat = selection_results[i].item; + Node3D *spat = selection_results[i].item; Ref<Texture2D> icon = EditorNode::get_singleton()->get_object_icon(spat, "Node"); @@ -1070,7 +1071,7 @@ void SpatialEditorViewport::_list_select(Ref<InputEventMouseButton> b) { Node *node = spat; while (node && node != ed_scene->get_parent()) { - Spatial *selected_tmp = Object::cast_to<Spatial>(node); + Node3D *selected_tmp = Object::cast_to<Node3D>(node); if (selected_tmp && node->has_meta("_edit_group_")) { locked = 2; } @@ -1090,12 +1091,12 @@ void SpatialEditorViewport::_list_select(Ref<InputEventMouseButton> b) { selection_menu->set_item_tooltip(i, String(spat->get_name()) + "\nType: " + spat->get_class() + "\nPath: " + node_path); } - selection_menu->set_global_position(b->get_global_position()); + selection_menu->set_position(get_screen_transform().xform(b->get_position())); selection_menu->popup(); } } -void SpatialEditorViewport::_sinput(const Ref<InputEvent> &p_event) { +void Node3DEditorViewport::_sinput(const Ref<InputEvent> &p_event) { if (previewing) return; //do NONE @@ -1148,7 +1149,7 @@ void SpatialEditorViewport::_sinput(const Ref<InputEvent> &p_event) { if (b->is_pressed() && _edit.gizmo.is_valid()) { //restore _edit.gizmo->commit_handle(_edit.gizmo_handle, _edit.gizmo_initial_value, true); - _edit.gizmo = Ref<EditorSpatialGizmo>(); + _edit.gizmo = Ref<EditorNode3DGizmo>(); } if (_edit.mode == TRANSFORM_NONE && b->is_pressed()) { @@ -1171,11 +1172,11 @@ void SpatialEditorViewport::_sinput(const Ref<InputEvent> &p_event) { for (List<Node *>::Element *E = selection.front(); E; E = E->next()) { - Spatial *sp = Object::cast_to<Spatial>(E->get()); + Node3D *sp = Object::cast_to<Node3D>(E->get()); if (!sp) continue; - SpatialEditorSelectedItem *se = editor_selection->get_node_editor_data<SpatialEditorSelectedItem>(sp); + Node3DEditorSelectedItem *se = editor_selection->get_node_editor_data<Node3DEditorSelectedItem>(sp); if (!se) continue; @@ -1250,7 +1251,7 @@ void SpatialEditorViewport::_sinput(const Ref<InputEvent> &p_event) { break; } - if (spatial_editor->get_tool_mode() == SpatialEditor::TOOL_MODE_LIST_SELECT) { + if (spatial_editor->get_tool_mode() == Node3DEditor::TOOL_MODE_LIST_SELECT) { _list_select(b); break; } @@ -1270,7 +1271,7 @@ void SpatialEditorViewport::_sinput(const Ref<InputEvent> &p_event) { if (can_select_gizmos && spatial_editor->get_selected()) { - Ref<EditorSpatialGizmo> seg = spatial_editor->get_selected()->get_gizmo(); + Ref<EditorNode3DGizmo> seg = spatial_editor->get_selected()->get_gizmo(); if (seg.is_valid()) { int handle = -1; Vector3 point; @@ -1292,7 +1293,7 @@ void SpatialEditorViewport::_sinput(const Ref<InputEvent> &p_event) { clicked = ObjectID(); clicked_includes_current = false; - if ((spatial_editor->get_tool_mode() == SpatialEditor::TOOL_MODE_SELECT && b->get_control()) || spatial_editor->get_tool_mode() == SpatialEditor::TOOL_MODE_ROTATE) { + if ((spatial_editor->get_tool_mode() == Node3DEditor::TOOL_MODE_SELECT && b->get_control()) || spatial_editor->get_tool_mode() == Node3DEditor::TOOL_MODE_ROTATE) { /* HANDLE ROTATION */ if (get_selected_count() == 0) @@ -1303,7 +1304,7 @@ void SpatialEditorViewport::_sinput(const Ref<InputEvent> &p_event) { break; } - if (spatial_editor->get_tool_mode() == SpatialEditor::TOOL_MODE_MOVE) { + if (spatial_editor->get_tool_mode() == Node3DEditor::TOOL_MODE_MOVE) { if (get_selected_count() == 0) break; //bye @@ -1313,7 +1314,7 @@ void SpatialEditorViewport::_sinput(const Ref<InputEvent> &p_event) { break; } - if (spatial_editor->get_tool_mode() == SpatialEditor::TOOL_MODE_SCALE) { + if (spatial_editor->get_tool_mode() == Node3DEditor::TOOL_MODE_SCALE) { if (get_selected_count() == 0) break; //bye @@ -1346,10 +1347,10 @@ void SpatialEditorViewport::_sinput(const Ref<InputEvent> &p_event) { if (clicked.is_valid() && gizmo_handle >= 0) { - Spatial *spa = Object::cast_to<Spatial>(ObjectDB::get_instance(clicked)); + Node3D *spa = Object::cast_to<Node3D>(ObjectDB::get_instance(clicked)); if (spa) { - Ref<EditorSpatialGizmo> seg = spa->get_gizmo(); + Ref<EditorNode3DGizmo> seg = spa->get_gizmo(); if (seg.is_valid()) { _edit.gizmo = seg; @@ -1366,7 +1367,7 @@ void SpatialEditorViewport::_sinput(const Ref<InputEvent> &p_event) { if (_edit.gizmo.is_valid()) { _edit.gizmo->commit_handle(_edit.gizmo_handle, _edit.gizmo_initial_value, false); - _edit.gizmo = Ref<EditorSpatialGizmo>(); + _edit.gizmo = Ref<EditorNode3DGizmo>(); break; } if (clicked.is_valid()) { @@ -1393,11 +1394,11 @@ void SpatialEditorViewport::_sinput(const Ref<InputEvent> &p_event) { for (List<Node *>::Element *E = selection.front(); E; E = E->next()) { - Spatial *sp = Object::cast_to<Spatial>(E->get()); + Node3D *sp = Object::cast_to<Node3D>(E->get()); if (!sp) continue; - SpatialEditorSelectedItem *se = editor_selection->get_node_editor_data<SpatialEditorSelectedItem>(sp); + Node3DEditorSelectedItem *se = editor_selection->get_node_editor_data<Node3DEditorSelectedItem>(sp); if (!se) continue; @@ -1424,7 +1425,7 @@ void SpatialEditorViewport::_sinput(const Ref<InputEvent> &p_event) { if (spatial_editor->get_selected()) { - Ref<EditorSpatialGizmo> seg = spatial_editor->get_selected()->get_gizmo(); + Ref<EditorNode3DGizmo> seg = spatial_editor->get_selected()->get_gizmo(); if (seg.is_valid()) { int selected_handle = -1; @@ -1592,12 +1593,12 @@ void SpatialEditorViewport::_sinput(const Ref<InputEvent> &p_event) { for (List<Node *>::Element *E = selection.front(); E; E = E->next()) { - Spatial *sp = Object::cast_to<Spatial>(E->get()); + Node3D *sp = Object::cast_to<Node3D>(E->get()); if (!sp) { continue; } - SpatialEditorSelectedItem *se = editor_selection->get_node_editor_data<SpatialEditorSelectedItem>(sp); + Node3DEditorSelectedItem *se = editor_selection->get_node_editor_data<Node3DEditorSelectedItem>(sp); if (!se) { continue; } @@ -1717,12 +1718,12 @@ void SpatialEditorViewport::_sinput(const Ref<InputEvent> &p_event) { for (List<Node *>::Element *E = selection.front(); E; E = E->next()) { - Spatial *sp = Object::cast_to<Spatial>(E->get()); + Node3D *sp = Object::cast_to<Node3D>(E->get()); if (!sp) { continue; } - SpatialEditorSelectedItem *se = editor_selection->get_node_editor_data<SpatialEditorSelectedItem>(sp); + Node3DEditorSelectedItem *se = editor_selection->get_node_editor_data<Node3DEditorSelectedItem>(sp); if (!se) { continue; } @@ -1815,11 +1816,11 @@ void SpatialEditorViewport::_sinput(const Ref<InputEvent> &p_event) { for (List<Node *>::Element *E = selection.front(); E; E = E->next()) { - Spatial *sp = Object::cast_to<Spatial>(E->get()); + Node3D *sp = Object::cast_to<Node3D>(E->get()); if (!sp) continue; - SpatialEditorSelectedItem *se = editor_selection->get_node_editor_data<SpatialEditorSelectedItem>(sp); + Node3DEditorSelectedItem *se = editor_selection->get_node_editor_data<Node3DEditorSelectedItem>(sp); if (!se) continue; @@ -2053,7 +2054,7 @@ void SpatialEditorViewport::_sinput(const Ref<InputEvent> &p_event) { for (List<Node *>::Element *E = selection.front(); E; E = E->next()) { - Spatial *sp = Object::cast_to<Spatial>(E->get()); + Node3D *sp = Object::cast_to<Node3D>(E->get()); if (!sp) continue; @@ -2082,7 +2083,7 @@ void SpatialEditorViewport::_sinput(const Ref<InputEvent> &p_event) { accept_event(); } -void SpatialEditorViewport::_nav_pan(Ref<InputEventWithModifiers> p_event, const Vector2 &p_relative) { +void Node3DEditorViewport::_nav_pan(Ref<InputEventWithModifiers> p_event, const Vector2 &p_relative) { const NavigationScheme nav_scheme = (NavigationScheme)EditorSettings::get_singleton()->get("editors/3d/navigation/navigation_scheme").operator int(); @@ -2102,7 +2103,7 @@ void SpatialEditorViewport::_nav_pan(Ref<InputEventWithModifiers> p_event, const cursor.pos = camera_transform.origin; } -void SpatialEditorViewport::_nav_zoom(Ref<InputEventWithModifiers> p_event, const Vector2 &p_relative) { +void Node3DEditorViewport::_nav_zoom(Ref<InputEventWithModifiers> p_event, const Vector2 &p_relative) { const NavigationScheme nav_scheme = (NavigationScheme)EditorSettings::get_singleton()->get("editors/3d/navigation/navigation_scheme").operator int(); @@ -2125,7 +2126,7 @@ void SpatialEditorViewport::_nav_zoom(Ref<InputEventWithModifiers> p_event, cons } } -void SpatialEditorViewport::_nav_orbit(Ref<InputEventWithModifiers> p_event, const Vector2 &p_relative) { +void Node3DEditorViewport::_nav_orbit(Ref<InputEventWithModifiers> p_event, const Vector2 &p_relative) { if (lock_rotation) { _nav_pan(p_event, p_relative); @@ -2154,7 +2155,7 @@ void SpatialEditorViewport::_nav_orbit(Ref<InputEventWithModifiers> p_event, con _update_name(); } -void SpatialEditorViewport::_nav_look(Ref<InputEventWithModifiers> p_event, const Vector2 &p_relative) { +void Node3DEditorViewport::_nav_look(Ref<InputEventWithModifiers> p_event, const Vector2 &p_relative) { if (orthogonal) { _nav_pan(p_event, p_relative); @@ -2194,7 +2195,7 @@ void SpatialEditorViewport::_nav_look(Ref<InputEventWithModifiers> p_event, cons _update_name(); } -void SpatialEditorViewport::set_freelook_active(bool active_now) { +void Node3DEditorViewport::set_freelook_active(bool active_now) { if (!freelook_active && active_now) { // Sync camera cursor to cursor to "cut" interpolation jumps due to changing referential @@ -2213,20 +2214,20 @@ void SpatialEditorViewport::set_freelook_active(bool active_now) { } // Hide mouse like in an FPS (warping doesn't work) - OS::get_singleton()->set_mouse_mode(OS::MOUSE_MODE_CAPTURED); + DisplayServer::get_singleton()->mouse_set_mode(DisplayServer::MOUSE_MODE_CAPTURED); } else if (freelook_active && !active_now) { // Sync camera cursor to cursor to "cut" interpolation jumps due to changing referential cursor = camera_cursor; // Restore mouse - OS::get_singleton()->set_mouse_mode(OS::MOUSE_MODE_VISIBLE); + DisplayServer::get_singleton()->mouse_set_mode(DisplayServer::MOUSE_MODE_VISIBLE); } freelook_active = active_now; } -void SpatialEditorViewport::scale_cursor_distance(real_t scale) { +void Node3DEditorViewport::scale_cursor_distance(real_t scale) { // Prevents zero distance which would short-circuit any scaling if (cursor.distance < ZOOM_MIN_DISTANCE) @@ -2241,7 +2242,7 @@ void SpatialEditorViewport::scale_cursor_distance(real_t scale) { surface->update(); } -void SpatialEditorViewport::scale_freelook_speed(real_t scale) { +void Node3DEditorViewport::scale_freelook_speed(real_t scale) { // Prevents zero distance which would short-circuit any scaling if (freelook_speed < FREELOOK_MIN_SPEED) @@ -2256,10 +2257,10 @@ void SpatialEditorViewport::scale_freelook_speed(real_t scale) { surface->update(); } -Point2i SpatialEditorViewport::_get_warped_mouse_motion(const Ref<InputEventMouseMotion> &p_ev_mouse_motion) const { +Point2i Node3DEditorViewport::_get_warped_mouse_motion(const Ref<InputEventMouseMotion> &p_ev_mouse_motion) const { Point2i relative; if (bool(EDITOR_DEF("editors/3d/navigation/warped_mouse_panning", false))) { - relative = Input::get_singleton()->warp_mouse_motion(p_ev_mouse_motion, surface->get_global_rect()); + relative = InputFilter::get_singleton()->warp_mouse_motion(p_ev_mouse_motion, surface->get_global_rect()); } else { relative = p_ev_mouse_motion->get_relative(); } @@ -2272,23 +2273,41 @@ static bool is_shortcut_pressed(const String &p_path) { return false; } InputEventKey *k = Object::cast_to<InputEventKey>(shortcut->get_shortcut().ptr()); - if (k == NULL) { + if (k == nullptr) { return false; } - const Input &input = *Input::get_singleton(); + const InputFilter &input = *InputFilter::get_singleton(); int keycode = k->get_keycode(); return input.is_key_pressed(keycode); } -void SpatialEditorViewport::_update_freelook(real_t delta) { +void Node3DEditorViewport::_update_freelook(real_t delta) { if (!is_freelook_active()) { return; } - const Vector3 forward = camera->get_transform().basis.xform(Vector3(0, 0, -1)); + const FreelookNavigationScheme navigation_scheme = (FreelookNavigationScheme)EditorSettings::get_singleton()->get("editors/3d/freelook/freelook_navigation_scheme").operator int(); + + Vector3 forward; + if (navigation_scheme == FREELOOK_FULLY_AXIS_LOCKED) { + // Forward/backward keys will always go straight forward/backward, never moving on the Y axis. + forward = Vector3(0, 0, -1).rotated(Vector3(0, 1, 0), camera->get_rotation().y); + } else { + // Forward/backward keys will be relative to the camera pitch. + forward = camera->get_transform().basis.xform(Vector3(0, 0, -1)); + } + const Vector3 right = camera->get_transform().basis.xform(Vector3(1, 0, 0)); - const Vector3 up = camera->get_transform().basis.xform(Vector3(0, 1, 0)); + + Vector3 up; + if (navigation_scheme == FREELOOK_PARTIALLY_AXIS_LOCKED || navigation_scheme == FREELOOK_FULLY_AXIS_LOCKED) { + // Up/down keys will always go up/down regardless of camera pitch. + up = Vector3(0, 1, 0); + } else { + // Up/down keys will be relative to the camera pitch. + up = camera->get_transform().basis.xform(Vector3(0, 1, 0)); + } Vector3 direction; @@ -2325,22 +2344,22 @@ void SpatialEditorViewport::_update_freelook(real_t delta) { cursor.eye_pos += motion; } -void SpatialEditorViewport::set_message(String p_message, float p_time) { +void Node3DEditorViewport::set_message(String p_message, float p_time) { message = p_message; message_time = p_time; } -void SpatialEditorPlugin::edited_scene_changed() { - for (uint32_t i = 0; i < SpatialEditor::VIEWPORTS_COUNT; i++) { - SpatialEditorViewport *viewport = SpatialEditor::get_singleton()->get_editor_viewport(i); +void Node3DEditorPlugin::edited_scene_changed() { + for (uint32_t i = 0; i < Node3DEditor::VIEWPORTS_COUNT; i++) { + Node3DEditorViewport *viewport = Node3DEditor::get_singleton()->get_editor_viewport(i); if (viewport->is_visible()) { viewport->notification(Control::NOTIFICATION_VISIBILITY_CHANGED); } } } -void SpatialEditorViewport::_notification(int p_what) { +void Node3DEditorViewport::_notification(int p_what) { if (p_what == NOTIFICATION_VISIBILITY_CHANGED) { @@ -2366,7 +2385,7 @@ void SpatialEditorViewport::_notification(int p_what) { if (p_what == NOTIFICATION_READY) { // The crosshair icon doesn't depend on the editor theme. - crosshair->set_texture(get_icon("Crosshair", "EditorIcons")); + crosshair->set_texture(get_theme_icon("Crosshair", "EditorIcons")); // Set the anchors and margins after changing the icon to ensure it's centered correctly. crosshair->set_anchors_and_margins_preset(PRESET_CENTER); } @@ -2385,16 +2404,16 @@ void SpatialEditorViewport::_notification(int p_what) { _update_freelook(delta); Node *scene_root = editor->get_scene_tree_dock()->get_editor_data()->get_edited_scene_root(); - if (previewing_cinema && scene_root != NULL) { - Camera *cam = scene_root->get_viewport()->get_camera(); - if (cam != NULL && cam != previewing) { + if (previewing_cinema && scene_root != nullptr) { + Camera3D *cam = scene_root->get_viewport()->get_camera(); + if (cam != nullptr && cam != previewing) { //then switch the viewport's camera to the scene's viewport camera - if (previewing != NULL) { - previewing->disconnect("tree_exited", callable_mp(this, &SpatialEditorViewport::_preview_exited_scene)); + if (previewing != nullptr) { + previewing->disconnect("tree_exited", callable_mp(this, &Node3DEditorViewport::_preview_exited_scene)); } previewing = cam; - previewing->connect("tree_exited", callable_mp(this, &SpatialEditorViewport::_preview_exited_scene)); - VS::get_singleton()->viewport_attach_camera(viewport->get_viewport_rid(), cam->get_camera()); + previewing->connect("tree_exited", callable_mp(this, &Node3DEditorViewport::_preview_exited_scene)); + RS::get_singleton()->viewport_attach_camera(viewport->get_viewport_rid(), cam->get_camera()); surface->update(); } } @@ -2408,11 +2427,11 @@ void SpatialEditorViewport::_notification(int p_what) { for (Map<Node *, Object *>::Element *E = selection.front(); E; E = E->next()) { - Spatial *sp = Object::cast_to<Spatial>(E->key()); + Node3D *sp = Object::cast_to<Node3D>(E->key()); if (!sp) continue; - SpatialEditorSelectedItem *se = editor_selection->get_node_editor_data<SpatialEditorSelectedItem>(sp); + Node3DEditorSelectedItem *se = editor_selection->get_node_editor_data<Node3DEditorSelectedItem>(sp); if (!se) continue; @@ -2425,7 +2444,7 @@ void SpatialEditorViewport::_notification(int p_what) { se->last_xform_dirty = false; se->last_xform = t; - VisualInstance *vi = Object::cast_to<VisualInstance>(sp); + VisualInstance3D *vi = Object::cast_to<VisualInstance3D>(sp); se->aabb = vi ? vi->get_aabb() : _calculate_spatial_bounds(sp); @@ -2436,7 +2455,7 @@ void SpatialEditorViewport::_notification(int p_what) { aabb_s.scale(se->aabb.size); t.basis = t.basis * aabb_s; - VisualServer::get_singleton()->instance_set_transform(se->sbox_instance, t); + RenderingServer::get_singleton()->instance_set_transform(se->sbox_instance, t); } if (changed || (spatial_editor->is_gizmo_visible() && !exist)) { @@ -2471,19 +2490,23 @@ void SpatialEditorViewport::_notification(int p_what) { bool shrink = view_menu->get_popup()->is_item_checked(view_menu->get_popup()->get_item_index(VIEW_HALF_RESOLUTION)); - if (shrink != (viewport_container->get_stretch_shrink() > 1)) { - viewport_container->set_stretch_shrink(shrink ? 2 : 1); + if (shrink != (subviewport_container->get_stretch_shrink() > 1)) { + subviewport_container->set_stretch_shrink(shrink ? 2 : 1); } //update msaa if changed - int msaa_mode = ProjectSettings::get_singleton()->get("rendering/quality/filters/msaa"); + int msaa_mode = ProjectSettings::get_singleton()->get("rendering/quality/screen_filters/msaa"); viewport->set_msaa(Viewport::MSAA(msaa_mode)); + int ssaa_mode = GLOBAL_GET("rendering/quality/screen_filters/screen_space_aa"); + viewport->set_screen_space_aa(Viewport::ScreenSpaceAA(ssaa_mode)); bool show_info = view_menu->get_popup()->is_item_checked(view_menu->get_popup()->get_item_index(VIEW_INFORMATION)); - info_label->set_visible(show_info); + if (show_info != info_label->is_visible()) { + info_label->set_visible(show_info); + } - Camera *current_camera; + Camera3D *current_camera; if (previewing) { current_camera = previewing; @@ -2508,17 +2531,46 @@ void SpatialEditorViewport::_notification(int p_what) { text += TTR("Surface Changes") + ": " + itos(viewport->get_render_info(Viewport::RENDER_INFO_SURFACE_CHANGES_IN_FRAME)) + "\n"; text += TTR("Draw Calls") + ": " + itos(viewport->get_render_info(Viewport::RENDER_INFO_DRAW_CALLS_IN_FRAME)) + "\n"; text += TTR("Vertices") + ": " + itos(viewport->get_render_info(Viewport::RENDER_INFO_VERTICES_IN_FRAME)); + info_label->set_text(text); } // FPS Counter. - bool show_fps = view_menu->get_popup()->is_item_checked(view_menu->get_popup()->get_item_index(VIEW_FPS)); - fps_label->set_visible(show_fps); - + bool show_fps = view_menu->get_popup()->is_item_checked(view_menu->get_popup()->get_item_index(VIEW_FRAME_TIME)); + + if (show_fps != fps_label->is_visible()) { + fps_label->set_visible(show_fps); + RS::get_singleton()->viewport_set_measure_render_time(viewport->get_viewport_rid(), show_fps); + for (int i = 0; i < FRAME_TIME_HISTORY; i++) { + cpu_time_history[i] = 0; + gpu_time_history[i] = 0; + } + cpu_time_history_index = 0; + cpu_time_history_index = 0; + } if (show_fps) { + + cpu_time_history[cpu_time_history_index] = RS::get_singleton()->viewport_get_measured_render_time_cpu(viewport->get_viewport_rid()); + cpu_time_history_index = (cpu_time_history_index + 1) % FRAME_TIME_HISTORY; + float cpu_time = 0.0; + for (int i = 0; i < FRAME_TIME_HISTORY; i++) { + cpu_time += cpu_time_history[i]; + } + cpu_time /= FRAME_TIME_HISTORY; + + gpu_time_history[gpu_time_history_index] = RS::get_singleton()->viewport_get_measured_render_time_gpu(viewport->get_viewport_rid()); + gpu_time_history_index = (gpu_time_history_index + 1) % FRAME_TIME_HISTORY; + float gpu_time = 0.0; + for (int i = 0; i < FRAME_TIME_HISTORY; i++) { + gpu_time += gpu_time_history[i]; + } + gpu_time /= FRAME_TIME_HISTORY; + String text; - const float temp_fps = Engine::get_singleton()->get_frames_per_second(); - text += TTR(vformat("FPS: %d (%s ms)", temp_fps, String::num(1000.0f / temp_fps, 2))); + text += TTR("CPU Time") + ": " + String::num(cpu_time, 1) + " ms\n"; + text += TTR("GPU Time") + ": " + String::num(gpu_time, 1) + " ms\n"; + text += TTR("FPS") + ": " + itos(1000.0 / gpu_time); + fps_label->set_text(text); } @@ -2537,12 +2589,12 @@ void SpatialEditorViewport::_notification(int p_what) { if (p_what == NOTIFICATION_ENTER_TREE) { - surface->connect("draw", callable_mp(this, &SpatialEditorViewport::_draw)); - surface->connect("gui_input", callable_mp(this, &SpatialEditorViewport::_sinput)); - surface->connect("mouse_entered", callable_mp(this, &SpatialEditorViewport::_surface_mouse_enter)); - surface->connect("mouse_exited", callable_mp(this, &SpatialEditorViewport::_surface_mouse_exit)); - surface->connect("focus_entered", callable_mp(this, &SpatialEditorViewport::_surface_focus_enter)); - surface->connect("focus_exited", callable_mp(this, &SpatialEditorViewport::_surface_focus_exit)); + surface->connect("draw", callable_mp(this, &Node3DEditorViewport::_draw)); + surface->connect("gui_input", callable_mp(this, &Node3DEditorViewport::_sinput)); + surface->connect("mouse_entered", callable_mp(this, &Node3DEditorViewport::_surface_mouse_enter)); + surface->connect("mouse_exited", callable_mp(this, &Node3DEditorViewport::_surface_mouse_exit)); + surface->connect("focus_entered", callable_mp(this, &Node3DEditorViewport::_surface_focus_enter)); + surface->connect("focus_exited", callable_mp(this, &Node3DEditorViewport::_surface_focus_exit)); _init_gizmo_instance(index); } @@ -2554,25 +2606,25 @@ void SpatialEditorViewport::_notification(int p_what) { if (p_what == NOTIFICATION_THEME_CHANGED) { - view_menu->set_icon(get_icon("GuiTabMenu", "EditorIcons")); - preview_camera->set_icon(get_icon("Camera", "EditorIcons")); + view_menu->set_icon(get_theme_icon("GuiTabMenu", "EditorIcons")); + preview_camera->set_icon(get_theme_icon("Camera3D", "EditorIcons")); - view_menu->add_style_override("normal", editor->get_gui_base()->get_stylebox("Information3dViewport", "EditorStyles")); - view_menu->add_style_override("hover", editor->get_gui_base()->get_stylebox("Information3dViewport", "EditorStyles")); - view_menu->add_style_override("pressed", editor->get_gui_base()->get_stylebox("Information3dViewport", "EditorStyles")); - view_menu->add_style_override("focus", editor->get_gui_base()->get_stylebox("Information3dViewport", "EditorStyles")); - view_menu->add_style_override("disabled", editor->get_gui_base()->get_stylebox("Information3dViewport", "EditorStyles")); + view_menu->add_theme_style_override("normal", editor->get_gui_base()->get_theme_stylebox("Information3dViewport", "EditorStyles")); + view_menu->add_theme_style_override("hover", editor->get_gui_base()->get_theme_stylebox("Information3dViewport", "EditorStyles")); + view_menu->add_theme_style_override("pressed", editor->get_gui_base()->get_theme_stylebox("Information3dViewport", "EditorStyles")); + view_menu->add_theme_style_override("focus", editor->get_gui_base()->get_theme_stylebox("Information3dViewport", "EditorStyles")); + view_menu->add_theme_style_override("disabled", editor->get_gui_base()->get_theme_stylebox("Information3dViewport", "EditorStyles")); - preview_camera->add_style_override("normal", editor->get_gui_base()->get_stylebox("Information3dViewport", "EditorStyles")); - preview_camera->add_style_override("hover", editor->get_gui_base()->get_stylebox("Information3dViewport", "EditorStyles")); - preview_camera->add_style_override("pressed", editor->get_gui_base()->get_stylebox("Information3dViewport", "EditorStyles")); - preview_camera->add_style_override("focus", editor->get_gui_base()->get_stylebox("Information3dViewport", "EditorStyles")); - preview_camera->add_style_override("disabled", editor->get_gui_base()->get_stylebox("Information3dViewport", "EditorStyles")); + preview_camera->add_theme_style_override("normal", editor->get_gui_base()->get_theme_stylebox("Information3dViewport", "EditorStyles")); + preview_camera->add_theme_style_override("hover", editor->get_gui_base()->get_theme_stylebox("Information3dViewport", "EditorStyles")); + preview_camera->add_theme_style_override("pressed", editor->get_gui_base()->get_theme_stylebox("Information3dViewport", "EditorStyles")); + preview_camera->add_theme_style_override("focus", editor->get_gui_base()->get_theme_stylebox("Information3dViewport", "EditorStyles")); + preview_camera->add_theme_style_override("disabled", editor->get_gui_base()->get_theme_stylebox("Information3dViewport", "EditorStyles")); - info_label->add_style_override("normal", editor->get_gui_base()->get_stylebox("Information3dViewport", "EditorStyles")); - fps_label->add_style_override("normal", editor->get_gui_base()->get_stylebox("Information3dViewport", "EditorStyles")); - cinema_label->add_style_override("normal", editor->get_gui_base()->get_stylebox("Information3dViewport", "EditorStyles")); - locked_label->add_style_override("normal", editor->get_gui_base()->get_stylebox("Information3dViewport", "EditorStyles")); + info_label->add_theme_style_override("normal", editor->get_gui_base()->get_theme_stylebox("Information3dViewport", "EditorStyles")); + fps_label->add_theme_style_override("normal", editor->get_gui_base()->get_theme_stylebox("Information3dViewport", "EditorStyles")); + cinema_label->add_theme_style_override("normal", editor->get_gui_base()->get_theme_stylebox("Information3dViewport", "EditorStyles")); + locked_label->add_theme_style_override("normal", editor->get_gui_base()->get_theme_stylebox("Information3dViewport", "EditorStyles")); } } @@ -2597,7 +2649,7 @@ static void draw_indicator_bar(Control &surface, real_t fill, Ref<Texture2D> ico surface.draw_texture(icon, icon_pos); } -void SpatialEditorViewport::_draw() { +void Node3DEditorViewport::_draw() { EditorPluginList *over_plugin_list = EditorNode::get_singleton()->get_editor_plugins_over(); if (!over_plugin_list->empty()) { @@ -2612,7 +2664,7 @@ void SpatialEditorViewport::_draw() { if (surface->has_focus()) { Size2 size = surface->get_size(); Rect2 r = Rect2(Point2(), size); - get_stylebox("Focus", "EditorStyles")->draw(surface->get_canvas_item(), r); + get_theme_stylebox("Focus", "EditorStyles")->draw(surface->get_canvas_item(), r); } if (cursor.region_select) { @@ -2620,11 +2672,11 @@ void SpatialEditorViewport::_draw() { surface->draw_rect( selection_rect, - get_color("box_selection_fill_color", "Editor")); + get_theme_color("box_selection_fill_color", "Editor")); surface->draw_rect( selection_rect, - get_color("box_selection_stroke_color", "Editor"), + get_theme_color("box_selection_stroke_color", "Editor"), false, Math::round(EDSCALE)); } @@ -2632,7 +2684,7 @@ void SpatialEditorViewport::_draw() { RID ci = surface->get_canvas_item(); if (message_time > 0) { - Ref<Font> font = get_font("font", "Label"); + Ref<Font> font = get_theme_font("font", "Label"); Point2 msgpos = Point2(5, get_size().y - 20); font->draw(ci, msgpos + Point2(1, 1), message, Color(0, 0, 0, 0.8)); font->draw(ci, msgpos + Point2(-1, -1), message, Color(0, 0, 0, 0.8)); @@ -2642,11 +2694,11 @@ void SpatialEditorViewport::_draw() { if (_edit.mode == TRANSFORM_ROTATE) { Point2 center = _point_to_screen(_edit.center); - VisualServer::get_singleton()->canvas_item_add_line( + RenderingServer::get_singleton()->canvas_item_add_line( ci, _edit.mouse_pos, center, - get_color("accent_color", "Editor") * Color(1, 1, 1, 0.6), + get_theme_color("accent_color", "Editor") * Color(1, 1, 1, 0.6), Math::round(2 * EDSCALE)); } if (previewing) { @@ -2658,14 +2710,14 @@ void SpatialEditorViewport::_draw() { Rect2 draw_rect; switch (previewing->get_keep_aspect_mode()) { - case Camera::KEEP_WIDTH: { + case Camera3D::KEEP_WIDTH: { draw_rect.size = Size2(s.width, s.width / aspect); draw_rect.position.x = 0; draw_rect.position.y = (s.height - draw_rect.size.y) * 0.5; } break; - case Camera::KEEP_HEIGHT: { + case Camera3D::KEEP_HEIGHT: { draw_rect.size = Size2(s.height * aspect, s.height); draw_rect.position.y = 0; @@ -2697,7 +2749,7 @@ void SpatialEditorViewport::_draw() { if (logscale_t < 0.25) logscale_t = 0.25 * Math::exp(4.0 * logscale_t - 1.0); - draw_indicator_bar(*surface, 1.0 - logscale_t, get_icon("ViewportSpeed", "EditorIcons")); + draw_indicator_bar(*surface, 1.0 - logscale_t, get_theme_icon("ViewportSpeed", "EditorIcons")); } } else { @@ -2715,14 +2767,14 @@ void SpatialEditorViewport::_draw() { if (logscale_t < 0.25) logscale_t = 0.25 * Math::exp(4.0 * logscale_t - 1.0); - draw_indicator_bar(*surface, logscale_t, get_icon("ViewportZoom", "EditorIcons")); + draw_indicator_bar(*surface, logscale_t, get_theme_icon("ViewportZoom", "EditorIcons")); } } } } } -void SpatialEditorViewport::_menu_option(int p_option) { +void Node3DEditorViewport::_menu_option(int p_option) { switch (p_option) { @@ -2809,11 +2861,11 @@ void SpatialEditorViewport::_menu_option(int p_option) { for (List<Node *>::Element *E = selection.front(); E; E = E->next()) { - Spatial *sp = Object::cast_to<Spatial>(E->get()); + Node3D *sp = Object::cast_to<Node3D>(E->get()); if (!sp) continue; - SpatialEditorSelectedItem *se = editor_selection->get_node_editor_data<SpatialEditorSelectedItem>(sp); + Node3DEditorSelectedItem *se = editor_selection->get_node_editor_data<Node3DEditorSelectedItem>(sp); if (!se) continue; @@ -2845,11 +2897,11 @@ void SpatialEditorViewport::_menu_option(int p_option) { undo_redo->create_action(TTR("Align Rotation with View")); for (List<Node *>::Element *E = selection.front(); E; E = E->next()) { - Spatial *sp = Object::cast_to<Spatial>(E->get()); + Node3D *sp = Object::cast_to<Node3D>(E->get()); if (!sp) continue; - SpatialEditorSelectedItem *se = editor_selection->get_node_editor_data<SpatialEditorSelectedItem>(sp); + Node3DEditorSelectedItem *se = editor_selection->get_node_editor_data<Node3DEditorSelectedItem>(sp); if (!se) continue; @@ -2869,7 +2921,7 @@ void SpatialEditorViewport::_menu_option(int p_option) { camera->set_environment(RES()); } else { - camera->set_environment(SpatialEditor::get_singleton()->get_viewport_environment()); + camera->set_environment(Node3DEditor::get_singleton()->get_viewport_environment()); } view_menu->get_popup()->set_item_checked(idx, current); @@ -2933,7 +2985,7 @@ void SpatialEditorViewport::_menu_option(int p_option) { int idx = view_menu->get_popup()->get_item_index(VIEW_AUDIO_DOPPLER); bool current = view_menu->get_popup()->is_item_checked(idx); current = !current; - camera->set_doppler_tracking(current ? Camera::DOPPLER_TRACKING_IDLE_STEP : Camera::DOPPLER_TRACKING_DISABLED); + camera->set_doppler_tracking(current ? Camera3D::DOPPLER_TRACKING_IDLE_STEP : Camera3D::DOPPLER_TRACKING_DISABLED); view_menu->get_popup()->set_item_checked(idx, current); } break; @@ -2949,7 +3001,7 @@ void SpatialEditorViewport::_menu_option(int p_option) { if (current) { preview_camera->hide(); } else { - if (previewing != NULL) + if (previewing != nullptr) preview_camera->show(); } } break; @@ -2979,9 +3031,9 @@ void SpatialEditorViewport::_menu_option(int p_option) { view_menu->get_popup()->set_item_checked(idx, !current); } break; - case VIEW_FPS: { + case VIEW_FRAME_TIME: { - int idx = view_menu->get_popup()->get_item_index(VIEW_FPS); + int idx = view_menu->get_popup()->get_item_index(VIEW_FRAME_TIME); bool current = view_menu->get_popup()->is_item_checked(idx); view_menu->get_popup()->set_item_checked(idx, !current); @@ -2999,6 +3051,8 @@ void SpatialEditorViewport::_menu_option(int p_option) { case VIEW_DISPLAY_DEBUG_GIPROBE_EMISSION: case VIEW_DISPLAY_DEBUG_SCENE_LUMINANCE: case VIEW_DISPLAY_DEBUG_SSAO: + case VIEW_DISPLAY_DEBUG_PSSM_SPLITS: + case VIEW_DISPLAY_DEBUG_DECAL_ATLAS: case VIEW_DISPLAY_DEBUG_ROUGHNESS_LIMITER: { static const int display_options[] = { @@ -3017,6 +3071,8 @@ void SpatialEditorViewport::_menu_option(int p_option) { VIEW_DISPLAY_DEBUG_SCENE_LUMINANCE, VIEW_DISPLAY_DEBUG_SSAO, VIEW_DISPLAY_DEBUG_ROUGHNESS_LIMITER, + VIEW_DISPLAY_DEBUG_PSSM_SPLITS, + VIEW_DISPLAY_DEBUG_DECAL_ATLAS, VIEW_MAX }; static const Viewport::DebugDraw debug_draw_modes[] = { @@ -3035,6 +3091,8 @@ void SpatialEditorViewport::_menu_option(int p_option) { Viewport::DEBUG_DRAW_SCENE_LUMINANCE, Viewport::DEBUG_DRAW_SSAO, Viewport::DEBUG_DRAW_ROUGHNESS_LIMITER, + Viewport::DEBUG_DRAW_PSSM_SPLITS, + Viewport::DEBUG_DRAW_DECAL_ATLAS, }; int idx = 0; @@ -3060,84 +3118,84 @@ void SpatialEditorViewport::_menu_option(int p_option) { } } -void SpatialEditorViewport::_set_auto_orthogonal() { +void Node3DEditorViewport::_set_auto_orthogonal() { if (!orthogonal && view_menu->get_popup()->is_item_checked(view_menu->get_popup()->get_item_index(VIEW_AUTO_ORTHOGONAL))) { _menu_option(VIEW_ORTHOGONAL); auto_orthogonal = true; } } -void SpatialEditorViewport::_preview_exited_scene() { +void Node3DEditorViewport::_preview_exited_scene() { - preview_camera->disconnect("toggled", callable_mp(this, &SpatialEditorViewport::_toggle_camera_preview)); + preview_camera->disconnect("toggled", callable_mp(this, &Node3DEditorViewport::_toggle_camera_preview)); preview_camera->set_pressed(false); _toggle_camera_preview(false); - preview_camera->connect("toggled", callable_mp(this, &SpatialEditorViewport::_toggle_camera_preview)); + preview_camera->connect("toggled", callable_mp(this, &Node3DEditorViewport::_toggle_camera_preview)); view_menu->show(); } -void SpatialEditorViewport::_init_gizmo_instance(int p_idx) { +void Node3DEditorViewport::_init_gizmo_instance(int p_idx) { uint32_t layer = 1 << (GIZMO_BASE_LAYER + p_idx); for (int i = 0; i < 3; i++) { - move_gizmo_instance[i] = VS::get_singleton()->instance_create(); - VS::get_singleton()->instance_set_base(move_gizmo_instance[i], spatial_editor->get_move_gizmo(i)->get_rid()); - VS::get_singleton()->instance_set_scenario(move_gizmo_instance[i], get_tree()->get_root()->get_world()->get_scenario()); - VS::get_singleton()->instance_set_visible(move_gizmo_instance[i], false); - VS::get_singleton()->instance_geometry_set_cast_shadows_setting(move_gizmo_instance[i], VS::SHADOW_CASTING_SETTING_OFF); - VS::get_singleton()->instance_set_layer_mask(move_gizmo_instance[i], layer); - - move_plane_gizmo_instance[i] = VS::get_singleton()->instance_create(); - VS::get_singleton()->instance_set_base(move_plane_gizmo_instance[i], spatial_editor->get_move_plane_gizmo(i)->get_rid()); - VS::get_singleton()->instance_set_scenario(move_plane_gizmo_instance[i], get_tree()->get_root()->get_world()->get_scenario()); - VS::get_singleton()->instance_set_visible(move_plane_gizmo_instance[i], false); - VS::get_singleton()->instance_geometry_set_cast_shadows_setting(move_plane_gizmo_instance[i], VS::SHADOW_CASTING_SETTING_OFF); - VS::get_singleton()->instance_set_layer_mask(move_plane_gizmo_instance[i], layer); - - rotate_gizmo_instance[i] = VS::get_singleton()->instance_create(); - VS::get_singleton()->instance_set_base(rotate_gizmo_instance[i], spatial_editor->get_rotate_gizmo(i)->get_rid()); - VS::get_singleton()->instance_set_scenario(rotate_gizmo_instance[i], get_tree()->get_root()->get_world()->get_scenario()); - VS::get_singleton()->instance_set_visible(rotate_gizmo_instance[i], false); - VS::get_singleton()->instance_geometry_set_cast_shadows_setting(rotate_gizmo_instance[i], VS::SHADOW_CASTING_SETTING_OFF); - VS::get_singleton()->instance_set_layer_mask(rotate_gizmo_instance[i], layer); - - scale_gizmo_instance[i] = VS::get_singleton()->instance_create(); - VS::get_singleton()->instance_set_base(scale_gizmo_instance[i], spatial_editor->get_scale_gizmo(i)->get_rid()); - VS::get_singleton()->instance_set_scenario(scale_gizmo_instance[i], get_tree()->get_root()->get_world()->get_scenario()); - VS::get_singleton()->instance_set_visible(scale_gizmo_instance[i], false); - VS::get_singleton()->instance_geometry_set_cast_shadows_setting(scale_gizmo_instance[i], VS::SHADOW_CASTING_SETTING_OFF); - VS::get_singleton()->instance_set_layer_mask(scale_gizmo_instance[i], layer); - - scale_plane_gizmo_instance[i] = VS::get_singleton()->instance_create(); - VS::get_singleton()->instance_set_base(scale_plane_gizmo_instance[i], spatial_editor->get_scale_plane_gizmo(i)->get_rid()); - VS::get_singleton()->instance_set_scenario(scale_plane_gizmo_instance[i], get_tree()->get_root()->get_world()->get_scenario()); - VS::get_singleton()->instance_set_visible(scale_plane_gizmo_instance[i], false); - VS::get_singleton()->instance_geometry_set_cast_shadows_setting(scale_plane_gizmo_instance[i], VS::SHADOW_CASTING_SETTING_OFF); - VS::get_singleton()->instance_set_layer_mask(scale_plane_gizmo_instance[i], layer); - } -} - -void SpatialEditorViewport::_finish_gizmo_instances() { + move_gizmo_instance[i] = RS::get_singleton()->instance_create(); + RS::get_singleton()->instance_set_base(move_gizmo_instance[i], spatial_editor->get_move_gizmo(i)->get_rid()); + RS::get_singleton()->instance_set_scenario(move_gizmo_instance[i], get_tree()->get_root()->get_world()->get_scenario()); + RS::get_singleton()->instance_set_visible(move_gizmo_instance[i], false); + RS::get_singleton()->instance_geometry_set_cast_shadows_setting(move_gizmo_instance[i], RS::SHADOW_CASTING_SETTING_OFF); + RS::get_singleton()->instance_set_layer_mask(move_gizmo_instance[i], layer); + + move_plane_gizmo_instance[i] = RS::get_singleton()->instance_create(); + RS::get_singleton()->instance_set_base(move_plane_gizmo_instance[i], spatial_editor->get_move_plane_gizmo(i)->get_rid()); + RS::get_singleton()->instance_set_scenario(move_plane_gizmo_instance[i], get_tree()->get_root()->get_world()->get_scenario()); + RS::get_singleton()->instance_set_visible(move_plane_gizmo_instance[i], false); + RS::get_singleton()->instance_geometry_set_cast_shadows_setting(move_plane_gizmo_instance[i], RS::SHADOW_CASTING_SETTING_OFF); + RS::get_singleton()->instance_set_layer_mask(move_plane_gizmo_instance[i], layer); + + rotate_gizmo_instance[i] = RS::get_singleton()->instance_create(); + RS::get_singleton()->instance_set_base(rotate_gizmo_instance[i], spatial_editor->get_rotate_gizmo(i)->get_rid()); + RS::get_singleton()->instance_set_scenario(rotate_gizmo_instance[i], get_tree()->get_root()->get_world()->get_scenario()); + RS::get_singleton()->instance_set_visible(rotate_gizmo_instance[i], false); + RS::get_singleton()->instance_geometry_set_cast_shadows_setting(rotate_gizmo_instance[i], RS::SHADOW_CASTING_SETTING_OFF); + RS::get_singleton()->instance_set_layer_mask(rotate_gizmo_instance[i], layer); + + scale_gizmo_instance[i] = RS::get_singleton()->instance_create(); + RS::get_singleton()->instance_set_base(scale_gizmo_instance[i], spatial_editor->get_scale_gizmo(i)->get_rid()); + RS::get_singleton()->instance_set_scenario(scale_gizmo_instance[i], get_tree()->get_root()->get_world()->get_scenario()); + RS::get_singleton()->instance_set_visible(scale_gizmo_instance[i], false); + RS::get_singleton()->instance_geometry_set_cast_shadows_setting(scale_gizmo_instance[i], RS::SHADOW_CASTING_SETTING_OFF); + RS::get_singleton()->instance_set_layer_mask(scale_gizmo_instance[i], layer); + + scale_plane_gizmo_instance[i] = RS::get_singleton()->instance_create(); + RS::get_singleton()->instance_set_base(scale_plane_gizmo_instance[i], spatial_editor->get_scale_plane_gizmo(i)->get_rid()); + RS::get_singleton()->instance_set_scenario(scale_plane_gizmo_instance[i], get_tree()->get_root()->get_world()->get_scenario()); + RS::get_singleton()->instance_set_visible(scale_plane_gizmo_instance[i], false); + RS::get_singleton()->instance_geometry_set_cast_shadows_setting(scale_plane_gizmo_instance[i], RS::SHADOW_CASTING_SETTING_OFF); + RS::get_singleton()->instance_set_layer_mask(scale_plane_gizmo_instance[i], layer); + } +} + +void Node3DEditorViewport::_finish_gizmo_instances() { for (int i = 0; i < 3; i++) { - VS::get_singleton()->free(move_gizmo_instance[i]); - VS::get_singleton()->free(move_plane_gizmo_instance[i]); - VS::get_singleton()->free(rotate_gizmo_instance[i]); - VS::get_singleton()->free(scale_gizmo_instance[i]); - VS::get_singleton()->free(scale_plane_gizmo_instance[i]); + RS::get_singleton()->free(move_gizmo_instance[i]); + RS::get_singleton()->free(move_plane_gizmo_instance[i]); + RS::get_singleton()->free(rotate_gizmo_instance[i]); + RS::get_singleton()->free(scale_gizmo_instance[i]); + RS::get_singleton()->free(scale_plane_gizmo_instance[i]); } } -void SpatialEditorViewport::_toggle_camera_preview(bool p_activate) { +void Node3DEditorViewport::_toggle_camera_preview(bool p_activate) { ERR_FAIL_COND(p_activate && !preview); ERR_FAIL_COND(!p_activate && !previewing); if (!p_activate) { - previewing->disconnect("tree_exiting", callable_mp(this, &SpatialEditorViewport::_preview_exited_scene)); - previewing = NULL; - VS::get_singleton()->viewport_attach_camera(viewport->get_viewport_rid(), camera->get_camera()); //restore + previewing->disconnect("tree_exiting", callable_mp(this, &Node3DEditorViewport::_preview_exited_scene)); + previewing = nullptr; + RS::get_singleton()->viewport_attach_camera(viewport->get_viewport_rid(), camera->get_camera()); //restore if (!preview) preview_camera->hide(); view_menu->set_disabled(false); @@ -3146,21 +3204,21 @@ void SpatialEditorViewport::_toggle_camera_preview(bool p_activate) { } else { previewing = preview; - previewing->connect("tree_exiting", callable_mp(this, &SpatialEditorViewport::_preview_exited_scene)); - VS::get_singleton()->viewport_attach_camera(viewport->get_viewport_rid(), preview->get_camera()); //replace + previewing->connect("tree_exiting", callable_mp(this, &Node3DEditorViewport::_preview_exited_scene)); + RS::get_singleton()->viewport_attach_camera(viewport->get_viewport_rid(), preview->get_camera()); //replace view_menu->set_disabled(true); surface->update(); } } -void SpatialEditorViewport::_toggle_cinema_preview(bool p_activate) { +void Node3DEditorViewport::_toggle_cinema_preview(bool p_activate) { previewing_cinema = p_activate; if (!previewing_cinema) { - if (previewing != NULL) - previewing->disconnect("tree_exited", callable_mp(this, &SpatialEditorViewport::_preview_exited_scene)); + if (previewing != nullptr) + previewing->disconnect("tree_exited", callable_mp(this, &Node3DEditorViewport::_preview_exited_scene)); - previewing = NULL; - VS::get_singleton()->viewport_attach_camera(viewport->get_viewport_rid(), camera->get_camera()); //restore + previewing = nullptr; + RS::get_singleton()->viewport_attach_camera(viewport->get_viewport_rid(), camera->get_camera()); //restore preview_camera->set_pressed(false); if (!preview) { preview_camera->hide(); @@ -3172,7 +3230,7 @@ void SpatialEditorViewport::_toggle_cinema_preview(bool p_activate) { } } -void SpatialEditorViewport::_selection_result_pressed(int p_result) { +void Node3DEditorViewport::_selection_result_pressed(int p_result) { if (selection_results.size() <= p_result) return; @@ -3180,19 +3238,19 @@ void SpatialEditorViewport::_selection_result_pressed(int p_result) { clicked = selection_results[p_result].item->get_instance_id(); if (clicked.is_valid()) { - _select_clicked(clicked_wants_append, true, spatial_editor->get_tool_mode() != SpatialEditor::TOOL_MODE_LIST_SELECT); + _select_clicked(clicked_wants_append, true, spatial_editor->get_tool_mode() != Node3DEditor::TOOL_MODE_LIST_SELECT); clicked = ObjectID(); } } -void SpatialEditorViewport::_selection_menu_hide() { +void Node3DEditorViewport::_selection_menu_hide() { selection_results.clear(); selection_menu->clear(); selection_menu->set_size(Vector2(0, 0)); } -void SpatialEditorViewport::set_can_preview(Camera *p_preview) { +void Node3DEditorViewport::set_can_preview(Camera3D *p_preview) { preview = p_preview; @@ -3200,7 +3258,7 @@ void SpatialEditorViewport::set_can_preview(Camera *p_preview) { preview_camera->set_visible(p_preview); } -void SpatialEditorViewport::update_transform_gizmo_view() { +void Node3DEditorViewport::update_transform_gizmo_view() { if (!is_visible_in_tree()) return; @@ -3211,11 +3269,11 @@ void SpatialEditorViewport::update_transform_gizmo_view() { if (xform.origin.distance_squared_to(camera_xform.origin) < 0.01) { for (int i = 0; i < 3; i++) { - VisualServer::get_singleton()->instance_set_visible(move_gizmo_instance[i], false); - VisualServer::get_singleton()->instance_set_visible(move_plane_gizmo_instance[i], false); - VisualServer::get_singleton()->instance_set_visible(rotate_gizmo_instance[i], false); - VisualServer::get_singleton()->instance_set_visible(scale_gizmo_instance[i], false); - VisualServer::get_singleton()->instance_set_visible(scale_plane_gizmo_instance[i], false); + RenderingServer::get_singleton()->instance_set_visible(move_gizmo_instance[i], false); + RenderingServer::get_singleton()->instance_set_visible(move_plane_gizmo_instance[i], false); + RenderingServer::get_singleton()->instance_set_visible(rotate_gizmo_instance[i], false); + RenderingServer::get_singleton()->instance_set_visible(scale_gizmo_instance[i], false); + RenderingServer::get_singleton()->instance_set_visible(scale_plane_gizmo_instance[i], false); } return; } @@ -3236,27 +3294,27 @@ void SpatialEditorViewport::update_transform_gizmo_view() { const int viewport_base_height = 400 * MAX(1, EDSCALE); gizmo_scale = (gizmo_size / Math::abs(dd)) * MAX(1, EDSCALE) * - MIN(viewport_base_height, viewport_container->get_size().height) / viewport_base_height / - viewport_container->get_stretch_shrink(); + MIN(viewport_base_height, subviewport_container->get_size().height) / viewport_base_height / + subviewport_container->get_stretch_shrink(); Vector3 scale = Vector3(1, 1, 1) * gizmo_scale; xform.basis.scale(scale); for (int i = 0; i < 3; i++) { - VisualServer::get_singleton()->instance_set_transform(move_gizmo_instance[i], xform); - VisualServer::get_singleton()->instance_set_visible(move_gizmo_instance[i], spatial_editor->is_gizmo_visible() && (spatial_editor->get_tool_mode() == SpatialEditor::TOOL_MODE_SELECT || spatial_editor->get_tool_mode() == SpatialEditor::TOOL_MODE_MOVE)); - VisualServer::get_singleton()->instance_set_transform(move_plane_gizmo_instance[i], xform); - VisualServer::get_singleton()->instance_set_visible(move_plane_gizmo_instance[i], spatial_editor->is_gizmo_visible() && (spatial_editor->get_tool_mode() == SpatialEditor::TOOL_MODE_SELECT || spatial_editor->get_tool_mode() == SpatialEditor::TOOL_MODE_MOVE)); - VisualServer::get_singleton()->instance_set_transform(rotate_gizmo_instance[i], xform); - VisualServer::get_singleton()->instance_set_visible(rotate_gizmo_instance[i], spatial_editor->is_gizmo_visible() && (spatial_editor->get_tool_mode() == SpatialEditor::TOOL_MODE_SELECT || spatial_editor->get_tool_mode() == SpatialEditor::TOOL_MODE_ROTATE)); - VisualServer::get_singleton()->instance_set_transform(scale_gizmo_instance[i], xform); - VisualServer::get_singleton()->instance_set_visible(scale_gizmo_instance[i], spatial_editor->is_gizmo_visible() && (spatial_editor->get_tool_mode() == SpatialEditor::TOOL_MODE_SCALE)); - VisualServer::get_singleton()->instance_set_transform(scale_plane_gizmo_instance[i], xform); - VisualServer::get_singleton()->instance_set_visible(scale_plane_gizmo_instance[i], spatial_editor->is_gizmo_visible() && (spatial_editor->get_tool_mode() == SpatialEditor::TOOL_MODE_SCALE)); + RenderingServer::get_singleton()->instance_set_transform(move_gizmo_instance[i], xform); + RenderingServer::get_singleton()->instance_set_visible(move_gizmo_instance[i], spatial_editor->is_gizmo_visible() && (spatial_editor->get_tool_mode() == Node3DEditor::TOOL_MODE_SELECT || spatial_editor->get_tool_mode() == Node3DEditor::TOOL_MODE_MOVE)); + RenderingServer::get_singleton()->instance_set_transform(move_plane_gizmo_instance[i], xform); + RenderingServer::get_singleton()->instance_set_visible(move_plane_gizmo_instance[i], spatial_editor->is_gizmo_visible() && (spatial_editor->get_tool_mode() == Node3DEditor::TOOL_MODE_SELECT || spatial_editor->get_tool_mode() == Node3DEditor::TOOL_MODE_MOVE)); + RenderingServer::get_singleton()->instance_set_transform(rotate_gizmo_instance[i], xform); + RenderingServer::get_singleton()->instance_set_visible(rotate_gizmo_instance[i], spatial_editor->is_gizmo_visible() && (spatial_editor->get_tool_mode() == Node3DEditor::TOOL_MODE_SELECT || spatial_editor->get_tool_mode() == Node3DEditor::TOOL_MODE_ROTATE)); + RenderingServer::get_singleton()->instance_set_transform(scale_gizmo_instance[i], xform); + RenderingServer::get_singleton()->instance_set_visible(scale_gizmo_instance[i], spatial_editor->is_gizmo_visible() && (spatial_editor->get_tool_mode() == Node3DEditor::TOOL_MODE_SCALE)); + RenderingServer::get_singleton()->instance_set_transform(scale_plane_gizmo_instance[i], xform); + RenderingServer::get_singleton()->instance_set_visible(scale_plane_gizmo_instance[i], spatial_editor->is_gizmo_visible() && (spatial_editor->get_tool_mode() == Node3DEditor::TOOL_MODE_SCALE)); } } -void SpatialEditorViewport::set_state(const Dictionary &p_state) { +void Node3DEditorViewport::set_state(const Dictionary &p_state) { if (p_state.has("position")) cursor.pos = p_state["position"]; @@ -3317,7 +3375,7 @@ void SpatialEditorViewport::set_state(const Dictionary &p_state) { bool doppler = p_state["doppler"]; int idx = view_menu->get_popup()->get_item_index(VIEW_AUDIO_DOPPLER); - camera->set_doppler_tracking(doppler ? Camera::DOPPLER_TRACKING_IDLE_STEP : Camera::DOPPLER_TRACKING_DISABLED); + camera->set_doppler_tracking(doppler ? Camera3D::DOPPLER_TRACKING_IDLE_STEP : Camera3D::DOPPLER_TRACKING_DISABLED); view_menu->get_popup()->set_item_checked(idx, doppler); } if (p_state.has("gizmos")) { @@ -3334,12 +3392,12 @@ void SpatialEditorViewport::set_state(const Dictionary &p_state) { if (view_menu->get_popup()->is_item_checked(idx) != information) _menu_option(VIEW_INFORMATION); } - if (p_state.has("fps")) { - bool fps = p_state["fps"]; + if (p_state.has("frame_time")) { + bool fps = p_state["frame_time"]; - int idx = view_menu->get_popup()->get_item_index(VIEW_FPS); + int idx = view_menu->get_popup()->get_item_index(VIEW_FRAME_TIME); if (view_menu->get_popup()->is_item_checked(idx) != fps) - _menu_option(VIEW_FPS); + _menu_option(VIEW_FRAME_TIME); } if (p_state.has("half_res")) { bool half_res = p_state["half_res"]; @@ -3354,25 +3412,25 @@ void SpatialEditorViewport::set_state(const Dictionary &p_state) { view_menu->get_popup()->set_item_checked(idx, previewing_cinema); } - if (preview_camera->is_connected("toggled", callable_mp(this, &SpatialEditorViewport::_toggle_camera_preview))) { - preview_camera->disconnect("toggled", callable_mp(this, &SpatialEditorViewport::_toggle_camera_preview)); + if (preview_camera->is_connected("toggled", callable_mp(this, &Node3DEditorViewport::_toggle_camera_preview))) { + preview_camera->disconnect("toggled", callable_mp(this, &Node3DEditorViewport::_toggle_camera_preview)); } if (p_state.has("previewing")) { Node *pv = EditorNode::get_singleton()->get_edited_scene()->get_node(p_state["previewing"]); - if (Object::cast_to<Camera>(pv)) { - previewing = Object::cast_to<Camera>(pv); - previewing->connect("tree_exiting", callable_mp(this, &SpatialEditorViewport::_preview_exited_scene)); - VS::get_singleton()->viewport_attach_camera(viewport->get_viewport_rid(), previewing->get_camera()); //replace + if (Object::cast_to<Camera3D>(pv)) { + previewing = Object::cast_to<Camera3D>(pv); + previewing->connect("tree_exiting", callable_mp(this, &Node3DEditorViewport::_preview_exited_scene)); + RS::get_singleton()->viewport_attach_camera(viewport->get_viewport_rid(), previewing->get_camera()); //replace view_menu->set_disabled(true); surface->update(); preview_camera->set_pressed(true); preview_camera->show(); } } - preview_camera->connect("toggled", callable_mp(this, &SpatialEditorViewport::_toggle_camera_preview)); + preview_camera->connect("toggled", callable_mp(this, &Node3DEditorViewport::_toggle_camera_preview)); } -Dictionary SpatialEditorViewport::get_state() const { +Dictionary Node3DEditorViewport::get_state() const { Dictionary d; d["position"] = cursor.pos; @@ -3380,7 +3438,7 @@ Dictionary SpatialEditorViewport::get_state() const { d["y_rotation"] = cursor.y_rot; d["distance"] = cursor.distance; d["use_environment"] = camera->get_environment().is_valid(); - d["use_orthogonal"] = camera->get_projection() == Camera::PROJECTION_ORTHOGONAL; + d["use_orthogonal"] = camera->get_projection() == Camera3D::PROJECTION_ORTHOGONAL; d["view_name"] = name; d["auto_orthogonal"] = auto_orthogonal; d["auto_orthogonal_enabled"] = view_menu->get_popup()->is_item_checked(view_menu->get_popup()->get_item_index(VIEW_AUTO_ORTHOGONAL)); @@ -3396,8 +3454,8 @@ Dictionary SpatialEditorViewport::get_state() const { d["doppler"] = view_menu->get_popup()->is_item_checked(view_menu->get_popup()->get_item_index(VIEW_AUDIO_DOPPLER)); d["gizmos"] = view_menu->get_popup()->is_item_checked(view_menu->get_popup()->get_item_index(VIEW_GIZMOS)); d["information"] = view_menu->get_popup()->is_item_checked(view_menu->get_popup()->get_item_index(VIEW_INFORMATION)); - d["fps"] = view_menu->get_popup()->is_item_checked(view_menu->get_popup()->get_item_index(VIEW_FPS)); - d["half_res"] = viewport_container->get_stretch_shrink() > 1; + d["frame_time"] = view_menu->get_popup()->is_item_checked(view_menu->get_popup()->get_item_index(VIEW_FRAME_TIME)); + d["half_res"] = subviewport_container->get_stretch_shrink() > 1; d["cinematic_preview"] = view_menu->get_popup()->is_item_checked(view_menu->get_popup()->get_item_index(VIEW_CINEMATIC_PREVIEW)); if (previewing) d["previewing"] = EditorNode::get_singleton()->get_edited_scene()->get_path_to(previewing); @@ -3407,17 +3465,17 @@ Dictionary SpatialEditorViewport::get_state() const { return d; } -void SpatialEditorViewport::_bind_methods() { +void Node3DEditorViewport::_bind_methods() { - ClassDB::bind_method(D_METHOD("update_transform_gizmo_view"), &SpatialEditorViewport::update_transform_gizmo_view); // Used by call_deferred. - ClassDB::bind_method(D_METHOD("can_drop_data_fw"), &SpatialEditorViewport::can_drop_data_fw); - ClassDB::bind_method(D_METHOD("drop_data_fw"), &SpatialEditorViewport::drop_data_fw); + ClassDB::bind_method(D_METHOD("update_transform_gizmo_view"), &Node3DEditorViewport::update_transform_gizmo_view); // Used by call_deferred. + ClassDB::bind_method(D_METHOD("can_drop_data_fw"), &Node3DEditorViewport::can_drop_data_fw); + ClassDB::bind_method(D_METHOD("drop_data_fw"), &Node3DEditorViewport::drop_data_fw); ADD_SIGNAL(MethodInfo("toggle_maximize_view", PropertyInfo(Variant::OBJECT, "viewport"))); ADD_SIGNAL(MethodInfo("clicked", PropertyInfo(Variant::OBJECT, "viewport"))); } -void SpatialEditorViewport::reset() { +void Node3DEditorViewport::reset() { orthogonal = false; auto_orthogonal = false; @@ -3435,7 +3493,7 @@ void SpatialEditorViewport::reset() { _update_name(); } -void SpatialEditorViewport::focus_selection() { +void Node3DEditorViewport::focus_selection() { if (!get_selected_count()) return; @@ -3446,11 +3504,11 @@ void SpatialEditorViewport::focus_selection() { for (List<Node *>::Element *E = selection.front(); E; E = E->next()) { - Spatial *sp = Object::cast_to<Spatial>(E->get()); + Node3D *sp = Object::cast_to<Node3D>(E->get()); if (!sp) continue; - SpatialEditorSelectedItem *se = editor_selection->get_node_editor_data<SpatialEditorSelectedItem>(sp); + Node3DEditorSelectedItem *se = editor_selection->get_node_editor_data<Node3DEditorSelectedItem>(sp); if (!se) continue; @@ -3465,20 +3523,20 @@ void SpatialEditorViewport::focus_selection() { cursor.pos = center; } -void SpatialEditorViewport::assign_pending_data_pointers(Spatial *p_preview_node, AABB *p_preview_bounds, AcceptDialog *p_accept) { +void Node3DEditorViewport::assign_pending_data_pointers(Node3D *p_preview_node, AABB *p_preview_bounds, AcceptDialog *p_accept) { preview_node = p_preview_node; preview_bounds = p_preview_bounds; accept = p_accept; } -Vector3 SpatialEditorViewport::_get_instance_position(const Point2 &p_pos) const { +Vector3 Node3DEditorViewport::_get_instance_position(const Point2 &p_pos) const { const float MAX_DISTANCE = 10; Vector3 world_ray = _get_ray(p_pos); Vector3 world_pos = _get_ray_pos(p_pos); - Vector<ObjectID> instances = VisualServer::get_singleton()->instances_cull_ray(world_pos, world_ray, get_tree()->get_root()->get_world()->get_scenario()); - Set<Ref<EditorSpatialGizmo>> found_gizmos; + Vector<ObjectID> instances = RenderingServer::get_singleton()->instances_cull_ray(world_pos, world_ray, get_tree()->get_root()->get_world()->get_scenario()); + Set<Ref<EditorNode3DGizmo>> found_gizmos; float closest_dist = MAX_DISTANCE; @@ -3487,12 +3545,12 @@ Vector3 SpatialEditorViewport::_get_instance_position(const Point2 &p_pos) const for (int i = 0; i < instances.size(); i++) { - MeshInstance *mesh_instance = Object::cast_to<MeshInstance>(ObjectDB::get_instance(instances[i])); + MeshInstance3D *mesh_instance = Object::cast_to<MeshInstance3D>(ObjectDB::get_instance(instances[i])); if (!mesh_instance) continue; - Ref<EditorSpatialGizmo> seg = mesh_instance->get_gizmo(); + Ref<EditorNode3DGizmo> seg = mesh_instance->get_gizmo(); if ((!seg.is_valid()) || found_gizmos.has(seg)) { continue; @@ -3502,7 +3560,7 @@ Vector3 SpatialEditorViewport::_get_instance_position(const Point2 &p_pos) const Vector3 hit_point; Vector3 hit_normal; - bool inters = seg->intersect_ray(camera, p_pos, hit_point, hit_normal, NULL, false); + bool inters = seg->intersect_ray(camera, p_pos, hit_point, hit_normal, nullptr, false); if (!inters) continue; @@ -3528,20 +3586,20 @@ Vector3 SpatialEditorViewport::_get_instance_position(const Point2 &p_pos) const return point + offset; } -AABB SpatialEditorViewport::_calculate_spatial_bounds(const Spatial *p_parent, bool p_exclude_toplevel_transform) { +AABB Node3DEditorViewport::_calculate_spatial_bounds(const Node3D *p_parent, bool p_exclude_toplevel_transform) { AABB bounds; - const MeshInstance *mesh_instance = Object::cast_to<MeshInstance>(p_parent); + const MeshInstance3D *mesh_instance = Object::cast_to<MeshInstance3D>(p_parent); if (mesh_instance) { bounds = mesh_instance->get_aabb(); } for (int i = 0; i < p_parent->get_child_count(); i++) { - Spatial *child = Object::cast_to<Spatial>(p_parent->get_child(i)); + Node3D *child = Object::cast_to<Node3D>(p_parent->get_child(i)); if (child) { AABB child_bounds = _calculate_spatial_bounds(child, false); - if (bounds.size == Vector3() && p_parent->get_class_name() == StringName("Spatial")) { + if (bounds.size == Vector3() && p_parent->get_class_name() == StringName("Node3D")) { bounds = child_bounds; } else { bounds.merge_with(child_bounds); @@ -3549,7 +3607,7 @@ AABB SpatialEditorViewport::_calculate_spatial_bounds(const Spatial *p_parent, b } } - if (bounds.size == Vector3() && p_parent->get_class_name() != StringName("Spatial")) { + if (bounds.size == Vector3() && p_parent->get_class_name() != StringName("Node3D")) { bounds = AABB(Vector3(-0.2, -0.2, -0.2), Vector3(0.4, 0.4, 0.4)); } @@ -3560,16 +3618,16 @@ AABB SpatialEditorViewport::_calculate_spatial_bounds(const Spatial *p_parent, b return bounds; } -void SpatialEditorViewport::_create_preview(const Vector<String> &files) const { +void Node3DEditorViewport::_create_preview(const Vector<String> &files) const { for (int i = 0; i < files.size(); i++) { String path = files[i]; RES res = ResourceLoader::load(path); ERR_CONTINUE(res.is_null()); Ref<PackedScene> scene = Ref<PackedScene>(Object::cast_to<PackedScene>(*res)); Ref<Mesh> mesh = Ref<Mesh>(Object::cast_to<Mesh>(*res)); - if (mesh != NULL || scene != NULL) { - if (mesh != NULL) { - MeshInstance *mesh_instance = memnew(MeshInstance); + if (mesh != nullptr || scene != nullptr) { + if (mesh != nullptr) { + MeshInstance3D *mesh_instance = memnew(MeshInstance3D); mesh_instance->set_mesh(mesh); preview_node->add_child(mesh_instance); } else { @@ -3586,7 +3644,7 @@ void SpatialEditorViewport::_create_preview(const Vector<String> &files) const { *preview_bounds = _calculate_spatial_bounds(preview_node); } -void SpatialEditorViewport::_remove_preview() { +void Node3DEditorViewport::_remove_preview() { if (preview_node->get_parent()) { for (int i = preview_node->get_child_count() - 1; i >= 0; i--) { Node *node = preview_node->get_child(i); @@ -3597,7 +3655,7 @@ void SpatialEditorViewport::_remove_preview() { } } -bool SpatialEditorViewport::_cyclical_dependency_exists(const String &p_target_scene_path, Node *p_desired_node) { +bool Node3DEditorViewport::_cyclical_dependency_exists(const String &p_target_scene_path, Node *p_desired_node) { if (p_desired_node->get_filename() == p_target_scene_path) { return true; } @@ -3612,18 +3670,18 @@ bool SpatialEditorViewport::_cyclical_dependency_exists(const String &p_target_s return false; } -bool SpatialEditorViewport::_create_instance(Node *parent, String &path, const Point2 &p_point) { +bool Node3DEditorViewport::_create_instance(Node *parent, String &path, const Point2 &p_point) { RES res = ResourceLoader::load(path); ERR_FAIL_COND_V(res.is_null(), false); Ref<PackedScene> scene = Ref<PackedScene>(Object::cast_to<PackedScene>(*res)); Ref<Mesh> mesh = Ref<Mesh>(Object::cast_to<Mesh>(*res)); - Node *instanced_scene = NULL; + Node *instanced_scene = nullptr; - if (mesh != NULL || scene != NULL) { - if (mesh != NULL) { - MeshInstance *mesh_instance = memnew(MeshInstance); + if (mesh != nullptr || scene != nullptr) { + if (mesh != nullptr) { + MeshInstance3D *mesh_instance = memnew(MeshInstance3D); mesh_instance->set_mesh(mesh); mesh_instance->set_name(path.get_file().get_basename()); instanced_scene = mesh_instance; @@ -3636,7 +3694,7 @@ bool SpatialEditorViewport::_create_instance(Node *parent, String &path, const P } } - if (instanced_scene == NULL) { + if (instanced_scene == nullptr) { return false; } @@ -3647,7 +3705,7 @@ bool SpatialEditorViewport::_create_instance(Node *parent, String &path, const P } } - if (scene != NULL) { + if (scene != nullptr) { instanced_scene->set_filename(ProjectSettings::get_singleton()->localize_path(path)); } @@ -3662,7 +3720,7 @@ bool SpatialEditorViewport::_create_instance(Node *parent, String &path, const P editor_data->get_undo_redo().add_undo_method(ed, "live_debug_remove_node", NodePath(String(editor->get_edited_scene()->get_path_to(parent)) + "/" + new_name)); Transform global_transform; - Spatial *parent_spatial = Object::cast_to<Spatial>(parent); + Node3D *parent_spatial = Object::cast_to<Node3D>(parent); if (parent_spatial) global_transform = parent_spatial->get_global_gizmo_transform(); @@ -3673,7 +3731,7 @@ bool SpatialEditorViewport::_create_instance(Node *parent, String &path, const P return true; } -void SpatialEditorViewport::_perform_drop_data() { +void Node3DEditorViewport::_perform_drop_data() { _remove_preview(); Vector<String> error_files; @@ -3688,7 +3746,7 @@ void SpatialEditorViewport::_perform_drop_data() { } Ref<PackedScene> scene = Ref<PackedScene>(Object::cast_to<PackedScene>(*res)); Ref<Mesh> mesh = Ref<Mesh>(Object::cast_to<Mesh>(*res)); - if (mesh != NULL || scene != NULL) { + if (mesh != nullptr || scene != nullptr) { bool success = _create_instance(target_node, path, drop_pos); if (!success) { error_files.push_back(path); @@ -3705,11 +3763,11 @@ void SpatialEditorViewport::_perform_drop_data() { } files_str = files_str.substr(0, files_str.length() - 1); accept->set_text(vformat(TTR("Error instancing scene from %s"), files_str.c_str())); - accept->popup_centered_minsize(); + accept->popup_centered(); } } -bool SpatialEditorViewport::can_drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from) const { +bool Node3DEditorViewport::can_drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from) const { bool can_instance = false; @@ -3766,11 +3824,11 @@ bool SpatialEditorViewport::can_drop_data_fw(const Point2 &p_point, const Varian return can_instance; } -void SpatialEditorViewport::drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from) { +void Node3DEditorViewport::drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from) { if (!can_drop_data_fw(p_point, p_data, p_from)) return; - bool is_shift = Input::get_singleton()->is_key_pressed(KEY_SHIFT); + bool is_shift = InputFilter::get_singleton()->is_key_pressed(KEY_SHIFT); selected_files.clear(); Dictionary d = p_data; @@ -3785,14 +3843,14 @@ void SpatialEditorViewport::drop_data_fw(const Point2 &p_point, const Variant &p list.push_back(root_node); } else { accept->set_text(TTR("No parent to instance a child at.")); - accept->popup_centered_minsize(); + accept->popup_centered(); _remove_preview(); return; } } if (list.size() != 1) { accept->set_text(TTR("This operation requires a single selected node.")); - accept->popup_centered_minsize(); + accept->popup_centered(); _remove_preview(); return; } @@ -3806,7 +3864,10 @@ void SpatialEditorViewport::drop_data_fw(const Point2 &p_point, const Variant &p _perform_drop_data(); } -SpatialEditorViewport::SpatialEditorViewport(SpatialEditor *p_spatial_editor, EditorNode *p_editor, int p_index) { +Node3DEditorViewport::Node3DEditorViewport(Node3DEditor *p_spatial_editor, EditorNode *p_editor, int p_index) { + + cpu_time_history_index = 0; + gpu_time_history_index = 0; _edit.mode = TRANSFORM_NONE; _edit.plane = TRANSFORM_VIEW; @@ -3828,12 +3889,12 @@ SpatialEditorViewport::SpatialEditorViewport(SpatialEditor *p_spatial_editor, Ed zoom_indicator_delay = 0.0; spatial_editor = p_spatial_editor; - ViewportContainer *c = memnew(ViewportContainer); - viewport_container = c; + SubViewportContainer *c = memnew(SubViewportContainer); + subviewport_container = c; c->set_stretch(true); add_child(c); c->set_anchors_and_margins_preset(Control::PRESET_WIDE); - viewport = memnew(Viewport); + viewport = memnew(SubViewport); viewport->set_disable_input(true); c->add_child(viewport); @@ -3842,7 +3903,7 @@ SpatialEditorViewport::SpatialEditorViewport(SpatialEditor *p_spatial_editor, Ed add_child(surface); surface->set_anchors_and_margins_preset(Control::PRESET_WIDE); surface->set_clip_contents(true); - camera = memnew(Camera); + camera = memnew(Camera3D); camera->set_disable_gizmo(true); camera->set_cull_mask(((1 << 20) - 1) | (1 << (GIZMO_BASE_LAYER + p_index)) | (1 << GIZMO_EDIT_LAYER) | (1 << GIZMO_GRID_LAYER)); viewport->add_child(camera); @@ -3886,11 +3947,15 @@ SpatialEditorViewport::SpatialEditorViewport(SpatialEditor *p_spatial_editor, Ed view_menu->get_popup()->add_radio_check_shortcut(ED_SHORTCUT("spatial_editor/view_display_lighting", TTR("Display Lighting")), VIEW_DISPLAY_LIGHTING); view_menu->get_popup()->add_radio_check_shortcut(ED_SHORTCUT("spatial_editor/view_display_unshaded", TTR("Display Unshaded")), VIEW_DISPLAY_SHADELESS); view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(VIEW_DISPLAY_NORMAL), true); + display_submenu->add_radio_check_item(TTR("Directional Shadow Splits"), VIEW_DISPLAY_DEBUG_PSSM_SPLITS); + display_submenu->add_separator(); display_submenu->add_radio_check_item(TTR("Normal Buffer"), VIEW_DISPLAY_NORMAL_BUFFER); display_submenu->add_separator(); display_submenu->add_radio_check_item(TTR("Shadow Atlas"), VIEW_DISPLAY_DEBUG_SHADOW_ATLAS); display_submenu->add_radio_check_item(TTR("Directional Shadow"), VIEW_DISPLAY_DEBUG_DIRECTIONAL_SHADOW_ATLAS); display_submenu->add_separator(); + display_submenu->add_radio_check_item(TTR("Decal Atlas"), VIEW_DISPLAY_DEBUG_DECAL_ATLAS); + display_submenu->add_separator(); display_submenu->add_radio_check_item(TTR("GIProbe Lighting"), VIEW_DISPLAY_DEBUG_GIPROBE_LIGHTING); display_submenu->add_radio_check_item(TTR("GIProbe Albedo"), VIEW_DISPLAY_DEBUG_GIPROBE_ALBEDO); display_submenu->add_radio_check_item(TTR("GIProbe Emission"), VIEW_DISPLAY_DEBUG_GIPROBE_EMISSION); @@ -3906,7 +3971,7 @@ SpatialEditorViewport::SpatialEditorViewport(SpatialEditor *p_spatial_editor, Ed view_menu->get_popup()->add_check_shortcut(ED_SHORTCUT("spatial_editor/view_environment", TTR("View Environment")), VIEW_ENVIRONMENT); view_menu->get_popup()->add_check_shortcut(ED_SHORTCUT("spatial_editor/view_gizmos", TTR("View Gizmos")), VIEW_GIZMOS); view_menu->get_popup()->add_check_shortcut(ED_SHORTCUT("spatial_editor/view_information", TTR("View Information")), VIEW_INFORMATION); - view_menu->get_popup()->add_check_shortcut(ED_SHORTCUT("spatial_editor/view_fps", TTR("View FPS")), VIEW_FPS); + view_menu->get_popup()->add_check_shortcut(ED_SHORTCUT("spatial_editor/view_fps", TTR("View Frame Time")), VIEW_FRAME_TIME); view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(VIEW_ENVIRONMENT), true); view_menu->get_popup()->add_separator(); view_menu->get_popup()->add_check_shortcut(ED_SHORTCUT("spatial_editor/view_half_resolution", TTR("Half Resolution")), VIEW_HALF_RESOLUTION); @@ -3923,11 +3988,14 @@ SpatialEditorViewport::SpatialEditorViewport(SpatialEditor *p_spatial_editor, Ed view_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("spatial_editor/focus_selection"), VIEW_CENTER_TO_SELECTION); view_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("spatial_editor/align_transform_with_view"), VIEW_ALIGN_TRANSFORM_WITH_VIEW); view_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("spatial_editor/align_rotation_with_view"), VIEW_ALIGN_ROTATION_WITH_VIEW); - view_menu->get_popup()->connect("id_pressed", callable_mp(this, &SpatialEditorViewport::_menu_option)); - display_submenu->connect("id_pressed", callable_mp(this, &SpatialEditorViewport::_menu_option)); + view_menu->get_popup()->connect("id_pressed", callable_mp(this, &Node3DEditorViewport::_menu_option)); + display_submenu->connect("id_pressed", callable_mp(this, &Node3DEditorViewport::_menu_option)); view_menu->set_disable_shortcuts(true); - - if (OS::get_singleton()->get_current_video_driver() == OS::VIDEO_DRIVER_GLES2) { +#ifndef _MSC_VER +#warning this needs to be fixed +#endif + //if (OS::get_singleton()->get_current_video_driver() == OS::VIDEO_DRIVER_GLES2) { + if (false) { // Alternate display modes only work when using the Vulkan renderer; make this explicit. const int normal_idx = view_menu->get_popup()->get_item_index(VIEW_DISPLAY_NORMAL); const int wireframe_idx = view_menu->get_popup()->get_item_index(VIEW_DISPLAY_WIREFRAME); @@ -3959,11 +4027,11 @@ SpatialEditorViewport::SpatialEditorViewport(SpatialEditor *p_spatial_editor, Ed vbox->add_child(preview_camera); preview_camera->set_h_size_flags(0); preview_camera->hide(); - preview_camera->connect("toggled", callable_mp(this, &SpatialEditorViewport::_toggle_camera_preview)); - previewing = NULL; + preview_camera->connect("toggled", callable_mp(this, &Node3DEditorViewport::_toggle_camera_preview)); + previewing = nullptr; gizmo_scale = 1.0; - preview_node = NULL; + preview_node = nullptr; info_label = memnew(Label); info_label->set_anchor_and_margin(MARGIN_LEFT, ANCHOR_END, -90 * EDSCALE); @@ -3980,7 +4048,7 @@ SpatialEditorViewport::SpatialEditorViewport(SpatialEditor *p_spatial_editor, Ed fps_label->set_anchor_and_margin(MARGIN_TOP, ANCHOR_BEGIN, 10 * EDSCALE); fps_label->set_anchor_and_margin(MARGIN_RIGHT, ANCHOR_END, -10 * EDSCALE); fps_label->set_h_grow_direction(GROW_DIRECTION_BEGIN); - fps_label->set_tooltip(TTR("Note: The FPS value displayed is the editor's framerate.\nIt cannot be used as a reliable indication of in-game performance.")); + fps_label->set_tooltip(TTR("Note: The FPS is estimated on a 60hz refresh rate.")); fps_label->set_mouse_filter(MOUSE_FILTER_PASS); // Otherwise tooltip doesn't show. surface->add_child(fps_label); fps_label->hide(); @@ -4026,16 +4094,16 @@ SpatialEditorViewport::SpatialEditorViewport(SpatialEditor *p_spatial_editor, Ed surface->add_child(top_right_vbox); - accept = NULL; + accept = nullptr; freelook_active = false; freelook_speed = EditorSettings::get_singleton()->get("editors/3d/freelook/freelook_base_speed"); selection_menu = memnew(PopupMenu); add_child(selection_menu); - selection_menu->set_custom_minimum_size(Size2(100, 0) * EDSCALE); - selection_menu->connect("id_pressed", callable_mp(this, &SpatialEditorViewport::_selection_result_pressed)); - selection_menu->connect("popup_hide", callable_mp(this, &SpatialEditorViewport::_selection_menu_hide)); + selection_menu->set_min_size(Size2(100, 0) * EDSCALE); + selection_menu->connect("id_pressed", callable_mp(this, &Node3DEditorViewport::_selection_result_pressed)); + selection_menu->connect("popup_hide", callable_mp(this, &Node3DEditorViewport::_selection_menu_hide)); if (p_index == 0) { view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(VIEW_AUDIO_LISTENER), true); @@ -4045,12 +4113,12 @@ SpatialEditorViewport::SpatialEditorViewport(SpatialEditor *p_spatial_editor, Ed name = ""; _update_name(); - EditorSettings::get_singleton()->connect("settings_changed", callable_mp(this, &SpatialEditorViewport::update_transform_gizmo_view)); + EditorSettings::get_singleton()->connect("settings_changed", callable_mp(this, &Node3DEditorViewport::update_transform_gizmo_view)); } ////////////////////////////////////////////////////////////// -void SpatialEditorViewportContainer::_gui_input(const Ref<InputEvent> &p_event) { +void Node3DEditorViewportContainer::_gui_input(const Ref<InputEvent> &p_event) { Ref<InputEventMouseButton> mb = p_event; @@ -4059,8 +4127,8 @@ void SpatialEditorViewportContainer::_gui_input(const Ref<InputEvent> &p_event) if (mb->is_pressed()) { Vector2 size = get_size(); - int h_sep = get_constant("separation", "HSplitContainer"); - int v_sep = get_constant("separation", "VSplitContainer"); + int h_sep = get_theme_constant("separation", "HSplitContainer"); + int v_sep = get_theme_constant("separation", "VSplitContainer"); int mid_w = size.width * ratio_h; int mid_h = size.height * ratio_v; @@ -4110,8 +4178,8 @@ void SpatialEditorViewportContainer::_gui_input(const Ref<InputEvent> &p_event) if (view == VIEW_USE_3_VIEWPORTS || view == VIEW_USE_3_VIEWPORTS_ALT || view == VIEW_USE_4_VIEWPORTS) { Vector2 size = get_size(); - int h_sep = get_constant("separation", "HSplitContainer"); - int v_sep = get_constant("separation", "VSplitContainer"); + int h_sep = get_theme_constant("separation", "HSplitContainer"); + int v_sep = get_theme_constant("separation", "VSplitContainer"); int mid_w = size.width * ratio_h; int mid_h = size.height * ratio_v; @@ -4143,7 +4211,7 @@ void SpatialEditorViewportContainer::_gui_input(const Ref<InputEvent> &p_event) } } -void SpatialEditorViewportContainer::_notification(int p_what) { +void Node3DEditorViewportContainer::_notification(int p_what) { if (p_what == NOTIFICATION_MOUSE_ENTER || p_what == NOTIFICATION_MOUSE_EXIT) { @@ -4153,18 +4221,18 @@ void SpatialEditorViewportContainer::_notification(int p_what) { if (p_what == NOTIFICATION_DRAW && mouseover) { - Ref<Texture2D> h_grabber = get_icon("grabber", "HSplitContainer"); - Ref<Texture2D> v_grabber = get_icon("grabber", "VSplitContainer"); + Ref<Texture2D> h_grabber = get_theme_icon("grabber", "HSplitContainer"); + Ref<Texture2D> v_grabber = get_theme_icon("grabber", "VSplitContainer"); - Ref<Texture2D> hdiag_grabber = get_icon("GuiViewportHdiagsplitter", "EditorIcons"); - Ref<Texture2D> vdiag_grabber = get_icon("GuiViewportVdiagsplitter", "EditorIcons"); - Ref<Texture2D> vh_grabber = get_icon("GuiViewportVhsplitter", "EditorIcons"); + Ref<Texture2D> hdiag_grabber = get_theme_icon("GuiViewportHdiagsplitter", "EditorIcons"); + Ref<Texture2D> vdiag_grabber = get_theme_icon("GuiViewportVdiagsplitter", "EditorIcons"); + Ref<Texture2D> vh_grabber = get_theme_icon("GuiViewportVhsplitter", "EditorIcons"); Vector2 size = get_size(); - int h_sep = get_constant("separation", "HSplitContainer"); + int h_sep = get_theme_constant("separation", "HSplitContainer"); - int v_sep = get_constant("separation", "VSplitContainer"); + int v_sep = get_theme_constant("separation", "VSplitContainer"); int mid_w = size.width * ratio_h; int mid_h = size.height * ratio_v; @@ -4239,10 +4307,10 @@ void SpatialEditorViewportContainer::_notification(int p_what) { if (p_what == NOTIFICATION_SORT_CHILDREN) { - SpatialEditorViewport *viewports[4]; + Node3DEditorViewport *viewports[4]; int vc = 0; for (int i = 0; i < get_child_count(); i++) { - viewports[vc] = Object::cast_to<SpatialEditorViewport>(get_child(i)); + viewports[vc] = Object::cast_to<Node3DEditorViewport>(get_child(i)); if (viewports[vc]) { vc++; } @@ -4258,9 +4326,9 @@ void SpatialEditorViewportContainer::_notification(int p_what) { } return; } - int h_sep = get_constant("separation", "HSplitContainer"); + int h_sep = get_theme_constant("separation", "HSplitContainer"); - int v_sep = get_constant("separation", "VSplitContainer"); + int v_sep = get_theme_constant("separation", "VSplitContainer"); int mid_w = size.width * ratio_h; int mid_h = size.height * ratio_v; @@ -4358,23 +4426,23 @@ void SpatialEditorViewportContainer::_notification(int p_what) { } } -void SpatialEditorViewportContainer::set_view(View p_view) { +void Node3DEditorViewportContainer::set_view(View p_view) { view = p_view; queue_sort(); } -SpatialEditorViewportContainer::View SpatialEditorViewportContainer::get_view() { +Node3DEditorViewportContainer::View Node3DEditorViewportContainer::get_view() { return view; } -void SpatialEditorViewportContainer::_bind_methods() { +void Node3DEditorViewportContainer::_bind_methods() { - ClassDB::bind_method("_gui_input", &SpatialEditorViewportContainer::_gui_input); + ClassDB::bind_method("_gui_input", &Node3DEditorViewportContainer::_gui_input); } -SpatialEditorViewportContainer::SpatialEditorViewportContainer() { +Node3DEditorViewportContainer::Node3DEditorViewportContainer() { set_clip_contents(true); view = VIEW_USE_1_VIEWPORT; @@ -4389,15 +4457,15 @@ SpatialEditorViewportContainer::SpatialEditorViewportContainer() { /////////////////////////////////////////////////////////////////// -SpatialEditor *SpatialEditor::singleton = NULL; +Node3DEditor *Node3DEditor::singleton = nullptr; -SpatialEditorSelectedItem::~SpatialEditorSelectedItem() { +Node3DEditorSelectedItem::~Node3DEditorSelectedItem() { if (sbox_instance.is_valid()) - VisualServer::get_singleton()->free(sbox_instance); + RenderingServer::get_singleton()->free(sbox_instance); } -void SpatialEditor::select_gizmo_highlight_axis(int p_axis) { +void Node3DEditor::select_gizmo_highlight_axis(int p_axis) { for (int i = 0; i < 3; i++) { @@ -4409,7 +4477,7 @@ void SpatialEditor::select_gizmo_highlight_axis(int p_axis) { } } -void SpatialEditor::update_transform_gizmo() { +void Node3DEditor::update_transform_gizmo() { List<Node *> &selection = editor_selection->get_selected_node_list(); AABB center; @@ -4420,11 +4488,11 @@ void SpatialEditor::update_transform_gizmo() { for (List<Node *>::Element *E = selection.front(); E; E = E->next()) { - Spatial *sp = Object::cast_to<Spatial>(E->get()); + Node3D *sp = Object::cast_to<Node3D>(E->get()); if (!sp) continue; - SpatialEditorSelectedItem *se = editor_selection->get_node_editor_data<SpatialEditorSelectedItem>(sp); + Node3DEditorSelectedItem *se = editor_selection->get_node_editor_data<Node3DEditorSelectedItem>(sp); if (!se) continue; @@ -4455,7 +4523,7 @@ void SpatialEditor::update_transform_gizmo() { void _update_all_gizmos(Node *p_node) { for (int i = p_node->get_child_count() - 1; 0 <= i; --i) { - Spatial *spatial_node = Object::cast_to<Spatial>(p_node->get_child(i)); + Node3D *spatial_node = Object::cast_to<Node3D>(p_node->get_child(i)); if (spatial_node) { spatial_node->update_gizmo(); } @@ -4464,29 +4532,29 @@ void _update_all_gizmos(Node *p_node) { } } -void SpatialEditor::update_all_gizmos(Node *p_node) { +void Node3DEditor::update_all_gizmos(Node *p_node) { if (!p_node) { p_node = SceneTree::get_singleton()->get_root(); } _update_all_gizmos(p_node); } -Object *SpatialEditor::_get_editor_data(Object *p_what) { +Object *Node3DEditor::_get_editor_data(Object *p_what) { - Spatial *sp = Object::cast_to<Spatial>(p_what); + Node3D *sp = Object::cast_to<Node3D>(p_what); if (!sp) - return NULL; + return nullptr; - SpatialEditorSelectedItem *si = memnew(SpatialEditorSelectedItem); + Node3DEditorSelectedItem *si = memnew(Node3DEditorSelectedItem); si->sp = sp; - si->sbox_instance = VisualServer::get_singleton()->instance_create2(selection_box->get_rid(), sp->get_world()->get_scenario()); - VS::get_singleton()->instance_geometry_set_cast_shadows_setting(si->sbox_instance, VS::SHADOW_CASTING_SETTING_OFF); + si->sbox_instance = RenderingServer::get_singleton()->instance_create2(selection_box->get_rid(), sp->get_world()->get_scenario()); + RS::get_singleton()->instance_geometry_set_cast_shadows_setting(si->sbox_instance, RS::SHADOW_CASTING_SETTING_OFF); return si; } -void SpatialEditor::_generate_selection_box() { +void Node3DEditor::_generate_selection_box() { AABB aabb(Vector3(), Vector3(1, 1, 1)); aabb.grow_by(aabb.get_longest_axis_size() / 20.0); @@ -4520,7 +4588,7 @@ void SpatialEditor::_generate_selection_box() { selection_box = st->commit(); } -Dictionary SpatialEditor::get_state() const { +Dictionary Node3DEditor::get_state() const { Dictionary d; @@ -4571,7 +4639,7 @@ Dictionary SpatialEditor::get_state() const { return d; } -void SpatialEditor::set_state(const Dictionary &p_state) { +void Node3DEditor::set_state(const Dictionary &p_state) { Dictionary d = p_state; @@ -4645,7 +4713,7 @@ void SpatialEditor::set_state(const Dictionary &p_state) { if (use != view_menu->get_popup()->is_item_checked(view_menu->get_popup()->get_item_index(MENU_VIEW_ORIGIN))) { view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(MENU_VIEW_ORIGIN), use); - VisualServer::get_singleton()->instance_set_visible(origin_instance, use); + RenderingServer::get_singleton()->instance_set_visible(origin_instance, use); } } @@ -4656,7 +4724,7 @@ void SpatialEditor::set_state(const Dictionary &p_state) { for (int j = 0; j < gizmo_plugins_by_name.size(); ++j) { if (!gizmo_plugins_by_name[j]->can_be_hidden()) continue; - int state = EditorSpatialGizmoPlugin::VISIBLE; + int state = EditorNode3DGizmoPlugin::VISIBLE; for (int i = 0; i < keys.size(); i++) { if (gizmo_plugins_by_name.write[j]->get_name() == keys[i]) { state = gizmos_status[keys[i]]; @@ -4670,12 +4738,12 @@ void SpatialEditor::set_state(const Dictionary &p_state) { } } -void SpatialEditor::edit(Spatial *p_spatial) { +void Node3DEditor::edit(Node3D *p_spatial) { if (p_spatial != selected) { if (selected) { - Ref<EditorSpatialGizmo> seg = selected->get_gizmo(); + Ref<EditorNode3DGizmo> seg = selected->get_gizmo(); if (seg.is_valid()) { seg->set_selected(false); selected->update_gizmo(); @@ -4687,7 +4755,7 @@ void SpatialEditor::edit(Spatial *p_spatial) { if (selected) { - Ref<EditorSpatialGizmo> seg = selected->get_gizmo(); + Ref<EditorNode3DGizmo> seg = selected->get_gizmo(); if (seg.is_valid()) { seg->set_selected(true); selected->update_gizmo(); @@ -4696,21 +4764,21 @@ void SpatialEditor::edit(Spatial *p_spatial) { } } -void SpatialEditor::_snap_changed() { +void Node3DEditor::_snap_changed() { snap_translate_value = snap_translate->get_text().to_double(); snap_rotate_value = snap_rotate->get_text().to_double(); snap_scale_value = snap_scale->get_text().to_double(); } -void SpatialEditor::_snap_update() { +void Node3DEditor::_snap_update() { snap_translate->set_text(String::num(snap_translate_value)); snap_rotate->set_text(String::num(snap_rotate_value)); snap_scale->set_text(String::num(snap_scale_value)); } -void SpatialEditor::_xform_dialog_action() { +void Node3DEditor::_xform_dialog_action() { Transform t; //translation @@ -4734,11 +4802,11 @@ void SpatialEditor::_xform_dialog_action() { for (List<Node *>::Element *E = selection.front(); E; E = E->next()) { - Spatial *sp = Object::cast_to<Spatial>(E->get()); + Node3D *sp = Object::cast_to<Node3D>(E->get()); if (!sp) continue; - SpatialEditorSelectedItem *se = editor_selection->get_node_editor_data<SpatialEditorSelectedItem>(sp); + Node3DEditorSelectedItem *se = editor_selection->get_node_editor_data<Node3DEditorSelectedItem>(sp); if (!se) continue; @@ -4759,7 +4827,7 @@ void SpatialEditor::_xform_dialog_action() { undo_redo->commit_action(); } -void SpatialEditor::_menu_item_toggled(bool pressed, int p_option) { +void Node3DEditor::_menu_item_toggled(bool pressed, int p_option) { switch (p_option) { case MENU_TOOL_LOCAL_COORDS: { @@ -4788,7 +4856,7 @@ void SpatialEditor::_menu_item_toggled(bool pressed, int p_option) { } } -void SpatialEditor::_menu_gizmo_toggled(int p_option) { +void Node3DEditor::_menu_gizmo_toggled(int p_option) { const int idx = gizmos_menu->get_item_index(p_option); gizmos_menu->toggle_item_multistate(idx); @@ -4796,14 +4864,14 @@ void SpatialEditor::_menu_gizmo_toggled(int p_option) { // Change icon const int state = gizmos_menu->get_item_state(idx); switch (state) { - case EditorSpatialGizmoPlugin::VISIBLE: - gizmos_menu->set_item_icon(idx, view_menu->get_popup()->get_icon("visibility_visible")); + case EditorNode3DGizmoPlugin::VISIBLE: + gizmos_menu->set_item_icon(idx, view_menu->get_popup()->get_theme_icon("visibility_visible")); break; - case EditorSpatialGizmoPlugin::ON_TOP: - gizmos_menu->set_item_icon(idx, view_menu->get_popup()->get_icon("visibility_xray")); + case EditorNode3DGizmoPlugin::ON_TOP: + gizmos_menu->set_item_icon(idx, view_menu->get_popup()->get_theme_icon("visibility_xray")); break; - case EditorSpatialGizmoPlugin::HIDDEN: - gizmos_menu->set_item_icon(idx, view_menu->get_popup()->get_icon("visibility_hidden")); + case EditorNode3DGizmoPlugin::HIDDEN: + gizmos_menu->set_item_icon(idx, view_menu->get_popup()->get_theme_icon("visibility_hidden")); break; } @@ -4812,7 +4880,7 @@ void SpatialEditor::_menu_gizmo_toggled(int p_option) { update_all_gizmos(); } -void SpatialEditor::_update_camera_override_button(bool p_game_running) { +void Node3DEditor::_update_camera_override_button(bool p_game_running) { Button *const button = tool_option_button[TOOL_OPT_OVERRIDE_CAMERA]; if (p_game_running) { @@ -4825,8 +4893,8 @@ void SpatialEditor::_update_camera_override_button(bool p_game_running) { } } -void SpatialEditor::_update_camera_override_viewport(Object *p_viewport) { - SpatialEditorViewport *current_viewport = Object::cast_to<SpatialEditorViewport>(p_viewport); +void Node3DEditor::_update_camera_override_viewport(Object *p_viewport) { + Node3DEditorViewport *current_viewport = Object::cast_to<Node3DEditorViewport>(p_viewport); if (!current_viewport) return; @@ -4841,7 +4909,7 @@ void SpatialEditor::_update_camera_override_viewport(Object *p_viewport) { } } -void SpatialEditor::_menu_item_pressed(int p_option) { +void Node3DEditor::_menu_item_pressed(int p_option) { switch (p_option) { @@ -4875,7 +4943,7 @@ void SpatialEditor::_menu_item_pressed(int p_option) { } break; case MENU_VIEW_USE_1_VIEWPORT: { - viewport_base->set_view(SpatialEditorViewportContainer::VIEW_USE_1_VIEWPORT); + viewport_base->set_view(Node3DEditorViewportContainer::VIEW_USE_1_VIEWPORT); view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_1_VIEWPORT), true); view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_2_VIEWPORTS), false); @@ -4887,7 +4955,7 @@ void SpatialEditor::_menu_item_pressed(int p_option) { } break; case MENU_VIEW_USE_2_VIEWPORTS: { - viewport_base->set_view(SpatialEditorViewportContainer::VIEW_USE_2_VIEWPORTS); + viewport_base->set_view(Node3DEditorViewportContainer::VIEW_USE_2_VIEWPORTS); view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_1_VIEWPORT), false); view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_2_VIEWPORTS), true); @@ -4899,7 +4967,7 @@ void SpatialEditor::_menu_item_pressed(int p_option) { } break; case MENU_VIEW_USE_2_VIEWPORTS_ALT: { - viewport_base->set_view(SpatialEditorViewportContainer::VIEW_USE_2_VIEWPORTS_ALT); + viewport_base->set_view(Node3DEditorViewportContainer::VIEW_USE_2_VIEWPORTS_ALT); view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_1_VIEWPORT), false); view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_2_VIEWPORTS), false); @@ -4911,7 +4979,7 @@ void SpatialEditor::_menu_item_pressed(int p_option) { } break; case MENU_VIEW_USE_3_VIEWPORTS: { - viewport_base->set_view(SpatialEditorViewportContainer::VIEW_USE_3_VIEWPORTS); + viewport_base->set_view(Node3DEditorViewportContainer::VIEW_USE_3_VIEWPORTS); view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_1_VIEWPORT), false); view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_2_VIEWPORTS), false); @@ -4923,7 +4991,7 @@ void SpatialEditor::_menu_item_pressed(int p_option) { } break; case MENU_VIEW_USE_3_VIEWPORTS_ALT: { - viewport_base->set_view(SpatialEditorViewportContainer::VIEW_USE_3_VIEWPORTS_ALT); + viewport_base->set_view(Node3DEditorViewportContainer::VIEW_USE_3_VIEWPORTS_ALT); view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_1_VIEWPORT), false); view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_2_VIEWPORTS), false); @@ -4935,7 +5003,7 @@ void SpatialEditor::_menu_item_pressed(int p_option) { } break; case MENU_VIEW_USE_4_VIEWPORTS: { - viewport_base->set_view(SpatialEditorViewportContainer::VIEW_USE_4_VIEWPORTS); + viewport_base->set_view(Node3DEditorViewportContainer::VIEW_USE_4_VIEWPORTS); view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_1_VIEWPORT), false); view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_2_VIEWPORTS), false); @@ -4950,7 +5018,7 @@ void SpatialEditor::_menu_item_pressed(int p_option) { bool is_checked = view_menu->get_popup()->is_item_checked(view_menu->get_popup()->get_item_index(p_option)); origin_enabled = !is_checked; - VisualServer::get_singleton()->instance_set_visible(origin_instance, origin_enabled); + RenderingServer::get_singleton()->instance_set_visible(origin_instance, origin_enabled); // Update the grid since its appearance depends on whether the origin is enabled _finish_grid(); _init_grid(); @@ -4965,7 +5033,7 @@ void SpatialEditor::_menu_item_pressed(int p_option) { for (int i = 0; i < 3; ++i) { if (grid_enable[i]) { - VisualServer::get_singleton()->instance_set_visible(grid_instance[i], grid_enabled); + RenderingServer::get_singleton()->instance_set_visible(grid_instance[i], grid_enabled); grid_visible[i] = grid_enabled; } } @@ -4987,7 +5055,7 @@ void SpatialEditor::_menu_item_pressed(int p_option) { for (List<Node *>::Element *E = selection.front(); E; E = E->next()) { - Spatial *spatial = Object::cast_to<Spatial>(E->get()); + Node3D *spatial = Object::cast_to<Node3D>(E->get()); if (!spatial || !spatial->is_visible_in_tree()) continue; @@ -5011,7 +5079,7 @@ void SpatialEditor::_menu_item_pressed(int p_option) { for (List<Node *>::Element *E = selection.front(); E; E = E->next()) { - Spatial *spatial = Object::cast_to<Spatial>(E->get()); + Node3D *spatial = Object::cast_to<Node3D>(E->get()); if (!spatial || !spatial->is_visible_in_tree()) continue; @@ -5035,7 +5103,7 @@ void SpatialEditor::_menu_item_pressed(int p_option) { for (List<Node *>::Element *E = selection.front(); E; E = E->next()) { - Spatial *spatial = Object::cast_to<Spatial>(E->get()); + Node3D *spatial = Object::cast_to<Node3D>(E->get()); if (!spatial || !spatial->is_visible_in_tree()) continue; @@ -5058,7 +5126,7 @@ void SpatialEditor::_menu_item_pressed(int p_option) { for (List<Node *>::Element *E = selection.front(); E; E = E->next()) { - Spatial *spatial = Object::cast_to<Spatial>(E->get()); + Node3D *spatial = Object::cast_to<Node3D>(E->get()); if (!spatial || !spatial->is_visible_in_tree()) continue; @@ -5078,7 +5146,7 @@ void SpatialEditor::_menu_item_pressed(int p_option) { } } -void SpatialEditor::_init_indicators() { +void Node3DEditor::_init_indicators() { { origin_enabled = true; @@ -5098,13 +5166,13 @@ void SpatialEditor::_init_indicators() { Color origin_color; switch (i) { case 0: - origin_color = get_color("axis_x_color", "Editor"); + origin_color = get_theme_color("axis_x_color", "Editor"); break; case 1: - origin_color = get_color("axis_y_color", "Editor"); + origin_color = get_theme_color("axis_y_color", "Editor"); break; case 2: - origin_color = get_color("axis_z_color", "Editor"); + origin_color = get_theme_color("axis_z_color", "Editor"); break; default: origin_color = Color(); @@ -5125,19 +5193,19 @@ void SpatialEditor::_init_indicators() { _init_grid(); - origin = VisualServer::get_singleton()->mesh_create(); + origin = RenderingServer::get_singleton()->mesh_create(); Array d; - d.resize(VS::ARRAY_MAX); - d[VisualServer::ARRAY_VERTEX] = origin_points; - d[VisualServer::ARRAY_COLOR] = origin_colors; + d.resize(RS::ARRAY_MAX); + d[RenderingServer::ARRAY_VERTEX] = origin_points; + d[RenderingServer::ARRAY_COLOR] = origin_colors; - VisualServer::get_singleton()->mesh_add_surface_from_arrays(origin, VisualServer::PRIMITIVE_LINES, d); - VisualServer::get_singleton()->mesh_surface_set_material(origin, 0, indicator_mat->get_rid()); + RenderingServer::get_singleton()->mesh_add_surface_from_arrays(origin, RenderingServer::PRIMITIVE_LINES, d); + RenderingServer::get_singleton()->mesh_surface_set_material(origin, 0, indicator_mat->get_rid()); - origin_instance = VisualServer::get_singleton()->instance_create2(origin, get_tree()->get_root()->get_world()->get_scenario()); - VS::get_singleton()->instance_set_layer_mask(origin_instance, 1 << SpatialEditorViewport::GIZMO_GRID_LAYER); + origin_instance = RenderingServer::get_singleton()->instance_create2(origin, get_tree()->get_root()->get_world()->get_scenario()); + RS::get_singleton()->instance_set_layer_mask(origin_instance, 1 << Node3DEditorViewport::GIZMO_GRID_LAYER); - VisualServer::get_singleton()->instance_geometry_set_cast_shadows_setting(origin_instance, VS::SHADOW_CASTING_SETTING_OFF); + RenderingServer::get_singleton()->instance_geometry_set_cast_shadows_setting(origin_instance, RS::SHADOW_CASTING_SETTING_OFF); } { @@ -5149,13 +5217,13 @@ void SpatialEditor::_init_indicators() { Color col; switch (i) { case 0: - col = get_color("axis_x_color", "Editor"); + col = get_theme_color("axis_x_color", "Editor"); break; case 1: - col = get_color("axis_y_color", "Editor"); + col = get_theme_color("axis_y_color", "Editor"); break; case 2: - col = get_color("axis_z_color", "Editor"); + col = get_theme_color("axis_z_color", "Editor"); break; default: col = Color(); @@ -5415,7 +5483,7 @@ void SpatialEditor::_init_indicators() { _generate_selection_box(); } -void SpatialEditor::_update_gizmos_menu() { +void Node3DEditor::_update_gizmos_menu() { gizmos_menu->clear(); @@ -5426,39 +5494,39 @@ void SpatialEditor::_update_gizmos_menu() { gizmos_menu->add_multistate_item(TTR(plugin_name), 3, plugin_state, i); const int idx = gizmos_menu->get_item_index(i); switch (plugin_state) { - case EditorSpatialGizmoPlugin::VISIBLE: - gizmos_menu->set_item_icon(idx, gizmos_menu->get_icon("visibility_visible")); + case EditorNode3DGizmoPlugin::VISIBLE: + gizmos_menu->set_item_icon(idx, gizmos_menu->get_theme_icon("visibility_visible")); break; - case EditorSpatialGizmoPlugin::ON_TOP: - gizmos_menu->set_item_icon(idx, gizmos_menu->get_icon("visibility_xray")); + case EditorNode3DGizmoPlugin::ON_TOP: + gizmos_menu->set_item_icon(idx, gizmos_menu->get_theme_icon("visibility_xray")); break; - case EditorSpatialGizmoPlugin::HIDDEN: - gizmos_menu->set_item_icon(idx, gizmos_menu->get_icon("visibility_hidden")); + case EditorNode3DGizmoPlugin::HIDDEN: + gizmos_menu->set_item_icon(idx, gizmos_menu->get_theme_icon("visibility_hidden")); break; } } } -void SpatialEditor::_update_gizmos_menu_theme() { +void Node3DEditor::_update_gizmos_menu_theme() { for (int i = 0; i < gizmo_plugins_by_name.size(); ++i) { if (!gizmo_plugins_by_name[i]->can_be_hidden()) continue; const int plugin_state = gizmo_plugins_by_name[i]->get_state(); const int idx = gizmos_menu->get_item_index(i); switch (plugin_state) { - case EditorSpatialGizmoPlugin::VISIBLE: - gizmos_menu->set_item_icon(idx, gizmos_menu->get_icon("visibility_visible")); + case EditorNode3DGizmoPlugin::VISIBLE: + gizmos_menu->set_item_icon(idx, gizmos_menu->get_theme_icon("visibility_visible")); break; - case EditorSpatialGizmoPlugin::ON_TOP: - gizmos_menu->set_item_icon(idx, gizmos_menu->get_icon("visibility_xray")); + case EditorNode3DGizmoPlugin::ON_TOP: + gizmos_menu->set_item_icon(idx, gizmos_menu->get_theme_icon("visibility_xray")); break; - case EditorSpatialGizmoPlugin::HIDDEN: - gizmos_menu->set_item_icon(idx, gizmos_menu->get_icon("visibility_hidden")); + case EditorNode3DGizmoPlugin::HIDDEN: + gizmos_menu->set_item_icon(idx, gizmos_menu->get_theme_icon("visibility_hidden")); break; } } } -void SpatialEditor::_init_grid() { +void Node3DEditor::_init_grid() { Vector<Color> grid_colors[3]; Vector<Vector3> grid_points[3]; @@ -5502,37 +5570,37 @@ void SpatialEditor::_init_grid() { grid_colors[i].push_back(line_color); } - grid[i] = VisualServer::get_singleton()->mesh_create(); + grid[i] = RenderingServer::get_singleton()->mesh_create(); Array d; - d.resize(VS::ARRAY_MAX); - d[VisualServer::ARRAY_VERTEX] = grid_points[i]; - d[VisualServer::ARRAY_COLOR] = grid_colors[i]; - VisualServer::get_singleton()->mesh_add_surface_from_arrays(grid[i], VisualServer::PRIMITIVE_LINES, d); - VisualServer::get_singleton()->mesh_surface_set_material(grid[i], 0, indicator_mat->get_rid()); - grid_instance[i] = VisualServer::get_singleton()->instance_create2(grid[i], get_tree()->get_root()->get_world()->get_scenario()); + d.resize(RS::ARRAY_MAX); + d[RenderingServer::ARRAY_VERTEX] = grid_points[i]; + d[RenderingServer::ARRAY_COLOR] = grid_colors[i]; + RenderingServer::get_singleton()->mesh_add_surface_from_arrays(grid[i], RenderingServer::PRIMITIVE_LINES, d); + RenderingServer::get_singleton()->mesh_surface_set_material(grid[i], 0, indicator_mat->get_rid()); + grid_instance[i] = RenderingServer::get_singleton()->instance_create2(grid[i], get_tree()->get_root()->get_world()->get_scenario()); - VisualServer::get_singleton()->instance_set_visible(grid_instance[i], grid_visible[i]); - VisualServer::get_singleton()->instance_geometry_set_cast_shadows_setting(grid_instance[i], VS::SHADOW_CASTING_SETTING_OFF); - VS::get_singleton()->instance_set_layer_mask(grid_instance[i], 1 << SpatialEditorViewport::GIZMO_GRID_LAYER); + RenderingServer::get_singleton()->instance_set_visible(grid_instance[i], grid_visible[i]); + RenderingServer::get_singleton()->instance_geometry_set_cast_shadows_setting(grid_instance[i], RS::SHADOW_CASTING_SETTING_OFF); + RS::get_singleton()->instance_set_layer_mask(grid_instance[i], 1 << Node3DEditorViewport::GIZMO_GRID_LAYER); } } -void SpatialEditor::_finish_indicators() { +void Node3DEditor::_finish_indicators() { - VisualServer::get_singleton()->free(origin_instance); - VisualServer::get_singleton()->free(origin); + RenderingServer::get_singleton()->free(origin_instance); + RenderingServer::get_singleton()->free(origin); _finish_grid(); } -void SpatialEditor::_finish_grid() { +void Node3DEditor::_finish_grid() { for (int i = 0; i < 3; i++) { - VisualServer::get_singleton()->free(grid_instance[i]); - VisualServer::get_singleton()->free(grid[i]); + RenderingServer::get_singleton()->free(grid_instance[i]); + RenderingServer::get_singleton()->free(grid[i]); } } -bool SpatialEditor::is_any_freelook_active() const { +bool Node3DEditor::is_any_freelook_active() const { for (unsigned int i = 0; i < VIEWPORTS_COUNT; ++i) { if (viewports[i]->is_freelook_active()) return true; @@ -5540,7 +5608,7 @@ bool SpatialEditor::is_any_freelook_active() const { return false; } -void SpatialEditor::_refresh_menu_icons() { +void Node3DEditor::_refresh_menu_icons() { bool all_locked = true; bool all_grouped = true; @@ -5552,13 +5620,13 @@ void SpatialEditor::_refresh_menu_icons() { all_grouped = false; } else { for (List<Node *>::Element *E = selection.front(); E; E = E->next()) { - if (Object::cast_to<Spatial>(E->get()) && !Object::cast_to<Spatial>(E->get())->has_meta("_edit_lock_")) { + if (Object::cast_to<Node3D>(E->get()) && !Object::cast_to<Node3D>(E->get())->has_meta("_edit_lock_")) { all_locked = false; break; } } for (List<Node *>::Element *E = selection.front(); E; E = E->next()) { - if (Object::cast_to<Spatial>(E->get()) && !Object::cast_to<Spatial>(E->get())->has_meta("_edit_group_")) { + if (Object::cast_to<Node3D>(E->get()) && !Object::cast_to<Node3D>(E->get())->has_meta("_edit_group_")) { all_grouped = false; break; } @@ -5595,35 +5663,35 @@ Set<T *> _get_child_nodes(Node *parent_node) { Set<RID> _get_physics_bodies_rid(Node *node) { Set<RID> rids = Set<RID>(); - PhysicsBody *pb = Node::cast_to<PhysicsBody>(node); + PhysicsBody3D *pb = Node::cast_to<PhysicsBody3D>(node); if (pb) { rids.insert(pb->get_rid()); } - Set<PhysicsBody *> child_nodes = _get_child_nodes<PhysicsBody>(node); - for (Set<PhysicsBody *>::Element *I = child_nodes.front(); I; I = I->next()) { + Set<PhysicsBody3D *> child_nodes = _get_child_nodes<PhysicsBody3D>(node); + for (Set<PhysicsBody3D *>::Element *I = child_nodes.front(); I; I = I->next()) { rids.insert(I->get()->get_rid()); } return rids; } -void SpatialEditor::snap_selected_nodes_to_floor() { +void Node3DEditor::snap_selected_nodes_to_floor() { List<Node *> &selection = editor_selection->get_selected_node_list(); Dictionary snap_data; for (List<Node *>::Element *E = selection.front(); E; E = E->next()) { - Spatial *sp = Object::cast_to<Spatial>(E->get()); + Node3D *sp = Object::cast_to<Node3D>(E->get()); if (sp) { Vector3 from = Vector3(); Vector3 position_offset = Vector3(); // Priorities for snapping to floor are CollisionShapes, VisualInstances and then origin - Set<VisualInstance *> vi = _get_child_nodes<VisualInstance>(sp); - Set<CollisionShape *> cs = _get_child_nodes<CollisionShape>(sp); + Set<VisualInstance3D *> vi = _get_child_nodes<VisualInstance3D>(sp); + Set<CollisionShape3D *> cs = _get_child_nodes<CollisionShape3D>(sp); if (cs.size()) { AABB aabb = sp->get_global_transform().xform(cs.front()->get()->get_shape()->get_debug_mesh()->get_aabb()); - for (Set<CollisionShape *>::Element *I = cs.front(); I; I = I->next()) { + for (Set<CollisionShape3D *>::Element *I = cs.front(); I; I = I->next()) { aabb.merge_with(sp->get_global_transform().xform(I->get()->get_shape()->get_debug_mesh()->get_aabb())); } Vector3 size = aabb.size * Vector3(0.5, 0.0, 0.5); @@ -5631,7 +5699,7 @@ void SpatialEditor::snap_selected_nodes_to_floor() { position_offset.y = from.y - sp->get_global_transform().origin.y; } else if (vi.size()) { AABB aabb = vi.front()->get()->get_transformed_aabb(); - for (Set<VisualInstance *>::Element *I = vi.front(); I; I = I->next()) { + for (Set<VisualInstance3D *>::Element *I = vi.front(); I; I = I->next()) { aabb.merge_with(I->get()->get_transformed_aabb()); } Vector3 size = aabb.size * Vector3(0.5, 0.0, 0.5); @@ -5654,8 +5722,8 @@ void SpatialEditor::snap_selected_nodes_to_floor() { } } - PhysicsDirectSpaceState *ss = get_tree()->get_root()->get_world()->get_direct_space_state(); - PhysicsDirectSpaceState::RayResult result; + PhysicsDirectSpaceState3D *ss = get_tree()->get_root()->get_world()->get_direct_space_state(); + PhysicsDirectSpaceState3D::RayResult result; Array keys = snap_data.keys(); @@ -5670,7 +5738,7 @@ void SpatialEditor::snap_selected_nodes_to_floor() { // We need to check this before snapping to register the undo/redo action only if needed. for (int i = 0; i < keys.size(); i++) { Node *node = keys[i]; - Spatial *sp = Object::cast_to<Spatial>(node); + Node3D *sp = Object::cast_to<Node3D>(node); Dictionary d = snap_data[node]; Vector3 from = d["from"]; Vector3 to = from - Vector3(0.0, max_snap_height, 0.0); @@ -5687,7 +5755,7 @@ void SpatialEditor::snap_selected_nodes_to_floor() { // Perform snapping if at least one node can be snapped for (int i = 0; i < keys.size(); i++) { Node *node = keys[i]; - Spatial *sp = Object::cast_to<Spatial>(node); + Node3D *sp = Object::cast_to<Node3D>(node); Dictionary d = snap_data[node]; Vector3 from = d["from"]; Vector3 to = from - Vector3(0.0, max_snap_height, 0.0); @@ -5712,48 +5780,48 @@ void SpatialEditor::snap_selected_nodes_to_floor() { } } -void SpatialEditor::_unhandled_key_input(Ref<InputEvent> p_event) { +void Node3DEditor::_unhandled_key_input(Ref<InputEvent> p_event) { - if (!is_visible_in_tree() || get_viewport()->gui_has_modal_stack()) + if (!is_visible_in_tree()) return; - snap_key_enabled = Input::get_singleton()->is_key_pressed(KEY_CONTROL); + snap_key_enabled = InputFilter::get_singleton()->is_key_pressed(KEY_CONTROL); } -void SpatialEditor::_notification(int p_what) { +void Node3DEditor::_notification(int p_what) { if (p_what == NOTIFICATION_READY) { - tool_button[SpatialEditor::TOOL_MODE_SELECT]->set_icon(get_icon("ToolSelect", "EditorIcons")); - tool_button[SpatialEditor::TOOL_MODE_MOVE]->set_icon(get_icon("ToolMove", "EditorIcons")); - tool_button[SpatialEditor::TOOL_MODE_ROTATE]->set_icon(get_icon("ToolRotate", "EditorIcons")); - tool_button[SpatialEditor::TOOL_MODE_SCALE]->set_icon(get_icon("ToolScale", "EditorIcons")); - tool_button[SpatialEditor::TOOL_MODE_LIST_SELECT]->set_icon(get_icon("ListSelect", "EditorIcons")); - tool_button[SpatialEditor::TOOL_LOCK_SELECTED]->set_icon(get_icon("Lock", "EditorIcons")); - tool_button[SpatialEditor::TOOL_UNLOCK_SELECTED]->set_icon(get_icon("Unlock", "EditorIcons")); - tool_button[SpatialEditor::TOOL_GROUP_SELECTED]->set_icon(get_icon("Group", "EditorIcons")); - tool_button[SpatialEditor::TOOL_UNGROUP_SELECTED]->set_icon(get_icon("Ungroup", "EditorIcons")); - - tool_option_button[SpatialEditor::TOOL_OPT_LOCAL_COORDS]->set_icon(get_icon("Object", "EditorIcons")); - tool_option_button[SpatialEditor::TOOL_OPT_USE_SNAP]->set_icon(get_icon("Snap", "EditorIcons")); - tool_option_button[SpatialEditor::TOOL_OPT_OVERRIDE_CAMERA]->set_icon(get_icon("Camera", "EditorIcons")); - - view_menu->get_popup()->set_item_icon(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_1_VIEWPORT), get_icon("Panels1", "EditorIcons")); - view_menu->get_popup()->set_item_icon(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_2_VIEWPORTS), get_icon("Panels2", "EditorIcons")); - view_menu->get_popup()->set_item_icon(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_2_VIEWPORTS_ALT), get_icon("Panels2Alt", "EditorIcons")); - view_menu->get_popup()->set_item_icon(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_3_VIEWPORTS), get_icon("Panels3", "EditorIcons")); - view_menu->get_popup()->set_item_icon(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_3_VIEWPORTS_ALT), get_icon("Panels3Alt", "EditorIcons")); - view_menu->get_popup()->set_item_icon(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_4_VIEWPORTS), get_icon("Panels4", "EditorIcons")); + tool_button[Node3DEditor::TOOL_MODE_SELECT]->set_icon(get_theme_icon("ToolSelect", "EditorIcons")); + tool_button[Node3DEditor::TOOL_MODE_MOVE]->set_icon(get_theme_icon("ToolMove", "EditorIcons")); + tool_button[Node3DEditor::TOOL_MODE_ROTATE]->set_icon(get_theme_icon("ToolRotate", "EditorIcons")); + tool_button[Node3DEditor::TOOL_MODE_SCALE]->set_icon(get_theme_icon("ToolScale", "EditorIcons")); + tool_button[Node3DEditor::TOOL_MODE_LIST_SELECT]->set_icon(get_theme_icon("ListSelect", "EditorIcons")); + tool_button[Node3DEditor::TOOL_LOCK_SELECTED]->set_icon(get_theme_icon("Lock", "EditorIcons")); + tool_button[Node3DEditor::TOOL_UNLOCK_SELECTED]->set_icon(get_theme_icon("Unlock", "EditorIcons")); + tool_button[Node3DEditor::TOOL_GROUP_SELECTED]->set_icon(get_theme_icon("Group", "EditorIcons")); + tool_button[Node3DEditor::TOOL_UNGROUP_SELECTED]->set_icon(get_theme_icon("Ungroup", "EditorIcons")); + + tool_option_button[Node3DEditor::TOOL_OPT_LOCAL_COORDS]->set_icon(get_theme_icon("Object", "EditorIcons")); + tool_option_button[Node3DEditor::TOOL_OPT_USE_SNAP]->set_icon(get_theme_icon("Snap", "EditorIcons")); + tool_option_button[Node3DEditor::TOOL_OPT_OVERRIDE_CAMERA]->set_icon(get_theme_icon("Camera3D", "EditorIcons")); + + view_menu->get_popup()->set_item_icon(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_1_VIEWPORT), get_theme_icon("Panels1", "EditorIcons")); + view_menu->get_popup()->set_item_icon(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_2_VIEWPORTS), get_theme_icon("Panels2", "EditorIcons")); + view_menu->get_popup()->set_item_icon(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_2_VIEWPORTS_ALT), get_theme_icon("Panels2Alt", "EditorIcons")); + view_menu->get_popup()->set_item_icon(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_3_VIEWPORTS), get_theme_icon("Panels3", "EditorIcons")); + view_menu->get_popup()->set_item_icon(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_3_VIEWPORTS_ALT), get_theme_icon("Panels3Alt", "EditorIcons")); + view_menu->get_popup()->set_item_icon(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_4_VIEWPORTS), get_theme_icon("Panels4", "EditorIcons")); _menu_item_pressed(MENU_VIEW_USE_1_VIEWPORT); _refresh_menu_icons(); - get_tree()->connect("node_removed", callable_mp(this, &SpatialEditor::_node_removed)); - EditorNode::get_singleton()->get_scene_tree_dock()->get_tree_editor()->connect("node_changed", callable_mp(this, &SpatialEditor::_refresh_menu_icons)); - editor_selection->connect("selection_changed", callable_mp(this, &SpatialEditor::_refresh_menu_icons)); + get_tree()->connect("node_removed", callable_mp(this, &Node3DEditor::_node_removed)); + EditorNode::get_singleton()->get_scene_tree_dock()->get_tree_editor()->connect("node_changed", callable_mp(this, &Node3DEditor::_refresh_menu_icons)); + editor_selection->connect("selection_changed", callable_mp(this, &Node3DEditor::_refresh_menu_icons)); - editor->connect("stop_pressed", callable_mp(this, &SpatialEditor::_update_camera_override_button), make_binds(false)); - editor->connect("play_pressed", callable_mp(this, &SpatialEditor::_update_camera_override_button), make_binds(true)); + editor->connect("stop_pressed", callable_mp(this, &Node3DEditor::_update_camera_override_button), make_binds(false)); + editor->connect("play_pressed", callable_mp(this, &Node3DEditor::_update_camera_override_button), make_binds(true)); } else if (p_what == NOTIFICATION_ENTER_TREE) { _register_all_gizmos(); @@ -5765,25 +5833,25 @@ void SpatialEditor::_notification(int p_what) { _finish_indicators(); } else if (p_what == EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED) { - tool_button[SpatialEditor::TOOL_MODE_SELECT]->set_icon(get_icon("ToolSelect", "EditorIcons")); - tool_button[SpatialEditor::TOOL_MODE_MOVE]->set_icon(get_icon("ToolMove", "EditorIcons")); - tool_button[SpatialEditor::TOOL_MODE_ROTATE]->set_icon(get_icon("ToolRotate", "EditorIcons")); - tool_button[SpatialEditor::TOOL_MODE_SCALE]->set_icon(get_icon("ToolScale", "EditorIcons")); - tool_button[SpatialEditor::TOOL_MODE_LIST_SELECT]->set_icon(get_icon("ListSelect", "EditorIcons")); - tool_button[SpatialEditor::TOOL_LOCK_SELECTED]->set_icon(get_icon("Lock", "EditorIcons")); - tool_button[SpatialEditor::TOOL_UNLOCK_SELECTED]->set_icon(get_icon("Unlock", "EditorIcons")); - tool_button[SpatialEditor::TOOL_GROUP_SELECTED]->set_icon(get_icon("Group", "EditorIcons")); - tool_button[SpatialEditor::TOOL_UNGROUP_SELECTED]->set_icon(get_icon("Ungroup", "EditorIcons")); - - tool_option_button[SpatialEditor::TOOL_OPT_LOCAL_COORDS]->set_icon(get_icon("Object", "EditorIcons")); - tool_option_button[SpatialEditor::TOOL_OPT_USE_SNAP]->set_icon(get_icon("Snap", "EditorIcons")); - - view_menu->get_popup()->set_item_icon(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_1_VIEWPORT), get_icon("Panels1", "EditorIcons")); - view_menu->get_popup()->set_item_icon(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_2_VIEWPORTS), get_icon("Panels2", "EditorIcons")); - view_menu->get_popup()->set_item_icon(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_2_VIEWPORTS_ALT), get_icon("Panels2Alt", "EditorIcons")); - view_menu->get_popup()->set_item_icon(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_3_VIEWPORTS), get_icon("Panels3", "EditorIcons")); - view_menu->get_popup()->set_item_icon(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_3_VIEWPORTS_ALT), get_icon("Panels3Alt", "EditorIcons")); - view_menu->get_popup()->set_item_icon(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_4_VIEWPORTS), get_icon("Panels4", "EditorIcons")); + tool_button[Node3DEditor::TOOL_MODE_SELECT]->set_icon(get_theme_icon("ToolSelect", "EditorIcons")); + tool_button[Node3DEditor::TOOL_MODE_MOVE]->set_icon(get_theme_icon("ToolMove", "EditorIcons")); + tool_button[Node3DEditor::TOOL_MODE_ROTATE]->set_icon(get_theme_icon("ToolRotate", "EditorIcons")); + tool_button[Node3DEditor::TOOL_MODE_SCALE]->set_icon(get_theme_icon("ToolScale", "EditorIcons")); + tool_button[Node3DEditor::TOOL_MODE_LIST_SELECT]->set_icon(get_theme_icon("ListSelect", "EditorIcons")); + tool_button[Node3DEditor::TOOL_LOCK_SELECTED]->set_icon(get_theme_icon("Lock", "EditorIcons")); + tool_button[Node3DEditor::TOOL_UNLOCK_SELECTED]->set_icon(get_theme_icon("Unlock", "EditorIcons")); + tool_button[Node3DEditor::TOOL_GROUP_SELECTED]->set_icon(get_theme_icon("Group", "EditorIcons")); + tool_button[Node3DEditor::TOOL_UNGROUP_SELECTED]->set_icon(get_theme_icon("Ungroup", "EditorIcons")); + + tool_option_button[Node3DEditor::TOOL_OPT_LOCAL_COORDS]->set_icon(get_theme_icon("Object", "EditorIcons")); + tool_option_button[Node3DEditor::TOOL_OPT_USE_SNAP]->set_icon(get_theme_icon("Snap", "EditorIcons")); + + view_menu->get_popup()->set_item_icon(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_1_VIEWPORT), get_theme_icon("Panels1", "EditorIcons")); + view_menu->get_popup()->set_item_icon(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_2_VIEWPORTS), get_theme_icon("Panels2", "EditorIcons")); + view_menu->get_popup()->set_item_icon(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_2_VIEWPORTS_ALT), get_theme_icon("Panels2Alt", "EditorIcons")); + view_menu->get_popup()->set_item_icon(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_3_VIEWPORTS), get_theme_icon("Panels3", "EditorIcons")); + view_menu->get_popup()->set_item_icon(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_3_VIEWPORTS_ALT), get_theme_icon("Panels3Alt", "EditorIcons")); + view_menu->get_popup()->set_item_icon(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_4_VIEWPORTS), get_theme_icon("Panels4", "EditorIcons")); // Update grid color by rebuilding grid. _finish_grid(); @@ -5798,41 +5866,41 @@ void SpatialEditor::_notification(int p_what) { } } -void SpatialEditor::add_control_to_menu_panel(Control *p_control) { +void Node3DEditor::add_control_to_menu_panel(Control *p_control) { hbc_menu->add_child(p_control); } -void SpatialEditor::remove_control_from_menu_panel(Control *p_control) { +void Node3DEditor::remove_control_from_menu_panel(Control *p_control) { hbc_menu->remove_child(p_control); } -void SpatialEditor::set_can_preview(Camera *p_preview) { +void Node3DEditor::set_can_preview(Camera3D *p_preview) { for (int i = 0; i < 4; i++) { viewports[i]->set_can_preview(p_preview); } } -VSplitContainer *SpatialEditor::get_shader_split() { +VSplitContainer *Node3DEditor::get_shader_split() { return shader_split; } -HSplitContainer *SpatialEditor::get_palette_split() { +HSplitContainer *Node3DEditor::get_palette_split() { return palette_split; } -void SpatialEditor::_request_gizmo(Object *p_obj) { +void Node3DEditor::_request_gizmo(Object *p_obj) { - Spatial *sp = Object::cast_to<Spatial>(p_obj); + Node3D *sp = Object::cast_to<Node3D>(p_obj); if (!sp) return; if (editor->get_edited_scene() && (sp == editor->get_edited_scene() || (sp->get_owner() && editor->get_edited_scene()->is_a_parent_of(sp)))) { - Ref<EditorSpatialGizmo> seg; + Ref<EditorNode3DGizmo> seg; for (int i = 0; i < gizmo_plugins_by_priority.size(); ++i) { seg = gizmo_plugins_by_priority.write[i]->get_gizmo(sp); @@ -5851,9 +5919,9 @@ void SpatialEditor::_request_gizmo(Object *p_obj) { } } -void SpatialEditor::_toggle_maximize_view(Object *p_viewport) { +void Node3DEditor::_toggle_maximize_view(Object *p_viewport) { if (!p_viewport) return; - SpatialEditorViewport *current_viewport = Object::cast_to<SpatialEditorViewport>(p_viewport); + Node3DEditorViewport *current_viewport = Object::cast_to<Node3DEditorViewport>(p_viewport); if (!current_viewport) return; int index = -1; @@ -5896,49 +5964,50 @@ void SpatialEditor::_toggle_maximize_view(Object *p_viewport) { } } -void SpatialEditor::_node_removed(Node *p_node) { +void Node3DEditor::_node_removed(Node *p_node) { if (p_node == selected) - selected = NULL; -} - -void SpatialEditor::_register_all_gizmos() { - add_gizmo_plugin(Ref<CameraSpatialGizmoPlugin>(memnew(CameraSpatialGizmoPlugin))); - add_gizmo_plugin(Ref<LightSpatialGizmoPlugin>(memnew(LightSpatialGizmoPlugin))); - add_gizmo_plugin(Ref<AudioStreamPlayer3DSpatialGizmoPlugin>(memnew(AudioStreamPlayer3DSpatialGizmoPlugin))); - add_gizmo_plugin(Ref<MeshInstanceSpatialGizmoPlugin>(memnew(MeshInstanceSpatialGizmoPlugin))); - add_gizmo_plugin(Ref<SoftBodySpatialGizmoPlugin>(memnew(SoftBodySpatialGizmoPlugin))); - add_gizmo_plugin(Ref<Sprite3DSpatialGizmoPlugin>(memnew(Sprite3DSpatialGizmoPlugin))); - add_gizmo_plugin(Ref<SkeletonSpatialGizmoPlugin>(memnew(SkeletonSpatialGizmoPlugin))); - add_gizmo_plugin(Ref<Position3DSpatialGizmoPlugin>(memnew(Position3DSpatialGizmoPlugin))); - add_gizmo_plugin(Ref<RayCastSpatialGizmoPlugin>(memnew(RayCastSpatialGizmoPlugin))); - add_gizmo_plugin(Ref<SpringArmSpatialGizmoPlugin>(memnew(SpringArmSpatialGizmoPlugin))); - add_gizmo_plugin(Ref<VehicleWheelSpatialGizmoPlugin>(memnew(VehicleWheelSpatialGizmoPlugin))); - add_gizmo_plugin(Ref<VisibilityNotifierGizmoPlugin>(memnew(VisibilityNotifierGizmoPlugin))); - add_gizmo_plugin(Ref<ParticlesGizmoPlugin>(memnew(ParticlesGizmoPlugin))); - add_gizmo_plugin(Ref<CPUParticlesGizmoPlugin>(memnew(CPUParticlesGizmoPlugin))); + selected = nullptr; +} + +void Node3DEditor::_register_all_gizmos() { + add_gizmo_plugin(Ref<Camera3DGizmoPlugin>(memnew(Camera3DGizmoPlugin))); + add_gizmo_plugin(Ref<Light3DGizmoPlugin>(memnew(Light3DGizmoPlugin))); + add_gizmo_plugin(Ref<AudioStreamPlayer3DGizmoPlugin>(memnew(AudioStreamPlayer3DGizmoPlugin))); + add_gizmo_plugin(Ref<MeshInstance3DGizmoPlugin>(memnew(MeshInstance3DGizmoPlugin))); + add_gizmo_plugin(Ref<SoftBody3DGizmoPlugin>(memnew(SoftBody3DGizmoPlugin))); + add_gizmo_plugin(Ref<Sprite3DGizmoPlugin>(memnew(Sprite3DGizmoPlugin))); + add_gizmo_plugin(Ref<Skeleton3DGizmoPlugin>(memnew(Skeleton3DGizmoPlugin))); + add_gizmo_plugin(Ref<Position3DGizmoPlugin>(memnew(Position3DGizmoPlugin))); + add_gizmo_plugin(Ref<RayCast3DGizmoPlugin>(memnew(RayCast3DGizmoPlugin))); + add_gizmo_plugin(Ref<SpringArm3DGizmoPlugin>(memnew(SpringArm3DGizmoPlugin))); + add_gizmo_plugin(Ref<VehicleWheel3DGizmoPlugin>(memnew(VehicleWheel3DGizmoPlugin))); + add_gizmo_plugin(Ref<VisibilityNotifier3DGizmoPlugin>(memnew(VisibilityNotifier3DGizmoPlugin))); + add_gizmo_plugin(Ref<GPUParticles3DGizmoPlugin>(memnew(GPUParticles3DGizmoPlugin))); + add_gizmo_plugin(Ref<CPUParticles3DGizmoPlugin>(memnew(CPUParticles3DGizmoPlugin))); add_gizmo_plugin(Ref<ReflectionProbeGizmoPlugin>(memnew(ReflectionProbeGizmoPlugin))); + add_gizmo_plugin(Ref<DecalGizmoPlugin>(memnew(DecalGizmoPlugin))); add_gizmo_plugin(Ref<GIProbeGizmoPlugin>(memnew(GIProbeGizmoPlugin))); // add_gizmo_plugin(Ref<BakedIndirectLightGizmoPlugin>(memnew(BakedIndirectLightGizmoPlugin))); - add_gizmo_plugin(Ref<CollisionShapeSpatialGizmoPlugin>(memnew(CollisionShapeSpatialGizmoPlugin))); - add_gizmo_plugin(Ref<CollisionPolygonSpatialGizmoPlugin>(memnew(CollisionPolygonSpatialGizmoPlugin))); - add_gizmo_plugin(Ref<NavigationMeshSpatialGizmoPlugin>(memnew(NavigationMeshSpatialGizmoPlugin))); - add_gizmo_plugin(Ref<JointSpatialGizmoPlugin>(memnew(JointSpatialGizmoPlugin))); - add_gizmo_plugin(Ref<PhysicalBoneSpatialGizmoPlugin>(memnew(PhysicalBoneSpatialGizmoPlugin))); + add_gizmo_plugin(Ref<CollisionShape3DGizmoPlugin>(memnew(CollisionShape3DGizmoPlugin))); + add_gizmo_plugin(Ref<CollisionPolygon3DGizmoPlugin>(memnew(CollisionPolygon3DGizmoPlugin))); + add_gizmo_plugin(Ref<NavigationRegion3DGizmoPlugin>(memnew(NavigationRegion3DGizmoPlugin))); + add_gizmo_plugin(Ref<Joint3DGizmoPlugin>(memnew(Joint3DGizmoPlugin))); + add_gizmo_plugin(Ref<PhysicalBone3DGizmoPlugin>(memnew(PhysicalBone3DGizmoPlugin))); } -void SpatialEditor::_bind_methods() { +void Node3DEditor::_bind_methods() { - ClassDB::bind_method("_unhandled_key_input", &SpatialEditor::_unhandled_key_input); - ClassDB::bind_method("_get_editor_data", &SpatialEditor::_get_editor_data); - ClassDB::bind_method("_request_gizmo", &SpatialEditor::_request_gizmo); + ClassDB::bind_method("_unhandled_key_input", &Node3DEditor::_unhandled_key_input); + ClassDB::bind_method("_get_editor_data", &Node3DEditor::_get_editor_data); + ClassDB::bind_method("_request_gizmo", &Node3DEditor::_request_gizmo); ADD_SIGNAL(MethodInfo("transform_key_request")); ADD_SIGNAL(MethodInfo("item_lock_status_changed")); ADD_SIGNAL(MethodInfo("item_group_status_changed")); } -void SpatialEditor::clear() { +void Node3DEditor::clear() { settings_fov->set_value(EDITOR_DEF("editors/3d/default_fov", 70.0)); settings_znear->set_value(EDITOR_DEF("editors/3d/default_z_near", 0.05)); @@ -5948,25 +6017,25 @@ void SpatialEditor::clear() { viewports[i]->reset(); } - VisualServer::get_singleton()->instance_set_visible(origin_instance, true); + RenderingServer::get_singleton()->instance_set_visible(origin_instance, true); view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(MENU_VIEW_ORIGIN), true); for (int i = 0; i < 3; ++i) { if (grid_enable[i]) { - VisualServer::get_singleton()->instance_set_visible(grid_instance[i], true); + RenderingServer::get_singleton()->instance_set_visible(grid_instance[i], true); grid_visible[i] = true; } } for (uint32_t i = 0; i < VIEWPORTS_COUNT; i++) { - viewports[i]->view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(SpatialEditorViewport::VIEW_AUDIO_LISTENER), i == 0); + viewports[i]->view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(Node3DEditorViewport::VIEW_AUDIO_LISTENER), i == 0); viewports[i]->viewport->set_as_audio_listener(i == 0); } view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(MENU_VIEW_GRID), true); } -SpatialEditor::SpatialEditor(EditorNode *p_editor) { +Node3DEditor::Node3DEditor(EditorNode *p_editor) { gizmo.visible = true; gizmo.scale = 1.0; @@ -5975,7 +6044,7 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) { undo_redo = p_editor->get_undo_redo(); VBoxContainer *vbc = this; - custom_camera = NULL; + custom_camera = nullptr; singleton = this; editor = p_editor; editor_selection = editor->get_editor_selection(); @@ -6000,7 +6069,7 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) { tool_button[TOOL_MODE_SELECT]->set_flat(true); tool_button[TOOL_MODE_SELECT]->set_pressed(true); button_binds.write[0] = MENU_TOOL_SELECT; - tool_button[TOOL_MODE_SELECT]->connect("pressed", callable_mp(this, &SpatialEditor::_menu_item_pressed), button_binds); + tool_button[TOOL_MODE_SELECT]->connect("pressed", callable_mp(this, &Node3DEditor::_menu_item_pressed), button_binds); tool_button[TOOL_MODE_SELECT]->set_shortcut(ED_SHORTCUT("spatial_editor/tool_select", TTR("Select Mode"), KEY_Q)); tool_button[TOOL_MODE_SELECT]->set_tooltip(keycode_get_string(KEY_MASK_CMD) + TTR("Drag: Rotate\nAlt+Drag: Move\nAlt+RMB: Depth list selection")); @@ -6011,7 +6080,7 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) { tool_button[TOOL_MODE_MOVE]->set_toggle_mode(true); tool_button[TOOL_MODE_MOVE]->set_flat(true); button_binds.write[0] = MENU_TOOL_MOVE; - tool_button[TOOL_MODE_MOVE]->connect("pressed", callable_mp(this, &SpatialEditor::_menu_item_pressed), button_binds); + tool_button[TOOL_MODE_MOVE]->connect("pressed", callable_mp(this, &Node3DEditor::_menu_item_pressed), button_binds); tool_button[TOOL_MODE_MOVE]->set_shortcut(ED_SHORTCUT("spatial_editor/tool_move", TTR("Move Mode"), KEY_W)); tool_button[TOOL_MODE_ROTATE] = memnew(ToolButton); @@ -6019,7 +6088,7 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) { tool_button[TOOL_MODE_ROTATE]->set_toggle_mode(true); tool_button[TOOL_MODE_ROTATE]->set_flat(true); button_binds.write[0] = MENU_TOOL_ROTATE; - tool_button[TOOL_MODE_ROTATE]->connect("pressed", callable_mp(this, &SpatialEditor::_menu_item_pressed), button_binds); + tool_button[TOOL_MODE_ROTATE]->connect("pressed", callable_mp(this, &Node3DEditor::_menu_item_pressed), button_binds); tool_button[TOOL_MODE_ROTATE]->set_shortcut(ED_SHORTCUT("spatial_editor/tool_rotate", TTR("Rotate Mode"), KEY_E)); tool_button[TOOL_MODE_SCALE] = memnew(ToolButton); @@ -6027,7 +6096,7 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) { tool_button[TOOL_MODE_SCALE]->set_toggle_mode(true); tool_button[TOOL_MODE_SCALE]->set_flat(true); button_binds.write[0] = MENU_TOOL_SCALE; - tool_button[TOOL_MODE_SCALE]->connect("pressed", callable_mp(this, &SpatialEditor::_menu_item_pressed), button_binds); + tool_button[TOOL_MODE_SCALE]->connect("pressed", callable_mp(this, &Node3DEditor::_menu_item_pressed), button_binds); tool_button[TOOL_MODE_SCALE]->set_shortcut(ED_SHORTCUT("spatial_editor/tool_scale", TTR("Scale Mode"), KEY_R)); hbc_menu->add_child(memnew(VSeparator)); @@ -6037,31 +6106,31 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) { tool_button[TOOL_MODE_LIST_SELECT]->set_toggle_mode(true); tool_button[TOOL_MODE_LIST_SELECT]->set_flat(true); button_binds.write[0] = MENU_TOOL_LIST_SELECT; - tool_button[TOOL_MODE_LIST_SELECT]->connect("pressed", callable_mp(this, &SpatialEditor::_menu_item_pressed), button_binds); + tool_button[TOOL_MODE_LIST_SELECT]->connect("pressed", callable_mp(this, &Node3DEditor::_menu_item_pressed), button_binds); tool_button[TOOL_MODE_LIST_SELECT]->set_tooltip(TTR("Show a list of all objects at the position clicked\n(same as Alt+RMB in select mode).")); tool_button[TOOL_LOCK_SELECTED] = memnew(ToolButton); hbc_menu->add_child(tool_button[TOOL_LOCK_SELECTED]); button_binds.write[0] = MENU_LOCK_SELECTED; - tool_button[TOOL_LOCK_SELECTED]->connect("pressed", callable_mp(this, &SpatialEditor::_menu_item_pressed), button_binds); + tool_button[TOOL_LOCK_SELECTED]->connect("pressed", callable_mp(this, &Node3DEditor::_menu_item_pressed), button_binds); tool_button[TOOL_LOCK_SELECTED]->set_tooltip(TTR("Lock the selected object in place (can't be moved).")); tool_button[TOOL_UNLOCK_SELECTED] = memnew(ToolButton); hbc_menu->add_child(tool_button[TOOL_UNLOCK_SELECTED]); button_binds.write[0] = MENU_UNLOCK_SELECTED; - tool_button[TOOL_UNLOCK_SELECTED]->connect("pressed", callable_mp(this, &SpatialEditor::_menu_item_pressed), button_binds); + tool_button[TOOL_UNLOCK_SELECTED]->connect("pressed", callable_mp(this, &Node3DEditor::_menu_item_pressed), button_binds); tool_button[TOOL_UNLOCK_SELECTED]->set_tooltip(TTR("Unlock the selected object (can be moved).")); tool_button[TOOL_GROUP_SELECTED] = memnew(ToolButton); hbc_menu->add_child(tool_button[TOOL_GROUP_SELECTED]); button_binds.write[0] = MENU_GROUP_SELECTED; - tool_button[TOOL_GROUP_SELECTED]->connect("pressed", callable_mp(this, &SpatialEditor::_menu_item_pressed), button_binds); + tool_button[TOOL_GROUP_SELECTED]->connect("pressed", callable_mp(this, &Node3DEditor::_menu_item_pressed), button_binds); tool_button[TOOL_GROUP_SELECTED]->set_tooltip(TTR("Makes sure the object's children are not selectable.")); tool_button[TOOL_UNGROUP_SELECTED] = memnew(ToolButton); hbc_menu->add_child(tool_button[TOOL_UNGROUP_SELECTED]); button_binds.write[0] = MENU_UNGROUP_SELECTED; - tool_button[TOOL_UNGROUP_SELECTED]->connect("pressed", callable_mp(this, &SpatialEditor::_menu_item_pressed), button_binds); + tool_button[TOOL_UNGROUP_SELECTED]->connect("pressed", callable_mp(this, &Node3DEditor::_menu_item_pressed), button_binds); tool_button[TOOL_UNGROUP_SELECTED]->set_tooltip(TTR("Restores the object's children's ability to be selected.")); hbc_menu->add_child(memnew(VSeparator)); @@ -6071,7 +6140,7 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) { tool_option_button[TOOL_OPT_LOCAL_COORDS]->set_toggle_mode(true); tool_option_button[TOOL_OPT_LOCAL_COORDS]->set_flat(true); button_binds.write[0] = MENU_TOOL_LOCAL_COORDS; - tool_option_button[TOOL_OPT_LOCAL_COORDS]->connect("toggled", callable_mp(this, &SpatialEditor::_menu_item_toggled), button_binds); + tool_option_button[TOOL_OPT_LOCAL_COORDS]->connect("toggled", callable_mp(this, &Node3DEditor::_menu_item_toggled), button_binds); tool_option_button[TOOL_OPT_LOCAL_COORDS]->set_shortcut(ED_SHORTCUT("spatial_editor/local_coords", TTR("Use Local Space"), KEY_T)); tool_option_button[TOOL_OPT_USE_SNAP] = memnew(ToolButton); @@ -6079,7 +6148,7 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) { tool_option_button[TOOL_OPT_USE_SNAP]->set_toggle_mode(true); tool_option_button[TOOL_OPT_USE_SNAP]->set_flat(true); button_binds.write[0] = MENU_TOOL_USE_SNAP; - tool_option_button[TOOL_OPT_USE_SNAP]->connect("toggled", callable_mp(this, &SpatialEditor::_menu_item_toggled), button_binds); + tool_option_button[TOOL_OPT_USE_SNAP]->connect("toggled", callable_mp(this, &Node3DEditor::_menu_item_toggled), button_binds); tool_option_button[TOOL_OPT_USE_SNAP]->set_shortcut(ED_SHORTCUT("spatial_editor/snap", TTR("Use Snap"), KEY_Y)); hbc_menu->add_child(memnew(VSeparator)); @@ -6090,13 +6159,13 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) { tool_option_button[TOOL_OPT_OVERRIDE_CAMERA]->set_flat(true); tool_option_button[TOOL_OPT_OVERRIDE_CAMERA]->set_disabled(true); button_binds.write[0] = MENU_TOOL_OVERRIDE_CAMERA; - tool_option_button[TOOL_OPT_OVERRIDE_CAMERA]->connect("toggled", callable_mp(this, &SpatialEditor::_menu_item_toggled), button_binds); + tool_option_button[TOOL_OPT_OVERRIDE_CAMERA]->connect("toggled", callable_mp(this, &Node3DEditor::_menu_item_toggled), button_binds); _update_camera_override_button(false); hbc_menu->add_child(memnew(VSeparator)); // Drag and drop support; - preview_node = memnew(Spatial); + preview_node = memnew(Node3D); preview_bounds = AABB(); ED_SHORTCUT("spatial_editor/bottom_view", TTR("Bottom View"), KEY_MASK_ALT + KEY_KP_7); @@ -6127,7 +6196,7 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) { p->add_separator(); p->add_shortcut(ED_SHORTCUT("spatial_editor/configure_snap", TTR("Configure Snap...")), MENU_TRANSFORM_CONFIGURE_SNAP); - p->connect("id_pressed", callable_mp(this, &SpatialEditor::_menu_item_pressed)); + p->connect("id_pressed", callable_mp(this, &Node3DEditor::_menu_item_pressed)); view_menu = memnew(MenuButton); view_menu->set_text(TTR("View")); @@ -6159,13 +6228,13 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) { p->set_item_checked(p->get_item_index(MENU_VIEW_ORIGIN), true); p->set_item_checked(p->get_item_index(MENU_VIEW_GRID), true); - p->connect("id_pressed", callable_mp(this, &SpatialEditor::_menu_item_pressed)); + p->connect("id_pressed", callable_mp(this, &Node3DEditor::_menu_item_pressed)); gizmos_menu = memnew(PopupMenu); p->add_child(gizmos_menu); gizmos_menu->set_name("GizmosMenu"); gizmos_menu->set_hide_on_checkable_item_selection(false); - gizmos_menu->connect("id_pressed", callable_mp(this, &SpatialEditor::_menu_gizmo_toggled)); + gizmos_menu->connect("id_pressed", callable_mp(this, &Node3DEditor::_menu_gizmo_toggled)); /* REST OF MENU */ @@ -6176,14 +6245,14 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) { shader_split = memnew(VSplitContainer); shader_split->set_h_size_flags(SIZE_EXPAND_FILL); palette_split->add_child(shader_split); - viewport_base = memnew(SpatialEditorViewportContainer); + viewport_base = memnew(Node3DEditorViewportContainer); shader_split->add_child(viewport_base); viewport_base->set_v_size_flags(SIZE_EXPAND_FILL); for (uint32_t i = 0; i < VIEWPORTS_COUNT; i++) { - viewports[i] = memnew(SpatialEditorViewport(this, editor, i)); - viewports[i]->connect("toggle_maximize_view", callable_mp(this, &SpatialEditor::_toggle_maximize_view)); - viewports[i]->connect("clicked", callable_mp(this, &SpatialEditor::_update_camera_override_viewport)); + viewports[i] = memnew(Node3DEditorViewport(this, editor, i)); + viewports[i]->connect("toggle_maximize_view", callable_mp(this, &Node3DEditor::_toggle_maximize_view)); + viewports[i]->connect("clicked", callable_mp(this, &Node3DEditor::_update_camera_override_viewport)); viewports[i]->assign_pending_data_pointers(preview_node, &preview_bounds, accept); viewport_base->add_child(viewports[i]); } @@ -6197,8 +6266,8 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) { snap_dialog = memnew(ConfirmationDialog); snap_dialog->set_title(TTR("Snap Settings")); add_child(snap_dialog); - snap_dialog->connect("confirmed", callable_mp(this, &SpatialEditor::_snap_changed)); - snap_dialog->get_cancel()->connect("pressed", callable_mp(this, &SpatialEditor::_snap_update)); + snap_dialog->connect("confirmed", callable_mp(this, &Node3DEditor::_snap_changed)); + snap_dialog->get_cancel()->connect("pressed", callable_mp(this, &Node3DEditor::_snap_update)); VBoxContainer *snap_dialog_vbc = memnew(VBoxContainer); snap_dialog->add_child(snap_dialog_vbc); @@ -6245,7 +6314,7 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) { settings_vbc->add_margin_child(TTR("View Z-Far:"), settings_zfar); for (uint32_t i = 0; i < VIEWPORTS_COUNT; ++i) { - settings_dialog->connect("confirmed", callable_mp(viewports[i], &SpatialEditorViewport::_update_camera), varray(0.0)); + settings_dialog->connect("confirmed", callable_mp(viewports[i], &Node3DEditorViewport::_update_camera), varray(0.0)); } /* XFORM DIALOG */ @@ -6307,11 +6376,11 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) { xform_type->add_item(TTR("Post")); xform_vbc->add_child(xform_type); - xform_dialog->connect("confirmed", callable_mp(this, &SpatialEditor::_xform_dialog_action)); + xform_dialog->connect("confirmed", callable_mp(this, &Node3DEditor::_xform_dialog_action)); - scenario_debug = VisualServer::SCENARIO_DEBUG_DISABLED; + scenario_debug = RenderingServer::SCENARIO_DEBUG_DISABLED; - selected = NULL; + selected = nullptr; set_process_unhandled_key_input(true); add_to_group("_spatial_editor_group"); @@ -6325,11 +6394,11 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) { over_gizmo_handle = -1; } -SpatialEditor::~SpatialEditor() { +Node3DEditor::~Node3DEditor() { memdelete(preview_node); } -void SpatialEditorPlugin::make_visible(bool p_visible) { +void Node3DEditorPlugin::make_visible(bool p_visible) { if (p_visible) { @@ -6342,31 +6411,31 @@ void SpatialEditorPlugin::make_visible(bool p_visible) { spatial_editor->set_process(false); } } -void SpatialEditorPlugin::edit(Object *p_object) { +void Node3DEditorPlugin::edit(Object *p_object) { - spatial_editor->edit(Object::cast_to<Spatial>(p_object)); + spatial_editor->edit(Object::cast_to<Node3D>(p_object)); } -bool SpatialEditorPlugin::handles(Object *p_object) const { +bool Node3DEditorPlugin::handles(Object *p_object) const { - return p_object->is_class("Spatial"); + return p_object->is_class("Node3D"); } -Dictionary SpatialEditorPlugin::get_state() const { +Dictionary Node3DEditorPlugin::get_state() const { return spatial_editor->get_state(); } -void SpatialEditorPlugin::set_state(const Dictionary &p_state) { +void Node3DEditorPlugin::set_state(const Dictionary &p_state) { spatial_editor->set_state(p_state); } -void SpatialEditor::snap_cursor_to_plane(const Plane &p_plane) { +void Node3DEditor::snap_cursor_to_plane(const Plane &p_plane) { //cursor.pos=p_plane.project(cursor.pos); } -Vector3 SpatialEditor::snap_point(Vector3 p_target, Vector3 p_start) const { +Vector3 Node3DEditor::snap_point(Vector3 p_target, Vector3 p_start) const { if (is_snap_enabled()) { p_target.x = Math::snap_scalar(0.0, get_translate_snap(), p_target.x); p_target.y = Math::snap_scalar(0.0, get_translate_snap(), p_target.y); @@ -6375,9 +6444,9 @@ Vector3 SpatialEditor::snap_point(Vector3 p_target, Vector3 p_start) const { return p_target; } -float SpatialEditor::get_translate_snap() const { +float Node3DEditor::get_translate_snap() const { float snap_value; - if (Input::get_singleton()->is_key_pressed(KEY_SHIFT)) { + if (InputFilter::get_singleton()->is_key_pressed(KEY_SHIFT)) { snap_value = snap_translate->get_text().to_double() / 10.0; } else { snap_value = snap_translate->get_text().to_double(); @@ -6386,9 +6455,9 @@ float SpatialEditor::get_translate_snap() const { return snap_value; } -float SpatialEditor::get_rotate_snap() const { +float Node3DEditor::get_rotate_snap() const { float snap_value; - if (Input::get_singleton()->is_key_pressed(KEY_SHIFT)) { + if (InputFilter::get_singleton()->is_key_pressed(KEY_SHIFT)) { snap_value = snap_rotate->get_text().to_double() / 3.0; } else { snap_value = snap_rotate->get_text().to_double(); @@ -6397,9 +6466,9 @@ float SpatialEditor::get_rotate_snap() const { return snap_value; } -float SpatialEditor::get_scale_snap() const { +float Node3DEditor::get_scale_snap() const { float snap_value; - if (Input::get_singleton()->is_key_pressed(KEY_SHIFT)) { + if (InputFilter::get_singleton()->is_key_pressed(KEY_SHIFT)) { snap_value = snap_scale->get_text().to_double() / 2.0; } else { snap_value = snap_scale->get_text().to_double(); @@ -6408,19 +6477,19 @@ float SpatialEditor::get_scale_snap() const { return snap_value; } -void SpatialEditorPlugin::_bind_methods() { +void Node3DEditorPlugin::_bind_methods() { - ClassDB::bind_method("snap_cursor_to_plane", &SpatialEditorPlugin::snap_cursor_to_plane); + ClassDB::bind_method("snap_cursor_to_plane", &Node3DEditorPlugin::snap_cursor_to_plane); } -void SpatialEditorPlugin::snap_cursor_to_plane(const Plane &p_plane) { +void Node3DEditorPlugin::snap_cursor_to_plane(const Plane &p_plane) { spatial_editor->snap_cursor_to_plane(p_plane); } struct _GizmoPluginPriorityComparator { - bool operator()(const Ref<EditorSpatialGizmoPlugin> &p_a, const Ref<EditorSpatialGizmoPlugin> &p_b) const { + bool operator()(const Ref<EditorNode3DGizmoPlugin> &p_a, const Ref<EditorNode3DGizmoPlugin> &p_b) const { if (p_a->get_priority() == p_b->get_priority()) { return p_a->get_name() < p_b->get_name(); } @@ -6430,12 +6499,12 @@ struct _GizmoPluginPriorityComparator { struct _GizmoPluginNameComparator { - bool operator()(const Ref<EditorSpatialGizmoPlugin> &p_a, const Ref<EditorSpatialGizmoPlugin> &p_b) const { + bool operator()(const Ref<EditorNode3DGizmoPlugin> &p_a, const Ref<EditorNode3DGizmoPlugin> &p_b) const { return p_a->get_name() < p_b->get_name(); } }; -void SpatialEditor::add_gizmo_plugin(Ref<EditorSpatialGizmoPlugin> p_plugin) { +void Node3DEditor::add_gizmo_plugin(Ref<EditorNode3DGizmoPlugin> p_plugin) { ERR_FAIL_NULL(p_plugin.ptr()); gizmo_plugins_by_priority.push_back(p_plugin); @@ -6445,19 +6514,19 @@ void SpatialEditor::add_gizmo_plugin(Ref<EditorSpatialGizmoPlugin> p_plugin) { gizmo_plugins_by_name.sort_custom<_GizmoPluginNameComparator>(); _update_gizmos_menu(); - SpatialEditor::get_singleton()->update_all_gizmos(); + Node3DEditor::get_singleton()->update_all_gizmos(); } -void SpatialEditor::remove_gizmo_plugin(Ref<EditorSpatialGizmoPlugin> p_plugin) { +void Node3DEditor::remove_gizmo_plugin(Ref<EditorNode3DGizmoPlugin> p_plugin) { gizmo_plugins_by_priority.erase(p_plugin); gizmo_plugins_by_name.erase(p_plugin); _update_gizmos_menu(); } -SpatialEditorPlugin::SpatialEditorPlugin(EditorNode *p_node) { +Node3DEditorPlugin::Node3DEditorPlugin(EditorNode *p_node) { editor = p_node; - spatial_editor = memnew(SpatialEditor(p_node)); + spatial_editor = memnew(Node3DEditor(p_node)); spatial_editor->set_v_size_flags(Control::SIZE_EXPAND_FILL); editor->get_viewport()->add_child(spatial_editor); @@ -6465,10 +6534,10 @@ SpatialEditorPlugin::SpatialEditorPlugin(EditorNode *p_node) { spatial_editor->connect_compat("transform_key_request", editor->get_inspector_dock(), "_transform_keyed"); } -SpatialEditorPlugin::~SpatialEditorPlugin() { +Node3DEditorPlugin::~Node3DEditorPlugin() { } -void EditorSpatialGizmoPlugin::create_material(const String &p_name, const Color &p_color, bool p_billboard, bool p_on_top, bool p_use_vertex_color) { +void EditorNode3DGizmoPlugin::create_material(const String &p_name, const Color &p_color, bool p_billboard, bool p_on_top, bool p_use_vertex_color) { Color instanced_color = EDITOR_DEF("editors/3d_gizmos/gizmo_colors/instanced", Color(0.7, 0.7, 0.7, 0.6)); @@ -6510,7 +6579,7 @@ void EditorSpatialGizmoPlugin::create_material(const String &p_name, const Color materials[p_name] = mats; } -void EditorSpatialGizmoPlugin::create_icon_material(const String &p_name, const Ref<Texture2D> &p_texture, bool p_on_top, const Color &p_albedo) { +void EditorNode3DGizmoPlugin::create_icon_material(const String &p_name, const Ref<Texture2D> &p_texture, bool p_on_top, const Color &p_albedo) { Color instanced_color = EDITOR_DEF("editors/3d_gizmos/gizmo_colors/instanced", Color(0.7, 0.7, 0.7, 0.6)); @@ -6551,12 +6620,12 @@ void EditorSpatialGizmoPlugin::create_icon_material(const String &p_name, const materials[p_name] = icons; } -void EditorSpatialGizmoPlugin::create_handle_material(const String &p_name, bool p_billboard) { +void EditorNode3DGizmoPlugin::create_handle_material(const String &p_name, bool p_billboard) { Ref<StandardMaterial3D> handle_material = Ref<StandardMaterial3D>(memnew(StandardMaterial3D)); handle_material->set_shading_mode(StandardMaterial3D::SHADING_MODE_UNSHADED); handle_material->set_flag(StandardMaterial3D::FLAG_USE_POINT_SIZE, true); - Ref<Texture2D> handle_t = SpatialEditor::get_singleton()->get_icon("Editor3DHandle", "EditorIcons"); + Ref<Texture2D> handle_t = Node3DEditor::get_singleton()->get_theme_icon("Editor3DHandle", "EditorIcons"); handle_material->set_point_size(handle_t->get_width()); handle_material->set_texture(StandardMaterial3D::TEXTURE_ALBEDO, handle_t); handle_material->set_albedo(Color(1, 1, 1)); @@ -6573,12 +6642,12 @@ void EditorSpatialGizmoPlugin::create_handle_material(const String &p_name, bool materials[p_name].push_back(handle_material); } -void EditorSpatialGizmoPlugin::add_material(const String &p_name, Ref<StandardMaterial3D> p_material) { +void EditorNode3DGizmoPlugin::add_material(const String &p_name, Ref<StandardMaterial3D> p_material) { materials[p_name] = Vector<Ref<StandardMaterial3D>>(); materials[p_name].push_back(p_material); } -Ref<StandardMaterial3D> EditorSpatialGizmoPlugin::get_material(const String &p_name, const Ref<EditorSpatialGizmo> &p_gizmo) { +Ref<StandardMaterial3D> EditorNode3DGizmoPlugin::get_material(const String &p_name, const Ref<EditorNode3DGizmo> &p_gizmo) { ERR_FAIL_COND_V(!materials.has(p_name), Ref<StandardMaterial3D>()); ERR_FAIL_COND_V(materials[p_name].size() == 0, Ref<StandardMaterial3D>()); @@ -6597,27 +6666,27 @@ Ref<StandardMaterial3D> EditorSpatialGizmoPlugin::get_material(const String &p_n return mat; } -String EditorSpatialGizmoPlugin::get_name() const { +String EditorNode3DGizmoPlugin::get_name() const { if (get_script_instance() && get_script_instance()->has_method("get_name")) { return get_script_instance()->call("get_name"); } return TTR("Nameless gizmo"); } -int EditorSpatialGizmoPlugin::get_priority() const { +int EditorNode3DGizmoPlugin::get_priority() const { if (get_script_instance() && get_script_instance()->has_method("get_priority")) { return get_script_instance()->call("get_priority"); } return 0; } -Ref<EditorSpatialGizmo> EditorSpatialGizmoPlugin::get_gizmo(Spatial *p_spatial) { +Ref<EditorNode3DGizmo> EditorNode3DGizmoPlugin::get_gizmo(Node3D *p_spatial) { if (get_script_instance() && get_script_instance()->has_method("get_gizmo")) { return get_script_instance()->call("get_gizmo", p_spatial); } - Ref<EditorSpatialGizmo> ref = create_gizmo(p_spatial); + Ref<EditorNode3DGizmo> ref = create_gizmo(p_spatial); if (ref.is_null()) return ref; @@ -6629,18 +6698,18 @@ Ref<EditorSpatialGizmo> EditorSpatialGizmoPlugin::get_gizmo(Spatial *p_spatial) return ref; } -void EditorSpatialGizmoPlugin::_bind_methods() { -#define GIZMO_REF PropertyInfo(Variant::OBJECT, "gizmo", PROPERTY_HINT_RESOURCE_TYPE, "EditorSpatialGizmo") +void EditorNode3DGizmoPlugin::_bind_methods() { +#define GIZMO_REF PropertyInfo(Variant::OBJECT, "gizmo", PROPERTY_HINT_RESOURCE_TYPE, "EditorNode3DGizmo") - BIND_VMETHOD(MethodInfo(Variant::BOOL, "has_gizmo", PropertyInfo(Variant::OBJECT, "spatial", PROPERTY_HINT_RESOURCE_TYPE, "Spatial"))); - BIND_VMETHOD(MethodInfo(GIZMO_REF, "create_gizmo", PropertyInfo(Variant::OBJECT, "spatial", PROPERTY_HINT_RESOURCE_TYPE, "Spatial"))); + BIND_VMETHOD(MethodInfo(Variant::BOOL, "has_gizmo", PropertyInfo(Variant::OBJECT, "spatial", PROPERTY_HINT_RESOURCE_TYPE, "Node3D"))); + BIND_VMETHOD(MethodInfo(GIZMO_REF, "create_gizmo", PropertyInfo(Variant::OBJECT, "spatial", PROPERTY_HINT_RESOURCE_TYPE, "Node3D"))); - ClassDB::bind_method(D_METHOD("create_material", "name", "color", "billboard", "on_top", "use_vertex_color"), &EditorSpatialGizmoPlugin::create_material, DEFVAL(false), DEFVAL(false), DEFVAL(false)); - ClassDB::bind_method(D_METHOD("create_icon_material", "name", "texture", "on_top", "color"), &EditorSpatialGizmoPlugin::create_icon_material, DEFVAL(false), DEFVAL(Color(1, 1, 1, 1))); - ClassDB::bind_method(D_METHOD("create_handle_material", "name", "billboard"), &EditorSpatialGizmoPlugin::create_handle_material, DEFVAL(false)); - ClassDB::bind_method(D_METHOD("add_material", "name", "material"), &EditorSpatialGizmoPlugin::add_material); + ClassDB::bind_method(D_METHOD("create_material", "name", "color", "billboard", "on_top", "use_vertex_color"), &EditorNode3DGizmoPlugin::create_material, DEFVAL(false), DEFVAL(false), DEFVAL(false)); + ClassDB::bind_method(D_METHOD("create_icon_material", "name", "texture", "on_top", "color"), &EditorNode3DGizmoPlugin::create_icon_material, DEFVAL(false), DEFVAL(Color(1, 1, 1, 1))); + ClassDB::bind_method(D_METHOD("create_handle_material", "name", "billboard"), &EditorNode3DGizmoPlugin::create_handle_material, DEFVAL(false)); + ClassDB::bind_method(D_METHOD("add_material", "name", "material"), &EditorNode3DGizmoPlugin::add_material); - ClassDB::bind_method(D_METHOD("get_material", "name", "gizmo"), &EditorSpatialGizmoPlugin::get_material); //, DEFVAL(Ref<EditorSpatialGizmo>())); + ClassDB::bind_method(D_METHOD("get_material", "name", "gizmo"), &EditorNode3DGizmoPlugin::get_material); //, DEFVAL(Ref<EditorNode3DGizmo>())); BIND_VMETHOD(MethodInfo(Variant::STRING, "get_name")); BIND_VMETHOD(MethodInfo(Variant::STRING, "get_priority")); @@ -6654,7 +6723,7 @@ void EditorSpatialGizmoPlugin::_bind_methods() { hvget.return_val.usage |= PROPERTY_USAGE_NIL_IS_VARIANT; BIND_VMETHOD(hvget); - BIND_VMETHOD(MethodInfo("set_handle", GIZMO_REF, PropertyInfo(Variant::INT, "index"), PropertyInfo(Variant::OBJECT, "camera", PROPERTY_HINT_RESOURCE_TYPE, "Camera"), PropertyInfo(Variant::VECTOR2, "point"))); + BIND_VMETHOD(MethodInfo("set_handle", GIZMO_REF, PropertyInfo(Variant::INT, "index"), PropertyInfo(Variant::OBJECT, "camera", PROPERTY_HINT_RESOURCE_TYPE, "Camera3D"), PropertyInfo(Variant::VECTOR2, "point"))); MethodInfo cm = MethodInfo("commit_handle", GIZMO_REF, PropertyInfo(Variant::INT, "index"), PropertyInfo(Variant::NIL, "restore"), PropertyInfo(Variant::BOOL, "cancel")); cm.default_arguments.push_back(false); BIND_VMETHOD(cm); @@ -6664,103 +6733,103 @@ void EditorSpatialGizmoPlugin::_bind_methods() { #undef GIZMO_REF } -bool EditorSpatialGizmoPlugin::has_gizmo(Spatial *p_spatial) { +bool EditorNode3DGizmoPlugin::has_gizmo(Node3D *p_spatial) { if (get_script_instance() && get_script_instance()->has_method("has_gizmo")) { return get_script_instance()->call("has_gizmo", p_spatial); } return false; } -Ref<EditorSpatialGizmo> EditorSpatialGizmoPlugin::create_gizmo(Spatial *p_spatial) { +Ref<EditorNode3DGizmo> EditorNode3DGizmoPlugin::create_gizmo(Node3D *p_spatial) { if (get_script_instance() && get_script_instance()->has_method("create_gizmo")) { return get_script_instance()->call("create_gizmo", p_spatial); } - Ref<EditorSpatialGizmo> ref; + Ref<EditorNode3DGizmo> ref; if (has_gizmo(p_spatial)) ref.instance(); return ref; } -bool EditorSpatialGizmoPlugin::can_be_hidden() const { +bool EditorNode3DGizmoPlugin::can_be_hidden() const { if (get_script_instance() && get_script_instance()->has_method("can_be_hidden")) { return get_script_instance()->call("can_be_hidden"); } return true; } -bool EditorSpatialGizmoPlugin::is_selectable_when_hidden() const { +bool EditorNode3DGizmoPlugin::is_selectable_when_hidden() const { if (get_script_instance() && get_script_instance()->has_method("is_selectable_when_hidden")) { return get_script_instance()->call("is_selectable_when_hidden"); } return false; } -void EditorSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { +void EditorNode3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { if (get_script_instance() && get_script_instance()->has_method("redraw")) { - Ref<EditorSpatialGizmo> ref(p_gizmo); + Ref<EditorNode3DGizmo> ref(p_gizmo); get_script_instance()->call("redraw", ref); } } -String EditorSpatialGizmoPlugin::get_handle_name(const EditorSpatialGizmo *p_gizmo, int p_idx) const { +String EditorNode3DGizmoPlugin::get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_idx) const { if (get_script_instance() && get_script_instance()->has_method("get_handle_name")) { return get_script_instance()->call("get_handle_name", p_gizmo, p_idx); } return ""; } -Variant EditorSpatialGizmoPlugin::get_handle_value(EditorSpatialGizmo *p_gizmo, int p_idx) const { +Variant EditorNode3DGizmoPlugin::get_handle_value(EditorNode3DGizmo *p_gizmo, int p_idx) const { if (get_script_instance() && get_script_instance()->has_method("get_handle_value")) { return get_script_instance()->call("get_handle_value", p_gizmo, p_idx); } return Variant(); } -void EditorSpatialGizmoPlugin::set_handle(EditorSpatialGizmo *p_gizmo, int p_idx, Camera *p_camera, const Point2 &p_point) { +void EditorNode3DGizmoPlugin::set_handle(EditorNode3DGizmo *p_gizmo, int p_idx, Camera3D *p_camera, const Point2 &p_point) { if (get_script_instance() && get_script_instance()->has_method("set_handle")) { get_script_instance()->call("set_handle", p_gizmo, p_idx, p_camera, p_point); } } -void EditorSpatialGizmoPlugin::commit_handle(EditorSpatialGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel) { +void EditorNode3DGizmoPlugin::commit_handle(EditorNode3DGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel) { if (get_script_instance() && get_script_instance()->has_method("commit_handle")) { get_script_instance()->call("commit_handle", p_gizmo, p_idx, p_restore, p_cancel); } } -bool EditorSpatialGizmoPlugin::is_handle_highlighted(const EditorSpatialGizmo *p_gizmo, int p_idx) const { +bool EditorNode3DGizmoPlugin::is_handle_highlighted(const EditorNode3DGizmo *p_gizmo, int p_idx) const { if (get_script_instance() && get_script_instance()->has_method("is_handle_highlighted")) { return get_script_instance()->call("is_handle_highlighted", p_gizmo, p_idx); } return false; } -void EditorSpatialGizmoPlugin::set_state(int p_state) { +void EditorNode3DGizmoPlugin::set_state(int p_state) { current_state = p_state; for (int i = 0; i < current_gizmos.size(); ++i) { current_gizmos[i]->set_hidden(current_state == HIDDEN); } } -int EditorSpatialGizmoPlugin::get_state() const { +int EditorNode3DGizmoPlugin::get_state() const { return current_state; } -void EditorSpatialGizmoPlugin::unregister_gizmo(EditorSpatialGizmo *p_gizmo) { +void EditorNode3DGizmoPlugin::unregister_gizmo(EditorNode3DGizmo *p_gizmo) { current_gizmos.erase(p_gizmo); } -EditorSpatialGizmoPlugin::EditorSpatialGizmoPlugin() { +EditorNode3DGizmoPlugin::EditorNode3DGizmoPlugin() { current_state = VISIBLE; } -EditorSpatialGizmoPlugin::~EditorSpatialGizmoPlugin() { +EditorNode3DGizmoPlugin::~EditorNode3DGizmoPlugin() { for (int i = 0; i < current_gizmos.size(); ++i) { - current_gizmos[i]->set_plugin(NULL); - current_gizmos[i]->get_spatial_node()->set_gizmo(NULL); + current_gizmos[i]->set_plugin(nullptr); + current_gizmos[i]->get_spatial_node()->set_gizmo(nullptr); } - if (SpatialEditor::get_singleton()) { - SpatialEditor::get_singleton()->update_all_gizmos(); + if (Node3DEditor::get_singleton()) { + Node3DEditor::get_singleton()->update_all_gizmos(); } } diff --git a/editor/plugins/spatial_editor_plugin.h b/editor/plugins/node_3d_editor_plugin.h index b67459b9d0..71da14ae1a 100644 --- a/editor/plugins/spatial_editor_plugin.h +++ b/editor/plugins/node_3d_editor_plugin.h @@ -1,5 +1,5 @@ /*************************************************************************/ -/* spatial_editor_plugin.h */ +/* node_3d_editor_plugin.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ @@ -34,20 +34,20 @@ #include "editor/editor_node.h" #include "editor/editor_plugin.h" #include "editor/editor_scale.h" -#include "scene/3d/immediate_geometry.h" -#include "scene/3d/light.h" -#include "scene/3d/visual_instance.h" +#include "scene/3d/immediate_geometry_3d.h" +#include "scene/3d/light_3d.h" +#include "scene/3d/visual_instance_3d.h" #include "scene/gui/panel_container.h" -class Camera; -class SpatialEditor; -class EditorSpatialGizmoPlugin; -class SpatialEditorViewport; -class ViewportContainer; +class Camera3D; +class Node3DEditor; +class EditorNode3DGizmoPlugin; +class Node3DEditorViewport; +class SubViewportContainer; -class EditorSpatialGizmo : public SpatialGizmo { +class EditorNode3DGizmo : public Node3DGizmo { - GDCLASS(EditorSpatialGizmo, SpatialGizmo); + GDCLASS(EditorNode3DGizmo, Node3DGizmo); bool selected; bool instanced; @@ -75,7 +75,7 @@ public: extra_margin = false; } - void create_instance(Spatial *p_base, bool p_hidden = false); + void create_instance(Node3D *p_base, bool p_hidden = false); }; Vector<Vector3> collision_segments; @@ -93,12 +93,12 @@ public: bool valid; bool hidden; - Spatial *base; + Node3D *base; Vector<Instance> instances; - Spatial *spatial_node; - EditorSpatialGizmoPlugin *gizmo_plugin; + Node3D *spatial_node; + EditorNode3DGizmoPlugin *gizmo_plugin; - void _set_spatial_node(Node *p_node) { set_spatial_node(Object::cast_to<Spatial>(p_node)); } + void _set_spatial_node(Node *p_node) { set_spatial_node(Object::cast_to<Node3D>(p_node)); } protected: static void _bind_methods(); @@ -115,15 +115,15 @@ public: virtual bool is_handle_highlighted(int p_idx) const; virtual String get_handle_name(int p_idx) const; virtual Variant get_handle_value(int p_idx); - virtual void set_handle(int p_idx, Camera *p_camera, const Point2 &p_point); + virtual void set_handle(int p_idx, Camera3D *p_camera, const Point2 &p_point); virtual void commit_handle(int p_idx, const Variant &p_restore, bool p_cancel = false); - void set_spatial_node(Spatial *p_node); - Spatial *get_spatial_node() const { return spatial_node; } - Ref<EditorSpatialGizmoPlugin> get_plugin() const { return gizmo_plugin; } + void set_spatial_node(Node3D *p_node); + Node3D *get_spatial_node() const { return spatial_node; } + Ref<EditorNode3DGizmoPlugin> get_plugin() const { return gizmo_plugin; } Vector3 get_handle_pos(int p_idx) const; - bool intersect_frustum(const Camera *p_camera, const Vector<Plane> &p_frustum); - bool intersect_ray(Camera *p_camera, const Point2 &p_point, Vector3 &r_pos, Vector3 &r_normal, int *r_gizmo_handle = NULL, bool p_sec_first = false); + bool intersect_frustum(const Camera3D *p_camera, const Vector<Plane> &p_frustum); + bool intersect_ray(Camera3D *p_camera, const Point2 &p_point, Vector3 &r_pos, Vector3 &r_normal, int *r_gizmo_handle = nullptr, bool p_sec_first = false); virtual void clear(); virtual void create(); @@ -134,10 +134,10 @@ public: virtual bool is_editable() const; void set_hidden(bool p_hidden); - void set_plugin(EditorSpatialGizmoPlugin *p_plugin); + void set_plugin(EditorNode3DGizmoPlugin *p_plugin); - EditorSpatialGizmo(); - ~EditorSpatialGizmo(); + EditorNode3DGizmo(); + ~EditorNode3DGizmo(); }; class ViewportRotationControl : public Control { @@ -155,7 +155,7 @@ class ViewportRotationControl : public Control { } }; - SpatialEditorViewport *viewport = nullptr; + Node3DEditorViewport *viewport = nullptr; Vector<Color> axis_colors; Vector<int> axis_menu_options; bool orbiting = false; @@ -174,13 +174,13 @@ protected: void _on_mouse_exited(); public: - void set_viewport(SpatialEditorViewport *p_viewport); + void set_viewport(Node3DEditorViewport *p_viewport); }; -class SpatialEditorViewport : public Control { +class Node3DEditorViewport : public Control { - GDCLASS(SpatialEditorViewport, Control); - friend class SpatialEditor; + GDCLASS(Node3DEditorViewport, Control); + friend class Node3DEditor; friend class ViewportRotationControl; enum { @@ -202,7 +202,7 @@ class SpatialEditorViewport : public Control { VIEW_AUDIO_DOPPLER, VIEW_GIZMOS, VIEW_INFORMATION, - VIEW_FPS, + VIEW_FRAME_TIME, VIEW_DISPLAY_NORMAL, VIEW_DISPLAY_WIREFRAME, VIEW_DISPLAY_OVERDRAW, @@ -218,6 +218,8 @@ class SpatialEditorViewport : public Control { VIEW_DISPLAY_DEBUG_SCENE_LUMINANCE, VIEW_DISPLAY_DEBUG_SSAO, VIEW_DISPLAY_DEBUG_ROUGHNESS_LIMITER, + VIEW_DISPLAY_DEBUG_PSSM_SPLITS, + VIEW_DISPLAY_DEBUG_DECAL_ATLAS, VIEW_LOCK_ROTATION, VIEW_CINEMATIC_PREVIEW, VIEW_AUTO_ORTHOGONAL, @@ -228,7 +230,9 @@ public: enum { GIZMO_BASE_LAYER = 27, GIZMO_EDIT_LAYER = 26, - GIZMO_GRID_LAYER = 25 + GIZMO_GRID_LAYER = 25, + + FRAME_TIME_HISTORY = 20, }; enum NavigationScheme { @@ -237,12 +241,23 @@ public: NAVIGATION_MODO, }; + enum FreelookNavigationScheme { + FREELOOK_DEFAULT, + FREELOOK_PARTIALLY_AXIS_LOCKED, + FREELOOK_FULLY_AXIS_LOCKED, + }; + private: + float cpu_time_history[FRAME_TIME_HISTORY]; + int cpu_time_history_index; + float gpu_time_history[FRAME_TIME_HISTORY]; + int gpu_time_history_index; + int index; String name; void _menu_option(int p_option); void _set_auto_orthogonal(); - Spatial *preview_node; + Node3D *preview_node; AABB *preview_bounds; Vector<String> selected_files; AcceptDialog *accept; @@ -256,14 +271,14 @@ private: UndoRedo *undo_redo; CheckBox *preview_camera; - ViewportContainer *viewport_container; + SubViewportContainer *subviewport_container; MenuButton *view_menu; PopupMenu *display_submenu; Control *surface; - Viewport *viewport; - Camera *camera; + SubViewport *viewport; + Camera3D *camera; bool transforming; bool orthogonal; bool auto_orthogonal; @@ -284,7 +299,7 @@ private: struct _RayResult { - Spatial *item; + Node3D *item; float depth; int handle; _FORCE_INLINE_ bool operator<(const _RayResult &p_rr) const { return depth < p_rr.depth; } @@ -295,7 +310,7 @@ private: void _clear_selected(); void _select_clicked(bool p_append, bool p_single, bool p_allow_locked = false); void _select(Node *p_node, bool p_append, bool p_single); - ObjectID _select_ray(const Point2 &p_pos, bool p_append, bool &r_includes_current, int *r_gizmo_handle = NULL, bool p_alt_select = false); + ObjectID _select_ray(const Point2 &p_pos, bool p_append, bool &r_includes_current, int *r_gizmo_handle = nullptr, bool p_alt_select = false); void _find_items_at_pos(const Point2 &p_pos, bool &r_includes_current, Vector<_RayResult> &results, bool p_alt_select = false); Vector3 _get_ray_pos(const Vector2 &p_pos) const; Vector3 _get_ray(const Vector2 &p_pos) const; @@ -366,7 +381,7 @@ private: int edited_gizmo; Point2 mouse_pos; bool snap; - Ref<EditorSpatialGizmo> gizmo; + Ref<EditorNode3DGizmo> gizmo; int gizmo_handle; Variant gizmo_initial_value; Vector3 gizmo_initial_pos; @@ -418,10 +433,10 @@ private: void _sinput(const Ref<InputEvent> &p_event); void _update_freelook(real_t delta); - SpatialEditor *spatial_editor; + Node3DEditor *spatial_editor; - Camera *previewing; - Camera *preview; + Camera3D *previewing; + Camera3D *preview; bool previewing_cinema; bool _is_node_locked(const Node *p_node); @@ -436,7 +451,7 @@ private: Point2i _get_warped_mouse_motion(const Ref<InputEventMouseMotion> &p_ev_mouse_motion) const; Vector3 _get_instance_position(const Point2 &p_pos) const; - static AABB _calculate_spatial_bounds(const Spatial *p_parent, bool p_exclude_toplevel_transform = true); + static AABB _calculate_spatial_bounds(const Node3D *p_parent, bool p_exclude_toplevel_transform = true); void _create_preview(const Vector<String> &files) const; void _remove_preview(); bool _cyclical_dependency_exists(const String &p_target_scene_path, Node *p_desired_node); @@ -454,7 +469,7 @@ public: void update_surface() { surface->update(); } void update_transform_gizmo_view(); - void set_can_preview(Camera *p_preview); + void set_can_preview(Camera3D *p_preview); void set_state(const Dictionary &p_state); Dictionary get_state() const; void reset(); @@ -463,19 +478,19 @@ public: void focus_selection(); void assign_pending_data_pointers( - Spatial *p_preview_node, + Node3D *p_preview_node, AABB *p_preview_bounds, AcceptDialog *p_accept); - Viewport *get_viewport_node() { return viewport; } - Camera *get_camera() { return camera; } // return the default camera object. + SubViewport *get_viewport_node() { return viewport; } + Camera3D *get_camera() { return camera; } // return the default camera object. - SpatialEditorViewport(SpatialEditor *p_spatial_editor, EditorNode *p_editor, int p_index); + Node3DEditorViewport(Node3DEditor *p_spatial_editor, EditorNode *p_editor, int p_index); }; -class SpatialEditorSelectedItem : public Object { +class Node3DEditorSelectedItem : public Object { - GDCLASS(SpatialEditorSelectedItem, Object); + GDCLASS(Node3DEditorSelectedItem, Object); public: AABB aabb; @@ -483,19 +498,19 @@ public: Transform original_local; Transform last_xform; // last transform bool last_xform_dirty; - Spatial *sp; + Node3D *sp; RID sbox_instance; - SpatialEditorSelectedItem() { - sp = NULL; + Node3DEditorSelectedItem() { + sp = nullptr; last_xform_dirty = true; } - ~SpatialEditorSelectedItem(); + ~Node3DEditorSelectedItem(); }; -class SpatialEditorViewportContainer : public Container { +class Node3DEditorViewportContainer : public Container { - GDCLASS(SpatialEditorViewportContainer, Container); + GDCLASS(Node3DEditorViewportContainer, Container); public: enum View { @@ -531,12 +546,12 @@ public: void set_view(View p_view); View get_view(); - SpatialEditorViewportContainer(); + Node3DEditorViewportContainer(); }; -class SpatialEditor : public VBoxContainer { +class Node3DEditor : public VBoxContainer { - GDCLASS(SpatialEditor, VBoxContainer); + GDCLASS(Node3DEditor, VBoxContainer); public: static const unsigned int VIEWPORTS_COUNT = 4; @@ -568,8 +583,8 @@ private: EditorNode *editor; EditorSelection *editor_selection; - SpatialEditorViewportContainer *viewport_base; - SpatialEditorViewport *viewports[VIEWPORTS_COUNT]; + Node3DEditorViewportContainer *viewport_base; + Node3DEditorViewport *viewports[VIEWPORTS_COUNT]; VSplitContainer *shader_split; HSplitContainer *palette_split; @@ -578,7 +593,7 @@ private: ToolMode tool_mode; bool orthogonal; - VisualServer::ScenarioDebugMode scenario_debug; + RenderingServer::ScenarioDebugMode scenario_debug; RID origin; RID origin_instance; @@ -609,7 +624,7 @@ private: Ref<StandardMaterial3D> cursor_material; // Scene drag and drop support - Spatial *preview_node; + Node3D *preview_node; AABB preview_bounds; struct Gizmo { @@ -709,19 +724,19 @@ private: Ref<Environment> viewport_environment; - Spatial *selected; + Node3D *selected; void _request_gizmo(Object *p_obj); - static SpatialEditor *singleton; + static Node3DEditor *singleton; void _node_removed(Node *p_node); - Vector<Ref<EditorSpatialGizmoPlugin>> gizmo_plugins_by_priority; - Vector<Ref<EditorSpatialGizmoPlugin>> gizmo_plugins_by_name; + Vector<Ref<EditorNode3DGizmoPlugin>> gizmo_plugins_by_priority; + Vector<Ref<EditorNode3DGizmoPlugin>> gizmo_plugins_by_name; void _register_all_gizmos(); - SpatialEditor(); + Node3DEditor(); bool is_any_freelook_active() const; @@ -735,7 +750,7 @@ protected: static void _bind_methods(); public: - static SpatialEditor *get_singleton() { return singleton; } + static Node3DEditor *get_singleton() { return singleton; } void snap_cursor_to_plane(const Plane &p_plane); Vector3 snap_point(Vector3 p_target, Vector3 p_start = Vector3(0, 0, 0)) const; @@ -748,7 +763,7 @@ public: bool is_gizmo_visible() const { return gizmo.visible; } ToolMode get_tool_mode() const { return tool_mode; } - bool are_local_coords_enabled() const { return tool_option_button[SpatialEditor::TOOL_OPT_LOCAL_COORDS]->is_pressed(); } + bool are_local_coords_enabled() const { return tool_option_button[Node3DEditor::TOOL_OPT_LOCAL_COORDS]->is_pressed(); } bool is_snap_enabled() const { return snap_enabled ^ snap_key_enabled; } float get_translate_snap() const; float get_rotate_snap() const; @@ -761,7 +776,7 @@ public: Ref<ArrayMesh> get_scale_plane_gizmo(int idx) const { return scale_plane_gizmo[idx]; } void update_transform_gizmo(); - void update_all_gizmos(Node *p_node = NULL); + void update_all_gizmos(Node *p_node = nullptr); void snap_selected_nodes_to_floor(); void select_gizmo_highlight_axis(int p_axis); void set_custom_camera(Node *p_camera) { custom_camera = p_camera; } @@ -780,33 +795,33 @@ public: VSplitContainer *get_shader_split(); HSplitContainer *get_palette_split(); - Spatial *get_selected() { return selected; } + Node3D *get_selected() { return selected; } int get_over_gizmo_handle() const { return over_gizmo_handle; } void set_over_gizmo_handle(int idx) { over_gizmo_handle = idx; } - void set_can_preview(Camera *p_preview); + void set_can_preview(Camera3D *p_preview); - SpatialEditorViewport *get_editor_viewport(int p_idx) { - ERR_FAIL_INDEX_V(p_idx, static_cast<int>(VIEWPORTS_COUNT), NULL); + Node3DEditorViewport *get_editor_viewport(int p_idx) { + ERR_FAIL_INDEX_V(p_idx, static_cast<int>(VIEWPORTS_COUNT), nullptr); return viewports[p_idx]; } - void add_gizmo_plugin(Ref<EditorSpatialGizmoPlugin> p_plugin); - void remove_gizmo_plugin(Ref<EditorSpatialGizmoPlugin> p_plugin); + void add_gizmo_plugin(Ref<EditorNode3DGizmoPlugin> p_plugin); + void remove_gizmo_plugin(Ref<EditorNode3DGizmoPlugin> p_plugin); - void edit(Spatial *p_spatial); + void edit(Node3D *p_spatial); void clear(); - SpatialEditor(EditorNode *p_editor); - ~SpatialEditor(); + Node3DEditor(EditorNode *p_editor); + ~Node3DEditor(); }; -class SpatialEditorPlugin : public EditorPlugin { +class Node3DEditorPlugin : public EditorPlugin { - GDCLASS(SpatialEditorPlugin, EditorPlugin); + GDCLASS(Node3DEditorPlugin, EditorPlugin); - SpatialEditor *spatial_editor; + Node3DEditor *spatial_editor; EditorNode *editor; protected: @@ -815,7 +830,7 @@ protected: public: void snap_cursor_to_plane(const Plane &p_plane); - SpatialEditor *get_spatial_editor() { return spatial_editor; } + Node3DEditor *get_spatial_editor() { return spatial_editor; } virtual String get_name() const { return "3D"; } bool has_main_screen() const { return true; } virtual void make_visible(bool p_visible); @@ -828,28 +843,27 @@ public: virtual void edited_scene_changed(); - SpatialEditorPlugin(EditorNode *p_node); - ~SpatialEditorPlugin(); + Node3DEditorPlugin(EditorNode *p_node); + ~Node3DEditorPlugin(); }; -class EditorSpatialGizmoPlugin : public Resource { +class EditorNode3DGizmoPlugin : public Resource { - GDCLASS(EditorSpatialGizmoPlugin, Resource); + GDCLASS(EditorNode3DGizmoPlugin, Resource); public: static const int VISIBLE = 0; static const int HIDDEN = 1; static const int ON_TOP = 2; -private: +protected: int current_state; - List<EditorSpatialGizmo *> current_gizmos; + List<EditorNode3DGizmo *> current_gizmos; HashMap<String, Vector<Ref<StandardMaterial3D>>> materials; -protected: static void _bind_methods(); - virtual bool has_gizmo(Spatial *p_spatial); - virtual Ref<EditorSpatialGizmo> create_gizmo(Spatial *p_spatial); + virtual bool has_gizmo(Node3D *p_spatial); + virtual Ref<EditorNode3DGizmo> create_gizmo(Node3D *p_spatial); public: void create_material(const String &p_name, const Color &p_color, bool p_billboard = false, bool p_on_top = false, bool p_use_vertex_color = false); @@ -857,27 +871,27 @@ public: void create_handle_material(const String &p_name, bool p_billboard = false); void add_material(const String &p_name, Ref<StandardMaterial3D> p_material); - Ref<StandardMaterial3D> get_material(const String &p_name, const Ref<EditorSpatialGizmo> &p_gizmo = Ref<EditorSpatialGizmo>()); + Ref<StandardMaterial3D> get_material(const String &p_name, const Ref<EditorNode3DGizmo> &p_gizmo = Ref<EditorNode3DGizmo>()); virtual String get_name() const; virtual int get_priority() const; virtual bool can_be_hidden() const; virtual bool is_selectable_when_hidden() const; - virtual void redraw(EditorSpatialGizmo *p_gizmo); - virtual String get_handle_name(const EditorSpatialGizmo *p_gizmo, int p_idx) const; - virtual Variant get_handle_value(EditorSpatialGizmo *p_gizmo, int p_idx) const; - virtual void set_handle(EditorSpatialGizmo *p_gizmo, int p_idx, Camera *p_camera, const Point2 &p_point); - virtual void commit_handle(EditorSpatialGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel = false); - virtual bool is_handle_highlighted(const EditorSpatialGizmo *p_gizmo, int p_idx) const; + virtual void redraw(EditorNode3DGizmo *p_gizmo); + virtual String get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_idx) const; + virtual Variant get_handle_value(EditorNode3DGizmo *p_gizmo, int p_idx) const; + virtual void set_handle(EditorNode3DGizmo *p_gizmo, int p_idx, Camera3D *p_camera, const Point2 &p_point); + virtual void commit_handle(EditorNode3DGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel = false); + virtual bool is_handle_highlighted(const EditorNode3DGizmo *p_gizmo, int p_idx) const; - Ref<EditorSpatialGizmo> get_gizmo(Spatial *p_spatial); + Ref<EditorNode3DGizmo> get_gizmo(Node3D *p_spatial); void set_state(int p_state); int get_state() const; - void unregister_gizmo(EditorSpatialGizmo *p_gizmo); + void unregister_gizmo(EditorNode3DGizmo *p_gizmo); - EditorSpatialGizmoPlugin(); - virtual ~EditorSpatialGizmoPlugin(); + EditorNode3DGizmoPlugin(); + virtual ~EditorNode3DGizmoPlugin(); }; #endif diff --git a/editor/plugins/path_2d_editor_plugin.cpp b/editor/plugins/path_2d_editor_plugin.cpp index 165df6b500..4516b7035b 100644 --- a/editor/plugins/path_2d_editor_plugin.cpp +++ b/editor/plugins/path_2d_editor_plugin.cpp @@ -56,7 +56,7 @@ void Path2DEditor::_notification(int p_what) { void Path2DEditor::_node_removed(Node *p_node) { if (p_node == node) { - node = NULL; + node = nullptr; hide(); } } @@ -288,7 +288,7 @@ bool Path2DEditor::forward_gui_input(const Ref<InputEvent> &p_event) { Vector2 gpoint = mm->get_position(); Ref<Curve2D> curve = node->get_curve(); - if (curve == NULL) return true; + if (curve == nullptr) return true; if (curve->get_point_count() < 2) return true; // Find edge @@ -373,12 +373,12 @@ void Path2DEditor::forward_canvas_draw_over_viewport(Control *p_overlay) { Transform2D xform = canvas_item_editor->get_canvas_transform() * node->get_global_transform(); - const Ref<Texture2D> path_sharp_handle = get_icon("EditorPathSharpHandle", "EditorIcons"); - const Ref<Texture2D> path_smooth_handle = get_icon("EditorPathSmoothHandle", "EditorIcons"); + const Ref<Texture2D> path_sharp_handle = get_theme_icon("EditorPathSharpHandle", "EditorIcons"); + const Ref<Texture2D> path_smooth_handle = get_theme_icon("EditorPathSmoothHandle", "EditorIcons"); // Both handle icons must be of the same size const Size2 handle_size = path_sharp_handle->get_size(); - const Ref<Texture2D> curve_handle = get_icon("EditorCurveHandle", "EditorIcons"); + const Ref<Texture2D> curve_handle = get_theme_icon("EditorCurveHandle", "EditorIcons"); const Size2 curve_handle_size = curve_handle->get_size(); Ref<Curve2D> curve = node->get_curve(); @@ -420,7 +420,7 @@ void Path2DEditor::forward_canvas_draw_over_viewport(Control *p_overlay) { } if (on_edge) { - Ref<Texture2D> add_handle = get_icon("EditorHandleAdd", "EditorIcons"); + Ref<Texture2D> add_handle = get_theme_icon("EditorHandleAdd", "EditorIcons"); p_overlay->draw_texture(add_handle, edge_point - add_handle->get_size() * 0.5); } } @@ -449,7 +449,7 @@ void Path2DEditor::edit(Node *p_path2d) { // node may have been deleted at this point if (node && node->is_connected("visibility_changed", callable_mp(this, &Path2DEditor::_node_visibility_changed))) node->disconnect("visibility_changed", callable_mp(this, &Path2DEditor::_node_visibility_changed)); - node = NULL; + node = nullptr; } } @@ -532,7 +532,7 @@ void Path2DEditor::_handle_option_pressed(int p_option) { Path2DEditor::Path2DEditor(EditorNode *p_editor) { - canvas_item_editor = NULL; + canvas_item_editor = nullptr; editor = p_editor; undo_redo = editor->get_undo_redo(); mirror_handle_angle = true; @@ -548,35 +548,35 @@ Path2DEditor::Path2DEditor(EditorNode *p_editor) { sep = memnew(VSeparator); base_hb->add_child(sep); curve_edit = memnew(ToolButton); - curve_edit->set_icon(EditorNode::get_singleton()->get_gui_base()->get_icon("CurveEdit", "EditorIcons")); + curve_edit->set_icon(EditorNode::get_singleton()->get_gui_base()->get_theme_icon("CurveEdit", "EditorIcons")); curve_edit->set_toggle_mode(true); curve_edit->set_focus_mode(Control::FOCUS_NONE); curve_edit->set_tooltip(TTR("Select Points") + "\n" + TTR("Shift+Drag: Select Control Points") + "\n" + keycode_get_string(KEY_MASK_CMD) + TTR("Click: Add Point") + "\n" + TTR("Left Click: Split Segment (in curve)") + "\n" + TTR("Right Click: Delete Point")); curve_edit->connect("pressed", callable_mp(this, &Path2DEditor::_mode_selected), varray(MODE_EDIT)); base_hb->add_child(curve_edit); curve_edit_curve = memnew(ToolButton); - curve_edit_curve->set_icon(EditorNode::get_singleton()->get_gui_base()->get_icon("CurveCurve", "EditorIcons")); + curve_edit_curve->set_icon(EditorNode::get_singleton()->get_gui_base()->get_theme_icon("CurveCurve", "EditorIcons")); curve_edit_curve->set_toggle_mode(true); curve_edit_curve->set_focus_mode(Control::FOCUS_NONE); curve_edit_curve->set_tooltip(TTR("Select Control Points (Shift+Drag)")); curve_edit_curve->connect("pressed", callable_mp(this, &Path2DEditor::_mode_selected), varray(MODE_EDIT_CURVE)); base_hb->add_child(curve_edit_curve); curve_create = memnew(ToolButton); - curve_create->set_icon(EditorNode::get_singleton()->get_gui_base()->get_icon("CurveCreate", "EditorIcons")); + curve_create->set_icon(EditorNode::get_singleton()->get_gui_base()->get_theme_icon("CurveCreate", "EditorIcons")); curve_create->set_toggle_mode(true); curve_create->set_focus_mode(Control::FOCUS_NONE); curve_create->set_tooltip(TTR("Add Point (in empty space)")); curve_create->connect("pressed", callable_mp(this, &Path2DEditor::_mode_selected), varray(MODE_CREATE)); base_hb->add_child(curve_create); curve_del = memnew(ToolButton); - curve_del->set_icon(EditorNode::get_singleton()->get_gui_base()->get_icon("CurveDelete", "EditorIcons")); + curve_del->set_icon(EditorNode::get_singleton()->get_gui_base()->get_theme_icon("CurveDelete", "EditorIcons")); curve_del->set_toggle_mode(true); curve_del->set_focus_mode(Control::FOCUS_NONE); curve_del->set_tooltip(TTR("Delete Point")); curve_del->connect("pressed", callable_mp(this, &Path2DEditor::_mode_selected), varray(MODE_DELETE)); base_hb->add_child(curve_del); curve_close = memnew(ToolButton); - curve_close->set_icon(EditorNode::get_singleton()->get_gui_base()->get_icon("CurveClose", "EditorIcons")); + curve_close->set_icon(EditorNode::get_singleton()->get_gui_base()->get_theme_icon("CurveClose", "EditorIcons")); curve_close->set_focus_mode(Control::FOCUS_NONE); curve_close->set_tooltip(TTR("Close Curve")); curve_close->connect("pressed", callable_mp(this, &Path2DEditor::_mode_selected), varray(ACTION_CLOSE)); @@ -620,7 +620,7 @@ void Path2DEditorPlugin::make_visible(bool p_visible) { path2d_editor->hide(); path2d_editor->base_hb->hide(); - path2d_editor->edit(NULL); + path2d_editor->edit(nullptr); } } diff --git a/editor/plugins/path_editor_plugin.cpp b/editor/plugins/path_3d_editor_plugin.cpp index 42b1045666..d3ece9556d 100644 --- a/editor/plugins/path_editor_plugin.cpp +++ b/editor/plugins/path_3d_editor_plugin.cpp @@ -1,5 +1,5 @@ /*************************************************************************/ -/* path_editor_plugin.cpp */ +/* path_3d_editor_plugin.cpp */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ @@ -28,13 +28,13 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#include "path_editor_plugin.h" +#include "path_3d_editor_plugin.h" #include "core/os/keyboard.h" +#include "node_3d_editor_plugin.h" #include "scene/resources/curve.h" -#include "spatial_editor_plugin.h" -String PathSpatialGizmo::get_handle_name(int p_idx) const { +String Path3DGizmo::get_handle_name(int p_idx) const { Ref<Curve3D> c = path->get_curve(); if (c.is_null()) @@ -57,7 +57,7 @@ String PathSpatialGizmo::get_handle_name(int p_idx) const { return n; } -Variant PathSpatialGizmo::get_handle_value(int p_idx) { +Variant Path3DGizmo::get_handle_value(int p_idx) { Ref<Curve3D> c = path->get_curve(); if (c.is_null()) @@ -84,7 +84,7 @@ Variant PathSpatialGizmo::get_handle_value(int p_idx) { return ofs; } -void PathSpatialGizmo::set_handle(int p_idx, Camera *p_camera, const Point2 &p_point) { +void Path3DGizmo::set_handle(int p_idx, Camera3D *p_camera, const Point2 &p_point) { Ref<Curve3D> c = path->get_curve(); if (c.is_null()) @@ -104,8 +104,8 @@ void PathSpatialGizmo::set_handle(int p_idx, Camera *p_camera, const Point2 &p_p if (p.intersects_ray(ray_from, ray_dir, &inters)) { - if (SpatialEditor::get_singleton()->is_snap_enabled()) { - float snap = SpatialEditor::get_singleton()->get_translate_snap(); + if (Node3DEditor::get_singleton()->is_snap_enabled()) { + float snap = Node3DEditor::get_singleton()->get_translate_snap(); inters.snap(Vector3(snap, snap, snap)); } @@ -130,37 +130,37 @@ void PathSpatialGizmo::set_handle(int p_idx, Camera *p_camera, const Point2 &p_p // Setting curve in/out positions if (p.intersects_ray(ray_from, ray_dir, &inters)) { - if (!PathEditorPlugin::singleton->is_handle_clicked()) { + if (!Path3DEditorPlugin::singleton->is_handle_clicked()) { orig_in_length = c->get_point_in(idx).length(); orig_out_length = c->get_point_out(idx).length(); - PathEditorPlugin::singleton->set_handle_clicked(true); + Path3DEditorPlugin::singleton->set_handle_clicked(true); } Vector3 local = gi.xform(inters) - base; - if (SpatialEditor::get_singleton()->is_snap_enabled()) { - float snap = SpatialEditor::get_singleton()->get_translate_snap(); + if (Node3DEditor::get_singleton()->is_snap_enabled()) { + float snap = Node3DEditor::get_singleton()->get_translate_snap(); local.snap(Vector3(snap, snap, snap)); } if (t == 0) { c->set_point_in(idx, local); - if (PathEditorPlugin::singleton->mirror_angle_enabled()) - c->set_point_out(idx, PathEditorPlugin::singleton->mirror_length_enabled() ? -local : (-local.normalized() * orig_out_length)); + if (Path3DEditorPlugin::singleton->mirror_angle_enabled()) + c->set_point_out(idx, Path3DEditorPlugin::singleton->mirror_length_enabled() ? -local : (-local.normalized() * orig_out_length)); } else { c->set_point_out(idx, local); - if (PathEditorPlugin::singleton->mirror_angle_enabled()) - c->set_point_in(idx, PathEditorPlugin::singleton->mirror_length_enabled() ? -local : (-local.normalized() * orig_in_length)); + if (Path3DEditorPlugin::singleton->mirror_angle_enabled()) + c->set_point_in(idx, Path3DEditorPlugin::singleton->mirror_length_enabled() ? -local : (-local.normalized() * orig_in_length)); } } } -void PathSpatialGizmo::commit_handle(int p_idx, const Variant &p_restore, bool p_cancel) { +void Path3DGizmo::commit_handle(int p_idx, const Variant &p_restore, bool p_cancel) { Ref<Curve3D> c = path->get_curve(); if (c.is_null()) return; - UndoRedo *ur = SpatialEditor::get_singleton()->get_undo_redo(); + UndoRedo *ur = Node3DEditor::get_singleton()->get_undo_redo(); if (p_idx < c->get_point_count()) { @@ -192,9 +192,9 @@ void PathSpatialGizmo::commit_handle(int p_idx, const Variant &p_restore, bool p ur->add_do_method(c.ptr(), "set_point_in", idx, c->get_point_in(idx)); ur->add_undo_method(c.ptr(), "set_point_in", idx, p_restore); - if (PathEditorPlugin::singleton->mirror_angle_enabled()) { - ur->add_do_method(c.ptr(), "set_point_out", idx, PathEditorPlugin::singleton->mirror_length_enabled() ? -c->get_point_in(idx) : (-c->get_point_in(idx).normalized() * orig_out_length)); - ur->add_undo_method(c.ptr(), "set_point_out", idx, PathEditorPlugin::singleton->mirror_length_enabled() ? -static_cast<Vector3>(p_restore) : (-static_cast<Vector3>(p_restore).normalized() * orig_out_length)); + if (Path3DEditorPlugin::singleton->mirror_angle_enabled()) { + ur->add_do_method(c.ptr(), "set_point_out", idx, Path3DEditorPlugin::singleton->mirror_length_enabled() ? -c->get_point_in(idx) : (-c->get_point_in(idx).normalized() * orig_out_length)); + ur->add_undo_method(c.ptr(), "set_point_out", idx, Path3DEditorPlugin::singleton->mirror_length_enabled() ? -static_cast<Vector3>(p_restore) : (-static_cast<Vector3>(p_restore).normalized() * orig_out_length)); } ur->commit_action(); @@ -209,15 +209,15 @@ void PathSpatialGizmo::commit_handle(int p_idx, const Variant &p_restore, bool p ur->add_do_method(c.ptr(), "set_point_out", idx, c->get_point_out(idx)); ur->add_undo_method(c.ptr(), "set_point_out", idx, p_restore); - if (PathEditorPlugin::singleton->mirror_angle_enabled()) { - ur->add_do_method(c.ptr(), "set_point_in", idx, PathEditorPlugin::singleton->mirror_length_enabled() ? -c->get_point_out(idx) : (-c->get_point_out(idx).normalized() * orig_in_length)); - ur->add_undo_method(c.ptr(), "set_point_in", idx, PathEditorPlugin::singleton->mirror_length_enabled() ? -static_cast<Vector3>(p_restore) : (-static_cast<Vector3>(p_restore).normalized() * orig_in_length)); + if (Path3DEditorPlugin::singleton->mirror_angle_enabled()) { + ur->add_do_method(c.ptr(), "set_point_in", idx, Path3DEditorPlugin::singleton->mirror_length_enabled() ? -c->get_point_out(idx) : (-c->get_point_out(idx).normalized() * orig_in_length)); + ur->add_undo_method(c.ptr(), "set_point_in", idx, Path3DEditorPlugin::singleton->mirror_length_enabled() ? -static_cast<Vector3>(p_restore) : (-static_cast<Vector3>(p_restore).normalized() * orig_in_length)); } ur->commit_action(); } } -void PathSpatialGizmo::redraw() { +void Path3DGizmo::redraw() { clear(); @@ -252,7 +252,7 @@ void PathSpatialGizmo::redraw() { add_collision_segments(v3p); } - if (PathEditorPlugin::singleton->get_edited_path() == path) { + if (Path3DEditorPlugin::singleton->get_edited_path() == path) { v3p.clear(); Vector<Vector3> handles; Vector<Vector3> sec_handles; @@ -286,13 +286,13 @@ void PathSpatialGizmo::redraw() { } } -PathSpatialGizmo::PathSpatialGizmo(Path *p_path) { +Path3DGizmo::Path3DGizmo(Path3D *p_path) { path = p_path; set_spatial_node(p_path); } -bool PathEditorPlugin::forward_spatial_gui_input(Camera *p_camera, const Ref<InputEvent> &p_event) { +bool Path3DEditorPlugin::forward_spatial_gui_input(Camera3D *p_camera, const Ref<InputEvent> &p_event) { if (!path) return false; @@ -448,10 +448,10 @@ bool PathEditorPlugin::forward_spatial_gui_input(Camera *p_camera, const Ref<Inp return false; } -void PathEditorPlugin::edit(Object *p_object) { +void Path3DEditorPlugin::edit(Object *p_object) { if (p_object) { - path = Object::cast_to<Path>(p_object); + path = Object::cast_to<Path3D>(p_object); if (path) { if (path->get_curve().is_valid()) { @@ -459,8 +459,8 @@ void PathEditorPlugin::edit(Object *p_object) { } } } else { - Path *pre = path; - path = NULL; + Path3D *pre = path; + path = nullptr; if (pre) { pre->get_curve()->emit_signal("changed"); } @@ -468,12 +468,12 @@ void PathEditorPlugin::edit(Object *p_object) { //collision_polygon_editor->edit(Object::cast_to<Node>(p_object)); } -bool PathEditorPlugin::handles(Object *p_object) const { +bool Path3DEditorPlugin::handles(Object *p_object) const { - return p_object->is_class("Path"); + return p_object->is_class("Path3D"); } -void PathEditorPlugin::make_visible(bool p_visible) { +void Path3DEditorPlugin::make_visible(bool p_visible) { if (p_visible) { @@ -493,8 +493,8 @@ void PathEditorPlugin::make_visible(bool p_visible) { sep->hide(); { - Path *pre = path; - path = NULL; + Path3D *pre = path; + path = nullptr; if (pre && pre->get_curve().is_valid()) { pre->get_curve()->emit_signal("changed"); } @@ -502,14 +502,14 @@ void PathEditorPlugin::make_visible(bool p_visible) { } } -void PathEditorPlugin::_mode_changed(int p_idx) { +void Path3DEditorPlugin::_mode_changed(int p_idx) { curve_create->set_pressed(p_idx == 0); curve_edit->set_pressed(p_idx == 1); curve_del->set_pressed(p_idx == 2); } -void PathEditorPlugin::_close_curve() { +void Path3DEditorPlugin::_close_curve() { Ref<Curve3D> c = path->get_curve(); if (c.is_null()) @@ -519,7 +519,7 @@ void PathEditorPlugin::_close_curve() { c->add_point(c->get_point_position(0), c->get_point_in(0), c->get_point_out(0)); } -void PathEditorPlugin::_handle_option_pressed(int p_option) { +void Path3DEditorPlugin::_handle_option_pressed(int p_option) { PopupMenu *pm; pm = handle_menu->get_popup(); @@ -539,78 +539,78 @@ void PathEditorPlugin::_handle_option_pressed(int p_option) { } } -void PathEditorPlugin::_notification(int p_what) { +void Path3DEditorPlugin::_notification(int p_what) { if (p_what == NOTIFICATION_ENTER_TREE) { - curve_create->connect("pressed", callable_mp(this, &PathEditorPlugin::_mode_changed), make_binds(0)); - curve_edit->connect("pressed", callable_mp(this, &PathEditorPlugin::_mode_changed), make_binds(1)); - curve_del->connect("pressed", callable_mp(this, &PathEditorPlugin::_mode_changed), make_binds(2)); - curve_close->connect("pressed", callable_mp(this, &PathEditorPlugin::_close_curve)); + curve_create->connect("pressed", callable_mp(this, &Path3DEditorPlugin::_mode_changed), make_binds(0)); + curve_edit->connect("pressed", callable_mp(this, &Path3DEditorPlugin::_mode_changed), make_binds(1)); + curve_del->connect("pressed", callable_mp(this, &Path3DEditorPlugin::_mode_changed), make_binds(2)); + curve_close->connect("pressed", callable_mp(this, &Path3DEditorPlugin::_close_curve)); } } -void PathEditorPlugin::_bind_methods() { +void Path3DEditorPlugin::_bind_methods() { } -PathEditorPlugin *PathEditorPlugin::singleton = NULL; +Path3DEditorPlugin *Path3DEditorPlugin::singleton = nullptr; -PathEditorPlugin::PathEditorPlugin(EditorNode *p_node) { +Path3DEditorPlugin::Path3DEditorPlugin(EditorNode *p_node) { - path = NULL; + path = nullptr; editor = p_node; singleton = this; mirror_handle_angle = true; mirror_handle_length = true; - Ref<PathSpatialGizmoPlugin> gizmo_plugin; + Ref<Path3DGizmoPlugin> gizmo_plugin; gizmo_plugin.instance(); - SpatialEditor::get_singleton()->add_gizmo_plugin(gizmo_plugin); + Node3DEditor::get_singleton()->add_gizmo_plugin(gizmo_plugin); sep = memnew(VSeparator); sep->hide(); - SpatialEditor::get_singleton()->add_control_to_menu_panel(sep); + Node3DEditor::get_singleton()->add_control_to_menu_panel(sep); curve_edit = memnew(ToolButton); - curve_edit->set_icon(EditorNode::get_singleton()->get_gui_base()->get_icon("CurveEdit", "EditorIcons")); + curve_edit->set_icon(EditorNode::get_singleton()->get_gui_base()->get_theme_icon("CurveEdit", "EditorIcons")); curve_edit->set_toggle_mode(true); curve_edit->hide(); curve_edit->set_focus_mode(Control::FOCUS_NONE); curve_edit->set_tooltip(TTR("Select Points") + "\n" + TTR("Shift+Drag: Select Control Points") + "\n" + keycode_get_string(KEY_MASK_CMD) + TTR("Click: Add Point") + "\n" + TTR("Right Click: Delete Point")); - SpatialEditor::get_singleton()->add_control_to_menu_panel(curve_edit); + Node3DEditor::get_singleton()->add_control_to_menu_panel(curve_edit); curve_create = memnew(ToolButton); - curve_create->set_icon(EditorNode::get_singleton()->get_gui_base()->get_icon("CurveCreate", "EditorIcons")); + curve_create->set_icon(EditorNode::get_singleton()->get_gui_base()->get_theme_icon("CurveCreate", "EditorIcons")); curve_create->set_toggle_mode(true); curve_create->hide(); curve_create->set_focus_mode(Control::FOCUS_NONE); curve_create->set_tooltip(TTR("Add Point (in empty space)") + "\n" + TTR("Split Segment (in curve)")); - SpatialEditor::get_singleton()->add_control_to_menu_panel(curve_create); + Node3DEditor::get_singleton()->add_control_to_menu_panel(curve_create); curve_del = memnew(ToolButton); - curve_del->set_icon(EditorNode::get_singleton()->get_gui_base()->get_icon("CurveDelete", "EditorIcons")); + curve_del->set_icon(EditorNode::get_singleton()->get_gui_base()->get_theme_icon("CurveDelete", "EditorIcons")); curve_del->set_toggle_mode(true); curve_del->hide(); curve_del->set_focus_mode(Control::FOCUS_NONE); curve_del->set_tooltip(TTR("Delete Point")); - SpatialEditor::get_singleton()->add_control_to_menu_panel(curve_del); + Node3DEditor::get_singleton()->add_control_to_menu_panel(curve_del); curve_close = memnew(ToolButton); - curve_close->set_icon(EditorNode::get_singleton()->get_gui_base()->get_icon("CurveClose", "EditorIcons")); + curve_close->set_icon(EditorNode::get_singleton()->get_gui_base()->get_theme_icon("CurveClose", "EditorIcons")); curve_close->hide(); curve_close->set_focus_mode(Control::FOCUS_NONE); curve_close->set_tooltip(TTR("Close Curve")); - SpatialEditor::get_singleton()->add_control_to_menu_panel(curve_close); + Node3DEditor::get_singleton()->add_control_to_menu_panel(curve_close); PopupMenu *menu; handle_menu = memnew(MenuButton); handle_menu->set_text(TTR("Options")); handle_menu->hide(); - SpatialEditor::get_singleton()->add_control_to_menu_panel(handle_menu); + Node3DEditor::get_singleton()->add_control_to_menu_panel(handle_menu); menu = handle_menu->get_popup(); menu->add_check_item(TTR("Mirror Handle Angles")); menu->set_item_checked(HANDLE_OPTION_ANGLE, mirror_handle_angle); menu->add_check_item(TTR("Mirror Handle Lengths")); menu->set_item_checked(HANDLE_OPTION_LENGTH, mirror_handle_length); - menu->connect("id_pressed", callable_mp(this, &PathEditorPlugin::_handle_option_pressed)); + menu->connect("id_pressed", callable_mp(this, &Path3DEditorPlugin::_handle_option_pressed)); curve_edit->set_pressed(true); /* @@ -624,27 +624,27 @@ PathEditorPlugin::PathEditorPlugin(EditorNode *p_node) { */ } -PathEditorPlugin::~PathEditorPlugin() { +Path3DEditorPlugin::~Path3DEditorPlugin() { } -Ref<EditorSpatialGizmo> PathSpatialGizmoPlugin::create_gizmo(Spatial *p_spatial) { - Ref<PathSpatialGizmo> ref; +Ref<EditorNode3DGizmo> Path3DGizmoPlugin::create_gizmo(Node3D *p_spatial) { + Ref<Path3DGizmo> ref; - Path *path = Object::cast_to<Path>(p_spatial); - if (path) ref = Ref<PathSpatialGizmo>(memnew(PathSpatialGizmo(path))); + Path3D *path = Object::cast_to<Path3D>(p_spatial); + if (path) ref = Ref<Path3DGizmo>(memnew(Path3DGizmo(path))); return ref; } -String PathSpatialGizmoPlugin::get_name() const { - return "Path"; +String Path3DGizmoPlugin::get_name() const { + return "Path3D"; } -int PathSpatialGizmoPlugin::get_priority() const { +int Path3DGizmoPlugin::get_priority() const { return -1; } -PathSpatialGizmoPlugin::PathSpatialGizmoPlugin() { +Path3DGizmoPlugin::Path3DGizmoPlugin() { Color path_color = EDITOR_DEF("editors/3d_gizmos/gizmo_colors/path", Color(0.5, 0.5, 1.0, 0.8)); create_material("path_material", path_color); diff --git a/editor/plugins/path_editor_plugin.h b/editor/plugins/path_3d_editor_plugin.h index 8ff83911f8..3f18cadacd 100644 --- a/editor/plugins/path_editor_plugin.h +++ b/editor/plugins/path_3d_editor_plugin.h @@ -1,5 +1,5 @@ /*************************************************************************/ -/* path_editor_plugin.h */ +/* path_3d_editor_plugin.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ @@ -31,14 +31,14 @@ #ifndef PATH_EDITOR_PLUGIN_H #define PATH_EDITOR_PLUGIN_H -#include "editor/spatial_editor_gizmos.h" -#include "scene/3d/path.h" +#include "editor/node_3d_editor_gizmos.h" +#include "scene/3d/path_3d.h" -class PathSpatialGizmo : public EditorSpatialGizmo { +class Path3DGizmo : public EditorNode3DGizmo { - GDCLASS(PathSpatialGizmo, EditorSpatialGizmo); + GDCLASS(Path3DGizmo, EditorNode3DGizmo); - Path *path; + Path3D *path; mutable Vector3 original; mutable float orig_in_length; mutable float orig_out_length; @@ -46,29 +46,29 @@ class PathSpatialGizmo : public EditorSpatialGizmo { public: virtual String get_handle_name(int p_idx) const; virtual Variant get_handle_value(int p_idx); - virtual void set_handle(int p_idx, Camera *p_camera, const Point2 &p_point); + virtual void set_handle(int p_idx, Camera3D *p_camera, const Point2 &p_point); virtual void commit_handle(int p_idx, const Variant &p_restore, bool p_cancel = false); virtual void redraw(); - PathSpatialGizmo(Path *p_path = NULL); + Path3DGizmo(Path3D *p_path = nullptr); }; -class PathSpatialGizmoPlugin : public EditorSpatialGizmoPlugin { +class Path3DGizmoPlugin : public EditorNode3DGizmoPlugin { - GDCLASS(PathSpatialGizmoPlugin, EditorSpatialGizmoPlugin); + GDCLASS(Path3DGizmoPlugin, EditorNode3DGizmoPlugin); protected: - Ref<EditorSpatialGizmo> create_gizmo(Spatial *p_spatial); + Ref<EditorNode3DGizmo> create_gizmo(Node3D *p_spatial); public: String get_name() const; int get_priority() const; - PathSpatialGizmoPlugin(); + Path3DGizmoPlugin(); }; -class PathEditorPlugin : public EditorPlugin { +class Path3DEditorPlugin : public EditorPlugin { - GDCLASS(PathEditorPlugin, EditorPlugin); + GDCLASS(Path3DEditorPlugin, EditorPlugin); Separator *sep; ToolButton *curve_create; @@ -79,7 +79,7 @@ class PathEditorPlugin : public EditorPlugin { EditorNode *editor; - Path *path; + Path3D *path; void _mode_changed(int p_idx); void _close_curve(); @@ -98,14 +98,12 @@ protected: static void _bind_methods(); public: - Path *get_edited_path() { return path; } + Path3D *get_edited_path() { return path; } - static PathEditorPlugin *singleton; - virtual bool forward_spatial_gui_input(Camera *p_camera, const Ref<InputEvent> &p_event); + static Path3DEditorPlugin *singleton; + virtual bool forward_spatial_gui_input(Camera3D *p_camera, const Ref<InputEvent> &p_event); - //virtual bool forward_gui_input(const InputEvent& p_event) { return collision_polygon_editor->forward_gui_input(p_event); } - //virtual Ref<SpatialEditorGizmo> create_spatial_gizmo(Spatial *p_spatial); - virtual String get_name() const { return "Path"; } + virtual String get_name() const { return "Path3D"; } bool has_main_screen() const { return false; } virtual void edit(Object *p_object); virtual bool handles(Object *p_object) const; @@ -116,8 +114,8 @@ public: bool is_handle_clicked() { return handle_clicked; } void set_handle_clicked(bool clicked) { handle_clicked = clicked; } - PathEditorPlugin(EditorNode *p_node); - ~PathEditorPlugin(); + Path3DEditorPlugin(EditorNode *p_node); + ~Path3DEditorPlugin(); }; #endif // PATH_EDITOR_PLUGIN_H diff --git a/editor/plugins/physical_bone_plugin.cpp b/editor/plugins/physical_bone_3d_editor_plugin.cpp index e0d48afeef..6d38f7f318 100644 --- a/editor/plugins/physical_bone_plugin.cpp +++ b/editor/plugins/physical_bone_3d_editor_plugin.cpp @@ -1,5 +1,5 @@ /*************************************************************************/ -/* physical_bone_plugin.cpp */ +/* physical_bone_3d_editor_plugin.cpp */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ @@ -28,32 +28,33 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#include "physical_bone_plugin.h" -#include "editor/plugins/spatial_editor_plugin.h" -#include "scene/3d/physics_body.h" +#include "physical_bone_3d_editor_plugin.h" -void PhysicalBoneEditor::_bind_methods() { +#include "editor/plugins/node_3d_editor_plugin.h" +#include "scene/3d/physics_body_3d.h" + +void PhysicalBone3DEditor::_bind_methods() { } -void PhysicalBoneEditor::_on_toggle_button_transform_joint(bool p_is_pressed) { +void PhysicalBone3DEditor::_on_toggle_button_transform_joint(bool p_is_pressed) { _set_move_joint(); } -void PhysicalBoneEditor::_set_move_joint() { +void PhysicalBone3DEditor::_set_move_joint() { if (selected) { selected->_set_gizmo_move_joint(button_transform_joint->is_pressed()); } } -PhysicalBoneEditor::PhysicalBoneEditor(EditorNode *p_editor) : +PhysicalBone3DEditor::PhysicalBone3DEditor(EditorNode *p_editor) : editor(p_editor), - selected(NULL) { + selected(nullptr) { spatial_editor_hb = memnew(HBoxContainer); spatial_editor_hb->set_h_size_flags(Control::SIZE_EXPAND_FILL); spatial_editor_hb->set_alignment(BoxContainer::ALIGN_BEGIN); - SpatialEditor::get_singleton()->add_control_to_menu_panel(spatial_editor_hb); + Node3DEditor::get_singleton()->add_control_to_menu_panel(spatial_editor_hb); spatial_editor_hb->add_child(memnew(VSeparator)); @@ -61,16 +62,16 @@ PhysicalBoneEditor::PhysicalBoneEditor(EditorNode *p_editor) : spatial_editor_hb->add_child(button_transform_joint); button_transform_joint->set_text(TTR("Move Joint")); - button_transform_joint->set_icon(SpatialEditor::get_singleton()->get_icon("PhysicalBone", "EditorIcons")); + button_transform_joint->set_icon(Node3DEditor::get_singleton()->get_theme_icon("PhysicalBone3D", "EditorIcons")); button_transform_joint->set_toggle_mode(true); - button_transform_joint->connect("toggled", callable_mp(this, &PhysicalBoneEditor::_on_toggle_button_transform_joint)); + button_transform_joint->connect("toggled", callable_mp(this, &PhysicalBone3DEditor::_on_toggle_button_transform_joint)); hide(); } -PhysicalBoneEditor::~PhysicalBoneEditor() {} +PhysicalBone3DEditor::~PhysicalBone3DEditor() {} -void PhysicalBoneEditor::set_selected(PhysicalBone *p_pb) { +void PhysicalBone3DEditor::set_selected(PhysicalBone3D *p_pb) { button_transform_joint->set_pressed(false); @@ -79,33 +80,33 @@ void PhysicalBoneEditor::set_selected(PhysicalBone *p_pb) { _set_move_joint(); } -void PhysicalBoneEditor::hide() { +void PhysicalBone3DEditor::hide() { spatial_editor_hb->hide(); } -void PhysicalBoneEditor::show() { +void PhysicalBone3DEditor::show() { spatial_editor_hb->show(); } -PhysicalBonePlugin::PhysicalBonePlugin(EditorNode *p_editor) : +PhysicalBone3DEditorPlugin::PhysicalBone3DEditorPlugin(EditorNode *p_editor) : editor(p_editor), - selected(NULL), + selected(nullptr), physical_bone_editor(editor) {} -void PhysicalBonePlugin::make_visible(bool p_visible) { +void PhysicalBone3DEditorPlugin::make_visible(bool p_visible) { if (p_visible) { physical_bone_editor.show(); } else { physical_bone_editor.hide(); - physical_bone_editor.set_selected(NULL); - selected = NULL; + physical_bone_editor.set_selected(nullptr); + selected = nullptr; } } -void PhysicalBonePlugin::edit(Object *p_node) { - selected = static_cast<PhysicalBone *>(p_node); // Trust it +void PhysicalBone3DEditorPlugin::edit(Object *p_node) { + selected = static_cast<PhysicalBone3D *>(p_node); // Trust it ERR_FAIL_COND(!selected); physical_bone_editor.set_selected(selected); diff --git a/editor/plugins/physical_bone_plugin.h b/editor/plugins/physical_bone_3d_editor_plugin.h index 459a67db05..74932710d6 100644 --- a/editor/plugins/physical_bone_plugin.h +++ b/editor/plugins/physical_bone_3d_editor_plugin.h @@ -1,5 +1,5 @@ /*************************************************************************/ -/* physical_bone_plugin.h */ +/* physical_bone_3d_editor_plugin.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ @@ -33,14 +33,14 @@ #include "editor/editor_node.h" -class PhysicalBoneEditor : public Object { - GDCLASS(PhysicalBoneEditor, Object); +class PhysicalBone3DEditor : public Object { + GDCLASS(PhysicalBone3DEditor, Object); EditorNode *editor; HBoxContainer *spatial_editor_hb; ToolButton *button_transform_joint; - PhysicalBone *selected; + PhysicalBone3D *selected; protected: static void _bind_methods(); @@ -50,29 +50,29 @@ private: void _set_move_joint(); public: - PhysicalBoneEditor(EditorNode *p_editor); - ~PhysicalBoneEditor(); + PhysicalBone3DEditor(EditorNode *p_editor); + ~PhysicalBone3DEditor(); - void set_selected(PhysicalBone *p_pb); + void set_selected(PhysicalBone3D *p_pb); void hide(); void show(); }; -class PhysicalBonePlugin : public EditorPlugin { - GDCLASS(PhysicalBonePlugin, EditorPlugin); +class PhysicalBone3DEditorPlugin : public EditorPlugin { + GDCLASS(PhysicalBone3DEditorPlugin, EditorPlugin); EditorNode *editor; - PhysicalBone *selected; - PhysicalBoneEditor physical_bone_editor; + PhysicalBone3D *selected; + PhysicalBone3DEditor physical_bone_editor; public: - virtual String get_name() const { return "PhysicalBone"; } - virtual bool handles(Object *p_object) const { return p_object->is_class("PhysicalBone"); } + virtual String get_name() const { return "PhysicalBone3D"; } + virtual bool handles(Object *p_object) const { return p_object->is_class("PhysicalBone3D"); } virtual void make_visible(bool p_visible); virtual void edit(Object *p_node); - PhysicalBonePlugin(EditorNode *p_editor); + PhysicalBone3DEditorPlugin(EditorNode *p_editor); }; #endif diff --git a/editor/plugins/polygon_2d_editor_plugin.cpp b/editor/plugins/polygon_2d_editor_plugin.cpp index 8c115586a4..1f7a5b9968 100644 --- a/editor/plugins/polygon_2d_editor_plugin.cpp +++ b/editor/plugins/polygon_2d_editor_plugin.cpp @@ -31,8 +31,8 @@ #include "polygon_2d_editor_plugin.h" #include "canvas_item_editor_plugin.h" +#include "core/input/input_filter.h" #include "core/os/file_access.h" -#include "core/os/input.h" #include "core/os/keyboard.h" #include "editor/editor_scale.h" #include "editor/editor_settings.h" @@ -70,28 +70,28 @@ void Polygon2DEditor::_notification(int p_what) { case NOTIFICATION_ENTER_TREE: case NOTIFICATION_THEME_CHANGED: { - uv_edit_draw->add_style_override("panel", get_stylebox("bg", "Tree")); - bone_scroll->add_style_override("bg", get_stylebox("bg", "Tree")); + uv_edit_draw->add_theme_style_override("panel", get_theme_stylebox("bg", "Tree")); + bone_scroll->add_theme_style_override("bg", get_theme_stylebox("bg", "Tree")); } break; case NOTIFICATION_READY: { - button_uv->set_icon(get_icon("Uv", "EditorIcons")); + button_uv->set_icon(get_theme_icon("Uv", "EditorIcons")); - uv_button[UV_MODE_CREATE]->set_icon(get_icon("Edit", "EditorIcons")); - uv_button[UV_MODE_CREATE_INTERNAL]->set_icon(get_icon("EditInternal", "EditorIcons")); - uv_button[UV_MODE_REMOVE_INTERNAL]->set_icon(get_icon("RemoveInternal", "EditorIcons")); - uv_button[UV_MODE_EDIT_POINT]->set_icon(get_icon("ToolSelect", "EditorIcons")); - uv_button[UV_MODE_MOVE]->set_icon(get_icon("ToolMove", "EditorIcons")); - uv_button[UV_MODE_ROTATE]->set_icon(get_icon("ToolRotate", "EditorIcons")); - uv_button[UV_MODE_SCALE]->set_icon(get_icon("ToolScale", "EditorIcons")); - uv_button[UV_MODE_ADD_POLYGON]->set_icon(get_icon("Edit", "EditorIcons")); - uv_button[UV_MODE_REMOVE_POLYGON]->set_icon(get_icon("Close", "EditorIcons")); - uv_button[UV_MODE_PAINT_WEIGHT]->set_icon(get_icon("PaintVertex", "EditorIcons")); - uv_button[UV_MODE_CLEAR_WEIGHT]->set_icon(get_icon("UnpaintVertex", "EditorIcons")); + uv_button[UV_MODE_CREATE]->set_icon(get_theme_icon("Edit", "EditorIcons")); + uv_button[UV_MODE_CREATE_INTERNAL]->set_icon(get_theme_icon("EditInternal", "EditorIcons")); + uv_button[UV_MODE_REMOVE_INTERNAL]->set_icon(get_theme_icon("RemoveInternal", "EditorIcons")); + uv_button[UV_MODE_EDIT_POINT]->set_icon(get_theme_icon("ToolSelect", "EditorIcons")); + uv_button[UV_MODE_MOVE]->set_icon(get_theme_icon("ToolMove", "EditorIcons")); + uv_button[UV_MODE_ROTATE]->set_icon(get_theme_icon("ToolRotate", "EditorIcons")); + uv_button[UV_MODE_SCALE]->set_icon(get_theme_icon("ToolScale", "EditorIcons")); + uv_button[UV_MODE_ADD_POLYGON]->set_icon(get_theme_icon("Edit", "EditorIcons")); + uv_button[UV_MODE_REMOVE_POLYGON]->set_icon(get_theme_icon("Close", "EditorIcons")); + uv_button[UV_MODE_PAINT_WEIGHT]->set_icon(get_theme_icon("PaintVertex", "EditorIcons")); + uv_button[UV_MODE_CLEAR_WEIGHT]->set_icon(get_theme_icon("UnpaintVertex", "EditorIcons")); - b_snap_grid->set_icon(get_icon("Grid", "EditorIcons")); - b_snap_enable->set_icon(get_icon("SnapGrid", "EditorIcons")); - uv_icon_zoom->set_texture(get_icon("Zoom", "EditorIcons")); + b_snap_grid->set_icon(get_theme_icon("Grid", "EditorIcons")); + b_snap_enable->set_icon(get_theme_icon("SnapGrid", "EditorIcons")); + uv_icon_zoom->set_texture(get_theme_icon("Zoom", "EditorIcons")); uv_vscroll->set_anchors_and_margins_preset(PRESET_RIGHT_WIDE); uv_hscroll->set_anchors_and_margins_preset(PRESET_BOTTOM_WIDE); @@ -107,10 +107,10 @@ void Polygon2DEditor::_notification(int p_what) { void Polygon2DEditor::_sync_bones() { - Skeleton2D *skeleton = NULL; + Skeleton2D *skeleton = nullptr; if (!node->has_node(node->get_skeleton())) { error->set_text(TTR("The skeleton property of the Polygon2D does not point to a Skeleton2D node")); - error->popup_centered_minsize(); + error->popup_centered(); } else { Node *sn = node->get_node(node->get_skeleton()); skeleton = Object::cast_to<Skeleton2D>(sn); @@ -121,7 +121,7 @@ void Polygon2DEditor::_sync_bones() { if (!skeleton) { error->set_text(TTR("The skeleton property of the Polygon2D does not point to a Skeleton2D node")); - error->popup_centered_minsize(); + error->popup_centered(); } else { for (int i = 0; i < skeleton->get_bone_count(); i++) { NodePath path = skeleton->get_path_to(skeleton->get_bone(i)); @@ -275,7 +275,7 @@ void Polygon2DEditor::_uv_edit_mode_select(int p_mode) { void Polygon2DEditor::_uv_edit_popup_hide() { - EditorSettings::get_singleton()->set("interface/dialogs/uv_editor_bounds", uv_edit->get_rect()); + EditorSettings::get_singleton()->set("interface/dialogs/uv_editor_bounds", Rect2(uv_edit->get_position(), uv_edit->get_size())); _cancel_editing(); } @@ -289,7 +289,7 @@ void Polygon2DEditor::_menu_option(int p_option) { if (node->get_texture().is_null()) { error->set_text(TTR("No texture in this polygon.\nSet a texture to be able to edit UV.")); - error->popup_centered_minsize(); + error->popup_centered(); return; } @@ -351,7 +351,7 @@ void Polygon2DEditor::_menu_option(int p_option) { } break; case UVEDIT_GRID_SETTINGS: { - grid_settings->popup_centered_minsize(); + grid_settings->popup_centered(); } break; default: { @@ -683,7 +683,7 @@ void Polygon2DEditor::_uv_input(const Ref<InputEvent> &p_input) { //close if (polygon_create.size() < 3) { error->set_text(TTR("Invalid Polygon (need 3 different vertices)")); - error->popup_centered_minsize(); + error->popup_centered(); } else { Array polygons = node->get_polygons(); polygons = polygons.duplicate(); //copy because its a reference @@ -810,7 +810,7 @@ void Polygon2DEditor::_uv_input(const Ref<InputEvent> &p_input) { if (mm.is_valid()) { - if ((mm->get_button_mask() & BUTTON_MASK_MIDDLE) || Input::get_singleton()->is_key_pressed(KEY_SPACE)) { + if ((mm->get_button_mask() & BUTTON_MASK_MIDDLE) || InputFilter::get_singleton()->is_key_pressed(KEY_SPACE)) { Vector2 drag(mm->get_relative().x, mm->get_relative().y); uv_hscroll->set_value(uv_hscroll->get_value() - drag.x); @@ -990,9 +990,9 @@ void Polygon2DEditor::_uv_draw() { mtx.elements[2] = -uv_draw_ofs; mtx.scale_basis(Vector2(uv_draw_zoom, uv_draw_zoom)); - VS::get_singleton()->canvas_item_add_set_transform(uv_edit_draw->get_canvas_item(), mtx); + RS::get_singleton()->canvas_item_add_set_transform(uv_edit_draw->get_canvas_item(), mtx); uv_edit_draw->draw_texture(base_tex, Point2()); - VS::get_singleton()->canvas_item_add_set_transform(uv_edit_draw->get_canvas_item(), Transform2D()); + RS::get_singleton()->canvas_item_add_set_transform(uv_edit_draw->get_canvas_item(), Transform2D()); if (snap_show_grid) { Color grid_color = Color(1.0, 1.0, 1.0, 0.15); @@ -1031,7 +1031,7 @@ void Polygon2DEditor::_uv_draw() { uvs = node->get_polygon(); } - const float *weight_r; + const float *weight_r = nullptr; if (uv_edit_mode[3]->is_pressed()) { int bone_selected = -1; @@ -1044,13 +1044,12 @@ void Polygon2DEditor::_uv_draw() { } if (bone_selected != -1 && node->get_bone_weights(bone_selected).size() == uvs.size()) { - weight_r = node->get_bone_weights(bone_selected).ptr(); } } // All UV points are sharp, so use the sharp handle icon - Ref<Texture2D> handle = get_icon("EditorPathSharpHandle", "EditorIcons"); + Ref<Texture2D> handle = get_theme_icon("EditorPathSharpHandle", "EditorIcons"); Color poly_line_color = Color(0.9, 0.5, 0.5); if (polygons.size() || polygon_create.size()) { @@ -1250,7 +1249,7 @@ Vector2 Polygon2DEditor::snap_point(Vector2 p_target) const { Polygon2DEditor::Polygon2DEditor(EditorNode *p_editor) : AbstractPolygon2DEditor(p_editor) { - node = NULL; + node = nullptr; snap_offset = EditorSettings::get_singleton()->get_project_metadata("polygon_2d_uv_editor", "snap_offset", Vector2()); snap_step = EditorSettings::get_singleton()->get_project_metadata("polygon_2d_uv_editor", "snap_step", Vector2(10, 10)); use_snap = EditorSettings::get_singleton()->get_project_metadata("polygon_2d_uv_editor", "snap_enabled", false); @@ -1265,8 +1264,7 @@ Polygon2DEditor::Polygon2DEditor(EditorNode *p_editor) : uv_edit = memnew(AcceptDialog); add_child(uv_edit); uv_edit->set_title(TTR("Polygon 2D UV Editor")); - uv_edit->set_resizable(true); - uv_edit->connect("popup_hide", callable_mp(this, &Polygon2DEditor::_uv_edit_popup_hide)); + uv_edit->connect("cancelled", callable_mp(this, &Polygon2DEditor::_uv_edit_popup_hide)); VBoxContainer *uv_main_vb = memnew(VBoxContainer); uv_edit->add_child(uv_main_vb); diff --git a/editor/plugins/resource_preloader_editor_plugin.cpp b/editor/plugins/resource_preloader_editor_plugin.cpp index feef505acc..852feeb675 100644 --- a/editor/plugins/resource_preloader_editor_plugin.cpp +++ b/editor/plugins/resource_preloader_editor_plugin.cpp @@ -41,7 +41,7 @@ void ResourcePreloaderEditor::_gui_input(Ref<InputEvent> p_event) { void ResourcePreloaderEditor::_notification(int p_what) { if (p_what == NOTIFICATION_ENTER_TREE) { - load->set_icon(get_icon("Folder", "EditorIcons")); + load->set_icon(get_theme_icon("Folder", "EditorIcons")); } if (p_what == NOTIFICATION_READY) { @@ -67,7 +67,7 @@ void ResourcePreloaderEditor::_files_load_request(const Vector<String> &p_paths) dialog->set_title(TTR("Error!")); //dialog->get_cancel()->set_text("Close"); dialog->get_ok()->set_text(TTR("Close")); - dialog->popup_centered_minsize(); + dialog->popup_centered(); return; ///beh should show an error i guess } @@ -98,7 +98,7 @@ void ResourcePreloaderEditor::_load_pressed() { for (int i = 0; i < extensions.size(); i++) file->add_filter("*." + extensions[i]); - file->set_mode(EditorFileDialog::MODE_OPEN_FILES); + file->set_file_mode(EditorFileDialog::FILE_MODE_OPEN_FILES); file->popup_centered_ratio(); } @@ -152,7 +152,7 @@ void ResourcePreloaderEditor::_paste_pressed() { dialog->set_text(TTR("Resource clipboard is empty!")); dialog->set_title(TTR("Error!")); dialog->get_ok()->set_text(TTR("Close")); - dialog->popup_centered_minsize(); + dialog->popup_centered(); return; ///beh should show an error i guess } @@ -181,7 +181,7 @@ void ResourcePreloaderEditor::_update_library() { tree->clear(); tree->set_hide_root(true); - TreeItem *root = tree->create_item(NULL); + TreeItem *root = tree->create_item(nullptr); List<StringName> rnames; preloader->get_resource_list(&rnames); @@ -215,11 +215,11 @@ void ResourcePreloaderEditor::_update_library() { ti->set_selectable(1, false); if (type == "PackedScene") { - ti->add_button(1, get_icon("InstanceOptions", "EditorIcons"), BUTTON_OPEN_SCENE, false, TTR("Open in Editor")); + ti->add_button(1, get_theme_icon("InstanceOptions", "EditorIcons"), BUTTON_OPEN_SCENE, false, TTR("Open in Editor")); } else { - ti->add_button(1, get_icon("Load", "EditorIcons"), BUTTON_EDIT_RESOURCE, false, TTR("Open in Editor")); + ti->add_button(1, get_theme_icon("Load", "EditorIcons"), BUTTON_EDIT_RESOURCE, false, TTR("Open in Editor")); } - ti->add_button(1, get_icon("Remove", "EditorIcons"), BUTTON_REMOVE, false, TTR("Remove")); + ti->add_button(1, get_theme_icon("Remove", "EditorIcons"), BUTTON_REMOVE, false, TTR("Remove")); } //player->add_resource("default",resource); diff --git a/editor/plugins/root_motion_editor_plugin.cpp b/editor/plugins/root_motion_editor_plugin.cpp index d932305c63..a7120c5d68 100644 --- a/editor/plugins/root_motion_editor_plugin.cpp +++ b/editor/plugins/root_motion_editor_plugin.cpp @@ -30,7 +30,7 @@ #include "root_motion_editor_plugin.h" #include "editor/editor_node.h" -#include "scene/main/viewport.h" +#include "scene/main/window.h" void EditorPropertyRootMotion::_confirmed() { @@ -88,7 +88,7 @@ void EditorPropertyRootMotion::_node_assign() { for (Set<String>::Element *E = paths.front(); E; E = E->next()) { NodePath path = E->get(); - TreeItem *ti = NULL; + TreeItem *ti = nullptr; String accum; for (int i = 0; i < path.get_name_count(); i++) { String name = path.get_name(i); @@ -117,7 +117,7 @@ void EditorPropertyRootMotion::_node_assign() { } } - Node *node = NULL; + Node *node = nullptr; if (base->has_node(accum)) { node = base->get_node(accum); } @@ -128,7 +128,7 @@ void EditorPropertyRootMotion::_node_assign() { String concat = path.get_concatenated_subnames(); - Skeleton *skeleton = Object::cast_to<Skeleton>(node); + Skeleton3D *skeleton = Object::cast_to<Skeleton3D>(node); if (skeleton && skeleton->find_bone(concat) != -1) { //path in skeleton const String &bone = concat; @@ -152,7 +152,7 @@ void EditorPropertyRootMotion::_node_assign() { ti->set_text(0, F->get()); ti->set_selectable(0, true); ti->set_editable(0, false); - ti->set_icon(0, get_icon("BoneAttachment", "EditorIcons")); + ti->set_icon(0, get_theme_icon("BoneAttachment3D", "EditorIcons")); ti->set_metadata(0, accum); } else { ti = parenthood[accum]; @@ -161,7 +161,7 @@ void EditorPropertyRootMotion::_node_assign() { ti->set_selectable(0, true); ti->set_text(0, concat); - ti->set_icon(0, get_icon("BoneAttachment", "EditorIcons")); + ti->set_icon(0, get_theme_icon("BoneAttachment3D", "EditorIcons")); ti->set_metadata(0, path); if (path == current) { ti->select(0); @@ -212,7 +212,7 @@ void EditorPropertyRootMotion::update_property() { } assign->set_flat(true); - Node *base_node = NULL; + Node *base_node = nullptr; if (base_hint != NodePath()) { if (get_tree()->get_root()->has_node(base_hint)) { base_node = get_tree()->get_root()->get_node(base_hint); @@ -242,7 +242,7 @@ void EditorPropertyRootMotion::setup(const NodePath &p_base_hint) { void EditorPropertyRootMotion::_notification(int p_what) { if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED) { - Ref<Texture2D> t = get_icon("Clear", "EditorIcons"); + Ref<Texture2D> t = get_theme_icon("Clear", "EditorIcons"); clear->set_icon(t); } } @@ -288,7 +288,7 @@ void EditorInspectorRootMotionPlugin::parse_begin(Object *p_object) { //do none } -bool EditorInspectorRootMotionPlugin::parse_property(Object *p_object, Variant::Type p_type, const String &p_path, PropertyHint p_hint, const String &p_hint_text, int p_usage) { +bool EditorInspectorRootMotionPlugin::parse_property(Object *p_object, Variant::Type p_type, const String &p_path, PropertyHint p_hint, const String &p_hint_text, int p_usage, bool p_wide) { if (p_path == "root_motion_track" && p_object->is_class("AnimationTree") && p_type == Variant::NODE_PATH) { EditorPropertyRootMotion *editor = memnew(EditorPropertyRootMotion); diff --git a/editor/plugins/root_motion_editor_plugin.h b/editor/plugins/root_motion_editor_plugin.h index 8a7691de5d..f72ad1ec05 100644 --- a/editor/plugins/root_motion_editor_plugin.h +++ b/editor/plugins/root_motion_editor_plugin.h @@ -65,7 +65,7 @@ class EditorInspectorRootMotionPlugin : public EditorInspectorPlugin { public: virtual bool can_handle(Object *p_object); virtual void parse_begin(Object *p_object); - virtual bool parse_property(Object *p_object, Variant::Type p_type, const String &p_path, PropertyHint p_hint, const String &p_hint_text, int p_usage); + virtual bool parse_property(Object *p_object, Variant::Type p_type, const String &p_path, PropertyHint p_hint, const String &p_hint_text, int p_usage, bool p_wide = false); virtual void parse_end(); }; diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index b3f78b5406..2c831979de 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -30,9 +30,9 @@ #include "script_editor_plugin.h" +#include "core/input/input_filter.h" #include "core/io/resource_loader.h" #include "core/os/file_access.h" -#include "core/os/input.h" #include "core/os/keyboard.h" #include "core/os/os.h" #include "core/project_settings.h" @@ -45,9 +45,10 @@ #include "editor/find_in_files.h" #include "editor/node_dock.h" #include "editor/plugins/shader_editor_plugin.h" -#include "scene/main/viewport.h" +#include "scene/main/window.h" #include "scene/scene_string_names.h" #include "script_text_editor.h" +#include "servers/display_server.h" #include "text_editor.h" /*** SCRIPT EDITOR ****/ @@ -192,7 +193,7 @@ void ScriptEditorQuickOpen::_update_search() { } } - get_ok()->set_disabled(root->get_children() == NULL); + get_ok()->set_disabled(root->get_children() == nullptr); } void ScriptEditorQuickOpen::_confirmed() { @@ -215,8 +216,8 @@ void ScriptEditorQuickOpen::_notification(int p_what) { search_box->set_clear_button_enabled(true); [[fallthrough]]; } - case NOTIFICATION_THEME_CHANGED: { - search_box->set_right_icon(get_icon("Search", "EditorIcons")); + case NOTIFICATION_VISIBILITY_CHANGED: { + search_box->set_right_icon(search_options->get_theme_icon("Search", "EditorIcons")); } break; case NOTIFICATION_EXIT_TREE: { disconnect("confirmed", callable_mp(this, &ScriptEditorQuickOpen::_confirmed)); @@ -246,12 +247,12 @@ ScriptEditorQuickOpen::ScriptEditorQuickOpen() { search_options->connect("item_activated", callable_mp(this, &ScriptEditorQuickOpen::_confirmed)); search_options->set_hide_root(true); search_options->set_hide_folding(true); - search_options->add_constant_override("draw_guides", 1); + search_options->add_theme_constant_override("draw_guides", 1); } ///////////////////////////////// -ScriptEditor *ScriptEditor::script_editor = NULL; +ScriptEditor *ScriptEditor::script_editor = nullptr; /*** SCRIPT EDITOR ******/ @@ -320,7 +321,7 @@ void ScriptEditor::_set_execution(REF p_script, int p_line) { if (!se) continue; - if ((script != NULL && se->get_edited_resource() == p_script) || se->get_edited_resource()->get_path() == script->get_path()) { + if ((script != nullptr && se->get_edited_resource() == p_script) || se->get_edited_resource()->get_path() == script->get_path()) { se->set_executing_line(p_line); } } @@ -336,7 +337,7 @@ void ScriptEditor::_clear_execution(REF p_script) { if (!se) continue; - if ((script != NULL && se->get_edited_resource() == p_script) || se->get_edited_resource()->get_path() == script->get_path()) { + if ((script != nullptr && se->get_edited_resource() == p_script) || se->get_edited_resource()->get_path() == script->get_path()) { se->clear_executing_line(); } } @@ -347,7 +348,7 @@ ScriptEditorBase *ScriptEditor::_get_current_editor() const { int selected = tab_container->get_current_tab(); if (selected < 0 || selected >= tab_container->get_child_count()) - return NULL; + return nullptr; return Object::cast_to<ScriptEditorBase>(tab_container->get_child(selected)); } @@ -428,12 +429,12 @@ void ScriptEditor::_go_to_tab(int p_idx) { if (Object::cast_to<ScriptEditorBase>(c)) { script_name_label->set_text(Object::cast_to<ScriptEditorBase>(c)->get_name()); - script_icon->set_texture(Object::cast_to<ScriptEditorBase>(c)->get_icon()); + script_icon->set_texture(Object::cast_to<ScriptEditorBase>(c)->get_theme_icon()); if (is_visible_in_tree()) Object::cast_to<ScriptEditorBase>(c)->ensure_focus(); Ref<Script> script = Object::cast_to<ScriptEditorBase>(c)->get_edited_resource(); - if (script != NULL) { + if (script != nullptr) { notify_script_changed(script); } @@ -442,7 +443,7 @@ void ScriptEditor::_go_to_tab(int p_idx) { if (Object::cast_to<EditorHelp>(c)) { script_name_label->set_text(Object::cast_to<EditorHelp>(c)->get_class()); - script_icon->set_texture(get_icon("Help", "EditorIcons")); + script_icon->set_texture(get_theme_icon("Help", "EditorIcons")); if (is_visible_in_tree()) Object::cast_to<EditorHelp>(c)->set_focused(); } @@ -556,7 +557,7 @@ void ScriptEditor::_open_recent_script(int p_idx) { void ScriptEditor::_show_error_dialog(String p_path) { error_dialog->set_text(vformat(TTR("Can't open '%s'. The file could have been moved or deleted."), p_path)); - error_dialog->popup_centered_minsize(); + error_dialog->popup_centered(); } void ScriptEditor::_close_tab(int p_idx, bool p_save, bool p_history_back) { @@ -574,7 +575,7 @@ void ScriptEditor::_close_tab(int p_idx, bool p_save, bool p_history_back) { } Ref<Script> script = current->get_edited_resource(); - if (script != NULL) { + if (script != nullptr) { previous_scripts.push_back(script->get_path()); notify_script_close(script); } @@ -651,7 +652,7 @@ void ScriptEditor::_close_docs_tab() { void ScriptEditor::_copy_script_path() { ScriptEditorBase *se = _get_current_editor(); RES script = se->get_edited_resource(); - OS::get_singleton()->set_clipboard(script->get_path()); + DisplayServer::get_singleton()->clipboard_set(script->get_path()); } void ScriptEditor::_close_other_tabs() { @@ -703,7 +704,7 @@ void ScriptEditor::_close_all_tabs() { void ScriptEditor::_ask_close_current_unsaved_tab(ScriptEditorBase *current) { erase_tab_confirm->set_text(TTR("Close and save changes?") + "\n\"" + current->get_name() + "\""); - erase_tab_confirm->popup_centered_minsize(); + erase_tab_confirm->popup_centered(); } void ScriptEditor::_resave_scripts(const String &p_str) { @@ -736,7 +737,7 @@ void ScriptEditor::_resave_scripts(const String &p_str) { } Ref<TextFile> text_file = script; - if (text_file != NULL) { + if (text_file != nullptr) { se->apply_code(); _save_text_file(text_file, text_file->get_path()); break; @@ -774,7 +775,7 @@ void ScriptEditor::_reload_scripts() { } Ref<Script> script = edited_res; - if (script != NULL) { + if (script != nullptr) { Ref<Script> rel_script = ResourceLoader::load(script->get_path(), script->get_class(), true); ERR_CONTINUE(!rel_script.is_valid()); script->set_source_code(rel_script->get_source_code()); @@ -783,7 +784,7 @@ void ScriptEditor::_reload_scripts() { } Ref<TextFile> text_file = edited_res; - if (text_file != NULL) { + if (text_file != nullptr) { Error err; Ref<TextFile> rel_text_file = _load_text_file(text_file->get_path(), &err); ERR_CONTINUE(!rel_text_file.is_valid()); @@ -960,9 +961,9 @@ Ref<Script> ScriptEditor::_get_current_script() { if (current) { Ref<Script> script = current->get_edited_resource(); - return script != NULL ? script : NULL; + return script != nullptr ? script : nullptr; } else { - return NULL; + return nullptr; } } @@ -995,7 +996,7 @@ void ScriptEditor::_menu_option(int p_option) { script_create_dialog->popup_centered(); } break; case FILE_NEW_TEXTFILE: { - file_dialog->set_mode(EditorFileDialog::MODE_SAVE_FILE); + file_dialog->set_file_mode(EditorFileDialog::FILE_MODE_SAVE_FILE); file_dialog->set_access(EditorFileDialog::ACCESS_FILESYSTEM); file_dialog_option = FILE_NEW_TEXTFILE; @@ -1004,7 +1005,7 @@ void ScriptEditor::_menu_option(int p_option) { file_dialog->set_title(TTR("New Text File...")); } break; case FILE_OPEN: { - file_dialog->set_mode(EditorFileDialog::MODE_OPEN_FILE); + file_dialog->set_file_mode(EditorFileDialog::FILE_MODE_OPEN_FILE); file_dialog->set_access(EditorFileDialog::ACCESS_FILESYSTEM); file_dialog_option = FILE_OPEN; @@ -1092,11 +1093,6 @@ void ScriptEditor::_menu_option(int p_option) { OS::get_singleton()->shell_open("https://docs.godotengine.org/"); } break; - case REQUEST_DOCS: { - - OS::get_singleton()->shell_open("https://github.com/godotengine/godot-docs/issues/new"); - } break; - case WINDOW_NEXT: { _history_forward(); @@ -1144,7 +1140,7 @@ void ScriptEditor::_menu_option(int p_option) { } Ref<TextFile> text_file = current->get_edited_resource(); - if (text_file != NULL) { + if (text_file != nullptr) { current->apply_code(); _save_text_file(text_file, text_file->get_path()); break; @@ -1168,8 +1164,8 @@ void ScriptEditor::_menu_option(int p_option) { } Ref<TextFile> text_file = current->get_edited_resource(); - if (text_file != NULL) { - file_dialog->set_mode(EditorFileDialog::MODE_SAVE_FILE); + if (text_file != nullptr) { + file_dialog->set_file_mode(EditorFileDialog::FILE_MODE_SAVE_FILE); file_dialog->set_access(EditorFileDialog::ACCESS_FILESYSTEM); file_dialog_option = FILE_SAVE_AS; @@ -1197,7 +1193,7 @@ void ScriptEditor::_menu_option(int p_option) { case FILE_RUN: { Ref<Script> scr = current->get_edited_resource(); - if (scr == NULL || scr.is_null()) { + if (scr == nullptr || scr.is_null()) { EditorNode::get_singleton()->show_warning(TTR("Can't obtain the script for running.")); break; } @@ -1247,7 +1243,7 @@ void ScriptEditor::_menu_option(int p_option) { file_system_dock->navigate_to_path(path); // Ensure that the FileSystem dock is visible. TabContainer *tab_container = (TabContainer *)file_system_dock->get_parent_control(); - tab_container->set_current_tab(file_system_dock->get_position_in_parent()); + tab_container->set_current_tab(file_system_dock->get_index()); } } break; case CLOSE_DOCS: { @@ -1335,7 +1331,7 @@ void ScriptEditor::_menu_option(int p_option) { void ScriptEditor::_theme_option(int p_option) { switch (p_option) { case THEME_IMPORT: { - file_dialog->set_mode(EditorFileDialog::MODE_OPEN_FILE); + file_dialog->set_file_mode(EditorFileDialog::FILE_MODE_OPEN_FILE); file_dialog->set_access(EditorFileDialog::ACCESS_FILESYSTEM); file_dialog_option = THEME_IMPORT; file_dialog->clear_filters(); @@ -1360,7 +1356,7 @@ void ScriptEditor::_theme_option(int p_option) { } void ScriptEditor::_show_save_theme_as_dialog() { - file_dialog->set_mode(EditorFileDialog::MODE_SAVE_FILE); + file_dialog->set_file_mode(EditorFileDialog::FILE_MODE_SAVE_FILE); file_dialog->set_access(EditorFileDialog::ACCESS_FILESYSTEM); file_dialog_option = THEME_SAVE_AS; file_dialog->clear_filters(); @@ -1395,19 +1391,18 @@ void ScriptEditor::_notification(int p_what) { } case NOTIFICATION_THEME_CHANGED: { - help_search->set_icon(get_icon("HelpSearch", "EditorIcons")); - site_search->set_icon(get_icon("Instance", "EditorIcons")); - request_docs->set_icon(get_icon("Issue", "EditorIcons")); + help_search->set_icon(get_theme_icon("HelpSearch", "EditorIcons")); + site_search->set_icon(get_theme_icon("Instance", "EditorIcons")); - script_forward->set_icon(get_icon("Forward", "EditorIcons")); - script_back->set_icon(get_icon("Back", "EditorIcons")); + script_forward->set_icon(get_theme_icon("Forward", "EditorIcons")); + script_back->set_icon(get_theme_icon("Back", "EditorIcons")); - members_overview_alphabeta_sort_button->set_icon(get_icon("Sort", "EditorIcons")); + members_overview_alphabeta_sort_button->set_icon(get_theme_icon("Sort", "EditorIcons")); - filter_scripts->set_right_icon(get_icon("Search", "EditorIcons")); - filter_methods->set_right_icon(get_icon("Search", "EditorIcons")); + filter_scripts->set_right_icon(get_theme_icon("Search", "EditorIcons")); + filter_methods->set_right_icon(get_theme_icon("Search", "EditorIcons")); - filename->add_style_override("normal", editor->get_gui_base()->get_stylebox("normal", "LineEdit")); + filename->add_theme_style_override("normal", editor->get_gui_base()->get_theme_stylebox("normal", "LineEdit")); recent_scripts->set_as_minsize(); } break; @@ -1424,7 +1419,7 @@ void ScriptEditor::_notification(int p_what) { editor->disconnect("stop_pressed", callable_mp(this, &ScriptEditor::_editor_stop)); } break; - case MainLoop::NOTIFICATION_WM_FOCUS_IN: { + case NOTIFICATION_WM_FOCUS_IN: { _test_script_times_on_disk(); _update_modified_scripts_for_external_editor(); @@ -1466,7 +1461,7 @@ void ScriptEditor::close_builtin_scripts_from_scene(const String &p_scene) { if (se) { Ref<Script> script = se->get_edited_resource(); - if (script == NULL || !script.is_valid()) + if (script == nullptr || !script.is_valid()) continue; if (script->get_path().find("::") != -1 && script->get_path().begins_with(p_scene)) { //is an internal script and belongs to scene being closed @@ -1499,7 +1494,7 @@ void ScriptEditor::get_breakpoints(List<String> *p_breakpoints) { continue; Ref<Script> script = se->get_edited_resource(); - if (script == NULL) { + if (script == nullptr) { continue; } @@ -1550,7 +1545,7 @@ void ScriptEditor::_help_overview_selected(int p_idx) { void ScriptEditor::_script_selected(int p_idx) { - grab_focus_block = !Input::get_singleton()->is_mouse_button_pressed(1); //amazing hack, simply amazing + grab_focus_block = !InputFilter::get_singleton()->is_mouse_button_pressed(1); //amazing hack, simply amazing _go_to_tab(script_list->get_item_metadata(p_idx)); grab_focus_block = false; @@ -1717,8 +1712,8 @@ void ScriptEditor::_update_script_colors() { bool highlight_current = EditorSettings::get_singleton()->get("text_editor/script_list/highlight_current_script"); int hist_size = EditorSettings::get_singleton()->get("text_editor/script_list/script_temperature_history_size"); - Color hot_color = get_color("accent_color", "Editor"); - Color cold_color = get_color("font_color", "Editor"); + Color hot_color = get_theme_color("accent_color", "Editor"); + Color cold_color = get_theme_color("font_color", "Editor"); for (int i = 0; i < script_list->get_item_count(); i++) { @@ -1775,7 +1770,7 @@ void ScriptEditor::_update_script_names() { ScriptEditorBase *se = Object::cast_to<ScriptEditorBase>(tab_container->get_child(i)); if (se) { - Ref<Texture2D> icon = se->get_icon(); + Ref<Texture2D> icon = se->get_theme_icon(); String path = se->get_edited_resource()->get_path(); bool built_in = !path.is_resource_file(); String name; @@ -1783,9 +1778,11 @@ void ScriptEditor::_update_script_names() { if (built_in) { name = path.get_file(); - String resource_name = se->get_edited_resource()->get_name(); + const String &resource_name = se->get_edited_resource()->get_name(); if (resource_name != "") { - name = name.substr(0, name.find("::", 0) + 2) + resource_name; + // If the built-in script has a custom resource name defined, + // display the built-in script name as follows: `ResourceName (scene_file.tscn)` + name = vformat("%s (%s)", resource_name, name.substr(0, name.find("::", 0))); } } else { @@ -1836,7 +1833,7 @@ void ScriptEditor::_update_script_names() { if (eh) { String name = eh->get_class(); - Ref<Texture2D> icon = get_icon("Help", "EditorIcons"); + Ref<Texture2D> icon = get_theme_icon("Help", "EditorIcons"); String tooltip = vformat(TTR("%s Class Reference"), name); _ScriptEditorItemData sd; @@ -1991,7 +1988,7 @@ bool ScriptEditor::edit(const RES &p_resource, int p_line, int p_col, bool p_gra const bool should_open = open_dominant || !EditorNode::get_singleton()->is_changing_scene(); - if (script != NULL && script->get_language()->overrides_external_editor()) { + if (script != nullptr && script->get_language()->overrides_external_editor()) { if (should_open) { Error err = script->get_language()->open_in_external_editor(script, p_line >= 0 ? p_line : 0, p_col); if (err != OK) @@ -2069,7 +2066,7 @@ bool ScriptEditor::edit(const RES &p_resource, int p_line, int p_col, bool p_gra if (!se) continue; - if ((script != NULL && se->get_edited_resource() == p_resource) || se->get_edited_resource()->get_path() == p_resource->get_path()) { + if ((script != nullptr && se->get_edited_resource() == p_resource) || se->get_edited_resource()->get_path() == p_resource->get_path()) { if (should_open) { if (tab_container->get_current_tab() != i) { @@ -2091,7 +2088,7 @@ bool ScriptEditor::edit(const RES &p_resource, int p_line, int p_col, bool p_gra // doesn't have it, make a new one - ScriptEditorBase *se = NULL; + ScriptEditorBase *se = nullptr; for (int i = script_editor_func_count - 1; i >= 0; i--) { se = script_editor_funcs[i](p_resource); @@ -2106,7 +2103,7 @@ bool ScriptEditor::edit(const RES &p_resource, int p_line, int p_col, bool p_gra SyntaxHighlighter *highlighter = syntax_highlighters_funcs[i](); se->add_syntax_highlighter(highlighter); - if (script != NULL && !highlighter_set) { + if (script != nullptr && !highlighter_set) { List<String> languages = highlighter->get_supported_languages(); if (languages.find(script->get_language()->get_name())) { se->set_syntax_highlighter(highlighter); @@ -2187,7 +2184,7 @@ void ScriptEditor::save_all_scripts() { if (edited_res->get_path() != "" && edited_res->get_path().find("local://") == -1 && edited_res->get_path().find("::") == -1) { Ref<TextFile> text_file = edited_res; - if (text_file != NULL) { + if (text_file != nullptr) { _save_text_file(text_file, text_file->get_path()); continue; } @@ -2346,12 +2343,12 @@ Variant ScriptEditor::get_drag_data_fw(const Point2 &p_point, Control *p_from) { ScriptEditorBase *se = Object::cast_to<ScriptEditorBase>(cur_node); if (se) { preview_name = se->get_name(); - preview_icon = se->get_icon(); + preview_icon = se->get_theme_icon(); } EditorHelp *eh = Object::cast_to<EditorHelp>(cur_node); if (eh) { preview_name = eh->get_class(); - preview_icon = get_icon("Help", "EditorIcons"); + preview_icon = get_theme_icon("Help", "EditorIcons"); } if (!preview_icon.is_null()) { @@ -2573,7 +2570,7 @@ void ScriptEditor::_make_script_list_context_menu() { context_menu->add_separator(); if (se) { Ref<Script> scr = se->get_edited_resource(); - if (scr != NULL) { + if (scr != nullptr) { context_menu->add_shortcut(ED_GET_SHORTCUT("script_editor/reload_script_soft"), FILE_TOOL_RELOAD_SOFT); if (!scr.is_null() && scr->is_tool()) { context_menu->add_shortcut(ED_GET_SHORTCUT("script_editor/run_file"), FILE_RUN); @@ -2830,7 +2827,7 @@ void ScriptEditor::_update_history_pos(int p_new_pos) { Object::cast_to<ScriptEditorBase>(n)->ensure_focus(); Ref<Script> script = Object::cast_to<ScriptEditorBase>(n)->get_edited_resource(); - if (script != NULL) { + if (script != nullptr) { notify_script_changed(script); } } @@ -2871,7 +2868,7 @@ Vector<Ref<Script>> ScriptEditor::get_open_scripts() const { continue; Ref<Script> script = se->get_edited_resource(); - if (script != NULL) { + if (script != nullptr) { out_scripts.push_back(script); } } @@ -2952,7 +2949,7 @@ void ScriptEditor::_on_find_in_files_requested(String text) { find_in_files_dialog->set_find_in_files_mode(FindInFilesDialog::SEARCH_MODE); find_in_files_dialog->set_search_text(text); - find_in_files_dialog->popup_centered_minsize(); + find_in_files_dialog->popup_centered(); } void ScriptEditor::_on_replace_in_files_requested(String text) { @@ -2960,7 +2957,7 @@ void ScriptEditor::_on_replace_in_files_requested(String text) { find_in_files_dialog->set_find_in_files_mode(FindInFilesDialog::REPLACE_MODE); find_in_files_dialog->set_search_text(text); find_in_files_dialog->set_replace_text(""); - find_in_files_dialog->popup_centered_minsize(); + find_in_files_dialog->popup_centered(); } void ScriptEditor::_on_find_in_files_result_selected(String fpath, int line_number, int begin, int end) { @@ -3111,7 +3108,6 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) { context_menu = memnew(PopupMenu); add_child(context_menu); context_menu->connect("id_pressed", callable_mp(this, &ScriptEditor::_menu_option)); - context_menu->set_hide_on_window_lose_focus(true); overview_vbox = memnew(VBoxContainer); overview_vbox->set_custom_minimum_size(Size2(0, 90)); @@ -3124,7 +3120,7 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) { filename = memnew(Label); filename->set_clip_text(true); filename->set_h_size_flags(SIZE_EXPAND_FILL); - filename->add_style_override("normal", EditorNode::get_singleton()->get_gui_base()->get_stylebox("normal", "LineEdit")); + filename->add_theme_style_override("normal", EditorNode::get_singleton()->get_gui_base()->get_theme_stylebox("normal", "LineEdit")); buttons_hbox->add_child(filename); members_overview_alphabeta_sort_button = memnew(ToolButton); @@ -3172,7 +3168,7 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) { menu_hb->add_child(file_menu); file_menu->set_text(TTR("File")); file_menu->set_switch_on_hover(true); - file_menu->get_popup()->set_hide_on_window_lose_focus(true); + file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/new", TTR("New Script...")), FILE_NEW); file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/new_textfile", TTR("New Text File...")), FILE_NEW_TEXTFILE); file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/open", TTR("Open...")), FILE_OPEN); @@ -3229,7 +3225,6 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) { menu_hb->add_child(script_search_menu); script_search_menu->set_text(TTR("Search")); script_search_menu->set_switch_on_hover(true); - script_search_menu->get_popup()->set_hide_on_window_lose_focus(true); script_search_menu->get_popup()->connect("id_pressed", callable_mp(this, &ScriptEditor::_menu_option)); MenuButton *debug_menu = memnew(MenuButton); @@ -3261,12 +3256,6 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) { menu_hb->add_child(site_search); site_search->set_tooltip(TTR("Open Godot online documentation.")); - request_docs = memnew(ToolButton); - request_docs->set_text(TTR("Request Docs")); - request_docs->connect("pressed", callable_mp(this, &ScriptEditor::_menu_option), varray(REQUEST_DOCS)); - menu_hb->add_child(request_docs); - request_docs->set_tooltip(TTR("Help improve the Godot documentation by giving feedback.")); - help_search = memnew(ToolButton); help_search->set_text(TTR("Search Help")); help_search->connect("pressed", callable_mp(this, &ScriptEditor::_menu_option), varray(SEARCH_HELP)); @@ -3291,7 +3280,7 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) { erase_tab_confirm = memnew(ConfirmationDialog); erase_tab_confirm->get_ok()->set_text(TTR("Save")); - erase_tab_confirm->add_button(TTR("Discard"), OS::get_singleton()->get_swap_ok_cancel(), "discard"); + erase_tab_confirm->add_button(TTR("Discard"), DisplayServer::get_singleton()->get_swap_ok_cancel(), "discard"); erase_tab_confirm->connect("confirmed", callable_mp(this, &ScriptEditor::_close_current_tab)); erase_tab_confirm->connect("custom_action", callable_mp(this, &ScriptEditor::_close_discard_current_tab)); add_child(erase_tab_confirm); @@ -3325,7 +3314,7 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) { disk_changed->connect("confirmed", callable_mp(this, &ScriptEditor::_reload_scripts)); disk_changed->get_ok()->set_text(TTR("Reload")); - disk_changed->add_button(TTR("Resave"), !OS::get_singleton()->get_swap_ok_cancel(), "resave"); + disk_changed->add_button(TTR("Resave"), !DisplayServer::get_singleton()->get_swap_ok_cancel(), "resave"); disk_changed->connect("custom_action", callable_mp(this, &ScriptEditor::_resave_scripts)); } @@ -3366,8 +3355,8 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) { ScriptServer::edit_request_func = _open_script_request; - add_style_override("panel", editor->get_gui_base()->get_stylebox("ScriptEditorPanel", "EditorStyles")); - tab_container->add_style_override("panel", editor->get_gui_base()->get_stylebox("ScriptEditor", "EditorStyles")); + add_theme_style_override("panel", editor->get_gui_base()->get_theme_stylebox("ScriptEditorPanel", "EditorStyles")); + tab_container->add_theme_style_override("panel", editor->get_gui_base()->get_theme_stylebox("ScriptEditor", "EditorStyles")); } ScriptEditor::~ScriptEditor() { diff --git a/editor/plugins/script_editor_plugin.h b/editor/plugins/script_editor_plugin.h index 81f9595264..e895867268 100644 --- a/editor/plugins/script_editor_plugin.h +++ b/editor/plugins/script_editor_plugin.h @@ -92,7 +92,7 @@ public: virtual void set_edited_resource(const RES &p_res) = 0; virtual void reload_text() = 0; virtual String get_name() = 0; - virtual Ref<Texture2D> get_icon() = 0; + virtual Ref<Texture2D> get_theme_icon() = 0; virtual bool is_unsaved() = 0; virtual Variant get_edit_state() = 0; virtual void set_edit_state(const Variant &p_state) = 0; @@ -159,7 +159,6 @@ class ScriptEditor : public PanelContainer { REPLACE_IN_FILES, SEARCH_HELP, SEARCH_WEBSITE, - REQUEST_DOCS, HELP_SEARCH_FIND, HELP_SEARCH_FIND_NEXT, HELP_SEARCH_FIND_PREVIOUS, @@ -204,7 +203,6 @@ class ScriptEditor : public PanelContainer { Button *help_search; Button *site_search; - Button *request_docs; EditorHelpSearch *help_search_dialog; ItemList *script_list; diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp index 176df7efb8..1a77eeb9de 100644 --- a/editor/plugins/script_text_editor.cpp +++ b/editor/plugins/script_text_editor.cpp @@ -65,7 +65,8 @@ void ConnectionInfoDialog::popup_connections(String p_method, Vector<Node *> p_n node_item->set_editable(0, false); node_item->set_text(1, connection.signal.get_name()); - node_item->set_icon(1, get_parent_control()->get_icon("Slot", "EditorIcons")); + Control *p = Object::cast_to<Control>(get_parent()); + node_item->set_icon(1, p->get_theme_icon("Slot", "EditorIcons")); node_item->set_selectable(1, false); node_item->set_editable(1, false); @@ -83,10 +84,10 @@ ConnectionInfoDialog::ConnectionInfoDialog() { set_title(TTR("Connections to method:")); VBoxContainer *vbc = memnew(VBoxContainer); - vbc->set_anchor_and_margin(MARGIN_LEFT, ANCHOR_BEGIN, 8 * EDSCALE); - vbc->set_anchor_and_margin(MARGIN_TOP, ANCHOR_BEGIN, 8 * EDSCALE); - vbc->set_anchor_and_margin(MARGIN_RIGHT, ANCHOR_END, -8 * EDSCALE); - vbc->set_anchor_and_margin(MARGIN_BOTTOM, ANCHOR_END, -8 * EDSCALE); + vbc->set_anchor_and_margin(MARGIN_LEFT, Control::ANCHOR_BEGIN, 8 * EDSCALE); + vbc->set_anchor_and_margin(MARGIN_TOP, Control::ANCHOR_BEGIN, 8 * EDSCALE); + vbc->set_anchor_and_margin(MARGIN_RIGHT, Control::ANCHOR_END, -8 * EDSCALE); + vbc->set_anchor_and_margin(MARGIN_BOTTOM, Control::ANCHOR_END, -8 * EDSCALE); add_child(vbc); method = memnew(Label); @@ -101,7 +102,7 @@ ConnectionInfoDialog::ConnectionInfoDialog() { tree->set_column_title(1, TTR("Signal")); tree->set_column_title(2, TTR("Target")); vbc->add_child(tree); - tree->set_v_size_flags(SIZE_EXPAND_FILL); + tree->set_v_size_flags(Control::SIZE_EXPAND_FILL); tree->set_allow_rmb_select(true); } @@ -171,7 +172,7 @@ void ScriptTextEditor::_update_member_keywords() { for (List<PropertyInfo>::Element *E = plist.front(); E; E = E->next()) { String name = E->get().name; - if (E->get().usage & PROPERTY_USAGE_CATEGORY || E->get().usage & PROPERTY_USAGE_GROUP) + if (E->get().usage & PROPERTY_USAGE_CATEGORY || E->get().usage & PROPERTY_USAGE_GROUP || E->get().usage & PROPERTY_USAGE_SUBGROUP) continue; if (name.find("/") != -1) continue; @@ -229,36 +230,36 @@ void ScriptTextEditor::_load_theme_settings() { Color comment_color = EDITOR_GET("text_editor/highlighting/comment_color"); Color string_color = EDITOR_GET("text_editor/highlighting/string_color"); - text_edit->add_color_override("background_color", background_color); - text_edit->add_color_override("completion_background_color", completion_background_color); - text_edit->add_color_override("completion_selected_color", completion_selected_color); - text_edit->add_color_override("completion_existing_color", completion_existing_color); - text_edit->add_color_override("completion_scroll_color", completion_scroll_color); - text_edit->add_color_override("completion_font_color", completion_font_color); - text_edit->add_color_override("font_color", text_color); - text_edit->add_color_override("line_number_color", line_number_color); - text_edit->add_color_override("safe_line_number_color", safe_line_number_color); - text_edit->add_color_override("caret_color", caret_color); - text_edit->add_color_override("caret_background_color", caret_background_color); - text_edit->add_color_override("font_color_selected", text_selected_color); - text_edit->add_color_override("selection_color", selection_color); - text_edit->add_color_override("brace_mismatch_color", brace_mismatch_color); - text_edit->add_color_override("current_line_color", current_line_color); - text_edit->add_color_override("line_length_guideline_color", line_length_guideline_color); - text_edit->add_color_override("word_highlighted_color", word_highlighted_color); - text_edit->add_color_override("number_color", number_color); - text_edit->add_color_override("function_color", function_color); - text_edit->add_color_override("member_variable_color", member_variable_color); - text_edit->add_color_override("bookmark_color", bookmark_color); - text_edit->add_color_override("breakpoint_color", breakpoint_color); - text_edit->add_color_override("executing_line_color", executing_line_color); - text_edit->add_color_override("mark_color", mark_color); - text_edit->add_color_override("code_folding_color", code_folding_color); - text_edit->add_color_override("search_result_color", search_result_color); - text_edit->add_color_override("search_result_border_color", search_result_border_color); - text_edit->add_color_override("symbol_color", symbol_color); - - text_edit->add_constant_override("line_spacing", EDITOR_DEF("text_editor/theme/line_spacing", 6)); + text_edit->add_theme_color_override("background_color", background_color); + text_edit->add_theme_color_override("completion_background_color", completion_background_color); + text_edit->add_theme_color_override("completion_selected_color", completion_selected_color); + text_edit->add_theme_color_override("completion_existing_color", completion_existing_color); + text_edit->add_theme_color_override("completion_scroll_color", completion_scroll_color); + text_edit->add_theme_color_override("completion_font_color", completion_font_color); + text_edit->add_theme_color_override("font_color", text_color); + text_edit->add_theme_color_override("line_number_color", line_number_color); + text_edit->add_theme_color_override("safe_line_number_color", safe_line_number_color); + text_edit->add_theme_color_override("caret_color", caret_color); + text_edit->add_theme_color_override("caret_background_color", caret_background_color); + text_edit->add_theme_color_override("font_color_selected", text_selected_color); + text_edit->add_theme_color_override("selection_color", selection_color); + text_edit->add_theme_color_override("brace_mismatch_color", brace_mismatch_color); + text_edit->add_theme_color_override("current_line_color", current_line_color); + text_edit->add_theme_color_override("line_length_guideline_color", line_length_guideline_color); + text_edit->add_theme_color_override("word_highlighted_color", word_highlighted_color); + text_edit->add_theme_color_override("number_color", number_color); + text_edit->add_theme_color_override("function_color", function_color); + text_edit->add_theme_color_override("member_variable_color", member_variable_color); + text_edit->add_theme_color_override("bookmark_color", bookmark_color); + text_edit->add_theme_color_override("breakpoint_color", breakpoint_color); + text_edit->add_theme_color_override("executing_line_color", executing_line_color); + text_edit->add_theme_color_override("mark_color", mark_color); + text_edit->add_theme_color_override("code_folding_color", code_folding_color); + text_edit->add_theme_color_override("search_result_color", search_result_color); + text_edit->add_theme_color_override("search_result_border_color", search_result_border_color); + text_edit->add_theme_color_override("symbol_color", symbol_color); + + text_edit->add_theme_constant_override("line_spacing", EDITOR_DEF("text_editor/theme/line_spacing", 6)); colors_cache.symbol_color = symbol_color; colors_cache.keyword_color = keyword_color; @@ -555,10 +556,10 @@ String ScriptTextEditor::get_name() { return name; } -Ref<Texture2D> ScriptTextEditor::get_icon() { +Ref<Texture2D> ScriptTextEditor::get_theme_icon() { - if (get_parent_control() && get_parent_control()->has_icon(script->get_class(), "EditorIcons")) { - return get_parent_control()->get_icon(script->get_class(), "EditorIcons"); + if (get_parent_control() && get_parent_control()->has_theme_icon(script->get_class(), "EditorIcons")) { + return get_parent_control()->get_theme_icon(script->get_class(), "EditorIcons"); } return Ref<Texture2D>(); @@ -614,7 +615,7 @@ void ScriptTextEditor::_validate_script() { String target_path = base == connection.callable.get_object() ? base_path : base_path + "/" + base->get_path_to(Object::cast_to<Node>(connection.callable.get_object())); warnings_panel->push_cell(); - warnings_panel->push_color(warnings_panel->get_color("warning_color", "Editor")); + warnings_panel->push_color(warnings_panel->get_theme_color("warning_color", "Editor")); warnings_panel->add_text(vformat(TTR("Missing connected method '%s' for signal '%s' from node '%s' to node '%s'."), connection.callable.get_method(), connection.signal.get_name(), source_path, target_path)); warnings_panel->pop(); // Color. warnings_panel->pop(); // Cell. @@ -634,7 +635,7 @@ void ScriptTextEditor::_validate_script() { warnings_panel->push_cell(); warnings_panel->push_meta(w.line - 1); - warnings_panel->push_color(warnings_panel->get_color("warning_color", "Editor")); + warnings_panel->push_color(warnings_panel->get_theme_color("warning_color", "Editor")); warnings_panel->add_text(TTR("Line") + " " + itos(w.line)); warnings_panel->add_text(" (" + w.string_code + "):"); warnings_panel->pop(); // Color. @@ -746,7 +747,7 @@ static Vector<Node *> _find_all_node_for_script(Node *p_base, Node *p_current, c static Node *_find_node_for_script(Node *p_base, Node *p_current, const Ref<Script> &p_script) { if (p_current->get_owner() != p_base && p_base != p_current) - return NULL; + return nullptr; Ref<Script> c = p_current->get_script(); if (c == p_script) return p_current; @@ -756,7 +757,7 @@ static Node *_find_node_for_script(Node *p_base, Node *p_current, const Ref<Scri return found; } - return NULL; + return nullptr; } static void _find_changed_scripts_for_external_editor(Node *p_base, Node *p_current, Set<Ref<Script>> &r_scripts) { @@ -821,7 +822,7 @@ void ScriptTextEditor::_code_complete_scripts(void *p_ud, const String &p_code, void ScriptTextEditor::_code_complete_script(const String &p_code, List<ScriptCodeCompletionOption> *r_options, bool &r_force) { - if (color_panel->is_visible_in_tree()) return; + if (color_panel->is_visible()) return; Node *base = get_tree()->get_edited_scene_root(); if (base) { base = _find_node_for_script(base, base, script); @@ -998,7 +999,7 @@ void ScriptTextEditor::_validate_symbol(const String &p_symbol) { } void ScriptTextEditor::update_toggle_scripts_button() { - if (code_editor != NULL) { + if (code_editor != nullptr) { code_editor->update_toggle_scripts_button(); } } @@ -1046,7 +1047,7 @@ void ScriptTextEditor::_update_connected_methods() { String name = functions[j].get_slice(":", 0); if (name == connection.callable.get_method()) { line = functions[j].get_slice(":", 1).to_int(); - text_edit->set_line_info_icon(line - 1, get_parent_control()->get_icon("Slot", "EditorIcons"), connection.callable.get_method()); + text_edit->set_line_info_icon(line - 1, get_parent_control()->get_theme_icon("Slot", "EditorIcons"), connection.callable.get_method()); methods_found.insert(connection.callable.get_method()); break; } @@ -1435,7 +1436,7 @@ void ScriptTextEditor::add_syntax_highlighter(SyntaxHighlighter *p_highlighter) void ScriptTextEditor::set_syntax_highlighter(SyntaxHighlighter *p_highlighter) { TextEdit *te = code_editor->get_text_edit(); te->_set_syntax_highlighting(p_highlighter); - if (p_highlighter != NULL) + if (p_highlighter != nullptr) highlighter_menu->set_item_checked(highlighter_menu->get_item_idx_from_text(p_highlighter->get_name()), true); else highlighter_menu->set_item_checked(highlighter_menu->get_item_idx_from_text(TTR("Standard")), true); @@ -1443,7 +1444,7 @@ void ScriptTextEditor::set_syntax_highlighter(SyntaxHighlighter *p_highlighter) void ScriptTextEditor::_change_syntax_highlighter(int p_idx) { Map<String, SyntaxHighlighter *>::Element *el = highlighters.front(); - while (el != NULL) { + while (el != nullptr) { highlighter_menu->set_item_checked(highlighter_menu->get_item_idx_from_text(el->key()), false); el = el->next(); } @@ -1516,7 +1517,7 @@ bool ScriptTextEditor::can_drop_data_fw(const Point2 &p_point, const Variant &p_ static Node *_find_script_node(Node *p_edited_scene, Node *p_current_node, const Ref<Script> &script) { if (p_edited_scene != p_current_node && p_current_node->get_owner() != p_edited_scene) - return NULL; + return nullptr; Ref<Script> scr = p_current_node->get_script(); @@ -1529,7 +1530,7 @@ static Node *_find_script_node(Node *p_edited_scene, Node *p_current_node, const return n; } - return NULL; + return nullptr; } void ScriptTextEditor::drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from) { @@ -1779,7 +1780,7 @@ ScriptTextEditor::ScriptTextEditor() { code_editor = memnew(CodeTextEditor); editor_box->add_child(code_editor); - code_editor->add_constant_override("separation", 2); + code_editor->add_theme_constant_override("separation", 2); code_editor->set_anchors_and_margins_preset(Control::PRESET_WIDE); code_editor->connect("validate_script", callable_mp(this, &ScriptTextEditor::_validate_script)); code_editor->connect("load_theme_settings", callable_mp(this, &ScriptTextEditor::_load_theme_settings)); @@ -1817,7 +1818,6 @@ ScriptTextEditor::ScriptTextEditor() { context_menu = memnew(PopupMenu); add_child(context_menu); context_menu->connect("id_pressed", callable_mp(this, &ScriptTextEditor::_edit_option)); - context_menu->set_hide_on_window_lose_focus(true); color_panel = memnew(PopupPanel); add_child(color_panel); @@ -1838,7 +1838,7 @@ ScriptTextEditor::ScriptTextEditor() { edit_menu = memnew(MenuButton); edit_menu->set_text(TTR("Edit")); edit_menu->set_switch_on_hover(true); - edit_menu->get_popup()->set_hide_on_window_lose_focus(true); + edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/undo"), EDIT_UNDO); edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/redo"), EDIT_REDO); edit_menu->get_popup()->add_separator(); @@ -1877,7 +1877,7 @@ ScriptTextEditor::ScriptTextEditor() { convert_case->add_shortcut(ED_SHORTCUT("script_text_editor/capitalize", TTR("Capitalize"), KEY_MASK_SHIFT | KEY_F6), EDIT_CAPITALIZE); convert_case->connect("id_pressed", callable_mp(this, &ScriptTextEditor::_edit_option)); - highlighters[TTR("Standard")] = NULL; + highlighters[TTR("Standard")] = nullptr; highlighter_menu = memnew(PopupMenu); highlighter_menu->set_name("highlighter_menu"); edit_menu->get_popup()->add_child(highlighter_menu); @@ -1889,7 +1889,7 @@ ScriptTextEditor::ScriptTextEditor() { edit_hb->add_child(search_menu); search_menu->set_text(TTR("Search")); search_menu->set_switch_on_hover(true); - search_menu->get_popup()->set_hide_on_window_lose_focus(true); + search_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/find"), SEARCH_FIND); search_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/find_next"), SEARCH_FIND_NEXT); search_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/find_previous"), SEARCH_FIND_PREV); @@ -1918,7 +1918,7 @@ ScriptTextEditor::ScriptTextEditor() { goto_menu->get_popup()->add_child(bookmarks_menu); goto_menu->get_popup()->add_submenu_item(TTR("Bookmarks"), "Bookmarks"); _update_bookmark_list(); - bookmarks_menu->connect("about_to_show", callable_mp(this, &ScriptTextEditor::_update_bookmark_list)); + bookmarks_menu->connect("about_to_popup", callable_mp(this, &ScriptTextEditor::_update_bookmark_list)); bookmarks_menu->connect("index_pressed", callable_mp(this, &ScriptTextEditor::_bookmark_item_pressed)); breakpoints_menu = memnew(PopupMenu); @@ -1926,7 +1926,7 @@ ScriptTextEditor::ScriptTextEditor() { goto_menu->get_popup()->add_child(breakpoints_menu); goto_menu->get_popup()->add_submenu_item(TTR("Breakpoints"), "Breakpoints"); _update_breakpoint_list(); - breakpoints_menu->connect("about_to_show", callable_mp(this, &ScriptTextEditor::_update_breakpoint_list)); + breakpoints_menu->connect("about_to_popup", callable_mp(this, &ScriptTextEditor::_update_breakpoint_list)); breakpoints_menu->connect("index_pressed", callable_mp(this, &ScriptTextEditor::_breakpoint_item_pressed)); quick_open = memnew(ScriptEditorQuickOpen); @@ -1944,7 +1944,7 @@ ScriptTextEditor::ScriptTextEditor() { ScriptTextEditor::~ScriptTextEditor() { for (const Map<String, SyntaxHighlighter *>::Element *E = highlighters.front(); E; E = E->next()) { - if (E->get() != NULL) { + if (E->get() != nullptr) { memdelete(E->get()); } } @@ -1956,7 +1956,7 @@ static ScriptEditorBase *create_editor(const RES &p_resource) { if (Object::cast_to<Script>(*p_resource)) { return memnew(ScriptTextEditor); } - return NULL; + return nullptr; } void ScriptTextEditor::register_editor() { diff --git a/editor/plugins/script_text_editor.h b/editor/plugins/script_text_editor.h index d2f0b310e6..51ce30c831 100644 --- a/editor/plugins/script_text_editor.h +++ b/editor/plugins/script_text_editor.h @@ -201,7 +201,7 @@ public: virtual Vector<String> get_functions(); virtual void reload_text(); virtual String get_name(); - virtual Ref<Texture2D> get_icon(); + virtual Ref<Texture2D> get_theme_icon(); virtual bool is_unsaved(); virtual Variant get_edit_state(); virtual void set_edit_state(const Variant &p_state); diff --git a/editor/plugins/shader_editor_plugin.cpp b/editor/plugins/shader_editor_plugin.cpp index 01b1e21153..9ef8148241 100644 --- a/editor/plugins/shader_editor_plugin.cpp +++ b/editor/plugins/shader_editor_plugin.cpp @@ -38,7 +38,8 @@ #include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/property_editor.h" -#include "servers/visual/shader_types.h" +#include "servers/display_server.h" +#include "servers/rendering/shader_types.h" /*** SHADER SCRIPT EDITOR ****/ @@ -116,49 +117,49 @@ void ShaderTextEditor::_load_theme_settings() { Color keyword_color = EDITOR_GET("text_editor/highlighting/keyword_color"); Color comment_color = EDITOR_GET("text_editor/highlighting/comment_color"); - get_text_edit()->add_color_override("background_color", background_color); - get_text_edit()->add_color_override("completion_background_color", completion_background_color); - get_text_edit()->add_color_override("completion_selected_color", completion_selected_color); - get_text_edit()->add_color_override("completion_existing_color", completion_existing_color); - get_text_edit()->add_color_override("completion_scroll_color", completion_scroll_color); - get_text_edit()->add_color_override("completion_font_color", completion_font_color); - get_text_edit()->add_color_override("font_color", text_color); - get_text_edit()->add_color_override("line_number_color", line_number_color); - get_text_edit()->add_color_override("caret_color", caret_color); - get_text_edit()->add_color_override("caret_background_color", caret_background_color); - get_text_edit()->add_color_override("font_color_selected", text_selected_color); - get_text_edit()->add_color_override("selection_color", selection_color); - get_text_edit()->add_color_override("brace_mismatch_color", brace_mismatch_color); - get_text_edit()->add_color_override("current_line_color", current_line_color); - get_text_edit()->add_color_override("line_length_guideline_color", line_length_guideline_color); - get_text_edit()->add_color_override("word_highlighted_color", word_highlighted_color); - get_text_edit()->add_color_override("number_color", number_color); - get_text_edit()->add_color_override("function_color", function_color); - get_text_edit()->add_color_override("member_variable_color", member_variable_color); - get_text_edit()->add_color_override("mark_color", mark_color); - get_text_edit()->add_color_override("bookmark_color", bookmark_color); - get_text_edit()->add_color_override("breakpoint_color", breakpoint_color); - get_text_edit()->add_color_override("executing_line_color", executing_line_color); - get_text_edit()->add_color_override("code_folding_color", code_folding_color); - get_text_edit()->add_color_override("search_result_color", search_result_color); - get_text_edit()->add_color_override("search_result_border_color", search_result_border_color); - get_text_edit()->add_color_override("symbol_color", symbol_color); + get_text_edit()->add_theme_color_override("background_color", background_color); + get_text_edit()->add_theme_color_override("completion_background_color", completion_background_color); + get_text_edit()->add_theme_color_override("completion_selected_color", completion_selected_color); + get_text_edit()->add_theme_color_override("completion_existing_color", completion_existing_color); + get_text_edit()->add_theme_color_override("completion_scroll_color", completion_scroll_color); + get_text_edit()->add_theme_color_override("completion_font_color", completion_font_color); + get_text_edit()->add_theme_color_override("font_color", text_color); + get_text_edit()->add_theme_color_override("line_number_color", line_number_color); + get_text_edit()->add_theme_color_override("caret_color", caret_color); + get_text_edit()->add_theme_color_override("caret_background_color", caret_background_color); + get_text_edit()->add_theme_color_override("font_color_selected", text_selected_color); + get_text_edit()->add_theme_color_override("selection_color", selection_color); + get_text_edit()->add_theme_color_override("brace_mismatch_color", brace_mismatch_color); + get_text_edit()->add_theme_color_override("current_line_color", current_line_color); + get_text_edit()->add_theme_color_override("line_length_guideline_color", line_length_guideline_color); + get_text_edit()->add_theme_color_override("word_highlighted_color", word_highlighted_color); + get_text_edit()->add_theme_color_override("number_color", number_color); + get_text_edit()->add_theme_color_override("function_color", function_color); + get_text_edit()->add_theme_color_override("member_variable_color", member_variable_color); + get_text_edit()->add_theme_color_override("mark_color", mark_color); + get_text_edit()->add_theme_color_override("bookmark_color", bookmark_color); + get_text_edit()->add_theme_color_override("breakpoint_color", breakpoint_color); + get_text_edit()->add_theme_color_override("executing_line_color", executing_line_color); + get_text_edit()->add_theme_color_override("code_folding_color", code_folding_color); + get_text_edit()->add_theme_color_override("search_result_color", search_result_color); + get_text_edit()->add_theme_color_override("search_result_border_color", search_result_border_color); + get_text_edit()->add_theme_color_override("symbol_color", symbol_color); List<String> keywords; ShaderLanguage::get_keyword_list(&keywords); if (shader.is_valid()) { - for (const Map<StringName, ShaderLanguage::FunctionInfo>::Element *E = ShaderTypes::get_singleton()->get_functions(VisualServer::ShaderMode(shader->get_mode())).front(); E; E = E->next()) { + for (const Map<StringName, ShaderLanguage::FunctionInfo>::Element *E = ShaderTypes::get_singleton()->get_functions(RenderingServer::ShaderMode(shader->get_mode())).front(); E; E = E->next()) { for (const Map<StringName, ShaderLanguage::BuiltInInfo>::Element *F = E->get().built_ins.front(); F; F = F->next()) { keywords.push_back(F->key()); } } - for (int i = 0; i < ShaderTypes::get_singleton()->get_modes(VisualServer::ShaderMode(shader->get_mode())).size(); i++) { + for (int i = 0; i < ShaderTypes::get_singleton()->get_modes(RenderingServer::ShaderMode(shader->get_mode())).size(); i++) { - keywords.push_back(ShaderTypes::get_singleton()->get_modes(VisualServer::ShaderMode(shader->get_mode()))[i]); + keywords.push_back(ShaderTypes::get_singleton()->get_modes(RenderingServer::ShaderMode(shader->get_mode()))[i]); } } @@ -192,6 +193,12 @@ void ShaderTextEditor::_check_shader_mode() { } } +static ShaderLanguage::DataType _get_global_variable_type(const StringName &p_variable) { + + RS::GlobalVariableType gvt = RS::get_singleton()->global_variable_get_type(p_variable); + return RS::global_variable_type_get_shader_datatype(gvt); +} + void ShaderTextEditor::_code_complete_script(const String &p_code, List<ScriptCodeCompletionOption> *r_options) { _check_shader_mode(); @@ -199,7 +206,7 @@ void ShaderTextEditor::_code_complete_script(const String &p_code, List<ScriptCo ShaderLanguage sl; String calltip; - sl.complete(p_code, ShaderTypes::get_singleton()->get_functions(VisualServer::ShaderMode(shader->get_mode())), ShaderTypes::get_singleton()->get_modes(VisualServer::ShaderMode(shader->get_mode())), ShaderTypes::get_singleton()->get_types(), r_options, calltip); + sl.complete(p_code, ShaderTypes::get_singleton()->get_functions(RenderingServer::ShaderMode(shader->get_mode())), ShaderTypes::get_singleton()->get_modes(RenderingServer::ShaderMode(shader->get_mode())), ShaderTypes::get_singleton()->get_types(), _get_global_variable_type, r_options, calltip); get_text_edit()->set_code_hint(calltip); } @@ -214,7 +221,7 @@ void ShaderTextEditor::_validate_script() { ShaderLanguage sl; - Error err = sl.compile(code, ShaderTypes::get_singleton()->get_functions(VisualServer::ShaderMode(shader->get_mode())), ShaderTypes::get_singleton()->get_modes(VisualServer::ShaderMode(shader->get_mode())), ShaderTypes::get_singleton()->get_types()); + Error err = sl.compile(code, ShaderTypes::get_singleton()->get_functions(RenderingServer::ShaderMode(shader->get_mode())), ShaderTypes::get_singleton()->get_modes(RenderingServer::ShaderMode(shader->get_mode())), ShaderTypes::get_singleton()->get_types(), _get_global_variable_type); if (err != OK) { String error_text = "error(" + itos(sl.get_error_line()) + "): " + sl.get_error_text(); @@ -351,7 +358,7 @@ void ShaderEditor::_menu_option(int p_option) { void ShaderEditor::_notification(int p_what) { - if (p_what == MainLoop::NOTIFICATION_WM_FOCUS_IN) { + if (p_what == NOTIFICATION_WM_FOCUS_IN) { _check_for_external_edit(); } } @@ -376,7 +383,7 @@ void ShaderEditor::_editor_settings_changed() { shader_editor->get_text_edit()->set_highlight_current_line(EditorSettings::get_singleton()->get("text_editor/highlighting/highlight_current_line")); shader_editor->get_text_edit()->cursor_set_blink_enabled(EditorSettings::get_singleton()->get("text_editor/cursor/caret_blink")); shader_editor->get_text_edit()->cursor_set_blink_speed(EditorSettings::get_singleton()->get("text_editor/cursor/caret_blink_speed")); - shader_editor->get_text_edit()->add_constant_override("line_spacing", EditorSettings::get_singleton()->get("text_editor/theme/line_spacing")); + shader_editor->get_text_edit()->add_theme_constant_override("line_spacing", EditorSettings::get_singleton()->get("text_editor/theme/line_spacing")); shader_editor->get_text_edit()->cursor_set_block_mode(EditorSettings::get_singleton()->get("text_editor/cursor/block_caret")); shader_editor->get_text_edit()->set_smooth_scroll_enabled(EditorSettings::get_singleton()->get("text_editor/navigation/smooth_scrolling")); shader_editor->get_text_edit()->set_v_scroll_speed(EditorSettings::get_singleton()->get("text_editor/navigation/v_scroll_speed")); @@ -595,7 +602,7 @@ ShaderEditor::ShaderEditor(EditorNode *p_node) { shader_editor = memnew(ShaderTextEditor); shader_editor->set_v_size_flags(SIZE_EXPAND_FILL); - shader_editor->add_constant_override("separation", 0); + shader_editor->add_theme_constant_override("separation", 0); shader_editor->set_anchors_and_margins_preset(Control::PRESET_WIDE); shader_editor->connect("script_changed", callable_mp(this, &ShaderEditor::apply_shaders)); @@ -614,7 +621,6 @@ ShaderEditor::ShaderEditor(EditorNode *p_node) { context_menu = memnew(PopupMenu); add_child(context_menu); context_menu->connect("id_pressed", callable_mp(this, &ShaderEditor::_menu_option)); - context_menu->set_hide_on_window_lose_focus(true); VBoxContainer *main_container = memnew(VBoxContainer); HBoxContainer *hbc = memnew(HBoxContainer); @@ -622,7 +628,7 @@ ShaderEditor::ShaderEditor(EditorNode *p_node) { edit_menu = memnew(MenuButton); edit_menu->set_text(TTR("Edit")); edit_menu->set_switch_on_hover(true); - edit_menu->get_popup()->set_hide_on_window_lose_focus(true); + edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/undo"), EDIT_UNDO); edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/redo"), EDIT_REDO); edit_menu->get_popup()->add_separator(); @@ -646,7 +652,7 @@ ShaderEditor::ShaderEditor(EditorNode *p_node) { search_menu = memnew(MenuButton); search_menu->set_text(TTR("Search")); search_menu->set_switch_on_hover(true); - search_menu->get_popup()->set_hide_on_window_lose_focus(true); + search_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/find"), SEARCH_FIND); search_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/find_next"), SEARCH_FIND_NEXT); search_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/find_previous"), SEARCH_FIND_PREV); @@ -666,13 +672,13 @@ ShaderEditor::ShaderEditor(EditorNode *p_node) { goto_menu->get_popup()->add_child(bookmarks_menu); goto_menu->get_popup()->add_submenu_item(TTR("Bookmarks"), "Bookmarks"); _update_bookmark_list(); - bookmarks_menu->connect("about_to_show", callable_mp(this, &ShaderEditor::_update_bookmark_list)); + bookmarks_menu->connect("about_to_popup", callable_mp(this, &ShaderEditor::_update_bookmark_list)); bookmarks_menu->connect("index_pressed", callable_mp(this, &ShaderEditor::_bookmark_item_pressed)); help_menu = memnew(MenuButton); help_menu->set_text(TTR("Help")); help_menu->set_switch_on_hover(true); - help_menu->get_popup()->add_icon_item(p_node->get_gui_base()->get_icon("Instance", "EditorIcons"), TTR("Online Docs"), HELP_DOCS); + help_menu->get_popup()->add_icon_item(p_node->get_gui_base()->get_theme_icon("Instance", "EditorIcons"), TTR("Online Docs"), HELP_DOCS); help_menu->get_popup()->connect("id_pressed", callable_mp(this, &ShaderEditor::_menu_option)); add_child(main_container); @@ -681,7 +687,7 @@ ShaderEditor::ShaderEditor(EditorNode *p_node) { hbc->add_child(edit_menu); hbc->add_child(goto_menu); hbc->add_child(help_menu); - hbc->add_style_override("panel", p_node->get_gui_base()->get_stylebox("ScriptEditorPanel", "EditorStyles")); + hbc->add_theme_style_override("panel", p_node->get_gui_base()->get_theme_stylebox("ScriptEditorPanel", "EditorStyles")); main_container->add_child(shader_editor); goto_line_dialog = memnew(GotoLineDialog); @@ -699,7 +705,7 @@ ShaderEditor::ShaderEditor(EditorNode *p_node) { disk_changed->connect("confirmed", callable_mp(this, &ShaderEditor::_reload_shader_from_disk)); disk_changed->get_ok()->set_text(TTR("Reload")); - disk_changed->add_button(TTR("Resave"), !OS::get_singleton()->get_swap_ok_cancel(), "resave"); + disk_changed->add_button(TTR("Resave"), !DisplayServer::get_singleton()->get_swap_ok_cancel(), "resave"); disk_changed->connect("custom_action", callable_mp(this, &ShaderEditor::save_external_data)); add_child(disk_changed); @@ -716,7 +722,7 @@ void ShaderEditorPlugin::edit(Object *p_object) { bool ShaderEditorPlugin::handles(Object *p_object) const { Shader *shader = Object::cast_to<Shader>(p_object); - return shader != NULL && shader->is_text_shader(); + return shader != nullptr && shader->is_text_shader(); } void ShaderEditorPlugin::make_visible(bool p_visible) { diff --git a/editor/plugins/shader_editor_plugin.h b/editor/plugins/shader_editor_plugin.h index 900b40bd7a..f02ed590fc 100644 --- a/editor/plugins/shader_editor_plugin.h +++ b/editor/plugins/shader_editor_plugin.h @@ -39,7 +39,7 @@ #include "scene/gui/text_edit.h" #include "scene/main/timer.h" #include "scene/resources/shader.h" -#include "servers/visual/shader_language.h" +#include "servers/rendering/shader_language.h" class ShaderTextEditor : public CodeTextEditor { diff --git a/editor/plugins/shader_file_editor_plugin.cpp b/editor/plugins/shader_file_editor_plugin.cpp new file mode 100644 index 0000000000..296c7a01b6 --- /dev/null +++ b/editor/plugins/shader_file_editor_plugin.cpp @@ -0,0 +1,303 @@ +#include "shader_file_editor_plugin.h" + +#include "core/io/resource_loader.h" +#include "core/io/resource_saver.h" +#include "core/os/keyboard.h" +#include "core/os/os.h" +#include "editor/editor_node.h" +#include "editor/editor_scale.h" +#include "editor/editor_settings.h" +#include "editor/property_editor.h" +#include "servers/display_server.h" +#include "servers/rendering/shader_types.h" + +/*** SHADER SCRIPT EDITOR ****/ + +/*** SCRIPT EDITOR ******/ + +void ShaderFileEditor::_update_version(const StringName &p_version_txt, const RD::ShaderStage p_stage) { +} + +void ShaderFileEditor::_version_selected(int p_option) { + + int c = versions->get_current(); + StringName version_txt = versions->get_item_metadata(c); + + RD::ShaderStage stage = RD::SHADER_STAGE_MAX; + int first_found = -1; + + Ref<RDShaderBytecode> bytecode = shader_file->get_bytecode(version_txt); + ERR_FAIL_COND(bytecode.is_null()); + + for (int i = 0; i < RD::SHADER_STAGE_MAX; i++) { + if (bytecode->get_stage_bytecode(RD::ShaderStage(i)).empty() && bytecode->get_stage_compile_error(RD::ShaderStage(i)) == String()) { + stages[i]->set_icon(Ref<Texture2D>()); + continue; + } + + Ref<Texture2D> icon; + if (bytecode->get_stage_compile_error(RD::ShaderStage(i)) != String()) { + icon = get_theme_icon("ImportFail", "EditorIcons"); + } else { + icon = get_theme_icon("ImportCheck", "EditorIcons"); + } + stages[i]->set_icon(icon); + + if (first_found == -1) { + first_found = i; + } + + if (stages[i]->is_pressed()) { + stage = RD::ShaderStage(i); + break; + } + } + + error_text->clear(); + + if (stage == RD::SHADER_STAGE_MAX) { //need to change stage, does not have it + if (first_found == -1) { + error_text->add_text(TTR("No valid shader stages found.")); + return; //well you did not put any stage I guess? + } + stages[first_found]->set_pressed(true); + stage = RD::ShaderStage(first_found); + } + + String error = bytecode->get_stage_compile_error(stage); + + error_text->push_font(get_theme_font("source", "EditorFonts")); + + if (error == String()) { + error_text->add_text(TTR("Shader stage compiled without errors.")); + } else { + error_text->add_text(error); + } +} + +void ShaderFileEditor::_update_options() { + + ERR_FAIL_COND(shader_file.is_null()); + + if (shader_file->get_base_error() != String()) { + stage_hb->hide(); + versions->hide(); + error_text->clear(); + error_text->push_font(get_theme_font("source", "EditorFonts")); + error_text->add_text(vformat(TTR("File structure for '%s' contains unrecoverable errors:\n\n"), shader_file->get_path().get_file())); + error_text->add_text(shader_file->get_base_error()); + return; + } + + stage_hb->show(); + versions->show(); + + int c = versions->get_current(); + //remember current + versions->clear(); + Vector<StringName> version_list = shader_file->get_version_list(); + + if (c >= version_list.size()) { + c = version_list.size() - 1; + } + if (c < 0) { + c = 0; + } + + StringName current_version; + + for (int i = 0; i < version_list.size(); i++) { + String title = version_list[i]; + if (title == "") { + title = "default"; + } + + Ref<Texture2D> icon; + + Ref<RDShaderBytecode> bytecode = shader_file->get_bytecode(version_list[i]); + ERR_FAIL_COND(bytecode.is_null()); + + bool failed = false; + for (int j = 0; j < RD::SHADER_STAGE_MAX; j++) { + String error = bytecode->get_stage_compile_error(RD::ShaderStage(j)); + if (error != String()) { + failed = true; + } + } + + if (failed) { + icon = get_theme_icon("ImportFail", "EditorIcons"); + } else { + icon = get_theme_icon("ImportCheck", "EditorIcons"); + } + + versions->add_item(title, icon); + versions->set_item_metadata(i, version_list[i]); + + if (i == c) { + versions->select(i); + current_version = version_list[i]; + } + } + + if (version_list.size() == 0) { + for (int i = 0; i < RD::SHADER_STAGE_MAX; i++) { + stages[i]->set_disabled(true); + } + return; + } + + Ref<RDShaderBytecode> bytecode = shader_file->get_bytecode(current_version); + ERR_FAIL_COND(bytecode.is_null()); + int first_valid = -1; + int current = -1; + for (int i = 0; i < RD::SHADER_STAGE_MAX; i++) { + Vector<uint8_t> bc = bytecode->get_stage_bytecode(RD::ShaderStage(i)); + String error = bytecode->get_stage_compile_error(RD::ShaderStage(i)); + bool disable = error == String() && bc.empty(); + stages[i]->set_disabled(disable); + if (!disable) { + if (stages[i]->is_pressed()) { + current = i; + } + first_valid = i; + } + } + + if (current == -1 && first_valid != -1) { + stages[first_valid]->set_pressed(true); + } + + _version_selected(0); +} + +void ShaderFileEditor::_notification(int p_what) { + + if (p_what == NOTIFICATION_WM_FOCUS_IN) { + if (is_visible_in_tree() && shader_file.is_valid()) { + _update_options(); + } + } +} + +void ShaderFileEditor::_editor_settings_changed() { + + if (is_visible_in_tree() && shader_file.is_valid()) { + _update_options(); + } +} + +void ShaderFileEditor::_bind_methods() { +} + +void ShaderFileEditor::edit(const Ref<RDShaderFile> &p_shader) { + + if (p_shader.is_null()) { + if (shader_file.is_valid()) { + shader_file->disconnect("changed", callable_mp(this, &ShaderFileEditor::_shader_changed)); + } + return; + } + + if (shader_file == p_shader) + return; + + shader_file = p_shader; + + if (shader_file.is_valid()) { + shader_file->connect("changed", callable_mp(this, &ShaderFileEditor::_shader_changed)); + } + + _update_options(); +} + +void ShaderFileEditor::_shader_changed() { + + if (is_visible_in_tree()) { + _update_options(); + } +} + +ShaderFileEditor *ShaderFileEditor::singleton = nullptr; + +ShaderFileEditor::ShaderFileEditor(EditorNode *p_node) { + singleton = this; + HSplitContainer *main_hs = memnew(HSplitContainer); + + add_child(main_hs); + + versions = memnew(ItemList); + versions->connect("item_selected", callable_mp(this, &ShaderFileEditor::_version_selected)); + versions->set_custom_minimum_size(Size2i(200 * EDSCALE, 0)); + main_hs->add_child(versions); + + VBoxContainer *main_vb = memnew(VBoxContainer); + main_vb->set_h_size_flags(SIZE_EXPAND_FILL); + main_hs->add_child(main_vb); + + static const char *stage_str[RD::SHADER_STAGE_MAX] = { + "Vertex", + "Fragment", + "TessControl", + "TessEval", + "Compute" + }; + + stage_hb = memnew(HBoxContainer); + main_vb->add_child(stage_hb); + + Ref<ButtonGroup> bg; + bg.instance(); + for (int i = 0; i < RD::SHADER_STAGE_MAX; i++) { + Button *button = memnew(Button(stage_str[i])); + button->set_toggle_mode(true); + button->set_focus_mode(FOCUS_NONE); + stage_hb->add_child(button); + stages[i] = button; + button->set_button_group(bg); + button->connect("pressed", callable_mp(this, &ShaderFileEditor::_version_selected), varray(i)); + } + + error_text = memnew(RichTextLabel); + error_text->set_v_size_flags(SIZE_EXPAND_FILL); + main_vb->add_child(error_text); +} + +void ShaderFileEditorPlugin::edit(Object *p_object) { + + RDShaderFile *s = Object::cast_to<RDShaderFile>(p_object); + shader_editor->edit(s); +} + +bool ShaderFileEditorPlugin::handles(Object *p_object) const { + + RDShaderFile *shader = Object::cast_to<RDShaderFile>(p_object); + return shader != nullptr; +} + +void ShaderFileEditorPlugin::make_visible(bool p_visible) { + + if (p_visible) { + button->show(); + editor->make_bottom_panel_item_visible(shader_editor); + + } else { + + button->hide(); + if (shader_editor->is_visible_in_tree()) + editor->hide_bottom_panel(); + } +} + +ShaderFileEditorPlugin::ShaderFileEditorPlugin(EditorNode *p_node) { + + editor = p_node; + shader_editor = memnew(ShaderFileEditor(p_node)); + + shader_editor->set_custom_minimum_size(Size2(0, 300) * EDSCALE); + button = editor->add_bottom_panel_item(TTR("ShaderFile"), shader_editor); + button->hide(); +} + +ShaderFileEditorPlugin::~ShaderFileEditorPlugin() { +} diff --git a/editor/plugins/shader_file_editor_plugin.h b/editor/plugins/shader_file_editor_plugin.h new file mode 100644 index 0000000000..44d32de2f1 --- /dev/null +++ b/editor/plugins/shader_file_editor_plugin.h @@ -0,0 +1,64 @@ +#ifndef SHADER_FILE_EDITOR_PLUGIN_H +#define SHADER_FILE_EDITOR_PLUGIN_H + +#include "editor/code_editor.h" +#include "editor/editor_plugin.h" +#include "scene/gui/menu_button.h" +#include "scene/gui/panel_container.h" +#include "scene/gui/rich_text_label.h" +#include "scene/gui/tab_container.h" +#include "scene/gui/text_edit.h" +#include "scene/main/timer.h" +#include "servers/rendering/rendering_device_binds.h" + +class ShaderFileEditor : public PanelContainer { + + GDCLASS(ShaderFileEditor, PanelContainer); + + Ref<RDShaderFile> shader_file; + + HBoxContainer *stage_hb; + ItemList *versions; + Button *stages[RD::SHADER_STAGE_MAX]; + RichTextLabel *error_text; + + void _update_version(const StringName &p_version_txt, const RenderingDevice::ShaderStage p_stage); + void _version_selected(int p_stage); + void _editor_settings_changed(); + + void _update_options(); + void _shader_changed(); + +protected: + void _notification(int p_what); + static void _bind_methods(); + +public: + static ShaderFileEditor *singleton; + void edit(const Ref<RDShaderFile> &p_shader); + + ShaderFileEditor(EditorNode *p_node); +}; + +class ShaderFileEditorPlugin : public EditorPlugin { + + GDCLASS(ShaderFileEditorPlugin, EditorPlugin); + + ShaderFileEditor *shader_editor; + EditorNode *editor; + Button *button; + +public: + virtual String get_name() const { return "ShaderFile"; } + bool has_main_screen() const { return false; } + virtual void edit(Object *p_object); + virtual bool handles(Object *p_object) const; + virtual void make_visible(bool p_visible); + + ShaderFileEditor *get_shader_editor() const { return shader_editor; } + + ShaderFileEditorPlugin(EditorNode *p_node); + ~ShaderFileEditorPlugin(); +}; + +#endif // SHADER_FILE_EDITOR_PLUGIN_H diff --git a/editor/plugins/skeleton_2d_editor_plugin.cpp b/editor/plugins/skeleton_2d_editor_plugin.cpp index 0b77b987bf..c81d3f787e 100644 --- a/editor/plugins/skeleton_2d_editor_plugin.cpp +++ b/editor/plugins/skeleton_2d_editor_plugin.cpp @@ -38,7 +38,7 @@ void Skeleton2DEditor::_node_removed(Node *p_node) { if (p_node == node) { - node = NULL; + node = nullptr; options->hide(); } } @@ -59,7 +59,7 @@ void Skeleton2DEditor::_menu_option(int p_option) { if (node->get_bone_count() == 0) { err_dialog->set_text(TTR("This skeleton has no bones, create some children Bone2D nodes.")); - err_dialog->popup_centered_minsize(); + err_dialog->popup_centered(); return; } UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo(); @@ -75,7 +75,7 @@ void Skeleton2DEditor::_menu_option(int p_option) { case MENU_OPTION_SET_REST: { if (node->get_bone_count() == 0) { err_dialog->set_text(TTR("This skeleton has no bones, create some children Bone2D nodes.")); - err_dialog->popup_centered_minsize(); + err_dialog->popup_centered(); return; } UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo(); @@ -101,7 +101,7 @@ Skeleton2DEditor::Skeleton2DEditor() { CanvasItemEditor::get_singleton()->add_control_to_menu_panel(options); options->set_text(TTR("Skeleton2D")); - options->set_icon(EditorNode::get_singleton()->get_gui_base()->get_icon("Skeleton2D", "EditorIcons")); + options->set_icon(EditorNode::get_singleton()->get_gui_base()->get_theme_icon("Skeleton2D", "EditorIcons")); options->get_popup()->add_item(TTR("Make Rest Pose (From Bones)"), MENU_OPTION_MAKE_REST); options->get_popup()->add_separator(); @@ -131,7 +131,7 @@ void Skeleton2DEditorPlugin::make_visible(bool p_visible) { } else { sprite_editor->options->hide(); - sprite_editor->edit(NULL); + sprite_editor->edit(nullptr); } } diff --git a/editor/plugins/skeleton_editor_plugin.cpp b/editor/plugins/skeleton_3d_editor_plugin.cpp index 07bd6a0e41..fac4cb19d8 100644 --- a/editor/plugins/skeleton_editor_plugin.cpp +++ b/editor/plugins/skeleton_3d_editor_plugin.cpp @@ -1,5 +1,5 @@ /*************************************************************************/ -/* skeleton_editor_plugin.cpp */ +/* skeleton_3d_editor_plugin.cpp */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ @@ -28,16 +28,16 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#include "skeleton_editor_plugin.h" +#include "skeleton_3d_editor_plugin.h" -#include "scene/3d/collision_shape.h" -#include "scene/3d/physics_body.h" -#include "scene/3d/physics_joint.h" -#include "scene/resources/capsule_shape.h" -#include "scene/resources/sphere_shape.h" -#include "spatial_editor_plugin.h" +#include "node_3d_editor_plugin.h" +#include "scene/3d/collision_shape_3d.h" +#include "scene/3d/physics_body_3d.h" +#include "scene/3d/physics_joint_3d.h" +#include "scene/resources/capsule_shape_3d.h" +#include "scene/resources/sphere_shape_3d.h" -void SkeletonEditor::_on_click_option(int p_option) { +void Skeleton3DEditor::_on_click_option(int p_option) { if (!skeleton) { return; } @@ -49,7 +49,7 @@ void SkeletonEditor::_on_click_option(int p_option) { } } -void SkeletonEditor::create_physical_skeleton() { +void Skeleton3DEditor::create_physical_skeleton() { UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo(); Node *owner = skeleton == get_tree()->get_edited_scene_root() ? skeleton : skeleton->get_owner(); @@ -94,25 +94,25 @@ void SkeletonEditor::create_physical_skeleton() { /// Create joint between parent of parent if (-1 != parent_parent) { - bones_infos[parent].physical_bone->set_joint_type(PhysicalBone::JOINT_TYPE_PIN); + bones_infos[parent].physical_bone->set_joint_type(PhysicalBone3D::JOINT_TYPE_PIN); } } } } } -PhysicalBone *SkeletonEditor::create_physical_bone(int bone_id, int bone_child_id, const Vector<BoneInfo> &bones_infos) { +PhysicalBone3D *Skeleton3DEditor::create_physical_bone(int bone_id, int bone_child_id, const Vector<BoneInfo> &bones_infos) { const Transform child_rest = skeleton->get_bone_rest(bone_child_id); const real_t half_height(child_rest.origin.length() * 0.5); const real_t radius(half_height * 0.2); - CapsuleShape *bone_shape_capsule = memnew(CapsuleShape); + CapsuleShape3D *bone_shape_capsule = memnew(CapsuleShape3D); bone_shape_capsule->set_height((half_height - radius) * 2); bone_shape_capsule->set_radius(radius); - CollisionShape *bone_shape = memnew(CollisionShape); + CollisionShape3D *bone_shape = memnew(CollisionShape3D); bone_shape->set_shape(bone_shape_capsule); Transform body_transform; @@ -122,7 +122,7 @@ PhysicalBone *SkeletonEditor::create_physical_bone(int bone_id, int bone_child_i Transform joint_transform; joint_transform.origin = Vector3(0, 0, half_height); - PhysicalBone *physical_bone = memnew(PhysicalBone); + PhysicalBone3D *physical_bone = memnew(PhysicalBone3D); physical_bone->add_child(bone_shape); physical_bone->set_name("Physical Bone " + skeleton->get_bone_name(bone_id)); physical_bone->set_body_offset(body_transform); @@ -130,66 +130,66 @@ PhysicalBone *SkeletonEditor::create_physical_bone(int bone_id, int bone_child_i return physical_bone; } -void SkeletonEditor::edit(Skeleton *p_node) { +void Skeleton3DEditor::edit(Skeleton3D *p_node) { skeleton = p_node; } -void SkeletonEditor::_notification(int p_what) { +void Skeleton3DEditor::_notification(int p_what) { if (p_what == NOTIFICATION_ENTER_TREE) { - get_tree()->connect("node_removed", callable_mp(this, &SkeletonEditor::_node_removed)); + get_tree()->connect("node_removed", callable_mp(this, &Skeleton3DEditor::_node_removed)); } } -void SkeletonEditor::_node_removed(Node *p_node) { +void Skeleton3DEditor::_node_removed(Node *p_node) { if (p_node == skeleton) { - skeleton = NULL; + skeleton = nullptr; options->hide(); } } -void SkeletonEditor::_bind_methods() { +void Skeleton3DEditor::_bind_methods() { } -SkeletonEditor::SkeletonEditor() { - skeleton = NULL; +Skeleton3DEditor::Skeleton3DEditor() { + skeleton = nullptr; options = memnew(MenuButton); - SpatialEditor::get_singleton()->add_control_to_menu_panel(options); + Node3DEditor::get_singleton()->add_control_to_menu_panel(options); - options->set_text(TTR("Skeleton")); - options->set_icon(EditorNode::get_singleton()->get_gui_base()->get_icon("Skeleton", "EditorIcons")); + options->set_text(TTR("Skeleton3D")); + options->set_icon(EditorNode::get_singleton()->get_gui_base()->get_theme_icon("Skeleton3D", "EditorIcons")); options->get_popup()->add_item(TTR("Create physical skeleton"), MENU_OPTION_CREATE_PHYSICAL_SKELETON); - options->get_popup()->connect("id_pressed", callable_mp(this, &SkeletonEditor::_on_click_option)); + options->get_popup()->connect("id_pressed", callable_mp(this, &Skeleton3DEditor::_on_click_option)); options->hide(); } -SkeletonEditor::~SkeletonEditor() {} +Skeleton3DEditor::~Skeleton3DEditor() {} -void SkeletonEditorPlugin::edit(Object *p_object) { - skeleton_editor->edit(Object::cast_to<Skeleton>(p_object)); +void Skeleton3DEditorPlugin::edit(Object *p_object) { + skeleton_editor->edit(Object::cast_to<Skeleton3D>(p_object)); } -bool SkeletonEditorPlugin::handles(Object *p_object) const { - return p_object->is_class("Skeleton"); +bool Skeleton3DEditorPlugin::handles(Object *p_object) const { + return p_object->is_class("Skeleton3D"); } -void SkeletonEditorPlugin::make_visible(bool p_visible) { +void Skeleton3DEditorPlugin::make_visible(bool p_visible) { if (p_visible) { skeleton_editor->options->show(); } else { skeleton_editor->options->hide(); - skeleton_editor->edit(NULL); + skeleton_editor->edit(nullptr); } } -SkeletonEditorPlugin::SkeletonEditorPlugin(EditorNode *p_node) { +Skeleton3DEditorPlugin::Skeleton3DEditorPlugin(EditorNode *p_node) { editor = p_node; - skeleton_editor = memnew(SkeletonEditor); + skeleton_editor = memnew(Skeleton3DEditor); editor->get_viewport()->add_child(skeleton_editor); } -SkeletonEditorPlugin::~SkeletonEditorPlugin() {} +Skeleton3DEditorPlugin::~Skeleton3DEditorPlugin() {} diff --git a/editor/plugins/skeleton_editor_plugin.h b/editor/plugins/skeleton_3d_editor_plugin.h index 1dce6d12ed..2ba5a817bc 100644 --- a/editor/plugins/skeleton_editor_plugin.h +++ b/editor/plugins/skeleton_3d_editor_plugin.h @@ -1,5 +1,5 @@ /*************************************************************************/ -/* skeleton_editor_plugin.h */ +/* skeleton_3d_editor_plugin.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ @@ -28,37 +28,37 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#ifndef SKELETON_EDITOR_PLUGIN_H -#define SKELETON_EDITOR_PLUGIN_H +#ifndef SKELETON_3D_EDITOR_PLUGIN_H +#define SKELETON_3D_EDITOR_PLUGIN_H #include "editor/editor_node.h" #include "editor/editor_plugin.h" -#include "scene/3d/skeleton.h" +#include "scene/3d/skeleton_3d.h" -class PhysicalBone; -class Joint; +class PhysicalBone3D; +class Joint3D; -class SkeletonEditor : public Node { - GDCLASS(SkeletonEditor, Node); +class Skeleton3DEditor : public Node { + GDCLASS(Skeleton3DEditor, Node); enum Menu { MENU_OPTION_CREATE_PHYSICAL_SKELETON }; struct BoneInfo { - PhysicalBone *physical_bone; + PhysicalBone3D *physical_bone; Transform relative_rest; // Relative to skeleton node BoneInfo() : - physical_bone(NULL) {} + physical_bone(nullptr) {} }; - Skeleton *skeleton; + Skeleton3D *skeleton; MenuButton *options; void _on_click_option(int p_option); - friend class SkeletonEditorPlugin; + friend class Skeleton3DEditorPlugin; protected: void _notification(int p_what); @@ -66,31 +66,31 @@ protected: static void _bind_methods(); void create_physical_skeleton(); - PhysicalBone *create_physical_bone(int bone_id, int bone_child_id, const Vector<BoneInfo> &bones_infos); + PhysicalBone3D *create_physical_bone(int bone_id, int bone_child_id, const Vector<BoneInfo> &bones_infos); public: - void edit(Skeleton *p_node); + void edit(Skeleton3D *p_node); - SkeletonEditor(); - ~SkeletonEditor(); + Skeleton3DEditor(); + ~Skeleton3DEditor(); }; -class SkeletonEditorPlugin : public EditorPlugin { +class Skeleton3DEditorPlugin : public EditorPlugin { - GDCLASS(SkeletonEditorPlugin, EditorPlugin); + GDCLASS(Skeleton3DEditorPlugin, EditorPlugin); EditorNode *editor; - SkeletonEditor *skeleton_editor; + Skeleton3DEditor *skeleton_editor; public: - virtual String get_name() const { return "Skeleton"; } + virtual String get_name() const { return "Skeleton3D"; } virtual bool has_main_screen() const { return false; } virtual void edit(Object *p_object); virtual bool handles(Object *p_object) const; virtual void make_visible(bool p_visible); - SkeletonEditorPlugin(EditorNode *p_node); - ~SkeletonEditorPlugin(); + Skeleton3DEditorPlugin(EditorNode *p_node); + ~Skeleton3DEditorPlugin(); }; -#endif // SKELETON_EDITOR_PLUGIN_H +#endif // SKELETON_3D_EDITOR_PLUGIN_H diff --git a/editor/plugins/skeleton_ik_editor_plugin.cpp b/editor/plugins/skeleton_ik_3d_editor_plugin.cpp index b031bd71d3..a22534eac0 100644 --- a/editor/plugins/skeleton_ik_editor_plugin.cpp +++ b/editor/plugins/skeleton_ik_3d_editor_plugin.cpp @@ -1,5 +1,5 @@ /*************************************************************************/ -/* skeleton_ik_editor_plugin.cpp */ +/* skeleton_ik_3d_editor_plugin.cpp */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ @@ -28,11 +28,11 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#include "skeleton_ik_editor_plugin.h" +#include "skeleton_ik_3d_editor_plugin.h" -#include "scene/animation/skeleton_ik.h" +#include "scene/3d/skeleton_ik_3d.h" -void SkeletonIKEditorPlugin::_play() { +void SkeletonIK3DEditorPlugin::_play() { if (!skeleton_ik) return; @@ -44,14 +44,11 @@ void SkeletonIKEditorPlugin::_play() { skeleton_ik->start(); } else { skeleton_ik->stop(); - - for (int i = 0; i < skeleton_ik->get_parent_skeleton()->get_bone_count(); ++i) { - skeleton_ik->get_parent_skeleton()->set_bone_global_pose_override(i, Transform(), 0); - } + skeleton_ik->get_parent_skeleton()->clear_bones_global_pose_override(); } } -void SkeletonIKEditorPlugin::edit(Object *p_object) { +void SkeletonIK3DEditorPlugin::edit(Object *p_object) { if (p_object != skeleton_ik) { if (skeleton_ik) { @@ -60,19 +57,19 @@ void SkeletonIKEditorPlugin::edit(Object *p_object) { } } - SkeletonIK *s = Object::cast_to<SkeletonIK>(p_object); + SkeletonIK3D *s = Object::cast_to<SkeletonIK3D>(p_object); if (!s) return; skeleton_ik = s; } -bool SkeletonIKEditorPlugin::handles(Object *p_object) const { +bool SkeletonIK3DEditorPlugin::handles(Object *p_object) const { - return p_object->is_class("SkeletonIK"); + return p_object->is_class("SkeletonIK3D"); } -void SkeletonIKEditorPlugin::make_visible(bool p_visible) { +void SkeletonIK3DEditorPlugin::make_visible(bool p_visible) { if (p_visible) play_btn->show(); @@ -80,20 +77,20 @@ void SkeletonIKEditorPlugin::make_visible(bool p_visible) { play_btn->hide(); } -void SkeletonIKEditorPlugin::_bind_methods() { +void SkeletonIK3DEditorPlugin::_bind_methods() { } -SkeletonIKEditorPlugin::SkeletonIKEditorPlugin(EditorNode *p_node) { +SkeletonIK3DEditorPlugin::SkeletonIK3DEditorPlugin(EditorNode *p_node) { editor = p_node; play_btn = memnew(Button); - play_btn->set_icon(editor->get_gui_base()->get_icon("Play", "EditorIcons")); + play_btn->set_icon(editor->get_gui_base()->get_theme_icon("Play", "EditorIcons")); play_btn->set_text(TTR("Play IK")); play_btn->set_toggle_mode(true); play_btn->hide(); - play_btn->connect("pressed", callable_mp(this, &SkeletonIKEditorPlugin::_play)); + play_btn->connect("pressed", callable_mp(this, &SkeletonIK3DEditorPlugin::_play)); add_control_to_container(CONTAINER_SPATIAL_EDITOR_MENU, play_btn); - skeleton_ik = NULL; + skeleton_ik = nullptr; } -SkeletonIKEditorPlugin::~SkeletonIKEditorPlugin() {} +SkeletonIK3DEditorPlugin::~SkeletonIK3DEditorPlugin() {} diff --git a/editor/plugins/skeleton_ik_editor_plugin.h b/editor/plugins/skeleton_ik_3d_editor_plugin.h index 814eb8ff5b..88472a2963 100644 --- a/editor/plugins/skeleton_ik_editor_plugin.h +++ b/editor/plugins/skeleton_ik_3d_editor_plugin.h @@ -1,5 +1,5 @@ /*************************************************************************/ -/* skeleton_ik_editor_plugin.h */ +/* skeleton_ik_3d_editor_plugin.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ @@ -28,19 +28,19 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#ifndef SKELETON_IK_EDITOR_PLUGIN_H -#define SKELETON_IK_EDITOR_PLUGIN_H +#ifndef SKELETON_IK_3D_EDITOR_PLUGIN_H +#define SKELETON_IK_3D_EDITOR_PLUGIN_H #include "editor/editor_node.h" #include "editor/editor_plugin.h" -class SkeletonIK; +class SkeletonIK3D; -class SkeletonIKEditorPlugin : public EditorPlugin { +class SkeletonIK3DEditorPlugin : public EditorPlugin { - GDCLASS(SkeletonIKEditorPlugin, EditorPlugin); + GDCLASS(SkeletonIK3DEditorPlugin, EditorPlugin); - SkeletonIK *skeleton_ik; + SkeletonIK3D *skeleton_ik; Button *play_btn; EditorNode *editor; @@ -51,14 +51,14 @@ protected: static void _bind_methods(); public: - virtual String get_name() const { return "SkeletonIK"; } + virtual String get_name() const { return "SkeletonIK3D"; } bool has_main_screen() const { return false; } virtual void edit(Object *p_object); virtual bool handles(Object *p_object) const; virtual void make_visible(bool p_visible); - SkeletonIKEditorPlugin(EditorNode *p_node); - ~SkeletonIKEditorPlugin(); + SkeletonIK3DEditorPlugin(EditorNode *p_node); + ~SkeletonIK3DEditorPlugin(); }; -#endif // SKELETON_IK_EDITOR_PLUGIN_H +#endif // SKELETON_IK_3D_EDITOR_PLUGIN_H diff --git a/editor/plugins/sprite_editor_plugin.cpp b/editor/plugins/sprite_2d_editor_plugin.cpp index 2897341f06..ab0f15d3d0 100644 --- a/editor/plugins/sprite_editor_plugin.cpp +++ b/editor/plugins/sprite_2d_editor_plugin.cpp @@ -1,5 +1,5 @@ /*************************************************************************/ -/* sprite_editor_plugin.cpp */ +/* sprite_2d_editor_plugin.cpp */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ @@ -28,7 +28,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#include "sprite_editor_plugin.h" +#include "sprite_2d_editor_plugin.h" #include "canvas_item_editor_plugin.h" #include "editor/editor_scale.h" @@ -39,15 +39,15 @@ #include "scene/gui/box_container.h" #include "thirdparty/misc/clipper.hpp" -void SpriteEditor::_node_removed(Node *p_node) { +void Sprite2DEditor::_node_removed(Node *p_node) { if (p_node == node) { - node = NULL; + node = nullptr; options->hide(); } } -void SpriteEditor::edit(Sprite *p_sprite) { +void Sprite2DEditor::edit(Sprite2D *p_sprite) { node = p_sprite; } @@ -114,7 +114,7 @@ Vector<Vector2> expand(const Vector<Vector2> &points, const Rect2i &rect, float return outPoints; } -void SpriteEditor::_menu_option(int p_option) { +void Sprite2DEditor::_menu_option(int p_option) { if (!node) { return; @@ -165,18 +165,18 @@ void SpriteEditor::_menu_option(int p_option) { } } -void SpriteEditor::_update_mesh_data() { +void Sprite2DEditor::_update_mesh_data() { Ref<Texture2D> texture = node->get_texture(); if (texture.is_null()) { - err_dialog->set_text(TTR("Sprite is empty!")); - err_dialog->popup_centered_minsize(); + err_dialog->set_text(TTR("Sprite2D is empty!")); + err_dialog->popup_centered(); return; } if (node->get_hframes() > 1 || node->get_vframes() > 1) { err_dialog->set_text(TTR("Can't convert a sprite using animation frames to mesh.")); - err_dialog->popup_centered_minsize(); + err_dialog->popup_centered(); return; } @@ -296,7 +296,7 @@ void SpriteEditor::_update_mesh_data() { debug_uv->update(); } -void SpriteEditor::_create_node() { +void Sprite2DEditor::_create_node() { switch (selected_menu_item) { case MENU_OPTION_CONVERT_TO_MESH_2D: { _convert_to_mesh_2d_node(); @@ -313,11 +313,11 @@ void SpriteEditor::_create_node() { } } -void SpriteEditor::_convert_to_mesh_2d_node() { +void Sprite2DEditor::_convert_to_mesh_2d_node() { if (computed_vertices.size() < 3) { err_dialog->set_text(TTR("Invalid geometry, can't replace by mesh.")); - err_dialog->popup_centered_minsize(); + err_dialog->popup_centered(); return; } @@ -344,11 +344,11 @@ void SpriteEditor::_convert_to_mesh_2d_node() { ur->commit_action(); } -void SpriteEditor::_convert_to_polygon_2d_node() { +void Sprite2DEditor::_convert_to_polygon_2d_node() { if (computed_outline_lines.empty()) { err_dialog->set_text(TTR("Invalid geometry, can't create polygon.")); - err_dialog->popup_centered_minsize(); + err_dialog->popup_centered(); return; } @@ -403,11 +403,11 @@ void SpriteEditor::_convert_to_polygon_2d_node() { ur->commit_action(); } -void SpriteEditor::_create_collision_polygon_2d_node() { +void Sprite2DEditor::_create_collision_polygon_2d_node() { if (computed_outline_lines.empty()) { err_dialog->set_text(TTR("Invalid geometry, can't create collision polygon.")); - err_dialog->popup_centered_minsize(); + err_dialog->popup_centered(); return; } @@ -427,11 +427,11 @@ void SpriteEditor::_create_collision_polygon_2d_node() { } } -void SpriteEditor::_create_light_occluder_2d_node() { +void Sprite2DEditor::_create_light_occluder_2d_node() { if (computed_outline_lines.empty()) { err_dialog->set_text(TTR("Invalid geometry, can't create light occluder.")); - err_dialog->popup_centered_minsize(); + err_dialog->popup_centered(); return; } @@ -462,7 +462,7 @@ void SpriteEditor::_create_light_occluder_2d_node() { } } -void SpriteEditor::_add_as_sibling_or_child(Node *p_own_node, Node *p_new_node) { +void Sprite2DEditor::_add_as_sibling_or_child(Node *p_own_node, Node *p_new_node) { // Can't make sibling if own node is scene root if (p_own_node != this->get_tree()->get_edited_scene_root()) { p_own_node->get_parent()->add_child(p_new_node, true); @@ -474,7 +474,7 @@ void SpriteEditor::_add_as_sibling_or_child(Node *p_own_node, Node *p_new_node) p_new_node->set_owner(this->get_tree()->get_edited_scene_root()); } -void SpriteEditor::_debug_uv_draw() { +void Sprite2DEditor::_debug_uv_draw() { Ref<Texture2D> tex = node->get_texture(); ERR_FAIL_COND(!tex.is_valid()); @@ -502,19 +502,19 @@ void SpriteEditor::_debug_uv_draw() { } } -void SpriteEditor::_bind_methods() { +void Sprite2DEditor::_bind_methods() { - ClassDB::bind_method("_add_as_sibling_or_child", &SpriteEditor::_add_as_sibling_or_child); + ClassDB::bind_method("_add_as_sibling_or_child", &Sprite2DEditor::_add_as_sibling_or_child); } -SpriteEditor::SpriteEditor() { +Sprite2DEditor::Sprite2DEditor() { options = memnew(MenuButton); CanvasItemEditor::get_singleton()->add_control_to_menu_panel(options); - options->set_text(TTR("Sprite")); - options->set_icon(EditorNode::get_singleton()->get_gui_base()->get_icon("Sprite", "EditorIcons")); + options->set_text(TTR("Sprite2D")); + options->set_icon(EditorNode::get_singleton()->get_gui_base()->get_theme_icon("Sprite2D", "EditorIcons")); options->get_popup()->add_item(TTR("Convert to Mesh2D"), MENU_OPTION_CONVERT_TO_MESH_2D); options->get_popup()->add_item(TTR("Convert to Polygon2D"), MENU_OPTION_CONVERT_TO_POLYGON_2D); @@ -522,7 +522,7 @@ SpriteEditor::SpriteEditor() { options->get_popup()->add_item(TTR("Create LightOccluder2D Sibling"), MENU_OPTION_CREATE_LIGHT_OCCLUDER_2D); options->set_switch_on_hover(true); - options->get_popup()->connect("id_pressed", callable_mp(this, &SpriteEditor::_menu_option)); + options->get_popup()->connect("id_pressed", callable_mp(this, &Sprite2DEditor::_menu_option)); err_dialog = memnew(AcceptDialog); add_child(err_dialog); @@ -538,9 +538,9 @@ SpriteEditor::SpriteEditor() { scroll->set_enable_v_scroll(true); vb->add_margin_child(TTR("Preview:"), scroll, true); debug_uv = memnew(Control); - debug_uv->connect("draw", callable_mp(this, &SpriteEditor::_debug_uv_draw)); + debug_uv->connect("draw", callable_mp(this, &Sprite2DEditor::_debug_uv_draw)); scroll->add_child(debug_uv); - debug_uv_dialog->connect("confirmed", callable_mp(this, &SpriteEditor::_create_node)); + debug_uv_dialog->connect("confirmed", callable_mp(this, &Sprite2DEditor::_create_node)); HBoxContainer *hb = memnew(HBoxContainer); hb->add_child(memnew(Label(TTR("Simplification: ")))); @@ -569,43 +569,43 @@ SpriteEditor::SpriteEditor() { hb->add_spacer(); update_preview = memnew(Button); update_preview->set_text(TTR("Update Preview")); - update_preview->connect("pressed", callable_mp(this, &SpriteEditor::_update_mesh_data)); + update_preview->connect("pressed", callable_mp(this, &Sprite2DEditor::_update_mesh_data)); hb->add_child(update_preview); vb->add_margin_child(TTR("Settings:"), hb); add_child(debug_uv_dialog); } -void SpriteEditorPlugin::edit(Object *p_object) { +void Sprite2DEditorPlugin::edit(Object *p_object) { - sprite_editor->edit(Object::cast_to<Sprite>(p_object)); + sprite_editor->edit(Object::cast_to<Sprite2D>(p_object)); } -bool SpriteEditorPlugin::handles(Object *p_object) const { +bool Sprite2DEditorPlugin::handles(Object *p_object) const { - return p_object->is_class("Sprite"); + return p_object->is_class("Sprite2D"); } -void SpriteEditorPlugin::make_visible(bool p_visible) { +void Sprite2DEditorPlugin::make_visible(bool p_visible) { if (p_visible) { sprite_editor->options->show(); } else { sprite_editor->options->hide(); - sprite_editor->edit(NULL); + sprite_editor->edit(nullptr); } } -SpriteEditorPlugin::SpriteEditorPlugin(EditorNode *p_node) { +Sprite2DEditorPlugin::Sprite2DEditorPlugin(EditorNode *p_node) { editor = p_node; - sprite_editor = memnew(SpriteEditor); + sprite_editor = memnew(Sprite2DEditor); editor->get_viewport()->add_child(sprite_editor); make_visible(false); //sprite_editor->options->hide(); } -SpriteEditorPlugin::~SpriteEditorPlugin() { +Sprite2DEditorPlugin::~Sprite2DEditorPlugin() { } diff --git a/editor/plugins/sprite_editor_plugin.h b/editor/plugins/sprite_2d_editor_plugin.h index 998851b6ad..0add77843b 100644 --- a/editor/plugins/sprite_editor_plugin.h +++ b/editor/plugins/sprite_2d_editor_plugin.h @@ -1,5 +1,5 @@ /*************************************************************************/ -/* sprite_editor_plugin.h */ +/* sprite_2d_editor_plugin.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ @@ -33,12 +33,12 @@ #include "editor/editor_node.h" #include "editor/editor_plugin.h" -#include "scene/2d/sprite.h" +#include "scene/2d/sprite_2d.h" #include "scene/gui/spin_box.h" -class SpriteEditor : public Control { +class Sprite2DEditor : public Control { - GDCLASS(SpriteEditor, Control); + GDCLASS(Sprite2DEditor, Control); enum Menu { MENU_OPTION_CONVERT_TO_MESH_2D, @@ -49,7 +49,7 @@ class SpriteEditor : public Control { Menu selected_menu_item; - Sprite *node; + Sprite2D *node; MenuButton *options; @@ -74,7 +74,7 @@ class SpriteEditor : public Control { void _menu_option(int p_option); //void _create_uv_lines(); - friend class SpriteEditorPlugin; + friend class Sprite2DEditorPlugin; void _debug_uv_draw(); void _update_mesh_data(); @@ -92,26 +92,26 @@ protected: static void _bind_methods(); public: - void edit(Sprite *p_sprite); - SpriteEditor(); + void edit(Sprite2D *p_sprite); + Sprite2DEditor(); }; -class SpriteEditorPlugin : public EditorPlugin { +class Sprite2DEditorPlugin : public EditorPlugin { - GDCLASS(SpriteEditorPlugin, EditorPlugin); + GDCLASS(Sprite2DEditorPlugin, EditorPlugin); - SpriteEditor *sprite_editor; + Sprite2DEditor *sprite_editor; EditorNode *editor; public: - virtual String get_name() const { return "Sprite"; } + virtual String get_name() const { return "Sprite2D"; } bool has_main_screen() const { return false; } virtual void edit(Object *p_object); virtual bool handles(Object *p_object) const; virtual void make_visible(bool p_visible); - SpriteEditorPlugin(EditorNode *p_node); - ~SpriteEditorPlugin(); + Sprite2DEditorPlugin(EditorNode *p_node); + ~Sprite2DEditorPlugin(); }; #endif // SPRITE_EDITOR_PLUGIN_H diff --git a/editor/plugins/sprite_frames_editor_plugin.cpp b/editor/plugins/sprite_frames_editor_plugin.cpp index e6b0e3142c..76e60bb014 100644 --- a/editor/plugins/sprite_frames_editor_plugin.cpp +++ b/editor/plugins/sprite_frames_editor_plugin.cpp @@ -81,7 +81,7 @@ void SpriteFramesEditor::_sheet_preview_draw() { return; } - Color accent = get_color("accent_color", "Editor"); + Color accent = get_theme_color("accent_color", "Editor"); for (Set<int>::Element *E = frames_selected.front(); E; E = E->next()) { int idx = E->get(); @@ -223,24 +223,24 @@ void SpriteFramesEditor::_notification(int p_what) { switch (p_what) { case NOTIFICATION_ENTER_TREE: { - load->set_icon(get_icon("Load", "EditorIcons")); - load_sheet->set_icon(get_icon("SpriteSheet", "EditorIcons")); - copy->set_icon(get_icon("ActionCopy", "EditorIcons")); - paste->set_icon(get_icon("ActionPaste", "EditorIcons")); - empty->set_icon(get_icon("InsertBefore", "EditorIcons")); - empty2->set_icon(get_icon("InsertAfter", "EditorIcons")); - move_up->set_icon(get_icon("MoveLeft", "EditorIcons")); - move_down->set_icon(get_icon("MoveRight", "EditorIcons")); - _delete->set_icon(get_icon("Remove", "EditorIcons")); - new_anim->set_icon(get_icon("New", "EditorIcons")); - remove_anim->set_icon(get_icon("Remove", "EditorIcons")); + load->set_icon(get_theme_icon("Load", "EditorIcons")); + load_sheet->set_icon(get_theme_icon("SpriteSheet", "EditorIcons")); + copy->set_icon(get_theme_icon("ActionCopy", "EditorIcons")); + paste->set_icon(get_theme_icon("ActionPaste", "EditorIcons")); + empty->set_icon(get_theme_icon("InsertBefore", "EditorIcons")); + empty2->set_icon(get_theme_icon("InsertAfter", "EditorIcons")); + move_up->set_icon(get_theme_icon("MoveLeft", "EditorIcons")); + move_down->set_icon(get_theme_icon("MoveRight", "EditorIcons")); + _delete->set_icon(get_theme_icon("Remove", "EditorIcons")); + new_anim->set_icon(get_theme_icon("New", "EditorIcons")); + remove_anim->set_icon(get_theme_icon("Remove", "EditorIcons")); [[fallthrough]]; } case NOTIFICATION_THEME_CHANGED: { - splite_sheet_scroll->add_style_override("bg", get_stylebox("bg", "Tree")); + splite_sheet_scroll->add_theme_style_override("bg", get_theme_stylebox("bg", "Tree")); } break; case NOTIFICATION_READY: { - add_constant_override("autohide", 1); // Fixes the dragger always showing up. + add_theme_constant_override("autohide", 1); // Fixes the dragger always showing up. } break; } } @@ -262,7 +262,7 @@ void SpriteFramesEditor::_file_load_request(const Vector<String> &p_path, int p_ //dialog->get_cancel()->set_text("Close"); dialog->get_ok()->set_text(TTR("Close")); - dialog->popup_centered_minsize(); + dialog->popup_centered(); return; ///beh should show an error i guess } @@ -301,7 +301,7 @@ void SpriteFramesEditor::_load_pressed() { for (int i = 0; i < extensions.size(); i++) file->add_filter("*." + extensions[i]); - file->set_mode(EditorFileDialog::MODE_OPEN_FILES); + file->set_file_mode(EditorFileDialog::FILE_MODE_OPEN_FILES); file->popup_centered_ratio(); } @@ -316,7 +316,7 @@ void SpriteFramesEditor::_paste_pressed() { dialog->set_title(TTR("Error!")); //dialog->get_cancel()->set_text("Close"); dialog->get_ok()->set_text(TTR("Close")); - dialog->popup_centered_minsize(); + dialog->popup_centered(); return; ///beh should show an error i guess } @@ -485,7 +485,7 @@ static void _find_anim_sprites(Node *p_node, List<Node *> *r_nodes, Ref<SpriteFr return; { - AnimatedSprite *as = Object::cast_to<AnimatedSprite>(p_node); + AnimatedSprite2D *as = Object::cast_to<AnimatedSprite2D>(p_node); if (as && as->get_sprite_frames() == p_sfames) { r_nodes->push_back(p_node); } @@ -591,7 +591,7 @@ void SpriteFramesEditor::_animation_remove() { return; delete_dialog->set_text(TTR("Delete Animation?")); - delete_dialog->popup_centered_minsize(); + delete_dialog->popup_centered(); } void SpriteFramesEditor::_animation_remove_confirmed() { @@ -1058,7 +1058,7 @@ SpriteFramesEditor::SpriteFramesEditor() { file_split_sheet = memnew(EditorFileDialog); file_split_sheet->set_title(TTR("Create Frames from Sprite Sheet")); - file_split_sheet->set_mode(EditorFileDialog::MODE_OPEN_FILE); + file_split_sheet->set_file_mode(EditorFileDialog::FILE_MODE_OPEN_FILE); add_child(file_split_sheet); file_split_sheet->connect("file_selected", callable_mp(this, &SpriteFramesEditor::_prepare_sprite_sheet)); } @@ -1068,11 +1068,17 @@ void SpriteFramesEditorPlugin::edit(Object *p_object) { frames_editor->set_undo_redo(&get_undo_redo()); SpriteFrames *s; - AnimatedSprite *animated_sprite = Object::cast_to<AnimatedSprite>(p_object); + AnimatedSprite2D *animated_sprite = Object::cast_to<AnimatedSprite2D>(p_object); if (animated_sprite) { s = *animated_sprite->get_sprite_frames(); } else { - s = Object::cast_to<SpriteFrames>(p_object); + AnimatedSprite3D *animated_sprite_3d = Object::cast_to<AnimatedSprite3D>(p_object); + if (animated_sprite_3d) { + s = *animated_sprite_3d->get_sprite_frames(); + } else { + + s = Object::cast_to<SpriteFrames>(p_object); + } } frames_editor->edit(s); @@ -1080,9 +1086,12 @@ void SpriteFramesEditorPlugin::edit(Object *p_object) { bool SpriteFramesEditorPlugin::handles(Object *p_object) const { - AnimatedSprite *animated_sprite = Object::cast_to<AnimatedSprite>(p_object); + AnimatedSprite2D *animated_sprite = Object::cast_to<AnimatedSprite2D>(p_object); + AnimatedSprite3D *animated_sprite_3d = Object::cast_to<AnimatedSprite3D>(p_object); if (animated_sprite && *animated_sprite->get_sprite_frames()) { return true; + } else if (animated_sprite_3d && *animated_sprite_3d->get_sprite_frames()) { + return true; } else { return p_object->is_class("SpriteFrames"); } diff --git a/editor/plugins/sprite_frames_editor_plugin.h b/editor/plugins/sprite_frames_editor_plugin.h index 1fa93b5c47..89d9bc6fd3 100644 --- a/editor/plugins/sprite_frames_editor_plugin.h +++ b/editor/plugins/sprite_frames_editor_plugin.h @@ -33,7 +33,7 @@ #include "editor/editor_node.h" #include "editor/editor_plugin.h" -#include "scene/2d/animated_sprite.h" +#include "scene/2d/animated_sprite_2d.h" #include "scene/gui/dialogs.h" #include "scene/gui/file_dialog.h" #include "scene/gui/split_container.h" diff --git a/editor/plugins/style_box_editor_plugin.cpp b/editor/plugins/style_box_editor_plugin.cpp index a92194da17..eb6e261305 100644 --- a/editor/plugins/style_box_editor_plugin.cpp +++ b/editor/plugins/style_box_editor_plugin.cpp @@ -34,7 +34,7 @@ bool EditorInspectorPluginStyleBox::can_handle(Object *p_object) { - return Object::cast_to<StyleBox>(p_object) != NULL; + return Object::cast_to<StyleBox>(p_object) != nullptr; } void EditorInspectorPluginStyleBox::parse_begin(Object *p_object) { @@ -45,7 +45,7 @@ void EditorInspectorPluginStyleBox::parse_begin(Object *p_object) { preview->edit(sb); add_custom_control(preview); } -bool EditorInspectorPluginStyleBox::parse_property(Object *p_object, Variant::Type p_type, const String &p_path, PropertyHint p_hint, const String &p_hint_text, int p_usage) { +bool EditorInspectorPluginStyleBox::parse_property(Object *p_object, Variant::Type p_type, const String &p_path, PropertyHint p_hint, const String &p_hint_text, int p_usage, bool p_wide) { return false; //do not want } void EditorInspectorPluginStyleBox::parse_end() { @@ -57,7 +57,7 @@ void StyleBoxPreview::edit(const Ref<StyleBox> &p_stylebox) { stylebox->disconnect("changed", callable_mp(this, &StyleBoxPreview::_sb_changed)); stylebox = p_stylebox; if (p_stylebox.is_valid()) { - preview->add_style_override("panel", stylebox); + preview->add_theme_style_override("panel", stylebox); stylebox->connect("changed", callable_mp(this, &StyleBoxPreview::_sb_changed)); } _sb_changed(); diff --git a/editor/plugins/style_box_editor_plugin.h b/editor/plugins/style_box_editor_plugin.h index f4a72d9d1c..1eea9260b2 100644 --- a/editor/plugins/style_box_editor_plugin.h +++ b/editor/plugins/style_box_editor_plugin.h @@ -62,7 +62,7 @@ class EditorInspectorPluginStyleBox : public EditorInspectorPlugin { public: virtual bool can_handle(Object *p_object); virtual void parse_begin(Object *p_object); - virtual bool parse_property(Object *p_object, Variant::Type p_type, const String &p_path, PropertyHint p_hint, const String &p_hint_text, int p_usage); + virtual bool parse_property(Object *p_object, Variant::Type p_type, const String &p_path, PropertyHint p_hint, const String &p_hint_text, int p_usage, bool p_wide = false); virtual void parse_end(); }; diff --git a/editor/plugins/text_editor.cpp b/editor/plugins/text_editor.cpp index 35f23ccf1d..2786a568ea 100644 --- a/editor/plugins/text_editor.cpp +++ b/editor/plugins/text_editor.cpp @@ -41,7 +41,7 @@ void TextEditor::add_syntax_highlighter(SyntaxHighlighter *p_highlighter) { void TextEditor::set_syntax_highlighter(SyntaxHighlighter *p_highlighter) { TextEdit *te = code_editor->get_text_edit(); te->_set_syntax_highlighting(p_highlighter); - if (p_highlighter != NULL) { + if (p_highlighter != nullptr) { highlighter_menu->set_item_checked(highlighter_menu->get_item_idx_from_text(p_highlighter->get_name()), true); } else { highlighter_menu->set_item_checked(highlighter_menu->get_item_idx_from_text("Standard"), true); @@ -49,12 +49,12 @@ void TextEditor::set_syntax_highlighter(SyntaxHighlighter *p_highlighter) { // little work around. GDScript highlighter goes through text_edit for colours, // so to remove all colours we need to set and unset them here. - if (p_highlighter == NULL) { // standard + if (p_highlighter == nullptr) { // standard TextEdit *text_edit = code_editor->get_text_edit(); - text_edit->add_color_override("number_color", colors_cache.font_color); - text_edit->add_color_override("function_color", colors_cache.font_color); - text_edit->add_color_override("number_color", colors_cache.font_color); - text_edit->add_color_override("member_variable_color", colors_cache.font_color); + text_edit->add_theme_color_override("number_color", colors_cache.font_color); + text_edit->add_theme_color_override("function_color", colors_cache.font_color); + text_edit->add_theme_color_override("number_color", colors_cache.font_color); + text_edit->add_theme_color_override("member_variable_color", colors_cache.font_color); } else { _load_theme_settings(); } @@ -62,7 +62,7 @@ void TextEditor::set_syntax_highlighter(SyntaxHighlighter *p_highlighter) { void TextEditor::_change_syntax_highlighter(int p_idx) { Map<String, SyntaxHighlighter *>::Element *el = highlighters.front(); - while (el != NULL) { + while (el != nullptr) { highlighter_menu->set_item_checked(highlighter_menu->get_item_idx_from_text(el->key()), false); el = el->next(); } @@ -107,35 +107,35 @@ void TextEditor::_load_theme_settings() { Color comment_color = EDITOR_GET("text_editor/highlighting/comment_color"); Color string_color = EDITOR_GET("text_editor/highlighting/string_color"); - text_edit->add_color_override("background_color", background_color); - text_edit->add_color_override("completion_background_color", completion_background_color); - text_edit->add_color_override("completion_selected_color", completion_selected_color); - text_edit->add_color_override("completion_existing_color", completion_existing_color); - text_edit->add_color_override("completion_scroll_color", completion_scroll_color); - text_edit->add_color_override("completion_font_color", completion_font_color); - text_edit->add_color_override("font_color", text_color); - text_edit->add_color_override("line_number_color", line_number_color); - text_edit->add_color_override("caret_color", caret_color); - text_edit->add_color_override("caret_background_color", caret_background_color); - text_edit->add_color_override("font_color_selected", text_selected_color); - text_edit->add_color_override("selection_color", selection_color); - text_edit->add_color_override("brace_mismatch_color", brace_mismatch_color); - text_edit->add_color_override("current_line_color", current_line_color); - text_edit->add_color_override("line_length_guideline_color", line_length_guideline_color); - text_edit->add_color_override("word_highlighted_color", word_highlighted_color); - text_edit->add_color_override("number_color", number_color); - text_edit->add_color_override("function_color", function_color); - text_edit->add_color_override("member_variable_color", member_variable_color); - text_edit->add_color_override("breakpoint_color", breakpoint_color); - text_edit->add_color_override("executing_line_color", executing_line_color); - text_edit->add_color_override("mark_color", mark_color); - text_edit->add_color_override("bookmark_color", bookmark_color); - text_edit->add_color_override("code_folding_color", code_folding_color); - text_edit->add_color_override("search_result_color", search_result_color); - text_edit->add_color_override("search_result_border_color", search_result_border_color); - text_edit->add_color_override("symbol_color", symbol_color); - - text_edit->add_constant_override("line_spacing", EDITOR_DEF("text_editor/theme/line_spacing", 6)); + text_edit->add_theme_color_override("background_color", background_color); + text_edit->add_theme_color_override("completion_background_color", completion_background_color); + text_edit->add_theme_color_override("completion_selected_color", completion_selected_color); + text_edit->add_theme_color_override("completion_existing_color", completion_existing_color); + text_edit->add_theme_color_override("completion_scroll_color", completion_scroll_color); + text_edit->add_theme_color_override("completion_font_color", completion_font_color); + text_edit->add_theme_color_override("font_color", text_color); + text_edit->add_theme_color_override("line_number_color", line_number_color); + text_edit->add_theme_color_override("caret_color", caret_color); + text_edit->add_theme_color_override("caret_background_color", caret_background_color); + text_edit->add_theme_color_override("font_color_selected", text_selected_color); + text_edit->add_theme_color_override("selection_color", selection_color); + text_edit->add_theme_color_override("brace_mismatch_color", brace_mismatch_color); + text_edit->add_theme_color_override("current_line_color", current_line_color); + text_edit->add_theme_color_override("line_length_guideline_color", line_length_guideline_color); + text_edit->add_theme_color_override("word_highlighted_color", word_highlighted_color); + text_edit->add_theme_color_override("number_color", number_color); + text_edit->add_theme_color_override("function_color", function_color); + text_edit->add_theme_color_override("member_variable_color", member_variable_color); + text_edit->add_theme_color_override("breakpoint_color", breakpoint_color); + text_edit->add_theme_color_override("executing_line_color", executing_line_color); + text_edit->add_theme_color_override("mark_color", mark_color); + text_edit->add_theme_color_override("bookmark_color", bookmark_color); + text_edit->add_theme_color_override("code_folding_color", code_folding_color); + text_edit->add_theme_color_override("search_result_color", search_result_color); + text_edit->add_theme_color_override("search_result_border_color", search_result_border_color); + text_edit->add_theme_color_override("symbol_color", symbol_color); + + text_edit->add_theme_constant_override("line_spacing", EDITOR_DEF("text_editor/theme/line_spacing", 6)); colors_cache.font_color = text_color; colors_cache.symbol_color = symbol_color; @@ -163,7 +163,7 @@ String TextEditor::get_name() { return name; } -Ref<Texture2D> TextEditor::get_icon() { +Ref<Texture2D> TextEditor::get_theme_icon() { return EditorNode::get_singleton()->get_object_icon(text_file.operator->(), ""); } @@ -533,7 +533,7 @@ static ScriptEditorBase *create_editor(const RES &p_resource) { if (Object::cast_to<TextFile>(*p_resource)) { return memnew(TextEditor); } - return NULL; + return nullptr; } void TextEditor::register_editor() { @@ -624,7 +624,7 @@ void TextEditor::_make_context_menu(bool p_selection, bool p_can_fold, bool p_is TextEditor::TextEditor() { code_editor = memnew(CodeTextEditor); add_child(code_editor); - code_editor->add_constant_override("separation", 0); + code_editor->add_theme_constant_override("separation", 0); code_editor->connect("load_theme_settings", callable_mp(this, &TextEditor::_load_theme_settings)); code_editor->connect("validate_script", callable_mp(this, &TextEditor::_validate_script)); code_editor->set_anchors_and_margins_preset(Control::PRESET_WIDE); @@ -694,7 +694,7 @@ TextEditor::TextEditor() { convert_case->add_shortcut(ED_SHORTCUT("script_text_editor/capitalize", TTR("Capitalize")), EDIT_CAPITALIZE); convert_case->connect("id_pressed", callable_mp(this, &TextEditor::_edit_option)); - highlighters["Standard"] = NULL; + highlighters["Standard"] = nullptr; highlighter_menu = memnew(PopupMenu); highlighter_menu->set_name("highlighter_menu"); edit_menu->get_popup()->add_child(highlighter_menu); @@ -716,7 +716,7 @@ TextEditor::TextEditor() { goto_menu->get_popup()->add_child(bookmarks_menu); goto_menu->get_popup()->add_submenu_item(TTR("Bookmarks"), "Bookmarks"); _update_bookmark_list(); - bookmarks_menu->connect("about_to_show", callable_mp(this, &TextEditor::_update_bookmark_list)); + bookmarks_menu->connect("about_to_popup", callable_mp(this, &TextEditor::_update_bookmark_list)); bookmarks_menu->connect("index_pressed", callable_mp(this, &TextEditor::_bookmark_item_pressed)); goto_line_dialog = memnew(GotoLineDialog); @@ -727,7 +727,7 @@ TextEditor::TextEditor() { TextEditor::~TextEditor() { for (const Map<String, SyntaxHighlighter *>::Element *E = highlighters.front(); E; E = E->next()) { - if (E->get() != NULL) { + if (E->get() != nullptr) { memdelete(E->get()); } } diff --git a/editor/plugins/text_editor.h b/editor/plugins/text_editor.h index c80052e7ba..b41e11c3aa 100644 --- a/editor/plugins/text_editor.h +++ b/editor/plugins/text_editor.h @@ -121,7 +121,7 @@ public: virtual void set_syntax_highlighter(SyntaxHighlighter *p_highlighter); virtual String get_name(); - virtual Ref<Texture2D> get_icon(); + virtual Ref<Texture2D> get_theme_icon(); virtual RES get_edited_resource() const; virtual void set_edited_resource(const RES &p_res); void set_edited_file(const Ref<TextFile> &p_file); diff --git a/editor/plugins/texture_editor_plugin.cpp b/editor/plugins/texture_editor_plugin.cpp index 60f9bb5dc1..c1184c1c89 100644 --- a/editor/plugins/texture_editor_plugin.cpp +++ b/editor/plugins/texture_editor_plugin.cpp @@ -46,7 +46,7 @@ void TextureEditor::_notification(int p_what) { if (p_what == NOTIFICATION_DRAW) { - Ref<Texture2D> checkerboard = get_icon("Checkerboard", "EditorIcons"); + Ref<Texture2D> checkerboard = get_theme_icon("Checkerboard", "EditorIcons"); Size2 size = get_size(); draw_texture_rect(checkerboard, Rect2(Point2(), size), true); @@ -79,7 +79,7 @@ void TextureEditor::_notification(int p_what) { draw_texture_rect(texture, Rect2(ofs_x, ofs_y, tex_width, tex_height)); - Ref<Font> font = get_font("font", "Label"); + Ref<Font> font = get_theme_font("font", "Label"); String format; if (Object::cast_to<ImageTexture>(*texture)) { @@ -144,7 +144,7 @@ TextureEditor::~TextureEditor() { // bool EditorInspectorPluginTexture::can_handle(Object *p_object) { - return Object::cast_to<ImageTexture>(p_object) != NULL || Object::cast_to<AtlasTexture>(p_object) != NULL || Object::cast_to<StreamTexture>(p_object) != NULL || Object::cast_to<LargeTexture>(p_object) != NULL || Object::cast_to<AnimatedTexture>(p_object) != NULL; + return Object::cast_to<ImageTexture>(p_object) != nullptr || Object::cast_to<AtlasTexture>(p_object) != nullptr || Object::cast_to<StreamTexture>(p_object) != nullptr || Object::cast_to<LargeTexture>(p_object) != nullptr || Object::cast_to<AnimatedTexture>(p_object) != nullptr; } void EditorInspectorPluginTexture::parse_begin(Object *p_object) { diff --git a/editor/plugins/texture_region_editor_plugin.cpp b/editor/plugins/texture_region_editor_plugin.cpp index 2262e12f5d..8892d13f51 100644 --- a/editor/plugins/texture_region_editor_plugin.cpp +++ b/editor/plugins/texture_region_editor_plugin.cpp @@ -31,7 +31,7 @@ #include "texture_region_editor_plugin.h" #include "core/core_string_names.h" -#include "core/os/input.h" +#include "core/input/input_filter.h" #include "core/os/keyboard.h" #include "editor/editor_scale.h" #include "scene/gui/check_box.h" @@ -43,13 +43,13 @@ void draw_margin_line(Control *edit_draw, Vector2 from, Vector2 to) { Vector2 line = (to - from).normalized() * 10; while ((to - from).length_squared() > 200) { - edit_draw->draw_line(from, from + line, EditorNode::get_singleton()->get_theme_base()->get_color("mono_color", "Editor"), 2); + edit_draw->draw_line(from, from + line, EditorNode::get_singleton()->get_theme_base()->get_theme_color("mono_color", "Editor"), 2); from += line * 2; } } void TextureRegionEditor::_region_draw() { - Ref<Texture2D> base_tex = NULL; + Ref<Texture2D> base_tex = nullptr; if (node_sprite) base_tex = node_sprite->get_texture(); else if (node_sprite_3d) @@ -68,9 +68,9 @@ void TextureRegionEditor::_region_draw() { mtx.elements[2] = -draw_ofs * draw_zoom; mtx.scale_basis(Vector2(draw_zoom, draw_zoom)); - VS::get_singleton()->canvas_item_add_set_transform(edit_draw->get_canvas_item(), mtx); + RS::get_singleton()->canvas_item_add_set_transform(edit_draw->get_canvas_item(), mtx); edit_draw->draw_texture(base_tex, Point2()); - VS::get_singleton()->canvas_item_add_set_transform(edit_draw->get_canvas_item(), Transform2D()); + RS::get_singleton()->canvas_item_add_set_transform(edit_draw->get_canvas_item(), Transform2D()); if (snap_mode == SNAP_GRID) { Color grid_color = Color(1.0, 1.0, 1.0, 0.15); @@ -134,7 +134,7 @@ void TextureRegionEditor::_region_draw() { } } - Ref<Texture2D> select_handle = get_icon("EditorHandle", "EditorIcons"); + Ref<Texture2D> select_handle = get_theme_icon("EditorHandle", "EditorIcons"); Rect2 scroll_rect(Point2(), base_tex->get_size()); @@ -150,7 +150,7 @@ void TextureRegionEditor::_region_draw() { mtx.basis_xform(raw_endpoints[2]), mtx.basis_xform(raw_endpoints[3]) }; - Color color = get_color("mono_color", "Editor"); + Color color = get_theme_color("mono_color", "Editor"); for (int i = 0; i < 4; i++) { int prev = (i + 3) % 4; @@ -307,7 +307,7 @@ void TextureRegionEditor::_region_input(const Ref<InputEvent> &p_input) { for (List<Rect2>::Element *E = autoslice_cache.front(); E; E = E->next()) { if (E->get().has_point(point)) { rect = E->get(); - if (Input::get_singleton()->is_key_pressed(KEY_CONTROL) && !(Input::get_singleton()->is_key_pressed(KEY_SHIFT | KEY_ALT))) { + if (InputFilter::get_singleton()->is_key_pressed(KEY_CONTROL) && !(InputFilter::get_singleton()->is_key_pressed(KEY_SHIFT | KEY_ALT))) { Rect2 r; if (node_sprite) r = node_sprite->get_region_rect(); @@ -449,7 +449,7 @@ void TextureRegionEditor::_region_input(const Ref<InputEvent> &p_input) { if (mm.is_valid()) { - if (mm->get_button_mask() & BUTTON_MASK_MIDDLE || Input::get_singleton()->is_key_pressed(KEY_SPACE)) { + if (mm->get_button_mask() & BUTTON_MASK_MIDDLE || InputFilter::get_singleton()->is_key_pressed(KEY_SPACE)) { Vector2 dragged(mm->get_relative().x / draw_zoom, mm->get_relative().y / draw_zoom); hscroll->set_value(hscroll->get_value() - dragged.x); @@ -672,7 +672,7 @@ void TextureRegionEditor::_update_autoslice() { autoslice_is_dirty = false; autoslice_cache.clear(); - Ref<Texture2D> texture = NULL; + Ref<Texture2D> texture = nullptr; if (node_sprite) texture = node_sprite->get_texture(); else if (node_sprite_3d) @@ -741,12 +741,12 @@ void TextureRegionEditor::_notification(int p_what) { switch (p_what) { case NOTIFICATION_ENTER_TREE: case NOTIFICATION_THEME_CHANGED: { - edit_draw->add_style_override("panel", get_stylebox("bg", "Tree")); + edit_draw->add_theme_style_override("panel", get_theme_stylebox("bg", "Tree")); } break; case NOTIFICATION_READY: { - zoom_out->set_icon(get_icon("ZoomLess", "EditorIcons")); - zoom_reset->set_icon(get_icon("ZoomReset", "EditorIcons")); - zoom_in->set_icon(get_icon("ZoomMore", "EditorIcons")); + zoom_out->set_icon(get_theme_icon("ZoomLess", "EditorIcons")); + zoom_reset->set_icon(get_theme_icon("ZoomReset", "EditorIcons")); + zoom_in->set_icon(get_theme_icon("ZoomMore", "EditorIcons")); vscroll->set_anchors_and_margins_preset(PRESET_RIGHT_WIDE); hscroll->set_anchors_and_margins_preset(PRESET_BOTTOM_WIDE); @@ -756,7 +756,7 @@ void TextureRegionEditor::_notification(int p_what) { _update_autoslice(); } } break; - case MainLoop::NOTIFICATION_WM_FOCUS_IN: { + case NOTIFICATION_WM_FOCUS_IN: { // This happens when the user leaves the Editor and returns, // they could have changed the textures, so the cache is cleared. cache_map.clear(); @@ -767,11 +767,11 @@ void TextureRegionEditor::_notification(int p_what) { void TextureRegionEditor::_node_removed(Object *p_obj) { if (p_obj == node_sprite || p_obj == node_sprite_3d || p_obj == node_ninepatch || p_obj == obj_styleBox.ptr() || p_obj == atlas_tex.ptr()) { - node_sprite = NULL; - node_sprite_3d = NULL; - node_ninepatch = NULL; - obj_styleBox = Ref<StyleBox>(NULL); - atlas_tex = Ref<AtlasTexture>(NULL); + node_sprite = nullptr; + node_sprite_3d = nullptr; + node_ninepatch = nullptr; + obj_styleBox = Ref<StyleBox>(nullptr); + atlas_tex = Ref<AtlasTexture>(nullptr); hide(); } } @@ -793,14 +793,14 @@ bool TextureRegionEditor::is_atlas_texture() { } bool TextureRegionEditor::is_ninepatch() { - return node_ninepatch != NULL; + return node_ninepatch != nullptr; } Sprite3D *TextureRegionEditor::get_sprite_3d() { return node_sprite_3d; } -Sprite *TextureRegionEditor::get_sprite() { +Sprite2D *TextureRegionEditor::get_sprite() { return node_sprite; } @@ -816,7 +816,7 @@ void TextureRegionEditor::edit(Object *p_obj) { if (atlas_tex.is_valid()) atlas_tex->remove_change_receptor(this); if (p_obj) { - node_sprite = Object::cast_to<Sprite>(p_obj); + node_sprite = Object::cast_to<Sprite2D>(p_obj); node_sprite_3d = Object::cast_to<Sprite3D>(p_obj); node_ninepatch = Object::cast_to<NinePatchRect>(p_obj); if (Object::cast_to<StyleBoxTexture>(p_obj)) @@ -826,11 +826,11 @@ void TextureRegionEditor::edit(Object *p_obj) { p_obj->add_change_receptor(this); _edit_region(); } else { - node_sprite = NULL; - node_sprite_3d = NULL; - node_ninepatch = NULL; - obj_styleBox = Ref<StyleBoxTexture>(NULL); - atlas_tex = Ref<AtlasTexture>(NULL); + node_sprite = nullptr; + node_sprite_3d = nullptr; + node_ninepatch = nullptr; + obj_styleBox = Ref<StyleBoxTexture>(nullptr); + atlas_tex = Ref<AtlasTexture>(nullptr); } edit_draw->update(); if ((node_sprite && !node_sprite->is_region()) || (node_sprite_3d && !node_sprite_3d->is_region())) { @@ -850,7 +850,7 @@ void TextureRegionEditor::_changed_callback(Object *p_changed, const char *p_pro } void TextureRegionEditor::_edit_region() { - Ref<Texture2D> texture = NULL; + Ref<Texture2D> texture = nullptr; if (node_sprite) texture = node_sprite->get_texture(); else if (node_sprite_3d) @@ -896,11 +896,11 @@ Vector2 TextureRegionEditor::snap_point(Vector2 p_target) const { } TextureRegionEditor::TextureRegionEditor(EditorNode *p_editor) { - node_sprite = NULL; - node_sprite_3d = NULL; - node_ninepatch = NULL; - obj_styleBox = Ref<StyleBoxTexture>(NULL); - atlas_tex = Ref<AtlasTexture>(NULL); + node_sprite = nullptr; + node_sprite_3d = nullptr; + node_ninepatch = nullptr; + obj_styleBox = Ref<StyleBoxTexture>(nullptr); + atlas_tex = Ref<AtlasTexture>(nullptr); editor = p_editor; undo_redo = editor->get_undo_redo(); @@ -1030,6 +1030,7 @@ TextureRegionEditor::TextureRegionEditor(EditorNode *p_editor) { hscroll->connect("value_changed", callable_mp(this, &TextureRegionEditor::_scroll_changed)); updating_scroll = false; + autoslice_is_dirty = true; } void TextureRegionEditorPlugin::edit(Object *p_object) { @@ -1037,7 +1038,7 @@ void TextureRegionEditorPlugin::edit(Object *p_object) { } bool TextureRegionEditorPlugin::handles(Object *p_object) const { - return p_object->is_class("Sprite") || p_object->is_class("Sprite3D") || p_object->is_class("NinePatchRect") || p_object->is_class("StyleBoxTexture") || p_object->is_class("AtlasTexture"); + return p_object->is_class("Sprite2D") || p_object->is_class("Sprite3D") || p_object->is_class("NinePatchRect") || p_object->is_class("StyleBoxTexture") || p_object->is_class("AtlasTexture"); } void TextureRegionEditorPlugin::_editor_visiblity_changed() { @@ -1057,7 +1058,7 @@ void TextureRegionEditorPlugin::make_visible(bool p_visible) { manually_hidden = false; } texture_region_button->hide(); - region_editor->edit(NULL); + region_editor->edit(nullptr); } } diff --git a/editor/plugins/texture_region_editor_plugin.h b/editor/plugins/texture_region_editor_plugin.h index edc55071b7..c6cd648842 100644 --- a/editor/plugins/texture_region_editor_plugin.h +++ b/editor/plugins/texture_region_editor_plugin.h @@ -34,7 +34,7 @@ #include "canvas_item_editor_plugin.h" #include "editor/editor_node.h" #include "editor/editor_plugin.h" -#include "scene/2d/sprite.h" +#include "scene/2d/sprite_2d.h" #include "scene/3d/sprite_3d.h" #include "scene/gui/nine_patch_rect.h" #include "scene/resources/style_box.h" @@ -84,7 +84,7 @@ class TextureRegionEditor : public VBoxContainer { Vector2 snap_step; Vector2 snap_separation; - Sprite *node_sprite; + Sprite2D *node_sprite; Sprite3D *node_sprite_3d; NinePatchRect *node_ninepatch; Ref<StyleBoxTexture> obj_styleBox; @@ -136,7 +136,7 @@ public: bool is_atlas_texture(); bool is_ninepatch(); Sprite3D *get_sprite_3d(); - Sprite *get_sprite(); + Sprite2D *get_sprite(); void edit(Object *p_obj); TextureRegionEditor(EditorNode *p_editor); diff --git a/editor/plugins/theme_editor_plugin.cpp b/editor/plugins/theme_editor_plugin.cpp index aa5caf6658..b246b611fd 100644 --- a/editor/plugins/theme_editor_plugin.cpp +++ b/editor/plugins/theme_editor_plugin.cpp @@ -592,7 +592,7 @@ void ThemeEditor::_notification(int p_what) { } } break; case NOTIFICATION_THEME_CHANGED: { - theme_menu->set_icon(get_icon("Theme", "EditorIcons")); + theme_menu->set_icon(get_theme_icon("Theme", "EditorIcons")); } break; } } @@ -645,10 +645,10 @@ ThemeEditor::ThemeEditor() { main_container = memnew(MarginContainer); root_container->add_child(main_container); - main_container->add_constant_override("margin_right", 4 * EDSCALE); - main_container->add_constant_override("margin_top", 4 * EDSCALE); - main_container->add_constant_override("margin_left", 4 * EDSCALE); - main_container->add_constant_override("margin_bottom", 4 * EDSCALE); + main_container->add_theme_constant_override("margin_right", 4 * EDSCALE); + main_container->add_theme_constant_override("margin_top", 4 * EDSCALE); + main_container->add_theme_constant_override("margin_left", 4 * EDSCALE); + main_container->add_theme_constant_override("margin_bottom", 4 * EDSCALE); HBoxContainer *main_hb = memnew(HBoxContainer); main_container->add_child(main_hb); @@ -656,7 +656,7 @@ ThemeEditor::ThemeEditor() { VBoxContainer *first_vb = memnew(VBoxContainer); main_hb->add_child(first_vb); first_vb->set_h_size_flags(SIZE_EXPAND_FILL); - first_vb->add_constant_override("separation", 10 * EDSCALE); + first_vb->add_theme_constant_override("separation", 10 * EDSCALE); first_vb->add_child(memnew(Label("Label"))); @@ -716,7 +716,7 @@ ThemeEditor::ThemeEditor() { VBoxContainer *second_vb = memnew(VBoxContainer); second_vb->set_h_size_flags(SIZE_EXPAND_FILL); main_hb->add_child(second_vb); - second_vb->add_constant_override("separation", 10 * EDSCALE); + second_vb->add_theme_constant_override("separation", 10 * EDSCALE); LineEdit *le = memnew(LineEdit); le->set_text("LineEdit"); second_vb->add_child(le); @@ -756,7 +756,7 @@ ThemeEditor::ThemeEditor() { VBoxContainer *third_vb = memnew(VBoxContainer); third_vb->set_h_size_flags(SIZE_EXPAND_FILL); - third_vb->add_constant_override("separation", 10 * EDSCALE); + third_vb->add_theme_constant_override("separation", 10 * EDSCALE); main_hb->add_child(third_vb); TabContainer *tc = memnew(TabContainer); @@ -776,7 +776,7 @@ ThemeEditor::ThemeEditor() { Tree *test_tree = memnew(Tree); third_vb->add_child(test_tree); test_tree->set_custom_minimum_size(Size2(0, 175) * EDSCALE); - test_tree->add_constant_override("draw_relationship_lines", 1); + test_tree->add_theme_constant_override("draw_relationship_lines", 1); TreeItem *item = test_tree->create_item(); item->set_text(0, "Tree"); @@ -802,7 +802,7 @@ ThemeEditor::ThemeEditor() { item->set_text(0, TTR("Has,Many,Options")); item->set_range(0, 2); - main_hb->add_constant_override("separation", 20 * EDSCALE); + main_hb->add_theme_constant_override("separation", 20 * EDSCALE); //////// @@ -846,7 +846,7 @@ ThemeEditor::ThemeEditor() { name_menu->set_text(".."); name_hbc->add_child(name_menu); - name_menu->get_popup()->connect("about_to_show", callable_mp(this, &ThemeEditor::_name_menu_about_to_show)); + name_menu->get_popup()->connect("about_to_popup", callable_mp(this, &ThemeEditor::_name_menu_about_to_show)); name_menu->get_popup()->connect("id_pressed", callable_mp(this, &ThemeEditor::_name_menu_cbk)); type_select_label = memnew(Label); diff --git a/editor/plugins/tile_map_editor_plugin.cpp b/editor/plugins/tile_map_editor_plugin.cpp index 017f986469..9e88cd8889 100644 --- a/editor/plugins/tile_map_editor_plugin.cpp +++ b/editor/plugins/tile_map_editor_plugin.cpp @@ -31,13 +31,20 @@ #include "tile_map_editor_plugin.h" #include "canvas_item_editor_plugin.h" +#include "core/input/input_filter.h" #include "core/math/math_funcs.h" -#include "core/os/input.h" #include "core/os/keyboard.h" #include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "scene/gui/split_container.h" +void TileMapEditor::_node_removed(Node *p_node) { + + if (p_node == node) { + node = nullptr; + } +} + void TileMapEditor::_notification(int p_what) { switch (p_what) { @@ -50,35 +57,41 @@ void TileMapEditor::_notification(int p_what) { } break; + case NOTIFICATION_ENTER_TREE: { + + get_tree()->connect("node_removed", callable_mp(this, &TileMapEditor::_node_removed)); + [[fallthrough]]; + } + case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: { if (is_visible_in_tree()) { _update_palette(); } - [[fallthrough]]; - } - case NOTIFICATION_ENTER_TREE: { + paint_button->set_icon(get_theme_icon("Edit", "EditorIcons")); + bucket_fill_button->set_icon(get_theme_icon("Bucket", "EditorIcons")); + picker_button->set_icon(get_theme_icon("ColorPick", "EditorIcons")); + select_button->set_icon(get_theme_icon("ActionCopy", "EditorIcons")); - paint_button->set_icon(get_icon("Edit", "EditorIcons")); - bucket_fill_button->set_icon(get_icon("Bucket", "EditorIcons")); - picker_button->set_icon(get_icon("ColorPick", "EditorIcons")); - select_button->set_icon(get_icon("ActionCopy", "EditorIcons")); + rotate_left_button->set_icon(get_theme_icon("RotateLeft", "EditorIcons")); + rotate_right_button->set_icon(get_theme_icon("RotateRight", "EditorIcons")); + flip_horizontal_button->set_icon(get_theme_icon("MirrorX", "EditorIcons")); + flip_vertical_button->set_icon(get_theme_icon("MirrorY", "EditorIcons")); + clear_transform_button->set_icon(get_theme_icon("Clear", "EditorIcons")); - rotate_left_button->set_icon(get_icon("RotateLeft", "EditorIcons")); - rotate_right_button->set_icon(get_icon("RotateRight", "EditorIcons")); - flip_horizontal_button->set_icon(get_icon("MirrorX", "EditorIcons")); - flip_vertical_button->set_icon(get_icon("MirrorY", "EditorIcons")); - clear_transform_button->set_icon(get_icon("Clear", "EditorIcons")); - - search_box->set_right_icon(get_icon("Search", "EditorIcons")); + search_box->set_right_icon(get_theme_icon("Search", "EditorIcons")); search_box->set_clear_button_enabled(true); PopupMenu *p = options->get_popup(); - p->set_item_icon(p->get_item_index(OPTION_CUT), get_icon("ActionCut", "EditorIcons")); - p->set_item_icon(p->get_item_index(OPTION_COPY), get_icon("Duplicate", "EditorIcons")); - p->set_item_icon(p->get_item_index(OPTION_ERASE_SELECTION), get_icon("Remove", "EditorIcons")); + p->set_item_icon(p->get_item_index(OPTION_CUT), get_theme_icon("ActionCut", "EditorIcons")); + p->set_item_icon(p->get_item_index(OPTION_COPY), get_theme_icon("Duplicate", "EditorIcons")); + p->set_item_icon(p->get_item_index(OPTION_ERASE_SELECTION), get_theme_icon("Remove", "EditorIcons")); + + } break; + case NOTIFICATION_EXIT_TREE: { + get_tree()->disconnect("node_removed", callable_mp(this, &TileMapEditor::_node_removed)); } break; } } @@ -421,7 +434,7 @@ void TileMapEditor::_update_palette() { bool show_tile_ids = bool(EDITOR_DEF("editors/tile_map/show_tile_ids", false)); bool sort_by_name = bool(EDITOR_DEF("editors/tile_map/sort_tiles_by_name", true)); - palette->add_constant_override("hseparation", hseparation * EDSCALE); + palette->add_theme_constant_override("hseparation", hseparation * EDSCALE); palette->set_fixed_icon_size(Size2(min_size, min_size)); palette->set_fixed_column_width(min_size * MAX(size_slider->get_value(), 1)); @@ -627,7 +640,7 @@ Vector<Vector2> TileMapEditor::_bucket_fill(const Point2i &p_start, bool erase, if (r != bucket_cache_rect) _clear_bucket_cache(); // Cache grid is not initialized - if (bucket_cache_visited == NULL) { + if (bucket_cache_visited == nullptr) { bucket_cache_visited = new bool[area]; invalidate_cache = true; } @@ -894,7 +907,7 @@ void TileMapEditor::_draw_fill_preview(Control *p_viewport, int p_cell, const Po void TileMapEditor::_clear_bucket_cache() { if (bucket_cache_visited) { delete[] bucket_cache_visited; - bucket_cache_visited = NULL; + bucket_cache_visited = nullptr; } } @@ -984,7 +997,7 @@ bool TileMapEditor::forward_gui_input(const Ref<InputEvent> &p_event) { if (mb->is_pressed()) { - if (Input::get_singleton()->is_key_pressed(KEY_SPACE)) + if (InputFilter::get_singleton()->is_key_pressed(KEY_SPACE)) return false; // Drag. if (tool == TOOL_NONE) { @@ -1365,7 +1378,7 @@ bool TileMapEditor::forward_gui_input(const Ref<InputEvent> &p_event) { return true; } - if (tool == TOOL_PICKING && Input::get_singleton()->is_mouse_button_pressed(BUTTON_LEFT)) { + if (tool == TOOL_PICKING && InputFilter::get_singleton()->is_mouse_button_pressed(BUTTON_LEFT)) { _pick_tile(over_tile); @@ -1773,7 +1786,7 @@ void TileMapEditor::edit(Node *p_tile_map) { _update_palette(); } else { - node = NULL; + node = nullptr; if (canvas_item_editor_viewport->is_connected("mouse_entered", callable_mp(this, &TileMapEditor::_canvas_mouse_enter))) canvas_item_editor_viewport->disconnect("mouse_entered", callable_mp(this, &TileMapEditor::_canvas_mouse_enter)); @@ -1889,11 +1902,11 @@ void TileMapEditor::_clear_transform() { TileMapEditor::TileMapEditor(EditorNode *p_editor) { - node = NULL; + node = nullptr; manual_autotile = false; priority_atlastile = false; manual_position = Vector2(0, 0); - canvas_item_editor_viewport = NULL; + canvas_item_editor_viewport = nullptr; editor = p_editor; undo_redo = EditorNode::get_undo_redo(); @@ -1906,7 +1919,7 @@ TileMapEditor::TileMapEditor(EditorNode *p_editor) { transpose = false; bucket_cache_tile = -1; - bucket_cache_visited = NULL; + bucket_cache_visited = nullptr; invalid_cell.resize(1); invalid_cell.write[0] = TileMap::INVALID_CELL; @@ -1960,7 +1973,7 @@ TileMapEditor::TileMapEditor(EditorNode *p_editor) { palette->set_icon_mode(ItemList::ICON_MODE_TOP); palette->set_max_text_lines(2); palette->set_select_mode(ItemList::SELECT_MULTI); - palette->add_constant_override("vseparation", 8 * EDSCALE); + palette->add_theme_constant_override("vseparation", 8 * EDSCALE); palette->connect("item_selected", callable_mp(this, &TileMapEditor::_palette_selected)); palette->connect("multi_selected", callable_mp(this, &TileMapEditor::_palette_multi_selected)); palette_container->add_child(palette); @@ -2031,7 +2044,7 @@ TileMapEditor::TileMapEditor(EditorNode *p_editor) { tile_info = memnew(Label); tile_info->set_modulate(Color(1, 1, 1, 0.8)); tile_info->set_mouse_filter(MOUSE_FILTER_IGNORE); - tile_info->add_font_override("font", EditorNode::get_singleton()->get_gui_base()->get_font("main", "EditorFonts")); + tile_info->add_theme_font_override("font", EditorNode::get_singleton()->get_gui_base()->get_theme_font("main", "EditorFonts")); // The tile info is only displayed after a tile has been hovered. tile_info->hide(); CanvasItemEditor::get_singleton()->add_control_to_info_overlay(tile_info); @@ -2039,7 +2052,7 @@ TileMapEditor::TileMapEditor(EditorNode *p_editor) { // Menu. options = memnew(MenuButton); options->set_text("TileMap"); - options->set_icon(EditorNode::get_singleton()->get_gui_base()->get_icon("TileMap", "EditorIcons")); + options->set_icon(EditorNode::get_singleton()->get_gui_base()->get_theme_icon("TileMap", "EditorIcons")); options->set_process_unhandled_key_input(false); toolbar_right->add_child(options); @@ -2142,7 +2155,7 @@ void TileMapEditorPlugin::make_visible(bool p_visible) { tile_map_editor->get_toolbar()->hide(); tile_map_editor->get_toolbar_right()->hide(); tile_map_editor->get_tile_info()->hide(); - tile_map_editor->edit(NULL); + tile_map_editor->edit(nullptr); } } diff --git a/editor/plugins/tile_map_editor_plugin.h b/editor/plugins/tile_map_editor_plugin.h index 74969d3e64..f43e5bb5cb 100644 --- a/editor/plugins/tile_map_editor_plugin.h +++ b/editor/plugins/tile_map_editor_plugin.h @@ -211,6 +211,7 @@ class TileMapEditor : public VBoxContainer { protected: void _notification(int p_what); + void _node_removed(Node *p_node); static void _bind_methods(); CellOp _get_op_from_cell(const Point2i &p_pos); diff --git a/editor/plugins/tile_set_editor_plugin.cpp b/editor/plugins/tile_set_editor_plugin.cpp index a5a667802e..d1dda68c1d 100644 --- a/editor/plugins/tile_set_editor_plugin.cpp +++ b/editor/plugins/tile_set_editor_plugin.cpp @@ -30,12 +30,12 @@ #include "tile_set_editor_plugin.h" -#include "core/os/input.h" +#include "core/input/input_filter.h" #include "core/os/keyboard.h" #include "editor/editor_scale.h" #include "editor/plugins/canvas_item_editor_plugin.h" #include "scene/2d/physics_body_2d.h" -#include "scene/2d/sprite.h" +#include "scene/2d/sprite_2d.h" void TileSetEditor::edit(const Ref<TileSet> &p_tileset) { @@ -53,7 +53,7 @@ void TileSetEditor::_import_node(Node *p_node, Ref<TileSet> p_library) { Node *child = p_node->get_child(i); - if (!Object::cast_to<Sprite>(child)) { + if (!Object::cast_to<Sprite2D>(child)) { if (child->get_child_count() > 0) { _import_node(child, p_library); } @@ -61,7 +61,7 @@ void TileSetEditor::_import_node(Node *p_node, Ref<TileSet> p_library) { continue; } - Sprite *mi = Object::cast_to<Sprite>(child); + Sprite2D *mi = Object::cast_to<Sprite2D>(child); Ref<Texture2D> texture = mi->get_texture(); Ref<Texture2D> normal_map = mi->get_normal_map(); Ref<ShaderMaterial> material = mi->get_material(); @@ -284,47 +284,47 @@ void TileSetEditor::_notification(int p_what) { switch (p_what) { case NOTIFICATION_READY: { - add_constant_override("autohide", 1); // Fixes the dragger always showing up. + add_theme_constant_override("autohide", 1); // Fixes the dragger always showing up. } break; case NOTIFICATION_ENTER_TREE: case NOTIFICATION_THEME_CHANGED: { - tileset_toolbar_buttons[TOOL_TILESET_ADD_TEXTURE]->set_icon(get_icon("ToolAddNode", "EditorIcons")); - tileset_toolbar_buttons[TOOL_TILESET_REMOVE_TEXTURE]->set_icon(get_icon("Remove", "EditorIcons")); - tileset_toolbar_tools->set_icon(get_icon("Tools", "EditorIcons")); - - tool_workspacemode[WORKSPACE_EDIT]->set_icon(get_icon("Edit", "EditorIcons")); - tool_workspacemode[WORKSPACE_CREATE_SINGLE]->set_icon(get_icon("AddSingleTile", "EditorIcons")); - tool_workspacemode[WORKSPACE_CREATE_AUTOTILE]->set_icon(get_icon("AddAutotile", "EditorIcons")); - tool_workspacemode[WORKSPACE_CREATE_ATLAS]->set_icon(get_icon("AddAtlasTile", "EditorIcons")); - - tools[TOOL_SELECT]->set_icon(get_icon("ToolSelect", "EditorIcons")); - tools[BITMASK_COPY]->set_icon(get_icon("Duplicate", "EditorIcons")); - tools[BITMASK_PASTE]->set_icon(get_icon("Override", "EditorIcons")); - tools[BITMASK_CLEAR]->set_icon(get_icon("Clear", "EditorIcons")); - tools[SHAPE_NEW_POLYGON]->set_icon(get_icon("CollisionPolygon2D", "EditorIcons")); - tools[SHAPE_NEW_RECTANGLE]->set_icon(get_icon("CollisionShape2D", "EditorIcons")); - tools[SELECT_PREVIOUS]->set_icon(get_icon("ArrowLeft", "EditorIcons")); - tools[SELECT_NEXT]->set_icon(get_icon("ArrowRight", "EditorIcons")); - tools[SHAPE_DELETE]->set_icon(get_icon("Remove", "EditorIcons")); - tools[SHAPE_KEEP_INSIDE_TILE]->set_icon(get_icon("Snap", "EditorIcons")); - tools[TOOL_GRID_SNAP]->set_icon(get_icon("SnapGrid", "EditorIcons")); - tools[ZOOM_OUT]->set_icon(get_icon("ZoomLess", "EditorIcons")); - tools[ZOOM_1]->set_icon(get_icon("ZoomReset", "EditorIcons")); - tools[ZOOM_IN]->set_icon(get_icon("ZoomMore", "EditorIcons")); - tools[VISIBLE_INFO]->set_icon(get_icon("InformationSign", "EditorIcons")); + tileset_toolbar_buttons[TOOL_TILESET_ADD_TEXTURE]->set_icon(get_theme_icon("ToolAddNode", "EditorIcons")); + tileset_toolbar_buttons[TOOL_TILESET_REMOVE_TEXTURE]->set_icon(get_theme_icon("Remove", "EditorIcons")); + tileset_toolbar_tools->set_icon(get_theme_icon("Tools", "EditorIcons")); + + tool_workspacemode[WORKSPACE_EDIT]->set_icon(get_theme_icon("Edit", "EditorIcons")); + tool_workspacemode[WORKSPACE_CREATE_SINGLE]->set_icon(get_theme_icon("AddSingleTile", "EditorIcons")); + tool_workspacemode[WORKSPACE_CREATE_AUTOTILE]->set_icon(get_theme_icon("AddAutotile", "EditorIcons")); + tool_workspacemode[WORKSPACE_CREATE_ATLAS]->set_icon(get_theme_icon("AddAtlasTile", "EditorIcons")); + + tools[TOOL_SELECT]->set_icon(get_theme_icon("ToolSelect", "EditorIcons")); + tools[BITMASK_COPY]->set_icon(get_theme_icon("Duplicate", "EditorIcons")); + tools[BITMASK_PASTE]->set_icon(get_theme_icon("Override", "EditorIcons")); + tools[BITMASK_CLEAR]->set_icon(get_theme_icon("Clear", "EditorIcons")); + tools[SHAPE_NEW_POLYGON]->set_icon(get_theme_icon("CollisionPolygon2D", "EditorIcons")); + tools[SHAPE_NEW_RECTANGLE]->set_icon(get_theme_icon("CollisionShape2D", "EditorIcons")); + tools[SELECT_PREVIOUS]->set_icon(get_theme_icon("ArrowLeft", "EditorIcons")); + tools[SELECT_NEXT]->set_icon(get_theme_icon("ArrowRight", "EditorIcons")); + tools[SHAPE_DELETE]->set_icon(get_theme_icon("Remove", "EditorIcons")); + tools[SHAPE_KEEP_INSIDE_TILE]->set_icon(get_theme_icon("Snap", "EditorIcons")); + tools[TOOL_GRID_SNAP]->set_icon(get_theme_icon("SnapGrid", "EditorIcons")); + tools[ZOOM_OUT]->set_icon(get_theme_icon("ZoomLess", "EditorIcons")); + tools[ZOOM_1]->set_icon(get_theme_icon("ZoomReset", "EditorIcons")); + tools[ZOOM_IN]->set_icon(get_theme_icon("ZoomMore", "EditorIcons")); + tools[VISIBLE_INFO]->set_icon(get_theme_icon("InformationSign", "EditorIcons")); _update_toggle_shape_button(); - tool_editmode[EDITMODE_REGION]->set_icon(get_icon("RegionEdit", "EditorIcons")); - tool_editmode[EDITMODE_COLLISION]->set_icon(get_icon("StaticBody2D", "EditorIcons")); - tool_editmode[EDITMODE_OCCLUSION]->set_icon(get_icon("LightOccluder2D", "EditorIcons")); - tool_editmode[EDITMODE_NAVIGATION]->set_icon(get_icon("Navigation2D", "EditorIcons")); - tool_editmode[EDITMODE_BITMASK]->set_icon(get_icon("PackedDataContainer", "EditorIcons")); - tool_editmode[EDITMODE_PRIORITY]->set_icon(get_icon("MaterialPreviewLight1", "EditorIcons")); - tool_editmode[EDITMODE_ICON]->set_icon(get_icon("LargeTexture", "EditorIcons")); - tool_editmode[EDITMODE_Z_INDEX]->set_icon(get_icon("Sort", "EditorIcons")); + tool_editmode[EDITMODE_REGION]->set_icon(get_theme_icon("RegionEdit", "EditorIcons")); + tool_editmode[EDITMODE_COLLISION]->set_icon(get_theme_icon("StaticBody2D", "EditorIcons")); + tool_editmode[EDITMODE_OCCLUSION]->set_icon(get_theme_icon("LightOccluder2D", "EditorIcons")); + tool_editmode[EDITMODE_NAVIGATION]->set_icon(get_theme_icon("Navigation2D", "EditorIcons")); + tool_editmode[EDITMODE_BITMASK]->set_icon(get_theme_icon("PackedDataContainer", "EditorIcons")); + tool_editmode[EDITMODE_PRIORITY]->set_icon(get_theme_icon("MaterialPreviewLight1", "EditorIcons")); + tool_editmode[EDITMODE_ICON]->set_icon(get_theme_icon("LargeTexture", "EditorIcons")); + tool_editmode[EDITMODE_Z_INDEX]->set_icon(get_theme_icon("Sort", "EditorIcons")); - scroll->add_style_override("bg", get_stylebox("bg", "Tree")); + scroll->add_theme_style_override("bg", get_theme_stylebox("bg", "Tree")); } break; } } @@ -528,8 +528,8 @@ TileSetEditor::TileSetEditor(EditorNode *p_editor) { toolbar->add_child(spin_priority); spin_z_index = memnew(SpinBox); - spin_z_index->set_min(VS::CANVAS_ITEM_Z_MIN); - spin_z_index->set_max(VS::CANVAS_ITEM_Z_MAX); + spin_z_index->set_min(RS::CANVAS_ITEM_Z_MIN); + spin_z_index->set_max(RS::CANVAS_ITEM_Z_MAX); spin_z_index->set_step(1); spin_z_index->set_custom_minimum_size(Size2(100, 0)); spin_z_index->connect("value_changed", callable_mp(this, &TileSetEditor::_on_z_index_changed)); @@ -601,7 +601,7 @@ TileSetEditor::TileSetEditor(EditorNode *p_editor) { workspace->set_draw_behind_parent(true); workspace_overlay->add_child(workspace); - preview = memnew(Sprite); + preview = memnew(Sprite2D); workspace->add_child(preview); preview->set_centered(false); preview->set_draw_behind_parent(true); @@ -619,7 +619,7 @@ TileSetEditor::TileSetEditor(EditorNode *p_editor) { //--------------- texture_dialog = memnew(EditorFileDialog); texture_dialog->set_access(EditorFileDialog::ACCESS_RESOURCES); - texture_dialog->set_mode(EditorFileDialog::MODE_OPEN_FILES); + texture_dialog->set_file_mode(EditorFileDialog::FILE_MODE_OPEN_FILES); texture_dialog->clear_filters(); List<String> extensions; @@ -725,7 +725,7 @@ void TileSetEditor::_on_texture_list_selected(int p_index) { update_workspace_minsize(); } else { current_item_index = -1; - preview->set_texture(NULL); + preview->set_texture(nullptr); workspace->set_custom_minimum_size(Size2i()); update_workspace_tile_mode(); } @@ -1113,7 +1113,7 @@ void TileSetEditor::_on_workspace_draw() { void TileSetEditor::_on_workspace_process() { - if (Input::get_singleton()->is_key_pressed(KEY_ALT) || tools[VISIBLE_INFO]->is_pressed()) { + if (InputFilter::get_singleton()->is_key_pressed(KEY_ALT) || tools[VISIBLE_INFO]->is_pressed()) { if (!tile_names_visible) { tile_names_visible = true; workspace_overlay->update(); @@ -1153,7 +1153,7 @@ void TileSetEditor::_on_workspace_overlay_draw() { else if (tileset->tile_get_tile_mode(t_id) == TileSet::ATLAS_TILE) c = COLOR_ATLAS; String tile_id_name = String::num(t_id, 0) + ": " + tileset->tile_get_name(t_id); - Ref<Font> font = get_font("font", "Label"); + Ref<Font> font = get_theme_font("font", "Label"); region.set_size(font->get_string_size(tile_id_name)); workspace_overlay->draw_rect(region, c); region.position.y += region.size.y - 2; @@ -1167,7 +1167,7 @@ void TileSetEditor::_on_workspace_overlay_draw() { if (t_id < 0) return; - Ref<Texture2D> handle = get_icon("EditorHandle", "EditorIcons"); + Ref<Texture2D> handle = get_theme_icon("EditorHandle", "EditorIcons"); if (draw_handles) { for (int i = 0; i < current_shape.size(); i++) { workspace_overlay->draw_texture(handle, current_shape[i] * workspace->get_scale().x - handle->get_size() * 0.5); @@ -1395,7 +1395,7 @@ void TileSetEditor::_on_workspace_input(const Ref<InputEvent> &p_ie) { if ((mb->get_button_index() == BUTTON_RIGHT || mb->get_button_index() == BUTTON_LEFT) && current_tile_region.has_point(mb->get_position())) { dragging = true; erasing = (mb->get_button_index() == BUTTON_RIGHT); - alternative = Input::get_singleton()->is_key_pressed(KEY_SHIFT); + alternative = InputFilter::get_singleton()->is_key_pressed(KEY_SHIFT); Vector2 coord((int)((mb->get_position().x - current_tile_region.position.x) / (spacing + size.x)), (int)((mb->get_position().y - current_tile_region.position.y) / (spacing + size.y))); Vector2 pos(coord.x * (spacing + size.x), coord.y * (spacing + size.y)); pos = mb->get_position() - (pos + current_tile_region.position); @@ -2019,10 +2019,10 @@ void TileSetEditor::_update_toggle_shape_button() { separator_shape_toggle->hide(); tools[SHAPE_TOGGLE_TYPE]->hide(); } else if (concave.is_valid()) { - tools[SHAPE_TOGGLE_TYPE]->set_icon(get_icon("ConvexPolygonShape2D", "EditorIcons")); + tools[SHAPE_TOGGLE_TYPE]->set_icon(get_theme_icon("ConvexPolygonShape2D", "EditorIcons")); tools[SHAPE_TOGGLE_TYPE]->set_text(TTR("Make Convex")); } else if (convex.is_valid()) { - tools[SHAPE_TOGGLE_TYPE]->set_icon(get_icon("ConcavePolygonShape2D", "EditorIcons")); + tools[SHAPE_TOGGLE_TYPE]->set_icon(get_theme_icon("ConcavePolygonShape2D", "EditorIcons")); tools[SHAPE_TOGGLE_TYPE]->set_text(TTR("Make Concave")); } else { // Shouldn't happen @@ -3003,7 +3003,7 @@ void TileSetEditor::select_coord(const Vector2 &coord) { } } if (!found_collision_shape) - _set_edited_collision_shape(Ref<ConvexPolygonShape2D>(NULL)); + _set_edited_collision_shape(Ref<ConvexPolygonShape2D>(nullptr)); if (edited_occlusion_shape != tileset->autotile_get_light_occluder(get_current_tile(), coord)) edited_occlusion_shape = tileset->autotile_get_light_occluder(get_current_tile(), coord); if (edited_navigation_shape != tileset->autotile_get_navigation_polygon(get_current_tile(), coord)) @@ -3485,7 +3485,7 @@ void TilesetEditorContext::_get_property_list(List<PropertyInfo> *p_list) const p_list->push_back(PropertyInfo(Variant::VECTOR2, "tile_navigation_offset")); p_list->push_back(PropertyInfo(Variant::VECTOR2, "tile_shape_offset", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR)); p_list->push_back(PropertyInfo(Variant::VECTOR2, "tile_shape_transform", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR)); - p_list->push_back(PropertyInfo(Variant::INT, "tile_z_index", PROPERTY_HINT_RANGE, itos(VS::CANVAS_ITEM_Z_MIN) + "," + itos(VS::CANVAS_ITEM_Z_MAX) + ",1")); + p_list->push_back(PropertyInfo(Variant::INT, "tile_z_index", PROPERTY_HINT_RANGE, itos(RS::CANVAS_ITEM_Z_MIN) + "," + itos(RS::CANVAS_ITEM_Z_MAX) + ",1")); } if (tileset_editor->edit_mode == TileSetEditor::EDITMODE_COLLISION && tileset_editor->edited_collision_shape.is_valid()) { p_list->push_back(PropertyInfo(Variant::OBJECT, "selected_collision", PROPERTY_HINT_RESOURCE_TYPE, tileset_editor->edited_collision_shape->get_class())); diff --git a/editor/plugins/tile_set_editor_plugin.h b/editor/plugins/tile_set_editor_plugin.h index 0d106ed454..53f8e8c4d6 100644 --- a/editor/plugins/tile_set_editor_plugin.h +++ b/editor/plugins/tile_set_editor_plugin.h @@ -32,7 +32,7 @@ #define TILE_SET_EDITOR_PLUGIN_H #include "editor/editor_node.h" -#include "scene/2d/sprite.h" +#include "scene/2d/sprite_2d.h" #include "scene/resources/concave_polygon_shape_2d.h" #include "scene/resources/convex_polygon_shape_2d.h" #include "scene/resources/tile_set.h" @@ -136,7 +136,7 @@ class TileSetEditor : public HSplitContainer { Ref<NavigationPolygon> edited_navigation_shape; int current_item_index; - Sprite *preview; + Sprite2D *preview; ScrollContainer *scroll; Label *empty_message; Control *workspace_container; diff --git a/editor/plugins/version_control_editor_plugin.cpp b/editor/plugins/version_control_editor_plugin.cpp index da80eee253..fe8392593b 100644 --- a/editor/plugins/version_control_editor_plugin.cpp +++ b/editor/plugins/version_control_editor_plugin.cpp @@ -35,7 +35,7 @@ #include "editor/editor_node.h" #include "editor/editor_scale.h" -VersionControlEditorPlugin *VersionControlEditorPlugin::singleton = NULL; +VersionControlEditorPlugin *VersionControlEditorPlugin::singleton = nullptr; void VersionControlEditorPlugin::_bind_methods() { @@ -171,7 +171,7 @@ void VersionControlEditorPlugin::_refresh_stage_area() { for (int i = 0; i < modified_file_paths.size(); i++) { file_path = modified_file_paths.get_key_at_index(i); - TreeItem *found = stage_files->search_item_text(file_path, 0, true); + TreeItem *found = stage_files->search_item_text(file_path, nullptr, true); if (!found) { ChangeType change_index = (ChangeType)(int)modified_file_paths.get_value_at_index(i); @@ -217,12 +217,12 @@ void VersionControlEditorPlugin::_stage_selected() { if (file_entry->is_checked(0)) { EditorVCSInterface::get_singleton()->stage_file(file_entry->get_metadata(0)); - file_entry->set_icon_modulate(0, EditorNode::get_singleton()->get_gui_base()->get_color("success_color", "Editor")); + file_entry->set_icon_modulate(0, EditorNode::get_singleton()->get_gui_base()->get_theme_color("success_color", "Editor")); staged_files_count++; } else { EditorVCSInterface::get_singleton()->unstage_file(file_entry->get_metadata(0)); - file_entry->set_icon_modulate(0, EditorNode::get_singleton()->get_gui_base()->get_color("error_color", "Editor")); + file_entry->set_icon_modulate(0, EditorNode::get_singleton()->get_gui_base()->get_theme_color("error_color", "Editor")); } file_entry = file_entry->get_next(); @@ -248,7 +248,7 @@ void VersionControlEditorPlugin::_stage_all() { while (file_entry) { EditorVCSInterface::get_singleton()->stage_file(file_entry->get_metadata(0)); - file_entry->set_icon_modulate(0, EditorNode::get_singleton()->get_gui_base()->get_color("success_color", "Editor")); + file_entry->set_icon_modulate(0, EditorNode::get_singleton()->get_gui_base()->get_theme_color("success_color", "Editor")); file_entry->set_checked(0, true); staged_files_count++; @@ -275,20 +275,20 @@ void VersionControlEditorPlugin::_display_file_diff(String p_file_path) { diff_file_name->set_text(p_file_path); diff->clear(); - diff->push_font(EditorNode::get_singleton()->get_gui_base()->get_font("source", "EditorFonts")); + diff->push_font(EditorNode::get_singleton()->get_gui_base()->get_theme_font("source", "EditorFonts")); for (int i = 0; i < diff_content.size(); i++) { Dictionary line_result = diff_content[i]; if (line_result["status"] == "+") { - diff->push_color(EditorNode::get_singleton()->get_gui_base()->get_color("success_color", "Editor")); + diff->push_color(EditorNode::get_singleton()->get_gui_base()->get_theme_color("success_color", "Editor")); } else if (line_result["status"] == "-") { - diff->push_color(EditorNode::get_singleton()->get_gui_base()->get_color("error_color", "Editor")); + diff->push_color(EditorNode::get_singleton()->get_gui_base()->get_theme_color("error_color", "Editor")); } else { - diff->push_color(EditorNode::get_singleton()->get_gui_base()->get_color("font_color", "Label")); + diff->push_color(EditorNode::get_singleton()->get_gui_base()->get_theme_color("font_color", "Label")); } diff->add_text((String)line_result["content"]); @@ -385,7 +385,7 @@ void VersionControlEditorPlugin::shut_down() { } EditorVCSInterface::get_singleton()->shut_down(); memdelete(EditorVCSInterface::get_singleton()); - EditorVCSInterface::set_singleton(NULL); + EditorVCSInterface::set_singleton(nullptr); EditorNode::get_singleton()->remove_control_from_dock(version_commit_dock); EditorNode::get_singleton()->remove_bottom_panel_item(version_control_dock); @@ -408,11 +408,10 @@ VersionControlEditorPlugin::VersionControlEditorPlugin() { staged_files_count = 0; version_control_actions = memnew(PopupMenu); - version_control_actions->set_v_size_flags(BoxContainer::SIZE_SHRINK_CENTER); set_up_dialog = memnew(AcceptDialog); set_up_dialog->set_title(TTR("Set Up Version Control")); - set_up_dialog->set_custom_minimum_size(Size2(400, 100)); + set_up_dialog->set_min_size(Size2(400, 100)); version_control_actions->add_child(set_up_dialog); set_up_ok_button = set_up_dialog->get_ok(); @@ -439,16 +438,13 @@ VersionControlEditorPlugin::VersionControlEditorPlugin() { set_up_choice->connect("item_selected", callable_mp(this, &VersionControlEditorPlugin::_selected_a_vcs)); set_up_hbc->add_child(set_up_choice); - set_up_init_settings = NULL; + set_up_init_settings = nullptr; set_up_init_button = memnew(Button); set_up_init_button->set_text(TTR("Initialize")); set_up_init_button->connect("pressed", callable_mp(this, &VersionControlEditorPlugin::_initialize_vcs)); set_up_vbc->add_child(set_up_init_button); - version_control_actions->set_v_size_flags(PopupMenu::SIZE_EXPAND_FILL); - version_control_actions->set_h_size_flags(PopupMenu::SIZE_EXPAND_FILL); - version_commit_dock = memnew(VBoxContainer); version_commit_dock->set_visible(false); @@ -470,7 +466,7 @@ VersionControlEditorPlugin::VersionControlEditorPlugin() { refresh_button = memnew(Button); refresh_button->set_tooltip(TTR("Detect new changes")); refresh_button->set_text(TTR("Refresh")); - refresh_button->set_icon(EditorNode::get_singleton()->get_gui_base()->get_icon("Reload", "EditorIcons")); + refresh_button->set_icon(EditorNode::get_singleton()->get_gui_base()->get_theme_icon("Reload", "EditorIcons")); refresh_button->connect("pressed", callable_mp(this, &VersionControlEditorPlugin::_refresh_stage_area)); stage_tools->add_child(refresh_button); @@ -495,11 +491,11 @@ VersionControlEditorPlugin::VersionControlEditorPlugin() { change_type_to_strings[CHANGE_TYPE_DELETED] = TTR("Deleted"); change_type_to_strings[CHANGE_TYPE_TYPECHANGE] = TTR("Typechange"); - change_type_to_color[CHANGE_TYPE_NEW] = EditorNode::get_singleton()->get_gui_base()->get_color("success_color", "Editor"); - change_type_to_color[CHANGE_TYPE_MODIFIED] = EditorNode::get_singleton()->get_gui_base()->get_color("warning_color", "Editor"); - change_type_to_color[CHANGE_TYPE_RENAMED] = EditorNode::get_singleton()->get_gui_base()->get_color("disabled_font_color", "Editor"); - change_type_to_color[CHANGE_TYPE_DELETED] = EditorNode::get_singleton()->get_gui_base()->get_color("error_color", "Editor"); - change_type_to_color[CHANGE_TYPE_TYPECHANGE] = EditorNode::get_singleton()->get_gui_base()->get_color("font_color", "Editor"); + change_type_to_color[CHANGE_TYPE_NEW] = EditorNode::get_singleton()->get_gui_base()->get_theme_color("success_color", "Editor"); + change_type_to_color[CHANGE_TYPE_MODIFIED] = EditorNode::get_singleton()->get_gui_base()->get_theme_color("warning_color", "Editor"); + change_type_to_color[CHANGE_TYPE_RENAMED] = EditorNode::get_singleton()->get_gui_base()->get_theme_color("disabled_font_color", "Editor"); + change_type_to_color[CHANGE_TYPE_DELETED] = EditorNode::get_singleton()->get_gui_base()->get_theme_color("error_color", "Editor"); + change_type_to_color[CHANGE_TYPE_TYPECHANGE] = EditorNode::get_singleton()->get_gui_base()->get_theme_color("font_color", "Editor"); stage_buttons = memnew(HSplitContainer); stage_buttons->set_dragger_visibility(SplitContainer::DRAGGER_HIDDEN_COLLAPSED); @@ -562,7 +558,7 @@ VersionControlEditorPlugin::VersionControlEditorPlugin() { diff_refresh_button = memnew(Button); diff_refresh_button->set_tooltip(TTR("Detect changes in file diff")); - diff_refresh_button->set_icon(EditorNode::get_singleton()->get_gui_base()->get_icon("Reload", "EditorIcons")); + diff_refresh_button->set_icon(EditorNode::get_singleton()->get_gui_base()->get_theme_icon("Reload", "EditorIcons")); diff_refresh_button->connect("pressed", callable_mp(this, &VersionControlEditorPlugin::_refresh_file_diff)); diff_hbc->add_child(diff_refresh_button); diff --git a/editor/plugins/visual_shader_editor_plugin.cpp b/editor/plugins/visual_shader_editor_plugin.cpp index 9100e28352..d5128db0d5 100644 --- a/editor/plugins/visual_shader_editor_plugin.cpp +++ b/editor/plugins/visual_shader_editor_plugin.cpp @@ -30,9 +30,9 @@ #include "visual_shader_editor_plugin.h" +#include "core/input/input_filter.h" #include "core/io/resource_loader.h" #include "core/math/math_defs.h" -#include "core/os/input.h" #include "core/os/keyboard.h" #include "core/project_settings.h" #include "core/version.h" @@ -42,16 +42,17 @@ #include "scene/animation/animation_player.h" #include "scene/gui/menu_button.h" #include "scene/gui/panel.h" -#include "scene/main/viewport.h" +#include "scene/main/window.h" #include "scene/resources/visual_shader_nodes.h" -#include "servers/visual/shader_types.h" +#include "servers/display_server.h" +#include "servers/rendering/shader_types.h" Control *VisualShaderNodePlugin::create_editor(const Ref<Resource> &p_parent_resource, const Ref<VisualShaderNode> &p_node) { if (get_script_instance()) { return get_script_instance()->call("create_editor", p_parent_resource, p_node); } - return NULL; + return nullptr; } void VisualShaderNodePlugin::_bind_methods() { @@ -312,8 +313,8 @@ void VisualShaderEditor::_update_options_menu() { bool is_first_item = true; - Color unsupported_color = get_color("error_color", "Editor"); - Color supported_color = get_color("warning_color", "Editor"); + Color unsupported_color = get_theme_color("error_color", "Editor"); + Color supported_color = get_theme_color("warning_color", "Editor"); static bool low_driver = ProjectSettings::get_singleton()->get("rendering/quality/driver/driver_name") == "GLES2"; @@ -351,7 +352,7 @@ void VisualShaderEditor::_update_options_menu() { for (int i = 0; i < options.size(); i++) { String path = options[i].category; Vector<String> subfolders = path.split("/"); - TreeItem *category = NULL; + TreeItem *category = nullptr; if (!folders.has(path)) { category = root; @@ -385,22 +386,22 @@ void VisualShaderEditor::_update_options_menu() { } switch (options[i].return_type) { case VisualShaderNode::PORT_TYPE_SCALAR: - item->set_icon(0, EditorNode::get_singleton()->get_gui_base()->get_icon("float", "EditorIcons")); + item->set_icon(0, EditorNode::get_singleton()->get_gui_base()->get_theme_icon("float", "EditorIcons")); break; case VisualShaderNode::PORT_TYPE_SCALAR_INT: - item->set_icon(0, EditorNode::get_singleton()->get_gui_base()->get_icon("int", "EditorIcons")); + item->set_icon(0, EditorNode::get_singleton()->get_gui_base()->get_theme_icon("int", "EditorIcons")); break; case VisualShaderNode::PORT_TYPE_VECTOR: - item->set_icon(0, EditorNode::get_singleton()->get_gui_base()->get_icon("Vector3", "EditorIcons")); + item->set_icon(0, EditorNode::get_singleton()->get_gui_base()->get_theme_icon("Vector3", "EditorIcons")); break; case VisualShaderNode::PORT_TYPE_BOOLEAN: - item->set_icon(0, EditorNode::get_singleton()->get_gui_base()->get_icon("bool", "EditorIcons")); + item->set_icon(0, EditorNode::get_singleton()->get_gui_base()->get_theme_icon("bool", "EditorIcons")); break; case VisualShaderNode::PORT_TYPE_TRANSFORM: - item->set_icon(0, EditorNode::get_singleton()->get_gui_base()->get_icon("Transform", "EditorIcons")); + item->set_icon(0, EditorNode::get_singleton()->get_gui_base()->get_theme_icon("Transform", "EditorIcons")); break; case VisualShaderNode::PORT_TYPE_SAMPLER: - item->set_icon(0, EditorNode::get_singleton()->get_gui_base()->get_icon("ImageTexture", "EditorIcons")); + item->set_icon(0, EditorNode::get_singleton()->get_gui_base()->get_theme_icon("ImageTexture", "EditorIcons")); break; default: break; @@ -420,7 +421,7 @@ void VisualShaderEditor::_draw_color_over_button(Object *obj, Color p_color) { if (!button) return; - Ref<StyleBox> normal = get_stylebox("normal", "Button"); + Ref<StyleBox> normal = get_theme_stylebox("normal", "Button"); button->draw_rect(Rect2(normal->get_offset(), button->get_size() - normal->get_minimum_size()), p_color); } @@ -436,7 +437,7 @@ static Ref<StyleBoxEmpty> make_empty_stylebox(float p_margin_left = -1, float p_ void VisualShaderEditor::_update_created_node(GraphNode *node) { if (EditorSettings::get_singleton()->get("interface/theme/use_graph_node_headers")) { - Ref<StyleBoxFlat> sb = node->get_stylebox("frame", "GraphNode"); + Ref<StyleBoxFlat> sb = node->get_theme_stylebox("frame", "GraphNode"); Color c = sb->get_border_color(); Color ic; Color mono_color; @@ -450,10 +451,10 @@ void VisualShaderEditor::_update_created_node(GraphNode *node) { mono_color.a = 0.85; c = mono_color; - node->add_color_override("title_color", c); + node->add_theme_color_override("title_color", c); c.a = 0.7; - node->add_color_override("close_color", c); - node->add_color_override("resizer_color", ic); + node->add_theme_color_override("close_color", c); + node->add_theme_color_override("resizer_color", ic); } } @@ -535,7 +536,7 @@ void VisualShaderEditor::_update_graph() { node->connect("dragged", callable_mp(this, &VisualShaderEditor::_node_dragged), varray(nodes[n_i])); - Control *custom_editor = NULL; + Control *custom_editor = nullptr; int port_offset = 0; if (is_group) { @@ -555,6 +556,17 @@ void VisualShaderEditor::_update_graph() { uniform_name->connect("text_entered", callable_mp(this, &VisualShaderEditor::_line_edit_changed), varray(uniform_name, nodes[n_i])); uniform_name->connect("focus_exited", callable_mp(this, &VisualShaderEditor::_line_edit_focus_out), varray(uniform_name, nodes[n_i])); + String error = vsnode->get_warning(visual_shader->get_mode(), type); + if (error != String()) { + offset = memnew(Control); + offset->set_custom_minimum_size(Size2(0, 4 * EDSCALE)); + node->add_child(offset); + Label *error_label = memnew(Label); + error_label->add_theme_color_override("font_color", get_theme_color("error_color", "Editor")); + error_label->set_text(error); + node->add_child(error_label); + } + if (vsnode->get_input_port_count() == 0 && vsnode->get_output_port_count() == 1 && vsnode->get_output_port_name(0) == "") { //shortcut VisualShaderNode::PortType port_right = vsnode->get_output_port_type(0); @@ -583,7 +595,7 @@ void VisualShaderEditor::_update_graph() { custom_editor->call_deferred("_show_prop_names", true); continue; } - custom_editor = NULL; + custom_editor = nullptr; } if (is_group) { @@ -641,7 +653,7 @@ void VisualShaderEditor::_update_graph() { } HBoxContainer *hb = memnew(HBoxContainer); - hb->add_constant_override("separation", 7 * EDSCALE); + hb->add_theme_constant_override("separation", 7 * EDSCALE); Variant default_value; @@ -705,7 +717,7 @@ void VisualShaderEditor::_update_graph() { name_box->connect("focus_exited", callable_mp(this, &VisualShaderEditor::_port_name_focus_out), varray(name_box, nodes[n_i], i, false)); Button *remove_btn = memnew(Button); - remove_btn->set_icon(EditorNode::get_singleton()->get_gui_base()->get_icon("Remove", "EditorIcons")); + remove_btn->set_icon(EditorNode::get_singleton()->get_gui_base()->get_theme_icon("Remove", "EditorIcons")); remove_btn->set_tooltip(TTR("Remove") + " " + name_left); remove_btn->connect("pressed", callable_mp(this, &VisualShaderEditor::_remove_input_port), varray(nodes[n_i], i), CONNECT_DEFERRED); hb->add_child(remove_btn); @@ -713,15 +725,15 @@ void VisualShaderEditor::_update_graph() { Label *label = memnew(Label); label->set_text(name_left); - label->add_style_override("normal", label_style); //more compact + label->add_theme_style_override("normal", label_style); //more compact hb->add_child(label); if (vsnode->get_input_port_default_hint(i) != "" && !port_left_used) { Label *hint_label = memnew(Label); hint_label->set_text("[" + vsnode->get_input_port_default_hint(i) + "]"); - hint_label->add_color_override("font_color", get_color("font_color_readonly", "TextEdit")); - hint_label->add_style_override("normal", label_style); + hint_label->add_theme_color_override("font_color", get_theme_color("font_color_readonly", "TextEdit")); + hint_label->add_theme_style_override("normal", label_style); hb->add_child(hint_label); } } @@ -734,7 +746,7 @@ void VisualShaderEditor::_update_graph() { if (valid_right) { if (is_group) { Button *remove_btn = memnew(Button); - remove_btn->set_icon(EditorNode::get_singleton()->get_gui_base()->get_icon("Remove", "EditorIcons")); + remove_btn->set_icon(EditorNode::get_singleton()->get_gui_base()->get_theme_icon("Remove", "EditorIcons")); remove_btn->set_tooltip(TTR("Remove") + " " + name_left); remove_btn->connect("pressed", callable_mp(this, &VisualShaderEditor::_remove_output_port), varray(nodes[n_i], i), CONNECT_DEFERRED); hb->add_child(remove_btn); @@ -760,7 +772,7 @@ void VisualShaderEditor::_update_graph() { } else { Label *label = memnew(Label); label->set_text(name_right); - label->add_style_override("normal", label_style); //more compact + label->add_theme_style_override("normal", label_style); //more compact hb->add_child(label); } } @@ -769,8 +781,8 @@ void VisualShaderEditor::_update_graph() { if (valid_right && edit_type->get_selected() == VisualShader::TYPE_FRAGMENT && port_right != VisualShaderNode::PORT_TYPE_TRANSFORM && port_right != VisualShaderNode::PORT_TYPE_SAMPLER) { TextureButton *preview = memnew(TextureButton); preview->set_toggle_mode(true); - preview->set_normal_texture(get_icon("GuiVisibilityHidden", "EditorIcons")); - preview->set_pressed_texture(get_icon("GuiVisibilityVisible", "EditorIcons")); + preview->set_normal_texture(get_theme_icon("GuiVisibilityHidden", "EditorIcons")); + preview->set_pressed_texture(get_theme_icon("GuiVisibilityVisible", "EditorIcons")); preview->set_v_size_flags(SIZE_SHRINK_CENTER); if (vsnode->get_output_port_for_preview() == i) { @@ -815,7 +827,7 @@ void VisualShaderEditor::_update_graph() { String error = vsnode->get_warning(visual_shader->get_mode(), type); if (error != String()) { Label *error_label = memnew(Label); - error_label->add_color_override("font_color", get_color("error_color", "Editor")); + error_label->add_theme_color_override("font_color", get_theme_color("error_color", "Editor")); error_label->set_text(error); node->add_child(error_label); } @@ -833,16 +845,16 @@ void VisualShaderEditor::_update_graph() { Color symbol_color = EDITOR_GET("text_editor/highlighting/symbol_color"); expression_box->set_syntax_coloring(true); - expression_box->add_color_override("background_color", background_color); + expression_box->add_theme_color_override("background_color", background_color); for (List<String>::Element *E = keyword_list.front(); E; E = E->next()) { expression_box->add_keyword_color(E->get(), keyword_color); } - expression_box->add_font_override("font", get_font("expression", "EditorFonts")); - expression_box->add_color_override("font_color", text_color); - expression_box->add_color_override("symbol_color", symbol_color); + expression_box->add_theme_font_override("font", get_theme_font("expression", "EditorFonts")); + expression_box->add_theme_color_override("font_color", text_color); + expression_box->add_theme_color_override("symbol_color", symbol_color); expression_box->add_color_region("/*", "*/", comment_color, false); expression_box->add_color_region("//", "", comment_color, false); @@ -1086,7 +1098,7 @@ void VisualShaderEditor::_expression_focus_out(Object *text_edit, int p_node) { } void VisualShaderEditor::_rebuild() { - if (visual_shader != NULL) { + if (visual_shader != nullptr) { EditorNode::get_singleton()->get_log()->clear(); visual_shader->rebuild(); } @@ -1110,7 +1122,7 @@ void VisualShaderEditor::_set_node_size(int p_type, int p_node, const Vector2 &p group_node->set_size(size); - GraphNode *gn = NULL; + GraphNode *gn = nullptr; if (edit_type->get_selected() == p_type) { // check - otherwise the error will be emitted Node *node2 = graph->get_node(itos(p_node)); gn = Object::cast_to<GraphNode>(node2); @@ -1125,7 +1137,7 @@ void VisualShaderEditor::_set_node_size(int p_type, int p_node, const Vector2 &p if (!expression_node.is_null()) { Control *text_box = expression_node->get_control(0); Size2 box_size = size; - if (gn != NULL) { + if (gn != nullptr) { if (box_size.x < 150 * EDSCALE || box_size.y < 0) { box_size.x = gn->get_size().x; } @@ -1272,8 +1284,8 @@ void VisualShaderEditor::_edit_port_default_input(Object *p_button, int p_node, Button *button = Object::cast_to<Button>(p_button); ERR_FAIL_COND(!button); Variant value = vsn->get_input_port_default_value(p_port); - property_editor->set_global_position(button->get_global_position() + Vector2(0, button->get_size().height)); - property_editor->edit(NULL, "", value.get_type(), value, 0, ""); + property_editor->set_position(button->get_screen_position() + Vector2(0, button->get_size().height)); + property_editor->edit(nullptr, "", value.get_type(), value, 0, ""); property_editor->popup(); editing_node = p_node; editing_port = p_port; @@ -1303,7 +1315,7 @@ void VisualShaderEditor::_add_texture_node(const String &p_path) { VisualShaderNode *VisualShaderEditor::_add_node(int p_idx, int p_op_idx) { - ERR_FAIL_INDEX_V(p_idx, add_options.size(), NULL); + ERR_FAIL_INDEX_V(p_idx, add_options.size(), nullptr); Ref<VisualShaderNode> vsnode; @@ -1311,7 +1323,7 @@ VisualShaderNode *VisualShaderEditor::_add_node(int p_idx, int p_op_idx) { if (!is_custom && add_options[p_idx].type != String()) { VisualShaderNode *vsn = Object::cast_to<VisualShaderNode>(ClassDB::instance(add_options[p_idx].type)); - ERR_FAIL_COND_V(!vsn, NULL); + ERR_FAIL_COND_V(!vsn, nullptr); VisualShaderNodeFloatConstant *constant = Object::cast_to<VisualShaderNodeFloatConstant>(vsn); @@ -1409,10 +1421,10 @@ VisualShaderNode *VisualShaderEditor::_add_node(int p_idx, int p_op_idx) { vsnode = Ref<VisualShaderNode>(vsn); } else { - ERR_FAIL_COND_V(add_options[p_idx].script.is_null(), NULL); + ERR_FAIL_COND_V(add_options[p_idx].script.is_null(), nullptr); String base_type = add_options[p_idx].script->get_instance_base_type(); VisualShaderNode *vsn = Object::cast_to<VisualShaderNode>(ClassDB::instance(base_type)); - ERR_FAIL_COND_V(!vsn, NULL); + ERR_FAIL_COND_V(!vsn, nullptr); vsnode = Ref<VisualShaderNode>(vsn); vsnode->set_script(add_options[p_idx].script); } @@ -1623,7 +1635,7 @@ void VisualShaderEditor::_graph_gui_input(const Ref<InputEvent> &p_event) { popup_menu->set_item_disabled(NodeMenuOptions::DELETE, to_change.empty()); popup_menu->set_item_disabled(NodeMenuOptions::DUPLICATE, to_change.empty()); menu_point = graph->get_local_mouse_position(); - Point2 gpos = Input::get_singleton()->get_mouse_position(); + Point2 gpos = InputFilter::get_singleton()->get_mouse_position(); popup_menu->set_position(gpos); popup_menu->popup(); } @@ -1636,7 +1648,7 @@ void VisualShaderEditor::_show_members_dialog(bool at_mouse_pos) { saved_node_pos_dirty = true; saved_node_pos = graph->get_local_mouse_position(); - Point2 gpos = Input::get_singleton()->get_mouse_position(); + Point2 gpos = InputFilter::get_singleton()->get_mouse_position(); members_dialog->popup(); members_dialog->set_position(gpos); } else { @@ -1646,8 +1658,8 @@ void VisualShaderEditor::_show_members_dialog(bool at_mouse_pos) { } // keep dialog within window bounds - Size2 window_size = OS::get_singleton()->get_window_size(); - Rect2 dialog_rect = members_dialog->get_global_rect(); + Size2 window_size = DisplayServer::get_singleton()->window_get_size(); + Rect2 dialog_rect = Rect2(members_dialog->get_position(), members_dialog->get_size()); if (dialog_rect.position.y + dialog_rect.size.y > window_size.y) { int difference = dialog_rect.position.y + dialog_rect.size.y - window_size.y; members_dialog->set_position(members_dialog->get_position() - Point2(0, difference)); @@ -1703,14 +1715,14 @@ void VisualShaderEditor::_notification(int p_what) { if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED) { - highend_label->set_modulate(get_color("vulkan_color", "Editor")); + highend_label->set_modulate(get_theme_color("vulkan_color", "Editor")); - error_panel->add_style_override("panel", get_stylebox("bg", "Tree")); - error_label->add_color_override("font_color", get_color("error_color", "Editor")); + error_panel->add_theme_style_override("panel", get_theme_stylebox("bg", "Tree")); + error_label->add_theme_color_override("font_color", get_theme_color("error_color", "Editor")); - node_filter->set_right_icon(Control::get_icon("Search", "EditorIcons")); + node_filter->set_right_icon(Control::get_theme_icon("Search", "EditorIcons")); - preview_shader->set_icon(Control::get_icon("Shader", "EditorIcons")); + preview_shader->set_icon(Control::get_theme_icon("Shader", "EditorIcons")); { Color background_color = EDITOR_GET("text_editor/highlighting/background_color"); @@ -1719,24 +1731,24 @@ void VisualShaderEditor::_notification(int p_what) { Color comment_color = EDITOR_GET("text_editor/highlighting/comment_color"); Color symbol_color = EDITOR_GET("text_editor/highlighting/symbol_color"); - preview_text->add_color_override("background_color", background_color); + preview_text->add_theme_color_override("background_color", background_color); for (List<String>::Element *E = keyword_list.front(); E; E = E->next()) { preview_text->add_keyword_color(E->get(), keyword_color); } - preview_text->add_font_override("font", get_font("expression", "EditorFonts")); - preview_text->add_color_override("font_color", text_color); - preview_text->add_color_override("symbol_color", symbol_color); + preview_text->add_theme_font_override("font", get_theme_font("expression", "EditorFonts")); + preview_text->add_theme_color_override("font_color", text_color); + preview_text->add_theme_color_override("symbol_color", symbol_color); preview_text->add_color_region("/*", "*/", comment_color, false); preview_text->add_color_region("//", "", comment_color, false); - error_text->add_font_override("font", get_font("status_source", "EditorFonts")); - error_text->add_color_override("font_color", get_color("error_color", "Editor")); + error_text->add_theme_font_override("font", get_theme_font("status_source", "EditorFonts")); + error_text->add_theme_color_override("font_color", get_theme_color("error_color", "Editor")); } - tools->set_icon(EditorNode::get_singleton()->get_gui_base()->get_icon("Tools", "EditorIcons")); + tools->set_icon(EditorNode::get_singleton()->get_gui_base()->get_theme_icon("Tools", "EditorIcons")); if (p_what == NOTIFICATION_THEME_CHANGED && is_visible_in_tree()) _update_graph(); @@ -2067,7 +2079,7 @@ void VisualShaderEditor::_member_filter_changed(const String &p_text) { void VisualShaderEditor::_member_selected() { TreeItem *item = members->get_selected(); - if (item != NULL && item->has_meta("id")) { + if (item != nullptr && item->has_meta("id")) { members_dialog->get_ok()->set_disabled(false); highend_label->set_visible(add_options[item->get_meta("id")].highend); node_desc->set_text(_get_description(item->get_meta("id"))); @@ -2083,7 +2095,7 @@ void VisualShaderEditor::_member_unselected() { void VisualShaderEditor::_member_create() { TreeItem *item = members->get_selected(); - if (item != NULL && item->has_meta("id")) { + if (item != nullptr && item->has_meta("id")) { int idx = members->get_selected()->get_meta("id"); _add_node(idx, add_options[idx].sub_func); members_dialog->hide(); @@ -2249,6 +2261,12 @@ void VisualShaderEditor::_show_preview_text() { } } +static ShaderLanguage::DataType _get_global_variable_type(const StringName &p_variable) { + + RS::GlobalVariableType gvt = RS::get_singleton()->global_variable_get_type(p_variable); + return RS::global_variable_type_get_shader_datatype(gvt); +} + void VisualShaderEditor::_update_preview() { if (!preview_showed) { @@ -2262,7 +2280,7 @@ void VisualShaderEditor::_update_preview() { ShaderLanguage sl; - Error err = sl.compile(code, ShaderTypes::get_singleton()->get_functions(VisualServer::ShaderMode(visual_shader->get_mode())), ShaderTypes::get_singleton()->get_modes(VisualServer::ShaderMode(visual_shader->get_mode())), ShaderTypes::get_singleton()->get_types()); + Error err = sl.compile(code, ShaderTypes::get_singleton()->get_functions(RenderingServer::ShaderMode(visual_shader->get_mode())), ShaderTypes::get_singleton()->get_modes(RenderingServer::ShaderMode(visual_shader->get_mode())), ShaderTypes::get_singleton()->get_types(), _get_global_variable_type); for (int i = 0; i < preview_text->get_line_count(); i++) { preview_text->set_line_as_marked(i, false); @@ -2297,7 +2315,7 @@ void VisualShaderEditor::_bind_methods() { ClassDB::bind_method("_is_available", &VisualShaderEditor::_is_available); } -VisualShaderEditor *VisualShaderEditor::singleton = NULL; +VisualShaderEditor *VisualShaderEditor::singleton = nullptr; VisualShaderEditor::VisualShaderEditor() { @@ -2489,13 +2507,10 @@ VisualShaderEditor::VisualShaderEditor() { members_dialog->get_ok()->set_text(TTR("Create")); members_dialog->get_ok()->connect("pressed", callable_mp(this, &VisualShaderEditor::_member_create)); members_dialog->get_ok()->set_disabled(true); - members_dialog->set_resizable(true); - members_dialog->set_as_minsize(); - members_dialog->connect("hide", callable_mp(this, &VisualShaderEditor::_member_cancel)); + members_dialog->connect("cancelled", callable_mp(this, &VisualShaderEditor::_member_cancel)); add_child(members_dialog); alert = memnew(AcceptDialog); - alert->set_as_minsize(); alert->get_label()->set_autowrap(true); alert->get_label()->set_align(Label::ALIGN_CENTER); alert->get_label()->set_valign(Label::VALIGN_CENTER); @@ -2669,6 +2684,38 @@ VisualShaderEditor::VisualShaderEditor() { add_options.push_back(AddOption("Transform", "Input", "Vertex", "VisualShaderNodeInput", vformat(input_param_for_vertex_shader_mode, "transform"), "transform", VisualShaderNode::PORT_TYPE_TRANSFORM, VisualShader::TYPE_VERTEX, Shader::MODE_PARTICLES)); add_options.push_back(AddOption("Velocity", "Input", "Vertex", "VisualShaderNodeInput", vformat(input_param_for_vertex_shader_mode, "velocity"), "velocity", VisualShaderNode::PORT_TYPE_VECTOR, VisualShader::TYPE_VERTEX, Shader::MODE_PARTICLES)); + // SKY INPUTS + + add_options.push_back(AddOption("AtCubeMapPass", "Input", "Fragment", "VisualShaderNodeInput", vformat(input_param_for_fragment_shader_mode, "at_cubemap_pass"), "at_cubemap_pass", VisualShaderNode::PORT_TYPE_BOOLEAN, VisualShader::TYPE_FRAGMENT, Shader::MODE_SKY)); + add_options.push_back(AddOption("AtHalfResPass", "Input", "Fragment", "VisualShaderNodeInput", vformat(input_param_for_fragment_shader_mode, "at_half_res_pass"), "at_half_res_pass", VisualShaderNode::PORT_TYPE_BOOLEAN, VisualShader::TYPE_FRAGMENT, Shader::MODE_SKY)); + add_options.push_back(AddOption("AtQuarterResPass", "Input", "Fragment", "VisualShaderNodeInput", vformat(input_param_for_fragment_shader_mode, "at_quarter_res_pass"), "at_quarter_res_pass", VisualShaderNode::PORT_TYPE_BOOLEAN, VisualShader::TYPE_FRAGMENT, Shader::MODE_SKY)); + add_options.push_back(AddOption("EyeDir", "Input", "Fragment", "VisualShaderNodeInput", vformat(input_param_for_fragment_shader_mode, "eyedir"), "eyedir", VisualShaderNode::PORT_TYPE_VECTOR, VisualShader::TYPE_FRAGMENT, Shader::MODE_SKY)); + add_options.push_back(AddOption("HalfResColor", "Input", "Fragment", "VisualShaderNodeInput", vformat(input_param_for_fragment_shader_mode, "half_res_color"), "half_res_color", VisualShaderNode::PORT_TYPE_VECTOR, VisualShader::TYPE_FRAGMENT, Shader::MODE_SKY)); + add_options.push_back(AddOption("HalfResAlpha", "Input", "Fragment", "VisualShaderNodeInput", vformat(input_param_for_fragment_shader_mode, "half_res_alpha"), "half_res_alpha", VisualShaderNode::PORT_TYPE_SCALAR, VisualShader::TYPE_FRAGMENT, Shader::MODE_SKY)); + add_options.push_back(AddOption("Light0Color", "Input", "Fragment", "VisualShaderNodeInput", vformat(input_param_for_fragment_shader_mode, "light0_color"), "light0_color", VisualShaderNode::PORT_TYPE_VECTOR, VisualShader::TYPE_FRAGMENT, Shader::MODE_SKY)); + add_options.push_back(AddOption("Light0Direction", "Input", "Fragment", "VisualShaderNodeInput", vformat(input_param_for_fragment_shader_mode, "light0_direction"), "light0_direction", VisualShaderNode::PORT_TYPE_VECTOR, VisualShader::TYPE_FRAGMENT, Shader::MODE_SKY)); + add_options.push_back(AddOption("Light0Enabled", "Input", "Fragment", "VisualShaderNodeInput", vformat(input_param_for_fragment_shader_mode, "light0_enabled"), "light0_enabled", VisualShaderNode::PORT_TYPE_BOOLEAN, VisualShader::TYPE_FRAGMENT, Shader::MODE_SKY)); + add_options.push_back(AddOption("Light0Energy", "Input", "Fragment", "VisualShaderNodeInput", vformat(input_param_for_fragment_shader_mode, "light0_energy"), "light0_energy", VisualShaderNode::PORT_TYPE_SCALAR, VisualShader::TYPE_FRAGMENT, Shader::MODE_SKY)); + add_options.push_back(AddOption("Light1Color", "Input", "Fragment", "VisualShaderNodeInput", vformat(input_param_for_fragment_shader_mode, "light1_color"), "light1_color", VisualShaderNode::PORT_TYPE_VECTOR, VisualShader::TYPE_FRAGMENT, Shader::MODE_SKY)); + add_options.push_back(AddOption("Light1Direction", "Input", "Fragment", "VisualShaderNodeInput", vformat(input_param_for_fragment_shader_mode, "light1_direction"), "light1_direction", VisualShaderNode::PORT_TYPE_VECTOR, VisualShader::TYPE_FRAGMENT, Shader::MODE_SKY)); + add_options.push_back(AddOption("Light1Enabled", "Input", "Fragment", "VisualShaderNodeInput", vformat(input_param_for_fragment_shader_mode, "light1_enabled"), "light1_enabled", VisualShaderNode::PORT_TYPE_BOOLEAN, VisualShader::TYPE_FRAGMENT, Shader::MODE_SKY)); + add_options.push_back(AddOption("Light1Energy", "Input", "Fragment", "VisualShaderNodeInput", vformat(input_param_for_fragment_shader_mode, "light1_energy"), "light1_energy", VisualShaderNode::PORT_TYPE_SCALAR, VisualShader::TYPE_FRAGMENT, Shader::MODE_SKY)); + add_options.push_back(AddOption("Light2Color", "Input", "Fragment", "VisualShaderNodeInput", vformat(input_param_for_fragment_shader_mode, "light2_color"), "light2_color", VisualShaderNode::PORT_TYPE_VECTOR, VisualShader::TYPE_FRAGMENT, Shader::MODE_SKY)); + add_options.push_back(AddOption("Light2Direction", "Input", "Fragment", "VisualShaderNodeInput", vformat(input_param_for_fragment_shader_mode, "light2_direction"), "light2_direction", VisualShaderNode::PORT_TYPE_VECTOR, VisualShader::TYPE_FRAGMENT, Shader::MODE_SKY)); + add_options.push_back(AddOption("Light2Enabled", "Input", "Fragment", "VisualShaderNodeInput", vformat(input_param_for_fragment_shader_mode, "light2_enabled"), "light2_enabled", VisualShaderNode::PORT_TYPE_BOOLEAN, VisualShader::TYPE_FRAGMENT, Shader::MODE_SKY)); + add_options.push_back(AddOption("Light2Energy", "Input", "Fragment", "VisualShaderNodeInput", vformat(input_param_for_fragment_shader_mode, "light2_energy"), "light2_energy", VisualShaderNode::PORT_TYPE_SCALAR, VisualShader::TYPE_FRAGMENT, Shader::MODE_SKY)); + add_options.push_back(AddOption("Light3Color", "Input", "Fragment", "VisualShaderNodeInput", vformat(input_param_for_fragment_shader_mode, "light3_color"), "light3_color", VisualShaderNode::PORT_TYPE_VECTOR, VisualShader::TYPE_FRAGMENT, Shader::MODE_SKY)); + add_options.push_back(AddOption("Light3Direction", "Input", "Fragment", "VisualShaderNodeInput", vformat(input_param_for_fragment_shader_mode, "light3_direction"), "light3_direction", VisualShaderNode::PORT_TYPE_VECTOR, VisualShader::TYPE_FRAGMENT, Shader::MODE_SKY)); + add_options.push_back(AddOption("Light3Enabled", "Input", "Fragment", "VisualShaderNodeInput", vformat(input_param_for_fragment_shader_mode, "light3_enabled"), "light3_enabled", VisualShaderNode::PORT_TYPE_BOOLEAN, VisualShader::TYPE_FRAGMENT, Shader::MODE_SKY)); + add_options.push_back(AddOption("Light3Energy", "Input", "Fragment", "VisualShaderNodeInput", vformat(input_param_for_fragment_shader_mode, "light3_energy"), "light3_energy", VisualShaderNode::PORT_TYPE_SCALAR, VisualShader::TYPE_FRAGMENT, Shader::MODE_SKY)); + add_options.push_back(AddOption("Position", "Input", "Fragment", "VisualShaderNodeInput", vformat(input_param_for_fragment_shader_mode, "position"), "position", VisualShaderNode::PORT_TYPE_VECTOR, VisualShader::TYPE_FRAGMENT, Shader::MODE_SKY)); + add_options.push_back(AddOption("QuarterResColor", "Input", "Fragment", "VisualShaderNodeInput", vformat(input_param_for_fragment_shader_mode, "quarter_res_color"), "quarter_res_color", VisualShaderNode::PORT_TYPE_VECTOR, VisualShader::TYPE_FRAGMENT, Shader::MODE_SKY)); + add_options.push_back(AddOption("QuarterResAlpha", "Input", "Fragment", "VisualShaderNodeInput", vformat(input_param_for_fragment_shader_mode, "quarter_res_alpha"), "quarter_res_alpha", VisualShaderNode::PORT_TYPE_SCALAR, VisualShader::TYPE_FRAGMENT, Shader::MODE_SKY)); + add_options.push_back(AddOption("Radiance", "Input", "Fragment", "VisualShaderNodeInput", vformat(input_param_for_fragment_shader_mode, "radiance"), "radiance", VisualShaderNode::PORT_TYPE_SAMPLER, VisualShader::TYPE_FRAGMENT, Shader::MODE_SKY)); + add_options.push_back(AddOption("ScreenUV", "Input", "Fragment", "VisualShaderNodeInput", vformat(input_param_for_fragment_shader_mode, "screen_uv"), "screen_uv", VisualShaderNode::PORT_TYPE_VECTOR, VisualShader::TYPE_FRAGMENT, Shader::MODE_SKY)); + add_options.push_back(AddOption("SkyCoords", "Input", "Fragment", "VisualShaderNodeInput", vformat(input_param_for_fragment_shader_mode, "sky_coords"), "sky_coords", VisualShaderNode::PORT_TYPE_VECTOR, VisualShader::TYPE_FRAGMENT, Shader::MODE_SKY)); + add_options.push_back(AddOption("Time", "Input", "Fragment", "VisualShaderNodeInput", vformat(input_param_for_fragment_shader_mode, "time"), "time", VisualShaderNode::PORT_TYPE_SCALAR, VisualShader::TYPE_FRAGMENT, Shader::MODE_SKY)); + // SCALAR add_options.push_back(AddOption("FloatFunc", "Scalar", "Common", "VisualShaderNodeFloatFunc", TTR("Float function."), -1, VisualShaderNode::PORT_TYPE_SCALAR)); @@ -2950,12 +2997,12 @@ public: void setup(const Ref<VisualShaderNodeInput> &p_input) { input = p_input; Ref<Texture2D> type_icon[6] = { - EditorNode::get_singleton()->get_gui_base()->get_icon("float", "EditorIcons"), - EditorNode::get_singleton()->get_gui_base()->get_icon("int", "EditorIcons"), - EditorNode::get_singleton()->get_gui_base()->get_icon("Vector3", "EditorIcons"), - EditorNode::get_singleton()->get_gui_base()->get_icon("bool", "EditorIcons"), - EditorNode::get_singleton()->get_gui_base()->get_icon("Transform", "EditorIcons"), - EditorNode::get_singleton()->get_gui_base()->get_icon("ImageTexture", "EditorIcons"), + EditorNode::get_singleton()->get_gui_base()->get_theme_icon("float", "EditorIcons"), + EditorNode::get_singleton()->get_gui_base()->get_theme_icon("int", "EditorIcons"), + EditorNode::get_singleton()->get_gui_base()->get_theme_icon("Vector3", "EditorIcons"), + EditorNode::get_singleton()->get_gui_base()->get_theme_icon("bool", "EditorIcons"), + EditorNode::get_singleton()->get_gui_base()->get_theme_icon("Transform", "EditorIcons"), + EditorNode::get_singleton()->get_gui_base()->get_theme_icon("ImageTexture", "EditorIcons"), }; add_item("[None]"); @@ -3099,7 +3146,7 @@ Control *VisualShaderNodePluginDefault::create_editor(const Ref<Resource> &p_par Vector<StringName> properties = p_node->get_editable_properties(); if (properties.size() == 0) { - return NULL; + return nullptr; } List<PropertyInfo> props; @@ -3117,7 +3164,7 @@ Control *VisualShaderNodePluginDefault::create_editor(const Ref<Resource> &p_par } if (pinfo.size() == 0) - return NULL; + return nullptr; properties.clear(); @@ -3128,7 +3175,7 @@ Control *VisualShaderNodePluginDefault::create_editor(const Ref<Resource> &p_par EditorProperty *prop = EditorInspector::instantiate_property_editor(node.ptr(), pinfo[i].type, pinfo[i].name, pinfo[i].hint, pinfo[i].hint_string, pinfo[i].usage); if (!prop) - return NULL; + return nullptr; if (Object::cast_to<EditorPropertyResource>(prop)) { Object::cast_to<EditorPropertyResource>(prop)->set_use_sub_inspector(false); @@ -3250,7 +3297,7 @@ void EditorInspectorShaderModePlugin::parse_begin(Object *p_object) { //do none } -bool EditorInspectorShaderModePlugin::parse_property(Object *p_object, Variant::Type p_type, const String &p_path, PropertyHint p_hint, const String &p_hint_text, int p_usage) { +bool EditorInspectorShaderModePlugin::parse_property(Object *p_object, Variant::Type p_type, const String &p_path, PropertyHint p_hint, const String &p_hint_text, int p_usage, bool p_wide) { if (p_path == "mode" && p_object->is_class("VisualShader") && p_type == Variant::INT) { diff --git a/editor/plugins/visual_shader_editor_plugin.h b/editor/plugins/visual_shader_editor_plugin.h index 473c1bb070..a495b09b5c 100644 --- a/editor/plugins/visual_shader_editor_plugin.h +++ b/editor/plugins/visual_shader_editor_plugin.h @@ -338,7 +338,7 @@ class EditorInspectorShaderModePlugin : public EditorInspectorPlugin { public: virtual bool can_handle(Object *p_object); virtual void parse_begin(Object *p_object); - virtual bool parse_property(Object *p_object, Variant::Type p_type, const String &p_path, PropertyHint p_hint, const String &p_hint_text, int p_usage); + virtual bool parse_property(Object *p_object, Variant::Type p_type, const String &p_path, PropertyHint p_hint, const String &p_hint_text, int p_usage, bool p_wide = false); virtual void parse_end(); }; diff --git a/editor/progress_dialog.cpp b/editor/progress_dialog.cpp index cdc5255edd..86df069b8b 100644 --- a/editor/progress_dialog.cpp +++ b/editor/progress_dialog.cpp @@ -34,6 +34,7 @@ #include "core/os/os.h" #include "editor_scale.h" #include "main/main.h" +#include "servers/display_server.h" void BackgroundProgress::_add_task(const String &p_task, const String &p_label, int p_steps) { @@ -134,19 +135,9 @@ void BackgroundProgress::end_task(const String &p_task) { //////////////////////////////////////////////// -ProgressDialog *ProgressDialog::singleton = NULL; +ProgressDialog *ProgressDialog::singleton = nullptr; void ProgressDialog::_notification(int p_what) { - - switch (p_what) { - - case NOTIFICATION_DRAW: { - - Ref<StyleBox> style = get_stylebox("panel", "PopupMenu"); - draw_style_box(style, Rect2(Point2(), get_size())); - - } break; - } } void ProgressDialog::_popup() { @@ -154,14 +145,14 @@ void ProgressDialog::_popup() { Size2 ms = main->get_combined_minimum_size(); ms.width = MAX(500 * EDSCALE, ms.width); - Ref<StyleBox> style = get_stylebox("panel", "PopupMenu"); + Ref<StyleBox> style = main->get_theme_stylebox("panel", "PopupMenu"); ms += style->get_minimum_size(); main->set_margin(MARGIN_LEFT, style->get_margin(MARGIN_LEFT)); main->set_margin(MARGIN_RIGHT, -style->get_margin(MARGIN_RIGHT)); main->set_margin(MARGIN_TOP, style->get_margin(MARGIN_TOP)); main->set_margin(MARGIN_BOTTOM, -style->get_margin(MARGIN_BOTTOM)); - raise(); + //raise(); popup_centered(ms); } @@ -219,7 +210,7 @@ bool ProgressDialog::task_step(const String &p_task, const String &p_state, int t.state->set_text(p_state); last_progress_tick = OS::get_singleton()->get_ticks_usec(); if (cancel_hb->is_visible()) { - OS::get_singleton()->force_process_input(); + DisplayServer::get_singleton()->process_events(); } Main::iteration(); // this will not work on a lot of platforms, so it's only meant for the editor diff --git a/editor/progress_dialog.h b/editor/progress_dialog.h index e01c7d802b..82f479ae9d 100644 --- a/editor/progress_dialog.h +++ b/editor/progress_dialog.h @@ -68,9 +68,9 @@ public: BackgroundProgress() {} }; -class ProgressDialog : public Popup { +class ProgressDialog : public PopupPanel { - GDCLASS(ProgressDialog, Popup); + GDCLASS(ProgressDialog, PopupPanel); struct Task { String task; diff --git a/editor/project_export.cpp b/editor/project_export.cpp index 37b959c78a..04ec5ae043 100644 --- a/editor/project_export.cpp +++ b/editor/project_export.cpp @@ -46,25 +46,28 @@ #include "scene/gui/margin_container.h" #include "scene/gui/scroll_container.h" #include "scene/gui/tab_container.h" - +#include "servers/display_server.h" + +void ProjectExportDialog::_theme_changed() { + duplicate_preset->set_icon(presets->get_theme_icon("Duplicate", "EditorIcons")); + delete_preset->set_icon(presets->get_theme_icon("Remove", "EditorIcons")); + Control *panel = custom_feature_display->get_parent_control(); + if (panel) + panel->add_theme_style_override("panel", patches->get_theme_stylebox("bg", "Tree")); +} void ProjectExportDialog::_notification(int p_what) { switch (p_what) { + case NOTIFICATION_VISIBILITY_CHANGED: { + if (!is_visible()) { + EditorSettings::get_singleton()->set_project_metadata("dialog_bounds", "export", Rect2(get_position(), get_size())); + } + } break; case NOTIFICATION_READY: { - duplicate_preset->set_icon(get_icon("Duplicate", "EditorIcons")); - delete_preset->set_icon(get_icon("Remove", "EditorIcons")); + duplicate_preset->set_icon(presets->get_theme_icon("Duplicate", "EditorIcons")); + delete_preset->set_icon(presets->get_theme_icon("Remove", "EditorIcons")); connect("confirmed", callable_mp(this, &ProjectExportDialog::_export_pck_zip)); - custom_feature_display->get_parent_control()->add_style_override("panel", get_stylebox("bg", "Tree")); - } break; - case NOTIFICATION_POPUP_HIDE: { - EditorSettings::get_singleton()->set_project_metadata("dialog_bounds", "export", get_rect()); - } break; - case NOTIFICATION_THEME_CHANGED: { - duplicate_preset->set_icon(get_icon("Duplicate", "EditorIcons")); - delete_preset->set_icon(get_icon("Remove", "EditorIcons")); - Control *panel = custom_feature_display->get_parent_control(); - if (panel) - panel->add_style_override("panel", get_stylebox("bg", "Tree")); + custom_feature_display->get_parent_control()->add_theme_style_override("panel", patches->get_theme_stylebox("bg", "Tree")); } break; } } @@ -193,7 +196,7 @@ void ProjectExportDialog::_edit_preset(int p_index) { name->set_editable(false); export_path->hide(); runnable->set_disabled(true); - parameters->edit(NULL); + parameters->edit(nullptr); presets->unselect_all(); duplicate_preset->set_disabled(true); delete_preset->set_disabled(true); @@ -247,8 +250,8 @@ void ProjectExportDialog::_edit_preset(int p_index) { patch->set_checked(0, true); patch->set_tooltip(0, patchlist[i]); patch->set_metadata(0, i); - patch->add_button(0, get_icon("Remove", "EditorIcons"), 0); - patch->add_button(0, get_icon("folder", "FileDialog"), 1); + patch->add_button(0, presets->get_theme_icon("Remove", "EditorIcons"), 0); + patch->add_button(0, presets->get_theme_icon("folder", "FileDialog"), 1); } TreeItem *patch_add = patches->create_item(patch_root); @@ -258,7 +261,7 @@ void ProjectExportDialog::_edit_preset(int p_index) { else patch_add->set_text(0, TTR("Add previous patches...")); - patch_add->add_button(0, get_icon("folder", "FileDialog"), 1); + patch_add->add_button(0, presets->get_theme_icon("folder", "FileDialog"), 1); _fill_resource_tree(); @@ -299,7 +302,7 @@ void ProjectExportDialog::_edit_preset(int p_index) { custom_features->set_text(current->get_custom_features()); _update_feature_list(); _update_export_all(); - minimum_size_changed(); + child_controls_changed(); int script_export_mode = current->get_script_export_mode(); script_mode->select(script_export_mode); @@ -388,7 +391,7 @@ void ProjectExportDialog::_patch_button_pressed(Object *p_item, int p_column, in Vector<String> patches = current->get_patches(); ERR_FAIL_INDEX(patch_index, patches.size()); patch_erase->set_text(vformat(TTR("Delete patch '%s' from list?"), patches[patch_index].get_file())); - patch_erase->popup_centered_minsize(); + patch_erase->popup_centered(); } else { patch_dialog->popup_centered_ratio(); } @@ -618,7 +621,7 @@ void ProjectExportDialog::_delete_preset() { return; delete_confirm->set_text(vformat(TTR("Delete preset '%s'?"), current->get_name())); - delete_confirm->popup_centered_minsize(); + delete_confirm->popup_centered(); } void ProjectExportDialog::_delete_preset_confirm() { @@ -649,7 +652,7 @@ Variant ProjectExportDialog::get_drag_data_fw(const Point2 &p_point, Control *p_ label->set_text(presets->get_item_text(pos)); drag->add_child(label); - set_drag_preview(drag); + presets->set_drag_preview(drag); return d; } @@ -666,7 +669,7 @@ Variant ProjectExportDialog::get_drag_data_fw(const Point2 &p_point, Control *p_ Label *label = memnew(Label); label->set_text(item->get_text(0)); - set_drag_preview(label); + patches->set_drag_preview(label); return d; } @@ -816,7 +819,7 @@ void ProjectExportDialog::_fill_resource_tree() { bool ProjectExportDialog::_fill_tree(EditorFileSystemDirectory *p_dir, TreeItem *p_item, Ref<EditorExportPreset> ¤t, bool p_only_scenes) { - p_item->set_icon(0, get_icon("folder", "FileDialog")); + p_item->set_icon(0, presets->get_theme_icon("folder", "FileDialog")); p_item->set_text(0, p_dir->get_name() + "/"); bool used = false; @@ -954,7 +957,7 @@ void ProjectExportDialog::_export_project() { export_project->get_line_edit()->connect_compat("text_entered", export_project, "_file_entered"); } - export_project->set_mode(EditorFileDialog::MODE_SAVE_FILE); + export_project->set_file_mode(EditorFileDialog::FILE_MODE_SAVE_FILE); export_project->popup_centered_ratio(); } @@ -979,14 +982,14 @@ void ProjectExportDialog::_export_project_to_path(const String &p_path) { ERR_PRINT(vformat("Failed to export the project for platform '%s'.", platform->get_name())); error_dialog->show(); - error_dialog->popup_centered_minsize(Size2(300, 80)); + error_dialog->popup_centered(Size2(300, 80)); } } void ProjectExportDialog::_export_all_dialog() { export_all_dialog->show(); - export_all_dialog->popup_centered_minsize(Size2(300, 80)); + export_all_dialog->popup_centered(Size2(300, 80)); } void ProjectExportDialog::_export_all_dialog_action(const String &p_str) { @@ -1017,7 +1020,7 @@ void ProjectExportDialog::_export_all(bool p_debug) { error_dialog->set_text(TTR("Export templates for this platform are missing/corrupted:") + " " + platform->get_name()); } error_dialog->show(); - error_dialog->popup_centered_minsize(Size2(300, 80)); + error_dialog->popup_centered(Size2(300, 80)); ERR_PRINT("Failed to export project"); } } @@ -1039,13 +1042,13 @@ void ProjectExportDialog::_bind_methods() { ProjectExportDialog::ProjectExportDialog() { set_title(TTR("Export")); - set_resizable(true); VBoxContainer *main_vb = memnew(VBoxContainer); + main_vb->connect("theme_changed", callable_mp(this, &ProjectExportDialog::_theme_changed)); add_child(main_vb); HSplitContainer *hbox = memnew(HSplitContainer); main_vb->add_child(hbox); - hbox->set_v_size_flags(SIZE_EXPAND_FILL); + hbox->set_v_size_flags(Control::SIZE_EXPAND_FILL); // Presets list. @@ -1064,9 +1067,12 @@ ProjectExportDialog::ProjectExportDialog() { preset_hb->add_child(add_preset); MarginContainer *mc = memnew(MarginContainer); preset_vb->add_child(mc); - mc->set_v_size_flags(SIZE_EXPAND_FILL); + mc->set_v_size_flags(Control::SIZE_EXPAND_FILL); presets = memnew(ItemList); - presets->set_drag_forwarding(this); +#ifndef _MSC_VER +#warning must reimplement drag forward +#endif + //presets->set_drag_forwarding(this); mc->add_child(presets); presets->connect("item_selected", callable_mp(this, &ProjectExportDialog::_edit_preset)); duplicate_preset = memnew(ToolButton); @@ -1104,14 +1110,14 @@ ProjectExportDialog::ProjectExportDialog() { sections->set_tab_align(TabContainer::ALIGN_LEFT); sections->set_use_hidden_tabs_for_min_size(true); settings_vb->add_child(sections); - sections->set_v_size_flags(SIZE_EXPAND_FILL); + sections->set_v_size_flags(Control::SIZE_EXPAND_FILL); // Main preset parameters. parameters = memnew(EditorInspector); sections->add_child(parameters); parameters->set_name(TTR("Options")); - parameters->set_v_size_flags(SIZE_EXPAND_FILL); + parameters->set_v_size_flags(Control::SIZE_EXPAND_FILL); parameters->connect("property_edited", callable_mp(this, &ProjectExportDialog::_update_parameters)); // Resources export parameters. @@ -1131,7 +1137,7 @@ ProjectExportDialog::ProjectExportDialog() { include_label->set_text(TTR("Resources to export:")); resources_vb->add_child(include_label); include_margin = memnew(MarginContainer); - include_margin->set_v_size_flags(SIZE_EXPAND_FILL); + include_margin->set_v_size_flags(Control::SIZE_EXPAND_FILL); resources_vb->add_child(include_margin); include_files = memnew(Tree); @@ -1163,11 +1169,14 @@ ProjectExportDialog::ProjectExportDialog() { patches = memnew(Tree); patch_vb->add_child(patches); - patches->set_v_size_flags(SIZE_EXPAND_FILL); + patches->set_v_size_flags(Control::SIZE_EXPAND_FILL); patches->set_hide_root(true); patches->connect("button_pressed", callable_mp(this, &ProjectExportDialog::_patch_button_pressed)); patches->connect("item_edited", callable_mp(this, &ProjectExportDialog::_patch_edited)); - patches->set_drag_forwarding(this); +#ifndef _MSC_VER +#warning must reimplement drag forward +#endif + //patches->set_drag_forwarding(this); patches->set_edit_checkbox_cell_only_when_checkbox_is_pressed(true); HBoxContainer *patches_hb = memnew(HBoxContainer); @@ -1180,7 +1189,7 @@ ProjectExportDialog::ProjectExportDialog() { patch_dialog = memnew(EditorFileDialog); patch_dialog->add_filter("*.pck ; " + TTR("Pack File")); - patch_dialog->set_mode(EditorFileDialog::MODE_OPEN_FILE); + patch_dialog->set_file_mode(EditorFileDialog::FILE_MODE_OPEN_FILE); patch_dialog->connect("file_selected", callable_mp(this, &ProjectExportDialog::_patch_selected)); add_child(patch_dialog); @@ -1196,12 +1205,9 @@ ProjectExportDialog::ProjectExportDialog() { custom_features = memnew(LineEdit); custom_features->connect("text_changed", callable_mp(this, &ProjectExportDialog::_custom_features_changed)); feature_vb->add_margin_child(TTR("Custom (comma-separated):"), custom_features); - Panel *features_panel = memnew(Panel); custom_feature_display = memnew(RichTextLabel); - features_panel->add_child(custom_feature_display); - custom_feature_display->set_anchors_and_margins_preset(Control::PRESET_WIDE, Control::PRESET_MODE_MINSIZE, 10 * EDSCALE); - custom_feature_display->set_v_size_flags(SIZE_EXPAND_FILL); - feature_vb->add_margin_child(TTR("Feature List:"), features_panel, true); + custom_feature_display->set_v_size_flags(Control::SIZE_EXPAND_FILL); + feature_vb->add_margin_child(TTR("Feature List:"), custom_feature_display, true); sections->add_child(feature_vb); // Script export parameters. @@ -1220,7 +1226,7 @@ ProjectExportDialog::ProjectExportDialog() { script_key->connect("text_changed", callable_mp(this, &ProjectExportDialog::_script_encryption_key_changed)); script_key_error = memnew(Label); script_key_error->set_text("- " + TTR("Invalid Encryption Key (must be 64 characters long)")); - script_key_error->add_color_override("font_color", EditorNode::get_singleton()->get_gui_base()->get_color("error_color", "Editor")); + script_key_error->add_theme_color_override("font_color", EditorNode::get_singleton()->get_gui_base()->get_theme_color("error_color", "Editor")); script_vb->add_margin_child(TTR("Script Encryption Key (256-bits as hex):"), script_key); script_vb->add_child(script_key_error); sections->add_child(script_vb); @@ -1235,7 +1241,7 @@ ProjectExportDialog::ProjectExportDialog() { delete_preset->set_disabled(true); script_key_error->hide(); sections->hide(); - parameters->edit(NULL); + parameters->edit(nullptr); // Deletion dialog. @@ -1250,7 +1256,7 @@ ProjectExportDialog::ProjectExportDialog() { get_cancel()->set_text(TTR("Close")); get_ok()->set_text(TTR("Export PCK/Zip")); - export_button = add_button(TTR("Export Project"), !OS::get_singleton()->get_swap_ok_cancel(), "export"); + export_button = add_button(TTR("Export Project"), !DisplayServer::get_singleton()->get_swap_ok_cancel(), "export"); export_button->connect("pressed", callable_mp(this, &ProjectExportDialog::_export_project)); // Disable initially before we select a valid preset export_button->set_disabled(true); @@ -1265,7 +1271,7 @@ ProjectExportDialog::ProjectExportDialog() { export_all_dialog->add_button(TTR("Release"), true, "release"); export_all_dialog->connect("custom_action", callable_mp(this, &ProjectExportDialog::_export_all_dialog_action)); - export_all_button = add_button(TTR("Export All"), !OS::get_singleton()->get_swap_ok_cancel(), "export"); + export_all_button = add_button(TTR("Export All"), !DisplayServer::get_singleton()->get_swap_ok_cancel(), "export"); export_all_button->connect("pressed", callable_mp(this, &ProjectExportDialog::_export_all_dialog)); export_all_button->set_disabled(true); @@ -1273,14 +1279,14 @@ ProjectExportDialog::ProjectExportDialog() { export_pck_zip->add_filter("*.zip ; " + TTR("ZIP File")); export_pck_zip->add_filter("*.pck ; " + TTR("Godot Game Pack")); export_pck_zip->set_access(EditorFileDialog::ACCESS_FILESYSTEM); - export_pck_zip->set_mode(EditorFileDialog::MODE_SAVE_FILE); + export_pck_zip->set_file_mode(EditorFileDialog::FILE_MODE_SAVE_FILE); add_child(export_pck_zip); export_pck_zip->connect("file_selected", callable_mp(this, &ProjectExportDialog::_export_pck_zip_selected)); export_error = memnew(Label); main_vb->add_child(export_error); export_error->hide(); - export_error->add_color_override("font_color", EditorNode::get_singleton()->get_gui_base()->get_color("error_color", "Editor")); + export_error->add_theme_color_override("font_color", EditorNode::get_singleton()->get_gui_base()->get_theme_color("error_color", "Editor")); export_templates_error = memnew(HBoxContainer); main_vb->add_child(export_templates_error); @@ -1288,7 +1294,7 @@ ProjectExportDialog::ProjectExportDialog() { Label *export_error2 = memnew(Label); export_templates_error->add_child(export_error2); - export_error2->add_color_override("font_color", EditorNode::get_singleton()->get_gui_base()->get_color("error_color", "Editor")); + export_error2->add_theme_color_override("font_color", EditorNode::get_singleton()->get_gui_base()->get_theme_color("error_color", "Editor")); export_error2->set_text(" - " + TTR("Export templates for this platform are missing:") + " "); error_dialog = memnew(AcceptDialog); @@ -1299,7 +1305,7 @@ ProjectExportDialog::ProjectExportDialog() { LinkButton *download_templates = memnew(LinkButton); download_templates->set_text(TTR("Manage Export Templates")); - download_templates->set_v_size_flags(SIZE_SHRINK_CENTER); + download_templates->set_v_size_flags(Control::SIZE_SHRINK_CENTER); export_templates_error->add_child(download_templates); download_templates->connect("pressed", callable_mp(this, &ProjectExportDialog::_open_export_template_manager)); diff --git a/editor/project_export.h b/editor/project_export.h index 00e6dfd6e3..2e311eb3b3 100644 --- a/editor/project_export.h +++ b/editor/project_export.h @@ -167,6 +167,7 @@ private: void _tab_changed(int); protected: + void _theme_changed(); void _notification(int p_what); static void _bind_methods(); diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp index 94f9bf2767..0ca540a33f 100644 --- a/editor/project_manager.cpp +++ b/editor/project_manager.cpp @@ -51,6 +51,8 @@ #include "scene/gui/separator.h" #include "scene/gui/texture_rect.h" #include "scene/gui/tool_button.h" +#include "scene/main/window.h" +#include "servers/display_server.h" static inline String get_project_key_from_path(const String &dir) { return dir.replace("/", "::"); @@ -115,22 +117,22 @@ private: case MESSAGE_ERROR: { - msg->add_color_override("font_color", get_color("error_color", "Editor")); + msg->add_theme_color_override("font_color", msg->get_theme_color("error_color", "Editor")); msg->set_modulate(Color(1, 1, 1, 1)); - new_icon = get_icon("StatusError", "EditorIcons"); + new_icon = msg->get_theme_icon("StatusError", "EditorIcons"); } break; case MESSAGE_WARNING: { - msg->add_color_override("font_color", get_color("warning_color", "Editor")); + msg->add_theme_color_override("font_color", msg->get_theme_color("warning_color", "Editor")); msg->set_modulate(Color(1, 1, 1, 1)); - new_icon = get_icon("StatusWarning", "EditorIcons"); + new_icon = msg->get_theme_icon("StatusWarning", "EditorIcons"); } break; case MESSAGE_SUCCESS: { msg->set_modulate(Color(1, 1, 1, 0)); - new_icon = get_icon("StatusSuccess", "EditorIcons"); + new_icon = msg->get_theme_icon("StatusSuccess", "EditorIcons"); } break; } @@ -141,7 +143,7 @@ private: install_status_rect->set_texture(new_icon); } - set_size(Size2(500, 0) * EDSCALE); + set_size(Size2i(500, 0) * EDSCALE); } String _test_path() { @@ -189,7 +191,7 @@ private: if (valid_path != "" && !d->file_exists("project.godot")) { if (valid_path.ends_with(".zip")) { - FileAccess *src_f = NULL; + FileAccess *src_f = nullptr; zlib_filefunc_def io = zipio_create_io_from_file(&src_f); unzFile pkg = unzOpen2(valid_path.utf8().get_data(), &io); @@ -206,7 +208,7 @@ private: while (ret == UNZ_OK) { unz_file_info info; char fname[16384]; - ret = unzGetCurrentFileInfo(pkg, &info, fname, 16384, NULL, 0, NULL, 0); + ret = unzGetCurrentFileInfo(pkg, &info, fname, 16384, nullptr, 0, nullptr, 0); if (String(fname).ends_with("project.godot")) { break; @@ -377,19 +379,19 @@ private: if (mode == MODE_IMPORT) { - fdialog->set_mode(FileDialog::MODE_OPEN_FILE); + fdialog->set_file_mode(FileDialog::FILE_MODE_OPEN_FILE); fdialog->clear_filters(); fdialog->add_filter(vformat("project.godot ; %s %s", VERSION_NAME, TTR("Project"))); fdialog->add_filter("*.zip ; " + TTR("ZIP File")); } else { - fdialog->set_mode(FileDialog::MODE_OPEN_DIR); + fdialog->set_file_mode(FileDialog::FILE_MODE_OPEN_DIR); } fdialog->popup_centered_ratio(); } void _browse_install_path() { fdialog_install->set_current_dir(install_path->get_text()); - fdialog_install->set_mode(FileDialog::MODE_OPEN_DIR); + fdialog_install->set_file_mode(FileDialog::FILE_MODE_OPEN_DIR); fdialog_install->popup_centered_ratio(); } @@ -416,12 +418,12 @@ private: } else { dialog_error->set_text(TTR("Couldn't create folder.")); - dialog_error->popup_centered_minsize(); + dialog_error->popup_centered(); } } else { dialog_error->set_text(TTR("There is already a folder in this path with the specified name.")); - dialog_error->popup_centered_minsize(); + dialog_error->popup_centered(); } } @@ -498,14 +500,14 @@ private: if (ProjectSettings::get_singleton()->save_custom(dir.plus_file("project.godot"), initial_settings, Vector<String>(), false) != OK) { set_message(TTR("Couldn't create project.godot in project path."), MESSAGE_ERROR); } else { - ResourceSaver::save(dir.plus_file("icon.png"), get_icon("DefaultProjectIcon", "EditorIcons")); + ResourceSaver::save(dir.plus_file("icon.png"), msg->get_theme_icon("DefaultProjectIcon", "EditorIcons")); FileAccess *f = FileAccess::open(dir.plus_file("default_env.tres"), FileAccess::WRITE); if (!f) { set_message(TTR("Couldn't create project.godot in project path."), MESSAGE_ERROR); } else { f->store_line("[gd_resource type=\"Environment\" load_steps=2 format=2]"); - f->store_line("[sub_resource type=\"ProceduralSky\" id=1]"); + f->store_line("[sub_resource type=\"Sky\" id=1]"); f->store_line("[resource]"); f->store_line("background_mode = 2"); f->store_line("background_sky = SubResource( 1 )"); @@ -520,14 +522,14 @@ private: zip_path = project_path->get_text(); } - FileAccess *src_f = NULL; + FileAccess *src_f = nullptr; zlib_filefunc_def io = zipio_create_io_from_file(&src_f); unzFile pkg = unzOpen2(zip_path.utf8().get_data(), &io); if (!pkg) { dialog_error->set_text(TTR("Error opening package file, not in ZIP format.")); - dialog_error->popup_centered_minsize(); + dialog_error->popup_centered(); return; } @@ -541,7 +543,7 @@ private: //get filename unz_file_info info; char fname[16384]; - ret = unzGetCurrentFileInfo(pkg, &info, fname, 16384, NULL, 0, NULL, 0); + ret = unzGetCurrentFileInfo(pkg, &info, fname, 16384, nullptr, 0, nullptr, 0); String path = fname; @@ -605,11 +607,11 @@ private: } dialog_error->set_text(msg); - dialog_error->popup_centered_minsize(); + dialog_error->popup_centered(); } else if (!project_path->get_text().ends_with(".zip")) { dialog_error->set_text(TTR("Package installed successfully!")); - dialog_error->popup_centered_minsize(); + dialog_error->popup_centered(); } } } @@ -647,16 +649,16 @@ private: project_name->clear(); _text_changed(""); - if (status_rect->get_texture() == get_icon("StatusError", "EditorIcons")) + if (status_rect->get_texture() == msg->get_theme_icon("StatusError", "EditorIcons")) msg->show(); - if (install_status_rect->get_texture() == get_icon("StatusError", "EditorIcons")) + if (install_status_rect->get_texture() == msg->get_theme_icon("StatusError", "EditorIcons")) msg->show(); } void _notification(int p_what) { - if (p_what == MainLoop::NOTIFICATION_WM_QUIT_REQUEST) + if (p_what == NOTIFICATION_WM_CLOSE_REQUEST) _remove_created_folder(); } @@ -786,7 +788,7 @@ public: _test_path(); } - popup_centered_minsize(Size2(500, 0) * EDSCALE); + popup_centered(Size2i(500, 0) * EDSCALE); } ProjectDialog() { @@ -805,7 +807,7 @@ public: name_container->add_child(pnhb); project_name = memnew(LineEdit); - project_name->set_h_size_flags(SIZE_EXPAND_FILL); + project_name->set_h_size_flags(Control::SIZE_EXPAND_FILL); pnhb->add_child(project_name); create_dir = memnew(Button); @@ -824,7 +826,7 @@ public: path_container->add_child(pphb); project_path = memnew(LineEdit); - project_path->set_h_size_flags(SIZE_EXPAND_FILL); + project_path->set_h_size_flags(Control::SIZE_EXPAND_FILL); pphb->add_child(project_path); install_path_container = memnew(VBoxContainer); @@ -838,7 +840,7 @@ public: install_path_container->add_child(iphb); install_path = memnew(LineEdit); - install_path->set_h_size_flags(SIZE_EXPAND_FILL); + install_path->set_h_size_flags(Control::SIZE_EXPAND_FILL); iphb->add_child(install_path); // status icon @@ -876,7 +878,7 @@ public: rasterizer_button_group.instance(); Container *rvb = memnew(VBoxContainer); - rvb->set_h_size_flags(SIZE_EXPAND_FILL); + rvb->set_h_size_flags(Control::SIZE_EXPAND_FILL); rshb->add_child(rvb); Button *rs_button = memnew(CheckBox); rs_button->set_button_group(rasterizer_button_group); @@ -895,7 +897,7 @@ public: TTR("The GLES2 renderer is currently unavailable, as it needs to be reworked for Godot 4.0.\nUse Godot 3.2 if you need GLES2 support."); rvb = memnew(VBoxContainer); - rvb->set_h_size_flags(SIZE_EXPAND_FILL); + rvb->set_h_size_flags(Control::SIZE_EXPAND_FILL); rshb->add_child(rvb); rs_button = memnew(CheckBox); rs_button->set_button_group(rasterizer_button_group); @@ -910,7 +912,7 @@ public: // Also set the tooltip on the label so it appears when hovering either the checkbox or label. l->set_tooltip(gles2_unsupported_tooltip); // Required for the tooltip to show. - l->set_mouse_filter(MOUSE_FILTER_STOP); + l->set_mouse_filter(Control::MOUSE_FILTER_STOP); rvb->add_child(l); l = memnew(Label); @@ -953,8 +955,8 @@ public: bool hover; ProjectListItemControl() { - favorite_button = NULL; - icon = NULL; + favorite_button = nullptr; + icon = nullptr; icon_needs_reload = true; hover = false; } @@ -975,7 +977,7 @@ public: } break; case NOTIFICATION_DRAW: { if (hover) { - draw_style_box(get_stylebox("hover", "Tree"), Rect2(Point2(), get_size() - Size2(10, 0) * EDSCALE)); + draw_style_box(get_theme_stylebox("hover", "Tree"), Rect2(Point2(), get_size() - Size2(10, 0) * EDSCALE)); } } break; } @@ -1034,7 +1036,7 @@ public: grayed = p_grayed; missing = p_missing; version = p_version; - control = NULL; + control = nullptr; } _FORCE_INLINE_ bool operator==(const Item &l) const { @@ -1045,6 +1047,9 @@ public: ProjectList(); ~ProjectList(); + void _global_menu_new_window(const Variant &p_tag); + void _global_menu_open_project(const Variant &p_tag); + void update_dock_menu(); void load_projects(); void set_search_term(String p_search_term); @@ -1116,7 +1121,7 @@ ProjectList::ProjectList() { _order_option = ProjectListFilter::FILTER_EDIT_DATE; _scroll_children = memnew(VBoxContainer); - _scroll_children->set_h_size_flags(SIZE_EXPAND_FILL); + _scroll_children->set_h_size_flags(Control::SIZE_EXPAND_FILL); add_child(_scroll_children); _icon_load_index = 0; @@ -1150,7 +1155,7 @@ void ProjectList::_notification(int p_what) { void ProjectList::load_project_icon(int p_index) { Item &item = _projects.write[p_index]; - Ref<Texture2D> default_icon = get_icon("DefaultProjectIcon", "EditorIcons"); + Ref<Texture2D> default_icon = get_theme_icon("DefaultProjectIcon", "EditorIcons"); Ref<Texture2D> icon; if (item.icon != "") { Ref<Image> img; @@ -1231,7 +1236,7 @@ void ProjectList::load_projects() { // Clear whole list for (int i = 0; i < _projects.size(); ++i) { Item &project = _projects.write[i]; - CRASH_COND(project.control == NULL); + CRASH_COND(project.control == nullptr); memdelete(project.control); // Why not queue_free()? } _projects.clear(); @@ -1284,7 +1289,11 @@ void ProjectList::load_projects() { } void ProjectList::update_dock_menu() { - OS::get_singleton()->global_menu_clear("_dock"); + + if (!DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_GLOBAL_MENU)) { + return; + } + DisplayServer::get_singleton()->global_menu_clear("_dock"); int favs_added = 0; int total_added = 0; @@ -1294,18 +1303,41 @@ void ProjectList::update_dock_menu() { favs_added++; } else { if (favs_added != 0) { - OS::get_singleton()->global_menu_add_separator("_dock"); + DisplayServer::get_singleton()->global_menu_add_separator("_dock"); } favs_added = 0; } - OS::get_singleton()->global_menu_add_item("_dock", _projects[i].project_name + " ( " + _projects[i].path + " )", GLOBAL_OPEN_PROJECT, Variant(_projects[i].path.plus_file("project.godot"))); + DisplayServer::get_singleton()->global_menu_add_item("_dock", _projects[i].project_name + " ( " + _projects[i].path + " )", callable_mp(this, &ProjectList::_global_menu_open_project), i); total_added++; } } if (total_added != 0) { - OS::get_singleton()->global_menu_add_separator("_dock"); + DisplayServer::get_singleton()->global_menu_add_separator("_dock"); + } + DisplayServer::get_singleton()->global_menu_add_item("_dock", TTR("New Window"), callable_mp(this, &ProjectList::_global_menu_new_window)); +} + +void ProjectList::_global_menu_new_window(const Variant &p_tag) { + List<String> args; + args.push_back("-p"); + String exec = OS::get_singleton()->get_executable_path(); + + OS::ProcessID pid = 0; + OS::get_singleton()->execute(exec, args, false, &pid); +} + +void ProjectList::_global_menu_open_project(const Variant &p_tag) { + int idx = (int)p_tag; + + if (idx >= 0 && idx < _projects.size()) { + String conf = _projects[idx].path.plus_file("project.godot"); + List<String> args; + args.push_back(conf); + String exec = OS::get_singleton()->get_executable_path(); + + OS::ProcessID pid = 0; + OS::get_singleton()->execute(exec, args, false, &pid); } - OS::get_singleton()->global_menu_add_item("_dock", TTR("New Window"), GLOBAL_NEW_WINDOW, Variant()); } void ProjectList::create_project_item_control(int p_index) { @@ -1314,15 +1346,15 @@ void ProjectList::create_project_item_control(int p_index) { ERR_FAIL_COND(p_index != _scroll_children->get_child_count()); Item &item = _projects.write[p_index]; - ERR_FAIL_COND(item.control != NULL); // Already created + ERR_FAIL_COND(item.control != nullptr); // Already created - Ref<Texture2D> favorite_icon = get_icon("Favorites", "EditorIcons"); - Color font_color = get_color("font_color", "Tree"); + Ref<Texture2D> favorite_icon = get_theme_icon("Favorites", "EditorIcons"); + Color font_color = get_theme_color("font_color", "Tree"); ProjectListItemControl *hb = memnew(ProjectListItemControl); hb->connect("draw", callable_mp(this, &ProjectList::_panel_draw), varray(hb)); hb->connect("gui_input", callable_mp(this, &ProjectList::_panel_input), varray(hb)); - hb->add_constant_override("separation", 10 * EDSCALE); + hb->add_theme_constant_override("separation", 10 * EDSCALE); hb->set_tooltip(item.description); VBoxContainer *favorite_box = memnew(VBoxContainer); @@ -1342,7 +1374,7 @@ void ProjectList::create_project_item_control(int p_index) { TextureRect *tf = memnew(TextureRect); // The project icon may not be loaded by the time the control is displayed, // so use a loading placeholder. - tf->set_texture(get_icon("ProjectIconLoading", "EditorIcons")); + tf->set_texture(get_theme_icon("ProjectIconLoading", "EditorIcons")); tf->set_v_size_flags(SIZE_SHRINK_CENTER); if (item.missing) { tf->set_modulate(Color(1, 1, 1, 0.5)); @@ -1353,25 +1385,25 @@ void ProjectList::create_project_item_control(int p_index) { VBoxContainer *vb = memnew(VBoxContainer); if (item.grayed) vb->set_modulate(Color(1, 1, 1, 0.5)); - vb->set_h_size_flags(SIZE_EXPAND_FILL); + vb->set_h_size_flags(Control::SIZE_EXPAND_FILL); hb->add_child(vb); Control *ec = memnew(Control); ec->set_custom_minimum_size(Size2(0, 1)); ec->set_mouse_filter(MOUSE_FILTER_PASS); vb->add_child(ec); Label *title = memnew(Label(!item.missing ? item.project_name : TTR("Missing Project"))); - title->add_font_override("font", get_font("title", "EditorFonts")); - title->add_color_override("font_color", font_color); + title->add_theme_font_override("font", get_theme_font("title", "EditorFonts")); + title->add_theme_color_override("font_color", font_color); title->set_clip_text(true); vb->add_child(title); HBoxContainer *path_hb = memnew(HBoxContainer); - path_hb->set_h_size_flags(SIZE_EXPAND_FILL); + path_hb->set_h_size_flags(Control::SIZE_EXPAND_FILL); vb->add_child(path_hb); Button *show = memnew(Button); // Display a folder icon if the project directory can be opened, or a "broken file" icon if it can't - show->set_icon(get_icon(!item.missing ? "Load" : "FileBroken", "EditorIcons")); + show->set_icon(get_theme_icon(!item.missing ? "Load" : "FileBroken", "EditorIcons")); show->set_flat(true); if (!item.grayed) { // Don't make the icon less prominent if the parent is already grayed out @@ -1388,9 +1420,9 @@ void ProjectList::create_project_item_control(int p_index) { Label *fpath = memnew(Label(item.path)); path_hb->add_child(fpath); - fpath->set_h_size_flags(SIZE_EXPAND_FILL); + fpath->set_h_size_flags(Control::SIZE_EXPAND_FILL); fpath->set_modulate(Color(1, 1, 1, 0.5)); - fpath->add_color_override("font_color", font_color); + fpath->add_theme_color_override("font_color", font_color); fpath->set_clip_text(true); _scroll_children->add_child(hb); @@ -1722,12 +1754,12 @@ void ProjectList::erase_selected_projects() { void ProjectList::_panel_draw(Node *p_hb) { Control *hb = Object::cast_to<Control>(p_hb); - hb->draw_line(Point2(0, hb->get_size().y + 1), Point2(hb->get_size().x - 10, hb->get_size().y + 1), get_color("guide_color", "Tree")); + hb->draw_line(Point2(0, hb->get_size().y + 1), Point2(hb->get_size().x - 10, hb->get_size().y + 1), get_theme_color("guide_color", "Tree")); String key = _projects[p_hb->get_index()].project_key; if (_selected_project_keys.has(key)) { - hb->draw_style_box(get_stylebox("selected", "Tree"), Rect2(Point2(), hb->get_size() - Size2(10, 0) * EDSCALE)); + hb->draw_style_box(get_theme_stylebox("selected", "Tree"), Rect2(Point2(), hb->get_size() - Size2(10, 0) * EDSCALE)); } } @@ -1827,13 +1859,13 @@ void ProjectManager::_notification(int p_what) { case NOTIFICATION_RESIZED: { if (open_templates->is_visible()) { - open_templates->popup_centered_minsize(); + open_templates->popup_centered(); } } break; case NOTIFICATION_READY: { if (_project_list->get_project_count() == 0 && StreamPeerSSL::is_available()) - open_templates->popup_centered_minsize(); + open_templates->popup_centered(); if (_project_list->get_project_count() >= 1) { // Focus on the search box immediately to allow the user @@ -1845,7 +1877,7 @@ void ProjectManager::_notification(int p_what) { set_process_unhandled_input(is_visible_in_tree()); } break; - case NOTIFICATION_WM_QUIT_REQUEST: { + case NOTIFICATION_WM_CLOSE_REQUEST: { _dim_window(); } break; @@ -2018,30 +2050,6 @@ void ProjectManager::_confirm_update_settings() { _open_selected_projects(); } -void ProjectManager::_global_menu_action(const Variant &p_id, const Variant &p_meta) { - - int id = (int)p_id; - if (id == ProjectList::GLOBAL_NEW_WINDOW) { - List<String> args; - args.push_back("-p"); - String exec = OS::get_singleton()->get_executable_path(); - - OS::ProcessID pid = 0; - OS::get_singleton()->execute(exec, args, false, &pid); - } else if (id == ProjectList::GLOBAL_OPEN_PROJECT) { - String conf = (String)p_meta; - - if (conf != String()) { - List<String> args; - args.push_back(conf); - String exec = OS::get_singleton()->get_executable_path(); - - OS::ProcessID pid = 0; - OS::get_singleton()->execute(exec, args, false, &pid); - } - } -} - void ProjectManager::_open_selected_projects() { const Set<String> &selected_list = _project_list->get_selected_project_keys(); @@ -2053,7 +2061,7 @@ void ProjectManager::_open_selected_projects() { if (!FileAccess::exists(conf)) { dialog_error->set_text(vformat(TTR("Can't open project at '%s'."), path)); - dialog_error->popup_centered_minsize(); + dialog_error->popup_centered(); return; } @@ -2091,7 +2099,7 @@ void ProjectManager::_open_selected_projects_ask() { if (selected_list.size() > 1) { multi_open_ask->set_text(TTR("Are you sure to open more than one project?")); - multi_open_ask->popup_centered_minsize(); + multi_open_ask->popup_centered(); return; } @@ -2107,19 +2115,19 @@ void ProjectManager::_open_selected_projects_ask() { // Check if the config_version property was empty or 0 if (config_version == 0) { ask_update_settings->set_text(vformat(TTR("The following project settings file does not specify the version of Godot through which it was created.\n\n%s\n\nIf you proceed with opening it, it will be converted to Godot's current configuration file format.\nWarning: You won't be able to open the project with previous versions of the engine anymore."), conf)); - ask_update_settings->popup_centered_minsize(); + ask_update_settings->popup_centered(); return; } // Check if we need to convert project settings from an earlier engine version if (config_version < ProjectSettings::CONFIG_VERSION) { ask_update_settings->set_text(vformat(TTR("The following project settings file was generated by an older engine version, and needs to be converted for this version:\n\n%s\n\nDo you want to convert it?\nWarning: You won't be able to open the project with previous versions of the engine anymore."), conf)); - ask_update_settings->popup_centered_minsize(); + ask_update_settings->popup_centered(); return; } // Check if the file was generated by a newer, incompatible engine version if (config_version > ProjectSettings::CONFIG_VERSION) { dialog_error->set_text(vformat(TTR("Can't open project at '%s'.") + "\n" + TTR("The project settings were created by a newer engine version, whose settings are not compatible with this version."), project.path)); - dialog_error->popup_centered_minsize(); + dialog_error->popup_centered(); return; } @@ -2179,7 +2187,7 @@ void ProjectManager::_run_project() { if (selected_list.size() > 1) { multi_run_ask->set_text(vformat(TTR("Are you sure to run %d projects at once?"), selected_list.size())); - multi_run_ask->popup_centered_minsize(); + multi_run_ask->popup_centered(); } else { _run_project_confirm(); } @@ -2276,13 +2284,13 @@ void ProjectManager::_erase_project() { } erase_ask->set_text(confirm_message); - erase_ask->popup_centered_minsize(); + erase_ask->popup_centered(); } void ProjectManager::_erase_missing_projects() { erase_missing_ask->set_text(TTR("Remove all missing projects from the list?\nThe project folders' contents won't be modified.")); - erase_missing_ask->popup_centered_minsize(); + erase_missing_ask->popup_centered(); } void ProjectManager::_language_selected(int p_id) { @@ -2290,7 +2298,7 @@ void ProjectManager::_language_selected(int p_id) { String lang = language_btn->get_item_metadata(p_id); EditorSettings::get_singleton()->set("interface/editor/editor_language", lang); language_btn->set_text(lang); - language_btn->set_icon(get_icon("Environment", "EditorIcons")); + language_btn->set_icon(get_theme_icon("Environment", "EditorIcons")); language_restart_ask->set_text(TTR("Language changed.\nThe interface will update after restarting the editor or project manager.")); language_restart_ask->popup_centered(); @@ -2357,7 +2365,7 @@ void ProjectManager::_files_dropped(PackedStringArray p_files, int p_screen) { multi_scan_ask->get_ok()->connect("pressed", callable_mp(this, &ProjectManager::_scan_multiple_folders), varray(folders)); multi_scan_ask->set_text( vformat(TTR("Are you sure to scan %s folders for existing Godot projects?\nThis could take a while."), folders.size())); - multi_scan_ask->popup_centered_minsize(); + multi_scan_ask->popup_centered(); } else { _scan_multiple_folders(folders); } @@ -2413,8 +2421,12 @@ ProjectManager::ProjectManager() { switch (display_scale) { case 0: { // Try applying a suitable display scale automatically - const int screen = OS::get_singleton()->get_current_screen(); - editor_set_scale(OS::get_singleton()->get_screen_dpi(screen) >= 192 && OS::get_singleton()->get_screen_size(screen).x > 2000 ? 2.0 : 1.0); + const int screen = DisplayServer::get_singleton()->window_get_current_screen(); +#ifdef OSX_ENABLED + editor_set_scale(DisplayServer::get_singleton()->screen_get_scale(screen)); +#else + editor_set_scale(DisplayServer::get_singleton()->screen_get_dpi(screen) >= 192 && DisplayServer::get_singleton()->screen_get_size(screen).x > 2000 ? 2.0 : 1.0); +#endif } break; case 1: editor_set_scale(0.75); break; @@ -2430,12 +2442,12 @@ ProjectManager::ProjectManager() { } // Define a minimum window size to prevent UI elements from overlapping or being cut off - OS::get_singleton()->set_min_window_size(Size2(750, 420) * EDSCALE); + DisplayServer::get_singleton()->window_set_min_size(Size2(750, 420) * EDSCALE); #ifndef OSX_ENABLED // The macOS platform implementation uses its own hiDPI window resizing code // TODO: Resize windows on hiDPI displays on Windows and Linux and remove the line below - OS::get_singleton()->set_window_size(OS::get_singleton()->get_window_size() * MAX(1, EDSCALE)); + DisplayServer::get_singleton()->window_set_size(DisplayServer::get_singleton()->window_get_size() * MAX(1, EDSCALE)); #endif } @@ -2451,7 +2463,7 @@ ProjectManager::ProjectManager() { Panel *panel = memnew(Panel); gui_base->add_child(panel); panel->set_anchors_and_margins_preset(Control::PRESET_WIDE); - panel->add_style_override("panel", gui_base->get_stylebox("Background", "EditorStyles")); + panel->add_theme_style_override("panel", gui_base->get_theme_stylebox("Background", "EditorStyles")); VBoxContainer *vb = memnew(VBoxContainer); panel->add_child(vb); @@ -2459,10 +2471,10 @@ ProjectManager::ProjectManager() { String cp; cp += 0xA9; - OS::get_singleton()->set_window_title(VERSION_NAME + String(" - ") + TTR("Project Manager") + " - " + cp + " 2007-2020 Juan Linietsky, Ariel Manzur & Godot Contributors"); + DisplayServer::get_singleton()->window_set_title(VERSION_NAME + String(" - ") + TTR("Project Manager") + " - " + cp + " 2007-2020 Juan Linietsky, Ariel Manzur & Godot Contributors"); Control *center_box = memnew(Control); - center_box->set_v_size_flags(SIZE_EXPAND_FILL); + center_box->set_v_size_flags(Control::SIZE_EXPAND_FILL); vb->add_child(center_box); tabs = memnew(TabContainer); @@ -2479,7 +2491,7 @@ ProjectManager::ProjectManager() { VBoxContainer *search_tree_vb = memnew(VBoxContainer); tree_hb->add_child(search_tree_vb); - search_tree_vb->set_h_size_flags(SIZE_EXPAND_FILL); + search_tree_vb->set_h_size_flags(Control::SIZE_EXPAND_FILL); HBoxContainer *sort_filters = memnew(HBoxContainer); Label *sort_label = memnew(Label); @@ -2511,9 +2523,9 @@ ProjectManager::ProjectManager() { search_tree_vb->add_child(sort_filters); PanelContainer *pc = memnew(PanelContainer); - pc->add_style_override("panel", gui_base->get_stylebox("bg", "Tree")); + pc->add_theme_style_override("panel", gui_base->get_theme_stylebox("bg", "Tree")); search_tree_vb->add_child(pc); - pc->set_v_size_flags(SIZE_EXPAND_FILL); + pc->set_v_size_flags(Control::SIZE_EXPAND_FILL); _project_list = memnew(ProjectList); _project_list->connect(ProjectList::SIGNAL_SELECTION_CHANGED, callable_mp(this, &ProjectManager::_update_project_buttons)); @@ -2547,7 +2559,7 @@ ProjectManager::ProjectManager() { scan_dir = memnew(FileDialog); scan_dir->set_access(FileDialog::ACCESS_FILESYSTEM); - scan_dir->set_mode(FileDialog::MODE_OPEN_DIR); + scan_dir->set_file_mode(FileDialog::FILE_MODE_OPEN_DIR); scan_dir->set_title(TTR("Select a Folder to Scan")); // must be after mode or it's overridden scan_dir->set_current_dir(EditorSettings::get_singleton()->get("filesystem/directories/default_project_path")); gui_base->add_child(scan_dir); @@ -2631,7 +2643,7 @@ ProjectManager::ProjectManager() { language_btn->set_text(lang); } } - language_btn->set_icon(get_icon("Environment", "EditorIcons")); + language_btn->set_icon(get_theme_icon("Environment", "EditorIcons")); settings_hb->add_child(language_btn); language_btn->connect("item_selected", callable_mp(this, &ProjectManager::_language_selected)); @@ -2689,8 +2701,7 @@ ProjectManager::ProjectManager() { _scan_begin(EditorSettings::get_singleton()->get("filesystem/directories/autoscan_project_path")); } - SceneTree::get_singleton()->connect("files_dropped", callable_mp(this, &ProjectManager::_files_dropped)); - SceneTree::get_singleton()->connect("global_menu_action", callable_mp(this, &ProjectManager::_global_menu_action)); + SceneTree::get_singleton()->get_root()->connect("files_dropped", callable_mp(this, &ProjectManager::_files_dropped)); run_error_diag = memnew(AcceptDialog); gui_base->add_child(run_error_diag); @@ -2748,7 +2759,7 @@ void ProjectListFilter::_filter_option_selected(int p_idx) { void ProjectListFilter::_notification(int p_what) { if (p_what == NOTIFICATION_ENTER_TREE && has_search_box) { - search_box->set_right_icon(get_icon("Search", "EditorIcons")); + search_box->set_right_icon(get_theme_icon("Search", "EditorIcons")); search_box->set_clear_button_enabled(true); } } @@ -2769,7 +2780,7 @@ void ProjectListFilter::add_search_box() { search_box = memnew(LineEdit); search_box->set_placeholder(TTR("Search")); search_box->connect("text_changed", callable_mp(this, &ProjectListFilter::_search_text_changed)); - search_box->set_h_size_flags(SIZE_EXPAND_FILL); + search_box->set_h_size_flags(Control::SIZE_EXPAND_FILL); add_child(search_box); has_search_box = true; diff --git a/editor/project_manager.h b/editor/project_manager.h index 8b9c769c59..6385000821 100644 --- a/editor/project_manager.h +++ b/editor/project_manager.h @@ -97,7 +97,6 @@ class ProjectManager : public Control { void _restart_confirm(); void _exit_dialog(); void _scan_begin(const String &p_base); - void _global_menu_action(const Variant &p_id, const Variant &p_meta); void _confirm_update_settings(); diff --git a/editor/project_settings_editor.cpp b/editor/project_settings_editor.cpp index 4fb61929a3..49c02dc895 100644 --- a/editor/project_settings_editor.cpp +++ b/editor/project_settings_editor.cpp @@ -31,7 +31,7 @@ #include "project_settings_editor.h" #include "core/global_constants.h" -#include "core/input_map.h" +#include "core/input/input_map.h" #include "core/os/keyboard.h" #include "core/project_settings.h" #include "core/translation.h" @@ -41,7 +41,7 @@ #include "scene/gui/margin_container.h" #include "scene/gui/tab_container.h" -ProjectSettingsEditor *ProjectSettingsEditor::singleton = NULL; +ProjectSettingsEditor *ProjectSettingsEditor::singleton = nullptr; static const char *_button_names[JOY_BUTTON_MAX] = { "DualShock Cross, Xbox A, Nintendo B", @@ -80,7 +80,7 @@ void ProjectSettingsEditor::_unhandled_input(const Ref<InputEvent> &p_event) { const Ref<InputEventKey> k = p_event; - if (k.is_valid() && is_window_modal_on_top() && k->is_pressed()) { + if (k.is_valid() && k->is_pressed()) { if (k->get_keycode_with_modifiers() == (KEY_MASK_CMD | KEY_F)) { if (search_button->is_pressed()) { @@ -91,7 +91,7 @@ void ProjectSettingsEditor::_unhandled_input(const Ref<InputEvent> &p_event) { search_button->set_pressed(true); } - accept_event(); + set_input_as_handled(); } } } @@ -99,22 +99,28 @@ void ProjectSettingsEditor::_unhandled_input(const Ref<InputEvent> &p_event) { void ProjectSettingsEditor::_notification(int p_what) { switch (p_what) { + case NOTIFICATION_VISIBILITY_CHANGED: { + if (!is_visible()) { + EditorSettings::get_singleton()->set_project_metadata("dialog_bounds", "project_settings", Rect2(get_position(), get_size())); + set_process_unhandled_input(false); + } + } break; case NOTIFICATION_ENTER_TREE: { globals_editor->edit(ProjectSettings::get_singleton()); - search_button->set_icon(get_icon("Search", "EditorIcons")); - search_box->set_right_icon(get_icon("Search", "EditorIcons")); + search_button->set_icon(input_editor->get_theme_icon("Search", "EditorIcons")); + search_box->set_right_icon(input_editor->get_theme_icon("Search", "EditorIcons")); search_box->set_clear_button_enabled(true); - action_add_error->add_color_override("font_color", get_color("error_color", "Editor")); + action_add_error->add_theme_color_override("font_color", input_editor->get_theme_color("error_color", "Editor")); translation_list->connect("button_pressed", callable_mp(this, &ProjectSettingsEditor::_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 - popup_add->add_icon_item(get_icon("KeyboardPhysical", "EditorIcons"), TTR("Physical Key"), INPUT_KEY_PHYSICAL); - popup_add->add_icon_item(get_icon("JoyButton", "EditorIcons"), TTR("Joy Button"), INPUT_JOY_BUTTON); - popup_add->add_icon_item(get_icon("JoyAxis", "EditorIcons"), TTR("Joy Axis"), INPUT_JOY_MOTION); - popup_add->add_icon_item(get_icon("Mouse", "EditorIcons"), TTR("Mouse Button"), INPUT_MOUSE_BUTTON); + popup_add->add_icon_item(input_editor->get_theme_icon("Keyboard", "EditorIcons"), TTR("Key"), INPUT_KEY); + popup_add->add_icon_item(input_editor->get_theme_icon("KeyboardPhysical", "EditorIcons"), TTR("Physical Key"), INPUT_KEY_PHYSICAL); + popup_add->add_icon_item(input_editor->get_theme_icon("JoyButton", "EditorIcons"), TTR("Joy Button"), INPUT_JOY_BUTTON); + popup_add->add_icon_item(input_editor->get_theme_icon("JoyAxis", "EditorIcons"), TTR("Joy Axis"), INPUT_JOY_MOTION); + popup_add->add_icon_item(input_editor->get_theme_icon("Mouse", "EditorIcons"), TTR("Mouse Button"), INPUT_MOUSE_BUTTON); List<String> tfn; ResourceLoader::get_recognized_extensions_for_type("Translation", &tfn); @@ -131,26 +137,22 @@ void ProjectSettingsEditor::_notification(int p_what) { translation_res_option_file_open->add_filter("*." + E->get()); } - restart_close_button->set_icon(get_icon("Close", "EditorIcons")); - restart_container->add_style_override("panel", get_stylebox("bg", "Tree")); - restart_icon->set_texture(get_icon("StatusWarning", "EditorIcons")); - restart_label->add_color_override("font_color", get_color("warning_color", "Editor")); + restart_close_button->set_icon(input_editor->get_theme_icon("Close", "EditorIcons")); + restart_container->add_theme_style_override("panel", input_editor->get_theme_stylebox("bg", "Tree")); + restart_icon->set_texture(input_editor->get_theme_icon("StatusWarning", "EditorIcons")); + restart_label->add_theme_color_override("font_color", input_editor->get_theme_color("warning_color", "Editor")); } break; - case NOTIFICATION_POPUP_HIDE: { - EditorSettings::get_singleton()->set_project_metadata("dialog_bounds", "project_settings", get_rect()); - set_process_unhandled_input(false); - } break; case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: { - search_button->set_icon(get_icon("Search", "EditorIcons")); - search_box->set_right_icon(get_icon("Search", "EditorIcons")); + search_button->set_icon(input_editor->get_theme_icon("Search", "EditorIcons")); + search_box->set_right_icon(input_editor->get_theme_icon("Search", "EditorIcons")); search_box->set_clear_button_enabled(true); - action_add_error->add_color_override("font_color", get_color("error_color", "Editor")); - popup_add->set_item_icon(popup_add->get_item_index(INPUT_KEY), get_icon("Keyboard", "EditorIcons")); - popup_add->set_item_icon(popup_add->get_item_index(INPUT_KEY_PHYSICAL), get_icon("KeyboardPhysical", "EditorIcons")); - popup_add->set_item_icon(popup_add->get_item_index(INPUT_JOY_BUTTON), get_icon("JoyButton", "EditorIcons")); - popup_add->set_item_icon(popup_add->get_item_index(INPUT_JOY_MOTION), get_icon("JoyAxis", "EditorIcons")); - popup_add->set_item_icon(popup_add->get_item_index(INPUT_MOUSE_BUTTON), get_icon("Mouse", "EditorIcons")); + action_add_error->add_theme_color_override("font_color", input_editor->get_theme_color("error_color", "Editor")); + popup_add->set_item_icon(popup_add->get_item_index(INPUT_KEY), input_editor->get_theme_icon("Keyboard", "EditorIcons")); + popup_add->set_item_icon(popup_add->get_item_index(INPUT_KEY_PHYSICAL), input_editor->get_theme_icon("KeyboardPhysical", "EditorIcons")); + popup_add->set_item_icon(popup_add->get_item_index(INPUT_JOY_BUTTON), input_editor->get_theme_icon("JoyButton", "EditorIcons")); + popup_add->set_item_icon(popup_add->get_item_index(INPUT_JOY_MOTION), input_editor->get_theme_icon("JoyAxis", "EditorIcons")); + popup_add->set_item_icon(popup_add->get_item_index(INPUT_MOUSE_BUTTON), input_editor->get_theme_icon("Mouse", "EditorIcons")); _update_actions(); } break; } @@ -462,7 +464,7 @@ void ProjectSettingsEditor::_wait_for_key(const Ref<InputEvent> &p_event) { press_a_key_label->set_text(str); press_a_key->get_ok()->set_disabled(false); - press_a_key->accept_event(); + press_a_key->set_input_as_handled(); } } @@ -479,7 +481,7 @@ void ProjectSettingsEditor::_add_item(int p_item, Ref<InputEvent> p_exiting_even press_a_key->get_ok()->set_disabled(true); last_wait_for_key = Ref<InputEvent>(); press_a_key->popup_centered(Size2(250, 80) * EDSCALE); - press_a_key->grab_focus(); + //press_a_key->grab_focus(); } break; case INPUT_KEY_PHYSICAL: { @@ -505,7 +507,7 @@ void ProjectSettingsEditor::_add_item(int p_item, Ref<InputEvent> p_exiting_even device_index->add_item(TTR("Wheel Right Button")); device_index->add_item(TTR("X Button 1")); device_index->add_item(TTR("X Button 2")); - device_input->popup_centered_minsize(Size2(350, 95) * EDSCALE); + device_input->popup_centered(Size2(350, 95) * EDSCALE); Ref<InputEventMouseButton> mb = p_exiting_event; if (mb.is_valid()) { @@ -527,7 +529,7 @@ void ProjectSettingsEditor::_add_item(int p_item, Ref<InputEvent> p_exiting_even String desc = _axis_names[i]; device_index->add_item(TTR("Axis") + " " + itos(i / 2) + " " + ((i & 1) ? "+" : "-") + desc); } - device_input->popup_centered_minsize(Size2(350, 95) * EDSCALE); + device_input->popup_centered(Size2(350, 95) * EDSCALE); Ref<InputEventJoypadMotion> jm = p_exiting_event; if (jm.is_valid()) { @@ -549,7 +551,7 @@ void ProjectSettingsEditor::_add_item(int p_item, Ref<InputEvent> p_exiting_even device_index->add_item(itos(i) + ": " + String(_button_names[i])); } - device_input->popup_centered_minsize(Size2(350, 95) * EDSCALE); + device_input->popup_centered(Size2(350, 95) * EDSCALE); Ref<InputEventJoypadButton> jb = p_exiting_event; if (jb.is_valid()) { @@ -738,7 +740,7 @@ void ProjectSettingsEditor::_update_actions() { TreeItem *item = input_editor->create_item(root); item->set_text(0, name); - item->set_custom_bg_color(0, get_color("prop_subsection", "Editor")); + item->set_custom_bg_color(0, input_editor->get_theme_color("prop_subsection", "Editor")); if (collapsed.has(name)) item->set_collapsed(collapsed[name]); @@ -746,12 +748,12 @@ void ProjectSettingsEditor::_update_actions() { item->set_cell_mode(1, TreeItem::CELL_MODE_RANGE); item->set_range_config(1, 0.0, 1.0, 0.01); item->set_range(1, action["deadzone"]); - item->set_custom_bg_color(1, get_color("prop_subsection", "Editor")); + item->set_custom_bg_color(1, input_editor->get_theme_color("prop_subsection", "Editor")); - const bool is_builtin_input = ProjectSettings::get_singleton()->get_input_presets().find(pi.name) != NULL; + const bool is_builtin_input = ProjectSettings::get_singleton()->get_input_presets().find(pi.name) != nullptr; const String tooltip = is_builtin_input ? TTR("Built-in actions can't be removed as they're used for UI navigation.") : TTR("Remove"); - item->add_button(2, get_icon("Add", "EditorIcons"), 1, false, TTR("Add Event")); - item->add_button(2, get_icon("Remove", "EditorIcons"), 2, false, tooltip); + item->add_button(2, input_editor->get_theme_icon("Add", "EditorIcons"), 1, false, TTR("Add Event")); + item->add_button(2, input_editor->get_theme_icon("Remove", "EditorIcons"), 2, false, tooltip); if (is_builtin_input) { // Built-in action (like `ui_up`). Make the action not removable, @@ -778,9 +780,9 @@ void ProjectSettingsEditor::_update_actions() { action2->set_text(0, str); if ((k->get_keycode() != 0)) { - action2->set_icon(0, get_icon("Keyboard", "EditorIcons")); + action2->set_icon(0, input_editor->get_theme_icon("Keyboard", "EditorIcons")); } else { - action2->set_icon(0, get_icon("KeyboardPhysical", "EditorIcons")); + action2->set_icon(0, input_editor->get_theme_icon("KeyboardPhysical", "EditorIcons")); } } @@ -794,7 +796,7 @@ void ProjectSettingsEditor::_update_actions() { } action2->set_text(0, str); - action2->set_icon(0, get_icon("JoyButton", "EditorIcons")); + action2->set_icon(0, input_editor->get_theme_icon("JoyButton", "EditorIcons")); } Ref<InputEventMouseButton> mb = event; @@ -811,7 +813,7 @@ void ProjectSettingsEditor::_update_actions() { } action2->set_text(0, str); - action2->set_icon(0, get_icon("Mouse", "EditorIcons")); + action2->set_icon(0, input_editor->get_theme_icon("Mouse", "EditorIcons")); } Ref<InputEventJoypadMotion> jm = event; @@ -823,13 +825,13 @@ void ProjectSettingsEditor::_update_actions() { String desc = _axis_names[n]; String str = _get_device_string(jm->get_device()) + ", " + TTR("Axis") + " " + itos(ax) + " " + (jm->get_axis_value() < 0 ? "-" : "+") + desc; action2->set_text(0, str); - action2->set_icon(0, get_icon("JoyAxis", "EditorIcons")); + action2->set_icon(0, input_editor->get_theme_icon("JoyAxis", "EditorIcons")); } action2->set_metadata(0, i); action2->set_meta("__input", event); - action2->add_button(2, get_icon("Edit", "EditorIcons"), 3, false, TTR("Edit")); - action2->add_button(2, get_icon("Remove", "EditorIcons"), 2, false, TTR("Remove")); + action2->add_button(2, input_editor->get_theme_icon("Edit", "EditorIcons"), 3, false, TTR("Edit")); + action2->add_button(2, input_editor->get_theme_icon("Remove", "EditorIcons"), 2, false, TTR("Remove")); // Fade out the individual event buttons slightly to make the // Add/Remove buttons stand out more. action2->set_button_color(2, 0, Color(1, 1, 1, 0.75)); @@ -881,7 +883,7 @@ void ProjectSettingsEditor::_item_add() { // Initialize the property with the default value for the given type. // The type list starts at 1 (as we exclude Nil), so add 1 to the selected value. Callable::CallError ce; - const Variant value = Variant::construct(Variant::Type(type->get_selected() + 1), NULL, 0, ce); + const Variant value = Variant::construct(Variant::Type(type->get_selected() + 1), nullptr, 0, ce); String catname = category->get_text().strip_edges(); String propname = property->get_text().strip_edges(); @@ -1112,7 +1114,7 @@ Variant ProjectSettingsEditor::get_drag_data_fw(const Point2 &p_point, Control * hb->set_modulate(Color(1, 1, 1, 1.0f)); hb->add_child(label); vb->add_child(hb); - set_drag_preview(vb); + input_editor->set_drag_preview(vb); Dictionary drag_data; drag_data["type"] = "nodes"; @@ -1535,7 +1537,7 @@ void ProjectSettingsEditor::_update_translations() { updating_translations = true; translation_list->clear(); - TreeItem *root = translation_list->create_item(NULL); + TreeItem *root = translation_list->create_item(nullptr); translation_list->set_hide_root(true); if (ProjectSettings::get_singleton()->has_setting("locale/translations")) { @@ -1547,7 +1549,7 @@ void ProjectSettingsEditor::_update_translations() { t->set_text(0, translations[i].replace_first("res://", "")); t->set_tooltip(0, translations[i]); t->set_metadata(0, i); - t->add_button(0, get_icon("Remove", "EditorIcons"), 0, false, TTR("Remove")); + t->add_button(0, input_editor->get_theme_icon("Remove", "EditorIcons"), 0, false, TTR("Remove")); } } @@ -1587,7 +1589,7 @@ void ProjectSettingsEditor::_update_translations() { translation_locales_list_created = true; translation_filter->clear(); - root = translation_filter->create_item(NULL); + root = translation_filter->create_item(nullptr); translation_filter->set_hide_root(true); translation_filter_treeitems.clear(); for (int i = 0; i < s; i++) { @@ -1620,8 +1622,8 @@ void ProjectSettingsEditor::_update_translations() { translation_remap->clear(); translation_remap_options->clear(); - root = translation_remap->create_item(NULL); - TreeItem *root2 = translation_remap_options->create_item(NULL); + root = translation_remap->create_item(nullptr); + TreeItem *root2 = translation_remap_options->create_item(nullptr); translation_remap->set_hide_root(true); translation_remap_options->set_hide_root(true); translation_res_option_add_button->set_disabled(true); @@ -1670,7 +1672,7 @@ void ProjectSettingsEditor::_update_translations() { t->set_text(0, keys[i].replace_first("res://", "")); t->set_tooltip(0, keys[i]); t->set_metadata(0, keys[i]); - t->add_button(0, get_icon("Remove", "EditorIcons"), 0, false, TTR("Remove")); + t->add_button(0, input_editor->get_theme_icon("Remove", "EditorIcons"), 0, false, TTR("Remove")); if (keys[i] == remap_selected) { t->select(0); translation_res_option_add_button->set_disabled(false); @@ -1688,7 +1690,7 @@ void ProjectSettingsEditor::_update_translations() { t2->set_text(0, path.replace_first("res://", "")); t2->set_tooltip(0, path); t2->set_metadata(0, j); - t2->add_button(0, get_icon("Remove", "EditorIcons"), 0, false, TTR("Remove")); + t2->add_button(0, input_editor->get_theme_icon("Remove", "EditorIcons"), 0, false, TTR("Remove")); t2->set_cell_mode(1, TreeItem::CELL_MODE_RANGE); t2->set_text(1, langnames); t2->set_editable(1, true); @@ -1774,7 +1776,7 @@ ProjectSettingsEditor::ProjectSettingsEditor(EditorData *p_data) { singleton = this; set_title(TTR("Project Settings (project.godot)")); - set_resizable(true); + undo_redo = &p_data->get_undo_redo(); data = p_data; @@ -1873,7 +1875,7 @@ ProjectSettingsEditor::ProjectSettingsEditor(EditorData *p_data) { add_prop_bar->add_child(popup_copy_to_feature); popup_copy_to_feature->get_popup()->connect("id_pressed", callable_mp(this, &ProjectSettingsEditor::_copy_to_platform)); - popup_copy_to_feature->get_popup()->connect("about_to_show", callable_mp(this, &ProjectSettingsEditor::_copy_to_platform_about_to_show)); + popup_copy_to_feature->get_popup()->connect("about_to_popup", callable_mp(this, &ProjectSettingsEditor::_copy_to_platform_about_to_show)); get_ok()->set_text(TTR("Close")); set_hide_on_ok(true); @@ -1883,7 +1885,7 @@ ProjectSettingsEditor::ProjectSettingsEditor(EditorData *p_data) { HBoxContainer *restart_hb = memnew(HBoxContainer); restart_container->add_child(restart_hb); restart_icon = memnew(TextureRect); - restart_icon->set_v_size_flags(SIZE_SHRINK_CENTER); + restart_icon->set_v_size_flags(Control::SIZE_SHRINK_CENTER); restart_hb->add_child(restart_icon); restart_label = memnew(Label); restart_label->set_text(TTR("The editor must be restarted for changes to take effect.")); @@ -1907,10 +1909,10 @@ ProjectSettingsEditor::ProjectSettingsEditor(EditorData *p_data) { VBoxContainer *vbc = memnew(VBoxContainer); input_base->add_child(vbc); - vbc->set_anchor_and_margin(MARGIN_TOP, ANCHOR_BEGIN, 0); - vbc->set_anchor_and_margin(MARGIN_BOTTOM, ANCHOR_END, 0); - vbc->set_anchor_and_margin(MARGIN_LEFT, ANCHOR_BEGIN, 0); - vbc->set_anchor_and_margin(MARGIN_RIGHT, ANCHOR_END, 0); + vbc->set_anchor_and_margin(MARGIN_TOP, Control::ANCHOR_BEGIN, 0); + vbc->set_anchor_and_margin(MARGIN_BOTTOM, Control::ANCHOR_END, 0); + vbc->set_anchor_and_margin(MARGIN_LEFT, Control::ANCHOR_BEGIN, 0); + vbc->set_anchor_and_margin(MARGIN_RIGHT, Control::ANCHOR_END, 0); hbc = memnew(HBoxContainer); vbc->add_child(hbc); @@ -1920,7 +1922,7 @@ ProjectSettingsEditor::ProjectSettingsEditor(EditorData *p_data) { l->set_text(TTR("Action:")); action_name = memnew(LineEdit); - action_name->set_h_size_flags(SIZE_EXPAND_FILL); + action_name->set_h_size_flags(Control::SIZE_EXPAND_FILL); hbc->add_child(action_name); action_name->connect("text_entered", callable_mp(this, &ProjectSettingsEditor::_action_adds)); action_name->connect("text_changed", callable_mp(this, &ProjectSettingsEditor::_action_check)); @@ -1938,7 +1940,7 @@ ProjectSettingsEditor::ProjectSettingsEditor(EditorData *p_data) { input_editor = memnew(Tree); vbc->add_child(input_editor); - input_editor->set_v_size_flags(SIZE_EXPAND_FILL); + input_editor->set_v_size_flags(Control::SIZE_EXPAND_FILL); input_editor->set_columns(3); input_editor->set_column_titles_visible(true); input_editor->set_column_title(0, TTR("Action")); @@ -1951,7 +1953,10 @@ ProjectSettingsEditor::ProjectSettingsEditor(EditorData *p_data) { input_editor->connect("item_activated", callable_mp(this, &ProjectSettingsEditor::_action_activated)); input_editor->connect("cell_selected", callable_mp(this, &ProjectSettingsEditor::_action_selected)); input_editor->connect("button_pressed", callable_mp(this, &ProjectSettingsEditor::_action_button_pressed)); - input_editor->set_drag_forwarding(this); +#ifndef _MSC_VER +#warning need to make drag data forwarding to non controls happen +#endif + //input_editor->set_drag_forwarding(this); popup_add = memnew(PopupMenu); add_child(popup_add); @@ -1960,7 +1965,7 @@ ProjectSettingsEditor::ProjectSettingsEditor(EditorData *p_data) { press_a_key_physical = false; press_a_key = memnew(ConfirmationDialog); - press_a_key->set_focus_mode(FOCUS_ALL); + //press_a_key->set_focus_mode(Control::FOCUS_ALL); add_child(press_a_key); l = memnew(Label); @@ -1968,11 +1973,11 @@ ProjectSettingsEditor::ProjectSettingsEditor(EditorData *p_data) { l->set_anchors_and_margins_preset(Control::PRESET_WIDE); l->set_align(Label::ALIGN_CENTER); l->set_margin(MARGIN_TOP, 20); - l->set_anchor_and_margin(MARGIN_BOTTOM, ANCHOR_BEGIN, 30); + l->set_anchor_and_margin(MARGIN_BOTTOM, Control::ANCHOR_BEGIN, 30); press_a_key->get_ok()->set_disabled(true); press_a_key_label = l; press_a_key->add_child(l); - press_a_key->connect("gui_input", callable_mp(this, &ProjectSettingsEditor::_wait_for_key)); + press_a_key->connect("window_input", callable_mp(this, &ProjectSettingsEditor::_wait_for_key)); press_a_key->connect("confirmed", callable_mp(this, &ProjectSettingsEditor::_press_a_key_confirm)); device_input = memnew(ConfirmationDialog); @@ -1998,7 +2003,7 @@ ProjectSettingsEditor::ProjectSettingsEditor(EditorData *p_data) { VBoxContainer *vbc_right = memnew(VBoxContainer); hbc->add_child(vbc_right); - vbc_right->set_h_size_flags(SIZE_EXPAND_FILL); + vbc_right->set_h_size_flags(Control::SIZE_EXPAND_FILL); l = memnew(Label); l->set_text(TTR("Index:")); @@ -2035,14 +2040,14 @@ ProjectSettingsEditor::ProjectSettingsEditor(EditorData *p_data) { thb->add_child(addtr); VBoxContainer *tmc = memnew(VBoxContainer); tvb->add_child(tmc); - tmc->set_v_size_flags(SIZE_EXPAND_FILL); + tmc->set_v_size_flags(Control::SIZE_EXPAND_FILL); translation_list = memnew(Tree); - translation_list->set_v_size_flags(SIZE_EXPAND_FILL); + translation_list->set_v_size_flags(Control::SIZE_EXPAND_FILL); tmc->add_child(translation_list); translation_file_open = memnew(EditorFileDialog); add_child(translation_file_open); - translation_file_open->set_mode(EditorFileDialog::MODE_OPEN_FILE); + translation_file_open->set_file_mode(EditorFileDialog::FILE_MODE_OPEN_FILE); translation_file_open->connect("file_selected", callable_mp(this, &ProjectSettingsEditor::_translation_add)); } @@ -2059,16 +2064,16 @@ ProjectSettingsEditor::ProjectSettingsEditor(EditorData *p_data) { thb->add_child(addtr); VBoxContainer *tmc = memnew(VBoxContainer); tvb->add_child(tmc); - tmc->set_v_size_flags(SIZE_EXPAND_FILL); + tmc->set_v_size_flags(Control::SIZE_EXPAND_FILL); translation_remap = memnew(Tree); - translation_remap->set_v_size_flags(SIZE_EXPAND_FILL); + translation_remap->set_v_size_flags(Control::SIZE_EXPAND_FILL); translation_remap->connect("cell_selected", callable_mp(this, &ProjectSettingsEditor::_translation_res_select)); tmc->add_child(translation_remap); translation_remap->connect("button_pressed", callable_mp(this, &ProjectSettingsEditor::_translation_res_delete)); translation_res_file_open = memnew(EditorFileDialog); add_child(translation_res_file_open); - translation_res_file_open->set_mode(EditorFileDialog::MODE_OPEN_FILE); + translation_res_file_open->set_file_mode(EditorFileDialog::FILE_MODE_OPEN_FILE); translation_res_file_open->connect("file_selected", callable_mp(this, &ProjectSettingsEditor::_translation_res_add)); thb = memnew(HBoxContainer); @@ -2081,9 +2086,9 @@ ProjectSettingsEditor::ProjectSettingsEditor(EditorData *p_data) { thb->add_child(addtr); tmc = memnew(VBoxContainer); tvb->add_child(tmc); - tmc->set_v_size_flags(SIZE_EXPAND_FILL); + tmc->set_v_size_flags(Control::SIZE_EXPAND_FILL); translation_remap_options = memnew(Tree); - translation_remap_options->set_v_size_flags(SIZE_EXPAND_FILL); + translation_remap_options->set_v_size_flags(Control::SIZE_EXPAND_FILL); tmc->add_child(translation_remap_options); translation_remap_options->set_columns(2); @@ -2098,7 +2103,7 @@ ProjectSettingsEditor::ProjectSettingsEditor(EditorData *p_data) { translation_res_option_file_open = memnew(EditorFileDialog); add_child(translation_res_option_file_open); - translation_res_option_file_open->set_mode(EditorFileDialog::MODE_OPEN_FILE); + translation_res_option_file_open->set_file_mode(EditorFileDialog::FILE_MODE_OPEN_FILE); translation_res_option_file_open->connect("file_selected", callable_mp(this, &ProjectSettingsEditor::_translation_res_option_add)); } @@ -2107,7 +2112,7 @@ ProjectSettingsEditor::ProjectSettingsEditor(EditorData *p_data) { translations->add_child(tvb); tvb->set_name(TTR("Locales Filter")); VBoxContainer *tmc = memnew(VBoxContainer); - tmc->set_v_size_flags(SIZE_EXPAND_FILL); + tmc->set_v_size_flags(Control::SIZE_EXPAND_FILL); tvb->add_child(tmc); translation_locale_filter_mode = memnew(OptionButton); @@ -2118,7 +2123,7 @@ ProjectSettingsEditor::ProjectSettingsEditor(EditorData *p_data) { translation_locale_filter_mode->connect("item_selected", callable_mp(this, &ProjectSettingsEditor::_translation_filter_mode_changed)); translation_filter = memnew(Tree); - translation_filter->set_v_size_flags(SIZE_EXPAND_FILL); + translation_filter->set_v_size_flags(Control::SIZE_EXPAND_FILL); translation_filter->set_columns(1); tmc->add_child(memnew(Label(TTR("Locales:")))); tmc->add_child(translation_filter); @@ -2130,6 +2135,11 @@ ProjectSettingsEditor::ProjectSettingsEditor(EditorData *p_data) { tab_container->add_child(autoload_settings); autoload_settings->connect("autoload_changed", callable_mp(this, &ProjectSettingsEditor::_settings_changed)); + shaders_global_variables_editor = memnew(ShaderGlobalsEditor); + shaders_global_variables_editor->set_name(TTR("Shader Globals")); + tab_container->add_child(shaders_global_variables_editor); + shaders_global_variables_editor->connect("globals_changed", callable_mp(this, &ProjectSettingsEditor::_settings_changed)); + plugin_settings = memnew(EditorPluginSettings); plugin_settings->set_name(TTR("Plugins")); tab_container->add_child(plugin_settings); diff --git a/editor/project_settings_editor.h b/editor/project_settings_editor.h index 52e7612acd..5475bb5508 100644 --- a/editor/project_settings_editor.h +++ b/editor/project_settings_editor.h @@ -28,14 +28,15 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#ifndef PROJECT_SETTINGS_H -#define PROJECT_SETTINGS_H +#ifndef PROJECT_SETTINGS_EDITOR_H +#define PROJECT_SETTINGS_EDITOR_H #include "core/undo_redo.h" #include "editor/editor_autoload_settings.h" #include "editor/editor_data.h" #include "editor/editor_plugin_settings.h" #include "editor/editor_sectioned_inspector.h" +#include "editor/shader_globals_editor.h" #include "scene/gui/dialogs.h" #include "scene/gui/tab_container.h" @@ -85,6 +86,7 @@ class ProjectSettingsEditor : public AcceptDialog { OptionButton *device_index; Label *device_index_label; MenuButton *popup_copy_to_feature; + ShaderGlobalsEditor *shaders_global_variables_editor; LineEdit *action_name; Button *action_add; @@ -204,4 +206,4 @@ public: ProjectSettingsEditor(EditorData *p_data); }; -#endif // PROJECT_SETTINGS_H +#endif // PROJECT_SETTINGS_EDITOR_H diff --git a/editor/property_editor.cpp b/editor/property_editor.cpp index 6913b0253b..978c95b9c8 100644 --- a/editor/property_editor.cpp +++ b/editor/property_editor.cpp @@ -31,11 +31,11 @@ #include "property_editor.h" #include "core/class_db.h" +#include "core/input/input_filter.h" #include "core/io/image_loader.h" #include "core/io/marshalls.h" #include "core/io/resource_loader.h" #include "core/math/expression.h" -#include "core/os/input.h" #include "core/os/keyboard.h" #include "core/pair.h" #include "core/print_string.h" @@ -53,7 +53,7 @@ #include "editor/multi_node_edit.h" #include "editor/property_selector.h" #include "scene/gui/label.h" -#include "scene/main/viewport.h" +#include "scene/main/window.h" #include "scene/resources/font.h" #include "scene/resources/packed_scene.h" #include "scene/scene_string_names.h" @@ -103,12 +103,7 @@ Ref<Resource> EditorResourceConversionPlugin::convert(const Ref<Resource> &p_res void CustomPropertyEditor::_notification(int p_what) { - if (p_what == NOTIFICATION_DRAW) { - - RID ci = get_canvas_item(); - get_stylebox("panel", "PopupMenu")->draw(ci, Rect2(Point2(), get_size())); - } - if (p_what == MainLoop::NOTIFICATION_WM_QUIT_REQUEST) { + if (p_what == NOTIFICATION_WM_CLOSE_REQUEST) { hide(); } } @@ -151,7 +146,7 @@ void CustomPropertyEditor::_menu_option(int p_which) { switch (p_which) { case OBJ_MENU_LOAD: { - file->set_mode(EditorFileDialog::MODE_OPEN_FILE); + file->set_file_mode(EditorFileDialog::FILE_MODE_OPEN_FILE); String type = (hint == PROPERTY_HINT_RESOURCE_TYPE) ? hint_text : String(); List<String> extensions; @@ -262,7 +257,7 @@ void CustomPropertyEditor::_menu_option(int p_which) { file_system_dock->navigate_to_path(r->get_path()); // Ensure that the FileSystem dock is visible. TabContainer *tab_container = (TabContainer *)file_system_dock->get_parent_control(); - tab_container->set_current_tab(file_system_dock->get_position_in_parent()); + tab_container->set_current_tab(file_system_dock->get_index()); } break; default: { @@ -493,14 +488,14 @@ bool CustomPropertyEditor::edit(Object *p_owner, const String &p_name, Variant:: } else if (hint == PROPERTY_HINT_EXP_EASING) { - easing_draw->set_anchor_and_margin(MARGIN_LEFT, ANCHOR_BEGIN, 5 * EDSCALE); - easing_draw->set_anchor_and_margin(MARGIN_RIGHT, ANCHOR_END, -5 * EDSCALE); - easing_draw->set_anchor_and_margin(MARGIN_TOP, ANCHOR_BEGIN, 5 * EDSCALE); - easing_draw->set_anchor_and_margin(MARGIN_BOTTOM, ANCHOR_END, -30 * EDSCALE); - type_button->set_anchor_and_margin(MARGIN_LEFT, ANCHOR_BEGIN, 3 * EDSCALE); - type_button->set_anchor_and_margin(MARGIN_RIGHT, ANCHOR_END, -3 * EDSCALE); - type_button->set_anchor_and_margin(MARGIN_TOP, ANCHOR_END, -25 * EDSCALE); - type_button->set_anchor_and_margin(MARGIN_BOTTOM, ANCHOR_END, -7 * EDSCALE); + easing_draw->set_anchor_and_margin(MARGIN_LEFT, Control::ANCHOR_BEGIN, 5 * EDSCALE); + easing_draw->set_anchor_and_margin(MARGIN_RIGHT, Control::ANCHOR_END, -5 * EDSCALE); + easing_draw->set_anchor_and_margin(MARGIN_TOP, Control::ANCHOR_BEGIN, 5 * EDSCALE); + easing_draw->set_anchor_and_margin(MARGIN_BOTTOM, Control::ANCHOR_END, -30 * EDSCALE); + type_button->set_anchor_and_margin(MARGIN_LEFT, Control::ANCHOR_BEGIN, 3 * EDSCALE); + type_button->set_anchor_and_margin(MARGIN_RIGHT, Control::ANCHOR_END, -3 * EDSCALE); + type_button->set_anchor_and_margin(MARGIN_TOP, Control::ANCHOR_END, -25 * EDSCALE); + type_button->set_anchor_and_margin(MARGIN_BOTTOM, Control::ANCHOR_END, -7 * EDSCALE); type_button->set_text(TTR("Preset...")); type_button->get_popup()->clear(); type_button->get_popup()->add_item(TTR("Linear"), EASING_LINEAR); @@ -573,13 +568,13 @@ bool CustomPropertyEditor::edit(Object *p_owner, const String &p_name, Variant:: text_edit->set_text(v); text_edit->deselect(); - int button_margin = get_constant("button_margin", "Dialogs"); - int margin = get_constant("margin", "Dialogs"); + int button_margin = text_edit->get_theme_constant("button_margin", "Dialogs"); + int margin = text_edit->get_theme_constant("margin", "Dialogs"); - action_buttons[0]->set_anchor(MARGIN_LEFT, ANCHOR_END); - action_buttons[0]->set_anchor(MARGIN_TOP, ANCHOR_END); - action_buttons[0]->set_anchor(MARGIN_RIGHT, ANCHOR_END); - action_buttons[0]->set_anchor(MARGIN_BOTTOM, ANCHOR_END); + action_buttons[0]->set_anchor(MARGIN_LEFT, Control::ANCHOR_END); + action_buttons[0]->set_anchor(MARGIN_TOP, Control::ANCHOR_END); + action_buttons[0]->set_anchor(MARGIN_RIGHT, Control::ANCHOR_END); + action_buttons[0]->set_anchor(MARGIN_BOTTOM, Control::ANCHOR_END); action_buttons[0]->set_begin(Point2(-70 * EDSCALE, -button_margin + 5 * EDSCALE)); action_buttons[0]->set_end(Point2(-margin, -margin)); action_buttons[0]->set_text(TTR("Close")); @@ -900,7 +895,7 @@ bool CustomPropertyEditor::edit(Object *p_owner, const String &p_name, Variant:: break; if (p_name == "script" && hint_text == "Script" && Object::cast_to<Node>(owner)) { - menu->add_icon_item(get_icon("Script", "EditorIcons"), TTR("New Script"), OBJ_MENU_NEW_SCRIPT); + menu->add_item(TTR("New Script"), OBJ_MENU_NEW_SCRIPT); menu->add_separator(); } else if (hint_text != "") { int idx = 0; @@ -953,17 +948,7 @@ bool CustomPropertyEditor::edit(Object *p_owner, const String &p_name, Variant:: int id = TYPE_BASE_ID + idx; - if (!icon.is_valid() && has_icon(t, "EditorIcons")) { - icon = get_icon(t, "EditorIcons"); - } - - if (icon.is_valid()) { - - menu->add_icon_item(icon, vformat(TTR("New %s"), t), id); - } else { - - menu->add_item(vformat(TTR("New %s"), t), id); - } + menu->add_item(vformat(TTR("New %s"), t), id); idx++; } @@ -973,13 +958,14 @@ bool CustomPropertyEditor::edit(Object *p_owner, const String &p_name, Variant:: menu->add_separator(); } - menu->add_icon_item(get_icon("Load", "EditorIcons"), TTR("Load"), OBJ_MENU_LOAD); + menu->add_item(TTR("Load"), OBJ_MENU_LOAD); if (!RES(v).is_null()) { - menu->add_icon_item(get_icon("Edit", "EditorIcons"), TTR("Edit"), OBJ_MENU_EDIT); - menu->add_icon_item(get_icon("Clear", "EditorIcons"), TTR("Clear"), OBJ_MENU_CLEAR); - menu->add_icon_item(get_icon("Duplicate", "EditorIcons"), TTR("Make Unique"), OBJ_MENU_MAKE_UNIQUE); + menu->add_item(TTR("Edit"), OBJ_MENU_EDIT); + menu->add_item(TTR("Clear"), OBJ_MENU_CLEAR); + menu->add_item(TTR("Make Unique"), OBJ_MENU_MAKE_UNIQUE); + RES r = v; if (r.is_valid() && r->get_path().is_resource_file()) { menu->add_separator(); @@ -1022,16 +1008,7 @@ bool CustomPropertyEditor::edit(Object *p_owner, const String &p_name, Variant:: } for (int i = 0; i < conversions.size(); i++) { String what = conversions[i]->converts_to(); - Ref<Texture2D> icon; - if (has_icon(what, "EditorIcons")) { - - icon = get_icon(what, "EditorIcons"); - } else { - - icon = get_icon(what, "Resource"); - } - - menu->add_icon_item(icon, vformat(TTR("Convert To %s"), what), CONVERT_BASE_ID + i); + menu->add_item(vformat(TTR("Convert To %s"), what), CONVERT_BASE_ID + i); } } @@ -1105,7 +1082,7 @@ void CustomPropertyEditor::_file_selected(String p_file) { RES res = ResourceLoader::load(p_file, type); if (res.is_null()) { error->set_text(TTR("Error loading file: Not a resource!")); - error->popup_centered_minsize(); + error->popup_centered(); break; } v = res; @@ -1217,7 +1194,7 @@ void CustomPropertyEditor::_node_path_selected(NodePath p_path) { } else if (owner) { - Node *node = NULL; + Node *node = nullptr; if (owner->is_class("Node")) node = Object::cast_to<Node>(owner); @@ -1282,7 +1259,7 @@ void CustomPropertyEditor::_action_pressed(int p_which) { else file->set_access(EditorFileDialog::ACCESS_FILESYSTEM); - file->set_mode(EditorFileDialog::MODE_OPEN_FILE); + file->set_file_mode(EditorFileDialog::FILE_MODE_OPEN_FILE); file->clear_filters(); file->clear_filters(); @@ -1316,7 +1293,7 @@ void CustomPropertyEditor::_action_pressed(int p_which) { file->set_access(EditorFileDialog::ACCESS_RESOURCES); else file->set_access(EditorFileDialog::ACCESS_FILESYSTEM); - file->set_mode(EditorFileDialog::MODE_OPEN_DIR); + file->set_file_mode(EditorFileDialog::FILE_MODE_OPEN_DIR); file->clear_filters(); file->popup_centered_ratio(); } else { @@ -1385,7 +1362,7 @@ void CustomPropertyEditor::_action_pressed(int p_which) { } else if (p_which == 1) { file->set_access(EditorFileDialog::ACCESS_RESOURCES); - file->set_mode(EditorFileDialog::MODE_OPEN_FILE); + file->set_file_mode(EditorFileDialog::FILE_MODE_OPEN_FILE); List<String> extensions; String type = (hint == PROPERTY_HINT_RESOURCE_TYPE) ? hint_text : String(); @@ -1500,7 +1477,7 @@ void CustomPropertyEditor::_draw_easing() { Size2 s = easing_draw->get_size(); Rect2 r(Point2(), s); r = r.grow(3); - get_stylebox("normal", "LineEdit")->draw(ci, r); + easing_draw->get_theme_stylebox("normal", "LineEdit")->draw(ci, r); int points = 48; @@ -1508,8 +1485,8 @@ void CustomPropertyEditor::_draw_easing() { float exp = v; bool flip = hint_text == "attenuation"; - Ref<Font> f = get_font("font", "Label"); - Color color = get_color("font_color", "Label"); + Ref<Font> f = easing_draw->get_theme_font("font", "Label"); + Color color = easing_draw->get_theme_color("font_color", "Label"); for (int i = 1; i <= points; i++) { @@ -1523,7 +1500,7 @@ void CustomPropertyEditor::_draw_easing() { iflp = 1.0 - iflp; } - VisualServer::get_singleton()->canvas_item_add_line(ci, Point2(iflp * s.width, prev * s.height), Point2(ifl * s.width, h * s.height), color); + RenderingServer::get_singleton()->canvas_item_add_line(ci, Point2(iflp * s.width, prev * s.height), Point2(ifl * s.width, h * s.height), color); prev = h; } @@ -1564,7 +1541,7 @@ void CustomPropertyEditor::_modified(String p_string) { v = value_editor[0]->get_text().to_int(); return; } else { - v = expr->execute(Array(), NULL, false); + v = expr->execute(Array(), nullptr, false); } emit_signal("variant_changed"); @@ -1736,14 +1713,14 @@ real_t CustomPropertyEditor::_parse_real_expression(String text) { if (err != OK) { out = value_editor[0]->get_text().to_double(); } else { - out = expr->execute(Array(), NULL, false); + out = expr->execute(Array(), nullptr, false); } return out; } void CustomPropertyEditor::_emit_changed_whole_or_field() { - if (!Input::get_singleton()->is_key_pressed(KEY_SHIFT)) { + if (!InputFilter::get_singleton()->is_key_pressed(KEY_SHIFT)) { emit_signal("variant_changed"); } else { emit_signal("variant_field_changed", field_names[focused_value_editor]); @@ -1805,7 +1782,7 @@ void CustomPropertyEditor::_focus_exit() { void CustomPropertyEditor::config_action_buttons(const List<String> &p_strings) { - Ref<StyleBox> sb = get_stylebox("panel"); + Ref<StyleBox> sb = action_buttons[0]->get_theme_stylebox("panel"); int margin_top = sb->get_margin(MARGIN_TOP); int margin_left = sb->get_margin(MARGIN_LEFT); int margin_bottom = sb->get_margin(MARGIN_BOTTOM); @@ -1921,7 +1898,7 @@ CustomPropertyEditor::CustomPropertyEditor() { checks20[i] = memnew(CheckBox); checks20[i]->set_toggle_mode(true); - checks20[i]->set_focus_mode(FOCUS_NONE); + checks20[i]->set_focus_mode(Control::FOCUS_NONE); checks20gc->add_child(checks20[i]); checks20[i]->hide(); checks20[i]->connect("pressed", callable_mp(this, &CustomPropertyEditor::_action_pressed), make_binds(i)); @@ -1947,9 +1924,8 @@ CustomPropertyEditor::CustomPropertyEditor() { action_buttons[i]->set_flat(true); } - color_picker = NULL; + color_picker = nullptr; - set_as_toplevel(true); file = memnew(EditorFileDialog); add_child(file); file->hide(); @@ -1983,11 +1959,11 @@ CustomPropertyEditor::CustomPropertyEditor() { type_button->get_popup()->connect("id_pressed", callable_mp(this, &CustomPropertyEditor::_type_create_selected)); menu = memnew(PopupMenu); - menu->set_pass_on_modal_close_click(false); + // menu->set_pass_on_modal_close_click(false); add_child(menu); menu->connect("id_pressed", callable_mp(this, &CustomPropertyEditor::_menu_option)); - evaluator = NULL; + evaluator = nullptr; spinbox = memnew(SpinBox); add_child(spinbox); @@ -1999,6 +1975,6 @@ CustomPropertyEditor::CustomPropertyEditor() { slider->set_anchors_and_margins_preset(Control::PRESET_WIDE, Control::PRESET_MODE_MINSIZE, 5); slider->connect("value_changed", callable_mp(this, &CustomPropertyEditor::_range_modified)); - create_dialog = NULL; - property_select = NULL; + create_dialog = nullptr; + property_select = nullptr; } diff --git a/editor/property_editor.h b/editor/property_editor.h index bc2a222714..45466eaa42 100644 --- a/editor/property_editor.h +++ b/editor/property_editor.h @@ -63,9 +63,9 @@ public: virtual Ref<Resource> convert(const Ref<Resource> &p_resource) const; }; -class CustomPropertyEditor : public Popup { +class CustomPropertyEditor : public PopupPanel { - GDCLASS(CustomPropertyEditor, Popup); + GDCLASS(CustomPropertyEditor, PopupPanel); enum { MAX_VALUE_EDITORS = 12, diff --git a/editor/property_selector.cpp b/editor/property_selector.cpp index ede7b860d6..1960ecc604 100644 --- a/editor/property_selector.cpp +++ b/editor/property_selector.cpp @@ -96,7 +96,7 @@ void PropertySelector::_update_search() { } else if (type != Variant::NIL) { Variant v; Callable::CallError ce; - v = Variant::construct(type, NULL, 0, ce); + v = Variant::construct(type, nullptr, 0, ce); v.get_property_list(&props); } else { @@ -116,43 +116,43 @@ void PropertySelector::_update_search() { } } - TreeItem *category = NULL; + TreeItem *category = nullptr; bool found = false; Ref<Texture2D> type_icons[Variant::VARIANT_MAX] = { - Control::get_icon("Variant", "EditorIcons"), - Control::get_icon("bool", "EditorIcons"), - Control::get_icon("int", "EditorIcons"), - Control::get_icon("float", "EditorIcons"), - Control::get_icon("String", "EditorIcons"), - Control::get_icon("Vector2", "EditorIcons"), - Control::get_icon("Rect2", "EditorIcons"), - Control::get_icon("Vector3", "EditorIcons"), - Control::get_icon("Transform2D", "EditorIcons"), - Control::get_icon("Plane", "EditorIcons"), - Control::get_icon("Quat", "EditorIcons"), - Control::get_icon("AABB", "EditorIcons"), - Control::get_icon("Basis", "EditorIcons"), - Control::get_icon("Transform", "EditorIcons"), - Control::get_icon("Color", "EditorIcons"), - Control::get_icon("Path", "EditorIcons"), - Control::get_icon("RID", "EditorIcons"), - Control::get_icon("Object", "EditorIcons"), - Control::get_icon("Dictionary", "EditorIcons"), - Control::get_icon("Array", "EditorIcons"), - Control::get_icon("PackedByteArray", "EditorIcons"), - Control::get_icon("PackedInt32Array", "EditorIcons"), - Control::get_icon("PackedFloat32Array", "EditorIcons"), - Control::get_icon("PackedStringArray", "EditorIcons"), - Control::get_icon("PackedVector2Array", "EditorIcons"), - Control::get_icon("PackedVector3Array", "EditorIcons"), - Control::get_icon("PackedColorArray", "EditorIcons") + search_options->get_theme_icon("Variant", "EditorIcons"), + search_options->get_theme_icon("bool", "EditorIcons"), + search_options->get_theme_icon("int", "EditorIcons"), + search_options->get_theme_icon("float", "EditorIcons"), + search_options->get_theme_icon("String", "EditorIcons"), + search_options->get_theme_icon("Vector2", "EditorIcons"), + search_options->get_theme_icon("Rect2", "EditorIcons"), + search_options->get_theme_icon("Vector3", "EditorIcons"), + search_options->get_theme_icon("Transform2D", "EditorIcons"), + search_options->get_theme_icon("Plane", "EditorIcons"), + search_options->get_theme_icon("Quat", "EditorIcons"), + search_options->get_theme_icon("AABB", "EditorIcons"), + search_options->get_theme_icon("Basis", "EditorIcons"), + search_options->get_theme_icon("Transform", "EditorIcons"), + search_options->get_theme_icon("Color", "EditorIcons"), + search_options->get_theme_icon("Path", "EditorIcons"), + search_options->get_theme_icon("RID", "EditorIcons"), + search_options->get_theme_icon("Object", "EditorIcons"), + search_options->get_theme_icon("Dictionary", "EditorIcons"), + search_options->get_theme_icon("Array", "EditorIcons"), + search_options->get_theme_icon("PackedByteArray", "EditorIcons"), + search_options->get_theme_icon("PackedInt32Array", "EditorIcons"), + search_options->get_theme_icon("PackedFloat32Array", "EditorIcons"), + search_options->get_theme_icon("PackedStringArray", "EditorIcons"), + search_options->get_theme_icon("PackedVector2Array", "EditorIcons"), + search_options->get_theme_icon("PackedVector3Array", "EditorIcons"), + search_options->get_theme_icon("PackedColorArray", "EditorIcons") }; for (List<PropertyInfo>::Element *E = props.front(); E; E = E->next()) { if (E->get().usage == PROPERTY_USAGE_CATEGORY) { - if (category && category->get_children() == NULL) { + if (category && category->get_children() == nullptr) { memdelete(category); //old category was unused } category = search_options->create_item(root); @@ -161,7 +161,7 @@ void PropertySelector::_update_search() { Ref<Texture2D> icon; if (E->get().name == "Script Variables") { - icon = get_icon("Script", "EditorIcons"); + icon = search_options->get_theme_icon("Script", "EditorIcons"); } else { icon = EditorNode::get_singleton()->get_class_icon(E->get().name); } @@ -191,7 +191,7 @@ void PropertySelector::_update_search() { item->set_selectable(0, true); } - if (category && category->get_children() == NULL) { + if (category && category->get_children() == nullptr) { memdelete(category); //old category was unused } } else { @@ -201,7 +201,7 @@ void PropertySelector::_update_search() { if (type != Variant::NIL) { Variant v; Callable::CallError ce; - v = Variant::construct(type, NULL, 0, ce); + v = Variant::construct(type, nullptr, 0, ce); v.get_method_list(&methods); } else { @@ -220,14 +220,14 @@ void PropertySelector::_update_search() { } } - TreeItem *category = NULL; + TreeItem *category = nullptr; bool found = false; bool script_methods = false; for (List<MethodInfo>::Element *E = methods.front(); E; E = E->next()) { if (E->get().name.begins_with("*")) { - if (category && category->get_children() == NULL) { + if (category && category->get_children() == nullptr) { memdelete(category); //old category was unused } category = search_options->create_item(root); @@ -238,7 +238,7 @@ void PropertySelector::_update_search() { script_methods = false; String rep = E->get().name.replace("*", ""); if (E->get().name == "*Script Methods") { - icon = get_icon("Script", "EditorIcons"); + icon = search_options->get_theme_icon("Script", "EditorIcons"); script_methods = true; } else { icon = EditorNode::get_singleton()->get_class_icon(rep); @@ -310,12 +310,12 @@ void PropertySelector::_update_search() { } } - if (category && category->get_children() == NULL) { + if (category && category->get_children() == nullptr) { memdelete(category); //old category was unused } } - get_ok()->set_disabled(root->get_children() == NULL); + get_ok()->set_disabled(root->get_children() == nullptr); } void PropertySelector::_confirmed() { @@ -390,7 +390,7 @@ void PropertySelector::_item_selected() { } void PropertySelector::_hide_requested() { - _closed(); // From WindowDialog. + _cancel_pressed(); // From AcceptDialog. } void PropertySelector::_notification(int p_what) { @@ -410,7 +410,7 @@ void PropertySelector::select_method_from_base_type(const String &p_base, const type = Variant::NIL; script = ObjectID(); properties = false; - instance = NULL; + instance = nullptr; virtuals_only = p_virtuals_only; popup_centered_ratio(0.6); @@ -427,7 +427,7 @@ void PropertySelector::select_method_from_script(const Ref<Script> &p_script, co type = Variant::NIL; script = p_script->get_instance_id(); properties = false; - instance = NULL; + instance = nullptr; virtuals_only = false; popup_centered_ratio(0.6); @@ -443,7 +443,7 @@ void PropertySelector::select_method_from_basic_type(Variant::Type p_type, const type = p_type; script = ObjectID(); properties = false; - instance = NULL; + instance = nullptr; virtuals_only = false; popup_centered_ratio(0.6); @@ -464,7 +464,7 @@ void PropertySelector::select_method_from_instance(Object *p_instance, const Str script = scr->get_instance_id(); } properties = false; - instance = NULL; + instance = nullptr; virtuals_only = false; popup_centered_ratio(0.6); @@ -480,7 +480,7 @@ void PropertySelector::select_property_from_base_type(const String &p_base, cons type = Variant::NIL; script = ObjectID(); properties = true; - instance = NULL; + instance = nullptr; virtuals_only = false; popup_centered_ratio(0.6); @@ -498,7 +498,7 @@ void PropertySelector::select_property_from_script(const Ref<Script> &p_script, type = Variant::NIL; script = p_script->get_instance_id(); properties = true; - instance = NULL; + instance = nullptr; virtuals_only = false; popup_centered_ratio(0.6); @@ -515,7 +515,7 @@ void PropertySelector::select_property_from_basic_type(Variant::Type p_type, con type = p_type; script = ObjectID(); properties = true; - instance = NULL; + instance = nullptr; virtuals_only = false; popup_centered_ratio(0.6); diff --git a/editor/pvrtc_compress.cpp b/editor/pvrtc_compress.cpp index f9efe6a50d..1363fe2942 100644 --- a/editor/pvrtc_compress.cpp +++ b/editor/pvrtc_compress.cpp @@ -38,8 +38,8 @@ #include "editor_settings.h" #include "scene/resources/texture.h" -static void (*_base_image_compress_pvrtc2_func)(Image *) = NULL; -static void (*_base_image_compress_pvrtc4_func)(Image *) = NULL; +static void (*_base_image_compress_pvrtc2_func)(Image *) = nullptr; +static void (*_base_image_compress_pvrtc4_func)(Image *) = nullptr; static void _compress_image(Image::CompressMode p_mode, Image *p_image) { diff --git a/editor/quick_open.cpp b/editor/quick_open.cpp index 95277e72d7..1b4439f0a8 100644 --- a/editor/quick_open.cpp +++ b/editor/quick_open.cpp @@ -142,7 +142,7 @@ void EditorQuickOpen::_parse_fs(EditorFileSystemDirectory *efsd, Vector<Pair<Str if (search_text.is_subsequence_ofi(path)) { Pair<String, Ref<Texture2D>> pair; pair.first = path; - pair.second = get_icon("folder", "FileDialog"); + pair.second = search_options->get_theme_icon("folder", "FileDialog"); if (search_text != String() && list.size() > 0) { @@ -171,7 +171,7 @@ void EditorQuickOpen::_parse_fs(EditorFileSystemDirectory *efsd, Vector<Pair<Str if (ClassDB::is_parent_class(efsd->get_file_type(i), base_type) && (search_text.is_subsequence_ofi(file))) { Pair<String, Ref<Texture2D>> pair; pair.first = file; - pair.second = get_icon((has_icon(efsd->get_file_type(i), ei) ? efsd->get_file_type(i) : ot), ei); + pair.second = search_options->get_theme_icon((search_options->has_theme_icon(efsd->get_file_type(i), ei) ? efsd->get_file_type(i) : ot), ei); list.push_back(pair); } } @@ -241,7 +241,7 @@ void EditorQuickOpen::_update_search() { ti->set_as_cursor(0); } - get_ok()->set_disabled(root->get_children() == NULL); + get_ok()->set_disabled(root->get_children() == nullptr); } void EditorQuickOpen::_confirmed() { @@ -253,6 +253,11 @@ void EditorQuickOpen::_confirmed() { hide(); } +void EditorQuickOpen::_theme_changed() { + + search_box->set_right_icon(search_options->get_theme_icon("Search", "EditorIcons")); +} + void EditorQuickOpen::_notification(int p_what) { switch (p_what) { @@ -260,10 +265,6 @@ void EditorQuickOpen::_notification(int p_what) { connect("confirmed", callable_mp(this, &EditorQuickOpen::_confirmed)); search_box->set_clear_button_enabled(true); - [[fallthrough]]; - } - case NOTIFICATION_THEME_CHANGED: { - search_box->set_right_icon(get_icon("Search", "EditorIcons")); } break; case NOTIFICATION_EXIT_TREE: { disconnect("confirmed", callable_mp(this, &EditorQuickOpen::_confirmed)); @@ -284,6 +285,8 @@ void EditorQuickOpen::_bind_methods() { EditorQuickOpen::EditorQuickOpen() { VBoxContainer *vbc = memnew(VBoxContainer); + vbc->connect("theme_changed", callable_mp(this, &EditorQuickOpen::_theme_changed)); + add_child(vbc); search_box = memnew(LineEdit); vbc->add_margin_child(TTR("Search:"), search_box); @@ -298,7 +301,7 @@ EditorQuickOpen::EditorQuickOpen() { search_options->connect("item_activated", callable_mp(this, &EditorQuickOpen::_confirmed)); search_options->set_hide_root(true); search_options->set_hide_folding(true); - search_options->add_constant_override("draw_guides", 1); + search_options->add_theme_constant_override("draw_guides", 1); ei = "EditorIcons"; ot = "Object"; add_directories = false; diff --git a/editor/quick_open.h b/editor/quick_open.h index 722bad3429..c0e2cb85d8 100644 --- a/editor/quick_open.h +++ b/editor/quick_open.h @@ -56,6 +56,8 @@ class EditorQuickOpen : public ConfirmationDialog { void _confirmed(); void _text_changed(const String &p_newtext); + void _theme_changed(); + protected: void _notification(int p_what); static void _bind_methods(); diff --git a/editor/rename_dialog.cpp b/editor/rename_dialog.cpp index 2d7b7027c8..0266ef6a2b 100644 --- a/editor/rename_dialog.cpp +++ b/editor/rename_dialog.cpp @@ -45,7 +45,7 @@ RenameDialog::RenameDialog(SceneTreeEditor *p_scene_tree_editor, UndoRedo *p_und scene_tree_editor = p_scene_tree_editor; undo_redo = p_undo_redo; - preview_node = NULL; + preview_node = nullptr; set_title(TTR("Batch Rename")); @@ -56,7 +56,7 @@ RenameDialog::RenameDialog(SceneTreeEditor *p_scene_tree_editor, UndoRedo *p_und GridContainer *grd_main = memnew(GridContainer); grd_main->set_columns(2); - grd_main->set_v_size_flags(SIZE_EXPAND_FILL); + grd_main->set_v_size_flags(Control::SIZE_EXPAND_FILL); vbc->add_child(grd_main); // ---- 1st & 2nd row @@ -67,7 +67,7 @@ RenameDialog::RenameDialog(SceneTreeEditor *p_scene_tree_editor, UndoRedo *p_und lne_search = memnew(LineEdit); lne_search->set_placeholder(TTR("Search")); lne_search->set_name("lne_search"); - lne_search->set_h_size_flags(SIZE_EXPAND_FILL); + lne_search->set_h_size_flags(Control::SIZE_EXPAND_FILL); Label *lbl_replace = memnew(Label); lbl_replace->set_text(TTR("Replace")); @@ -75,7 +75,7 @@ RenameDialog::RenameDialog(SceneTreeEditor *p_scene_tree_editor, UndoRedo *p_und lne_replace = memnew(LineEdit); lne_replace->set_placeholder(TTR("Replace")); lne_replace->set_name("lne_replace"); - lne_replace->set_h_size_flags(SIZE_EXPAND_FILL); + lne_replace->set_h_size_flags(Control::SIZE_EXPAND_FILL); grd_main->add_child(lbl_search); grd_main->add_child(lbl_replace); @@ -90,7 +90,7 @@ RenameDialog::RenameDialog(SceneTreeEditor *p_scene_tree_editor, UndoRedo *p_und lne_prefix = memnew(LineEdit); lne_prefix->set_placeholder(TTR("Prefix")); lne_prefix->set_name("lne_prefix"); - lne_prefix->set_h_size_flags(SIZE_EXPAND_FILL); + lne_prefix->set_h_size_flags(Control::SIZE_EXPAND_FILL); Label *lbl_suffix = memnew(Label); lbl_suffix->set_text(TTR("Suffix")); @@ -98,7 +98,7 @@ RenameDialog::RenameDialog(SceneTreeEditor *p_scene_tree_editor, UndoRedo *p_und lne_suffix = memnew(LineEdit); lne_suffix->set_placeholder(TTR("Suffix")); lne_suffix->set_name("lne_suffix"); - lne_suffix->set_h_size_flags(SIZE_EXPAND_FILL); + lne_suffix->set_h_size_flags(Control::SIZE_EXPAND_FILL); grd_main->add_child(lbl_prefix); grd_main->add_child(lbl_suffix); @@ -124,7 +124,7 @@ RenameDialog::RenameDialog(SceneTreeEditor *p_scene_tree_editor, UndoRedo *p_und // ---- Tab Substitute VBoxContainer *vbc_substitute = memnew(VBoxContainer); - vbc_substitute->set_h_size_flags(SIZE_EXPAND_FILL); + vbc_substitute->set_h_size_flags(Control::SIZE_EXPAND_FILL); vbc_substitute->set_custom_minimum_size(Size2(0, feature_min_height)); vbc_substitute->set_name(TTR("Substitute")); @@ -143,9 +143,9 @@ RenameDialog::RenameDialog(SceneTreeEditor *p_scene_tree_editor, UndoRedo *p_und but_insert_name = memnew(Button); but_insert_name->set_text("NAME"); but_insert_name->set_tooltip(String("${NAME}\n") + TTR("Node name")); - but_insert_name->set_focus_mode(FOCUS_NONE); + but_insert_name->set_focus_mode(Control::FOCUS_NONE); but_insert_name->connect("pressed", callable_mp(this, &RenameDialog::_insert_text), make_binds("${NAME}")); - but_insert_name->set_h_size_flags(SIZE_EXPAND_FILL); + but_insert_name->set_h_size_flags(Control::SIZE_EXPAND_FILL); grd_substitute->add_child(but_insert_name); // Parent @@ -153,9 +153,9 @@ RenameDialog::RenameDialog(SceneTreeEditor *p_scene_tree_editor, UndoRedo *p_und but_insert_parent = memnew(Button); but_insert_parent->set_text("PARENT"); but_insert_parent->set_tooltip(String("${PARENT}\n") + TTR("Node's parent name, if available")); - but_insert_parent->set_focus_mode(FOCUS_NONE); + but_insert_parent->set_focus_mode(Control::FOCUS_NONE); but_insert_parent->connect("pressed", callable_mp(this, &RenameDialog::_insert_text), make_binds("${PARENT}")); - but_insert_parent->set_h_size_flags(SIZE_EXPAND_FILL); + but_insert_parent->set_h_size_flags(Control::SIZE_EXPAND_FILL); grd_substitute->add_child(but_insert_parent); // Type @@ -163,9 +163,9 @@ RenameDialog::RenameDialog(SceneTreeEditor *p_scene_tree_editor, UndoRedo *p_und but_insert_type = memnew(Button); but_insert_type->set_text("TYPE"); but_insert_type->set_tooltip(String("${TYPE}\n") + TTR("Node type")); - but_insert_type->set_focus_mode(FOCUS_NONE); + but_insert_type->set_focus_mode(Control::FOCUS_NONE); but_insert_type->connect("pressed", callable_mp(this, &RenameDialog::_insert_text), make_binds("${TYPE}")); - but_insert_type->set_h_size_flags(SIZE_EXPAND_FILL); + but_insert_type->set_h_size_flags(Control::SIZE_EXPAND_FILL); grd_substitute->add_child(but_insert_type); // Scene @@ -173,9 +173,9 @@ RenameDialog::RenameDialog(SceneTreeEditor *p_scene_tree_editor, UndoRedo *p_und but_insert_scene = memnew(Button); but_insert_scene->set_text("SCENE"); but_insert_scene->set_tooltip(String("${SCENE}\n") + TTR("Current scene name")); - but_insert_scene->set_focus_mode(FOCUS_NONE); + but_insert_scene->set_focus_mode(Control::FOCUS_NONE); but_insert_scene->connect("pressed", callable_mp(this, &RenameDialog::_insert_text), make_binds("${SCENE}")); - but_insert_scene->set_h_size_flags(SIZE_EXPAND_FILL); + but_insert_scene->set_h_size_flags(Control::SIZE_EXPAND_FILL); grd_substitute->add_child(but_insert_scene); // Root @@ -183,9 +183,9 @@ RenameDialog::RenameDialog(SceneTreeEditor *p_scene_tree_editor, UndoRedo *p_und but_insert_root = memnew(Button); but_insert_root->set_text("ROOT"); but_insert_root->set_tooltip(String("${ROOT}\n") + TTR("Root node name")); - but_insert_root->set_focus_mode(FOCUS_NONE); + but_insert_root->set_focus_mode(Control::FOCUS_NONE); but_insert_root->connect("pressed", callable_mp(this, &RenameDialog::_insert_text), make_binds("${ROOT}")); - but_insert_root->set_h_size_flags(SIZE_EXPAND_FILL); + but_insert_root->set_h_size_flags(Control::SIZE_EXPAND_FILL); grd_substitute->add_child(but_insert_root); // Count @@ -193,9 +193,9 @@ RenameDialog::RenameDialog(SceneTreeEditor *p_scene_tree_editor, UndoRedo *p_und but_insert_count = memnew(Button); but_insert_count->set_text("COUNTER"); but_insert_count->set_tooltip(String("${COUNTER}\n") + TTR("Sequential integer counter.\nCompare counter options.")); - but_insert_count->set_focus_mode(FOCUS_NONE); + but_insert_count->set_focus_mode(Control::FOCUS_NONE); but_insert_count->connect("pressed", callable_mp(this, &RenameDialog::_insert_text), make_binds("${COUNTER}")); - but_insert_count->set_h_size_flags(SIZE_EXPAND_FILL); + but_insert_count->set_h_size_flags(Control::SIZE_EXPAND_FILL); grd_substitute->add_child(but_insert_count); chk_per_level_counter = memnew(CheckBox); @@ -240,7 +240,7 @@ RenameDialog::RenameDialog(SceneTreeEditor *p_scene_tree_editor, UndoRedo *p_und // ---- Tab Process VBoxContainer *vbc_process = memnew(VBoxContainer); - vbc_process->set_h_size_flags(SIZE_EXPAND_FILL); + vbc_process->set_h_size_flags(Control::SIZE_EXPAND_FILL); vbc_process->set_name(TTR("Post-Process")); vbc_process->set_custom_minimum_size(Size2(0, feature_min_height)); tabc_features->add_child(vbc_process); @@ -291,13 +291,13 @@ RenameDialog::RenameDialog(SceneTreeEditor *p_scene_tree_editor, UndoRedo *p_und lbl_preview = memnew(Label); lbl_preview->set_text(""); - lbl_preview->add_color_override("font_color", EditorNode::get_singleton()->get_gui_base()->get_color("error_color", "Editor")); + lbl_preview->add_theme_color_override("font_color", EditorNode::get_singleton()->get_gui_base()->get_theme_color("error_color", "Editor")); vbc->add_child(lbl_preview); // ---- Dialog related - set_custom_minimum_size(Size2(383, 0)); - set_as_toplevel(true); + set_min_size(Size2(383, 0)); + //set_as_toplevel(true); get_ok()->set_text(TTR("Rename")); Button *but_reset = add_button(TTR("Reset")); @@ -347,7 +347,7 @@ void RenameDialog::_bind_methods() { void RenameDialog::_update_substitute() { - LineEdit *focus_owner_line_edit = Object::cast_to<LineEdit>(get_focus_owner()); + LineEdit *focus_owner_line_edit = Object::cast_to<LineEdit>(scene_tree_editor->get_focus_owner()); bool is_main_field = _is_main_field(focus_owner_line_edit); but_insert_name->set_disabled(!is_main_field); @@ -358,18 +358,18 @@ void RenameDialog::_update_substitute() { but_insert_count->set_disabled(!is_main_field); // The focus mode seems to be reset when disabling/re-enabling - but_insert_name->set_focus_mode(FOCUS_NONE); - but_insert_parent->set_focus_mode(FOCUS_NONE); - but_insert_type->set_focus_mode(FOCUS_NONE); - but_insert_scene->set_focus_mode(FOCUS_NONE); - but_insert_root->set_focus_mode(FOCUS_NONE); - but_insert_count->set_focus_mode(FOCUS_NONE); + but_insert_name->set_focus_mode(Control::FOCUS_NONE); + but_insert_parent->set_focus_mode(Control::FOCUS_NONE); + but_insert_type->set_focus_mode(Control::FOCUS_NONE); + but_insert_scene->set_focus_mode(Control::FOCUS_NONE); + but_insert_root->set_focus_mode(Control::FOCUS_NONE); + but_insert_count->set_focus_mode(Control::FOCUS_NONE); } void RenameDialog::_post_popup() { EditorSelection *editor_selection = EditorNode::get_singleton()->get_editor_selection(); - preview_node = NULL; + preview_node = nullptr; Array selected_node_list = editor_selection->get_selected_nodes(); ERR_FAIL_COND(selected_node_list.size() == 0); @@ -386,7 +386,7 @@ void RenameDialog::_update_preview_int(int new_value) { void RenameDialog::_update_preview(String new_text) { - if (lock_preview_update || preview_node == NULL) + if (lock_preview_update || preview_node == nullptr) return; has_errors = false; @@ -401,11 +401,11 @@ void RenameDialog::_update_preview(String new_text) { if (new_name == preview_node->get_name()) { // New name is identical to the old one. Don't color it as much to avoid distracting the user. - const Color accent_color = EditorNode::get_singleton()->get_gui_base()->get_color("accent_color", "Editor"); - const Color text_color = EditorNode::get_singleton()->get_gui_base()->get_color("default_color", "RichTextLabel"); - lbl_preview->add_color_override("font_color", accent_color.linear_interpolate(text_color, 0.5)); + const Color accent_color = EditorNode::get_singleton()->get_gui_base()->get_theme_color("accent_color", "Editor"); + const Color text_color = EditorNode::get_singleton()->get_gui_base()->get_theme_color("default_color", "RichTextLabel"); + lbl_preview->add_theme_color_override("font_color", accent_color.linear_interpolate(text_color, 0.5)); } else { - lbl_preview->add_color_override("font_color", EditorNode::get_singleton()->get_gui_base()->get_color("success_color", "Editor")); + lbl_preview->add_theme_color_override("font_color", EditorNode::get_singleton()->get_gui_base()->get_theme_color("success_color", "Editor")); } } @@ -491,7 +491,7 @@ void RenameDialog::_error_handler(void *p_self, const char *p_func, const char * self->has_errors = true; self->lbl_preview_title->set_text(TTR("Regular Expression Error")); - self->lbl_preview->add_color_override("font_color", EditorNode::get_singleton()->get_gui_base()->get_color("error_color", "Editor")); + self->lbl_preview->add_theme_color_override("font_color", EditorNode::get_singleton()->get_gui_base()->get_theme_color("error_color", "Editor")); self->lbl_preview->set_text(vformat(TTR("At character %s"), err_str)); } @@ -652,7 +652,7 @@ bool RenameDialog::_is_main_field(LineEdit *line_edit) { void RenameDialog::_insert_text(String text) { - LineEdit *focus_owner = Object::cast_to<LineEdit>(get_focus_owner()); + LineEdit *focus_owner = Object::cast_to<LineEdit>(scene_tree_editor->get_focus_owner()); if (_is_main_field(focus_owner)) { focus_owner->selection_delete(); diff --git a/editor/rename_dialog.h b/editor/rename_dialog.h index 537aa1703b..194dd57648 100644 --- a/editor/rename_dialog.h +++ b/editor/rename_dialog.h @@ -103,7 +103,6 @@ class RenameDialog : public ConfirmationDialog { bool has_errors; protected: - void _notification(int p_what){}; static void _bind_methods(); virtual void _post_popup(); @@ -111,7 +110,7 @@ public: void reset(); void rename(); - RenameDialog(SceneTreeEditor *p_scene_tree_editor, UndoRedo *p_undo_redo = NULL); + RenameDialog(SceneTreeEditor *p_scene_tree_editor, UndoRedo *p_undo_redo = nullptr); ~RenameDialog(){}; }; diff --git a/editor/reparent_dialog.cpp b/editor/reparent_dialog.cpp index 551d20eddb..b71c2bd078 100644 --- a/editor/reparent_dialog.cpp +++ b/editor/reparent_dialog.cpp @@ -45,12 +45,6 @@ void ReparentDialog::_notification(int p_what) { disconnect("confirmed", callable_mp(this, &ReparentDialog::_reparent)); } - - if (p_what == NOTIFICATION_DRAW) { - - //RID ci = get_canvas_item(); - //get_stylebox("panel","PopupMenu")->draw(ci,Rect2(Point2(),get_size())); - } } void ReparentDialog::_cancel() { diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp index 7845af7f79..4041256dd5 100644 --- a/editor/scene_tree_dock.cpp +++ b/editor/scene_tree_dock.cpp @@ -30,8 +30,8 @@ #include "scene_tree_dock.h" +#include "core/input/input_filter.h" #include "core/io/resource_saver.h" -#include "core/os/input.h" #include "core/os/keyboard.h" #include "core/project_settings.h" #include "editor/debugger/editor_debugger_node.h" @@ -42,10 +42,12 @@ #include "editor/multi_node_edit.h" #include "editor/plugins/animation_player_editor_plugin.h" #include "editor/plugins/canvas_item_editor_plugin.h" +#include "editor/plugins/node_3d_editor_plugin.h" #include "editor/plugins/script_editor_plugin.h" -#include "editor/plugins/spatial_editor_plugin.h" -#include "scene/main/viewport.h" +#include "scene/main/window.h" #include "scene/resources/packed_scene.h" +#include "servers/display_server.h" +#include "servers/rendering_server.h" void SceneTreeDock::_nodes_drag_begin() { @@ -73,9 +75,6 @@ void SceneTreeDock::_input(Ref<InputEvent> p_event) { void SceneTreeDock::_unhandled_key_input(Ref<InputEvent> p_event) { - if (get_viewport()->get_modal_stack_top()) - return; //ignore because of modal window - if (get_focus_owner() && get_focus_owner()->is_text_field()) return; @@ -131,7 +130,7 @@ void SceneTreeDock::instance(const String &p_file) { current_option = -1; accept->set_text(TTR("No parent to instance a child at.")); - accept->popup_centered_minsize(); + accept->popup_centered(); return; }; @@ -153,7 +152,7 @@ void SceneTreeDock::instance_scenes(const Vector<String> &p_files, Node *p_paren if (!parent || !edited_scene) { accept->set_text(TTR("No parent to instance the scenes at.")); - accept->popup_centered_minsize(); + accept->popup_centered(); return; }; @@ -174,7 +173,7 @@ void SceneTreeDock::_perform_instance_scenes(const Vector<String> &p_files, Node if (!sdata.is_valid()) { current_option = -1; accept->set_text(vformat(TTR("Error loading scene from %s"), p_files[i])); - accept->popup_centered_minsize(); + accept->popup_centered(); error = true; break; } @@ -183,7 +182,7 @@ void SceneTreeDock::_perform_instance_scenes(const Vector<String> &p_files, Node if (!instanced_scene) { current_option = -1; accept->set_text(vformat(TTR("Error instancing scene from %s"), p_files[i])); - accept->popup_centered_minsize(); + accept->popup_centered(); error = true; break; } @@ -193,7 +192,7 @@ void SceneTreeDock::_perform_instance_scenes(const Vector<String> &p_files, Node if (_cyclical_dependency_exists(edited_scene->get_filename(), instanced_scene)) { accept->set_text(vformat(TTR("Cannot instance the scene '%s' because the current scene exists within one of its nodes."), p_files[i])); - accept->popup_centered_minsize(); + accept->popup_centered(); error = true; break; } @@ -240,14 +239,14 @@ void SceneTreeDock::_replace_with_branch_scene(const String &p_file, Node *base) Ref<PackedScene> sdata = ResourceLoader::load(p_file); if (!sdata.is_valid()) { accept->set_text(vformat(TTR("Error loading scene from %s"), p_file)); - accept->popup_centered_minsize(); + accept->popup_centered(); return; } Node *instanced_scene = sdata->instance(PackedScene::GEN_EDIT_STATE_INSTANCE); if (!instanced_scene) { accept->set_text(vformat(TTR("Error instancing scene from %s"), p_file)); - accept->popup_centered_minsize(); + accept->popup_centered(); return; } @@ -368,8 +367,8 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) { if (ClassDB::is_parent_class(current_edited_scene_root->get_class_name(), "Node2D")) preferred = "Node2D"; - else if (ClassDB::is_parent_class(current_edited_scene_root->get_class_name(), "Spatial")) - preferred = "Spatial"; + else if (ClassDB::is_parent_class(current_edited_scene_root->get_class_name(), "Node3D")) + preferred = "Node3D"; } create_dialog->set_preferred_search_result_type(preferred); create_dialog->popup_create(true); @@ -439,7 +438,7 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) { return; editor_data->get_undo_redo().create_action(TTR("Clear Script")); - editor_data->get_undo_redo().add_do_method(editor, "push_item", (Script *)NULL); + editor_data->get_undo_redo().add_do_method(editor, "push_item", (Script *)nullptr); for (int i = 0; i < selection.size(); i++) { @@ -471,7 +470,7 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) { current_option = -1; accept->set_text(TTR("This operation can't be done on the tree root.")); - accept->popup_centered_minsize(); + accept->popup_centered(); break; } @@ -496,7 +495,7 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) { if (index < lowest_id) lowest_id = index; if (E->get()->get_parent() != common_parent) - common_parent = NULL; + common_parent = nullptr; } if (!common_parent || (MOVING_DOWN && highest_id >= common_parent->get_child_count() - MOVING_DOWN) || (MOVING_UP && lowest_id == 0)) @@ -535,7 +534,7 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) { current_option = -1; accept->set_text(TTR("This operation can't be done on the tree root.")); - accept->popup_centered_minsize(); + accept->popup_centered(); break; } @@ -549,7 +548,7 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) { editor_data->get_undo_redo().create_action(TTR("Duplicate Node(s)")); editor_data->get_undo_redo().add_do_method(editor_selection, "clear"); - Node *dupsingle = NULL; + Node *dupsingle = nullptr; List<Node *> editable_children; selection.sort_custom<Node::Comparator>(); @@ -618,7 +617,7 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) { current_option = -1; accept->set_text(TTR("This operation can't be done on the tree root.")); - accept->popup_centered_minsize(); + accept->popup_centered(); break; } @@ -654,19 +653,19 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) { if (root->get_scene_inherited_state().is_valid()) { accept->set_text(TTR("Can't reparent nodes in inherited scenes, order of nodes can't change.")); - accept->popup_centered_minsize(); + accept->popup_centered(); return; } if (node->get_owner() != root) { accept->set_text(TTR("Node must belong to the edited scene to become root.")); - accept->popup_centered_minsize(); + accept->popup_centered(); return; } if (node->get_filename() != String()) { accept->set_text(TTR("Instantiated scenes can't become root")); - accept->popup_centered_minsize(); + accept->popup_centered(); return; } @@ -676,7 +675,7 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) { editor_data->get_undo_redo().add_do_method(node, "add_child", root); editor_data->get_undo_redo().add_do_method(node, "set_filename", root->get_filename()); editor_data->get_undo_redo().add_do_method(root, "set_filename", String()); - editor_data->get_undo_redo().add_do_method(node, "set_owner", (Object *)NULL); + editor_data->get_undo_redo().add_do_method(node, "set_owner", (Object *)nullptr); editor_data->get_undo_redo().add_do_method(root, "set_owner", node); _node_replace_owner(root, root, node, MODE_DO); @@ -686,7 +685,7 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) { editor_data->get_undo_redo().add_undo_method(editor, "set_edited_scene", root); editor_data->get_undo_redo().add_undo_method(node->get_parent(), "add_child", node); editor_data->get_undo_redo().add_undo_method(node->get_parent(), "move_child", node, node->get_index()); - editor_data->get_undo_redo().add_undo_method(root, "set_owner", (Object *)NULL); + editor_data->get_undo_redo().add_undo_method(root, "set_owner", (Object *)nullptr); editor_data->get_undo_redo().add_undo_method(node, "set_owner", root); _node_replace_owner(root, root, root, MODE_UNDO); @@ -745,7 +744,7 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) { // This prevents the dialog from being too wide after displaying // a deletion confirmation for a node with a long name. delete_dialog->set_size(Size2()); - delete_dialog->popup_centered_minsize(); + delete_dialog->popup_centered(); } } break; @@ -767,7 +766,7 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) { if (!scene) { accept->set_text(TTR("This operation can't be done without a scene.")); - accept->popup_centered_minsize(); + accept->popup_centered(); break; } @@ -775,7 +774,7 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) { if (selection.size() != 1) { accept->set_text(TTR("This operation requires a single selected node.")); - accept->popup_centered_minsize(); + accept->popup_centered(); break; } @@ -783,17 +782,17 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) { if (tocopy == scene) { accept->set_text(TTR("Can not perform with the root node.")); - accept->popup_centered_minsize(); + accept->popup_centered(); break; } if (tocopy != editor_data->get_edited_scene_root() && tocopy->get_filename() != "") { accept->set_text(TTR("This operation can't be done on instanced scenes.")); - accept->popup_centered_minsize(); + accept->popup_centered(); break; } - new_scene_from_dialog->set_mode(EditorFileDialog::MODE_SAVE_FILE); + new_scene_from_dialog->set_file_mode(EditorFileDialog::FILE_MODE_SAVE_FILE); List<String> extensions; Ref<PackedScene> sd = memnew(PackedScene); @@ -822,7 +821,7 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) { if (node) { Node *root = EditorNode::get_singleton()->get_edited_scene(); NodePath path = root->get_path().rel_path_to(node->get_path()); - OS::get_singleton()->set_clipboard(path); + DisplayServer::get_singleton()->clipboard_set(path); } } } break; @@ -848,7 +847,7 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) { if (editable) { editable_instance_remove_dialog->set_text(TTR("Disabling \"editable_instance\" will cause all properties of the node to be reverted to their default.")); - editable_instance_remove_dialog->popup_centered_minsize(); + editable_instance_remove_dialog->popup_centered(); break; } _toggle_editable_children(node); @@ -872,7 +871,7 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) { // Fire confirmation dialog when children are editable. if (editable && !placeholder) { placeholder_editable_instance_remove_dialog->set_text(TTR("Enabling \"Load As Placeholder\" will disable \"Editable Children\" and cause all properties of the node to be reverted to their default.")); - placeholder_editable_instance_remove_dialog->popup_centered_minsize(); + placeholder_editable_instance_remove_dialog->popup_centered(); break; } @@ -929,7 +928,7 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) { break; } - clear_inherit_confirm->popup_centered_minsize(); + clear_inherit_confirm->popup_centered(); } break; case TOOL_SCENE_CLEAR_INHERITANCE_CONFIRM: { if (!profile_allow_editing) { @@ -963,7 +962,7 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) { case TOOL_CREATE_USER_INTERFACE: case TOOL_CREATE_FAVORITE: { - Node *new_node = NULL; + Node *new_node = nullptr; if (TOOL_CREATE_FAVORITE == p_tool) { String name = selected_favorite_root.get_slicec(' ', 0); @@ -985,7 +984,7 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) { } else { switch (p_tool) { case TOOL_CREATE_2D_SCENE: new_node = memnew(Node2D); break; - case TOOL_CREATE_3D_SCENE: new_node = memnew(Spatial); break; + case TOOL_CREATE_3D_SCENE: new_node = memnew(Node3D); break; case TOOL_CREATE_USER_INTERFACE: { Control *node = memnew(Control); node->set_anchors_and_margins_preset(PRESET_WIDE); //more useful for resizable UIs. @@ -999,7 +998,7 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) { editor_data->get_undo_redo().add_do_method(editor, "set_edited_scene", new_node); editor_data->get_undo_redo().add_do_method(scene_tree, "update_tree"); editor_data->get_undo_redo().add_do_reference(new_node); - editor_data->get_undo_redo().add_undo_method(editor, "set_edited_scene", (Object *)NULL); + editor_data->get_undo_redo().add_undo_method(editor, "set_edited_scene", (Object *)nullptr); editor_data->get_undo_redo().commit_action(); editor->edit_node(new_node); @@ -1031,7 +1030,7 @@ void SceneTreeDock::_node_collapsed(Object *p_obj) { if (!ti) return; - if (Input::get_singleton()->is_key_pressed(KEY_SHIFT)) { + if (InputFilter::get_singleton()->is_key_pressed(KEY_SHIFT)) { _set_collapsed_recursive(ti, ti->is_collapsed()); } } @@ -1054,16 +1053,16 @@ void SceneTreeDock::_notification(int p_what) { scene_tree->connect("node_changed", callable_mp((CanvasItem *)canvas_item_plugin->get_canvas_item_editor()->get_viewport_control(), &CanvasItem::update)); } - SpatialEditorPlugin *spatial_editor_plugin = Object::cast_to<SpatialEditorPlugin>(editor_data->get_editor("3D")); + Node3DEditorPlugin *spatial_editor_plugin = Object::cast_to<Node3DEditorPlugin>(editor_data->get_editor("3D")); spatial_editor_plugin->get_spatial_editor()->connect_compat("item_lock_status_changed", scene_tree, "_update_tree"); spatial_editor_plugin->get_spatial_editor()->connect_compat("item_group_status_changed", scene_tree, "_update_tree"); - button_add->set_icon(get_icon("Add", "EditorIcons")); - button_instance->set_icon(get_icon("Instance", "EditorIcons")); - button_create_script->set_icon(get_icon("ScriptCreate", "EditorIcons")); - button_clear_script->set_icon(get_icon("ScriptRemove", "EditorIcons")); + button_add->set_icon(get_theme_icon("Add", "EditorIcons")); + button_instance->set_icon(get_theme_icon("Instance", "EditorIcons")); + button_create_script->set_icon(get_theme_icon("ScriptCreate", "EditorIcons")); + button_clear_script->set_icon(get_theme_icon("ScriptRemove", "EditorIcons")); - filter->set_right_icon(get_icon("Search", "EditorIcons")); + filter->set_right_icon(get_theme_icon("Search", "EditorIcons")); filter->set_clear_button_enabled(true); EditorNode::get_singleton()->get_editor_selection()->connect("selection_changed", callable_mp(this, &SceneTreeDock::_selection_changed)); @@ -1078,7 +1077,7 @@ void SceneTreeDock::_notification(int p_what) { ToolButton *node_shortcuts_toggle = memnew(ToolButton); node_shortcuts_toggle->set_name("NodeShortcutsToggle"); - node_shortcuts_toggle->set_icon(get_icon("Favorites", "EditorIcons")); + node_shortcuts_toggle->set_icon(get_theme_icon("Favorites", "EditorIcons")); node_shortcuts_toggle->set_toggle_mode(true); node_shortcuts_toggle->set_pressed(EDITOR_GET("_use_favorites_root_selection")); node_shortcuts_toggle->set_anchors_and_margins_preset(Control::PRESET_CENTER_RIGHT); @@ -1097,18 +1096,19 @@ void SceneTreeDock::_notification(int p_what) { Button *button_2d = memnew(Button); beginner_node_shortcuts->add_child(button_2d); button_2d->set_text(TTR("2D Scene")); - button_2d->set_icon(get_icon("Node2D", "EditorIcons")); + button_2d->set_icon(get_theme_icon("Node2D", "EditorIcons")); button_2d->connect("pressed", callable_mp(this, &SceneTreeDock::_tool_selected), make_binds(TOOL_CREATE_2D_SCENE, false)); + button_3d = memnew(Button); beginner_node_shortcuts->add_child(button_3d); button_3d->set_text(TTR("3D Scene")); - button_3d->set_icon(get_icon("Spatial", "EditorIcons")); + button_3d->set_icon(get_theme_icon("Node3D", "EditorIcons")); button_3d->connect("pressed", callable_mp(this, &SceneTreeDock::_tool_selected), make_binds(TOOL_CREATE_3D_SCENE, false)); Button *button_ui = memnew(Button); beginner_node_shortcuts->add_child(button_ui); button_ui->set_text(TTR("User Interface")); - button_ui->set_icon(get_icon("Control", "EditorIcons")); + button_ui->set_icon(get_theme_icon("Control", "EditorIcons")); button_ui->connect("pressed", callable_mp(this, &SceneTreeDock::_tool_selected), make_binds(TOOL_CREATE_USER_INTERFACE, false)); VBoxContainer *favorite_node_shortcuts = memnew(VBoxContainer); @@ -1118,7 +1118,7 @@ void SceneTreeDock::_notification(int p_what) { Button *button_custom = memnew(Button); node_shortcuts->add_child(button_custom); button_custom->set_text(TTR("Other Node")); - button_custom->set_icon(get_icon("Add", "EditorIcons")); + button_custom->set_icon(get_theme_icon("Add", "EditorIcons")); button_custom->connect("pressed", callable_mp(this, &SceneTreeDock::_tool_selected), make_binds(TOOL_NEW, false)); node_shortcuts->add_spacer(); @@ -1134,17 +1134,17 @@ void SceneTreeDock::_notification(int p_what) { clear_inherit_confirm->disconnect("confirmed", callable_mp(this, &SceneTreeDock::_tool_selected)); } break; case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: { - button_add->set_icon(get_icon("Add", "EditorIcons")); - button_instance->set_icon(get_icon("Instance", "EditorIcons")); - button_create_script->set_icon(get_icon("ScriptCreate", "EditorIcons")); - button_clear_script->set_icon(get_icon("ScriptRemove", "EditorIcons")); + button_add->set_icon(get_theme_icon("Add", "EditorIcons")); + button_instance->set_icon(get_theme_icon("Instance", "EditorIcons")); + button_create_script->set_icon(get_theme_icon("ScriptCreate", "EditorIcons")); + button_clear_script->set_icon(get_theme_icon("ScriptRemove", "EditorIcons")); - filter->set_right_icon(get_icon("Search", "EditorIcons")); + filter->set_right_icon(get_theme_icon("Search", "EditorIcons")); filter->set_clear_button_enabled(true); } break; case NOTIFICATION_PROCESS: { - bool show_create_root = bool(EDITOR_GET("interface/editors/show_scene_tree_root_selection")) && get_tree()->get_edited_scene_root() == NULL; + bool show_create_root = bool(EDITOR_GET("interface/editors/show_scene_tree_root_selection")) && get_tree()->get_edited_scene_root() == nullptr; if (show_create_root != create_root_dialog->is_visible_in_tree() && !remote_tree->is_visible()) { if (show_create_root) { @@ -1202,7 +1202,7 @@ void SceneTreeDock::_node_selected() { if (!node) { - editor->push_item(NULL); + editor->push_item(nullptr); return; } @@ -1466,7 +1466,7 @@ void SceneTreeDock::_node_prerenamed(Node *p_node, const String &p_new_name) { for (int i = 0; i < p_node->get_child_count(); i++) _fill_path_renames(base_path, new_base_path, p_node->get_child(i), &path_renames); - perform_node_renames(NULL, &path_renames); + perform_node_renames(nullptr, &path_renames); } bool SceneTreeDock::_validate_no_foreign() { @@ -1478,7 +1478,7 @@ bool SceneTreeDock::_validate_no_foreign() { if (E->get() != edited_scene && E->get()->get_owner() != edited_scene) { accept->set_text(TTR("Can't operate on nodes from a foreign scene!")); - accept->popup_centered_minsize(); + accept->popup_centered(); return false; } @@ -1492,7 +1492,7 @@ bool SceneTreeDock::_validate_no_foreign() { if (edited_scene->get_scene_inherited_state().is_valid() && edited_scene->get_scene_inherited_state()->find_node_by_path(edited_scene->get_path_to(E->get())) >= 0) { accept->set_text(TTR("Can't operate on nodes the current scene inherits from!")); - accept->popup_centered_minsize(); + accept->popup_centered(); return false; } } @@ -1535,7 +1535,7 @@ void SceneTreeDock::_do_reparent(Node *p_new_parent, int p_position_in_parent, V if (p_nodes[ni] == p_new_parent) return; // Attempt to reparent to itself. - if (p_nodes[ni]->get_parent() != p_new_parent || p_position_in_parent + ni != p_nodes[ni]->get_position_in_parent()) + if (p_nodes[ni]->get_parent() != p_new_parent || p_position_in_parent + ni != p_nodes[ni]->get_index()) no_change = false; } @@ -1614,8 +1614,8 @@ void SceneTreeDock::_do_reparent(Node *p_new_parent, int p_position_in_parent, V if (p_keep_global_xform) { if (Object::cast_to<Node2D>(node)) editor_data->get_undo_redo().add_do_method(node, "set_global_transform", Object::cast_to<Node2D>(node)->get_global_transform()); - if (Object::cast_to<Spatial>(node)) - editor_data->get_undo_redo().add_do_method(node, "set_global_transform", Object::cast_to<Spatial>(node)->get_global_transform()); + if (Object::cast_to<Node3D>(node)) + editor_data->get_undo_redo().add_do_method(node, "set_global_transform", Object::cast_to<Node3D>(node)->get_global_transform()); if (Object::cast_to<Control>(node)) editor_data->get_undo_redo().add_do_method(node, "set_global_position", Object::cast_to<Control>(node)->get_global_position()); } @@ -1644,7 +1644,7 @@ void SceneTreeDock::_do_reparent(Node *p_new_parent, int p_position_in_parent, V owners.push_back(E->get()); } - int child_pos = node->get_position_in_parent(); + int child_pos = node->get_index(); editor_data->get_undo_redo().add_undo_method(node->get_parent(), "add_child", node); editor_data->get_undo_redo().add_undo_method(node->get_parent(), "move_child", node, child_pos); @@ -1655,14 +1655,14 @@ void SceneTreeDock::_do_reparent(Node *p_new_parent, int p_position_in_parent, V if (p_keep_global_xform) { if (Object::cast_to<Node2D>(node)) editor_data->get_undo_redo().add_undo_method(node, "set_transform", Object::cast_to<Node2D>(node)->get_transform()); - if (Object::cast_to<Spatial>(node)) - editor_data->get_undo_redo().add_undo_method(node, "set_transform", Object::cast_to<Spatial>(node)->get_transform()); + if (Object::cast_to<Node3D>(node)) + editor_data->get_undo_redo().add_undo_method(node, "set_transform", Object::cast_to<Node3D>(node)->get_transform()); if (Object::cast_to<Control>(node)) editor_data->get_undo_redo().add_undo_method(node, "set_position", Object::cast_to<Control>(node)->get_position()); } } - perform_node_renames(NULL, &path_renames); + perform_node_renames(nullptr, &path_renames); editor_data->get_undo_redo().commit_action(); } @@ -1777,7 +1777,7 @@ void SceneTreeDock::_toggle_editable_children(Node *p_node) { if (editable) p_node->set_scene_instance_load_placeholder(false); - SpatialEditor::get_singleton()->update_all_gizmos(p_node); + Node3DEditor::get_singleton()->update_all_gizmos(p_node); scene_tree->update_tree(); } @@ -1805,7 +1805,7 @@ void SceneTreeDock::_delete_confirm() { if (entire_scene) { - editor_data->get_undo_redo().add_do_method(editor, "set_edited_scene", (Object *)NULL); + editor_data->get_undo_redo().add_do_method(editor, "set_edited_scene", (Object *)nullptr); editor_data->get_undo_redo().add_undo_method(editor, "set_edited_scene", edited_scene); editor_data->get_undo_redo().add_undo_method(edited_scene, "set_owner", edited_scene->get_owner()); editor_data->get_undo_redo().add_undo_method(scene_tree, "update_tree"); @@ -1822,10 +1822,10 @@ void SceneTreeDock::_delete_confirm() { if (!n->is_inside_tree() || !n->get_parent()) continue; - fill_path_renames(n, NULL, &path_renames); + fill_path_renames(n, nullptr, &path_renames); } - perform_node_renames(NULL, &path_renames); + perform_node_renames(nullptr, &path_renames); //delete for read for (List<Node *>::Element *E = remove_list.front(); E; E = E->next()) { Node *n = E->get(); @@ -1859,7 +1859,7 @@ void SceneTreeDock::_delete_confirm() { if (CanvasItemEditor *editor = CanvasItemEditor::get_singleton()) editor->get_viewport_control()->update(); - editor->push_item(NULL); + editor->push_item(nullptr); // Fixes the EditorHistory from still offering deleted notes EditorHistory *editor_history = EditorNode::get_singleton()->get_editor_history(); @@ -1908,7 +1908,7 @@ void SceneTreeDock::_selection_changed() { } else if (selection_size == 1) { editor->push_item(EditorNode::get_singleton()->get_editor_selection()->get_selected_node_list()[0]); } else { - editor->push_item(NULL); + editor->push_item(nullptr); } _update_script_button(); } @@ -1918,7 +1918,7 @@ Node *SceneTreeDock::_get_selection_group_tail(Node *p_node, List<Node *> p_list Node *tail = p_node; Node *parent = tail->get_parent(); - for (int i = p_node->get_position_in_parent(); i < parent->get_child_count(); i++) { + for (int i = p_node->get_index(); i < parent->get_child_count(); i++) { Node *sibling = parent->get_child(i); if (p_list.find(sibling)) @@ -1958,7 +1958,7 @@ void SceneTreeDock::_do_create(Node *p_parent) { editor_data->get_undo_redo().add_do_method(editor, "set_edited_scene", child); editor_data->get_undo_redo().add_do_method(scene_tree, "update_tree"); editor_data->get_undo_redo().add_do_reference(child); - editor_data->get_undo_redo().add_undo_method(editor, "set_edited_scene", (Object *)NULL); + editor_data->get_undo_redo().add_undo_method(editor, "set_edited_scene", (Object *)nullptr); } editor_data->get_undo_redo().commit_action(); @@ -1982,7 +1982,7 @@ void SceneTreeDock::_create() { if (current_option == TOOL_NEW) { - Node *parent = NULL; + Node *parent = nullptr; if (edited_scene) { // If root exists in edited scene @@ -2052,7 +2052,7 @@ void SceneTreeDock::_create() { } } - Node *parent = NULL; + Node *parent = nullptr; if (only_one_top_node) parent = top_node->get_parent(); else @@ -2096,7 +2096,7 @@ void SceneTreeDock::replace_node(Node *p_node, Node *p_by_node, bool p_keep_prop memdelete(default_oldnode); } - editor->push_item(NULL); + editor->push_item(nullptr); //reconnect signals List<MethodInfo> sl; @@ -2120,7 +2120,7 @@ void SceneTreeDock::replace_node(Node *p_node, Node *p_by_node, bool p_keep_prop List<Node *> to_erase; for (int i = 0; i < n->get_child_count(); i++) { - if (n->get_child(i)->get_owner() == NULL && n->is_owned_by_parent()) { + if (n->get_child(i)->get_owner() == nullptr && n->is_owned_by_parent()) { to_erase.push_back(n->get_child(i)); } } @@ -2187,13 +2187,13 @@ void SceneTreeDock::_new_scene_from(String p_file) { if (selection.size() != 1) { accept->set_text(TTR("This operation requires a single selected node.")); - accept->popup_centered_minsize(); + accept->popup_centered(); return; } if (EditorNode::get_singleton()->is_scene_open(p_file)) { accept->set_text(TTR("Can't overwrite scene that is still open!")); - accept->popup_centered_minsize(); + accept->popup_centered(); return; } @@ -2210,7 +2210,7 @@ void SceneTreeDock::_new_scene_from(String p_file) { if (err != OK) { accept->set_text(TTR("Couldn't save new scene. Likely dependencies (instances) couldn't be satisfied.")); - accept->popup_centered_minsize(); + accept->popup_centered(); return; } @@ -2221,13 +2221,13 @@ void SceneTreeDock::_new_scene_from(String p_file) { err = ResourceSaver::save(p_file, sdata, flg); if (err != OK) { accept->set_text(TTR("Error saving scene.")); - accept->popup_centered_minsize(); + accept->popup_centered(); return; } _replace_with_branch_scene(p_file, base); } else { accept->set_text(TTR("Error duplicating scene to save it.")); - accept->popup_centered_minsize(); + accept->popup_centered(); return; } } @@ -2267,7 +2267,7 @@ void SceneTreeDock::_normalize_drop(Node *&to_node, int &to_pos, int p_type) { if (p_type == -1) { //drop at above selected node if (to_node == EditorNode::get_singleton()->get_edited_scene()) { - to_node = NULL; + to_node = nullptr; ERR_FAIL_MSG("Cannot perform drop above the root node!"); } @@ -2282,7 +2282,7 @@ void SceneTreeDock::_normalize_drop(Node *&to_node, int &to_pos, int p_type) { return; } - Node *lower_sibling = NULL; + Node *lower_sibling = nullptr; if (_has_visible_children(to_node)) { to_pos = 0; @@ -2346,7 +2346,7 @@ void SceneTreeDock::_nodes_dragged(Array p_nodes, NodePath p_to, int p_type) { int to_pos = -1; _normalize_drop(to_node, to_pos, p_type); - _do_reparent(to_node, to_pos, nodes, !Input::get_singleton()->is_key_pressed(KEY_SHIFT)); + _do_reparent(to_node, to_pos, nodes, !InputFilter::get_singleton()->is_key_pressed(KEY_SHIFT)); } void SceneTreeDock::_add_children_to_popup(Object *p_obj, int p_depth) { @@ -2390,8 +2390,8 @@ void SceneTreeDock::_tree_rmb(const Vector2 &p_menu_pos) { menu->clear(); if (profile_allow_editing) { - menu->add_icon_shortcut(get_icon("Add", "EditorIcons"), ED_GET_SHORTCUT("scene_tree/add_child_node"), TOOL_NEW); - menu->add_icon_shortcut(get_icon("Instance", "EditorIcons"), ED_GET_SHORTCUT("scene_tree/instance_scene"), TOOL_INSTANCE); + menu->add_icon_shortcut(get_theme_icon("Add", "EditorIcons"), ED_GET_SHORTCUT("scene_tree/add_child_node"), TOOL_NEW); + menu->add_icon_shortcut(get_theme_icon("Instance", "EditorIcons"), ED_GET_SHORTCUT("scene_tree/instance_scene"), TOOL_INSTANCE); } menu->set_size(Size2(1, 1)); @@ -2422,10 +2422,10 @@ void SceneTreeDock::_tree_rmb(const Vector2 &p_menu_pos) { if (menu->get_item_count() > 0) menu->add_separator(); - menu->add_icon_shortcut(get_icon("Add", "EditorIcons"), ED_GET_SHORTCUT("scene_tree/add_child_node"), TOOL_NEW); - menu->add_icon_shortcut(get_icon("Instance", "EditorIcons"), ED_GET_SHORTCUT("scene_tree/instance_scene"), TOOL_INSTANCE); + menu->add_icon_shortcut(get_theme_icon("Add", "EditorIcons"), ED_GET_SHORTCUT("scene_tree/add_child_node"), TOOL_NEW); + menu->add_icon_shortcut(get_theme_icon("Instance", "EditorIcons"), ED_GET_SHORTCUT("scene_tree/instance_scene"), TOOL_INSTANCE); } - menu->add_icon_shortcut(get_icon("Collapse", "EditorIcons"), ED_GET_SHORTCUT("scene_tree/expand_collapse_all"), TOOL_EXPAND_COLLAPSE); + menu->add_icon_shortcut(get_theme_icon("Collapse", "EditorIcons"), ED_GET_SHORTCUT("scene_tree/expand_collapse_all"), TOOL_EXPAND_COLLAPSE); menu->add_separator(); existing_script = selected->get_script(); @@ -2440,14 +2440,14 @@ void SceneTreeDock::_tree_rmb(const Vector2 &p_menu_pos) { if (full_selection.size() == 1) { add_separator = true; - menu->add_icon_shortcut(get_icon("ScriptCreate", "EditorIcons"), ED_GET_SHORTCUT("scene_tree/attach_script"), TOOL_ATTACH_SCRIPT); + menu->add_icon_shortcut(get_theme_icon("ScriptCreate", "EditorIcons"), ED_GET_SHORTCUT("scene_tree/attach_script"), TOOL_ATTACH_SCRIPT); if (existing_script.is_valid()) { - menu->add_icon_shortcut(get_icon("ScriptExtend", "EditorIcons"), ED_GET_SHORTCUT("scene_tree/extend_script"), TOOL_EXTEND_SCRIPT); + menu->add_icon_shortcut(get_theme_icon("ScriptExtend", "EditorIcons"), ED_GET_SHORTCUT("scene_tree/extend_script"), TOOL_EXTEND_SCRIPT); } } if (existing_script.is_valid() && existing_script_removable) { add_separator = true; - menu->add_icon_shortcut(get_icon("ScriptRemove", "EditorIcons"), ED_GET_SHORTCUT("scene_tree/clear_script"), TOOL_CLEAR_SCRIPT); + menu->add_icon_shortcut(get_theme_icon("ScriptRemove", "EditorIcons"), ED_GET_SHORTCUT("scene_tree/clear_script"), TOOL_CLEAR_SCRIPT); } else if (full_selection.size() > 1) { bool script_exists = false; for (List<Node *>::Element *E = full_selection.front(); E; E = E->next()) { @@ -2459,7 +2459,7 @@ void SceneTreeDock::_tree_rmb(const Vector2 &p_menu_pos) { if (script_exists) { add_separator = true; - menu->add_icon_shortcut(get_icon("ScriptRemove", "EditorIcons"), ED_GET_SHORTCUT("scene_tree/clear_script"), TOOL_CLEAR_SCRIPT); + menu->add_icon_shortcut(get_theme_icon("ScriptRemove", "EditorIcons"), ED_GET_SHORTCUT("scene_tree/clear_script"), TOOL_CLEAR_SCRIPT); } } @@ -2470,19 +2470,19 @@ void SceneTreeDock::_tree_rmb(const Vector2 &p_menu_pos) { if (profile_allow_editing) { if (full_selection.size() == 1) { - menu->add_icon_shortcut(get_icon("Rename", "EditorIcons"), ED_GET_SHORTCUT("scene_tree/rename"), TOOL_RENAME); + menu->add_icon_shortcut(get_theme_icon("Rename", "EditorIcons"), ED_GET_SHORTCUT("scene_tree/rename"), TOOL_RENAME); } - menu->add_icon_shortcut(get_icon("Reload", "EditorIcons"), ED_GET_SHORTCUT("scene_tree/change_node_type"), TOOL_REPLACE); + menu->add_icon_shortcut(get_theme_icon("Reload", "EditorIcons"), ED_GET_SHORTCUT("scene_tree/change_node_type"), TOOL_REPLACE); if (scene_tree->get_selected() != edited_scene) { menu->add_separator(); - menu->add_icon_shortcut(get_icon("MoveUp", "EditorIcons"), ED_GET_SHORTCUT("scene_tree/move_up"), TOOL_MOVE_UP); - menu->add_icon_shortcut(get_icon("MoveDown", "EditorIcons"), ED_GET_SHORTCUT("scene_tree/move_down"), TOOL_MOVE_DOWN); - menu->add_icon_shortcut(get_icon("Duplicate", "EditorIcons"), ED_GET_SHORTCUT("scene_tree/duplicate"), TOOL_DUPLICATE); - menu->add_icon_shortcut(get_icon("Reparent", "EditorIcons"), ED_GET_SHORTCUT("scene_tree/reparent"), TOOL_REPARENT); - menu->add_icon_shortcut(get_icon("ReparentToNewNode", "EditorIcons"), ED_GET_SHORTCUT("scene_tree/reparent_to_new_node"), TOOL_REPARENT_TO_NEW_NODE); + menu->add_icon_shortcut(get_theme_icon("MoveUp", "EditorIcons"), ED_GET_SHORTCUT("scene_tree/move_up"), TOOL_MOVE_UP); + menu->add_icon_shortcut(get_theme_icon("MoveDown", "EditorIcons"), ED_GET_SHORTCUT("scene_tree/move_down"), TOOL_MOVE_DOWN); + menu->add_icon_shortcut(get_theme_icon("Duplicate", "EditorIcons"), ED_GET_SHORTCUT("scene_tree/duplicate"), TOOL_DUPLICATE); + menu->add_icon_shortcut(get_theme_icon("Reparent", "EditorIcons"), ED_GET_SHORTCUT("scene_tree/reparent"), TOOL_REPARENT); + menu->add_icon_shortcut(get_theme_icon("ReparentToNewNode", "EditorIcons"), ED_GET_SHORTCUT("scene_tree/reparent_to_new_node"), TOOL_REPARENT_TO_NEW_NODE); if (selection.size() == 1) { - menu->add_icon_shortcut(get_icon("NewRoot", "EditorIcons"), ED_GET_SHORTCUT("scene_tree/make_root"), TOOL_MAKE_ROOT); + menu->add_icon_shortcut(get_theme_icon("NewRoot", "EditorIcons"), ED_GET_SHORTCUT("scene_tree/make_root"), TOOL_MAKE_ROOT); } } } @@ -2490,24 +2490,24 @@ void SceneTreeDock::_tree_rmb(const Vector2 &p_menu_pos) { if (profile_allow_editing) { menu->add_separator(); - menu->add_icon_shortcut(get_icon("Blend", "EditorIcons"), ED_GET_SHORTCUT("scene_tree/merge_from_scene"), TOOL_MERGE_FROM_SCENE); - menu->add_icon_shortcut(get_icon("CreateNewSceneFrom", "EditorIcons"), ED_GET_SHORTCUT("scene_tree/save_branch_as_scene"), TOOL_NEW_SCENE_FROM); + menu->add_icon_shortcut(get_theme_icon("Blend", "EditorIcons"), ED_GET_SHORTCUT("scene_tree/merge_from_scene"), TOOL_MERGE_FROM_SCENE); + menu->add_icon_shortcut(get_theme_icon("CreateNewSceneFrom", "EditorIcons"), ED_GET_SHORTCUT("scene_tree/save_branch_as_scene"), TOOL_NEW_SCENE_FROM); } if (full_selection.size() == 1) { menu->add_separator(); - menu->add_icon_shortcut(get_icon("CopyNodePath", "EditorIcons"), ED_GET_SHORTCUT("scene_tree/copy_node_path"), TOOL_COPY_NODE_PATH); + menu->add_icon_shortcut(get_theme_icon("CopyNodePath", "EditorIcons"), ED_GET_SHORTCUT("scene_tree/copy_node_path"), TOOL_COPY_NODE_PATH); } bool is_external = (selection[0]->get_filename() != ""); if (is_external) { - bool is_inherited = selection[0]->get_scene_inherited_state() != NULL; - bool is_top_level = selection[0]->get_owner() == NULL; + bool is_inherited = selection[0]->get_scene_inherited_state() != nullptr; + bool is_top_level = selection[0]->get_owner() == nullptr; if (is_inherited && is_top_level) { menu->add_separator(); if (profile_allow_editing) { menu->add_item(TTR("Clear Inheritance"), TOOL_SCENE_CLEAR_INHERITANCE); } - menu->add_icon_item(get_icon("Load", "EditorIcons"), TTR("Open in Editor"), TOOL_SCENE_OPEN_INHERITED); + menu->add_icon_item(get_theme_icon("Load", "EditorIcons"), TTR("Open in Editor"), TOOL_SCENE_OPEN_INHERITED); } else if (!is_top_level) { menu->add_separator(); bool editable = EditorNode::get_singleton()->get_edited_scene()->is_editable_instance(selection[0]); @@ -2517,7 +2517,7 @@ void SceneTreeDock::_tree_rmb(const Vector2 &p_menu_pos) { menu->add_check_item(TTR("Load As Placeholder"), TOOL_SCENE_USE_PLACEHOLDER); menu->add_item(TTR("Make Local"), TOOL_SCENE_MAKE_LOCAL); } - menu->add_icon_item(get_icon("Load", "EditorIcons"), TTR("Open in Editor"), TOOL_SCENE_OPEN); + menu->add_icon_item(get_theme_icon("Load", "EditorIcons"), TTR("Open in Editor"), TOOL_SCENE_OPEN); if (profile_allow_editing) { menu->set_item_checked(menu->get_item_idx_from_text(TTR("Editable Children")), editable); menu->set_item_checked(menu->get_item_idx_from_text(TTR("Load As Placeholder")), placeholder); @@ -2529,14 +2529,14 @@ void SceneTreeDock::_tree_rmb(const Vector2 &p_menu_pos) { if (profile_allow_editing && selection.size() > 1) { //this is not a commonly used action, it makes no sense for it to be where it was nor always present. menu->add_separator(); - menu->add_icon_shortcut(get_icon("Rename", "EditorIcons"), ED_GET_SHORTCUT("scene_tree/batch_rename"), TOOL_BATCH_RENAME); + menu->add_icon_shortcut(get_theme_icon("Rename", "EditorIcons"), ED_GET_SHORTCUT("scene_tree/batch_rename"), TOOL_BATCH_RENAME); } menu->add_separator(); - menu->add_icon_item(get_icon("Help", "EditorIcons"), TTR("Open Documentation"), TOOL_OPEN_DOCUMENTATION); + menu->add_icon_item(get_theme_icon("Help", "EditorIcons"), TTR("Open Documentation"), TOOL_OPEN_DOCUMENTATION); if (profile_allow_editing) { menu->add_separator(); - menu->add_icon_shortcut(get_icon("Remove", "EditorIcons"), ED_SHORTCUT("scene_tree/delete", TTR("Delete Node(s)"), KEY_DELETE), TOOL_ERASE); + menu->add_icon_shortcut(get_theme_icon("Remove", "EditorIcons"), ED_SHORTCUT("scene_tree/delete", TTR("Delete Node(s)"), KEY_DELETE), TOOL_ERASE); } menu->set_size(Size2(1, 1)); menu->set_position(p_menu_pos); @@ -2568,7 +2568,7 @@ void SceneTreeDock::_focus_node() { CanvasItemEditorPlugin *editor = Object::cast_to<CanvasItemEditorPlugin>(editor_data->get_editor("2D")); editor->get_canvas_item_editor()->focus_selection(); } else { - SpatialEditorPlugin *editor = Object::cast_to<SpatialEditorPlugin>(editor_data->get_editor("3D")); + Node3DEditorPlugin *editor = Object::cast_to<Node3DEditorPlugin>(editor_data->get_editor("3D")); editor->get_spatial_editor()->get_editor_viewport(0)->focus_selection(); } } @@ -2634,7 +2634,7 @@ void SceneTreeDock::open_script_dialog(Node *p_for_node, bool p_extend) { } void SceneTreeDock::add_remote_tree_editor(Control *p_remote) { - ERR_FAIL_COND(remote_tree != NULL); + ERR_FAIL_COND(remote_tree != nullptr); add_child(p_remote); remote_tree = p_remote; remote_tree->hide(); @@ -2787,7 +2787,7 @@ SceneTreeDock::SceneTreeDock(EditorNode *p_editor, Node *p_scene_root, EditorSel set_name("Scene"); editor = p_editor; - edited_scene = NULL; + edited_scene = nullptr; editor_data = &p_editor_data; editor_selection = p_editor_selection; scene_root = p_scene_root; @@ -2795,7 +2795,7 @@ SceneTreeDock::SceneTreeDock(EditorNode *p_editor, Node *p_scene_root, EditorSel VBoxContainer *vbc = this; HBoxContainer *filter_hbc = memnew(HBoxContainer); - filter_hbc->add_constant_override("separate", 0); + filter_hbc->add_theme_constant_override("separate", 0); ED_SHORTCUT("scene_tree/rename", TTR("Rename")); ED_SHORTCUT("scene_tree/batch_rename", TTR("Batch Rename"), KEY_MASK_CMD | KEY_F2); @@ -2835,7 +2835,7 @@ SceneTreeDock::SceneTreeDock(EditorNode *p_editor, Node *p_scene_root, EditorSel filter->set_h_size_flags(SIZE_EXPAND_FILL); filter->set_placeholder(TTR("Filter nodes")); filter_hbc->add_child(filter); - filter->add_constant_override("minimum_spaces", 0); + filter->add_theme_constant_override("minimum_spaces", 0); filter->connect("text_changed", callable_mp(this, &SceneTreeDock::_filter_changed)); button_create_script = memnew(ToolButton); @@ -2867,9 +2867,10 @@ SceneTreeDock::SceneTreeDock(EditorNode *p_editor, Node *p_scene_root, EditorSel edit_local->set_h_size_flags(SIZE_EXPAND_FILL); edit_local->set_text(TTR("Local")); edit_local->set_toggle_mode(true); + edit_local->set_pressed(true); edit_local->connect("pressed", callable_mp(this, &SceneTreeDock::_local_tree_selected)); - remote_tree = NULL; + remote_tree = nullptr; button_hb->hide(); create_root_dialog = memnew(VBoxContainer); @@ -2939,14 +2940,14 @@ SceneTreeDock::SceneTreeDock(EditorNode *p_editor, Node *p_scene_root, EditorSel import_subscene_dialog->connect("subscene_selected", callable_mp(this, &SceneTreeDock::_import_subscene)); new_scene_from_dialog = memnew(EditorFileDialog); - new_scene_from_dialog->set_mode(EditorFileDialog::MODE_SAVE_FILE); + new_scene_from_dialog->set_file_mode(EditorFileDialog::FILE_MODE_SAVE_FILE); add_child(new_scene_from_dialog); new_scene_from_dialog->connect("file_selected", callable_mp(this, &SceneTreeDock::_new_scene_from)); menu = memnew(PopupMenu); add_child(menu); menu->connect("id_pressed", callable_mp(this, &SceneTreeDock::_tool_selected), make_binds(false)); - menu->set_hide_on_window_lose_focus(true); + menu_subresources = memnew(PopupMenu); menu_subresources->set_name("Sub-Resources"); menu_subresources->connect("id_pressed", callable_mp(this, &SceneTreeDock::_tool_selected), make_binds(false)); diff --git a/editor/scene_tree_dock.h b/editor/scene_tree_dock.h index e41ea1ce97..31ef1ce7d0 100644 --- a/editor/scene_tree_dock.h +++ b/editor/scene_tree_dock.h @@ -247,10 +247,10 @@ public: void import_subscene(); void set_edited_scene(Node *p_scene); void instance(const String &p_file); - void instance_scenes(const Vector<String> &p_files, Node *p_parent = NULL); + void instance_scenes(const Vector<String> &p_files, Node *p_parent = nullptr); void set_selected(Node *p_node, bool p_emit_selected = false); void fill_path_renames(Node *p_node, Node *p_new_parent, List<Pair<NodePath, NodePath>> *p_renames); - void perform_node_renames(Node *p_base, List<Pair<NodePath, NodePath>> *p_renames, Map<Ref<Animation>, Set<int>> *r_rem_anims = NULL); + void perform_node_renames(Node *p_base, List<Pair<NodePath, NodePath>> *p_renames, Map<Ref<Animation>, Set<int>> *r_rem_anims = nullptr); SceneTreeEditor *get_tree_editor() { return scene_tree; } EditorData *get_editor_data() { return editor_data; } diff --git a/editor/scene_tree_editor.cpp b/editor/scene_tree_editor.cpp index 782df12d4b..251c911038 100644 --- a/editor/scene_tree_editor.cpp +++ b/editor/scene_tree_editor.cpp @@ -37,12 +37,12 @@ #include "editor/plugins/animation_player_editor_plugin.h" #include "editor/plugins/canvas_item_editor_plugin.h" #include "scene/gui/label.h" -#include "scene/main/viewport.h" +#include "scene/main/window.h" #include "scene/resources/packed_scene.h" Node *SceneTreeEditor::get_scene_node() { - ERR_FAIL_COND_V(!is_inside_tree(), NULL); + ERR_FAIL_COND_V(!is_inside_tree(), nullptr); return get_tree()->get_edited_scene_root(); } @@ -78,7 +78,7 @@ void SceneTreeEditor::_cell_button_pressed(Object *p_item, int p_column, int p_i undo_redo->create_action(TTR("Toggle Visible")); _toggle_visible(n); List<Node *> selection = editor_selection->get_selected_node_list(); - if (selection.size() > 1 && selection.find(n) != NULL) { + if (selection.size() > 1 && selection.find(n) != nullptr) { for (List<Node *>::Element *E = selection.front(); E; E = E->next()) { Node *nv = E->get(); ERR_FAIL_COND(!nv); @@ -92,7 +92,7 @@ void SceneTreeEditor::_cell_button_pressed(Object *p_item, int p_column, int p_i } else if (p_id == BUTTON_LOCK) { undo_redo->create_action(TTR("Unlock Node")); - if (n->is_class("CanvasItem") || n->is_class("Spatial")) { + if (n->is_class("CanvasItem") || n->is_class("Node3D")) { undo_redo->add_do_method(n, "remove_meta", "_edit_lock_"); undo_redo->add_undo_method(n, "set_meta", "_edit_lock_", true); @@ -112,7 +112,7 @@ void SceneTreeEditor::_cell_button_pressed(Object *p_item, int p_column, int p_i } else if (p_id == BUTTON_GROUP) { undo_redo->create_action(TTR("Button Group")); - if (n->is_class("CanvasItem") || n->is_class("Spatial")) { + if (n->is_class("CanvasItem") || n->is_class("Node3D")) { undo_redo->add_do_method(n, "remove_meta", "_edit_group_"); undo_redo->add_undo_method(n, "set_meta", "_edit_group_", true); @@ -129,7 +129,7 @@ void SceneTreeEditor::_cell_button_pressed(Object *p_item, int p_column, int p_i return; config_err = config_err.word_wrap(80); warning->set_text(config_err); - warning->popup_centered_minsize(); + warning->popup_centered(); } else if (p_id == BUTTON_SIGNALS) { @@ -201,19 +201,19 @@ bool SceneTreeEditor::_add_nodes(Node *p_node, TreeItem *p_parent) { item->set_metadata(0, p_node->get_path()); if (connect_to_script_mode) { - Color accent = get_color("accent_color", "Editor"); + Color accent = get_theme_color("accent_color", "Editor"); Ref<Script> script = p_node->get_script(); if (!script.is_null() && EditorNode::get_singleton()->get_object_custom_type_base(p_node) != script) { //has script - item->add_button(0, get_icon("Script", "EditorIcons"), BUTTON_SCRIPT); + item->add_button(0, get_theme_icon("Script", "EditorIcons"), BUTTON_SCRIPT); } else { //has no script (or script is a custom type) - item->set_custom_color(0, get_color("disabled_font_color", "Editor")); + item->set_custom_color(0, get_theme_color("disabled_font_color", "Editor")); item->set_selectable(0, false); if (!script.is_null()) { // make sure to mark the script if a custom type - item->add_button(0, get_icon("Script", "EditorIcons"), BUTTON_SCRIPT); + item->add_button(0, get_theme_icon("Script", "EditorIcons"), BUTTON_SCRIPT); item->set_button_disabled(0, item->get_button_count(0) - 1, true); } @@ -231,7 +231,7 @@ bool SceneTreeEditor::_add_nodes(Node *p_node, TreeItem *p_parent) { } else if (part_of_subscene) { if (valid_types.size() == 0) { - item->set_custom_color(0, get_color("disabled_font_color", "Editor")); + item->set_custom_color(0, get_theme_color("disabled_font_color", "Editor")); } } else if (marked.has(p_node)) { @@ -241,14 +241,14 @@ bool SceneTreeEditor::_add_nodes(Node *p_node, TreeItem *p_parent) { } item->set_text(0, node_name); item->set_selectable(0, marked_selectable); - item->set_custom_color(0, get_color("accent_color", "Editor")); + item->set_custom_color(0, get_theme_color("accent_color", "Editor")); } else if (!marked_selectable && !marked_children_selectable) { Node *node = p_node; while (node) { if (marked.has(node)) { item->set_selectable(0, false); - item->set_custom_color(0, get_color("error_color", "Editor")); + item->set_custom_color(0, get_theme_color("error_color", "Editor")); break; } node = node->get_parent(); @@ -259,7 +259,7 @@ bool SceneTreeEditor::_add_nodes(Node *p_node, TreeItem *p_parent) { String warning = p_node->get_configuration_warning(); if (warning != String()) { - item->add_button(0, get_icon("NodeWarning", "EditorIcons"), BUTTON_WARNING, false, TTR("Node configuration warning:") + "\n" + p_node->get_configuration_warning()); + item->add_button(0, get_theme_icon("NodeWarning", "EditorIcons"), BUTTON_WARNING, false, TTR("Node configuration warning:") + "\n" + p_node->get_configuration_warning()); } int num_connections = p_node->get_persistent_signal_connection_count(); @@ -268,21 +268,21 @@ bool SceneTreeEditor::_add_nodes(Node *p_node, TreeItem *p_parent) { if (num_connections >= 1 && num_groups >= 1) { item->add_button( 0, - get_icon("SignalsAndGroups", "EditorIcons"), + get_theme_icon("SignalsAndGroups", "EditorIcons"), BUTTON_SIGNALS, false, vformat(TTR("Node has %s connection(s) and %s group(s).\nClick to show signals dock."), num_connections, num_groups)); } else if (num_connections >= 1) { item->add_button( 0, - get_icon("Signals", "EditorIcons"), + get_theme_icon("Signals", "EditorIcons"), BUTTON_SIGNALS, false, vformat(TTR("Node has %s connection(s).\nClick to show signals dock."), num_connections)); } else if (num_groups >= 1) { item->add_button( 0, - get_icon("Groups", "EditorIcons"), + get_theme_icon("Groups", "EditorIcons"), BUTTON_GROUPS, false, vformat(TTR("Node is in %s group(s).\nClick to show groups dock."), num_groups)); @@ -290,7 +290,7 @@ bool SceneTreeEditor::_add_nodes(Node *p_node, TreeItem *p_parent) { } if (p_node == get_scene_node() && p_node->get_scene_inherited_state().is_valid()) { - item->add_button(0, get_icon("InstanceOptions", "EditorIcons"), BUTTON_SUBSCENE, false, TTR("Open in Editor")); + item->add_button(0, get_theme_icon("InstanceOptions", "EditorIcons"), BUTTON_SUBSCENE, false, TTR("Open in Editor")); String tooltip = TTR("Inherits:") + " " + p_node->get_scene_inherited_state()->get_path() + "\n" + TTR("Type:") + " " + p_node->get_class(); if (p_node->get_editor_description() != String()) { @@ -299,7 +299,7 @@ bool SceneTreeEditor::_add_nodes(Node *p_node, TreeItem *p_parent) { item->set_tooltip(0, tooltip); } else if (p_node != get_scene_node() && p_node->get_filename() != "" && can_open_instance) { - item->add_button(0, get_icon("InstanceOptions", "EditorIcons"), BUTTON_SUBSCENE, false, TTR("Open in Editor")); + item->add_button(0, get_theme_icon("InstanceOptions", "EditorIcons"), BUTTON_SUBSCENE, false, TTR("Open in Editor")); String tooltip = TTR("Instance:") + " " + p_node->get_filename() + "\n" + TTR("Type:") + " " + p_node->get_class(); if (p_node->get_editor_description() != String()) { @@ -328,7 +328,7 @@ bool SceneTreeEditor::_add_nodes(Node *p_node, TreeItem *p_parent) { Ref<Script> script = p_node->get_script(); if (!script.is_null()) { - item->add_button(0, get_icon("Script", "EditorIcons"), BUTTON_SCRIPT, false, TTR("Open Script:") + " " + script->get_path()); + item->add_button(0, get_theme_icon("Script", "EditorIcons"), BUTTON_SCRIPT, false, TTR("Open Script:") + " " + script->get_path()); if (EditorNode::get_singleton()->get_object_custom_type_base(p_node) == script) { item->set_button_color(0, item->get_button_count(0) - 1, Color(1, 1, 1, 0.5)); } @@ -338,37 +338,37 @@ bool SceneTreeEditor::_add_nodes(Node *p_node, TreeItem *p_parent) { bool is_locked = p_node->has_meta("_edit_lock_"); //_edit_group_ if (is_locked) - item->add_button(0, get_icon("Lock", "EditorIcons"), BUTTON_LOCK, false, TTR("Node is locked.\nClick to unlock it.")); + item->add_button(0, get_theme_icon("Lock", "EditorIcons"), BUTTON_LOCK, false, TTR("Node is locked.\nClick to unlock it.")); bool is_grouped = p_node->has_meta("_edit_group_"); if (is_grouped) - item->add_button(0, get_icon("Group", "EditorIcons"), BUTTON_GROUP, false, TTR("Children are not selectable.\nClick to make selectable.")); + item->add_button(0, get_theme_icon("Group", "EditorIcons"), BUTTON_GROUP, false, TTR("Children are not selectable.\nClick to make selectable.")); bool v = p_node->call("is_visible"); if (v) - item->add_button(0, get_icon("GuiVisibilityVisible", "EditorIcons"), BUTTON_VISIBILITY, false, TTR("Toggle Visibility")); + item->add_button(0, get_theme_icon("GuiVisibilityVisible", "EditorIcons"), BUTTON_VISIBILITY, false, TTR("Toggle Visibility")); else - item->add_button(0, get_icon("GuiVisibilityHidden", "EditorIcons"), BUTTON_VISIBILITY, false, TTR("Toggle Visibility")); + item->add_button(0, get_theme_icon("GuiVisibilityHidden", "EditorIcons"), BUTTON_VISIBILITY, false, TTR("Toggle Visibility")); if (!p_node->is_connected("visibility_changed", callable_mp(this, &SceneTreeEditor::_node_visibility_changed))) p_node->connect("visibility_changed", callable_mp(this, &SceneTreeEditor::_node_visibility_changed), varray(p_node)); _update_visibility_color(p_node, item); - } else if (p_node->is_class("Spatial")) { + } else if (p_node->is_class("Node3D")) { bool is_locked = p_node->has_meta("_edit_lock_"); if (is_locked) - item->add_button(0, get_icon("Lock", "EditorIcons"), BUTTON_LOCK, false, TTR("Node is locked.\nClick to unlock it.")); + item->add_button(0, get_theme_icon("Lock", "EditorIcons"), BUTTON_LOCK, false, TTR("Node is locked.\nClick to unlock it.")); bool is_grouped = p_node->has_meta("_edit_group_"); if (is_grouped) - item->add_button(0, get_icon("Group", "EditorIcons"), BUTTON_GROUP, false, TTR("Children are not selectable.\nClick to make selectable.")); + item->add_button(0, get_theme_icon("Group", "EditorIcons"), BUTTON_GROUP, false, TTR("Children are not selectable.\nClick to make selectable.")); bool v = p_node->call("is_visible"); if (v) - item->add_button(0, get_icon("GuiVisibilityVisible", "EditorIcons"), BUTTON_VISIBILITY, false, TTR("Toggle Visibility")); + item->add_button(0, get_theme_icon("GuiVisibilityVisible", "EditorIcons"), BUTTON_VISIBILITY, false, TTR("Toggle Visibility")); else - item->add_button(0, get_icon("GuiVisibilityHidden", "EditorIcons"), BUTTON_VISIBILITY, false, TTR("Toggle Visibility")); + item->add_button(0, get_theme_icon("GuiVisibilityHidden", "EditorIcons"), BUTTON_VISIBILITY, false, TTR("Toggle Visibility")); if (!p_node->is_connected("visibility_changed", callable_mp(this, &SceneTreeEditor::_node_visibility_changed))) p_node->connect("visibility_changed", callable_mp(this, &SceneTreeEditor::_node_visibility_changed), varray(p_node)); @@ -379,7 +379,7 @@ bool SceneTreeEditor::_add_nodes(Node *p_node, TreeItem *p_parent) { bool is_pinned = AnimationPlayerEditor::singleton->get_player() == p_node && AnimationPlayerEditor::singleton->is_pinned(); if (is_pinned) { - item->add_button(0, get_icon("Pin", "EditorIcons"), BUTTON_PIN, false, TTR("AnimationPlayer is pinned.\nClick to unpin.")); + item->add_button(0, get_theme_icon("Pin", "EditorIcons"), BUTTON_PIN, false, TTR("AnimationPlayer is pinned.\nClick to unpin.")); } } } @@ -417,7 +417,7 @@ bool SceneTreeEditor::_add_nodes(Node *p_node, TreeItem *p_parent) { if (!valid) { //item->set_selectable(0,marked_selectable); - item->set_custom_color(0, get_color("disabled_font_color", "Editor")); + item->set_custom_color(0, get_theme_color("disabled_font_color", "Editor")); item->set_selectable(0, false); } } @@ -457,20 +457,20 @@ void SceneTreeEditor::_node_visibility_changed(Node *p_node) { if (p_node->is_class("CanvasItem")) { visible = p_node->call("is_visible"); CanvasItemEditor::get_singleton()->get_viewport_control()->update(); - } else if (p_node->is_class("Spatial")) { + } else if (p_node->is_class("Node3D")) { visible = p_node->call("is_visible"); } if (visible) - item->set_button(0, idx, get_icon("GuiVisibilityVisible", "EditorIcons")); + item->set_button(0, idx, get_theme_icon("GuiVisibilityVisible", "EditorIcons")); else - item->set_button(0, idx, get_icon("GuiVisibilityHidden", "EditorIcons")); + item->set_button(0, idx, get_theme_icon("GuiVisibilityHidden", "EditorIcons")); _update_visibility_color(p_node, item); } void SceneTreeEditor::_update_visibility_color(Node *p_node, TreeItem *p_item) { - if (p_node->is_class("CanvasItem") || p_node->is_class("Spatial")) { + if (p_node->is_class("CanvasItem") || p_node->is_class("Node3D")) { Color color(1, 1, 1, 1); bool visible_on_screen = p_node->call("is_visible_in_tree"); if (!visible_on_screen) { @@ -498,13 +498,13 @@ void SceneTreeEditor::_node_removed(Node *p_node) { if (p_node->is_connected("script_changed", callable_mp(this, &SceneTreeEditor::_node_script_changed))) p_node->disconnect("script_changed", callable_mp(this, &SceneTreeEditor::_node_script_changed)); - if (p_node->is_class("Spatial") || p_node->is_class("CanvasItem")) { + if (p_node->is_class("Node3D") || p_node->is_class("CanvasItem")) { if (p_node->is_connected("visibility_changed", callable_mp(this, &SceneTreeEditor::_node_visibility_changed))) p_node->disconnect("visibility_changed", callable_mp(this, &SceneTreeEditor::_node_visibility_changed)); } if (p_node == selected) { - selected = NULL; + selected = nullptr; emit_signal("node_selected"); } } @@ -529,7 +529,7 @@ void SceneTreeEditor::_update_tree() { updating_tree = true; tree->clear(); if (get_scene_node()) { - _add_nodes(get_scene_node(), NULL); + _add_nodes(get_scene_node(), nullptr); last_hash = hash_djb2_one_64(0); _compute_hash(get_scene_node(), last_hash); } @@ -667,7 +667,7 @@ void SceneTreeEditor::_notification(int p_what) { TreeItem *SceneTreeEditor::_find(TreeItem *p_node, const NodePath &p_path) { if (!p_node) - return NULL; + return nullptr; NodePath np = p_node->get_metadata(0); if (np == p_path) @@ -682,7 +682,7 @@ TreeItem *SceneTreeEditor::_find(TreeItem *p_node, const NodePath &p_path) { children = children->get_next(); } - return NULL; + return nullptr; } void SceneTreeEditor::set_selected(Node *p_node, bool p_emit_selected) { @@ -697,7 +697,7 @@ void SceneTreeEditor::set_selected(Node *p_node, bool p_emit_selected) { if (selected == p_node) return; - TreeItem *item = p_node ? _find(tree->get_root(), p_node->get_path()) : NULL; + TreeItem *item = p_node ? _find(tree->get_root(), p_node->get_path()) : nullptr; if (item) { // make visible when it's collapsed @@ -713,7 +713,7 @@ void SceneTreeEditor::set_selected(Node *p_node, bool p_emit_selected) { } else { if (!p_node) - selected = NULL; + selected = nullptr; _update_tree(); selected = p_node; } @@ -757,7 +757,7 @@ void SceneTreeEditor::_renamed() { if (!Node::_validate_node_name(new_name)) { error->set_text(TTR("Invalid node name, the following characters are not allowed:") + "\n" + Node::invalid_character); - error->popup_centered_minsize(); + error->popup_centered(); if (new_name.empty()) { which->set_text(0, n->get_name()); @@ -906,7 +906,7 @@ Variant SceneTreeEditor::get_drag_data_fw(const Point2 &p_point, Control *p_from Vector<Node *> selected; Vector<Ref<Texture2D>> icons; - TreeItem *next = tree->get_next_selected(NULL); + TreeItem *next = tree->get_next_selected(nullptr); while (next) { NodePath np = next->get_metadata(0); @@ -1117,16 +1117,16 @@ SceneTreeEditor::SceneTreeEditor(bool p_label, bool p_can_rename, bool p_can_ope connect_to_script_mode = false; connecting_signal = false; - undo_redo = NULL; + undo_redo = nullptr; tree_dirty = true; - selected = NULL; + selected = nullptr; marked_selectable = false; marked_children_selectable = false; can_rename = p_can_rename; can_open_instance = p_can_open_instance; display_foreign = false; - editor_selection = NULL; + editor_selection = nullptr; if (p_label) { Label *label = memnew(Label); @@ -1141,7 +1141,7 @@ SceneTreeEditor::SceneTreeEditor(bool p_label, bool p_can_rename, bool p_can_ope tree->set_anchor(MARGIN_BOTTOM, ANCHOR_END); tree->set_begin(Point2(0, p_label ? 18 : 0)); tree->set_end(Point2(0, 0)); - tree->add_constant_override("button_margin", 0); + tree->add_theme_constant_override("button_margin", 0); add_child(tree); @@ -1193,18 +1193,19 @@ SceneTreeEditor::~SceneTreeEditor() { void SceneTreeDialog::_notification(int p_what) { switch (p_what) { + case NOTIFICATION_VISIBILITY_CHANGED: { + + if (is_visible()) + tree->update_tree(); + } break; case NOTIFICATION_ENTER_TREE: { connect("confirmed", callable_mp(this, &SceneTreeDialog::_select)); - filter->set_right_icon(get_icon("Search", "EditorIcons")); + filter->set_right_icon(tree->get_theme_icon("Search", "EditorIcons")); filter->set_clear_button_enabled(true); } break; case NOTIFICATION_EXIT_TREE: { disconnect("confirmed", callable_mp(this, &SceneTreeDialog::_select)); } break; - case NOTIFICATION_VISIBILITY_CHANGED: { - if (is_visible_in_tree()) - tree->update_tree(); - } break; } } @@ -1239,14 +1240,14 @@ SceneTreeDialog::SceneTreeDialog() { add_child(vbc); filter = memnew(LineEdit); - filter->set_h_size_flags(SIZE_EXPAND_FILL); + filter->set_h_size_flags(Control::SIZE_EXPAND_FILL); filter->set_placeholder(TTR("Filter nodes")); - filter->add_constant_override("minimum_spaces", 0); + filter->add_theme_constant_override("minimum_spaces", 0); filter->connect("text_changed", callable_mp(this, &SceneTreeDialog::_filter_changed)); vbc->add_child(filter); tree = memnew(SceneTreeEditor(false, false, true)); - tree->set_v_size_flags(SIZE_EXPAND_FILL); + tree->set_v_size_flags(Control::SIZE_EXPAND_FILL); tree->get_scene_tree()->connect("item_activated", callable_mp(this, &SceneTreeDialog::_select)); vbc->add_child(tree); } diff --git a/editor/script_create_dialog.cpp b/editor/script_create_dialog.cpp index 5a111afe32..12b21d871b 100644 --- a/editor/script_create_dialog.cpp +++ b/editor/script_create_dialog.cpp @@ -40,36 +40,38 @@ #include "editor/editor_scale.h" #include "editor_file_system.h" -void ScriptCreateDialog::_notification(int p_what) { +void ScriptCreateDialog::_theme_changed() { + for (int i = 0; i < ScriptServer::get_language_count(); i++) { + String lang = ScriptServer::get_language(i)->get_type(); + Ref<Texture2D> lang_icon = gc->get_theme_icon(lang, "EditorIcons"); + if (lang_icon.is_valid()) { + language_menu->set_item_icon(i, lang_icon); + } + } - switch (p_what) { - case NOTIFICATION_THEME_CHANGED: - case NOTIFICATION_ENTER_TREE: { - for (int i = 0; i < ScriptServer::get_language_count(); i++) { - String lang = ScriptServer::get_language(i)->get_type(); - Ref<Texture2D> lang_icon = get_icon(lang, "EditorIcons"); - if (lang_icon.is_valid()) { - language_menu->set_item_icon(i, lang_icon); - } + String last_lang = EditorSettings::get_singleton()->get_project_metadata("script_setup", "last_selected_language", ""); + if (!last_lang.empty()) { + for (int i = 0; i < language_menu->get_item_count(); i++) { + if (language_menu->get_item_text(i) == last_lang) { + language_menu->select(i); + current_language = i; + break; } + } + } else { + language_menu->select(default_language); + } - String last_lang = EditorSettings::get_singleton()->get_project_metadata("script_setup", "last_selected_language", ""); - if (!last_lang.empty()) { - for (int i = 0; i < language_menu->get_item_count(); i++) { - if (language_menu->get_item_text(i) == last_lang) { - language_menu->select(i); - current_language = i; - break; - } - } - } else { - language_menu->select(default_language); - } + path_button->set_icon(gc->get_theme_icon("Folder", "EditorIcons")); + parent_browse_button->set_icon(gc->get_theme_icon("Folder", "EditorIcons")); + parent_search_button->set_icon(gc->get_theme_icon("ClassList", "EditorIcons")); + status_panel->add_theme_style_override("panel", gc->get_theme_stylebox("bg", "Tree")); +} +void ScriptCreateDialog::_notification(int p_what) { - path_button->set_icon(get_icon("Folder", "EditorIcons")); - parent_browse_button->set_icon(get_icon("Folder", "EditorIcons")); - parent_search_button->set_icon(get_icon("ClassList", "EditorIcons")); - status_panel->add_style_override("panel", get_stylebox("bg", "Tree")); + switch (p_what) { + case NOTIFICATION_ENTER_TREE: { + _theme_changed(); } break; } } @@ -442,7 +444,7 @@ void ScriptCreateDialog::_lang_changed(int l) { override_info += ", "; } } - template_menu->set_item_icon(extended.id, get_icon("Override", "EditorIcons")); + template_menu->set_item_icon(extended.id, gc->get_theme_icon("Override", "EditorIcons")); template_menu->get_popup()->set_item_tooltip(extended.id, override_info.as_string()); } // Reselect last selected template @@ -517,11 +519,11 @@ void ScriptCreateDialog::_browse_path(bool browse_parent, bool p_save) { is_browsing_parent = browse_parent; if (p_save) { - file_browse->set_mode(EditorFileDialog::MODE_SAVE_FILE); + file_browse->set_file_mode(EditorFileDialog::FILE_MODE_SAVE_FILE); file_browse->set_title(TTR("Open Script / Choose Location")); file_browse->get_ok()->set_text(TTR("Open")); } else { - file_browse->set_mode(EditorFileDialog::MODE_OPEN_FILE); + file_browse->set_file_mode(EditorFileDialog::FILE_MODE_OPEN_FILE); file_browse->set_title(TTR("Open Script")); } @@ -607,9 +609,9 @@ void ScriptCreateDialog::_msg_script_valid(bool valid, const String &p_msg) { error_label->set_text("- " + TTR(p_msg)); if (valid) { - error_label->add_color_override("font_color", get_color("success_color", "Editor")); + error_label->add_theme_color_override("font_color", gc->get_theme_color("success_color", "Editor")); } else { - error_label->add_color_override("font_color", get_color("error_color", "Editor")); + error_label->add_theme_color_override("font_color", gc->get_theme_color("error_color", "Editor")); } } @@ -617,9 +619,9 @@ void ScriptCreateDialog::_msg_path_valid(bool valid, const String &p_msg) { path_error_label->set_text("- " + TTR(p_msg)); if (valid) { - path_error_label->add_color_override("font_color", get_color("success_color", "Editor")); + path_error_label->add_theme_color_override("font_color", gc->get_theme_color("success_color", "Editor")); } else { - path_error_label->add_color_override("font_color", get_color("error_color", "Editor")); + path_error_label->add_theme_color_override("font_color", gc->get_theme_color("error_color", "Editor")); } } @@ -687,6 +689,8 @@ void ScriptCreateDialog::_update_dialog() { // Is Script created or loaded from existing file? + builtin_warning_label->set_visible(is_built_in); + if (is_built_in) { get_ok()->set_text(TTR("Create")); parent_name->set_editable(true); @@ -739,9 +743,11 @@ ScriptCreateDialog::ScriptCreateDialog() { /* Main Controls */ - GridContainer *gc = memnew(GridContainer); + gc = memnew(GridContainer); gc->set_columns(2); + gc->connect("theme_changed", callable_mp(this, &ScriptCreateDialog::_theme_changed)); + /* Error Messages Field */ VBoxContainer *vb = memnew(VBoxContainer); @@ -752,6 +758,13 @@ ScriptCreateDialog::ScriptCreateDialog() { path_error_label = memnew(Label); vb->add_child(path_error_label); + builtin_warning_label = memnew(Label); + builtin_warning_label->set_text( + TTR("Note: Built-in scripts have some limitations and can't be edited using an external editor.")); + vb->add_child(builtin_warning_label); + builtin_warning_label->set_autowrap(true); + builtin_warning_label->hide(); + status_panel = memnew(PanelContainer); status_panel->set_h_size_flags(Control::SIZE_FILL); status_panel->add_child(vb); @@ -774,7 +787,7 @@ ScriptCreateDialog::ScriptCreateDialog() { language_menu = memnew(OptionButton); language_menu->set_custom_minimum_size(Size2(250, 0) * EDSCALE); - language_menu->set_h_size_flags(SIZE_EXPAND_FILL); + language_menu->set_h_size_flags(Control::SIZE_EXPAND_FILL); gc->add_child(memnew(Label(TTR("Language:")))); gc->add_child(language_menu); @@ -798,10 +811,10 @@ ScriptCreateDialog::ScriptCreateDialog() { base_type = "Object"; hb = memnew(HBoxContainer); - hb->set_h_size_flags(SIZE_EXPAND_FILL); + hb->set_h_size_flags(Control::SIZE_EXPAND_FILL); parent_name = memnew(LineEdit); parent_name->connect("text_changed", callable_mp(this, &ScriptCreateDialog::_parent_name_changed)); - parent_name->set_h_size_flags(SIZE_EXPAND_FILL); + parent_name->set_h_size_flags(Control::SIZE_EXPAND_FILL); hb->add_child(parent_name); parent_search_button = memnew(Button); parent_search_button->set_flat(true); @@ -819,7 +832,7 @@ ScriptCreateDialog::ScriptCreateDialog() { class_name = memnew(LineEdit); class_name->connect("text_changed", callable_mp(this, &ScriptCreateDialog::_class_name_changed)); - class_name->set_h_size_flags(SIZE_EXPAND_FILL); + class_name->set_h_size_flags(Control::SIZE_EXPAND_FILL); gc->add_child(memnew(Label(TTR("Class Name:")))); gc->add_child(class_name); @@ -845,7 +858,7 @@ ScriptCreateDialog::ScriptCreateDialog() { file_path = memnew(LineEdit); file_path->connect("text_changed", callable_mp(this, &ScriptCreateDialog::_path_changed)); file_path->connect("text_entered", callable_mp(this, &ScriptCreateDialog::_path_entered)); - file_path->set_h_size_flags(SIZE_EXPAND_FILL); + file_path->set_h_size_flags(Control::SIZE_EXPAND_FILL); hb->add_child(file_path); path_button = memnew(Button); path_button->set_flat(true); @@ -863,18 +876,16 @@ ScriptCreateDialog::ScriptCreateDialog() { file_browse = memnew(EditorFileDialog); file_browse->connect("file_selected", callable_mp(this, &ScriptCreateDialog::_file_selected)); - file_browse->set_mode(EditorFileDialog::MODE_OPEN_FILE); + file_browse->set_file_mode(EditorFileDialog::FILE_MODE_OPEN_FILE); add_child(file_browse); get_ok()->set_text(TTR("Create")); alert = memnew(AcceptDialog); - alert->set_as_minsize(); alert->get_label()->set_autowrap(true); alert->get_label()->set_align(Label::ALIGN_CENTER); alert->get_label()->set_valign(Label::VALIGN_CENTER); alert->get_label()->set_custom_minimum_size(Size2(325, 60) * EDSCALE); add_child(alert); - set_as_minsize(); set_hide_on_ok(false); set_title(TTR("Attach Node Script")); diff --git a/editor/script_create_dialog.h b/editor/script_create_dialog.h index f73309c373..63a30eba88 100644 --- a/editor/script_create_dialog.h +++ b/editor/script_create_dialog.h @@ -45,9 +45,11 @@ class CreateDialog; class ScriptCreateDialog : public ConfirmationDialog { GDCLASS(ScriptCreateDialog, ConfirmationDialog); + GridContainer *gc; LineEdit *class_name; Label *error_label; Label *path_error_label; + Label *builtin_warning_label; PanelContainer *status_panel; LineEdit *parent_name; Button *parent_browse_button; @@ -123,6 +125,7 @@ class ScriptCreateDialog : public ConfirmationDialog { void _update_dialog(); protected: + void _theme_changed(); void _notification(int p_what); static void _bind_methods(); diff --git a/editor/settings_config_dialog.cpp b/editor/settings_config_dialog.cpp index cf93fab9a8..8910e8ec3a 100644 --- a/editor/settings_config_dialog.cpp +++ b/editor/settings_config_dialog.cpp @@ -118,18 +118,20 @@ void EditorSettingsDialog::_undo_redo_callback(void *p_self, const String &p_nam void EditorSettingsDialog::_notification(int p_what) { switch (p_what) { + case NOTIFICATION_VISIBILITY_CHANGED: { + if (!is_visible()) { + EditorSettings::get_singleton()->set_project_metadata("dialog_bounds", "editor_settings", Rect2(get_position(), get_size())); + set_process_unhandled_input(false); + } + } break; case NOTIFICATION_READY: { - undo_redo->set_method_notify_callback(EditorDebuggerNode::_method_changeds, NULL); - undo_redo->set_property_notify_callback(EditorDebuggerNode::_property_changeds, NULL); + undo_redo->set_method_notify_callback(EditorDebuggerNode::_method_changeds, nullptr); + undo_redo->set_property_notify_callback(EditorDebuggerNode::_property_changeds, nullptr); undo_redo->set_commit_notify_callback(_undo_redo_callback, this); } break; case NOTIFICATION_ENTER_TREE: { _update_icons(); } break; - case NOTIFICATION_POPUP_HIDE: { - EditorSettings::get_singleton()->set_project_metadata("dialog_bounds", "editor_settings", get_rect()); - set_process_unhandled_input(false); - } break; case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: { _update_icons(); // Update theme colors. @@ -143,7 +145,7 @@ void EditorSettingsDialog::_unhandled_input(const Ref<InputEvent> &p_event) { const Ref<InputEventKey> k = p_event; - if (k.is_valid() && is_window_modal_on_top() && k->is_pressed()) { + if (k.is_valid() && k->is_pressed()) { bool handled = false; @@ -169,22 +171,22 @@ void EditorSettingsDialog::_unhandled_input(const Ref<InputEvent> &p_event) { } if (handled) { - accept_event(); + set_input_as_handled(); } } } void EditorSettingsDialog::_update_icons() { - search_box->set_right_icon(get_icon("Search", "EditorIcons")); + search_box->set_right_icon(shortcuts->get_theme_icon("Search", "EditorIcons")); search_box->set_clear_button_enabled(true); - shortcut_search_box->set_right_icon(get_icon("Search", "EditorIcons")); + shortcut_search_box->set_right_icon(shortcuts->get_theme_icon("Search", "EditorIcons")); shortcut_search_box->set_clear_button_enabled(true); - restart_close_button->set_icon(get_icon("Close", "EditorIcons")); - restart_container->add_style_override("panel", get_stylebox("bg", "Tree")); - restart_icon->set_texture(get_icon("StatusWarning", "EditorIcons")); - restart_label->add_color_override("font_color", get_color("warning_color", "Editor")); + restart_close_button->set_icon(shortcuts->get_theme_icon("Close", "EditorIcons")); + restart_container->add_theme_style_override("panel", shortcuts->get_theme_stylebox("bg", "Tree")); + restart_icon->set_texture(shortcuts->get_theme_icon("StatusWarning", "EditorIcons")); + restart_label->add_theme_color_override("font_color", shortcuts->get_theme_color("warning_color", "Editor")); } void EditorSettingsDialog::_update_shortcuts() { @@ -230,8 +232,8 @@ void EditorSettingsDialog::_update_shortcuts() { } sections[section_name] = section; - section->set_custom_bg_color(0, get_color("prop_subsection", "Editor")); - section->set_custom_bg_color(1, get_color("prop_subsection", "Editor")); + section->set_custom_bg_color(0, shortcuts->get_theme_color("prop_subsection", "Editor")); + section->set_custom_bg_color(1, shortcuts->get_theme_color("prop_subsection", "Editor")); } // Don't match unassigned shortcuts when searching for assigned keys in search results. @@ -243,16 +245,16 @@ void EditorSettingsDialog::_update_shortcuts() { item->set_text(1, sc->get_as_text()); if (!sc->is_shortcut(original) && !(sc->get_shortcut().is_null() && original.is_null())) { - item->add_button(1, get_icon("Reload", "EditorIcons"), 2); + item->add_button(1, shortcuts->get_theme_icon("Reload", "EditorIcons"), 2); } if (sc->get_as_text() == "None") { // Fade out unassigned shortcut labels for easier visual grepping. - item->set_custom_color(1, get_color("font_color", "Label") * Color(1, 1, 1, 0.5)); + item->set_custom_color(1, shortcuts->get_theme_color("font_color", "Label") * Color(1, 1, 1, 0.5)); } - item->add_button(1, get_icon("Edit", "EditorIcons"), 0); - item->add_button(1, get_icon("Close", "EditorIcons"), 1); + item->add_button(1, shortcuts->get_theme_icon("Edit", "EditorIcons"), 0); + item->add_button(1, shortcuts->get_theme_icon("Close", "EditorIcons"), 1); item->set_tooltip(0, E->get()); item->set_metadata(0, E->get()); } @@ -261,7 +263,7 @@ void EditorSettingsDialog::_update_shortcuts() { // remove sections with no shortcuts for (Map<String, TreeItem *>::Element *E = sections.front(); E; E = E->next()) { TreeItem *section = E->get(); - if (section->get_children() == NULL) { + if (section->get_children() == nullptr) { root->remove_child(section); } } @@ -279,9 +281,9 @@ void EditorSettingsDialog::_shortcut_button_pressed(Object *p_item, int p_column press_a_key_label->set_text(TTR("Press a Key...")); last_wait_for_key = Ref<InputEventKey>(); press_a_key->popup_centered(Size2(250, 80) * EDSCALE); - press_a_key->grab_focus(); - press_a_key->get_ok()->set_focus_mode(FOCUS_NONE); - press_a_key->get_cancel()->set_focus_mode(FOCUS_NONE); + //press_a_key->grab_focus(); + press_a_key->get_ok()->set_focus_mode(Control::FOCUS_NONE); + press_a_key->get_cancel()->set_focus_mode(Control::FOCUS_NONE); shortcut_configured = item; } else if (p_idx == 1) { //erase @@ -323,7 +325,7 @@ void EditorSettingsDialog::_wait_for_key(const Ref<InputEvent> &p_event) { const String str = keycode_get_string(k->get_keycode_with_modifiers()); press_a_key_label->set_text(str); - press_a_key->accept_event(); + press_a_key->set_input_as_handled(); } } @@ -360,7 +362,7 @@ void EditorSettingsDialog::_tabs_tab_changed(int p_tab) { void EditorSettingsDialog::_focus_current_search_box() { Control *tab = tabs->get_current_tab_control(); - LineEdit *current_search_box = NULL; + LineEdit *current_search_box = nullptr; if (tab == tab_general) current_search_box = search_box; else if (tab == tab_shortcuts) @@ -394,7 +396,7 @@ void EditorSettingsDialog::_bind_methods() { EditorSettingsDialog::EditorSettingsDialog() { set_title(TTR("Editor Settings")); - set_resizable(true); + undo_redo = memnew(UndoRedo); tabs = memnew(TabContainer); @@ -430,7 +432,7 @@ EditorSettingsDialog::EditorSettingsDialog() { HBoxContainer *restart_hb = memnew(HBoxContainer); restart_container->add_child(restart_hb); restart_icon = memnew(TextureRect); - restart_icon->set_v_size_flags(SIZE_SHRINK_CENTER); + restart_icon->set_v_size_flags(Control::SIZE_SHRINK_CENTER); restart_hb->add_child(restart_icon); restart_label = memnew(Label); restart_label->set_text(TTR("The editor must be restarted for changes to take effect.")); @@ -462,7 +464,7 @@ EditorSettingsDialog::EditorSettingsDialog() { shortcuts = memnew(Tree); tab_shortcuts->add_child(shortcuts, true); - shortcuts->set_v_size_flags(SIZE_EXPAND_FILL); + shortcuts->set_v_size_flags(Control::SIZE_EXPAND_FILL); shortcuts->set_columns(2); shortcuts->set_hide_root(true); shortcuts->set_column_titles_visible(true); @@ -471,7 +473,7 @@ EditorSettingsDialog::EditorSettingsDialog() { shortcuts->connect("button_pressed", callable_mp(this, &EditorSettingsDialog::_shortcut_button_pressed)); press_a_key = memnew(ConfirmationDialog); - press_a_key->set_focus_mode(FOCUS_ALL); + //press_a_key->set_focus_mode(Control::FOCUS_ALL); add_child(press_a_key); Label *l = memnew(Label); @@ -479,10 +481,10 @@ EditorSettingsDialog::EditorSettingsDialog() { l->set_anchors_and_margins_preset(Control::PRESET_WIDE); l->set_align(Label::ALIGN_CENTER); l->set_margin(MARGIN_TOP, 20); - l->set_anchor_and_margin(MARGIN_BOTTOM, ANCHOR_BEGIN, 30); + l->set_anchor_and_margin(MARGIN_BOTTOM, Control::ANCHOR_BEGIN, 30); press_a_key_label = l; press_a_key->add_child(l); - press_a_key->connect("gui_input", callable_mp(this, &EditorSettingsDialog::_wait_for_key)); + press_a_key->connect("window_input", callable_mp(this, &EditorSettingsDialog::_wait_for_key)); press_a_key->connect("confirmed", callable_mp(this, &EditorSettingsDialog::_press_a_key_confirm)); set_hide_on_ok(true); diff --git a/editor/shader_globals_editor.cpp b/editor/shader_globals_editor.cpp new file mode 100644 index 0000000000..566ac54612 --- /dev/null +++ b/editor/shader_globals_editor.cpp @@ -0,0 +1,452 @@ +#include "shader_globals_editor.h" +#include "editor_node.h" + +static const char *global_var_type_names[RS::GLOBAL_VAR_TYPE_MAX] = { + "bool", + "bvec2", + "bvec3", + "bvec4", + "int", + "ivec2", + "ivec3", + "ivec4", + "rect2i", + "uint", + "uvec2", + "uvec3", + "uvec4", + "float", + "vec2", + "vec3", + "vec4", + "color", + "rect2", + "mat2", + "mat3", + "mat4", + "transform_2d", + "transform", + "sampler2D", + "sampler2DArray", + "sampler3D", + "samplerCube", +}; + +class ShaderGlobalsEditorInterface : public Object { + GDCLASS(ShaderGlobalsEditorInterface, Object) + + void _var_changed() { + emit_signal("var_changed"); + } + +protected: + static void _bind_methods() { + ClassDB::bind_method("_var_changed", &ShaderGlobalsEditorInterface::_var_changed); + ADD_SIGNAL(MethodInfo("var_changed")); + } + + bool _set(const StringName &p_name, const Variant &p_value) { + Variant existing = RS::get_singleton()->global_variable_get(p_name); + + if (existing.get_type() == Variant::NIL) { + return false; + } + + UndoRedo *undo_redo = EditorNode::get_singleton()->get_undo_redo(); + + undo_redo->create_action("Set Shader Global Variable"); + undo_redo->add_do_method(RS::get_singleton(), "global_variable_set", p_name, p_value); + undo_redo->add_undo_method(RS::get_singleton(), "global_variable_set", p_name, existing); + RS::GlobalVariableType type = RS::get_singleton()->global_variable_get_type(p_name); + Dictionary gv; + gv["type"] = global_var_type_names[type]; + if (type >= RS::GLOBAL_VAR_TYPE_SAMPLER2D) { + RES res = p_value; + if (res.is_valid()) { + gv["value"] = res->get_path(); + } else { + gv["value"] = ""; + } + } else { + gv["value"] = p_value; + } + + String path = "shader_globals/" + String(p_name); + undo_redo->add_do_property(ProjectSettings::get_singleton(), path, gv); + undo_redo->add_undo_property(ProjectSettings::get_singleton(), path, ProjectSettings::get_singleton()->get(path)); + undo_redo->add_do_method(this, "_var_changed"); + undo_redo->add_undo_method(this, "_var_changed"); + block_update = true; + undo_redo->commit_action(); + block_update = false; + + print_line("all good?"); + return true; + } + + bool _get(const StringName &p_name, Variant &r_ret) const { + r_ret = RS::get_singleton()->global_variable_get(p_name); + return r_ret.get_type() != Variant::NIL; + } + void _get_property_list(List<PropertyInfo> *p_list) const { + Vector<StringName> variables; + variables = RS::get_singleton()->global_variable_get_list(); + for (int i = 0; i < variables.size(); i++) { + PropertyInfo pinfo; + pinfo.name = variables[i]; + + switch (RS::get_singleton()->global_variable_get_type(variables[i])) { + case RS::GLOBAL_VAR_TYPE_BOOL: { + pinfo.type = Variant::BOOL; + } break; + case RS::GLOBAL_VAR_TYPE_BVEC2: { + pinfo.type = Variant::INT; + pinfo.hint = PROPERTY_HINT_FLAGS; + pinfo.hint_string = "x,y"; + } break; + case RS::GLOBAL_VAR_TYPE_BVEC3: { + pinfo.type = Variant::INT; + pinfo.hint = PROPERTY_HINT_FLAGS; + pinfo.hint_string = "x,y,z"; + } break; + case RS::GLOBAL_VAR_TYPE_BVEC4: { + pinfo.type = Variant::INT; + pinfo.hint = PROPERTY_HINT_FLAGS; + pinfo.hint_string = "x,y,z,w"; + } break; + case RS::GLOBAL_VAR_TYPE_INT: { + pinfo.type = Variant::INT; + } break; + case RS::GLOBAL_VAR_TYPE_IVEC2: { + pinfo.type = Variant::VECTOR2I; + } break; + case RS::GLOBAL_VAR_TYPE_IVEC3: { + pinfo.type = Variant::VECTOR3I; + } break; + case RS::GLOBAL_VAR_TYPE_IVEC4: { + pinfo.type = Variant::PACKED_INT32_ARRAY; + } break; + case RS::GLOBAL_VAR_TYPE_RECT2I: { + pinfo.type = Variant::RECT2I; + } break; + case RS::GLOBAL_VAR_TYPE_UINT: { + pinfo.type = Variant::INT; + } break; + case RS::GLOBAL_VAR_TYPE_UVEC2: { + pinfo.type = Variant::VECTOR2I; + } break; + case RS::GLOBAL_VAR_TYPE_UVEC3: { + pinfo.type = Variant::VECTOR3I; + } break; + case RS::GLOBAL_VAR_TYPE_UVEC4: { + pinfo.type = Variant::PACKED_INT32_ARRAY; + } break; + case RS::GLOBAL_VAR_TYPE_FLOAT: { + pinfo.type = Variant::FLOAT; + } break; + case RS::GLOBAL_VAR_TYPE_VEC2: { + pinfo.type = Variant::VECTOR2; + } break; + case RS::GLOBAL_VAR_TYPE_VEC3: { + pinfo.type = Variant::VECTOR3; + } break; + case RS::GLOBAL_VAR_TYPE_VEC4: { + pinfo.type = Variant::PLANE; + } break; + case RS::GLOBAL_VAR_TYPE_RECT2: { + pinfo.type = Variant::RECT2; + } break; + case RS::GLOBAL_VAR_TYPE_COLOR: { + pinfo.type = Variant::COLOR; + } break; + case RS::GLOBAL_VAR_TYPE_MAT2: { + pinfo.type = Variant::PACKED_INT32_ARRAY; + } break; + case RS::GLOBAL_VAR_TYPE_MAT3: { + pinfo.type = Variant::BASIS; + } break; + case RS::GLOBAL_VAR_TYPE_TRANSFORM_2D: { + pinfo.type = Variant::TRANSFORM2D; + } break; + case RS::GLOBAL_VAR_TYPE_TRANSFORM: { + pinfo.type = Variant::TRANSFORM; + } break; + case RS::GLOBAL_VAR_TYPE_MAT4: { + pinfo.type = Variant::PACKED_INT32_ARRAY; + } break; + case RS::GLOBAL_VAR_TYPE_SAMPLER2D: { + pinfo.type = Variant::OBJECT; + pinfo.hint = PROPERTY_HINT_RESOURCE_TYPE; + pinfo.hint_string = "Texture2D"; + } break; + case RS::GLOBAL_VAR_TYPE_SAMPLER2DARRAY: { + pinfo.type = Variant::OBJECT; + pinfo.hint = PROPERTY_HINT_RESOURCE_TYPE; + pinfo.hint_string = "Texture2DArray"; + } break; + case RS::GLOBAL_VAR_TYPE_SAMPLER3D: { + pinfo.type = Variant::OBJECT; + pinfo.hint = PROPERTY_HINT_RESOURCE_TYPE; + pinfo.hint_string = "Texture3D"; + } break; + case RS::GLOBAL_VAR_TYPE_SAMPLERCUBE: { + pinfo.type = Variant::OBJECT; + pinfo.hint = PROPERTY_HINT_RESOURCE_TYPE; + pinfo.hint_string = "Cubemap"; + } break; + default: { + + } break; + } + + p_list->push_back(pinfo); + } + } + +public: + bool block_update = false; + + ShaderGlobalsEditorInterface() { + } +}; + +static Variant create_var(RS::GlobalVariableType p_type) { + switch (p_type) { + case RS::GLOBAL_VAR_TYPE_BOOL: { + return false; + } + case RS::GLOBAL_VAR_TYPE_BVEC2: { + return 0; //bits + } + case RS::GLOBAL_VAR_TYPE_BVEC3: { + return 0; //bits + } + case RS::GLOBAL_VAR_TYPE_BVEC4: { + return 0; //bits + } + case RS::GLOBAL_VAR_TYPE_INT: { + return 0; //bits + } + case RS::GLOBAL_VAR_TYPE_IVEC2: { + return Vector2i(); + } + case RS::GLOBAL_VAR_TYPE_IVEC3: { + return Vector3i(); + } + case RS::GLOBAL_VAR_TYPE_IVEC4: { + Vector<int> v4; + v4.resize(4); + v4.write[0] = 0; + v4.write[1] = 0; + v4.write[2] = 0; + v4.write[3] = 0; + return v4; + } + case RS::GLOBAL_VAR_TYPE_RECT2I: { + return Rect2i(); + } + case RS::GLOBAL_VAR_TYPE_UINT: { + return 0; + } + case RS::GLOBAL_VAR_TYPE_UVEC2: { + return Vector2i(); + } + case RS::GLOBAL_VAR_TYPE_UVEC3: { + return Vector3i(); + } + case RS::GLOBAL_VAR_TYPE_UVEC4: { + return Rect2i(); + } + case RS::GLOBAL_VAR_TYPE_FLOAT: { + return 0.0; + } + case RS::GLOBAL_VAR_TYPE_VEC2: { + return Vector2(); + } + case RS::GLOBAL_VAR_TYPE_VEC3: { + return Vector3(); + } + case RS::GLOBAL_VAR_TYPE_VEC4: { + return Plane(); + } + case RS::GLOBAL_VAR_TYPE_RECT2: { + return Rect2(); + } + case RS::GLOBAL_VAR_TYPE_COLOR: { + return Color(); + } + case RS::GLOBAL_VAR_TYPE_MAT2: { + Vector<real_t> xform; + xform.resize(4); + xform.write[0] = 1; + xform.write[1] = 0; + xform.write[2] = 0; + xform.write[3] = 1; + return xform; + } + case RS::GLOBAL_VAR_TYPE_MAT3: { + return Basis(); + } + case RS::GLOBAL_VAR_TYPE_TRANSFORM_2D: { + return Transform2D(); + } + case RS::GLOBAL_VAR_TYPE_TRANSFORM: { + return Transform(); + } + case RS::GLOBAL_VAR_TYPE_MAT4: { + Vector<real_t> xform; + xform.resize(4); + xform.write[0] = 1; + xform.write[1] = 0; + xform.write[2] = 0; + xform.write[3] = 0; + + xform.write[4] = 0; + xform.write[5] = 1; + xform.write[6] = 0; + xform.write[7] = 0; + + xform.write[8] = 0; + xform.write[9] = 0; + xform.write[10] = 1; + xform.write[11] = 0; + + xform.write[12] = 0; + xform.write[13] = 0; + xform.write[14] = 0; + xform.write[15] = 1; + + return xform; + } + case RS::GLOBAL_VAR_TYPE_SAMPLER2D: { + return ""; + } + case RS::GLOBAL_VAR_TYPE_SAMPLER2DARRAY: { + return ""; + } + case RS::GLOBAL_VAR_TYPE_SAMPLER3D: { + return ""; + } + case RS::GLOBAL_VAR_TYPE_SAMPLERCUBE: { + return ""; + } + default: { + return Variant(); + } + } +} + +void ShaderGlobalsEditor::_variable_added() { + + String var = variable_name->get_text().strip_edges(); + if (var == "" || !var.is_valid_identifier()) { + EditorNode::get_singleton()->show_warning(TTR("Please specify a valid variable identifier name.")); + return; + } + + if (RenderingServer::get_singleton()->global_variable_get(var).get_type() != Variant::NIL) { + EditorNode::get_singleton()->show_warning(vformat(TTR("Global variable '%s' already exists'"), var)); + return; + } + + List<String> keywords; + ShaderLanguage::get_keyword_list(&keywords); + + if (keywords.find(var) != nullptr || var == "script") { + EditorNode::get_singleton()->show_warning(vformat(TTR("Name '%s' is a reserved shader language keyword."), var)); + return; + } + + UndoRedo *undo_redo = EditorNode::get_singleton()->get_undo_redo(); + + Variant value = create_var(RS::GlobalVariableType(variable_type->get_selected())); + + undo_redo->create_action("Add Shader Global Variable"); + undo_redo->add_do_method(RS::get_singleton(), "global_variable_add", var, RS::GlobalVariableType(variable_type->get_selected()), value); + undo_redo->add_undo_method(RS::get_singleton(), "global_variable_remove", var); + Dictionary gv; + gv["type"] = global_var_type_names[variable_type->get_selected()]; + gv["value"] = value; + + undo_redo->add_do_property(ProjectSettings::get_singleton(), "shader_globals/" + var, gv); + undo_redo->add_undo_property(ProjectSettings::get_singleton(), "shader_globals/" + var, Variant()); + undo_redo->add_do_method(this, "_changed"); + undo_redo->add_undo_method(this, "_changed"); + undo_redo->commit_action(); +} + +void ShaderGlobalsEditor::_variable_deleted(const String &p_variable) { + + print_line("deleted " + p_variable); + UndoRedo *undo_redo = EditorNode::get_singleton()->get_undo_redo(); + + undo_redo->create_action("Add Shader Global Variable"); + undo_redo->add_do_method(RS::get_singleton(), "global_variable_remove", p_variable); + undo_redo->add_undo_method(RS::get_singleton(), "global_variable_add", p_variable, RS::get_singleton()->global_variable_get_type(p_variable), RS::get_singleton()->global_variable_get(p_variable)); + + undo_redo->add_do_property(ProjectSettings::get_singleton(), "shader_globals/" + p_variable, Variant()); + undo_redo->add_undo_property(ProjectSettings::get_singleton(), "shader_globals/" + p_variable, ProjectSettings::get_singleton()->get("shader_globals/" + p_variable)); + undo_redo->add_do_method(this, "_changed"); + undo_redo->add_undo_method(this, "_changed"); + undo_redo->commit_action(); +} + +void ShaderGlobalsEditor::_changed() { + emit_signal("globals_changed"); + if (!interface->block_update) { + interface->_change_notify(); + } +} + +void ShaderGlobalsEditor::_bind_methods() { + ClassDB::bind_method("_changed", &ShaderGlobalsEditor::_changed); + ADD_SIGNAL(MethodInfo("globals_changed")); +} + +void ShaderGlobalsEditor::_notification(int p_what) { + if (p_what == NOTIFICATION_VISIBILITY_CHANGED) { + if (is_visible_in_tree()) { + print_line("OK load settings in globalseditor"); + inspector->edit(interface); + } + } +} + +ShaderGlobalsEditor::ShaderGlobalsEditor() { + + HBoxContainer *add_menu_hb = memnew(HBoxContainer); + add_child(add_menu_hb); + + add_menu_hb->add_child(memnew(Label(TTR("Name:")))); + variable_name = memnew(LineEdit); + variable_name->set_h_size_flags(SIZE_EXPAND_FILL); + add_menu_hb->add_child(variable_name); + + add_menu_hb->add_child(memnew(Label(TTR("Type:")))); + variable_type = memnew(OptionButton); + variable_type->set_h_size_flags(SIZE_EXPAND_FILL); + add_menu_hb->add_child(variable_type); + + for (int i = 0; i < RS::GLOBAL_VAR_TYPE_MAX; i++) { + variable_type->add_item(global_var_type_names[i]); + } + + variable_add = memnew(Button(TTR("Add"))); + add_menu_hb->add_child(variable_add); + variable_add->connect("pressed", callable_mp(this, &ShaderGlobalsEditor::_variable_added)); + + inspector = memnew(EditorInspector); + inspector->set_v_size_flags(SIZE_EXPAND_FILL); + add_child(inspector); + inspector->set_use_wide_editors(true); + inspector->set_enable_capitalize_paths(false); + inspector->set_use_deletable_properties(true); + inspector->connect("property_deleted", callable_mp(this, &ShaderGlobalsEditor::_variable_deleted), varray(), CONNECT_DEFERRED); + + interface = memnew(ShaderGlobalsEditorInterface); + interface->connect("var_changed", Callable(this, "_changed")); +} +ShaderGlobalsEditor::~ShaderGlobalsEditor() { + inspector->edit(NULL); + memdelete(interface); +} diff --git a/editor/shader_globals_editor.h b/editor/shader_globals_editor.h new file mode 100644 index 0000000000..59cdeddd8d --- /dev/null +++ b/editor/shader_globals_editor.h @@ -0,0 +1,38 @@ +#ifndef SHADER_GLOBALS_EDITOR_H +#define SHADER_GLOBALS_EDITOR_H + +#include "core/undo_redo.h" +#include "editor/editor_autoload_settings.h" +#include "editor/editor_data.h" +#include "editor/editor_plugin_settings.h" +#include "editor/editor_sectioned_inspector.h" +#include "scene/gui/dialogs.h" +#include "scene/gui/tab_container.h" + +class ShaderGlobalsEditorInterface; + +class ShaderGlobalsEditor : public VBoxContainer { + + GDCLASS(ShaderGlobalsEditor, VBoxContainer) + + ShaderGlobalsEditorInterface *interface; + EditorInspector *inspector; + + LineEdit *variable_name; + OptionButton *variable_type; + Button *variable_add; + + void _variable_added(); + void _variable_deleted(const String &p_variable); + void _changed(); + +protected: + static void _bind_methods(); + void _notification(int p_what); + +public: + ShaderGlobalsEditor(); + ~ShaderGlobalsEditor(); +}; + +#endif // SHADER_GLOBALS_EDITOR_H diff --git a/editor/spatial_editor_gizmos.h b/editor/spatial_editor_gizmos.h deleted file mode 100644 index b786aa2b50..0000000000 --- a/editor/spatial_editor_gizmos.h +++ /dev/null @@ -1,434 +0,0 @@ -/*************************************************************************/ -/* spatial_editor_gizmos.h */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* https://godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */ -/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */ -/* */ -/* Permission is hereby granted, free of charge, to any person obtaining */ -/* a copy of this software and associated documentation files (the */ -/* "Software"), to deal in the Software without restriction, including */ -/* without limitation the rights to use, copy, modify, merge, publish, */ -/* distribute, sublicense, and/or sell copies of the Software, and to */ -/* permit persons to whom the Software is furnished to do so, subject to */ -/* the following conditions: */ -/* */ -/* The above copyright notice and this permission notice shall be */ -/* included in all copies or substantial portions of the Software. */ -/* */ -/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ -/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ -/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ -/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ -/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ -/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/*************************************************************************/ - -#ifndef SPATIAL_EDITOR_GIZMOS_H -#define SPATIAL_EDITOR_GIZMOS_H - -#include "editor/plugins/spatial_editor_plugin.h" -#include "scene/3d/camera.h" - -class Camera; - -class LightSpatialGizmoPlugin : public EditorSpatialGizmoPlugin { - - GDCLASS(LightSpatialGizmoPlugin, EditorSpatialGizmoPlugin); - -public: - bool has_gizmo(Spatial *p_spatial); - String get_name() const; - int get_priority() const; - - String get_handle_name(const EditorSpatialGizmo *p_gizmo, int p_idx) const; - Variant get_handle_value(EditorSpatialGizmo *p_gizmo, int p_idx) const; - void set_handle(EditorSpatialGizmo *p_gizmo, int p_idx, Camera *p_camera, const Point2 &p_point); - void commit_handle(EditorSpatialGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel = false); - void redraw(EditorSpatialGizmo *p_gizmo); - - LightSpatialGizmoPlugin(); -}; - -class AudioStreamPlayer3DSpatialGizmoPlugin : public EditorSpatialGizmoPlugin { - - GDCLASS(AudioStreamPlayer3DSpatialGizmoPlugin, EditorSpatialGizmoPlugin); - -public: - bool has_gizmo(Spatial *p_spatial); - String get_name() const; - int get_priority() const; - - String get_handle_name(const EditorSpatialGizmo *p_gizmo, int p_idx) const; - Variant get_handle_value(EditorSpatialGizmo *p_gizmo, int p_idx) const; - void set_handle(EditorSpatialGizmo *p_gizmo, int p_idx, Camera *p_camera, const Point2 &p_point); - void commit_handle(EditorSpatialGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel = false); - void redraw(EditorSpatialGizmo *p_gizmo); - - AudioStreamPlayer3DSpatialGizmoPlugin(); -}; - -class CameraSpatialGizmoPlugin : public EditorSpatialGizmoPlugin { - - GDCLASS(CameraSpatialGizmoPlugin, EditorSpatialGizmoPlugin); - -public: - bool has_gizmo(Spatial *p_spatial); - String get_name() const; - int get_priority() const; - - String get_handle_name(const EditorSpatialGizmo *p_gizmo, int p_idx) const; - Variant get_handle_value(EditorSpatialGizmo *p_gizmo, int p_idx) const; - void set_handle(EditorSpatialGizmo *p_gizmo, int p_idx, Camera *p_camera, const Point2 &p_point); - void commit_handle(EditorSpatialGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel = false); - void redraw(EditorSpatialGizmo *p_gizmo); - - CameraSpatialGizmoPlugin(); -}; - -class MeshInstanceSpatialGizmoPlugin : public EditorSpatialGizmoPlugin { - - GDCLASS(MeshInstanceSpatialGizmoPlugin, EditorSpatialGizmoPlugin); - -public: - bool has_gizmo(Spatial *p_spatial); - String get_name() const; - int get_priority() const; - bool can_be_hidden() const; - void redraw(EditorSpatialGizmo *p_gizmo); - - MeshInstanceSpatialGizmoPlugin(); -}; - -class Sprite3DSpatialGizmoPlugin : public EditorSpatialGizmoPlugin { - - GDCLASS(Sprite3DSpatialGizmoPlugin, EditorSpatialGizmoPlugin); - -public: - bool has_gizmo(Spatial *p_spatial); - String get_name() const; - int get_priority() const; - bool can_be_hidden() const; - void redraw(EditorSpatialGizmo *p_gizmo); - - Sprite3DSpatialGizmoPlugin(); -}; - -class Position3DSpatialGizmoPlugin : public EditorSpatialGizmoPlugin { - - GDCLASS(Position3DSpatialGizmoPlugin, EditorSpatialGizmoPlugin); - - Ref<ArrayMesh> pos3d_mesh; - Vector<Vector3> cursor_points; - -public: - bool has_gizmo(Spatial *p_spatial); - String get_name() const; - int get_priority() const; - void redraw(EditorSpatialGizmo *p_gizmo); - - Position3DSpatialGizmoPlugin(); -}; - -class SkeletonSpatialGizmoPlugin : public EditorSpatialGizmoPlugin { - - GDCLASS(SkeletonSpatialGizmoPlugin, EditorSpatialGizmoPlugin); - -public: - bool has_gizmo(Spatial *p_spatial); - String get_name() const; - int get_priority() const; - void redraw(EditorSpatialGizmo *p_gizmo); - - SkeletonSpatialGizmoPlugin(); -}; - -class PhysicalBoneSpatialGizmoPlugin : public EditorSpatialGizmoPlugin { - - GDCLASS(PhysicalBoneSpatialGizmoPlugin, EditorSpatialGizmoPlugin); - -public: - bool has_gizmo(Spatial *p_spatial); - String get_name() const; - int get_priority() const; - void redraw(EditorSpatialGizmo *p_gizmo); - - PhysicalBoneSpatialGizmoPlugin(); -}; - -class RayCastSpatialGizmoPlugin : public EditorSpatialGizmoPlugin { - - GDCLASS(RayCastSpatialGizmoPlugin, EditorSpatialGizmoPlugin); - -public: - bool has_gizmo(Spatial *p_spatial); - String get_name() const; - int get_priority() const; - void redraw(EditorSpatialGizmo *p_gizmo); - - RayCastSpatialGizmoPlugin(); -}; - -class SpringArmSpatialGizmoPlugin : public EditorSpatialGizmoPlugin { - - GDCLASS(SpringArmSpatialGizmoPlugin, EditorSpatialGizmoPlugin); - -public: - bool has_gizmo(Spatial *p_spatial); - String get_name() const; - int get_priority() const; - void redraw(EditorSpatialGizmo *p_gizmo); - - SpringArmSpatialGizmoPlugin(); -}; - -class VehicleWheelSpatialGizmoPlugin : public EditorSpatialGizmoPlugin { - - GDCLASS(VehicleWheelSpatialGizmoPlugin, EditorSpatialGizmoPlugin); - -public: - bool has_gizmo(Spatial *p_spatial); - String get_name() const; - int get_priority() const; - void redraw(EditorSpatialGizmo *p_gizmo); - - VehicleWheelSpatialGizmoPlugin(); -}; - -class SoftBodySpatialGizmoPlugin : public EditorSpatialGizmoPlugin { - - GDCLASS(SoftBodySpatialGizmoPlugin, EditorSpatialGizmoPlugin); - -public: - bool has_gizmo(Spatial *p_spatial); - String get_name() const; - int get_priority() const; - bool is_selectable_when_hidden() const; - void redraw(EditorSpatialGizmo *p_gizmo); - - String get_handle_name(const EditorSpatialGizmo *p_gizmo, int p_idx) const; - Variant get_handle_value(EditorSpatialGizmo *p_gizmo, int p_idx) const; - void commit_handle(EditorSpatialGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel); - bool is_handle_highlighted(const EditorSpatialGizmo *p_gizmo, int idx) const; - - SoftBodySpatialGizmoPlugin(); -}; - -class VisibilityNotifierGizmoPlugin : public EditorSpatialGizmoPlugin { - - GDCLASS(VisibilityNotifierGizmoPlugin, EditorSpatialGizmoPlugin); - -public: - bool has_gizmo(Spatial *p_spatial); - String get_name() const; - int get_priority() const; - void redraw(EditorSpatialGizmo *p_gizmo); - - String get_handle_name(const EditorSpatialGizmo *p_gizmo, int p_idx) const; - Variant get_handle_value(EditorSpatialGizmo *p_gizmo, int p_idx) const; - void set_handle(EditorSpatialGizmo *p_gizmo, int p_idx, Camera *p_camera, const Point2 &p_point); - void commit_handle(EditorSpatialGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel = false); - - VisibilityNotifierGizmoPlugin(); -}; - -class CPUParticlesGizmoPlugin : public EditorSpatialGizmoPlugin { - GDCLASS(CPUParticlesGizmoPlugin, EditorSpatialGizmoPlugin); - -public: - bool has_gizmo(Spatial *p_spatial); - String get_name() const; - int get_priority() const; - bool is_selectable_when_hidden() const; - void redraw(EditorSpatialGizmo *p_gizmo); - CPUParticlesGizmoPlugin(); -}; - -class ParticlesGizmoPlugin : public EditorSpatialGizmoPlugin { - - GDCLASS(ParticlesGizmoPlugin, EditorSpatialGizmoPlugin); - -public: - bool has_gizmo(Spatial *p_spatial); - String get_name() const; - int get_priority() const; - bool is_selectable_when_hidden() const; - void redraw(EditorSpatialGizmo *p_gizmo); - - String get_handle_name(const EditorSpatialGizmo *p_gizmo, int p_idx) const; - Variant get_handle_value(EditorSpatialGizmo *p_gizmo, int p_idx) const; - void set_handle(EditorSpatialGizmo *p_gizmo, int p_idx, Camera *p_camera, const Point2 &p_point); - void commit_handle(EditorSpatialGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel = false); - - ParticlesGizmoPlugin(); -}; - -class ReflectionProbeGizmoPlugin : public EditorSpatialGizmoPlugin { - - GDCLASS(ReflectionProbeGizmoPlugin, EditorSpatialGizmoPlugin); - -public: - bool has_gizmo(Spatial *p_spatial); - String get_name() const; - int get_priority() const; - void redraw(EditorSpatialGizmo *p_gizmo); - - String get_handle_name(const EditorSpatialGizmo *p_gizmo, int p_idx) const; - Variant get_handle_value(EditorSpatialGizmo *p_gizmo, int p_idx) const; - void set_handle(EditorSpatialGizmo *p_gizmo, int p_idx, Camera *p_camera, const Point2 &p_point); - void commit_handle(EditorSpatialGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel = false); - - ReflectionProbeGizmoPlugin(); -}; - -class GIProbeGizmoPlugin : public EditorSpatialGizmoPlugin { - - GDCLASS(GIProbeGizmoPlugin, EditorSpatialGizmoPlugin); - -public: - bool has_gizmo(Spatial *p_spatial); - String get_name() const; - int get_priority() const; - void redraw(EditorSpatialGizmo *p_gizmo); - - String get_handle_name(const EditorSpatialGizmo *p_gizmo, int p_idx) const; - Variant get_handle_value(EditorSpatialGizmo *p_gizmo, int p_idx) const; - void set_handle(EditorSpatialGizmo *p_gizmo, int p_idx, Camera *p_camera, const Point2 &p_point); - void commit_handle(EditorSpatialGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel = false); - - GIProbeGizmoPlugin(); -}; - -#if 0 -class BakedIndirectLightGizmoPlugin : public EditorSpatialGizmoPlugin { - - GDCLASS(BakedIndirectLightGizmoPlugin, EditorSpatialGizmoPlugin); - -public: - bool has_gizmo(Spatial *p_spatial); - String get_name() const; - int get_priority() const; - void redraw(EditorSpatialGizmo *p_gizmo); - - String get_handle_name(const EditorSpatialGizmo *p_gizmo, int p_idx) const; - Variant get_handle_value(EditorSpatialGizmo *p_gizmo, int p_idx) const; - void set_handle(EditorSpatialGizmo *p_gizmo, int p_idx, Camera *p_camera, const Point2 &p_point); - void commit_handle(EditorSpatialGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel = false); - - BakedIndirectLightGizmoPlugin(); -}; -#endif -class CollisionShapeSpatialGizmoPlugin : public EditorSpatialGizmoPlugin { - - GDCLASS(CollisionShapeSpatialGizmoPlugin, EditorSpatialGizmoPlugin); - -public: - bool has_gizmo(Spatial *p_spatial); - String get_name() const; - int get_priority() const; - void redraw(EditorSpatialGizmo *p_gizmo); - - String get_handle_name(const EditorSpatialGizmo *p_gizmo, int p_idx) const; - Variant get_handle_value(EditorSpatialGizmo *p_gizmo, int p_idx) const; - void set_handle(EditorSpatialGizmo *p_gizmo, int p_idx, Camera *p_camera, const Point2 &p_point); - void commit_handle(EditorSpatialGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel = false); - - CollisionShapeSpatialGizmoPlugin(); -}; - -class CollisionPolygonSpatialGizmoPlugin : public EditorSpatialGizmoPlugin { - GDCLASS(CollisionPolygonSpatialGizmoPlugin, EditorSpatialGizmoPlugin); - -public: - bool has_gizmo(Spatial *p_spatial); - String get_name() const; - int get_priority() const; - void redraw(EditorSpatialGizmo *p_gizmo); - CollisionPolygonSpatialGizmoPlugin(); -}; - -class NavigationMeshSpatialGizmoPlugin : public EditorSpatialGizmoPlugin { - - GDCLASS(NavigationMeshSpatialGizmoPlugin, EditorSpatialGizmoPlugin); - - struct _EdgeKey { - - Vector3 from; - Vector3 to; - - bool operator<(const _EdgeKey &p_with) const { return from == p_with.from ? to < p_with.to : from < p_with.from; } - }; - -public: - bool has_gizmo(Spatial *p_spatial); - String get_name() const; - int get_priority() const; - void redraw(EditorSpatialGizmo *p_gizmo); - - NavigationMeshSpatialGizmoPlugin(); -}; - -class JointGizmosDrawer { -public: - static Basis look_body(const Transform &p_joint_transform, const Transform &p_body_transform); - static Basis look_body_toward(Vector3::Axis p_axis, const Transform &joint_transform, const Transform &body_transform); - static Basis look_body_toward_x(const Transform &p_joint_transform, const Transform &p_body_transform); - static Basis look_body_toward_y(const Transform &p_joint_transform, const Transform &p_body_transform); - /// Special function just used for physics joints, it returns a basis constrained toward Joint Z axis - /// with axis X and Y that are looking toward the body and oriented toward up - static Basis look_body_toward_z(const Transform &p_joint_transform, const Transform &p_body_transform); - - // Draw circle around p_axis - static void draw_circle(Vector3::Axis p_axis, real_t p_radius, const Transform &p_offset, const Basis &p_base, real_t p_limit_lower, real_t p_limit_upper, Vector<Vector3> &r_points, bool p_inverse = false); - static void draw_cone(const Transform &p_offset, const Basis &p_base, real_t p_swing, real_t p_twist, Vector<Vector3> &r_points); -}; - -class JointSpatialGizmoPlugin : public EditorSpatialGizmoPlugin { - - GDCLASS(JointSpatialGizmoPlugin, EditorSpatialGizmoPlugin); - -public: - bool has_gizmo(Spatial *p_spatial); - String get_name() const; - int get_priority() const; - void redraw(EditorSpatialGizmo *p_gizmo); - - static void CreatePinJointGizmo(const Transform &p_offset, Vector<Vector3> &r_cursor_points); - static void CreateHingeJointGizmo(const Transform &p_offset, const Transform &p_trs_joint, const Transform &p_trs_body_a, const Transform &p_trs_body_b, real_t p_limit_lower, real_t p_limit_upper, bool p_use_limit, Vector<Vector3> &r_common_points, Vector<Vector3> *r_body_a_points, Vector<Vector3> *r_body_b_points); - static void CreateSliderJointGizmo(const Transform &p_offset, const Transform &p_trs_joint, const Transform &p_trs_body_a, const Transform &p_trs_body_b, real_t p_angular_limit_lower, real_t p_angular_limit_upper, real_t p_linear_limit_lower, real_t p_linear_limit_upper, Vector<Vector3> &r_points, Vector<Vector3> *r_body_a_points, Vector<Vector3> *r_body_b_points); - static void CreateConeTwistJointGizmo(const Transform &p_offset, const Transform &p_trs_joint, const Transform &p_trs_body_a, const Transform &p_trs_body_b, real_t p_swing, real_t p_twist, Vector<Vector3> *r_body_a_points, Vector<Vector3> *r_body_b_points); - static void CreateGeneric6DOFJointGizmo( - const Transform &p_offset, - const Transform &p_trs_joint, - const Transform &p_trs_body_a, - const Transform &p_trs_body_b, - real_t p_angular_limit_lower_x, - real_t p_angular_limit_upper_x, - real_t p_linear_limit_lower_x, - real_t p_linear_limit_upper_x, - bool p_enable_angular_limit_x, - bool p_enable_linear_limit_x, - real_t p_angular_limit_lower_y, - real_t p_angular_limit_upper_y, - real_t p_linear_limit_lower_y, - real_t p_linear_limit_upper_y, - bool p_enable_angular_limit_y, - bool p_enable_linear_limit_y, - real_t p_angular_limit_lower_z, - real_t p_angular_limit_upper_z, - real_t p_linear_limit_lower_z, - real_t p_linear_limit_upper_z, - bool p_enable_angular_limit_z, - bool p_enable_linear_limit_z, - Vector<Vector3> &r_points, - Vector<Vector3> *r_body_a_points, - Vector<Vector3> *r_body_b_points); - - JointSpatialGizmoPlugin(); -}; - -#endif // SPATIAL_EDITOR_GIZMOS_H diff --git a/editor/translations/af.po b/editor/translations/af.po index 23afeb2e55..d9e1753c65 100644 --- a/editor/translations/af.po +++ b/editor/translations/af.po @@ -1505,7 +1505,7 @@ msgstr "Skuif AutoLaai" msgid "Remove Autoload" msgstr "Hernoem AutoLaai" -#: editor/editor_autoload_settings.cpp +#: editor/editor_autoload_settings.cpp editor/editor_plugin_settings.cpp msgid "Enable" msgstr "Aktiveer" @@ -2974,7 +2974,11 @@ msgid "Q&A" msgstr "" #: editor/editor_node.cpp -msgid "Issue Tracker" +msgid "Report a Bug" +msgstr "" + +#: editor/editor_node.cpp +msgid "Send Docs Feedback" msgstr "" #: editor/editor_node.cpp editor/plugins/asset_library_editor_plugin.cpp @@ -4040,7 +4044,7 @@ msgid "Reimport" msgstr "" #: editor/import_dock.cpp -msgid "Save scenes, re-import and restart" +msgid "Save Scenes, Re-Import, and Restart" msgstr "" #: editor/import_dock.cpp @@ -6936,14 +6940,6 @@ msgid "Open Godot online documentation." msgstr "Opnoemings" #: editor/plugins/script_editor_plugin.cpp -msgid "Request Docs" -msgstr "" - -#: editor/plugins/script_editor_plugin.cpp -msgid "Help improve the Godot documentation by giving feedback." -msgstr "" - -#: editor/plugins/script_editor_plugin.cpp msgid "Search the reference documentation." msgstr "" @@ -7393,6 +7389,10 @@ msgid "This operation requires a single selected node." msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Auto Orthogonal Enabled" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Lock View Rotation" msgstr "" @@ -7482,13 +7482,13 @@ msgid "Freelook Slow Modifier" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "" -"Note: The FPS value displayed is the editor's framerate.\n" -"It cannot be used as a reliable indication of in-game performance." +msgid "View Rotation Locked" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "View Rotation Locked" +msgid "" +"Note: The FPS value displayed is the editor's framerate.\n" +"It cannot be used as a reliable indication of in-game performance." msgstr "" #: editor/plugins/spatial_editor_plugin.cpp @@ -10928,6 +10928,12 @@ msgid "Script file already exists." msgstr "AutoLaai '%s' bestaan reeds!" #: editor/script_create_dialog.cpp +msgid "" +"Note: Built-in scripts have some limitations and can't be edited using an " +"external editor." +msgstr "" + +#: editor/script_create_dialog.cpp #, fuzzy msgid "Class Name:" msgstr "Klas:" @@ -12592,6 +12598,10 @@ msgid "" "texture to some node for display." msgstr "" +#: scene/main/viewport.cpp +msgid "Viewport size must be greater than 0 to render anything." +msgstr "" + #: scene/resources/visual_shader_nodes.cpp msgid "Invalid source for preview." msgstr "" diff --git a/editor/translations/ar.po b/editor/translations/ar.po index 2cd523ec69..2ea1bd1dd5 100644 --- a/editor/translations/ar.po +++ b/editor/translations/ar.po @@ -33,12 +33,14 @@ # traveller010 <manar.bushnaq.001@gmail.com>, 2019. # Ahmed Shahwan <dev.ahmed.shahwan@gmail.com>, 2019. # hshw <shw@tutanota.com>, 2020. +# Youssef Harmal <the.coder.crab@gmail.com>, 2020. +# Nabeel20 <nabeelandnizam@gmail.com>, 2020. msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2020-01-16 22:23+0000\n" -"Last-Translator: hshw <shw@tutanota.com>\n" +"PO-Revision-Date: 2020-04-15 14:29+0000\n" +"Last-Translator: Nabeel20 <nabeelandnizam@gmail.com>\n" "Language-Team: Arabic <https://hosted.weblate.org/projects/godot-engine/" "godot/ar/>\n" "Language: ar\n" @@ -47,7 +49,7 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 " "&& n%100<=10 ? 3 : n%100>=11 ? 4 : 5;\n" -"X-Generator: Weblate 3.10.2-dev\n" +"X-Generator: Weblate 4.0-dev\n" #: core/math/expression.cpp modules/gdscript/gdscript_functions.cpp #: modules/visual_script/visual_script_builtin_funcs.cpp @@ -710,7 +712,7 @@ msgstr "رقم الخط:" #: editor/code_editor.cpp #, fuzzy msgid "%d replaced." -msgstr "إستبدال" +msgstr "تم إستبدال %d" #: editor/code_editor.cpp editor/editor_help.cpp msgid "%d match." @@ -747,7 +749,7 @@ msgstr "معياري" #: editor/code_editor.cpp editor/plugins/script_editor_plugin.cpp msgid "Toggle Scripts Panel" -msgstr "" +msgstr "تحديد التبويب البرمجي" #: editor/code_editor.cpp editor/plugins/canvas_item_editor_plugin.cpp #: editor/plugins/texture_region_editor_plugin.cpp @@ -915,7 +917,7 @@ msgstr "هل أنت(ي) متأكد(ة) أنك تود إزالة كل الإتص #: editor/connections_dialog.cpp editor/editor_help.cpp editor/node_dock.cpp msgid "Signals" -msgstr "إشارات" +msgstr "الإشارات" #: editor/connections_dialog.cpp msgid "Are you sure you want to remove all connections from this signal?" @@ -1225,9 +1227,8 @@ msgid "The following files failed extraction from package:" msgstr "فشل استخراج الملفات التالية من الحزمة:" #: editor/editor_asset_installer.cpp -#, fuzzy msgid "And %s more files." -msgstr "%d مزيد من الملفات" +msgstr "%s مزيد من الملفات" #: editor/editor_asset_installer.cpp editor/project_manager.cpp msgid "Package installed successfully!" @@ -1381,9 +1382,8 @@ msgid "Invalid file, not an audio bus layout." msgstr "ملف خطأ، ليس ملف نسق بيوس الصوت." #: editor/editor_audio_buses.cpp -#, fuzzy msgid "Error saving file: %s" -msgstr "خطأ في حفظ مجموعة البلاط!" +msgstr "خطأ !خطأ في تسجيل الملف: s%" #: editor/editor_audio_buses.cpp msgid "Add Bus" @@ -1469,7 +1469,7 @@ msgstr "نقل التحميل التلقائي" msgid "Remove Autoload" msgstr "ازالة التحميل التلقائي" -#: editor/editor_autoload_settings.cpp +#: editor/editor_autoload_settings.cpp editor/editor_plugin_settings.cpp msgid "Enable" msgstr "تمكين" @@ -1609,9 +1609,8 @@ msgstr "" #: editor/editor_export.cpp platform/android/export/export.cpp #: platform/iphone/export/export.cpp platform/javascript/export/export.cpp #: platform/osx/export/export.cpp platform/uwp/export/export.cpp -#, fuzzy msgid "Custom debug template not found." -msgstr "ملف النموذج غير موجود:" +msgstr "نمودج تصحيح الأخطاء غير موجود." #: editor/editor_export.cpp platform/android/export/export.cpp #: platform/iphone/export/export.cpp platform/javascript/export/export.cpp @@ -1628,9 +1627,8 @@ msgid "On 32-bit exports the embedded PCK cannot be bigger than 4 GiB." msgstr "" #: editor/editor_feature_profile.cpp -#, fuzzy msgid "3D Editor" -msgstr "المُعدل" +msgstr "معدل تلاثي الأبعاد" #: editor/editor_feature_profile.cpp #, fuzzy @@ -1643,22 +1641,19 @@ msgstr "مكتبة الأصول" #: editor/editor_feature_profile.cpp msgid "Scene Tree Editing" -msgstr "" +msgstr "تعديل شجرة المشهد" #: editor/editor_feature_profile.cpp -#, fuzzy msgid "Import Dock" -msgstr "إستيراد" +msgstr "رصيف الاستيراد" #: editor/editor_feature_profile.cpp -#, fuzzy msgid "Node Dock" -msgstr "وضع التحريك" +msgstr "رصيف العقد" #: editor/editor_feature_profile.cpp -#, fuzzy msgid "FileSystem and Import Docks" -msgstr "نظام الملفات" +msgstr "رصيف نظام الملفات و الاستيراد" #: editor/editor_feature_profile.cpp #, fuzzy @@ -3010,8 +3005,13 @@ msgid "Q&A" msgstr "الأسئلة و الأجوبة" #: editor/editor_node.cpp -msgid "Issue Tracker" -msgstr "متتبع الأخطاء" +#, fuzzy +msgid "Report a Bug" +msgstr "إعادة إستيراد" + +#: editor/editor_node.cpp +msgid "Send Docs Feedback" +msgstr "" #: editor/editor_node.cpp editor/plugins/asset_library_editor_plugin.cpp msgid "Community" @@ -4100,7 +4100,7 @@ msgid "Reimport" msgstr "إعادة إستيراد" #: editor/import_dock.cpp -msgid "Save scenes, re-import and restart" +msgid "Save Scenes, Re-Import, and Restart" msgstr "" #: editor/import_dock.cpp @@ -7090,14 +7090,6 @@ msgid "Open Godot online documentation." msgstr "فُتح مؤخراً" #: editor/plugins/script_editor_plugin.cpp -msgid "Request Docs" -msgstr "" - -#: editor/plugins/script_editor_plugin.cpp -msgid "Help improve the Godot documentation by giving feedback." -msgstr "" - -#: editor/plugins/script_editor_plugin.cpp msgid "Search the reference documentation." msgstr "" @@ -7552,6 +7544,10 @@ msgid "This operation requires a single selected node." msgstr "هذه العملية تتطلب عقدة واحدة محددة." #: editor/plugins/spatial_editor_plugin.cpp +msgid "Auto Orthogonal Enabled" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Lock View Rotation" msgstr "" @@ -7642,13 +7638,13 @@ msgid "Freelook Slow Modifier" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "" -"Note: The FPS value displayed is the editor's framerate.\n" -"It cannot be used as a reliable indication of in-game performance." +msgid "View Rotation Locked" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "View Rotation Locked" +msgid "" +"Note: The FPS value displayed is the editor's framerate.\n" +"It cannot be used as a reliable indication of in-game performance." msgstr "" #: editor/plugins/spatial_editor_plugin.cpp @@ -9157,38 +9153,39 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "E constant (2.718282). Represents the base of the natural logarithm." msgstr "" +"ثابت E ويعادل القيمة (2.718282)، وهو يمثل الأساس في اللوغاريتم الطبيعي." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Epsilon constant (0.00001). Smallest possible scalar number." -msgstr "" +msgstr "ثابت إيبسلون (0.00001)، أصغر الأعداد على الإطلاق." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Phi constant (1.618034). Golden ratio." -msgstr "" +msgstr "ثابت فاي (1.618034)، ويمثل النسبة الذهبية ذاتها." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Pi/4 constant (0.785398) or 45 degrees." -msgstr "" +msgstr "ثابت باي/4 (0.785398) أو 45 درجة." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Pi/2 constant (1.570796) or 90 degrees." -msgstr "" +msgstr "ثابت باي/2 (1.570796) أو 90 درجة." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Pi constant (3.141593) or 180 degrees." -msgstr "" +msgstr "ثابت باي (3.141593) أو 180 درجة." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Tau constant (6.283185) or 360 degrees." -msgstr "" +msgstr "ثابت تاو Tau وقيمته (6.283185) أو 360 درجة." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Sqrt2 constant (1.414214). Square root of 2." -msgstr "" +msgstr "ثابت جذر-العدد2 (1.414214)، أي قيمة جذر العدد 2." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the absolute value of the parameter." -msgstr "" +msgstr "يحسب القيمة المطلقة لقيمة المَعلم." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the arc-cosine of the parameter." @@ -11166,6 +11163,12 @@ msgid "Script file already exists." msgstr "التحميل التلقائي '%s' موجود اصلا!" #: editor/script_create_dialog.cpp +msgid "" +"Note: Built-in scripts have some limitations and can't be edited using an " +"external editor." +msgstr "" + +#: editor/script_create_dialog.cpp #, fuzzy msgid "Class Name:" msgstr "إسم صنف" @@ -12859,6 +12862,10 @@ msgid "" "texture to some node for display." msgstr "" +#: scene/main/viewport.cpp +msgid "Viewport size must be greater than 0 to render anything." +msgstr "" + #: scene/resources/visual_shader_nodes.cpp msgid "Invalid source for preview." msgstr "مصدر غير صالح للمعاينة." @@ -12887,6 +12894,9 @@ msgstr "يمكن تعيين المتغيرات فقط في الذروة ." msgid "Constants cannot be modified." msgstr "لا يمكن تعديل الثوابت." +#~ msgid "Issue Tracker" +#~ msgstr "متتبع الأخطاء" + #~ msgid "Replaced %d occurrence(s)." #~ msgstr "إستبُدل %d حادثة(حوادث)." diff --git a/editor/translations/bg.po b/editor/translations/bg.po index 651776b6ab..1dcaf7fa32 100644 --- a/editor/translations/bg.po +++ b/editor/translations/bg.po @@ -6,14 +6,15 @@ # Иван Пенев (Адмирал АнимЕ) <aeternus.arcis@gmail.com>, 2016-2017. # Любомир Василев <lyubomirv@abv.bg>, 2018, 2020. # MaresPW <marespw206@gmail.com>, 2018. -# PakoSt <kokotekilata@gmail.com>, 2018. +# PakoSt <kokotekilata@gmail.com>, 2018, 2020. # Damyan Dichev <mwshock2@gmail.com>, 2019. +# anonymous <noreply@weblate.org>, 2020. msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2020-02-28 13:33+0000\n" -"Last-Translator: Любомир Василев <lyubomirv@abv.bg>\n" +"PO-Revision-Date: 2020-03-27 15:42+0000\n" +"Last-Translator: PakoSt <kokotekilata@gmail.com>\n" "Language-Team: Bulgarian <https://hosted.weblate.org/projects/godot-engine/" "godot/bg/>\n" "Language: bg\n" @@ -42,11 +43,12 @@ msgstr "Недостатъчно байтове за разкодиране ил #: core/math/expression.cpp msgid "Invalid input %i (not passed) in expression" -msgstr "" +msgstr "Неправилно въведени дани %i (не подаден) в израза" #: core/math/expression.cpp msgid "self can't be used because instance is null (not passed)" msgstr "" +"self не може да се ползва, тъй като инстанцията е null (не е била подадена)" #: core/math/expression.cpp msgid "Invalid operands to operator %s, %s and %s." @@ -58,7 +60,7 @@ msgstr "Невалиден индекс от тип %s за базов тип %s #: core/math/expression.cpp msgid "Invalid named index '%s' for base type %s" -msgstr "" +msgstr "Невалидно наименован индекс '%s' за базов тип %s" #: core/math/expression.cpp msgid "Invalid arguments to construct '%s'" @@ -66,7 +68,7 @@ msgstr "Неправилни аргументи за създаване на „ #: core/math/expression.cpp msgid "On call to '%s':" -msgstr "" +msgstr "При обаждане към '%s':" #: core/ustring.cpp msgid "B" @@ -118,15 +120,15 @@ msgstr "Стойност:" #: editor/animation_bezier_editor.cpp msgid "Insert Key Here" -msgstr "" +msgstr "Вмъкване на ключ тук" #: editor/animation_bezier_editor.cpp msgid "Duplicate Selected Key(s)" -msgstr "" +msgstr "Копиране на избран(и) ключ(ове)" #: editor/animation_bezier_editor.cpp msgid "Delete Selected Key(s)" -msgstr "" +msgstr "Изтриване на избран(и) ключ(ове)" #: editor/animation_bezier_editor.cpp msgid "Add Bezier Point" @@ -138,31 +140,31 @@ msgstr "Преместване на точки на Безие" #: editor/animation_bezier_editor.cpp editor/animation_track_editor.cpp msgid "Anim Duplicate Keys" -msgstr "" +msgstr "Копиране на ключ(ове) (Анимация)" #: editor/animation_bezier_editor.cpp editor/animation_track_editor.cpp msgid "Anim Delete Keys" -msgstr "" +msgstr "Изтриване на ключ(ове) (Анимация)" #: editor/animation_track_editor.cpp msgid "Anim Change Keyframe Time" -msgstr "" +msgstr "Промяна на момент на ключов кадър (Анимация)" #: editor/animation_track_editor.cpp msgid "Anim Change Transition" -msgstr "" +msgstr "Промяна на вид преход (Анимация)" #: editor/animation_track_editor.cpp msgid "Anim Change Transform" -msgstr "" +msgstr "Промяна на трансформация (Анимация)" #: editor/animation_track_editor.cpp msgid "Anim Change Keyframe Value" -msgstr "" +msgstr "Промяна на стойност на ключов кадър (Анимация)" #: editor/animation_track_editor.cpp msgid "Anim Change Call" -msgstr "" +msgstr "Промяна на повикана функция (Анимация)" #: editor/animation_track_editor.cpp msgid "Anim Multi Change Keyframe Time" @@ -1417,7 +1419,7 @@ msgstr "" msgid "Remove Autoload" msgstr "" -#: editor/editor_autoload_settings.cpp +#: editor/editor_autoload_settings.cpp editor/editor_plugin_settings.cpp msgid "Enable" msgstr "" @@ -2821,7 +2823,12 @@ msgid "Q&A" msgstr "" #: editor/editor_node.cpp -msgid "Issue Tracker" +#, fuzzy +msgid "Report a Bug" +msgstr "Повторно внасяне" + +#: editor/editor_node.cpp +msgid "Send Docs Feedback" msgstr "" #: editor/editor_node.cpp editor/plugins/asset_library_editor_plugin.cpp @@ -3844,7 +3851,7 @@ msgid "Reimport" msgstr "Повторно внасяне" #: editor/import_dock.cpp -msgid "Save scenes, re-import and restart" +msgid "Save Scenes, Re-Import, and Restart" msgstr "" #: editor/import_dock.cpp @@ -6694,14 +6701,6 @@ msgid "Open Godot online documentation." msgstr "Отваряне на документацията на Godot в Интернет." #: editor/plugins/script_editor_plugin.cpp -msgid "Request Docs" -msgstr "" - -#: editor/plugins/script_editor_plugin.cpp -msgid "Help improve the Godot documentation by giving feedback." -msgstr "" - -#: editor/plugins/script_editor_plugin.cpp msgid "Search the reference documentation." msgstr "" @@ -7139,6 +7138,10 @@ msgid "This operation requires a single selected node." msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Auto Orthogonal Enabled" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Lock View Rotation" msgstr "" @@ -7230,13 +7233,13 @@ msgid "Freelook Slow Modifier" msgstr "Свободен Изглед Отпред" #: editor/plugins/spatial_editor_plugin.cpp -msgid "" -"Note: The FPS value displayed is the editor's framerate.\n" -"It cannot be used as a reliable indication of in-game performance." +msgid "View Rotation Locked" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "View Rotation Locked" +msgid "" +"Note: The FPS value displayed is the editor's framerate.\n" +"It cannot be used as a reliable indication of in-game performance." msgstr "" #: editor/plugins/spatial_editor_plugin.cpp @@ -10656,6 +10659,12 @@ msgid "Script file already exists." msgstr "Група с това име вече съществува." #: editor/script_create_dialog.cpp +msgid "" +"Note: Built-in scripts have some limitations and can't be edited using an " +"external editor." +msgstr "" + +#: editor/script_create_dialog.cpp #, fuzzy msgid "Class Name:" msgstr "Клас:" @@ -12375,6 +12384,10 @@ msgid "" "texture to some node for display." msgstr "" +#: scene/main/viewport.cpp +msgid "Viewport size must be greater than 0 to render anything." +msgstr "" + #: scene/resources/visual_shader_nodes.cpp msgid "Invalid source for preview." msgstr "" diff --git a/editor/translations/bn.po b/editor/translations/bn.po index 77ff28a113..b37267652e 100644 --- a/editor/translations/bn.po +++ b/editor/translations/bn.po @@ -1537,7 +1537,7 @@ msgstr "Autoload স্থানান্তর করুন" msgid "Remove Autoload" msgstr "Autoload অপসারণ করুন" -#: editor/editor_autoload_settings.cpp +#: editor/editor_autoload_settings.cpp editor/editor_plugin_settings.cpp msgid "Enable" msgstr "সক্রিয় করুন" @@ -3130,8 +3130,13 @@ msgid "Q&A" msgstr "Q&A" #: editor/editor_node.cpp -msgid "Issue Tracker" -msgstr "ইস্যু ট্র্যাকার" +#, fuzzy +msgid "Report a Bug" +msgstr "পুন-ইম্পোর্ট" + +#: editor/editor_node.cpp +msgid "Send Docs Feedback" +msgstr "" #: editor/editor_node.cpp editor/plugins/asset_library_editor_plugin.cpp msgid "Community" @@ -4291,7 +4296,7 @@ msgid "Reimport" msgstr "পুন-ইম্পোর্ট" #: editor/import_dock.cpp -msgid "Save scenes, re-import and restart" +msgid "Save Scenes, Re-Import, and Restart" msgstr "" #: editor/import_dock.cpp @@ -7354,14 +7359,6 @@ msgid "Open Godot online documentation." msgstr "রেফারেন্সের ডকুমেন্টেশনে খুঁজুন।" #: editor/plugins/script_editor_plugin.cpp -msgid "Request Docs" -msgstr "" - -#: editor/plugins/script_editor_plugin.cpp -msgid "Help improve the Godot documentation by giving feedback." -msgstr "" - -#: editor/plugins/script_editor_plugin.cpp msgid "Search the reference documentation." msgstr "রেফারেন্সের ডকুমেন্টেশনে খুঁজুন।" @@ -7836,6 +7833,11 @@ msgstr "এই কাজটি করার জন্য একটি একক #: editor/plugins/spatial_editor_plugin.cpp #, fuzzy +msgid "Auto Orthogonal Enabled" +msgstr "সমকোণীয় (Orthogonal)" + +#: editor/plugins/spatial_editor_plugin.cpp +#, fuzzy msgid "Lock View Rotation" msgstr "তথ্য দেখুন" @@ -7935,17 +7937,17 @@ msgid "Freelook Slow Modifier" msgstr "ফ্রি লুক স্পিড মডিফায়ার" #: editor/plugins/spatial_editor_plugin.cpp +#, fuzzy +msgid "View Rotation Locked" +msgstr "তথ্য দেখুন" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -#, fuzzy -msgid "View Rotation Locked" -msgstr "তথ্য দেখুন" - -#: editor/plugins/spatial_editor_plugin.cpp msgid "XForm Dialog" msgstr "XForm এর সংলাপ" @@ -11620,6 +11622,12 @@ msgid "Script file already exists." msgstr "'%s' অ্যাকশন ইতিমধ্যেই বিদ্যমান!" #: editor/script_create_dialog.cpp +msgid "" +"Note: Built-in scripts have some limitations and can't be edited using an " +"external editor." +msgstr "" + +#: editor/script_create_dialog.cpp #, fuzzy msgid "Class Name:" msgstr "ক্লাস নাম:" @@ -13433,6 +13441,10 @@ msgstr "" "আকার ধারণ করতে পারে। অন্যথায়, এটিকে একটি RenderTarget করুন এবং এর অভ্যন্তরীণ " "দৃশ্যাবলিকে (texture) দৃশ্যমান করতে কোনো নোডে হস্তান্তর করুন।" +#: scene/main/viewport.cpp +msgid "Viewport size must be greater than 0 to render anything." +msgstr "" + #: scene/resources/visual_shader_nodes.cpp #, fuzzy msgid "Invalid source for preview." @@ -13464,6 +13476,9 @@ msgstr "" msgid "Constants cannot be modified." msgstr "" +#~ msgid "Issue Tracker" +#~ msgstr "ইস্যু ট্র্যাকার" + #~ msgid "Replaced %d occurrence(s)." #~ msgstr "%d সংখ্যক সংঘটন প্রতিস্থাপিত হয়েছে ।" diff --git a/editor/translations/ca.po b/editor/translations/ca.po index 304fa8905b..21886cea24 100644 --- a/editor/translations/ca.po +++ b/editor/translations/ca.po @@ -1452,7 +1452,7 @@ msgstr "Mou l'AutoCàrrega" msgid "Remove Autoload" msgstr "Treu Autocàrrega" -#: editor/editor_autoload_settings.cpp +#: editor/editor_autoload_settings.cpp editor/editor_plugin_settings.cpp msgid "Enable" msgstr "Activa" @@ -2953,8 +2953,13 @@ msgid "Q&A" msgstr "Preguntes i Respostes" #: editor/editor_node.cpp -msgid "Issue Tracker" -msgstr "Seguiment d'Incidències" +#, fuzzy +msgid "Report a Bug" +msgstr "ReImportar" + +#: editor/editor_node.cpp +msgid "Send Docs Feedback" +msgstr "" #: editor/editor_node.cpp editor/plugins/asset_library_editor_plugin.cpp msgid "Community" @@ -4027,7 +4032,8 @@ msgid "Reimport" msgstr "ReImportar" #: editor/import_dock.cpp -msgid "Save scenes, re-import and restart" +#, fuzzy +msgid "Save Scenes, Re-Import, and Restart" msgstr "Guardar escenes, reimportar i reiniciar" #: editor/import_dock.cpp @@ -6956,15 +6962,6 @@ msgid "Open Godot online documentation." msgstr "Obrir la documentació en línia de Godot." #: editor/plugins/script_editor_plugin.cpp -msgid "Request Docs" -msgstr "Sol·licitar Documentació" - -#: editor/plugins/script_editor_plugin.cpp -#, fuzzy -msgid "Help improve the Godot documentation by giving feedback." -msgstr "Ajudeu a millorar la documentació de Godot donant comentaris" - -#: editor/plugins/script_editor_plugin.cpp msgid "Search the reference documentation." msgstr "Cerca dins la documentació de referència." @@ -7416,6 +7413,11 @@ msgid "This operation requires a single selected node." msgstr "Aquesta operació requereix un únic node seleccionat." #: editor/plugins/spatial_editor_plugin.cpp +#, fuzzy +msgid "Auto Orthogonal Enabled" +msgstr "Ortogonal" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Lock View Rotation" msgstr "Bloquejar Rotació de la Vista" @@ -7507,6 +7509,10 @@ msgid "Freelook Slow Modifier" msgstr "Modificador de la Velocitat de la Vista Lliure" #: editor/plugins/spatial_editor_plugin.cpp +msgid "View Rotation Locked" +msgstr "Rotació de la Vista Bloquejada" + +#: editor/plugins/spatial_editor_plugin.cpp #, fuzzy msgid "" "Note: The FPS value displayed is the editor's framerate.\n" @@ -7516,10 +7522,6 @@ msgstr "" "No es pot utilitzar com una indicació fiable del rendiment en el joc." #: editor/plugins/spatial_editor_plugin.cpp -msgid "View Rotation Locked" -msgstr "Rotació de la Vista Bloquejada" - -#: editor/plugins/spatial_editor_plugin.cpp msgid "XForm Dialog" msgstr "Diàleg XForm" @@ -11209,6 +11211,12 @@ msgid "Script file already exists." msgstr "L'Acció '%s' ja existeix!" #: editor/script_create_dialog.cpp +msgid "" +"Note: Built-in scripts have some limitations and can't be edited using an " +"external editor." +msgstr "" + +#: editor/script_create_dialog.cpp #, fuzzy msgid "Class Name:" msgstr "Nom de Classe" @@ -13063,6 +13071,10 @@ msgstr "" "forma per tal d'obtenir-ne la mida. Altrament, establiu-la com a Destinació " "de Renderització i assigneu-ne la textura interna a algun node." +#: scene/main/viewport.cpp +msgid "Viewport size must be greater than 0 to render anything." +msgstr "" + #: scene/resources/visual_shader_nodes.cpp #, fuzzy msgid "Invalid source for preview." @@ -13093,6 +13105,16 @@ msgstr "" msgid "Constants cannot be modified." msgstr "Les constants no es poden modificar." +#~ msgid "Issue Tracker" +#~ msgstr "Seguiment d'Incidències" + +#~ msgid "Request Docs" +#~ msgstr "Sol·licitar Documentació" + +#, fuzzy +#~ msgid "Help improve the Godot documentation by giving feedback." +#~ msgstr "Ajudeu a millorar la documentació de Godot donant comentaris" + #~ msgid "Replaced %d occurrence(s)." #~ msgstr "%d ocurrència/es reemplaçades." diff --git a/editor/translations/cs.po b/editor/translations/cs.po index 595db1837f..887bbeb8f4 100644 --- a/editor/translations/cs.po +++ b/editor/translations/cs.po @@ -1455,7 +1455,7 @@ msgstr "Přemístit Autoload" msgid "Remove Autoload" msgstr "Odstranit Autoload" -#: editor/editor_autoload_settings.cpp +#: editor/editor_autoload_settings.cpp editor/editor_plugin_settings.cpp msgid "Enable" msgstr "Povolit" @@ -2933,8 +2933,13 @@ msgid "Q&A" msgstr "Otázky a odpovědi" #: editor/editor_node.cpp -msgid "Issue Tracker" -msgstr "Sledování chyb" +#, fuzzy +msgid "Report a Bug" +msgstr "Znovu importovat" + +#: editor/editor_node.cpp +msgid "Send Docs Feedback" +msgstr "" #: editor/editor_node.cpp editor/plugins/asset_library_editor_plugin.cpp msgid "Community" @@ -3972,7 +3977,7 @@ msgid "Reimport" msgstr "Znovu importovat" #: editor/import_dock.cpp -msgid "Save scenes, re-import and restart" +msgid "Save Scenes, Re-Import, and Restart" msgstr "" #: editor/import_dock.cpp @@ -6828,14 +6833,6 @@ msgid "Open Godot online documentation." msgstr "Otevřít online dokumentaci Godotu." #: editor/plugins/script_editor_plugin.cpp -msgid "Request Docs" -msgstr "Požádat o dokumentaci" - -#: editor/plugins/script_editor_plugin.cpp -msgid "Help improve the Godot documentation by giving feedback." -msgstr "" - -#: editor/plugins/script_editor_plugin.cpp msgid "Search the reference documentation." msgstr "Hledat v referenční dokumentaci." @@ -7282,6 +7279,11 @@ msgstr "Tato operace vyžaduje jeden vybraný uzel." #: editor/plugins/spatial_editor_plugin.cpp #, fuzzy +msgid "Auto Orthogonal Enabled" +msgstr "Ortogonální" + +#: editor/plugins/spatial_editor_plugin.cpp +#, fuzzy msgid "Lock View Rotation" msgstr "Zobrazit informace" @@ -7372,17 +7374,17 @@ msgid "Freelook Slow Modifier" msgstr "Rychlost volného pohledu" #: editor/plugins/spatial_editor_plugin.cpp +#, fuzzy +msgid "View Rotation Locked" +msgstr "Zobrazit informace" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -#, fuzzy -msgid "View Rotation Locked" -msgstr "Zobrazit informace" - -#: editor/plugins/spatial_editor_plugin.cpp msgid "XForm Dialog" msgstr "XForm Dialog" @@ -10904,6 +10906,12 @@ msgid "Script file already exists." msgstr "Soubor skriptu již existuje." #: editor/script_create_dialog.cpp +msgid "" +"Note: Built-in scripts have some limitations and can't be edited using an " +"external editor." +msgstr "" + +#: editor/script_create_dialog.cpp msgid "Class Name:" msgstr "Jméno třídy:" @@ -12648,6 +12656,10 @@ msgstr "" "mohl získat velikost. Jinak ho nastavte jako render target a přiřaďte jeho " "vnitřní texturu nějakému uzlu k zobrazení." +#: scene/main/viewport.cpp +msgid "Viewport size must be greater than 0 to render anything." +msgstr "" + #: scene/resources/visual_shader_nodes.cpp #, fuzzy msgid "Invalid source for preview." @@ -12678,6 +12690,12 @@ msgstr "" msgid "Constants cannot be modified." msgstr "Konstanty není možné upravovat." +#~ msgid "Issue Tracker" +#~ msgstr "Sledování chyb" + +#~ msgid "Request Docs" +#~ msgstr "Požádat o dokumentaci" + #~ msgid "Replaced %d occurrence(s)." #~ msgstr "Nahrazeno %d výskytů." diff --git a/editor/translations/da.po b/editor/translations/da.po index 3d2c4cb48b..e582e4f3f9 100644 --- a/editor/translations/da.po +++ b/editor/translations/da.po @@ -1508,7 +1508,7 @@ msgstr "Flyt Autoload" msgid "Remove Autoload" msgstr "Fjern Autoload" -#: editor/editor_autoload_settings.cpp +#: editor/editor_autoload_settings.cpp editor/editor_plugin_settings.cpp msgid "Enable" msgstr "Aktivér" @@ -3041,8 +3041,13 @@ msgid "Q&A" msgstr "Spørgsmål og Svar" #: editor/editor_node.cpp -msgid "Issue Tracker" -msgstr "Problem Tracker" +#, fuzzy +msgid "Report a Bug" +msgstr "Genimporter" + +#: editor/editor_node.cpp +msgid "Send Docs Feedback" +msgstr "" #: editor/editor_node.cpp editor/plugins/asset_library_editor_plugin.cpp msgid "Community" @@ -4132,7 +4137,7 @@ msgid "Reimport" msgstr "Genimporter" #: editor/import_dock.cpp -msgid "Save scenes, re-import and restart" +msgid "Save Scenes, Re-Import, and Restart" msgstr "" #: editor/import_dock.cpp @@ -7083,14 +7088,6 @@ msgid "Open Godot online documentation." msgstr "Åben Seneste" #: editor/plugins/script_editor_plugin.cpp -msgid "Request Docs" -msgstr "" - -#: editor/plugins/script_editor_plugin.cpp -msgid "Help improve the Godot documentation by giving feedback." -msgstr "" - -#: editor/plugins/script_editor_plugin.cpp msgid "Search the reference documentation." msgstr "" @@ -7546,6 +7543,10 @@ msgid "This operation requires a single selected node." msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Auto Orthogonal Enabled" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Lock View Rotation" msgstr "" @@ -7636,13 +7637,13 @@ msgid "Freelook Slow Modifier" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "" -"Note: The FPS value displayed is the editor's framerate.\n" -"It cannot be used as a reliable indication of in-game performance." +msgid "View Rotation Locked" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "View Rotation Locked" +msgid "" +"Note: The FPS value displayed is the editor's framerate.\n" +"It cannot be used as a reliable indication of in-game performance." msgstr "" #: editor/plugins/spatial_editor_plugin.cpp @@ -11161,6 +11162,12 @@ msgid "Script file already exists." msgstr "Autoload '%s' eksisterer allerede!" #: editor/script_create_dialog.cpp +msgid "" +"Note: Built-in scripts have some limitations and can't be edited using an " +"external editor." +msgstr "" + +#: editor/script_create_dialog.cpp #, fuzzy msgid "Class Name:" msgstr "Klasse:" @@ -12917,6 +12924,10 @@ msgstr "" "den kan opnå en størrelse. Ellers gør den til en RenderTarget og tildel dens " "indre textur til en node så den kan vises." +#: scene/main/viewport.cpp +msgid "Viewport size must be greater than 0 to render anything." +msgstr "" + #: scene/resources/visual_shader_nodes.cpp #, fuzzy msgid "Invalid source for preview." @@ -12948,6 +12959,9 @@ msgstr "" msgid "Constants cannot be modified." msgstr "Konstanter kan ikke ændres." +#~ msgid "Issue Tracker" +#~ msgstr "Problem Tracker" + #~ msgid "Replaced %d occurrence(s)." #~ msgstr "Erstattede %d forekomst(er)." diff --git a/editor/translations/de.po b/editor/translations/de.po index 1520c3aa2a..dc12e814b0 100644 --- a/editor/translations/de.po +++ b/editor/translations/de.po @@ -1494,7 +1494,7 @@ msgstr "Autoload verschieben" msgid "Remove Autoload" msgstr "Autoload entfernen" -#: editor/editor_autoload_settings.cpp +#: editor/editor_autoload_settings.cpp editor/editor_plugin_settings.cpp msgid "Enable" msgstr "Aktivieren" @@ -2992,8 +2992,13 @@ msgid "Q&A" msgstr "Fragen & Antworten" #: editor/editor_node.cpp -msgid "Issue Tracker" -msgstr "Problem-Melder" +#, fuzzy +msgid "Report a Bug" +msgstr "Neuimport" + +#: editor/editor_node.cpp +msgid "Send Docs Feedback" +msgstr "" #: editor/editor_node.cpp editor/plugins/asset_library_editor_plugin.cpp msgid "Community" @@ -4051,7 +4056,8 @@ msgid "Reimport" msgstr "Neuimport" #: editor/import_dock.cpp -msgid "Save scenes, re-import and restart" +#, fuzzy +msgid "Save Scenes, Re-Import, and Restart" msgstr "Szenen speichern, reimportieren und neu starten" #: editor/import_dock.cpp @@ -6920,15 +6926,6 @@ msgid "Open Godot online documentation." msgstr "Godot-Onlinedokumentation öffnen." #: editor/plugins/script_editor_plugin.cpp -msgid "Request Docs" -msgstr "Dokumentation anfragen" - -#: editor/plugins/script_editor_plugin.cpp -msgid "Help improve the Godot documentation by giving feedback." -msgstr "" -"Mithelfen die Godot-Dokumentation durch Meinungsäußerungen zu verbessern." - -#: editor/plugins/script_editor_plugin.cpp msgid "Search the reference documentation." msgstr "Durchsuche die Referenzdokumentation." @@ -7368,6 +7365,11 @@ msgid "This operation requires a single selected node." msgstr "Diese Aktion benötigt einen einzelnen ausgewählten Node." #: editor/plugins/spatial_editor_plugin.cpp +#, fuzzy +msgid "Auto Orthogonal Enabled" +msgstr "Orthogonal" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Lock View Rotation" msgstr "Sichtrotation sperren" @@ -7456,6 +7458,10 @@ msgid "Freelook Slow Modifier" msgstr "Freisicht Trägheitsregler" #: editor/plugins/spatial_editor_plugin.cpp +msgid "View Rotation Locked" +msgstr "Sichtrotation gesperrt" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." @@ -7464,10 +7470,6 @@ msgstr "" "Sie ist kein zuverlässiger Vergleichswert für die In-Spiel-Leistung." #: editor/plugins/spatial_editor_plugin.cpp -msgid "View Rotation Locked" -msgstr "Sichtrotation gesperrt" - -#: editor/plugins/spatial_editor_plugin.cpp msgid "XForm Dialog" msgstr "Transformationsdialog" @@ -10989,6 +10991,12 @@ msgid "Script file already exists." msgstr "Skriptdatei existiert bereits." #: editor/script_create_dialog.cpp +msgid "" +"Note: Built-in scripts have some limitations and can't be edited using an " +"external editor." +msgstr "" + +#: editor/script_create_dialog.cpp msgid "Class Name:" msgstr "Klassenname:" @@ -12797,6 +12805,10 @@ msgstr "" "Eigenschaft ‚Render Target‘ des Viewports aktiviert und seine Textur " "irgendeinem Node zum Anzeigen zugewiesen werden." +#: scene/main/viewport.cpp +msgid "Viewport size must be greater than 0 to render anything." +msgstr "" + #: scene/resources/visual_shader_nodes.cpp msgid "Invalid source for preview." msgstr "Ungültige Quelle für Vorschau." @@ -12825,6 +12837,16 @@ msgstr "Varyings können nur in Vertex-Funktion zugewiesen werden." msgid "Constants cannot be modified." msgstr "Konstanten können nicht verändert werden." +#~ msgid "Issue Tracker" +#~ msgstr "Problem-Melder" + +#~ msgid "Request Docs" +#~ msgstr "Dokumentation anfragen" + +#~ msgid "Help improve the Godot documentation by giving feedback." +#~ msgstr "" +#~ "Mithelfen die Godot-Dokumentation durch Meinungsäußerungen zu verbessern." + #~ msgid "Replaced %d occurrence(s)." #~ msgstr "Suchbegriff wurde %d mal ersetzt." diff --git a/editor/translations/de_CH.po b/editor/translations/de_CH.po index 84e1dd1599..e17231a0dd 100644 --- a/editor/translations/de_CH.po +++ b/editor/translations/de_CH.po @@ -1458,7 +1458,7 @@ msgstr "" msgid "Remove Autoload" msgstr "" -#: editor/editor_autoload_settings.cpp +#: editor/editor_autoload_settings.cpp editor/editor_plugin_settings.cpp msgid "Enable" msgstr "" @@ -2918,7 +2918,11 @@ msgid "Q&A" msgstr "" #: editor/editor_node.cpp -msgid "Issue Tracker" +msgid "Report a Bug" +msgstr "" + +#: editor/editor_node.cpp +msgid "Send Docs Feedback" msgstr "" #: editor/editor_node.cpp editor/plugins/asset_library_editor_plugin.cpp @@ -3992,7 +3996,7 @@ msgid "Reimport" msgstr "" #: editor/import_dock.cpp -msgid "Save scenes, re-import and restart" +msgid "Save Scenes, Re-Import, and Restart" msgstr "" #: editor/import_dock.cpp @@ -6925,14 +6929,6 @@ msgid "Open Godot online documentation." msgstr "" #: editor/plugins/script_editor_plugin.cpp -msgid "Request Docs" -msgstr "" - -#: editor/plugins/script_editor_plugin.cpp -msgid "Help improve the Godot documentation by giving feedback." -msgstr "" - -#: editor/plugins/script_editor_plugin.cpp msgid "Search the reference documentation." msgstr "" @@ -7378,6 +7374,10 @@ msgid "This operation requires a single selected node." msgstr "Bitte nur ein Node selektieren." #: editor/plugins/spatial_editor_plugin.cpp +msgid "Auto Orthogonal Enabled" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Lock View Rotation" msgstr "" @@ -7468,13 +7468,13 @@ msgid "Freelook Slow Modifier" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "" -"Note: The FPS value displayed is the editor's framerate.\n" -"It cannot be used as a reliable indication of in-game performance." +msgid "View Rotation Locked" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "View Rotation Locked" +msgid "" +"Note: The FPS value displayed is the editor's framerate.\n" +"It cannot be used as a reliable indication of in-game performance." msgstr "" #: editor/plugins/spatial_editor_plugin.cpp @@ -10962,6 +10962,12 @@ msgid "Script file already exists." msgstr "" #: editor/script_create_dialog.cpp +msgid "" +"Note: Built-in scripts have some limitations and can't be edited using an " +"external editor." +msgstr "" + +#: editor/script_create_dialog.cpp msgid "Class Name:" msgstr "" @@ -12667,6 +12673,10 @@ msgid "" "texture to some node for display." msgstr "" +#: scene/main/viewport.cpp +msgid "Viewport size must be greater than 0 to render anything." +msgstr "" + #: scene/resources/visual_shader_nodes.cpp msgid "Invalid source for preview." msgstr "" diff --git a/editor/translations/editor.pot b/editor/translations/editor.pot index 232f6eb087..466aa8fa7f 100644 --- a/editor/translations/editor.pot +++ b/editor/translations/editor.pot @@ -1401,7 +1401,7 @@ msgstr "" msgid "Remove Autoload" msgstr "" -#: editor/editor_autoload_settings.cpp +#: editor/editor_autoload_settings.cpp editor/editor_plugin_settings.cpp msgid "Enable" msgstr "" @@ -2804,7 +2804,11 @@ msgid "Q&A" msgstr "" #: editor/editor_node.cpp -msgid "Issue Tracker" +msgid "Report a Bug" +msgstr "" + +#: editor/editor_node.cpp +msgid "Send Docs Feedback" msgstr "" #: editor/editor_node.cpp editor/plugins/asset_library_editor_plugin.cpp @@ -3825,7 +3829,7 @@ msgid "Reimport" msgstr "" #: editor/import_dock.cpp -msgid "Save scenes, re-import and restart" +msgid "Save Scenes, Re-Import, and Restart" msgstr "" #: editor/import_dock.cpp @@ -6607,14 +6611,6 @@ msgid "Open Godot online documentation." msgstr "" #: editor/plugins/script_editor_plugin.cpp -msgid "Request Docs" -msgstr "" - -#: editor/plugins/script_editor_plugin.cpp -msgid "Help improve the Godot documentation by giving feedback." -msgstr "" - -#: editor/plugins/script_editor_plugin.cpp msgid "Search the reference documentation." msgstr "" @@ -7044,6 +7040,10 @@ msgid "This operation requires a single selected node." msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Auto Orthogonal Enabled" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Lock View Rotation" msgstr "" @@ -7132,13 +7132,13 @@ msgid "Freelook Slow Modifier" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "" -"Note: The FPS value displayed is the editor's framerate.\n" -"It cannot be used as a reliable indication of in-game performance." +msgid "View Rotation Locked" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "View Rotation Locked" +msgid "" +"Note: The FPS value displayed is the editor's framerate.\n" +"It cannot be used as a reliable indication of in-game performance." msgstr "" #: editor/plugins/spatial_editor_plugin.cpp @@ -10456,6 +10456,12 @@ msgid "Script file already exists." msgstr "" #: editor/script_create_dialog.cpp +msgid "" +"Note: Built-in scripts have some limitations and can't be edited using an " +"external editor." +msgstr "" + +#: editor/script_create_dialog.cpp msgid "Class Name:" msgstr "" @@ -12069,6 +12075,10 @@ msgid "" "texture to some node for display." msgstr "" +#: scene/main/viewport.cpp +msgid "Viewport size must be greater than 0 to render anything." +msgstr "" + #: scene/resources/visual_shader_nodes.cpp msgid "Invalid source for preview." msgstr "" diff --git a/editor/translations/el.po b/editor/translations/el.po index fb9029a861..2c8335393b 100644 --- a/editor/translations/el.po +++ b/editor/translations/el.po @@ -11,7 +11,7 @@ msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2020-03-08 22:32+0000\n" +"PO-Revision-Date: 2020-03-23 03:47+0000\n" "Last-Translator: George Tsiamasiotis <gtsiam@windowslive.com>\n" "Language-Team: Greek <https://hosted.weblate.org/projects/godot-engine/godot/" "el/>\n" @@ -1451,7 +1451,7 @@ msgstr "Μετακίνηση AutoLoad" msgid "Remove Autoload" msgstr "Αφαίρεση AutoLoad" -#: editor/editor_autoload_settings.cpp +#: editor/editor_autoload_settings.cpp editor/editor_plugin_settings.cpp msgid "Enable" msgstr "Ενεργοποίηση" @@ -2951,8 +2951,13 @@ msgid "Q&A" msgstr "Ερωτήσεις & Απαντήσεις" #: editor/editor_node.cpp -msgid "Issue Tracker" -msgstr "Διαχείριση προβλημάτων" +#, fuzzy +msgid "Report a Bug" +msgstr "Επανεισαγωγή" + +#: editor/editor_node.cpp +msgid "Send Docs Feedback" +msgstr "" #: editor/editor_node.cpp editor/plugins/asset_library_editor_plugin.cpp msgid "Community" @@ -4013,7 +4018,8 @@ msgid "Reimport" msgstr "Επανεισαγωγή" #: editor/import_dock.cpp -msgid "Save scenes, re-import and restart" +#, fuzzy +msgid "Save Scenes, Re-Import, and Restart" msgstr "Αποθήκευση σκηνών, επανεισαγωγή και επανεκκίνηση" #: editor/import_dock.cpp @@ -5992,9 +5998,8 @@ msgstr "" "Είναι η πιο ακριβής (αλλά αργότερη) επιλογή για εντοπισμό σύγκρουσης." #: editor/plugins/mesh_instance_editor_plugin.cpp -#, fuzzy msgid "Create Single Convex Collision Sibling" -msgstr "Δημιουργία Μοναδικών Κυρτών Αδελφών Σύγκρουσης" +msgstr "Δημιουργία Μοναδικού Κυρτού Αδελφού Σύγκρουσης" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "" @@ -6889,14 +6894,6 @@ msgid "Open Godot online documentation." msgstr "Άνοιγμα ηλεκτρονικής τεκμηρίωσης της Godot." #: editor/plugins/script_editor_plugin.cpp -msgid "Request Docs" -msgstr "Αίτηση Τεκμηρίωσης" - -#: editor/plugins/script_editor_plugin.cpp -msgid "Help improve the Godot documentation by giving feedback." -msgstr "Βοηθήστε στην βελτίωση της τεκμηρίωσης σχολιάζοντας." - -#: editor/plugins/script_editor_plugin.cpp msgid "Search the reference documentation." msgstr "Αναζήτηση στην τεκμηρίωση αναφοράς." @@ -7337,6 +7334,11 @@ msgid "This operation requires a single selected node." msgstr "Αυτή η λειτουργία απαιτεί έναν μόνο επιλεγμένο κόμβο." #: editor/plugins/spatial_editor_plugin.cpp +#, fuzzy +msgid "Auto Orthogonal Enabled" +msgstr "Αξονομετρική" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Lock View Rotation" msgstr "Κλείδωμα Περιστροφής Προβολής" @@ -7425,6 +7427,10 @@ msgid "Freelook Slow Modifier" msgstr "Αργός Τροποποιητής Ελεύθερου Κοιτάγματος" #: editor/plugins/spatial_editor_plugin.cpp +msgid "View Rotation Locked" +msgstr "Κλείδωμα Περιστροφής" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." @@ -7434,10 +7440,6 @@ msgstr "" "παιχνιδιού." #: editor/plugins/spatial_editor_plugin.cpp -msgid "View Rotation Locked" -msgstr "Κλείδωμα Περιστροφής" - -#: editor/plugins/spatial_editor_plugin.cpp msgid "XForm Dialog" msgstr "Διάλογος XForm" @@ -10949,6 +10951,12 @@ msgid "Script file already exists." msgstr "Υπαρκτό αρχείο δέσμης ενεργειών." #: editor/script_create_dialog.cpp +msgid "" +"Note: Built-in scripts have some limitations and can't be edited using an " +"external editor." +msgstr "" + +#: editor/script_create_dialog.cpp msgid "Class Name:" msgstr "Όνομα Κλάσης:" @@ -12446,6 +12454,8 @@ msgstr "" msgid "" "ConcavePolygonShape doesn't support RigidBody in another mode than static." msgstr "" +"Το ConcavePolygonShape δεν υποστηρίζει το RigidBody εκτός της static " +"λειτουργίας." #: scene/3d/cpu_particles.cpp msgid "Nothing is visible because no mesh has been assigned." @@ -12749,6 +12759,10 @@ msgstr "" "μέγεθος. Αλλιώς, κάντε το ένα RenderTarget και ορίστε το internal texture σε " "έναν κόμβο για απεικόνιση." +#: scene/main/viewport.cpp +msgid "Viewport size must be greater than 0 to render anything." +msgstr "" + #: scene/resources/visual_shader_nodes.cpp msgid "Invalid source for preview." msgstr "Άκυρη πηγή για προεπισκόπηση." @@ -12777,6 +12791,15 @@ msgstr "Τα «varying» μπορούν να ανατεθούν μόνο στη msgid "Constants cannot be modified." msgstr "Οι σταθερές δεν μπορούν να τροποποιηθούν." +#~ msgid "Issue Tracker" +#~ msgstr "Διαχείριση προβλημάτων" + +#~ msgid "Request Docs" +#~ msgstr "Αίτηση Τεκμηρίωσης" + +#~ msgid "Help improve the Godot documentation by giving feedback." +#~ msgstr "Βοηθήστε στην βελτίωση της τεκμηρίωσης σχολιάζοντας." + #~ msgid "Replaced %d occurrence(s)." #~ msgstr "Αντικαταστάθηκαν %d εμφανίσεις." diff --git a/editor/translations/eo.po b/editor/translations/eo.po index cd84f54a40..7dc152659f 100644 --- a/editor/translations/eo.po +++ b/editor/translations/eo.po @@ -1439,7 +1439,7 @@ msgstr "" msgid "Remove Autoload" msgstr "" -#: editor/editor_autoload_settings.cpp +#: editor/editor_autoload_settings.cpp editor/editor_plugin_settings.cpp msgid "Enable" msgstr "" @@ -2895,7 +2895,11 @@ msgid "Q&A" msgstr "" #: editor/editor_node.cpp -msgid "Issue Tracker" +msgid "Report a Bug" +msgstr "" + +#: editor/editor_node.cpp +msgid "Send Docs Feedback" msgstr "" #: editor/editor_node.cpp editor/plugins/asset_library_editor_plugin.cpp @@ -3929,7 +3933,7 @@ msgid "Reimport" msgstr "" #: editor/import_dock.cpp -msgid "Save scenes, re-import and restart" +msgid "Save Scenes, Re-Import, and Restart" msgstr "" #: editor/import_dock.cpp @@ -6727,15 +6731,6 @@ msgid "Open Godot online documentation." msgstr "" #: editor/plugins/script_editor_plugin.cpp -msgid "Request Docs" -msgstr "" - -#: editor/plugins/script_editor_plugin.cpp -#, fuzzy -msgid "Help improve the Godot documentation by giving feedback." -msgstr "Helpi plibonigi la Godotan dokumentadon per doni reagon." - -#: editor/plugins/script_editor_plugin.cpp #, fuzzy msgid "Search the reference documentation." msgstr "Serĉi la referencan dokumentadon." @@ -7167,6 +7162,10 @@ msgid "This operation requires a single selected node." msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Auto Orthogonal Enabled" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Lock View Rotation" msgstr "" @@ -7255,13 +7254,13 @@ msgid "Freelook Slow Modifier" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "" -"Note: The FPS value displayed is the editor's framerate.\n" -"It cannot be used as a reliable indication of in-game performance." +msgid "View Rotation Locked" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "View Rotation Locked" +msgid "" +"Note: The FPS value displayed is the editor's framerate.\n" +"It cannot be used as a reliable indication of in-game performance." msgstr "" #: editor/plugins/spatial_editor_plugin.cpp @@ -10606,6 +10605,12 @@ msgid "Script file already exists." msgstr "Grupa nomo jam ekzistas." #: editor/script_create_dialog.cpp +msgid "" +"Note: Built-in scripts have some limitations and can't be edited using an " +"external editor." +msgstr "" + +#: editor/script_create_dialog.cpp #, fuzzy msgid "Class Name:" msgstr "Nomo:" @@ -12237,6 +12242,10 @@ msgid "" "texture to some node for display." msgstr "" +#: scene/main/viewport.cpp +msgid "Viewport size must be greater than 0 to render anything." +msgstr "" + #: scene/resources/visual_shader_nodes.cpp #, fuzzy msgid "Invalid source for preview." @@ -12267,6 +12276,10 @@ msgstr "" msgid "Constants cannot be modified." msgstr "" +#, fuzzy +#~ msgid "Help improve the Godot documentation by giving feedback." +#~ msgstr "Helpi plibonigi la Godotan dokumentadon per doni reagon." + #~ msgid "Replaced %d occurrence(s)." #~ msgstr "Anstataŭigis %d apero(j)n." diff --git a/editor/translations/es.po b/editor/translations/es.po index 3bbe96bcb3..c9ca261498 100644 --- a/editor/translations/es.po +++ b/editor/translations/es.po @@ -43,12 +43,15 @@ # Dario <darlex259@gmail.com>, 2019. # Adolfo Jayme Barrientos <fitojb@ubuntu.com>, 2019. # Julián Luini <jluini@gmail.com>, 2020. +# anonymous <noreply@weblate.org>, 2020. +# Victor S. <victorstancioiu@gmail.com>, 2020. +# henry rujano herrera <rujhen@gmail.com>, 2020. msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2020-03-11 12:20+0000\n" -"Last-Translator: Javier Ocampos <xavier.ocampos@gmail.com>\n" +"PO-Revision-Date: 2020-04-16 11:03+0000\n" +"Last-Translator: anonymous <noreply@weblate.org>\n" "Language-Team: Spanish <https://hosted.weblate.org/projects/godot-engine/" "godot/es/>\n" "Language: es\n" @@ -56,12 +59,13 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 4.0-dev\n" +"X-Generator: Weblate 4.0.1-dev\n" #: core/math/expression.cpp modules/gdscript/gdscript_functions.cpp #: modules/visual_script/visual_script_builtin_funcs.cpp msgid "Invalid type argument to convert(), use TYPE_* constants." -msgstr "Argumento de tipo inválido para convert(), utiliza constantes TYPE_*." +msgstr "" +"Tipo de argumento inválido para 'convert()', utiliza constantes TYPE_*." #: core/math/expression.cpp modules/gdscript/gdscript_functions.cpp msgid "Expected a string of length 1 (a character)." @@ -76,7 +80,7 @@ msgstr "" #: core/math/expression.cpp msgid "Invalid input %i (not passed) in expression" -msgstr "Entrada inválida %i (no pasó) en la expresión" +msgstr "Entrada inválida %i (no se pasó) en la expresión" #: core/math/expression.cpp msgid "self can't be used because instance is null (not passed)" @@ -638,7 +642,7 @@ msgstr "Usar Curvas Bezier" #: editor/animation_track_editor.cpp msgid "Anim. Optimizer" -msgstr "Optimizar Animación" +msgstr "Optimizador de Animación" #: editor/animation_track_editor.cpp msgid "Max. Linear Error:" @@ -841,7 +845,7 @@ msgstr "Eliminar" #: editor/connections_dialog.cpp msgid "Add Extra Call Argument:" -msgstr "Añadir Argumento de Llamada Extra:" +msgstr "Añadir un Argumento de Llamada Extra:" #: editor/connections_dialog.cpp msgid "Extra Call Arguments:" @@ -1488,7 +1492,7 @@ msgstr "Mover Autoload" msgid "Remove Autoload" msgstr "Eliminar Autoload" -#: editor/editor_autoload_settings.cpp +#: editor/editor_autoload_settings.cpp editor/editor_plugin_settings.cpp msgid "Enable" msgstr "Activar" @@ -2990,8 +2994,13 @@ msgid "Q&A" msgstr "Preguntas y respuestas" #: editor/editor_node.cpp -msgid "Issue Tracker" -msgstr "Registro de problemas" +#, fuzzy +msgid "Report a Bug" +msgstr "Reimportar" + +#: editor/editor_node.cpp +msgid "Send Docs Feedback" +msgstr "" #: editor/editor_node.cpp editor/plugins/asset_library_editor_plugin.cpp msgid "Community" @@ -3003,7 +3012,7 @@ msgstr "Acerca de" #: editor/editor_node.cpp msgid "Play the project." -msgstr "Reproducir el proyecto." +msgstr "Ejecutar el proyecto." #: editor/editor_node.cpp msgid "Play" @@ -4051,7 +4060,8 @@ msgid "Reimport" msgstr "Reimportar" #: editor/import_dock.cpp -msgid "Save scenes, re-import and restart" +#, fuzzy +msgid "Save Scenes, Re-Import, and Restart" msgstr "Guardar escenas, reimportar y reiniciar" #: editor/import_dock.cpp @@ -5264,7 +5274,7 @@ msgid "" "When active, moving Control nodes changes their anchors instead of their " "margins." msgstr "" -"Cuando esté activo, los nodos de Control en movimiento cambian sus anclas en " +"Cuando esté activo, moviendo los nodos de Control cambiará sus anclas en " "lugar de sus márgenes." #: editor/plugins/canvas_item_editor_plugin.cpp @@ -6921,14 +6931,6 @@ msgid "Open Godot online documentation." msgstr "Abrir la documentación en línea de Godot." #: editor/plugins/script_editor_plugin.cpp -msgid "Request Docs" -msgstr "Solicitar Documentos" - -#: editor/plugins/script_editor_plugin.cpp -msgid "Help improve the Godot documentation by giving feedback." -msgstr "Ayuda a mejorar la documentación de Godot aportando retroalimentación." - -#: editor/plugins/script_editor_plugin.cpp msgid "Search the reference documentation." msgstr "Buscar en la documentación de referencia." @@ -7365,6 +7367,11 @@ msgid "This operation requires a single selected node." msgstr "Esta operación requiere un solo nodo seleccionado." #: editor/plugins/spatial_editor_plugin.cpp +#, fuzzy +msgid "Auto Orthogonal Enabled" +msgstr "Ortogonal" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Lock View Rotation" msgstr "Bloquear Rotación de Vista" @@ -7453,6 +7460,10 @@ msgid "Freelook Slow Modifier" msgstr "Modificador de Velocidad de Vista Libre" #: editor/plugins/spatial_editor_plugin.cpp +msgid "View Rotation Locked" +msgstr "Bloquear Rotación de Vista" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." @@ -7461,10 +7472,6 @@ msgstr "" "No se puede utilizar como un indicador fiable del rendimiento en el juego." #: editor/plugins/spatial_editor_plugin.cpp -msgid "View Rotation Locked" -msgstr "Bloquear Rotación de Vista" - -#: editor/plugins/spatial_editor_plugin.cpp msgid "XForm Dialog" msgstr "Diálogo XForm" @@ -7823,7 +7830,7 @@ msgstr "Añadir Textura desde Archivo" #: editor/plugins/sprite_frames_editor_plugin.cpp msgid "Add Frames from a Sprite Sheet" -msgstr "Añadir Frames de un Sprite Sheet" +msgstr "Añadir Frames desde un Sprite Sheet" #: editor/plugins/sprite_frames_editor_plugin.cpp msgid "Insert Empty (Before)" @@ -8457,11 +8464,11 @@ msgstr "Editar Índice Z de Tile" #: editor/plugins/tile_set_editor_plugin.cpp msgid "Make Convex" -msgstr "Crear Convexo" +msgstr "Hacerlo Convexo" #: editor/plugins/tile_set_editor_plugin.cpp msgid "Make Concave" -msgstr "Crear Cóncavo" +msgstr "Hacerlo Cóncavo" #: editor/plugins/tile_set_editor_plugin.cpp msgid "Create Collision Polygon" @@ -9447,7 +9454,7 @@ msgstr "Editar Propiedad Visual" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Visual Shader Mode Changed" -msgstr "Cambiar Modo de Visual Shader" +msgstr "El Modo de Visual Shader ha cambiado" #: editor/project_export.cpp msgid "Runnable" @@ -9518,7 +9525,7 @@ msgid "" "Only one preset per platform may be marked as runnable." msgstr "" "Si se selecciona, la plantilla estará disponible para su uso en un " -"despliegue con “un click”.\n" +"despliegue con un clic.\n" "Sólo se puede marcar como ejecutable una plantilla por plataforma." #: editor/project_export.cpp @@ -10977,6 +10984,12 @@ msgid "Script file already exists." msgstr "El archivo de script ya existe." #: editor/script_create_dialog.cpp +msgid "" +"Note: Built-in scripts have some limitations and can't be edited using an " +"external editor." +msgstr "" + +#: editor/script_create_dialog.cpp msgid "Class Name:" msgstr "Nombre de Clase:" @@ -11430,7 +11443,7 @@ msgstr "Eliminar Rotación del Cursor" #: modules/gridmap/grid_map_editor_plugin.cpp msgid "Paste Selects" -msgstr "Pegar Seleccionados" +msgstr "Pegar Selecciona" #: modules/gridmap/grid_map_editor_plugin.cpp msgid "Clear Selection" @@ -12020,7 +12033,7 @@ msgid "" "Trying to build from a custom built template, but no version info for it " "exists. Please reinstall from the 'Project' menu." msgstr "" -"Intentando construir a partir de una plantilla personalizada, pero no existe " +"Se intentó construir a partir de una plantilla personalizada, pero no existe " "información de la versión para ello. Por favor, reinstala desde el menú " "'Proyecto'." @@ -12785,6 +12798,10 @@ msgstr "" "bien, conviértalo en un RenderTarget y asigne su textura interna a algún " "nodo para que se muestre." +#: scene/main/viewport.cpp +msgid "Viewport size must be greater than 0 to render anything." +msgstr "" + #: scene/resources/visual_shader_nodes.cpp msgid "Invalid source for preview." msgstr "Fuente inválida para la vista previa." @@ -12813,6 +12830,16 @@ msgstr "Solo se pueden asignar variaciones en funciones de vértice." msgid "Constants cannot be modified." msgstr "Las constantes no pueden modificarse." +#~ msgid "Issue Tracker" +#~ msgstr "Registro de problemas" + +#~ msgid "Request Docs" +#~ msgstr "Solicitar Documentos" + +#~ msgid "Help improve the Godot documentation by giving feedback." +#~ msgstr "" +#~ "Ayuda a mejorar la documentación de Godot aportando retroalimentación." + #~ msgid "Replaced %d occurrence(s)." #~ msgstr "%d ocurrencia(s) reemplazada(s)." diff --git a/editor/translations/es_AR.po b/editor/translations/es_AR.po index 7781d59f34..7e7ed33aca 100644 --- a/editor/translations/es_AR.po +++ b/editor/translations/es_AR.po @@ -1457,7 +1457,7 @@ msgstr "Mover Autoload" msgid "Remove Autoload" msgstr "Quitar Autoload" -#: editor/editor_autoload_settings.cpp +#: editor/editor_autoload_settings.cpp editor/editor_plugin_settings.cpp msgid "Enable" msgstr "Activar" @@ -2954,8 +2954,13 @@ msgid "Q&A" msgstr "Q&A" #: editor/editor_node.cpp -msgid "Issue Tracker" -msgstr "Registro de problemas" +#, fuzzy +msgid "Report a Bug" +msgstr "Reimportar" + +#: editor/editor_node.cpp +msgid "Send Docs Feedback" +msgstr "" #: editor/editor_node.cpp editor/plugins/asset_library_editor_plugin.cpp msgid "Community" @@ -4015,7 +4020,8 @@ msgid "Reimport" msgstr "Reimportar" #: editor/import_dock.cpp -msgid "Save scenes, re-import and restart" +#, fuzzy +msgid "Save Scenes, Re-Import, and Restart" msgstr "Guardar escenas, reimportar y reiniciar" #: editor/import_dock.cpp @@ -6881,14 +6887,6 @@ msgid "Open Godot online documentation." msgstr "Abrir la documentación en línea de Godot." #: editor/plugins/script_editor_plugin.cpp -msgid "Request Docs" -msgstr "Solicitar Docum." - -#: editor/plugins/script_editor_plugin.cpp -msgid "Help improve the Godot documentation by giving feedback." -msgstr "Ayudá a mejorar la documentación de Godot dando feedback." - -#: editor/plugins/script_editor_plugin.cpp msgid "Search the reference documentation." msgstr "Buscar en la documentación de referencia." @@ -7325,6 +7323,11 @@ msgid "This operation requires a single selected node." msgstr "Esta operación requiere un solo nodo seleccionado." #: editor/plugins/spatial_editor_plugin.cpp +#, fuzzy +msgid "Auto Orthogonal Enabled" +msgstr "Ortogonal" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Lock View Rotation" msgstr "Trabar Rotación de Vista" @@ -7413,6 +7416,10 @@ msgid "Freelook Slow Modifier" msgstr "Modificador de Velocidad de Vista Libre" #: editor/plugins/spatial_editor_plugin.cpp +msgid "View Rotation Locked" +msgstr "Rotación de Vista Trabada" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." @@ -7421,10 +7428,6 @@ msgstr "" "No se puede utilizar como un indicador fiable del rendimiento en el juego." #: editor/plugins/spatial_editor_plugin.cpp -msgid "View Rotation Locked" -msgstr "Rotación de Vista Trabada" - -#: editor/plugins/spatial_editor_plugin.cpp msgid "XForm Dialog" msgstr "Dialogo XForm" @@ -10937,6 +10940,12 @@ msgid "Script file already exists." msgstr "El archivo de script ya existe." #: editor/script_create_dialog.cpp +msgid "" +"Note: Built-in scripts have some limitations and can't be edited using an " +"external editor." +msgstr "" + +#: editor/script_create_dialog.cpp msgid "Class Name:" msgstr "Nombre de Clase:" @@ -12736,6 +12745,10 @@ msgstr "" "pueda obtener un tamaño. Alternativamente, haz un RenderTarget y asigna su " "textura interna a algún otro nodo para mostrar." +#: scene/main/viewport.cpp +msgid "Viewport size must be greater than 0 to render anything." +msgstr "" + #: scene/resources/visual_shader_nodes.cpp msgid "Invalid source for preview." msgstr "Fuente inválida para la vista previa." @@ -12764,6 +12777,15 @@ msgstr "Solo se pueden asignar variaciones en funciones de vértice." msgid "Constants cannot be modified." msgstr "Las constantes no pueden modificarse." +#~ msgid "Issue Tracker" +#~ msgstr "Registro de problemas" + +#~ msgid "Request Docs" +#~ msgstr "Solicitar Docum." + +#~ msgid "Help improve the Godot documentation by giving feedback." +#~ msgstr "Ayudá a mejorar la documentación de Godot dando feedback." + #~ msgid "Replaced %d occurrence(s)." #~ msgstr "%d ocurrencia(s) Reemplazadas." diff --git a/editor/translations/et.po b/editor/translations/et.po index 9b9d9b9137..6c052803e0 100644 --- a/editor/translations/et.po +++ b/editor/translations/et.po @@ -1409,7 +1409,7 @@ msgstr "" msgid "Remove Autoload" msgstr "" -#: editor/editor_autoload_settings.cpp +#: editor/editor_autoload_settings.cpp editor/editor_plugin_settings.cpp msgid "Enable" msgstr "" @@ -2816,7 +2816,11 @@ msgid "Q&A" msgstr "" #: editor/editor_node.cpp -msgid "Issue Tracker" +msgid "Report a Bug" +msgstr "" + +#: editor/editor_node.cpp +msgid "Send Docs Feedback" msgstr "" #: editor/editor_node.cpp editor/plugins/asset_library_editor_plugin.cpp @@ -3838,7 +3842,7 @@ msgid "Reimport" msgstr "" #: editor/import_dock.cpp -msgid "Save scenes, re-import and restart" +msgid "Save Scenes, Re-Import, and Restart" msgstr "" #: editor/import_dock.cpp @@ -6626,14 +6630,6 @@ msgid "Open Godot online documentation." msgstr "" #: editor/plugins/script_editor_plugin.cpp -msgid "Request Docs" -msgstr "" - -#: editor/plugins/script_editor_plugin.cpp -msgid "Help improve the Godot documentation by giving feedback." -msgstr "" - -#: editor/plugins/script_editor_plugin.cpp msgid "Search the reference documentation." msgstr "" @@ -7064,6 +7060,10 @@ msgid "This operation requires a single selected node." msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Auto Orthogonal Enabled" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Lock View Rotation" msgstr "" @@ -7152,13 +7152,13 @@ msgid "Freelook Slow Modifier" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "" -"Note: The FPS value displayed is the editor's framerate.\n" -"It cannot be used as a reliable indication of in-game performance." +msgid "View Rotation Locked" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "View Rotation Locked" +msgid "" +"Note: The FPS value displayed is the editor's framerate.\n" +"It cannot be used as a reliable indication of in-game performance." msgstr "" #: editor/plugins/spatial_editor_plugin.cpp @@ -10481,6 +10481,12 @@ msgid "Script file already exists." msgstr "" #: editor/script_create_dialog.cpp +msgid "" +"Note: Built-in scripts have some limitations and can't be edited using an " +"external editor." +msgstr "" + +#: editor/script_create_dialog.cpp msgid "Class Name:" msgstr "" @@ -12100,6 +12106,10 @@ msgid "" "texture to some node for display." msgstr "" +#: scene/main/viewport.cpp +msgid "Viewport size must be greater than 0 to render anything." +msgstr "" + #: scene/resources/visual_shader_nodes.cpp msgid "Invalid source for preview." msgstr "" diff --git a/editor/translations/eu.po b/editor/translations/eu.po index 1075a4a046..49fb37e599 100644 --- a/editor/translations/eu.po +++ b/editor/translations/eu.po @@ -1406,7 +1406,7 @@ msgstr "" msgid "Remove Autoload" msgstr "" -#: editor/editor_autoload_settings.cpp +#: editor/editor_autoload_settings.cpp editor/editor_plugin_settings.cpp msgid "Enable" msgstr "" @@ -2809,7 +2809,11 @@ msgid "Q&A" msgstr "" #: editor/editor_node.cpp -msgid "Issue Tracker" +msgid "Report a Bug" +msgstr "" + +#: editor/editor_node.cpp +msgid "Send Docs Feedback" msgstr "" #: editor/editor_node.cpp editor/plugins/asset_library_editor_plugin.cpp @@ -3830,7 +3834,7 @@ msgid "Reimport" msgstr "" #: editor/import_dock.cpp -msgid "Save scenes, re-import and restart" +msgid "Save Scenes, Re-Import, and Restart" msgstr "" #: editor/import_dock.cpp @@ -6612,14 +6616,6 @@ msgid "Open Godot online documentation." msgstr "" #: editor/plugins/script_editor_plugin.cpp -msgid "Request Docs" -msgstr "" - -#: editor/plugins/script_editor_plugin.cpp -msgid "Help improve the Godot documentation by giving feedback." -msgstr "" - -#: editor/plugins/script_editor_plugin.cpp msgid "Search the reference documentation." msgstr "" @@ -7049,6 +7045,10 @@ msgid "This operation requires a single selected node." msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Auto Orthogonal Enabled" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Lock View Rotation" msgstr "" @@ -7137,13 +7137,13 @@ msgid "Freelook Slow Modifier" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "" -"Note: The FPS value displayed is the editor's framerate.\n" -"It cannot be used as a reliable indication of in-game performance." +msgid "View Rotation Locked" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "View Rotation Locked" +msgid "" +"Note: The FPS value displayed is the editor's framerate.\n" +"It cannot be used as a reliable indication of in-game performance." msgstr "" #: editor/plugins/spatial_editor_plugin.cpp @@ -10461,6 +10461,12 @@ msgid "Script file already exists." msgstr "" #: editor/script_create_dialog.cpp +msgid "" +"Note: Built-in scripts have some limitations and can't be edited using an " +"external editor." +msgstr "" + +#: editor/script_create_dialog.cpp msgid "Class Name:" msgstr "" @@ -12074,6 +12080,10 @@ msgid "" "texture to some node for display." msgstr "" +#: scene/main/viewport.cpp +msgid "Viewport size must be greater than 0 to render anything." +msgstr "" + #: scene/resources/visual_shader_nodes.cpp msgid "Invalid source for preview." msgstr "" diff --git a/editor/translations/extract.py b/editor/translations/extract.py index 10859c7c90..749bad5fff 100755 --- a/editor/translations/extract.py +++ b/editor/translations/extract.py @@ -10,23 +10,23 @@ import sys line_nb = False for arg in sys.argv[1:]: - if (arg == "--with-line-nb"): + if arg == "--with-line-nb": print("Enabling line numbers in the context locations.") line_nb = True else: os.sys.exit("Non supported argument '" + arg + "'. Aborting.") -if (not os.path.exists("editor")): +if not os.path.exists("editor"): os.sys.exit("ERROR: This script should be started from the root of the git repo.") matches = [] -for root, dirnames, filenames in os.walk('.'): +for root, dirnames, filenames in os.walk("."): dirnames[:] = [d for d in dirnames if d not in ["thirdparty"]] - for filename in fnmatch.filter(filenames, '*.cpp'): + for filename in fnmatch.filter(filenames, "*.cpp"): matches.append(os.path.join(root, filename)) - for filename in fnmatch.filter(filenames, '*.h'): + for filename in fnmatch.filter(filenames, "*.h"): matches.append(os.path.join(root, filename)) matches.sort() @@ -51,52 +51,54 @@ msgstr "" "Content-Transfer-Encoding: 8-bit\\n" """ + def process_file(f, fname): global main_po, unique_str, unique_loc l = f.readline() lc = 1 - while (l): + while l: - patterns = ['RTR(\"', 'TTR(\"', 'TTRC(\"'] + patterns = ['RTR("', 'TTR("', 'TTRC("'] idx = 0 pos = 0 - while (pos >= 0): + while pos >= 0: pos = l.find(patterns[idx], pos) - if (pos == -1): - if (idx < len(patterns) - 1): + if pos == -1: + if idx < len(patterns) - 1: idx += 1 pos = 0 continue pos += len(patterns[idx]) msg = "" - while (pos < len(l) and (l[pos] != '"' or l[pos - 1] == '\\')): + while pos < len(l) and (l[pos] != '"' or l[pos - 1] == "\\"): msg += l[pos] pos += 1 - location = os.path.relpath(fname).replace('\\', '/') - if (line_nb): + location = os.path.relpath(fname).replace("\\", "/") + if line_nb: location += ":" + str(lc) - if (not msg in unique_str): + if not msg in unique_str: main_po += "\n#: " + location + "\n" main_po += 'msgid "' + msg + '"\n' main_po += 'msgstr ""\n' unique_str.append(msg) unique_loc[msg] = [location] - elif (not location in unique_loc[msg]): + elif not location in unique_loc[msg]: # Add additional location to previous occurrence too msg_pos = main_po.find('\nmsgid "' + msg + '"') - if (msg_pos == -1): + if msg_pos == -1: print("Someone apparently thought writing Python was as easy as GDScript. Ping Akien.") - main_po = main_po[:msg_pos] + ' ' + location + main_po[msg_pos:] + main_po = main_po[:msg_pos] + " " + location + main_po[msg_pos:] unique_loc[msg].append(location) l = f.readline() lc += 1 + print("Updating the editor.pot template...") for fname in matches: @@ -106,7 +108,7 @@ for fname in matches: with open("editor.pot", "w") as f: f.write(main_po) -if (os.name == "posix"): +if os.name == "posix": print("Wrapping template at 79 characters for compatibility with Weblate.") os.system("msgmerge -w79 editor.pot editor.pot > editor.pot.wrap") shutil.move("editor.pot.wrap", "editor.pot") @@ -114,7 +116,7 @@ if (os.name == "posix"): shutil.move("editor.pot", "editor/translations/editor.pot") # TODO: Make that in a portable way, if we care; if not, kudos to Unix users -if (os.name == "posix"): +if os.name == "posix": added = subprocess.check_output(r"git diff editor/translations/editor.pot | grep \+msgid | wc -l", shell=True) removed = subprocess.check_output(r"git diff editor/translations/editor.pot | grep \\\-msgid | wc -l", shell=True) print("\n# Template changes compared to the staged status:") diff --git a/editor/translations/fa.po b/editor/translations/fa.po index caee80995e..f45393c505 100644 --- a/editor/translations/fa.po +++ b/editor/translations/fa.po @@ -10,7 +10,7 @@ # sayyed hamed nasib <cghamed752@chmail.ir>, 2017. # Behrooz Kashani <bkashani@gmail.com>, 2018. # Mahdi <sadisticwarlock@gmail.com>, 2018. -# hpn33 <hamed.hpn332@gmail.com>, 2019. +# hpn33 <hamed.hpn332@gmail.com>, 2019, 2020. # Focus <saeeddashticlash@gmail.com>, 2019. # anonymous <noreply@weblate.org>, 2020. # mohamad por <mohamad24xx@gmail.com>, 2020. @@ -18,8 +18,8 @@ msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2020-03-08 22:33+0000\n" -"Last-Translator: mohamad por <mohamad24xx@gmail.com>\n" +"PO-Revision-Date: 2020-04-09 07:52+0000\n" +"Last-Translator: hpn33 <hamed.hpn332@gmail.com>\n" "Language-Team: Persian <https://hosted.weblate.org/projects/godot-engine/" "godot/fa/>\n" "Language: fa\n" @@ -31,10 +31,9 @@ msgstr "" #: core/math/expression.cpp modules/gdscript/gdscript_functions.cpp #: modules/visual_script/visual_script_builtin_funcs.cpp -#, fuzzy msgid "Invalid type argument to convert(), use TYPE_* constants." msgstr "" -"نوع آرگومان برای متد ()convert نامعتبر است ، از ثابت های *_TYPE استفاده " +"نوع ورودی برای متد ()convert نامعتبر است ، از ثابت های *_TYPE استفاده " "کنید ." #: core/math/expression.cpp modules/gdscript/gdscript_functions.cpp @@ -1497,7 +1496,7 @@ msgstr "" msgid "Remove Autoload" msgstr "" -#: editor/editor_autoload_settings.cpp +#: editor/editor_autoload_settings.cpp editor/editor_plugin_settings.cpp msgid "Enable" msgstr "" @@ -2984,7 +2983,12 @@ msgid "Q&A" msgstr "" #: editor/editor_node.cpp -msgid "Issue Tracker" +#, fuzzy +msgid "Report a Bug" +msgstr "وارد کردن دوباره" + +#: editor/editor_node.cpp +msgid "Send Docs Feedback" msgstr "" #: editor/editor_node.cpp editor/plugins/asset_library_editor_plugin.cpp @@ -4071,7 +4075,7 @@ msgid "Reimport" msgstr "وارد کردن دوباره" #: editor/import_dock.cpp -msgid "Save scenes, re-import and restart" +msgid "Save Scenes, Re-Import, and Restart" msgstr "" #: editor/import_dock.cpp @@ -7017,14 +7021,6 @@ msgid "Open Godot online documentation." msgstr "شمارش ها" #: editor/plugins/script_editor_plugin.cpp -msgid "Request Docs" -msgstr "" - -#: editor/plugins/script_editor_plugin.cpp -msgid "Help improve the Godot documentation by giving feedback." -msgstr "" - -#: editor/plugins/script_editor_plugin.cpp msgid "Search the reference documentation." msgstr "" @@ -7483,6 +7479,10 @@ msgid "This operation requires a single selected node." msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Auto Orthogonal Enabled" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp #, fuzzy msgid "Lock View Rotation" msgstr "بومیسازی" @@ -7578,17 +7578,17 @@ msgid "Freelook Slow Modifier" msgstr "غلطاندن به پایین." #: editor/plugins/spatial_editor_plugin.cpp +#, fuzzy +msgid "View Rotation Locked" +msgstr "بومیسازی" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -#, fuzzy -msgid "View Rotation Locked" -msgstr "بومیسازی" - -#: editor/plugins/spatial_editor_plugin.cpp msgid "XForm Dialog" msgstr "" @@ -11119,6 +11119,12 @@ msgid "Script file already exists." msgstr "پیش از این وجود داشته است" #: editor/script_create_dialog.cpp +msgid "" +"Note: Built-in scripts have some limitations and can't be edited using an " +"external editor." +msgstr "" + +#: editor/script_create_dialog.cpp #, fuzzy msgid "Class Name:" msgstr "کلاس:" @@ -12899,6 +12905,10 @@ msgstr "" "تا بتواند یک اندازه بگیرد. در غیر اینصورت، آن را یک RenderTarget قرار دهید و " "بافت داخلی آن را برای نمایش به تعدادی گره تخصیص دهید." +#: scene/main/viewport.cpp +msgid "Viewport size must be greater than 0 to render anything." +msgstr "" + #: scene/resources/visual_shader_nodes.cpp #, fuzzy msgid "Invalid source for preview." diff --git a/editor/translations/fi.po b/editor/translations/fi.po index 2798d56d28..74bc461021 100644 --- a/editor/translations/fi.po +++ b/editor/translations/fi.po @@ -1444,7 +1444,7 @@ msgstr "Siirrä automaattisesti ladattavaa" msgid "Remove Autoload" msgstr "Poista automaattinen lataus" -#: editor/editor_autoload_settings.cpp +#: editor/editor_autoload_settings.cpp editor/editor_plugin_settings.cpp msgid "Enable" msgstr "Ota käyttöön" @@ -2921,8 +2921,13 @@ msgid "Q&A" msgstr "Kysymykset ja vastaukset" #: editor/editor_node.cpp -msgid "Issue Tracker" -msgstr "Ilmoita viasta" +#, fuzzy +msgid "Report a Bug" +msgstr "Tuo uudelleen" + +#: editor/editor_node.cpp +msgid "Send Docs Feedback" +msgstr "" #: editor/editor_node.cpp editor/plugins/asset_library_editor_plugin.cpp msgid "Community" @@ -3976,7 +3981,8 @@ msgid "Reimport" msgstr "Tuo uudelleen" #: editor/import_dock.cpp -msgid "Save scenes, re-import and restart" +#, fuzzy +msgid "Save Scenes, Re-Import, and Restart" msgstr "Tallenna skenet, tuo uudelleen ja käynnistä uudelleen" #: editor/import_dock.cpp @@ -6836,14 +6842,6 @@ msgid "Open Godot online documentation." msgstr "Avaa Godotin online-dokumentaatio." #: editor/plugins/script_editor_plugin.cpp -msgid "Request Docs" -msgstr "Pyydä dokumentaatiota" - -#: editor/plugins/script_editor_plugin.cpp -msgid "Help improve the Godot documentation by giving feedback." -msgstr "Auta parantamaan Godotin dokumentaatiota antamalla palautetta." - -#: editor/plugins/script_editor_plugin.cpp msgid "Search the reference documentation." msgstr "Etsi dokumentaatiosta." @@ -7279,6 +7277,11 @@ msgid "This operation requires a single selected node." msgstr "Tämä toiminto vaatii yhden valitun solmun." #: editor/plugins/spatial_editor_plugin.cpp +#, fuzzy +msgid "Auto Orthogonal Enabled" +msgstr "Ortogonaalinen" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Lock View Rotation" msgstr "Lukitse näkymän kierto" @@ -7367,6 +7370,10 @@ msgid "Freelook Slow Modifier" msgstr "Liikkumisen hitauskerroin" #: editor/plugins/spatial_editor_plugin.cpp +msgid "View Rotation Locked" +msgstr "Näkymän kierto lukittu" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." @@ -7375,10 +7382,6 @@ msgstr "" "Sitä ei voi käyttää luotettavana pelin sisäisenä tehokkuuden ilmaisimena." #: editor/plugins/spatial_editor_plugin.cpp -msgid "View Rotation Locked" -msgstr "Näkymän kierto lukittu" - -#: editor/plugins/spatial_editor_plugin.cpp msgid "XForm Dialog" msgstr "XForm-ikkuna" @@ -10882,6 +10885,12 @@ msgid "Script file already exists." msgstr "Skriptitiedosto on jo olemassa." #: editor/script_create_dialog.cpp +msgid "" +"Note: Built-in scripts have some limitations and can't be edited using an " +"external editor." +msgstr "" + +#: editor/script_create_dialog.cpp msgid "Class Name:" msgstr "Luokan nimi:" @@ -12661,6 +12670,10 @@ msgstr "" "saada koon. Muutoin tee siitä RenderTarget ja aseta sen sisäinen tekstuuri " "johonkin solmuun näkyväksi." +#: scene/main/viewport.cpp +msgid "Viewport size must be greater than 0 to render anything." +msgstr "" + #: scene/resources/visual_shader_nodes.cpp msgid "Invalid source for preview." msgstr "Virheellinen lähde esikatselulle." @@ -12689,6 +12702,15 @@ msgstr "Varying tyypin voi sijoittaa vain vertex-funktiossa." msgid "Constants cannot be modified." msgstr "Vakioita ei voi muokata." +#~ msgid "Issue Tracker" +#~ msgstr "Ilmoita viasta" + +#~ msgid "Request Docs" +#~ msgstr "Pyydä dokumentaatiota" + +#~ msgid "Help improve the Godot documentation by giving feedback." +#~ msgstr "Auta parantamaan Godotin dokumentaatiota antamalla palautetta." + #~ msgid "Replaced %d occurrence(s)." #~ msgstr "Korvattu %d osuvuutta." diff --git a/editor/translations/fil.po b/editor/translations/fil.po index 60445be723..5a1942fee5 100644 --- a/editor/translations/fil.po +++ b/editor/translations/fil.po @@ -1414,7 +1414,7 @@ msgstr "" msgid "Remove Autoload" msgstr "" -#: editor/editor_autoload_settings.cpp +#: editor/editor_autoload_settings.cpp editor/editor_plugin_settings.cpp msgid "Enable" msgstr "" @@ -2818,7 +2818,11 @@ msgid "Q&A" msgstr "" #: editor/editor_node.cpp -msgid "Issue Tracker" +msgid "Report a Bug" +msgstr "" + +#: editor/editor_node.cpp +msgid "Send Docs Feedback" msgstr "" #: editor/editor_node.cpp editor/plugins/asset_library_editor_plugin.cpp @@ -3841,7 +3845,7 @@ msgid "Reimport" msgstr "" #: editor/import_dock.cpp -msgid "Save scenes, re-import and restart" +msgid "Save Scenes, Re-Import, and Restart" msgstr "" #: editor/import_dock.cpp @@ -6628,14 +6632,6 @@ msgid "Open Godot online documentation." msgstr "" #: editor/plugins/script_editor_plugin.cpp -msgid "Request Docs" -msgstr "" - -#: editor/plugins/script_editor_plugin.cpp -msgid "Help improve the Godot documentation by giving feedback." -msgstr "" - -#: editor/plugins/script_editor_plugin.cpp msgid "Search the reference documentation." msgstr "" @@ -7065,6 +7061,10 @@ msgid "This operation requires a single selected node." msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Auto Orthogonal Enabled" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Lock View Rotation" msgstr "" @@ -7153,13 +7153,13 @@ msgid "Freelook Slow Modifier" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "" -"Note: The FPS value displayed is the editor's framerate.\n" -"It cannot be used as a reliable indication of in-game performance." +msgid "View Rotation Locked" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "View Rotation Locked" +msgid "" +"Note: The FPS value displayed is the editor's framerate.\n" +"It cannot be used as a reliable indication of in-game performance." msgstr "" #: editor/plugins/spatial_editor_plugin.cpp @@ -10480,6 +10480,12 @@ msgid "Script file already exists." msgstr "" #: editor/script_create_dialog.cpp +msgid "" +"Note: Built-in scripts have some limitations and can't be edited using an " +"external editor." +msgstr "" + +#: editor/script_create_dialog.cpp msgid "Class Name:" msgstr "" @@ -12098,6 +12104,10 @@ msgid "" "texture to some node for display." msgstr "" +#: scene/main/viewport.cpp +msgid "Viewport size must be greater than 0 to render anything." +msgstr "" + #: scene/resources/visual_shader_nodes.cpp msgid "Invalid source for preview." msgstr "" diff --git a/editor/translations/fr.po b/editor/translations/fr.po index 2c53fcb8e2..0844df8dc7 100644 --- a/editor/translations/fr.po +++ b/editor/translations/fr.po @@ -70,12 +70,14 @@ # Camille Mohr-Daurat <pouleyketchoup@gmail.com>, 2019. # Pierre Stempin <pierre.stempin@gmail.com>, 2019. # Pierre Caye <pierrecaye@laposte.net>, 2020. +# Kevin Bouancheau <kevin.bouancheau@gmail.com>, 2020. +# anonymous <noreply@weblate.org>, 2020. msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2020-02-27 07:01+0000\n" -"Last-Translator: Pierre Caye <pierrecaye@laposte.net>\n" +"PO-Revision-Date: 2020-04-03 09:09+0000\n" +"Last-Translator: anonymous <noreply@weblate.org>\n" "Language-Team: French <https://hosted.weblate.org/projects/godot-engine/" "godot/fr/>\n" "Language: fr\n" @@ -93,7 +95,7 @@ msgstr "" #: core/math/expression.cpp modules/gdscript/gdscript_functions.cpp msgid "Expected a string of length 1 (a character)." -msgstr "Attendu chaîne de longueur 1 (un caractère)." +msgstr "Une chaîne de caractères de longueur 1 est attendue (un caractère)." #: core/math/expression.cpp modules/gdscript/gdscript_functions.cpp #: modules/mono/glue/gd_glue.cpp @@ -1518,7 +1520,7 @@ msgstr "Déplacer l'AutoLoad" msgid "Remove Autoload" msgstr "Supprimer l'AutoLoad" -#: editor/editor_autoload_settings.cpp +#: editor/editor_autoload_settings.cpp editor/editor_plugin_settings.cpp msgid "Enable" msgstr "Activer" @@ -3022,8 +3024,13 @@ msgid "Q&A" msgstr "Questions et réponses" #: editor/editor_node.cpp -msgid "Issue Tracker" -msgstr "Traqueur de problèmes" +#, fuzzy +msgid "Report a Bug" +msgstr "Réimporter" + +#: editor/editor_node.cpp +msgid "Send Docs Feedback" +msgstr "" #: editor/editor_node.cpp editor/plugins/asset_library_editor_plugin.cpp msgid "Community" @@ -4085,7 +4092,8 @@ msgid "Reimport" msgstr "Réimporter" #: editor/import_dock.cpp -msgid "Save scenes, re-import and restart" +#, fuzzy +msgid "Save Scenes, Re-Import, and Restart" msgstr "Sauvegarde des scènes, réimportation et redémarrage" #: editor/import_dock.cpp @@ -6966,14 +6974,6 @@ msgid "Open Godot online documentation." msgstr "Ouvrir la documentation de Godot en ligne." #: editor/plugins/script_editor_plugin.cpp -msgid "Request Docs" -msgstr "Demande de documentation" - -#: editor/plugins/script_editor_plugin.cpp -msgid "Help improve the Godot documentation by giving feedback." -msgstr "Aider à améliorer la documentation de Godot en donnant vos réactions." - -#: editor/plugins/script_editor_plugin.cpp msgid "Search the reference documentation." msgstr "Rechercher dans la documentation de référence." @@ -7413,6 +7413,11 @@ msgstr "" "sélectionné." #: editor/plugins/spatial_editor_plugin.cpp +#, fuzzy +msgid "Auto Orthogonal Enabled" +msgstr "Orthogonale" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Lock View Rotation" msgstr "Verrouiller la rotation de la vue" @@ -7501,6 +7506,10 @@ msgid "Freelook Slow Modifier" msgstr "Modificateur de vitesse de la vue libre" #: editor/plugins/spatial_editor_plugin.cpp +msgid "View Rotation Locked" +msgstr "Verrouiller la rotation de la vue" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." @@ -7510,10 +7519,6 @@ msgstr "" "jeu." #: editor/plugins/spatial_editor_plugin.cpp -msgid "View Rotation Locked" -msgstr "Verrouiller la rotation de la vue" - -#: editor/plugins/spatial_editor_plugin.cpp msgid "XForm Dialog" msgstr "Dialogue XForm" @@ -10496,7 +10501,7 @@ msgstr "Valeur par laquelle le compteur est incrémenté pour chaque nœud" #: editor/rename_dialog.cpp msgid "Padding" -msgstr "Remplissage" +msgstr "Remplissage(Padding)" #: editor/rename_dialog.cpp msgid "" @@ -11034,6 +11039,12 @@ msgid "Script file already exists." msgstr "Le fichier de script existe déjà." #: editor/script_create_dialog.cpp +msgid "" +"Note: Built-in scripts have some limitations and can't be edited using an " +"external editor." +msgstr "" + +#: editor/script_create_dialog.cpp msgid "Class Name:" msgstr "Nom de la classe :" @@ -12543,6 +12554,8 @@ msgstr "" msgid "" "ConcavePolygonShape doesn't support RigidBody in another mode than static." msgstr "" +"ConcavePolygonShape ne supporte pas RigidBody dans un autre mode que le mode " +"statique." #: scene/3d/cpu_particles.cpp msgid "Nothing is visible because no mesh has been assigned." @@ -12851,6 +12864,10 @@ msgstr "" "nœud de type Control afin qu'il en obtienne une taille. Sinon, faites-en une " "RenderTarget et assignez sa texture à un nœud pouvant l'afficher." +#: scene/main/viewport.cpp +msgid "Viewport size must be greater than 0 to render anything." +msgstr "" + #: scene/resources/visual_shader_nodes.cpp msgid "Invalid source for preview." msgstr "Source invalide pour la prévisualisation." @@ -12879,6 +12896,16 @@ msgstr "Les variations ne peuvent être affectées que dans la fonction vertex." msgid "Constants cannot be modified." msgstr "Les constantes ne peuvent être modifiées." +#~ msgid "Issue Tracker" +#~ msgstr "Traqueur de problèmes" + +#~ msgid "Request Docs" +#~ msgstr "Demande de documentation" + +#~ msgid "Help improve the Godot documentation by giving feedback." +#~ msgstr "" +#~ "Aider à améliorer la documentation de Godot en donnant vos réactions." + #~ msgid "Replaced %d occurrence(s)." #~ msgstr "%d occurrence(s) remplacée(s)." diff --git a/editor/translations/ga.po b/editor/translations/ga.po index e4e77fffc1..d40b50cd90 100644 --- a/editor/translations/ga.po +++ b/editor/translations/ga.po @@ -1408,7 +1408,7 @@ msgstr "" msgid "Remove Autoload" msgstr "" -#: editor/editor_autoload_settings.cpp +#: editor/editor_autoload_settings.cpp editor/editor_plugin_settings.cpp msgid "Enable" msgstr "" @@ -2812,7 +2812,11 @@ msgid "Q&A" msgstr "" #: editor/editor_node.cpp -msgid "Issue Tracker" +msgid "Report a Bug" +msgstr "" + +#: editor/editor_node.cpp +msgid "Send Docs Feedback" msgstr "" #: editor/editor_node.cpp editor/plugins/asset_library_editor_plugin.cpp @@ -3836,7 +3840,7 @@ msgid "Reimport" msgstr "" #: editor/import_dock.cpp -msgid "Save scenes, re-import and restart" +msgid "Save Scenes, Re-Import, and Restart" msgstr "" #: editor/import_dock.cpp @@ -6621,14 +6625,6 @@ msgid "Open Godot online documentation." msgstr "" #: editor/plugins/script_editor_plugin.cpp -msgid "Request Docs" -msgstr "" - -#: editor/plugins/script_editor_plugin.cpp -msgid "Help improve the Godot documentation by giving feedback." -msgstr "" - -#: editor/plugins/script_editor_plugin.cpp msgid "Search the reference documentation." msgstr "" @@ -7058,6 +7054,10 @@ msgid "This operation requires a single selected node." msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Auto Orthogonal Enabled" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Lock View Rotation" msgstr "" @@ -7146,13 +7146,13 @@ msgid "Freelook Slow Modifier" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "" -"Note: The FPS value displayed is the editor's framerate.\n" -"It cannot be used as a reliable indication of in-game performance." +msgid "View Rotation Locked" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "View Rotation Locked" +msgid "" +"Note: The FPS value displayed is the editor's framerate.\n" +"It cannot be used as a reliable indication of in-game performance." msgstr "" #: editor/plugins/spatial_editor_plugin.cpp @@ -10476,6 +10476,12 @@ msgid "Script file already exists." msgstr "" #: editor/script_create_dialog.cpp +msgid "" +"Note: Built-in scripts have some limitations and can't be edited using an " +"external editor." +msgstr "" + +#: editor/script_create_dialog.cpp msgid "Class Name:" msgstr "" @@ -12095,6 +12101,10 @@ msgid "" "texture to some node for display." msgstr "" +#: scene/main/viewport.cpp +msgid "Viewport size must be greater than 0 to render anything." +msgstr "" + #: scene/resources/visual_shader_nodes.cpp msgid "Invalid source for preview." msgstr "" diff --git a/editor/translations/he.po b/editor/translations/he.po index 17e04827a0..1a82804b31 100644 --- a/editor/translations/he.po +++ b/editor/translations/he.po @@ -1489,7 +1489,7 @@ msgstr "הזזת טעינה אוטומטית" msgid "Remove Autoload" msgstr "הסרת טעינה אוטומטית" -#: editor/editor_autoload_settings.cpp +#: editor/editor_autoload_settings.cpp editor/editor_plugin_settings.cpp msgid "Enable" msgstr "הפעלה" @@ -2984,8 +2984,13 @@ msgid "Q&A" msgstr "שאלות ותשובות נפוצות" #: editor/editor_node.cpp -msgid "Issue Tracker" -msgstr "עוקב תקלות" +#, fuzzy +msgid "Report a Bug" +msgstr "ייבוא מחדש" + +#: editor/editor_node.cpp +msgid "Send Docs Feedback" +msgstr "" #: editor/editor_node.cpp editor/plugins/asset_library_editor_plugin.cpp msgid "Community" @@ -4065,7 +4070,7 @@ msgid "Reimport" msgstr "ייבוא מחדש" #: editor/import_dock.cpp -msgid "Save scenes, re-import and restart" +msgid "Save Scenes, Re-Import, and Restart" msgstr "" #: editor/import_dock.cpp @@ -7009,14 +7014,6 @@ msgid "Open Godot online documentation." msgstr "פתיחת התיעוד המקוון של Godot" #: editor/plugins/script_editor_plugin.cpp -msgid "Request Docs" -msgstr "" - -#: editor/plugins/script_editor_plugin.cpp -msgid "Help improve the Godot documentation by giving feedback." -msgstr "" - -#: editor/plugins/script_editor_plugin.cpp msgid "Search the reference documentation." msgstr "" @@ -7477,6 +7474,10 @@ msgid "This operation requires a single selected node." msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Auto Orthogonal Enabled" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp #, fuzzy msgid "Lock View Rotation" msgstr "הצגת מידע" @@ -7567,17 +7568,17 @@ msgid "Freelook Slow Modifier" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +#, fuzzy +msgid "View Rotation Locked" +msgstr "הצגת מידע" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -#, fuzzy -msgid "View Rotation Locked" -msgstr "הצגת מידע" - -#: editor/plugins/spatial_editor_plugin.cpp msgid "XForm Dialog" msgstr "" @@ -11086,6 +11087,12 @@ msgid "Script file already exists." msgstr "הפעולה ‚%s’ כבר קיימת!" #: editor/script_create_dialog.cpp +msgid "" +"Note: Built-in scripts have some limitations and can't be edited using an " +"external editor." +msgstr "" + +#: editor/script_create_dialog.cpp #, fuzzy msgid "Class Name:" msgstr "מחלקה:" @@ -12757,6 +12764,10 @@ msgid "" "texture to some node for display." msgstr "" +#: scene/main/viewport.cpp +msgid "Viewport size must be greater than 0 to render anything." +msgstr "" + #: scene/resources/visual_shader_nodes.cpp #, fuzzy msgid "Invalid source for preview." @@ -12788,6 +12799,9 @@ msgstr "" msgid "Constants cannot be modified." msgstr "" +#~ msgid "Issue Tracker" +#~ msgstr "עוקב תקלות" + #~ msgid "enum " #~ msgstr "מונה " diff --git a/editor/translations/hi.po b/editor/translations/hi.po index d043407257..75f29b8e0b 100644 --- a/editor/translations/hi.po +++ b/editor/translations/hi.po @@ -9,11 +9,14 @@ # Abhay Patel <abhay111patel@gmail.com>, 2019. # Lakshmi-Jayakumar <lakshmi.jayakumar.tkm@gmail.com>, 2019. # Devashishsingh98 <devashishsingh98@gmail.com>, 2019. +# Shirious <sad3119823@gmail.com>, 2020. +# anonymous <noreply@weblate.org>, 2020. +# Abhay Patel <Traumaticbean@protonmail.com>, 2020. msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2020-01-30 03:56+0000\n" +"PO-Revision-Date: 2020-04-03 09:50+0000\n" "Last-Translator: Suryansh5545 <suryanshpathak5545@gmail.com>\n" "Language-Team: Hindi <https://hosted.weblate.org/projects/godot-engine/godot/" "hi/>\n" @@ -22,7 +25,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 3.11-dev\n" +"X-Generator: Weblate 4.0-dev\n" #: core/math/expression.cpp modules/gdscript/gdscript_functions.cpp #: modules/visual_script/visual_script_builtin_funcs.cpp @@ -31,17 +34,17 @@ msgstr "कन्वर्ट करने के लिए अमान्य #: core/math/expression.cpp modules/gdscript/gdscript_functions.cpp msgid "Expected a string of length 1 (a character)." -msgstr "लंबाई 1 (एक चरित्र) की एक स्ट्रिंग की उम्मीद है।" +msgstr "स्ट्रिंग की लंबाई 1 (1 अक्षर) अपेक्षित है." #: core/math/expression.cpp modules/gdscript/gdscript_functions.cpp #: modules/mono/glue/gd_glue.cpp #: modules/visual_script/visual_script_builtin_funcs.cpp msgid "Not enough bytes for decoding bytes, or invalid format." -msgstr "डिकोडिंग बाइट, या अमान्य प्रारूप के लिए पर्याप्त बाइट नहीं।" +msgstr "अमान्य फ़ोर्मैट, या बाइट्स डिकोडिंग के लिए पर्याप्त बाइट्स नहीं।" #: core/math/expression.cpp msgid "Invalid input %i (not passed) in expression" -msgstr "अभिव्यक्ति में अमान्य इनपुट%i (पारित नहीं)" +msgstr "एक्सप्रेशन मे अमान्य इनपुट %i (पास नहीं हो पाया)" #: core/math/expression.cpp msgid "self can't be used because instance is null (not passed)" @@ -105,7 +108,7 @@ msgstr "संतुलित" #: editor/animation_bezier_editor.cpp msgid "Mirror" -msgstr "दर्पण" +msgstr "आइना" #: editor/animation_bezier_editor.cpp editor/editor_profiler.cpp msgid "Time:" @@ -666,7 +669,7 @@ msgstr "ऑडियो ट्रैक क्लिप एंड ऑफसे #: editor/array_property_edit.cpp msgid "Resize Array" -msgstr "रीसाइज रीव्यू" +msgstr "Array को बड़ा या छोटा करना" #: editor/array_property_edit.cpp msgid "Change Array Value Type" @@ -682,24 +685,23 @@ msgstr "लाइन पर जाएं" #: editor/code_editor.cpp msgid "Line Number:" -msgstr "लाइन नंबर:" +msgstr "लाइन क्र.:" #: editor/code_editor.cpp -#, fuzzy msgid "%d replaced." -msgstr "बदलने के" +msgstr "%d बदले." #: editor/code_editor.cpp editor/editor_help.cpp msgid "%d match." -msgstr "% d मैच।" +msgstr "% d मिल गया।" #: editor/code_editor.cpp editor/editor_help.cpp msgid "%d matches." -msgstr "% डी मैच।" +msgstr "%d मिल गया।" #: editor/code_editor.cpp editor/find_in_files.cpp msgid "Match Case" -msgstr "मैच मामला" +msgstr "पूंजीकरण मेल करे" #: editor/code_editor.cpp editor/find_in_files.cpp msgid "Whole Words" @@ -707,7 +709,7 @@ msgstr "पूरे शब्द" #: editor/code_editor.cpp editor/rename_dialog.cpp msgid "Replace" -msgstr "बदलने के" +msgstr "बदले" #: editor/code_editor.cpp msgid "Replace All" @@ -715,7 +717,7 @@ msgstr "सबको बदली करें" #: editor/code_editor.cpp msgid "Selection Only" -msgstr "केवल चयन" +msgstr "सिर्फ चयन किये हुए" #: editor/code_editor.cpp editor/plugins/script_text_editor.cpp #: editor/plugins/text_editor.cpp @@ -748,40 +750,39 @@ msgstr "चेतावनियाँ" #: editor/code_editor.cpp msgid "Line and column numbers." -msgstr "लाइन और कॉलम नंबर।" +msgstr "पंक्ति और क़तार क्र.।" #: editor/connections_dialog.cpp msgid "Method in target node must be specified." -msgstr "लक्ष्य नोड में विधि निर्दिष्ट की जानी चाहिए।" +msgstr "Method को target node में निर्दिष्ट कीजिए." #: editor/connections_dialog.cpp msgid "" "Target method not found. Specify a valid method or attach a script to the " "target node." -msgstr "" -"लक्ष्य विधि नहीं मिली। एक मान्य विधि निर्दिष्ट करें या स्क्रिप्ट को लक्ष्य नोड में संलग्न करें।" +msgstr "target node नहीं मिला। method उल्लिखित करें या script जोड़िये।" #: editor/connections_dialog.cpp msgid "Connect to Node:" -msgstr "नोड से कनेक्ट करें:" +msgstr "Node से कनेक्ट करें:" #: editor/connections_dialog.cpp msgid "Connect to Script:" -msgstr "स्क्रिप्ट से कनेक्ट:" +msgstr "Script से कनेक्ट:" #: editor/connections_dialog.cpp msgid "From Signal:" -msgstr "सिग्नल से:" +msgstr "Signal से:" #: editor/connections_dialog.cpp msgid "Scene does not contain any script." -msgstr "सीन में कोई स्क्रिप्ट नहीं होती।" +msgstr "Scene में कोई script नहीं पाई गयी।" #: editor/connections_dialog.cpp editor/editor_autoload_settings.cpp #: editor/groups_editor.cpp editor/plugins/item_list_editor_plugin.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_settings_editor.cpp msgid "Add" -msgstr "जोड़ें" +msgstr "जोड़िये" #: editor/connections_dialog.cpp editor/dependency_editor.cpp #: editor/editor_feature_profile.cpp editor/groups_editor.cpp @@ -792,23 +793,23 @@ msgstr "जोड़ें" #: editor/plugins/visual_shader_editor_plugin.cpp editor/project_manager.cpp #: editor/project_settings_editor.cpp msgid "Remove" -msgstr "मिटाना" +msgstr "मिटाइये" #: editor/connections_dialog.cpp msgid "Add Extra Call Argument:" -msgstr "अतिरिक्त कॉल तर्क जोड़ें:" +msgstr "अतिरिक्त Call Argument अपेक्षित है:" #: editor/connections_dialog.cpp msgid "Extra Call Arguments:" -msgstr "अतिरिक्त कॉल तर्क:" +msgstr "अतिरिक्त Call Arguments:" #: editor/connections_dialog.cpp msgid "Receiver Method:" -msgstr "रिसीवर विधि:" +msgstr "पानेवाली Method:" #: editor/connections_dialog.cpp msgid "Advanced" -msgstr "उन्नत" +msgstr "अग्रवर्ती" #: editor/connections_dialog.cpp msgid "Deferred" @@ -818,20 +819,20 @@ msgstr "स्थगित" msgid "" "Defers the signal, storing it in a queue and only firing it at idle time." msgstr "" -"संकेत को स्थगित कर देता है, इसे एक कतार में संग्रहित करता है और केवल निष्क्रिय समय पर इसे " +"इशारा को स्थगित कर देता है, इसे एक कतार में संग्रहित करता है और केवल निष्क्रिय समय पर इसे " "फायरिंग करता है।" #: editor/connections_dialog.cpp msgid "Oneshot" -msgstr "वनशॉट" +msgstr "एक बार" #: editor/connections_dialog.cpp msgid "Disconnects the signal after its first emission." -msgstr "अपने पहले उत्सर्जन के बाद संकेत डिस्कनेक्ट करता है।" +msgstr "इसके पहले उत्सर्जन के बाद सिग्नल को डिस्कनेक्ट करें" #: editor/connections_dialog.cpp msgid "Cannot connect signal" -msgstr "सिग्नल कनेक्ट नहीं कर सकते" +msgstr "इशारा कनेक्ट नहीं कर सकते" #: editor/connections_dialog.cpp editor/dependency_editor.cpp #: editor/export_template_manager.cpp editor/groups_editor.cpp @@ -850,11 +851,11 @@ msgstr "बंद करे" #: editor/connections_dialog.cpp msgid "Connect" -msgstr "जोड़ना" +msgstr "जोड़िये" #: editor/connections_dialog.cpp msgid "Signal:" -msgstr "संकेत:" +msgstr "इशारा:" #: editor/connections_dialog.cpp msgid "Connect '%s' to '%s'" @@ -862,11 +863,11 @@ msgstr "'%' को '%' से कनेक्ट करें" #: editor/connections_dialog.cpp msgid "Disconnect '%s' from '%s'" -msgstr "'%' से डिस्कनेक्ट करें '%'" +msgstr "'%' से '%' को डिस्कनेक्ट करें" #: editor/connections_dialog.cpp msgid "Disconnect all from signal: '%s'" -msgstr "सभी को सिग्नल से डिस्कनेक्ट करें: '%s'" +msgstr "सभी इशारो से डिस्कनेक्ट करें: '%s'" #: editor/connections_dialog.cpp msgid "Connect..." @@ -875,15 +876,15 @@ msgstr "जोड़ना..." #: editor/connections_dialog.cpp #: editor/plugins/animation_tree_player_editor_plugin.cpp msgid "Disconnect" -msgstr "डिस्कनेक्ट" +msgstr "विलगन" #: editor/connections_dialog.cpp msgid "Connect a Signal to a Method" -msgstr "एक विधि के लिए एक संकेत कनेक्ट" +msgstr "method इशारे से जोड़िए" #: editor/connections_dialog.cpp msgid "Edit Connection:" -msgstr "संपादित करें कनेक्शन:" +msgstr "कनेक्शन संपादित करें:" #: editor/connections_dialog.cpp msgid "Are you sure you want to remove all connections from the \"%s\" signal?" @@ -903,19 +904,19 @@ msgstr "सभी को डिस्कनेक्ट करें" #: editor/connections_dialog.cpp msgid "Edit..." -msgstr "संपादित..." +msgstr "संपादित करें..." #: editor/connections_dialog.cpp msgid "Go To Method" -msgstr "" +msgstr "मेथड पे जाये" #: editor/create_dialog.cpp msgid "Change %s Type" -msgstr "" +msgstr "%s का टाइप बदले" #: editor/create_dialog.cpp editor/project_settings_editor.cpp msgid "Change" -msgstr "परिवर्तन" +msgstr "बदली" #: editor/create_dialog.cpp msgid "Create New %s" @@ -1196,11 +1197,11 @@ msgstr "असंपीड़ित संपत्तियां" #: editor/editor_asset_installer.cpp editor/project_manager.cpp msgid "The following files failed extraction from package:" -msgstr "" +msgstr "निम्न फ़ाइलों का निस्सारण नहीं हो पाया:" #: editor/editor_asset_installer.cpp msgid "And %s more files." -msgstr "" +msgstr "और %s फ़ाइलें." #: editor/editor_asset_installer.cpp editor/project_manager.cpp msgid "Package installed successfully!" @@ -1213,7 +1214,7 @@ msgstr "सफलता!" #: editor/editor_asset_installer.cpp msgid "Package Contents:" -msgstr "पैकेज सामग्री:" +msgstr "पैकेज में है:" #: editor/editor_asset_installer.cpp editor/editor_node.cpp msgid "Install" @@ -1273,7 +1274,7 @@ msgstr "पुनर्व्यवस्थित करने के लिए #: editor/editor_audio_buses.cpp msgid "Solo" -msgstr "एकल" +msgstr "सोलो" #: editor/editor_audio_buses.cpp msgid "Mute" @@ -1298,7 +1299,7 @@ msgstr "वॉल्यूम रीसेट करें" #: editor/editor_audio_buses.cpp msgid "Delete Effect" -msgstr "डिलीट इफेक्ट" +msgstr "इफेक्ट मिटाइये" #: editor/editor_audio_buses.cpp msgid "Audio" @@ -1306,31 +1307,31 @@ msgstr "ऑडियो" #: editor/editor_audio_buses.cpp msgid "Add Audio Bus" -msgstr "" +msgstr "ऑडियो बस ऐड कीजिए" #: editor/editor_audio_buses.cpp msgid "Master bus can't be deleted!" -msgstr "" +msgstr "मास्टर बस नहीं मिटा सकते!" #: editor/editor_audio_buses.cpp msgid "Delete Audio Bus" -msgstr "" +msgstr "ऑडियो बस मिटाइये" #: editor/editor_audio_buses.cpp msgid "Duplicate Audio Bus" -msgstr "" +msgstr "ऑडियो बस दुगुना करे" #: editor/editor_audio_buses.cpp msgid "Reset Bus Volume" -msgstr "" +msgstr "बस की ध्वनि मात्रा पूर्वरूप करे" #: editor/editor_audio_buses.cpp msgid "Move Audio Bus" -msgstr "" +msgstr "ऑडियो बस हटाइये" #: editor/editor_audio_buses.cpp msgid "Save Audio Bus Layout As..." -msgstr "" +msgstr "ऑडियो बस लेआउट इस तरह बचा के रखिये..." #: editor/editor_audio_buses.cpp msgid "Location for New Layout..." @@ -1338,113 +1339,113 @@ msgstr "नए लेआउट के लिए स्थान..." #: editor/editor_audio_buses.cpp msgid "Open Audio Bus Layout" -msgstr "" +msgstr "ऑडियो बस लेआउट खोलिये" #: editor/editor_audio_buses.cpp msgid "There is no '%s' file." -msgstr "" +msgstr "कोई '%s' फ़ाइल नहीं." #: editor/editor_audio_buses.cpp editor/plugins/canvas_item_editor_plugin.cpp msgid "Layout" -msgstr "" +msgstr "लेआउट" #: editor/editor_audio_buses.cpp msgid "Invalid file, not an audio bus layout." -msgstr "" +msgstr "अमान्य फ़ाइल, ऑडियो बस लेआउट." #: editor/editor_audio_buses.cpp msgid "Error saving file: %s" -msgstr "त्रुटि बचत फ़ाइल: %s" +msgstr "फ़ाइल बचाने में चूक: %s" #: editor/editor_audio_buses.cpp msgid "Add Bus" -msgstr "" +msgstr "बस ऐड कीजिए" #: editor/editor_audio_buses.cpp msgid "Add a new Audio Bus to this layout." -msgstr "" +msgstr "लेआउट में नई ऑडियो बस ऐड कीजिए." #: editor/editor_audio_buses.cpp editor/editor_properties.cpp #: editor/plugins/animation_player_editor_plugin.cpp editor/property_editor.cpp #: editor/script_create_dialog.cpp msgid "Load" -msgstr "" +msgstr "लोड कीजिये" #: editor/editor_audio_buses.cpp msgid "Load an existing Bus Layout." -msgstr "" +msgstr "मौजूदा बस लेआउट लोड कीजिये." #: editor/editor_audio_buses.cpp msgid "Save As" -msgstr "" +msgstr "इस तरह बचा के रखिये" #: editor/editor_audio_buses.cpp msgid "Save this Bus Layout to a file." -msgstr "" +msgstr "बस लेआउट को फ़ाइल में बचा के रखिये." #: editor/editor_audio_buses.cpp editor/import_dock.cpp msgid "Load Default" -msgstr "" +msgstr "प्रायिक लोड कीजिये" #: editor/editor_audio_buses.cpp msgid "Load the default Bus Layout." -msgstr "" +msgstr "प्रायिक बस लेआउट लोड कीजिये." #: editor/editor_audio_buses.cpp msgid "Create a new Bus Layout." -msgstr "" +msgstr "नई बस लेआउट बनाइये." #: editor/editor_autoload_settings.cpp msgid "Invalid name." -msgstr "" +msgstr "अमान्य नाम." #: editor/editor_autoload_settings.cpp msgid "Valid characters:" -msgstr "" +msgstr "मान्य अक्षर:" #: editor/editor_autoload_settings.cpp msgid "Must not collide with an existing engine class name." -msgstr "" +msgstr "मौजूदा क्लास इंजन नाम से मेल नहीं खाना चाहिए." #: editor/editor_autoload_settings.cpp msgid "Must not collide with an existing built-in type name." -msgstr "" +msgstr "मौजूदा बिल्ट-इन टाइप के नाम से मेल नहीं खाना चाहिए." #: editor/editor_autoload_settings.cpp msgid "Must not collide with an existing global constant name." -msgstr "" +msgstr "मौजूदा ग्लोबल कोन्स्टन्ट के नाम से मेल नहीं खाना चाहिए." #: editor/editor_autoload_settings.cpp msgid "Keyword cannot be used as an autoload name." -msgstr "" +msgstr "कीवर्ड को औटोलोड नाम के तरह नहीं इस्तेमाल कर सकते." #: editor/editor_autoload_settings.cpp msgid "Autoload '%s' already exists!" -msgstr "" +msgstr "औटोलोड '%s' पहले से मौजूद!" #: editor/editor_autoload_settings.cpp msgid "Rename Autoload" -msgstr "" +msgstr "औटोलोड का नाम बदली कीजिये" #: editor/editor_autoload_settings.cpp msgid "Toggle AutoLoad Globals" -msgstr "" +msgstr "औटोलोड ग्लोबल टॉगल कीजिये" #: editor/editor_autoload_settings.cpp msgid "Move Autoload" -msgstr "" +msgstr "औटोलोड हिलाइये" #: editor/editor_autoload_settings.cpp msgid "Remove Autoload" -msgstr "" +msgstr "औटोलोड हटा दीजिये" -#: editor/editor_autoload_settings.cpp +#: editor/editor_autoload_settings.cpp editor/editor_plugin_settings.cpp msgid "Enable" -msgstr "" +msgstr "सक्रिय करे" #: editor/editor_autoload_settings.cpp msgid "Rearrange Autoloads" -msgstr "" +msgstr "औटोलोड पुनर्व्यवस्थित करें" #: editor/editor_autoload_settings.cpp editor/script_create_dialog.cpp msgid "Invalid path." @@ -1452,114 +1453,118 @@ msgstr "अमान्य रास्ता।" #: editor/editor_autoload_settings.cpp editor/script_create_dialog.cpp msgid "File does not exist." -msgstr "" +msgstr "फ़ाइल नहीं मौजूद." #: editor/editor_autoload_settings.cpp msgid "Not in resource path." -msgstr "" +msgstr "रेसोर्स पाथ में नहीं." #: editor/editor_autoload_settings.cpp msgid "Add AutoLoad" -msgstr "" +msgstr "औटोलोड ऐड कीजिए" #: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp #: editor/plugins/animation_tree_editor_plugin.cpp #: editor/script_create_dialog.cpp scene/gui/file_dialog.cpp msgid "Path:" -msgstr "" +msgstr "पाथ:" #: editor/editor_autoload_settings.cpp msgid "Node Name:" -msgstr "" +msgstr "नोड का नाम:" #: editor/editor_autoload_settings.cpp editor/editor_help_search.cpp #: editor/editor_profiler.cpp editor/project_manager.cpp #: editor/settings_config_dialog.cpp msgid "Name" -msgstr "" +msgstr "नाम" #: editor/editor_autoload_settings.cpp msgid "Singleton" -msgstr "" +msgstr "सिन्गलटन" #: editor/editor_data.cpp editor/inspector_dock.cpp msgid "Paste Params" -msgstr "" +msgstr "पैरैमिटर्स पेस्ट कीजिये" #: editor/editor_data.cpp msgid "Updating Scene" -msgstr "" +msgstr "सीन अपडेट कर रहा है" #: editor/editor_data.cpp msgid "Storing local changes..." -msgstr "" +msgstr "लोकल बदलीया स्टोर कर रहा है..." #: editor/editor_data.cpp msgid "Updating scene..." -msgstr "" +msgstr "सीन अपडेट कर रहा है..." #: editor/editor_data.cpp editor/editor_properties.cpp msgid "[empty]" -msgstr "" +msgstr "[खाली]" #: editor/editor_data.cpp msgid "[unsaved]" -msgstr "" +msgstr "[अनसेव्ड]" #: editor/editor_dir_dialog.cpp msgid "Please select a base directory first." -msgstr "" +msgstr "कृपया पहले बेस डायरेक्टरी सिलेक्ट कीजिये." #: editor/editor_dir_dialog.cpp msgid "Choose a Directory" -msgstr "" +msgstr "डायरेक्टरी चुनें" #: editor/editor_dir_dialog.cpp editor/editor_file_dialog.cpp #: editor/filesystem_dock.cpp editor/project_manager.cpp #: scene/gui/file_dialog.cpp msgid "Create Folder" -msgstr "" +msgstr "फ़ोल्डर बनाइये" #: editor/editor_dir_dialog.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp editor/filesystem_dock.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_export.cpp #: modules/visual_script/visual_script_editor.cpp scene/gui/file_dialog.cpp msgid "Name:" -msgstr "" +msgstr "नाम:" #: editor/editor_dir_dialog.cpp editor/editor_file_dialog.cpp #: editor/filesystem_dock.cpp scene/gui/file_dialog.cpp msgid "Could not create folder." -msgstr "" +msgstr "फ़ोल्डर नही बना सकते." #: editor/editor_dir_dialog.cpp msgid "Choose" -msgstr "" +msgstr "चुनें" #: editor/editor_export.cpp msgid "Storing File:" -msgstr "" +msgstr "फ़ाइल स्टोर कर रहा है:" #: editor/editor_export.cpp msgid "No export template found at the expected path:" -msgstr "" +msgstr "निश्चित पाथ पर एक्सपोर्ट टेम्प्लेट नहीं मिला:" #: editor/editor_export.cpp msgid "Packing" -msgstr "" +msgstr "पैक कर रहा है" #: editor/editor_export.cpp msgid "" "Target platform requires 'ETC' texture compression for GLES2. Enable 'Import " "Etc' in Project Settings." msgstr "" +"GLES2 के लिये टार्गेट प्ल्टैफ़ोर्म को 'ETC' टेक्सचर कोम्प्रेशन की आवश्यकता है. 'Import Etc' " +"को प्रोजेक्ट सेटिन्गस मे सक्रिय करे." #: editor/editor_export.cpp msgid "" "Target platform requires 'ETC2' texture compression for GLES3. Enable " "'Import Etc 2' in Project Settings." msgstr "" +"GLES3 के लिये टार्गेट प्ल्टैफ़ोर्म को 'ETC2' टेक्सचर कोम्प्रेशन की आवश्यकता है. 'Import Etc " +"2' को प्रोजेक्ट सेटिन्गस मे सक्रिय करे." #: editor/editor_export.cpp msgid "" @@ -1568,364 +1573,361 @@ msgid "" "Enable 'Import Etc' in Project Settings, or disable 'Driver Fallback " "Enabled'." msgstr "" +"GLES2 के लिये टार्गेट प्ल्टैफ़ोर्म को 'ETC' टेक्सचर कोम्प्रेशन की आवश्यकता है. \n" +"'Import Etc' को प्रोजेक्ट सेटिन्गस मे सक्रिय करे, या 'Driver Fallback Enabled' को " +"निष्क्रिय करे." #: editor/editor_export.cpp platform/android/export/export.cpp #: platform/iphone/export/export.cpp platform/javascript/export/export.cpp #: platform/osx/export/export.cpp platform/uwp/export/export.cpp msgid "Custom debug template not found." -msgstr "" +msgstr "कस्टम डिबग टेम्प्लेट नहीं मिला." #: editor/editor_export.cpp platform/android/export/export.cpp #: platform/iphone/export/export.cpp platform/javascript/export/export.cpp #: platform/osx/export/export.cpp platform/uwp/export/export.cpp msgid "Custom release template not found." -msgstr "" +msgstr "कस्टम रिलिज टेम्प्लेट नहीं मिला." #: editor/editor_export.cpp platform/javascript/export/export.cpp msgid "Template file not found:" -msgstr "" +msgstr "टेम्प्लेट फ़ाइल नहीं मिला:" #: editor/editor_export.cpp msgid "On 32-bit exports the embedded PCK cannot be bigger than 4 GiB." -msgstr "" +msgstr "32-बिट एक्सपोर्ट पर एमबेड्डेड PCK 4 GiB से बड़ी नहीं इस्तेमाल कर सकते." #: editor/editor_feature_profile.cpp msgid "3D Editor" msgstr "3D संपादक" #: editor/editor_feature_profile.cpp -#, fuzzy msgid "Script Editor" -msgstr "निर्भरता संपादक" +msgstr "स्क्रिप्ट एडीटर" #: editor/editor_feature_profile.cpp msgid "Asset Library" -msgstr "" +msgstr "अस्सेट संग्रह" #: editor/editor_feature_profile.cpp msgid "Scene Tree Editing" -msgstr "" +msgstr "सीन ट्री एडिटिंग" #: editor/editor_feature_profile.cpp msgid "Import Dock" -msgstr "" +msgstr "इंपोर्ट डॉक" #: editor/editor_feature_profile.cpp msgid "Node Dock" -msgstr "" +msgstr "नोड डॉक" #: editor/editor_feature_profile.cpp msgid "FileSystem and Import Docks" -msgstr "" +msgstr "फाइलसिस्टेम और इंपोर्ट डोक्स" #: editor/editor_feature_profile.cpp msgid "Erase profile '%s'? (no undo)" -msgstr "" +msgstr "प्रोफ़ाइल '%s' को मिटाएं? (इसे अंडू नहीं किया जा सकता है)" #: editor/editor_feature_profile.cpp msgid "Profile must be a valid filename and must not contain '.'" -msgstr "" +msgstr "प्रोफ़ाइल का एक वैध फ़ाइलनेम होना चाहिए और उसमे '.' नहीं होना चाहिए" #: editor/editor_feature_profile.cpp msgid "Profile with this name already exists." -msgstr "" +msgstr "इस नाम का प्रोफ़ाइल पहले से मौजूद है।" #: editor/editor_feature_profile.cpp msgid "(Editor Disabled, Properties Disabled)" -msgstr "" +msgstr "(एडीटर निष्क्रिय,प्रोपरटिज निष्क्रिय)" #: editor/editor_feature_profile.cpp msgid "(Properties Disabled)" -msgstr "" +msgstr "(प्रोपरटिज निष्क्रिय)" #: editor/editor_feature_profile.cpp -#, fuzzy msgid "(Editor Disabled)" -msgstr "बंद कर दिया गया है" +msgstr "(एडीटर निष्क्रिय)" #: editor/editor_feature_profile.cpp -#, fuzzy msgid "Class Options:" -msgstr "विवरण:" +msgstr "क्लास विकल्प:" #: editor/editor_feature_profile.cpp msgid "Enable Contextual Editor" -msgstr "" +msgstr "कोन्टेक्सचुअल एडीटर सक्रिय करे" #: editor/editor_feature_profile.cpp msgid "Enabled Properties:" -msgstr "" +msgstr "सक्रिय प्रोपरटिज:" #: editor/editor_feature_profile.cpp msgid "Enabled Features:" -msgstr "" +msgstr "सक्रिय फ़िचर्स:" #: editor/editor_feature_profile.cpp msgid "Enabled Classes:" -msgstr "" +msgstr "सक्रिय क्लास:" #: editor/editor_feature_profile.cpp msgid "File '%s' format is invalid, import aborted." -msgstr "" +msgstr "'%s' फ़ोर्मैट की फ़ाइल अमान्य, इंपोर्ट रोका गया." #: editor/editor_feature_profile.cpp msgid "" "Profile '%s' already exists. Remove it first before importing, import " "aborted." -msgstr "" +msgstr "'%s' प्रोफ़ाइल पहले से मौजूद. इंपोर्ट से पहले हटा दीजिये, इंपोर्ट रोका गया." #: editor/editor_feature_profile.cpp -#, fuzzy msgid "Error saving profile to path: '%s'." -msgstr "लोड हो रहा है त्रुटियाँ!" +msgstr "पाथ मे प्रोफ़ाइल सेव करनेमे एरर: '%s'." #: editor/editor_feature_profile.cpp msgid "Unset" -msgstr "" +msgstr "अन्सेट" #: editor/editor_feature_profile.cpp msgid "Current Profile:" -msgstr "" +msgstr "वर्तमान प्रोफ़ाइल:" #: editor/editor_feature_profile.cpp msgid "Make Current" -msgstr "" +msgstr "वर्तमान बनाय" #: editor/editor_feature_profile.cpp #: editor/plugins/animation_player_editor_plugin.cpp #: editor/plugins/version_control_editor_plugin.cpp msgid "New" -msgstr "" +msgstr "नई" #: editor/editor_feature_profile.cpp editor/editor_node.cpp #: editor/project_manager.cpp msgid "Import" -msgstr "" +msgstr "इंपोर्ट" #: editor/editor_feature_profile.cpp editor/project_export.cpp msgid "Export" -msgstr "" +msgstr "एक्सपोर्ट" #: editor/editor_feature_profile.cpp msgid "Available Profiles:" -msgstr "" +msgstr "उपलब्ध प्रोफ़ाइल:" #: editor/editor_feature_profile.cpp -#, fuzzy msgid "Class Options" -msgstr "विवरण:" +msgstr "क्लास विकल्प" #: editor/editor_feature_profile.cpp msgid "New profile name:" -msgstr "" +msgstr "नया प्रोफ़ाइल नाम:" #: editor/editor_feature_profile.cpp msgid "Erase Profile" -msgstr "" +msgstr "प्रोफ़ाइल मिटाय" #: editor/editor_feature_profile.cpp msgid "Godot Feature Profile" -msgstr "" +msgstr "Godot फ़िचर प्रोफ़ाइल" #: editor/editor_feature_profile.cpp msgid "Import Profile(s)" -msgstr "" +msgstr "इंपोर्ट प्रोफ़ाइल" #: editor/editor_feature_profile.cpp msgid "Export Profile" -msgstr "" +msgstr "एक्सपोर्ट प्रोफ़ाइल" #: editor/editor_feature_profile.cpp msgid "Manage Editor Feature Profiles" -msgstr "" +msgstr "एडीटर फ़िचर प्रोफ़ाइल व्यवस्था कीजिये" #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Select Current Folder" -msgstr "" +msgstr "वर्तमान फ़ोल्डर सिलेक्ट कीजिये" #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "File Exists, Overwrite?" -msgstr "" +msgstr "फ़ाइल पहले से मौजूद, मौजूदा के ऊपर लिखे?" #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Select This Folder" -msgstr "" +msgstr "यह फ़ोल्डर सिलेक्ट कीजिये" #: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp msgid "Copy Path" -msgstr "" +msgstr "पाथ कौपी कीजिये" #: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp -#, fuzzy msgid "Open in File Manager" -msgstr "खोलो इसे" +msgstr "फ़ाइल मैनेजर में खोलिये" #: editor/editor_file_dialog.cpp editor/editor_node.cpp #: editor/filesystem_dock.cpp editor/project_manager.cpp msgid "Show in File Manager" -msgstr "" +msgstr "फ़ाइल मैनेजर मे दिखाइए" #: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp msgid "New Folder..." -msgstr "" +msgstr "नया फ़ोल्डर..." #: editor/editor_file_dialog.cpp editor/find_in_files.cpp #: editor/plugins/version_control_editor_plugin.cpp msgid "Refresh" -msgstr "" +msgstr "रिफ़्रेश" #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "All Recognized" -msgstr "" +msgstr "सभी स्वीकृत" #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "All Files (*)" -msgstr "" +msgstr "सभी फ़ाइल (*)" #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Open a File" -msgstr "" +msgstr "फ़ाइल खोलिये" #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Open File(s)" -msgstr "" +msgstr "फ़ाइल(s) खोलिये" #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Open a Directory" -msgstr "" +msgstr "डायरेक्टरी खोलिये" #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Open a File or Directory" -msgstr "" +msgstr "फ़ाइल या डायरेक्टरी खोलिये" #: editor/editor_file_dialog.cpp editor/editor_node.cpp #: editor/editor_properties.cpp editor/inspector_dock.cpp #: editor/plugins/animation_player_editor_plugin.cpp #: editor/plugins/script_editor_plugin.cpp scene/gui/file_dialog.cpp msgid "Save" -msgstr "" +msgstr "सेव कीजिये" #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Save a File" -msgstr "" +msgstr "फ़ाइल सेव कीजिये" #: editor/editor_file_dialog.cpp msgid "Go Back" -msgstr "" +msgstr "पीछे जाय" #: editor/editor_file_dialog.cpp msgid "Go Forward" -msgstr "" +msgstr "आगे जाय" #: editor/editor_file_dialog.cpp msgid "Go Up" -msgstr "" +msgstr "ऊपर जाय" #: editor/editor_file_dialog.cpp msgid "Toggle Hidden Files" -msgstr "" +msgstr "छिपी फ़ाइले टॉगल कीजिये" #: editor/editor_file_dialog.cpp msgid "Toggle Favorite" -msgstr "" +msgstr "फ़ेवरेट टॉगल कीजिये" #: editor/editor_file_dialog.cpp msgid "Toggle Mode" -msgstr "" +msgstr "मोड टॉगल कीजिये" #: editor/editor_file_dialog.cpp msgid "Focus Path" -msgstr "" +msgstr "फ़ोकस पाथ" #: editor/editor_file_dialog.cpp msgid "Move Favorite Up" -msgstr "" +msgstr "फ़ेवरेट उपर लीजिये" #: editor/editor_file_dialog.cpp msgid "Move Favorite Down" -msgstr "" +msgstr "फ़ेवरेट नीचे लीजिये" #: editor/editor_file_dialog.cpp msgid "Go to previous folder." -msgstr "" +msgstr "पिछले फ़ोल्डर पे जाय." #: editor/editor_file_dialog.cpp msgid "Go to next folder." -msgstr "" +msgstr "अगले फ़ोल्डर पे जाय." #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Go to parent folder." -msgstr "" +msgstr "मूल फ़ोल्डर पे जाय." #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp -#, fuzzy msgid "Refresh files." -msgstr "खोज कर:" +msgstr "रिफ़्रेश फ़ाइल." #: editor/editor_file_dialog.cpp msgid "(Un)favorite current folder." -msgstr "" +msgstr "फ़ेवरेट मे से वर्तमान फ़ोल्डर निकाले." #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Toggle the visibility of hidden files." -msgstr "" +msgstr "छिपी फ़ाइलों की दृश्य टॉगल कीजिये." #: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp msgid "View items as a grid of thumbnails." -msgstr "" +msgstr "आइटम थम्बनेल्स के ढाँचे के तरह देखे." #: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp msgid "View items as a list." -msgstr "" +msgstr "आइटम लिस्ट के तरह देखे." #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Directories & Files:" -msgstr "" +msgstr "डायरेक्टरिज & फ़ाइले:" #: editor/editor_file_dialog.cpp editor/plugins/sprite_editor_plugin.cpp #: editor/plugins/style_box_editor_plugin.cpp #: editor/plugins/theme_editor_plugin.cpp msgid "Preview:" -msgstr "" +msgstr "पूर्व दर्शन:" #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "File:" -msgstr "" +msgstr "फ़ाइल:" #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Must use a valid extension." -msgstr "" +msgstr "मान्य एक्सटेनशन इस्तेमाल कीजिये." #: editor/editor_file_system.cpp msgid "ScanSources" -msgstr "" +msgstr "स्रोतस्कैन कीजिये" #: editor/editor_file_system.cpp msgid "" "There are multiple importers for different types pointing to file %s, import " "aborted" msgstr "" +"विभिन्न प्रकार के लिए कई आयातक हैं जो % फाइल करने की ओर इशारा करते हैं, आयात निरस्त" #: editor/editor_file_system.cpp msgid "(Re)Importing Assets" -msgstr "" +msgstr "अस्सेट (पुन:) इंपोर्ट" #: editor/editor_help.cpp editor/plugins/spatial_editor_plugin.cpp msgid "Top" -msgstr "" +msgstr "सर्वोच्च" #: editor/editor_help.cpp msgid "Class:" -msgstr "" +msgstr "क्लास:" #: editor/editor_help.cpp editor/scene_tree_editor.cpp #: editor/script_create_dialog.cpp msgid "Inherits:" -msgstr "" +msgstr "निम्न का उत्तराधिकारी:" #: editor/editor_help.cpp msgid "Inherited by:" -msgstr "" +msgstr "निम्न से उत्तराधिकार प्राप्त:" #: editor/editor_help.cpp msgid "Description" @@ -1933,155 +1935,152 @@ msgstr "विवरण" #: editor/editor_help.cpp msgid "Online Tutorials" -msgstr "" +msgstr "ऑनलाइन ट्यूटोरियल" #: editor/editor_help.cpp msgid "Properties" -msgstr "" +msgstr "प्रोपरटिज" #: editor/editor_help.cpp msgid "override:" -msgstr "" +msgstr "अधिभावी करता है:" #: editor/editor_help.cpp msgid "default:" -msgstr "" +msgstr "प्रायिक:" #: editor/editor_help.cpp msgid "Methods" -msgstr "" +msgstr "मेथड" #: editor/editor_help.cpp msgid "Theme Properties" -msgstr "" +msgstr "थिम प्रोपरटिज" #: editor/editor_help.cpp msgid "Enumerations" -msgstr "" +msgstr "एन्युमरेशन" #: editor/editor_help.cpp msgid "Constants" -msgstr "" +msgstr "कोन्स्टन्ट" #: editor/editor_help.cpp -#, fuzzy msgid "Property Descriptions" -msgstr "विवरण:" +msgstr "प्रोपर्टी का विवरण" #: editor/editor_help.cpp -#, fuzzy msgid "(value)" -msgstr "मूल्य :" +msgstr "(मूल्य)" #: editor/editor_help.cpp msgid "" "There is currently no description for this property. Please help us by " "[color=$color][url=$url]contributing one[/url][/color]!" msgstr "" +"वर्तमान में प्रोपर्टी का विवरण नहीं. आप हमें [color=$color][url=$url]योगदान करके[/url]" +"[/color] मदत कर सकते है!" #: editor/editor_help.cpp -#, fuzzy msgid "Method Descriptions" -msgstr "विवरण:" +msgstr "मेथड विवरण" #: editor/editor_help.cpp msgid "" "There is currently no description for this method. Please help us by [color=" "$color][url=$url]contributing one[/url][/color]!" msgstr "" +"वर्तमान में मेथड का विवरण नहीं. आप हमें [color=$color][url=$url]योगदान करके[/url][/" +"color] मदत कर सकते है!" #: editor/editor_help_search.cpp editor/editor_node.cpp #: editor/plugins/script_editor_plugin.cpp msgid "Search Help" -msgstr "" +msgstr "मदत खोजे" #: editor/editor_help_search.cpp msgid "Case Sensitive" -msgstr "" +msgstr "अक्षर संवेदनशील" #: editor/editor_help_search.cpp msgid "Show Hierarchy" -msgstr "" +msgstr "उत्क्रम दिखाइए" #: editor/editor_help_search.cpp msgid "Display All" -msgstr "" +msgstr "सब दिखाइए" #: editor/editor_help_search.cpp msgid "Classes Only" -msgstr "" +msgstr "सिर्फ क्लास" #: editor/editor_help_search.cpp msgid "Methods Only" -msgstr "" +msgstr "सिर्फ मेथड" #: editor/editor_help_search.cpp -#, fuzzy msgid "Signals Only" -msgstr "संकेत" +msgstr "सिर्फ सिग्नल" #: editor/editor_help_search.cpp msgid "Constants Only" -msgstr "" +msgstr "सिर्फ कोन्स्टन्ट" #: editor/editor_help_search.cpp msgid "Properties Only" -msgstr "" +msgstr "सिर्फ प्रोपरटिज" #: editor/editor_help_search.cpp msgid "Theme Properties Only" -msgstr "" +msgstr "सिर्फ थिम प्रोपरटिज" #: editor/editor_help_search.cpp msgid "Member Type" -msgstr "" +msgstr "मेंबर टाइप" #: editor/editor_help_search.cpp msgid "Class" -msgstr "" +msgstr "क्लास" #: editor/editor_help_search.cpp msgid "Method" -msgstr "" +msgstr "मेथड" #: editor/editor_help_search.cpp editor/plugins/script_text_editor.cpp -#, fuzzy msgid "Signal" -msgstr "संकेत" +msgstr "सिग्नल" #: editor/editor_help_search.cpp editor/plugins/theme_editor_plugin.cpp msgid "Constant" -msgstr "" +msgstr "कोन्स्टन्ट" #: editor/editor_help_search.cpp -#, fuzzy msgid "Property" -msgstr "गुण(Property) ट्रैक" +msgstr "प्रोपर्टी" #: editor/editor_help_search.cpp msgid "Theme Property" -msgstr "" +msgstr "थिम प्रोपर्टी" #: editor/editor_inspector.cpp editor/project_settings_editor.cpp msgid "Property:" -msgstr "" +msgstr "प्रोपर्टी:" #: editor/editor_inspector.cpp msgid "Set" -msgstr "" +msgstr "सेट करे" #: editor/editor_inspector.cpp msgid "Set Multiple:" -msgstr "" +msgstr "अनेक सेट करे:" #: editor/editor_log.cpp msgid "Output:" -msgstr "" +msgstr "परिणाम:" #: editor/editor_log.cpp editor/plugins/tile_map_editor_plugin.cpp -#, fuzzy msgid "Copy Selection" -msgstr "सभी खंड" +msgstr "खंड कौपी कीजिये" #: editor/editor_log.cpp editor/editor_network_profiler.cpp #: editor/editor_profiler.cpp editor/editor_properties.cpp @@ -2091,176 +2090,178 @@ msgstr "सभी खंड" #: modules/gdnative/gdnative_library_editor_plugin.cpp scene/gui/line_edit.cpp #: scene/gui/text_edit.cpp msgid "Clear" -msgstr "" +msgstr "साफ़" #: editor/editor_log.cpp msgid "Clear Output" -msgstr "" +msgstr "परिणाम साफ़ करे" #: editor/editor_network_profiler.cpp editor/editor_node.cpp #: editor/editor_profiler.cpp msgid "Stop" -msgstr "" +msgstr "रोकिये" #: editor/editor_network_profiler.cpp editor/editor_profiler.cpp #: editor/plugins/animation_state_machine_editor.cpp editor/rename_dialog.cpp msgid "Start" -msgstr "" +msgstr "शुरू कीजिये" #: editor/editor_network_profiler.cpp msgid "%s/s" -msgstr "" +msgstr "%s/s" #: editor/editor_network_profiler.cpp msgid "Down" -msgstr "" +msgstr "नीचे" #: editor/editor_network_profiler.cpp msgid "Up" -msgstr "" +msgstr "ऊपर" #: editor/editor_network_profiler.cpp editor/editor_node.cpp msgid "Node" -msgstr "" +msgstr "नोड" #: editor/editor_network_profiler.cpp msgid "Incoming RPC" -msgstr "" +msgstr "आगामी RPC" #: editor/editor_network_profiler.cpp msgid "Incoming RSET" -msgstr "" +msgstr "आगामी RSET" #: editor/editor_network_profiler.cpp msgid "Outgoing RPC" -msgstr "" +msgstr "बाहर जाने वाला RPC" #: editor/editor_network_profiler.cpp msgid "Outgoing RSET" -msgstr "" +msgstr "बाहर जाने वाला RSET" #: editor/editor_node.cpp editor/project_manager.cpp msgid "New Window" -msgstr "" +msgstr "नया विंडो" #: editor/editor_node.cpp msgid "Imported resources can't be saved." -msgstr "" +msgstr "इंपोर्टेड रेसोर्सेस सेव नहीं कर सकते." #: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp #: scene/gui/dialogs.cpp msgid "OK" -msgstr "" +msgstr "ठीक है" #: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp msgid "Error saving resource!" -msgstr "" +msgstr "रेसोर्स सेव करनेमे एरर!" #: editor/editor_node.cpp msgid "" "This resource can't be saved because it does not belong to the edited scene. " "Make it unique first." -msgstr "" +msgstr "रेसोर्स सेव नहीं कर सकते क्योंकि यह संपादित सीन से संबंधित नहीं. इसे पहले युनिक बनाय." #: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp msgid "Save Resource As..." -msgstr "" +msgstr "रेसोर्स इसप्रकार सेव कीजिये..." #: editor/editor_node.cpp msgid "Can't open file for writing:" -msgstr "" +msgstr "फ़ाइल रायटिंग के लिए नहीं खोल सकते:" #: editor/editor_node.cpp msgid "Requested file format unknown:" -msgstr "" +msgstr "निवेदित फ़ाइल फ़ोर्मैट अज्ञात:" #: editor/editor_node.cpp msgid "Error while saving." -msgstr "" +msgstr "सेव करनेमे एरर." #: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp msgid "Can't open '%s'. The file could have been moved or deleted." -msgstr "" +msgstr "'%s' नहीं खोल सकते. फ़ाइल हिलाइ गयी या हटाई गयी." #: editor/editor_node.cpp msgid "Error while parsing '%s'." -msgstr "" +msgstr "'%s' पार्स करनेमे एरर." #: editor/editor_node.cpp msgid "Unexpected end of file '%s'." -msgstr "" +msgstr "अनपेक्षित फ़ाइल समाप्ति '%s'." #: editor/editor_node.cpp msgid "Missing '%s' or its dependencies." -msgstr "" +msgstr "'%s' या उसकी निर्भरित फ़ाइलें नहीं मिली." #: editor/editor_node.cpp msgid "Error while loading '%s'." -msgstr "" +msgstr "लोड करनेमे एरर '%s'." #: editor/editor_node.cpp msgid "Saving Scene" -msgstr "" +msgstr "सीन सेव कर रहा है" #: editor/editor_node.cpp msgid "Analyzing" -msgstr "" +msgstr "विश्लेषण" #: editor/editor_node.cpp msgid "Creating Thumbnail" -msgstr "" +msgstr "थंबनेल बनाना" #: editor/editor_node.cpp msgid "This operation can't be done without a tree root." -msgstr "" +msgstr "यह ऑपरेशन पेड़ की जड़ के बिना नहीं किया जा सकता है।" #: editor/editor_node.cpp msgid "" "This scene can't be saved because there is a cyclic instancing inclusion.\n" "Please resolve it and then attempt to save again." msgstr "" +"इस दृश्य को बचाया नहीं जा सकता क्योंकि एक चक्रीय instancing समावेश है ।\n" +"कृपया इसे हल करें और फिर फिर से बचाने का प्रयास करें।" #: editor/editor_node.cpp msgid "" "Couldn't save scene. Likely dependencies (instances or inheritance) couldn't " "be satisfied." -msgstr "" +msgstr "दृश्य नहीं बचा सका । संभावित निर्भरता (उदाहरण या विरासत) संतुष्ट नहीं हो सकीं।" #: editor/editor_node.cpp editor/scene_tree_dock.cpp msgid "Can't overwrite scene that is still open!" -msgstr "" +msgstr "दृश्य है कि अभी भी खुला है ओवरराइट नहीं कर सकते!" #: editor/editor_node.cpp msgid "Can't load MeshLibrary for merging!" -msgstr "" +msgstr "विलय के लिए MeshLibrary लोड नहीं कर सकते!" #: editor/editor_node.cpp msgid "Error saving MeshLibrary!" -msgstr "" +msgstr "त्रुटि बचत मेष लाइब्रेरी!" #: editor/editor_node.cpp msgid "Can't load TileSet for merging!" -msgstr "" +msgstr "विलय के लिए TileSet लोड नहीं कर सकते!" #: editor/editor_node.cpp msgid "Error saving TileSet!" -msgstr "" +msgstr "त्रुटि बचत टाइलसेट!" #: editor/editor_node.cpp msgid "Error trying to save layout!" -msgstr "" +msgstr "लेआउट को बचाने की कोशिश कर रहा त्रुटि!" #: editor/editor_node.cpp msgid "Default editor layout overridden." -msgstr "" +msgstr "डिफ़ॉल्ट संपादक लेआउट अभिभूत।" #: editor/editor_node.cpp msgid "Layout name not found!" -msgstr "" +msgstr "लेआउट नाम नहीं मिला!" #: editor/editor_node.cpp msgid "Restored default layout to base settings." -msgstr "" +msgstr "आधार सेटिंग्स के लिए डिफ़ॉल्ट लेआउट बहाल।" #: editor/editor_node.cpp msgid "" @@ -2268,18 +2269,26 @@ msgid "" "Please read the documentation relevant to importing scenes to better " "understand this workflow." msgstr "" +"यह संसाधन एक दृश्य है कि आयात किया गया था के अंतर्गत आता है, तो यह संपादन योग्य नहीं है " +"।\n" +"कृपया इस कार्यप्रवाह को बेहतर ढंग से समझने के लिए दृश्यों का आयात करने के लिए प्रासंगिक " +"दस्तावेज पढ़ें।" #: editor/editor_node.cpp msgid "" "This resource belongs to a scene that was instanced or inherited.\n" "Changes to it won't be kept when saving the current scene." msgstr "" +"यह संसाधन एक दृश्य है कि उदाहरण या विरासत में मिला था के अंतर्गत आता है ।\n" +"वर्तमान दृश्य को सहेजते समय इसमें परिवर्तन नहीं रखे जाएंगे।" #: editor/editor_node.cpp msgid "" "This resource was imported, so it's not editable. Change its settings in the " "import panel and then re-import." msgstr "" +"इस संसाधन का आयात किया गया था, तो यह संपादन योग्य नहीं है । आयात पैनल में अपनी सेटिंग " +"बदलें और फिर फिर से आयात करें।" #: editor/editor_node.cpp msgid "" @@ -2288,6 +2297,10 @@ msgid "" "Please read the documentation relevant to importing scenes to better " "understand this workflow." msgstr "" +"यह दृश्य आयात किया गया था, इसलिए इसमें परिवर्तन नहीं रखे जाएंगे।\n" +"यह instancing या विरासत में यह परिवर्तन करने की अनुमति होगी ।\n" +"कृपया इस कार्यप्रवाह को बेहतर ढंग से समझने के लिए दृश्यों का आयात करने के लिए प्रासंगिक " +"दस्तावेज पढ़ें।" #: editor/editor_node.cpp msgid "" @@ -2295,26 +2308,28 @@ msgid "" "Please read the documentation relevant to debugging to better understand " "this workflow." msgstr "" +"यह एक दूरस्थ वस्तु है, इसलिए इसमें परिवर्तन नहीं रखे जाएंगे।\n" +"कृपया इस कार्यप्रवाह को बेहतर ढंग से समझने के लिए डिबगिंग के लिए प्रासंगिक दस्तावेज पढ़ें।" #: editor/editor_node.cpp msgid "There is no defined scene to run." -msgstr "" +msgstr "चलाने के लिए कोई परिभाषित दृश्य नहीं है ।" #: editor/editor_node.cpp msgid "Current scene was never saved, please save it prior to running." -msgstr "" +msgstr "वर्तमान दृश्य कभी नहीं बचाया गया था, कृपया इसे चलाने से पहले बचाने के लिए ।" #: editor/editor_node.cpp msgid "Could not start subprocess!" -msgstr "" +msgstr "उपप्रक्रिया शुरू नहीं कर सका!" #: editor/editor_node.cpp editor/filesystem_dock.cpp msgid "Open Scene" -msgstr "" +msgstr "खुला दृश्य" #: editor/editor_node.cpp msgid "Open Base Scene" -msgstr "" +msgstr "ओपन बेस सीन" #: editor/editor_node.cpp #, fuzzy @@ -2323,121 +2338,123 @@ msgstr "खोलो इसे" #: editor/editor_node.cpp msgid "Quick Open Scene..." -msgstr "" +msgstr "क्विक ओपन सीन..." #: editor/editor_node.cpp msgid "Quick Open Script..." -msgstr "" +msgstr "क्विक ओपन स्क्रिप्ट..." #: editor/editor_node.cpp msgid "Save & Close" -msgstr "" +msgstr "सहेजें और बंद" #: editor/editor_node.cpp msgid "Save changes to '%s' before closing?" -msgstr "" +msgstr "बंद करने से पहले '%' में परिवर्तन सहेजें?" #: editor/editor_node.cpp msgid "Saved %s modified resource(s)." -msgstr "" +msgstr "सहेजा गया% संशोधित संसाधन (एस)" #: editor/editor_node.cpp msgid "A root node is required to save the scene." -msgstr "" +msgstr "दृश्य को बचाने के लिए एक रूट नोड की आवश्यकता होती है।" #: editor/editor_node.cpp msgid "Save Scene As..." -msgstr "" +msgstr "दृश्य के रूप में सहेजें ..." #: editor/editor_node.cpp msgid "No" -msgstr "" +msgstr "नहीं" #: editor/editor_node.cpp msgid "Yes" -msgstr "" +msgstr "हाँ" #: editor/editor_node.cpp msgid "This scene has never been saved. Save before running?" -msgstr "" +msgstr "इस सीन को कभी नहीं बचाया गया। दौड़ने से पहले सहेजें?" #: editor/editor_node.cpp editor/scene_tree_dock.cpp msgid "This operation can't be done without a scene." -msgstr "" +msgstr "यह ऑपरेशन बिना किसी दृश्य के नहीं किया जा सकता है।" #: editor/editor_node.cpp msgid "Export Mesh Library" -msgstr "" +msgstr "निर्यात मेष पुस्तकालय" #: editor/editor_node.cpp msgid "This operation can't be done without a root node." -msgstr "" +msgstr "यह ऑपरेशन रूट नोड के बिना नहीं किया जा सकता है।" #: editor/editor_node.cpp msgid "Export Tile Set" -msgstr "" +msgstr "निर्यात टाइल सेट" #: editor/editor_node.cpp msgid "This operation can't be done without a selected node." -msgstr "" +msgstr "यह ऑपरेशन चयनित नोड के बिना नहीं किया जा सकता है।" #: editor/editor_node.cpp msgid "Current scene not saved. Open anyway?" -msgstr "" +msgstr "वर्तमान दृश्य को बचाया नहीं गया । वैसे भी खुला?" #: editor/editor_node.cpp msgid "Can't reload a scene that was never saved." -msgstr "" +msgstr "एक दृश्य है कि कभी नहीं बचाया गया था फिर से लोड नहीं कर सकते ।" #: editor/editor_node.cpp msgid "Revert" -msgstr "" +msgstr "वापस लौटना" #: editor/editor_node.cpp msgid "This action cannot be undone. Revert anyway?" -msgstr "" +msgstr "इस कार्रवाई को पूर्ववत नहीं किया जा सकता । वैसे भी वापस?" #: editor/editor_node.cpp msgid "Quick Run Scene..." -msgstr "" +msgstr "क्विक रन सीन..." #: editor/editor_node.cpp msgid "Quit" -msgstr "" +msgstr "छोड़ना" #: editor/editor_node.cpp msgid "Exit the editor?" -msgstr "" +msgstr "संपादक से बाहर निकलें?" #: editor/editor_node.cpp msgid "Open Project Manager?" -msgstr "" +msgstr "ओपन प्रोजेक्ट मैनेजर?" #: editor/editor_node.cpp msgid "Save & Quit" -msgstr "" +msgstr "सहेजें और छोड़ो" #: editor/editor_node.cpp msgid "Save changes to the following scene(s) before quitting?" -msgstr "" +msgstr "छोड़ने से पहले निम्नलिखित दृश्य (ओं) में परिवर्तन सहेजें?" #: editor/editor_node.cpp msgid "Save changes the following scene(s) before opening Project Manager?" -msgstr "" +msgstr "परियोजना प्रबंधक खोलने से पहले निम्नलिखित दृश्य (ओं) में परिवर्तन सहेजें?" #: editor/editor_node.cpp msgid "" "This option is deprecated. Situations where refresh must be forced are now " "considered a bug. Please report." msgstr "" +"यह विकल्प बहिष्कृत है। स्थितियों जहां ताज़ा मजबूर किया जाना चाहिए अब एक बग माना जाता " +"है । कृपया रिपोर्ट करें।" #: editor/editor_node.cpp msgid "Pick a Main Scene" -msgstr "" +msgstr "एक मुख्य दृश्य चुनें" #: editor/editor_node.cpp msgid "Close Scene" -msgstr "" +msgstr "क्लोज सीन" #: editor/editor_node.cpp #, fuzzy @@ -2446,50 +2463,56 @@ msgstr "खोलो इसे" #: editor/editor_node.cpp msgid "Unable to enable addon plugin at: '%s' parsing of config failed." -msgstr "" +msgstr "ऐडऑन प्लगइन को सक्षम करने में असमर्थ: '%' कॉन्फिग का पार्सिंग विफल रहा।" #: editor/editor_node.cpp msgid "Unable to find script field for addon plugin at: 'res://addons/%s'." -msgstr "" +msgstr "ऐडऑन प्लगइन के लिए स्क्रिप्ट फ़ील्ड खोजने में असमर्थ: 'res://addons/% s'।" #: editor/editor_node.cpp msgid "Unable to load addon script from path: '%s'." -msgstr "" +msgstr "पथ से ऐडऑन स्क्रिप्ट लोड करने में असमर्थ: '%' ।" #: editor/editor_node.cpp msgid "" "Unable to load addon script from path: '%s' There seems to be an error in " "the code, please check the syntax." msgstr "" +"रास्ते से ऐडऑन स्क्रिप्ट लोड करने में असमर्थ: '% एस' कोड में गड़बड़ी लगती है, कृपया सिंटेक्स की " +"जांच करें।" #: editor/editor_node.cpp msgid "" "Unable to load addon script from path: '%s' Base type is not EditorPlugin." -msgstr "" +msgstr "पथ से ऐडऑन स्क्रिप्ट लोड करने में असमर्थ: '%' आधार प्रकार संपादकप्लगइन नहीं है।" #: editor/editor_node.cpp msgid "Unable to load addon script from path: '%s' Script is not in tool mode." -msgstr "" +msgstr "पथ से ऐडऑन स्क्रिप्ट लोड करने में असमर्थ: '%' स्क्रिप्ट टूल मोड में नहीं है।" #: editor/editor_node.cpp msgid "" "Scene '%s' was automatically imported, so it can't be modified.\n" "To make changes to it, a new inherited scene can be created." msgstr "" +"दृश्य '%' स्वचालित रूप से आयात किया गया था, इसलिए इसे संशोधित नहीं किया जा सकता है।\n" +"इसमें बदलाव करने के लिए विरासत में मिला एक नया सीन बनाया जा सकता है।" #: editor/editor_node.cpp msgid "" "Error loading scene, it must be inside the project path. Use 'Import' to " "open the scene, then save it inside the project path." msgstr "" +"त्रुटि लोडिंग दृश्य, यह परियोजना पथ के अंदर होना चाहिए। दृश्य खोलने के लिए 'आयात' का " +"उपयोग करें, फिर इसे परियोजना पथ के अंदर बचाएं।" #: editor/editor_node.cpp msgid "Scene '%s' has broken dependencies:" -msgstr "" +msgstr "दृश्य '%' निर्भरता टूट गया है:" #: editor/editor_node.cpp msgid "Clear Recent Scenes" -msgstr "" +msgstr "हाल के दृश्यों को साफ करें" #: editor/editor_node.cpp msgid "" @@ -2497,6 +2520,8 @@ msgid "" "You can change it later in \"Project Settings\" under the 'application' " "category." msgstr "" +"कोई मुख्य दृश्य कभी परिभाषित किया गया है, एक का चयन करें?\n" +"आप इसे बाद में 'एप्लिकेशन' श्रेणी के तहत \"प्रोजेक्ट सेटिंग्स\" में बदल सकते हैं।" #: editor/editor_node.cpp msgid "" @@ -2504,6 +2529,8 @@ msgid "" "You can change it later in \"Project Settings\" under the 'application' " "category." msgstr "" +"चयनित दृश्य '%' मौजूद नहीं है, एक वैध का चयन करें?\n" +"आप इसे बाद में 'एप्लिकेशन' श्रेणी के तहत \"प्रोजेक्ट सेटिंग्स\" में बदल सकते हैं।" #: editor/editor_node.cpp msgid "" @@ -2511,28 +2538,30 @@ msgid "" "You can change it later in \"Project Settings\" under the 'application' " "category." msgstr "" +"चयनित दृश्य '%' एक दृश्य फ़ाइल नहीं है, एक वैध का चयन करें?\n" +"आप इसे बाद में 'एप्लिकेशन' श्रेणी के तहत \"प्रोजेक्ट सेटिंग्स\" में बदल सकते हैं।" #: editor/editor_node.cpp msgid "Save Layout" -msgstr "" +msgstr "लेआउट सहेजें" #: editor/editor_node.cpp msgid "Delete Layout" -msgstr "" +msgstr "लेआउट हटाएं" #: editor/editor_node.cpp editor/import_dock.cpp #: editor/script_create_dialog.cpp msgid "Default" -msgstr "" +msgstr "चूक" #: editor/editor_node.cpp editor/editor_properties.cpp #: editor/plugins/script_editor_plugin.cpp editor/property_editor.cpp msgid "Show in FileSystem" -msgstr "" +msgstr "शो में फाइल सिस्टम" #: editor/editor_node.cpp msgid "Play This Scene" -msgstr "" +msgstr "इस दृश्य को खेलो" #: editor/editor_node.cpp #, fuzzy @@ -2546,11 +2575,11 @@ msgstr "बंद करे" #: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp msgid "Close Other Tabs" -msgstr "" +msgstr "बंद करें अन्य टैब" #: editor/editor_node.cpp msgid "Close Tabs to the Right" -msgstr "" +msgstr "टैब को दाईं ओर बंद करें" #: editor/editor_node.cpp #, fuzzy @@ -2559,43 +2588,43 @@ msgstr "बंद करे" #: editor/editor_node.cpp msgid "Switch Scene Tab" -msgstr "" +msgstr "स्विच सीन टैब" #: editor/editor_node.cpp msgid "%d more files or folders" -msgstr "" +msgstr "% डी अधिक फाइलें या फ़ोल्डर" #: editor/editor_node.cpp msgid "%d more folders" -msgstr "" +msgstr "% डी अधिक फ़ोल्डर्स" #: editor/editor_node.cpp msgid "%d more files" -msgstr "" +msgstr "% डी अधिक फाइलें" #: editor/editor_node.cpp msgid "Dock Position" -msgstr "" +msgstr "डॉक पोजीशन" #: editor/editor_node.cpp msgid "Distraction Free Mode" -msgstr "" +msgstr "व्याकुलता मुक्त मोड" #: editor/editor_node.cpp msgid "Toggle distraction-free mode." -msgstr "" +msgstr "व्याकुलता मुक्त मोड टॉगल।" #: editor/editor_node.cpp msgid "Add a new scene." -msgstr "" +msgstr "एक नया दृश्य जोड़ें।" #: editor/editor_node.cpp msgid "Scene" -msgstr "" +msgstr "दृश्य" #: editor/editor_node.cpp msgid "Go to previously opened scene." -msgstr "" +msgstr "पहले खोले गए दृश्य में जाएं।" #: editor/editor_node.cpp #, fuzzy @@ -2604,102 +2633,102 @@ msgstr "सभी खंड" #: editor/editor_node.cpp msgid "Next tab" -msgstr "" +msgstr "अगला टैब" #: editor/editor_node.cpp msgid "Previous tab" -msgstr "" +msgstr "पिछला टैब" #: editor/editor_node.cpp msgid "Filter Files..." -msgstr "" +msgstr "फ़िल्टर फ़ाइलें..." #: editor/editor_node.cpp msgid "Operations with scene files." -msgstr "" +msgstr "दृश्य फ़ाइलों के साथ संचालन।" #: editor/editor_node.cpp msgid "New Scene" -msgstr "" +msgstr "नया दृश्य" #: editor/editor_node.cpp msgid "New Inherited Scene..." -msgstr "" +msgstr "नया विरासत में मिला दृश्य..." #: editor/editor_node.cpp msgid "Open Scene..." -msgstr "" +msgstr "खुला दृश्य..." #: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp msgid "Open Recent" -msgstr "" +msgstr "खुला हाल" #: editor/editor_node.cpp msgid "Save Scene" -msgstr "" +msgstr "दृश्य बचाओ" #: editor/editor_node.cpp msgid "Save All Scenes" -msgstr "" +msgstr "सभी दृश्यों को सहेजें" #: editor/editor_node.cpp msgid "Convert To..." -msgstr "" +msgstr "बदलने के लिए..." #: editor/editor_node.cpp msgid "MeshLibrary..." -msgstr "" +msgstr "मेष लाइब्रेरी..." #: editor/editor_node.cpp msgid "TileSet..." -msgstr "" +msgstr "Tileset ..." #: editor/editor_node.cpp editor/plugins/script_text_editor.cpp #: scene/gui/line_edit.cpp scene/gui/text_edit.cpp msgid "Undo" -msgstr "" +msgstr "पूर्ववत्" #: editor/editor_node.cpp editor/plugins/script_text_editor.cpp #: scene/gui/line_edit.cpp scene/gui/text_edit.cpp msgid "Redo" -msgstr "" +msgstr "दोहराएँ" #: editor/editor_node.cpp msgid "Revert Scene" -msgstr "" +msgstr "वापस दृश्य" #: editor/editor_node.cpp msgid "Miscellaneous project or scene-wide tools." -msgstr "" +msgstr "विविध परियोजना या दृश्य-व्यापी उपकरण।" #: editor/editor_node.cpp editor/project_manager.cpp #: editor/script_create_dialog.cpp msgid "Project" -msgstr "" +msgstr "परियोजना" #: editor/editor_node.cpp msgid "Project Settings..." -msgstr "" +msgstr "प्रोजेक्ट सेटिंग ..." #: editor/editor_node.cpp editor/plugins/version_control_editor_plugin.cpp msgid "Version Control" -msgstr "" +msgstr "वर्जन कंट्रोल" #: editor/editor_node.cpp editor/plugins/version_control_editor_plugin.cpp msgid "Set Up Version Control" -msgstr "" +msgstr "वर्जन नियंत्रण स्थापित करें" #: editor/editor_node.cpp msgid "Shut Down Version Control" -msgstr "" +msgstr "वर्जन नियंत्रण बंद करें" #: editor/editor_node.cpp msgid "Export..." -msgstr "" +msgstr "निर्यात..." #: editor/editor_node.cpp msgid "Install Android Build Template..." -msgstr "" +msgstr "एंड्रॉयड बिल्ड टेम्पलेट स्थापित करें..." #: editor/editor_node.cpp #, fuzzy @@ -2708,7 +2737,7 @@ msgstr "परियोजना के संस्थापक" #: editor/editor_node.cpp editor/plugins/tile_set_editor_plugin.cpp msgid "Tools" -msgstr "" +msgstr "उपकरण" #: editor/editor_node.cpp #, fuzzy @@ -2717,26 +2746,28 @@ msgstr "Orphan Resource Explorer" #: editor/editor_node.cpp msgid "Quit to Project List" -msgstr "" +msgstr "परियोजना सूची में छोड़ो" #: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp #: editor/project_export.cpp msgid "Debug" -msgstr "" +msgstr "डीबग करें" #: editor/editor_node.cpp msgid "Deploy with Remote Debug" -msgstr "" +msgstr "रिमोट डिबग के साथ तैनात" #: editor/editor_node.cpp msgid "" "When exporting or deploying, the resulting executable will attempt to " "connect to the IP of this computer in order to be debugged." msgstr "" +"निर्यात या तैनाती करते समय, परिणामी निष्पादक इस कंप्यूटर के आईपी से जुड़ने का प्रयास करेगा " +"ताकि डिबग किया जा सके।" #: editor/editor_node.cpp msgid "Small Deploy with Network FS" -msgstr "" +msgstr "नेटवर्क एफएस के साथ छोटे तैनात" #: editor/editor_node.cpp msgid "" @@ -2747,30 +2778,36 @@ msgid "" "On Android, deploy will use the USB cable for faster performance. This " "option speeds up testing for games with a large footprint." msgstr "" +"जब यह विकल्प सक्षम हो जाता है, तो निर्यात या तैनाती न्यूनतम निष्पादित उत्पादन करेगी।\n" +"नेटवर्क के ऊपर संपादक द्वारा परियोजना से फाइलसिस्टम उपलब्ध कराया जाएगा।\n" +"एंड्रॉयड पर, तैनात तेजी से प्रदर्शन के लिए यूएसबी केबल का उपयोग करेंगे । यह विकल्प एक बड़े " +"पदचिह्न के साथ खेल के लिए परीक्षण को गति देता है।" #: editor/editor_node.cpp msgid "Visible Collision Shapes" -msgstr "" +msgstr "दृश्यमान टकराव आकार" #: editor/editor_node.cpp msgid "" "Collision shapes and raycast nodes (for 2D and 3D) will be visible on the " "running game if this option is turned on." msgstr "" +"यदि यह विकल्प चालू हो जाता है तो टकराव के आकार और रेकास्ट नोड्स (2डी और 3 डी के लिए) " +"चल रहे खेल पर दिखाई देंगे।" #: editor/editor_node.cpp msgid "Visible Navigation" -msgstr "" +msgstr "दर्शनीय नेविगेशन" #: editor/editor_node.cpp msgid "" "Navigation meshes and polygons will be visible on the running game if this " "option is turned on." -msgstr "" +msgstr "यदि यह विकल्प चालू हो जाता है तो नेविगेशन मेशेस और बहुभुज चल रहे खेल पर दिखाई देंगे।" #: editor/editor_node.cpp msgid "Sync Scene Changes" -msgstr "" +msgstr "सिंक सीन बदलता है" #: editor/editor_node.cpp msgid "" @@ -2779,10 +2816,14 @@ msgid "" "When used remotely on a device, this is more efficient with network " "filesystem." msgstr "" +"जब इस विकल्प को चालू किया जाता है, तो संपादक में दृश्य में किए गए किसी भी परिवर्तन को " +"चल रहे खेल में दोहराया जाएगा।\n" +"जब किसी डिवाइस पर दूर से उपयोग किया जाता है, तो यह नेटवर्क फाइलसिस्टम के साथ अधिक " +"कुशल होता है।" #: editor/editor_node.cpp msgid "Sync Script Changes" -msgstr "" +msgstr "सिंक स्क्रिप्ट परिवर्तन" #: editor/editor_node.cpp msgid "" @@ -2791,10 +2832,14 @@ msgid "" "When used remotely on a device, this is more efficient with network " "filesystem." msgstr "" +"जब यह विकल्प चालू हो जाएगा, तो सहेजी गई किसी भी स्क्रिप्ट को चल रहे गेम पर फिर से लोड " +"किया जाएगा।\n" +"जब किसी डिवाइस पर दूर से उपयोग किया जाता है, तो यह नेटवर्क फाइलसिस्टम के साथ अधिक " +"कुशल होता है।" #: editor/editor_node.cpp editor/script_create_dialog.cpp msgid "Editor" -msgstr "" +msgstr "संपादक" #: editor/editor_node.cpp #, fuzzy @@ -2803,47 +2848,47 @@ msgstr "अनुवाद में बदलाव करें:" #: editor/editor_node.cpp msgid "Editor Layout" -msgstr "" +msgstr "संपादक लेआउट" #: editor/editor_node.cpp msgid "Take Screenshot" -msgstr "" +msgstr "स्क्रीनशॉट लें" #: editor/editor_node.cpp msgid "Screenshots are stored in the Editor Data/Settings Folder." -msgstr "" +msgstr "स्क्रीनशॉट एडिटर डेटा/सेटिंग्स फोल्डर में स्टोर किए जाते हैं ।" #: editor/editor_node.cpp msgid "Toggle Fullscreen" -msgstr "" +msgstr "पूर्णस्क्रीन चालू करें" #: editor/editor_node.cpp msgid "Toggle System Console" -msgstr "" +msgstr "टॉगल सिस्टम कंसोल" #: editor/editor_node.cpp msgid "Open Editor Data/Settings Folder" -msgstr "" +msgstr "संपादक डेटा / सेटिंग्स फ़ोल्डर खोलें" #: editor/editor_node.cpp msgid "Open Editor Data Folder" -msgstr "" +msgstr "संपादक डेटा फ़ोल्डर खोलें" #: editor/editor_node.cpp msgid "Open Editor Settings Folder" -msgstr "" +msgstr "ओपन एडिटर सेटिंगफ़र" #: editor/editor_node.cpp msgid "Manage Editor Features..." -msgstr "" +msgstr "संपादक सुविधाएँ प्रबंधित करें ..." #: editor/editor_node.cpp msgid "Manage Export Templates..." -msgstr "" +msgstr "निर्यात टेम्पलेट्स का प्रबंधन करें ..." #: editor/editor_node.cpp editor/plugins/shader_editor_plugin.cpp msgid "Help" -msgstr "" +msgstr "मदद" #: editor/editor_node.cpp editor/plugins/asset_library_editor_plugin.cpp #: editor/plugins/script_editor_plugin.cpp @@ -2852,19 +2897,23 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp editor/project_manager.cpp #: editor/project_settings_editor.cpp editor/rename_dialog.cpp msgid "Search" -msgstr "" +msgstr "ढूंढें" #: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp #: editor/plugins/shader_editor_plugin.cpp msgid "Online Docs" -msgstr "" +msgstr "ऑनलाइन डॉक्स" #: editor/editor_node.cpp msgid "Q&A" +msgstr "Q&A" + +#: editor/editor_node.cpp +msgid "Report a Bug" msgstr "" #: editor/editor_node.cpp -msgid "Issue Tracker" +msgid "Send Docs Feedback" msgstr "" #: editor/editor_node.cpp editor/plugins/asset_library_editor_plugin.cpp @@ -2877,92 +2926,92 @@ msgstr "के बारे में" #: editor/editor_node.cpp msgid "Play the project." -msgstr "" +msgstr "प्रोजेक्ट चलाएं।" #: editor/editor_node.cpp msgid "Play" -msgstr "" +msgstr "खेल" #: editor/editor_node.cpp msgid "Pause the scene execution for debugging." -msgstr "" +msgstr "डिबगिंग के लिए दृश्य निष्पादन को रोकें।" #: editor/editor_node.cpp msgid "Pause Scene" -msgstr "" +msgstr "दृश्य रोकें" #: editor/editor_node.cpp msgid "Stop the scene." -msgstr "" +msgstr "सीन बंद करो।" #: editor/editor_node.cpp msgid "Play the edited scene." -msgstr "" +msgstr "संपादित दृश्य खेलते हैं।" #: editor/editor_node.cpp msgid "Play Scene" -msgstr "" +msgstr "प्ले सीन" #: editor/editor_node.cpp msgid "Play custom scene" -msgstr "" +msgstr "कस्टम दृश्य बजाना" #: editor/editor_node.cpp msgid "Play Custom Scene" -msgstr "" +msgstr "कस्टम दृश्य बजाना" #: editor/editor_node.cpp msgid "Changing the video driver requires restarting the editor." -msgstr "" +msgstr "वीडियो ड्राइवर को बदलने के लिए संपादक को फिर से शुरू करने की आवश्यकता होती है।" #: editor/editor_node.cpp editor/project_settings_editor.cpp #: editor/settings_config_dialog.cpp msgid "Save & Restart" -msgstr "" +msgstr "सहेजें और पुनः आरंभ करें" #: editor/editor_node.cpp msgid "Spins when the editor window redraws." -msgstr "" +msgstr "जब संपादक खिड़की फिर से खींचता है तो स्पिन करता है।" #: editor/editor_node.cpp msgid "Update Continuously" -msgstr "" +msgstr "लगातार अपडेट करें" #: editor/editor_node.cpp msgid "Update When Changed" -msgstr "" +msgstr "जब बदला अद्यतन" #: editor/editor_node.cpp msgid "Hide Update Spinner" -msgstr "" +msgstr "अपडेट स्पिनर को छिपाएं" #: editor/editor_node.cpp msgid "FileSystem" -msgstr "" +msgstr "फ़ाइल" #: editor/editor_node.cpp msgid "Inspector" -msgstr "" +msgstr "निरीक्षक" #: editor/editor_node.cpp msgid "Expand Bottom Panel" -msgstr "" +msgstr "बॉटम पैनल का विस्तार करें" #: editor/editor_node.cpp msgid "Output" -msgstr "" +msgstr "आउटपुट" #: editor/editor_node.cpp msgid "Don't Save" -msgstr "" +msgstr "सहेजें मत करो" #: editor/editor_node.cpp msgid "Android build template is missing, please install relevant templates." -msgstr "" +msgstr "एंड्रॉइड बिल्ड टेम्पलेट गायब है, कृपया प्रासंगिक टेम्पलेट्स स्थापित करें।" #: editor/editor_node.cpp msgid "Manage Templates" -msgstr "" +msgstr "टेम्पलेट्स का प्रबंधन करें" #: editor/editor_node.cpp msgid "" @@ -2974,6 +3023,12 @@ msgid "" "the \"Use Custom Build\" option should be enabled in the Android export " "preset." msgstr "" +"यह \"res://android/build\" के लिए स्रोत टेम्पलेट स्थापित करके कस्टम एंड्रॉइड बिल्ड के " +"लिए आपकी परियोजना स्थापित करेगा।\n" +"फिर आप संशोधनों को लागू कर सकते हैं और निर्यात पर अपना खुद का कस्टम एपीके बना सकते हैं " +"(मॉड्यूल जोड़ना, AndroidManifest.xml, आदि बदलना)।\n" +"ध्यान दें कि पूर्व-निर्मित एपीके का उपयोग करने के बजाय कस्टम बिल्ड बनाने के लिए, एंड्रॉइड " +"निर्यात पूर्व निर्धारित में \"उपयोग कस्टम बिल्ड\" विकल्प सक्षम किया जाना चाहिए।" #: editor/editor_node.cpp msgid "" @@ -2982,66 +3037,70 @@ msgid "" "Remove the \"res://android/build\" directory manually before attempting this " "operation again." msgstr "" +"एंड्रॉयड बिल्ड टेम्पलेट पहले से ही इस परियोजना में स्थापित है और यह अधिक नहीं लिखा जाएगा " +"।\n" +"इस ऑपरेशन को फिर से प्रयास करने से पहले मैन्युअल रूप से \"res://android/build\" " +"निर्देशिका निकालें।" #: editor/editor_node.cpp msgid "Import Templates From ZIP File" -msgstr "" +msgstr "जिप फाइल से आयात टेम्पलेट्स" #: editor/editor_node.cpp msgid "Template Package" -msgstr "" +msgstr "टेम्पलेट पैकेज" #: editor/editor_node.cpp msgid "Export Library" -msgstr "" +msgstr "एक्सपोर्ट लाइब्रेरी" #: editor/editor_node.cpp msgid "Merge With Existing" -msgstr "" +msgstr "मौजूदा के साथ विलय" #: editor/editor_node.cpp msgid "Open & Run a Script" -msgstr "" +msgstr "ओपन एंड रन एक स्क्रिप्ट" #: editor/editor_node.cpp msgid "New Inherited" -msgstr "" +msgstr "नई विरासत में मिली" #: editor/editor_node.cpp msgid "Load Errors" -msgstr "" +msgstr "लोड त्रुटियां" #: editor/editor_node.cpp editor/plugins/tile_map_editor_plugin.cpp msgid "Select" -msgstr "" +msgstr "चुनें" #: editor/editor_node.cpp msgid "Open 2D Editor" -msgstr "" +msgstr "ओपन 2D संपादक" #: editor/editor_node.cpp msgid "Open 3D Editor" -msgstr "" +msgstr "ओपन 3डी एडिटर" #: editor/editor_node.cpp msgid "Open Script Editor" -msgstr "" +msgstr "ओपन स्क्रिप्ट एडिटर" #: editor/editor_node.cpp editor/project_manager.cpp msgid "Open Asset Library" -msgstr "" +msgstr "ओपन एसेट लाइब्रेरी" #: editor/editor_node.cpp msgid "Open the next Editor" -msgstr "" +msgstr "अगले संपादक खोलें" #: editor/editor_node.cpp msgid "Open the previous Editor" -msgstr "" +msgstr "पिछले संपादक खोलें" #: editor/editor_node.h msgid "Warning!" -msgstr "" +msgstr "चेतावनी!" #: editor/editor_path.cpp #, fuzzy @@ -3050,11 +3109,11 @@ msgstr "संसाधन" #: editor/editor_plugin.cpp msgid "Creating Mesh Previews" -msgstr "" +msgstr "मेष पूर्वावलोकन बनाना" #: editor/editor_plugin.cpp msgid "Thumbnail..." -msgstr "" +msgstr "थंबनेल..." #: editor/editor_plugin_settings.cpp #, fuzzy @@ -3063,72 +3122,72 @@ msgstr "निर्भरता संपादक" #: editor/editor_plugin_settings.cpp msgid "Edit Plugin" -msgstr "" +msgstr "प्लगइन को संपादित करें" #: editor/editor_plugin_settings.cpp msgid "Installed Plugins:" -msgstr "" +msgstr "स्थापित प्लगइन्स:" #: editor/editor_plugin_settings.cpp editor/plugin_config_dialog.cpp msgid "Update" -msgstr "" +msgstr "अद्यतन" #: editor/editor_plugin_settings.cpp editor/plugin_config_dialog.cpp #: editor/plugins/asset_library_editor_plugin.cpp msgid "Version:" -msgstr "" +msgstr "संस्करण:" #: editor/editor_plugin_settings.cpp editor/plugin_config_dialog.cpp msgid "Author:" -msgstr "" +msgstr "लेखक:" #: editor/editor_plugin_settings.cpp msgid "Status:" -msgstr "" +msgstr "स्थिति:" #: editor/editor_plugin_settings.cpp msgid "Edit:" -msgstr "" +msgstr "संपादित:" #: editor/editor_profiler.cpp msgid "Measure:" -msgstr "" +msgstr "рдорд╛рдк:" #: editor/editor_profiler.cpp msgid "Frame Time (sec)" -msgstr "" +msgstr "फ्रेम समय (सेकंड)" #: editor/editor_profiler.cpp msgid "Average Time (sec)" -msgstr "" +msgstr "औसत समय (सेकंड)" #: editor/editor_profiler.cpp msgid "Frame %" -msgstr "" +msgstr "फ़्रेम%" #: editor/editor_profiler.cpp msgid "Physics Frame %" -msgstr "" +msgstr "फिजिक्स फ्रेम %" #: editor/editor_profiler.cpp msgid "Inclusive" -msgstr "" +msgstr "समावेशी" #: editor/editor_profiler.cpp msgid "Self" -msgstr "" +msgstr "स्वयं" #: editor/editor_profiler.cpp msgid "Frame #:" -msgstr "" +msgstr "फ्रेम #:" #: editor/editor_profiler.cpp msgid "Time" -msgstr "" +msgstr "समय" #: editor/editor_profiler.cpp msgid "Calls" -msgstr "" +msgstr "कॉल" #: editor/editor_properties.cpp #, fuzzy @@ -3137,23 +3196,23 @@ msgstr "परिवर्तन वक्र चयन" #: editor/editor_properties.cpp editor/script_create_dialog.cpp msgid "On" -msgstr "" +msgstr "पर" #: editor/editor_properties.cpp msgid "Layer" -msgstr "" +msgstr "परत" #: editor/editor_properties.cpp msgid "Bit %d, value %d" -msgstr "" +msgstr "बिट%d, मूल्य % डी" #: editor/editor_properties.cpp msgid "[Empty]" -msgstr "" +msgstr "[खाली]" #: editor/editor_properties.cpp editor/plugins/root_motion_editor_plugin.cpp msgid "Assign..." -msgstr "" +msgstr "सौंपना..." #: editor/editor_properties.cpp #, fuzzy @@ -3165,12 +3224,15 @@ msgid "" "The selected resource (%s) does not match any type expected for this " "property (%s)." msgstr "" +"चयनित संसाधन (%s) इस संपत्ति (% एस) के लिए अपेक्षित किसी भी प्रकार से मेल नहीं खाता है।" #: editor/editor_properties.cpp msgid "" "Can't create a ViewportTexture on resources saved as a file.\n" "Resource needs to belong to a scene." msgstr "" +"फ़ाइल के रूप में सहेजे गए संसाधनों पर व्यूपोर्टटेक्सचर नहीं बना सकते.\n" +"संसाधन के लिए एक दृश्य से संबंधित की जरूरत है ।" #: editor/editor_properties.cpp msgid "" @@ -3179,26 +3241,28 @@ msgid "" "Please switch on the 'local to scene' property on it (and all resources " "containing it up to a node)." msgstr "" +"इस संसाधन पर व्यूपोर्टटेक्सचर नहीं बना सकते क्योंकि यह स्थानीय से दृश्य के रूप में सेट नहीं है।\n" +"कृपया उस पर 'स्थानीय से दृश्य' संपत्ति पर स्विच करें (और इसे युक्त सभी संसाधन एक नोड तक)।" #: editor/editor_properties.cpp editor/property_editor.cpp msgid "Pick a Viewport" -msgstr "" +msgstr "व्यूपोर्ट चुनें" #: editor/editor_properties.cpp editor/property_editor.cpp msgid "New Script" -msgstr "" +msgstr "नई स्क्रिप्ट" #: editor/editor_properties.cpp editor/scene_tree_dock.cpp msgid "Extend Script" -msgstr "" +msgstr "स्क्रिप्ट बढ़ाएँ" #: editor/editor_properties.cpp editor/property_editor.cpp msgid "New %s" -msgstr "" +msgstr "नया%s" #: editor/editor_properties.cpp editor/property_editor.cpp msgid "Make Unique" -msgstr "" +msgstr "अद्वितीय बनाओ" #: editor/editor_properties.cpp #: editor/plugins/animation_blend_space_1d_editor.cpp @@ -3212,193 +3276,197 @@ msgstr "" #: editor/plugins/tile_map_editor_plugin.cpp editor/property_editor.cpp #: scene/gui/line_edit.cpp scene/gui/text_edit.cpp msgid "Paste" -msgstr "" +msgstr "चिपकाएँ" #: editor/editor_properties.cpp editor/property_editor.cpp msgid "Convert To %s" -msgstr "" +msgstr "% एस में परिवर्तित करें" #: editor/editor_properties.cpp editor/property_editor.cpp msgid "Selected node is not a Viewport!" -msgstr "" +msgstr "चयनित नोड व्यूपोर्ट नहीं है!" #: editor/editor_properties_array_dict.cpp msgid "Size: " -msgstr "" +msgstr "आकार: " #: editor/editor_properties_array_dict.cpp msgid "Page: " -msgstr "" +msgstr "पृष्ठ: " #: editor/editor_properties_array_dict.cpp #: editor/plugins/theme_editor_plugin.cpp msgid "Remove Item" -msgstr "" +msgstr "आइटम निकालें" #: editor/editor_properties_array_dict.cpp msgid "New Key:" -msgstr "" +msgstr "नई कुंजी:" #: editor/editor_properties_array_dict.cpp msgid "New Value:" -msgstr "" +msgstr "नया मूल्य:" #: editor/editor_properties_array_dict.cpp msgid "Add Key/Value Pair" -msgstr "" +msgstr "कुंजी/मूल्य जोड़ी जोड़ें" #: editor/editor_run_native.cpp msgid "" "No runnable export preset found for this platform.\n" "Please add a runnable preset in the export menu." msgstr "" +"इस मंच के लिए कोई रननयोग्य निर्यात पूर्व निर्धारित नहीं मिला।\n" +"कृपया निर्यात मेनू में एक रननेबल प्रीसेट जोड़ें।" #: editor/editor_run_script.cpp msgid "Write your logic in the _run() method." -msgstr "" +msgstr "अपने तर्क को _run () विधि में लिखें।" #: editor/editor_run_script.cpp msgid "There is an edited scene already." -msgstr "" +msgstr "वहां एक संपादित दृश्य पहले से ही है ।" #: editor/editor_run_script.cpp msgid "Couldn't instance script:" -msgstr "" +msgstr "उदाहरण स्क्रिप्ट नहीं कर सका:" #: editor/editor_run_script.cpp msgid "Did you forget the 'tool' keyword?" -msgstr "" +msgstr "क्या आप 'टूल' कीवर्ड भूल गए?" #: editor/editor_run_script.cpp msgid "Couldn't run script:" -msgstr "" +msgstr "स्क्रिप्ट नहीं चला सका:" #: editor/editor_run_script.cpp msgid "Did you forget the '_run' method?" -msgstr "" +msgstr "क्या आप '_run' विधि को भूल गए?" #: editor/editor_sub_scene.cpp msgid "Select Node(s) to Import" -msgstr "" +msgstr "आयात करने के लिए नोड (एस) का चयन करें" #: editor/editor_sub_scene.cpp editor/project_manager.cpp msgid "Browse" -msgstr "" +msgstr "ब्राउज़" #: editor/editor_sub_scene.cpp msgid "Scene Path:" -msgstr "" +msgstr "दृश्य पथ:" #: editor/editor_sub_scene.cpp msgid "Import From Node:" -msgstr "" +msgstr "नोड से आयात:" #: editor/export_template_manager.cpp msgid "Redownload" -msgstr "" +msgstr "रीडाउनलोड करें" #: editor/export_template_manager.cpp msgid "Uninstall" -msgstr "" +msgstr "अनइंस्टाल करें" #: editor/export_template_manager.cpp msgid "(Installed)" -msgstr "" +msgstr "(स्थापित)" #: editor/export_template_manager.cpp #: editor/plugins/asset_library_editor_plugin.cpp msgid "Download" -msgstr "" +msgstr "डाउनलोड" #: editor/export_template_manager.cpp msgid "Official export templates aren't available for development builds." -msgstr "" +msgstr "विकास के निर्माण के लिए आधिकारिक निर्यात टेम्पलेटउपलब्ध नहीं हैं।" #: editor/export_template_manager.cpp msgid "(Missing)" -msgstr "" +msgstr "(लापता)" #: editor/export_template_manager.cpp msgid "(Current)" -msgstr "" +msgstr "(वर्तमान)" #: editor/export_template_manager.cpp msgid "Retrieving mirrors, please wait..." -msgstr "" +msgstr "दर्पण को पुनः प्राप्त करना, कृपया प्रतीक्षा करें ..." #: editor/export_template_manager.cpp msgid "Remove template version '%s'?" -msgstr "" +msgstr "टेम्पलेट संस्करण '%s'?" #: editor/export_template_manager.cpp msgid "Can't open export templates zip." -msgstr "" +msgstr "निर्यात टेम्पलेट्स ज़िप नहीं खोल सकते।" #: editor/export_template_manager.cpp msgid "Invalid version.txt format inside templates: %s." -msgstr "" +msgstr "टेम्पलेट्स के अंदर अमान्य संस्करण.txt प्रारूप: % एस।" #: editor/export_template_manager.cpp msgid "No version.txt found inside templates." -msgstr "" +msgstr "टेम्पलेट्स के अंदर कोई संस्करण.txt नहीं मिला।" #: editor/export_template_manager.cpp msgid "Error creating path for templates:" -msgstr "" +msgstr "टेम्पलेट्स के लिए पथ बनाने में त्रुटि:" #: editor/export_template_manager.cpp msgid "Extracting Export Templates" -msgstr "" +msgstr "एक्सपोर्ट टेम्पलेट्स निकालना" #: editor/export_template_manager.cpp msgid "Importing:" -msgstr "" +msgstr "आयात:" #: editor/export_template_manager.cpp msgid "Error getting the list of mirrors." -msgstr "" +msgstr "त्रुटि दर्पण की सूची हो रही है।" #: editor/export_template_manager.cpp msgid "Error parsing JSON of mirror list. Please report this issue!" -msgstr "" +msgstr "मिरर लिस्ट की त्रुटि पार्सिंग जेसन । कृपया इस मुद्दे की रिपोर्ट करें!" #: editor/export_template_manager.cpp msgid "" "No download links found for this version. Direct download is only available " "for official releases." msgstr "" +"इस संस्करण के लिए कोई डाउनलोड लिंक नहीं मिला। प्रत्यक्ष डाउनलोड केवल आधिकारिक रिलीज के " +"लिए उपलब्ध है।" #: editor/export_template_manager.cpp #: editor/plugins/asset_library_editor_plugin.cpp msgid "Can't resolve." -msgstr "" +msgstr "हल नहीं कर सकते।" #: editor/export_template_manager.cpp #: editor/plugins/asset_library_editor_plugin.cpp msgid "Can't connect." -msgstr "" +msgstr "कनेक्ट नहीं कर सकते।" #: editor/export_template_manager.cpp #: editor/plugins/asset_library_editor_plugin.cpp msgid "No response." -msgstr "" +msgstr "कोई जवाब नहीं।" #: editor/export_template_manager.cpp msgid "Request Failed." -msgstr "" +msgstr "अनुरोध विफल रहा।" #: editor/export_template_manager.cpp msgid "Redirect Loop." -msgstr "" +msgstr "लूप को रीडायरेक्ट करते हैं।" #: editor/export_template_manager.cpp #: editor/plugins/asset_library_editor_plugin.cpp msgid "Failed:" -msgstr "" +msgstr "विफल:" #: editor/export_template_manager.cpp msgid "Download Complete." -msgstr "" +msgstr "पूरा डाउनलोड करें।" #: editor/export_template_manager.cpp #, fuzzy @@ -3410,6 +3478,8 @@ msgid "" "Templates installation failed.\n" "The problematic templates archives can be found at '%s'." msgstr "" +"टेम्पलेट्स स्थापना विफल रही।\n" +"समस्याग्रस्त टेम्पलेट्स अभिलेखागार '%' पर पाया जा सकता है।" #: editor/export_template_manager.cpp msgid "Error requesting URL:" @@ -3417,24 +3487,24 @@ msgstr "लोड होने मे त्रुटि:" #: editor/export_template_manager.cpp msgid "Connecting to Mirror..." -msgstr "" +msgstr "मिरर से कनेक्ट..." #: editor/export_template_manager.cpp msgid "Disconnected" -msgstr "" +msgstr "डिस्कनेक्ट" #: editor/export_template_manager.cpp msgid "Resolving" -msgstr "" +msgstr "समाधान" #: editor/export_template_manager.cpp msgid "Can't Resolve" -msgstr "" +msgstr "हल नहीं कर सकते" #: editor/export_template_manager.cpp #: editor/plugins/asset_library_editor_plugin.cpp msgid "Connecting..." -msgstr "" +msgstr "जोड़ने..." #: editor/export_template_manager.cpp msgid "Can't Connect" @@ -3442,24 +3512,24 @@ msgstr "कनेक्ट नहीं कर सकते" #: editor/export_template_manager.cpp msgid "Connected" -msgstr "" +msgstr "जुड़ा" #: editor/export_template_manager.cpp #: editor/plugins/asset_library_editor_plugin.cpp msgid "Requesting..." -msgstr "" +msgstr "अनुरोध..." #: editor/export_template_manager.cpp msgid "Downloading" -msgstr "" +msgstr "डाउनलोड" #: editor/export_template_manager.cpp msgid "Connection Error" -msgstr "" +msgstr "कनेक्शन त्रुटि" #: editor/export_template_manager.cpp msgid "SSL Handshake Error" -msgstr "" +msgstr "एसएसएल हैंडशेक एरर" #: editor/export_template_manager.cpp msgid "Uncompressing Android Build Sources" @@ -3467,19 +3537,19 @@ msgstr "अनकॉमिंग एंड्रॉइड बिल्ड स् #: editor/export_template_manager.cpp msgid "Current Version:" -msgstr "" +msgstr "वर्तमान संस्करण:" #: editor/export_template_manager.cpp msgid "Installed Versions:" -msgstr "" +msgstr "स्थापित संस्करण:" #: editor/export_template_manager.cpp msgid "Install From File" -msgstr "" +msgstr "फ़ाइल से इंस्टॉल करें" #: editor/export_template_manager.cpp msgid "Remove Template" -msgstr "" +msgstr "टेम्पलेट निकालें" #: editor/export_template_manager.cpp msgid "Select Template File" @@ -3487,19 +3557,19 @@ msgstr "टेम्पलेट फ़ाइल का चयन करें" #: editor/export_template_manager.cpp msgid "Godot Export Templates" -msgstr "" +msgstr "गोडॉट एक्सपोर्ट टेम्पलेट्स" #: editor/export_template_manager.cpp msgid "Export Template Manager" -msgstr "" +msgstr "एक्सपोर्ट टेम्पलेट मैनेजर" #: editor/export_template_manager.cpp msgid "Download Templates" -msgstr "" +msgstr "टेम्पलेट्स डाउनलोड करें" #: editor/export_template_manager.cpp msgid "Select mirror from list: (Shift+Click: Open in Browser)" -msgstr "" +msgstr "सूची से दर्पण चुनें: (शिफ्ट +क्लिक: ब्राउज़र में खुला)" #: editor/filesystem_dock.cpp msgid "Favorites" @@ -3508,14 +3578,15 @@ msgstr "पसंद" #: editor/filesystem_dock.cpp msgid "Status: Import of file failed. Please fix file and reimport manually." msgstr "" +"स्थिति: फाइल का आयात विफल रहा। कृपया फाइल को ठीक करें और मैन्युअल रूप से पुनर्आयात करें।" #: editor/filesystem_dock.cpp msgid "Cannot move/rename resources root." -msgstr "" +msgstr "संसाधनों की जड़ को स्थानांतरित/नाम नहीं दे सकते ।" #: editor/filesystem_dock.cpp msgid "Cannot move a folder into itself." -msgstr "" +msgstr "फ़ोल्डर को अपने आप में नहीं ले जा सकते।" #: editor/filesystem_dock.cpp msgid "Error moving:" @@ -3531,11 +3602,11 @@ msgstr "निर्भरता को अपडेट करने में #: editor/filesystem_dock.cpp editor/scene_tree_editor.cpp msgid "No name provided." -msgstr "" +msgstr "कोई नाम प्रदान नहीं किया गया।" #: editor/filesystem_dock.cpp msgid "Provided name contains invalid characters." -msgstr "" +msgstr "बशर्ते नाम में अमान्य पात्र होते हैं।" #: editor/filesystem_dock.cpp msgid "A file or folder with this name already exists." @@ -3890,7 +3961,7 @@ msgid "Reimport" msgstr "" #: editor/import_dock.cpp -msgid "Save scenes, re-import and restart" +msgid "Save Scenes, Re-Import, and Restart" msgstr "" #: editor/import_dock.cpp @@ -6691,14 +6762,6 @@ msgid "Open Godot online documentation." msgstr "" #: editor/plugins/script_editor_plugin.cpp -msgid "Request Docs" -msgstr "" - -#: editor/plugins/script_editor_plugin.cpp -msgid "Help improve the Godot documentation by giving feedback." -msgstr "" - -#: editor/plugins/script_editor_plugin.cpp msgid "Search the reference documentation." msgstr "" @@ -7136,6 +7199,10 @@ msgid "This operation requires a single selected node." msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Auto Orthogonal Enabled" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Lock View Rotation" msgstr "" @@ -7224,13 +7291,13 @@ msgid "Freelook Slow Modifier" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "" -"Note: The FPS value displayed is the editor's framerate.\n" -"It cannot be used as a reliable indication of in-game performance." +msgid "View Rotation Locked" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "View Rotation Locked" +msgid "" +"Note: The FPS value displayed is the editor's framerate.\n" +"It cannot be used as a reliable indication of in-game performance." msgstr "" #: editor/plugins/spatial_editor_plugin.cpp @@ -10633,6 +10700,12 @@ msgid "Script file already exists." msgstr "" #: editor/script_create_dialog.cpp +msgid "" +"Note: Built-in scripts have some limitations and can't be edited using an " +"external editor." +msgstr "" + +#: editor/script_create_dialog.cpp msgid "Class Name:" msgstr "" @@ -12280,6 +12353,10 @@ msgid "" "texture to some node for display." msgstr "" +#: scene/main/viewport.cpp +msgid "Viewport size must be greater than 0 to render anything." +msgstr "" + #: scene/resources/visual_shader_nodes.cpp #, fuzzy msgid "Invalid source for preview." @@ -12311,6 +12388,9 @@ msgstr "" msgid "Constants cannot be modified." msgstr "" +#~ msgid "Issue Tracker" +#~ msgstr "मुद्दा पर नज़र रखने वाला" + #~ msgid "Replaced %d occurrence(s)." #~ msgstr "बदल दिया % डी घटना (एस) ।" diff --git a/editor/translations/hr.po b/editor/translations/hr.po index ce8191c638..5087044b13 100644 --- a/editor/translations/hr.po +++ b/editor/translations/hr.po @@ -1423,7 +1423,7 @@ msgstr "" msgid "Remove Autoload" msgstr "" -#: editor/editor_autoload_settings.cpp +#: editor/editor_autoload_settings.cpp editor/editor_plugin_settings.cpp msgid "Enable" msgstr "" @@ -2829,7 +2829,11 @@ msgid "Q&A" msgstr "" #: editor/editor_node.cpp -msgid "Issue Tracker" +msgid "Report a Bug" +msgstr "" + +#: editor/editor_node.cpp +msgid "Send Docs Feedback" msgstr "" #: editor/editor_node.cpp editor/plugins/asset_library_editor_plugin.cpp @@ -3855,7 +3859,7 @@ msgid "Reimport" msgstr "" #: editor/import_dock.cpp -msgid "Save scenes, re-import and restart" +msgid "Save Scenes, Re-Import, and Restart" msgstr "" #: editor/import_dock.cpp @@ -6654,14 +6658,6 @@ msgid "Open Godot online documentation." msgstr "" #: editor/plugins/script_editor_plugin.cpp -msgid "Request Docs" -msgstr "" - -#: editor/plugins/script_editor_plugin.cpp -msgid "Help improve the Godot documentation by giving feedback." -msgstr "" - -#: editor/plugins/script_editor_plugin.cpp msgid "Search the reference documentation." msgstr "" @@ -7091,6 +7087,10 @@ msgid "This operation requires a single selected node." msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Auto Orthogonal Enabled" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Lock View Rotation" msgstr "" @@ -7179,13 +7179,13 @@ msgid "Freelook Slow Modifier" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "" -"Note: The FPS value displayed is the editor's framerate.\n" -"It cannot be used as a reliable indication of in-game performance." +msgid "View Rotation Locked" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "View Rotation Locked" +msgid "" +"Note: The FPS value displayed is the editor's framerate.\n" +"It cannot be used as a reliable indication of in-game performance." msgstr "" #: editor/plugins/spatial_editor_plugin.cpp @@ -10526,6 +10526,12 @@ msgid "Script file already exists." msgstr "" #: editor/script_create_dialog.cpp +msgid "" +"Note: Built-in scripts have some limitations and can't be edited using an " +"external editor." +msgstr "" + +#: editor/script_create_dialog.cpp msgid "Class Name:" msgstr "" @@ -12154,6 +12160,10 @@ msgid "" "texture to some node for display." msgstr "" +#: scene/main/viewport.cpp +msgid "Viewport size must be greater than 0 to render anything." +msgstr "" + #: scene/resources/visual_shader_nodes.cpp msgid "Invalid source for preview." msgstr "" diff --git a/editor/translations/hu.po b/editor/translations/hu.po index cbe475b022..54206db36f 100644 --- a/editor/translations/hu.po +++ b/editor/translations/hu.po @@ -1507,7 +1507,7 @@ msgstr "AutoLoad Áthelyezése" msgid "Remove Autoload" msgstr "AutoLoad Eltávolítása" -#: editor/editor_autoload_settings.cpp +#: editor/editor_autoload_settings.cpp editor/editor_plugin_settings.cpp msgid "Enable" msgstr "Engedélyezés" @@ -3075,8 +3075,13 @@ msgid "Q&A" msgstr "Kérdések és Válaszok" #: editor/editor_node.cpp -msgid "Issue Tracker" -msgstr "Problémakövető" +#, fuzzy +msgid "Report a Bug" +msgstr "Újraimportálás" + +#: editor/editor_node.cpp +msgid "Send Docs Feedback" +msgstr "" #: editor/editor_node.cpp editor/plugins/asset_library_editor_plugin.cpp msgid "Community" @@ -4167,7 +4172,7 @@ msgid "Reimport" msgstr "Újraimportálás" #: editor/import_dock.cpp -msgid "Save scenes, re-import and restart" +msgid "Save Scenes, Re-Import, and Restart" msgstr "" #: editor/import_dock.cpp @@ -7177,14 +7182,6 @@ msgid "Open Godot online documentation." msgstr "Godot online dokumentáció megnyitása" #: editor/plugins/script_editor_plugin.cpp -msgid "Request Docs" -msgstr "" - -#: editor/plugins/script_editor_plugin.cpp -msgid "Help improve the Godot documentation by giving feedback." -msgstr "" - -#: editor/plugins/script_editor_plugin.cpp msgid "Search the reference documentation." msgstr "Keresés a referencia dokumentációban." @@ -7645,6 +7642,10 @@ msgid "This operation requires a single selected node." msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Auto Orthogonal Enabled" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Lock View Rotation" msgstr "" @@ -7735,13 +7736,13 @@ msgid "Freelook Slow Modifier" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "" -"Note: The FPS value displayed is the editor's framerate.\n" -"It cannot be used as a reliable indication of in-game performance." +msgid "View Rotation Locked" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "View Rotation Locked" +msgid "" +"Note: The FPS value displayed is the editor's framerate.\n" +"It cannot be used as a reliable indication of in-game performance." msgstr "" #: editor/plugins/spatial_editor_plugin.cpp @@ -11270,6 +11271,12 @@ msgid "Script file already exists." msgstr "Már létezik '%s' AutoLoad!" #: editor/script_create_dialog.cpp +msgid "" +"Note: Built-in scripts have some limitations and can't be edited using an " +"external editor." +msgstr "" + +#: editor/script_create_dialog.cpp #, fuzzy msgid "Class Name:" msgstr "Osztály:" @@ -12954,6 +12961,10 @@ msgstr "" "gyermekévé, hogy így kapjon méretet. Ellenkező esetben tegye RenderTarget-" "té, és állítsa hozzá a belső textúráját valamilyen node-hoz kirajzolásra." +#: scene/main/viewport.cpp +msgid "Viewport size must be greater than 0 to render anything." +msgstr "" + #: scene/resources/visual_shader_nodes.cpp #, fuzzy msgid "Invalid source for preview." @@ -12985,6 +12996,9 @@ msgstr "" msgid "Constants cannot be modified." msgstr "" +#~ msgid "Issue Tracker" +#~ msgstr "Problémakövető" + #~ msgid "Replaced %d occurrence(s)." #~ msgstr "Lecserélve %d előfordulás." diff --git a/editor/translations/id.po b/editor/translations/id.po index c4ead514c6..087a274249 100644 --- a/editor/translations/id.po +++ b/editor/translations/id.po @@ -25,12 +25,13 @@ # Akhmad Zulfikar <azuldegratz@gmail.com>, 2020. # Ade Fikri Malihuddin <ade.fm97@gmail.com>, 2020. # zephyroths <ridho.hikaru@gmail.com>, 2020. +# Richard Urban <redasuio1@gmail.com>, 2020. msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2020-03-08 22:33+0000\n" -"Last-Translator: Sofyan Sugianto <sofyanartem@gmail.com>\n" +"PO-Revision-Date: 2020-04-16 11:03+0000\n" +"Last-Translator: Richard Urban <redasuio1@gmail.com>\n" "Language-Team: Indonesian <https://hosted.weblate.org/projects/godot-engine/" "godot/id/>\n" "Language: id\n" @@ -38,7 +39,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Weblate 4.0-dev\n" +"X-Generator: Weblate 4.0.1-dev\n" #: core/math/expression.cpp modules/gdscript/gdscript_functions.cpp #: modules/visual_script/visual_script_builtin_funcs.cpp @@ -1462,7 +1463,7 @@ msgstr "Pindahkan Autoload" msgid "Remove Autoload" msgstr "Hapus Autoload" -#: editor/editor_autoload_settings.cpp +#: editor/editor_autoload_settings.cpp editor/editor_plugin_settings.cpp msgid "Enable" msgstr "Aktifkan" @@ -2947,8 +2948,13 @@ msgid "Q&A" msgstr "Tanya Jawab" #: editor/editor_node.cpp -msgid "Issue Tracker" -msgstr "Pelacak Isu" +#, fuzzy +msgid "Report a Bug" +msgstr "Impor ulang" + +#: editor/editor_node.cpp +msgid "Send Docs Feedback" +msgstr "" #: editor/editor_node.cpp editor/plugins/asset_library_editor_plugin.cpp msgid "Community" @@ -4000,7 +4006,8 @@ msgid "Reimport" msgstr "Impor ulang" #: editor/import_dock.cpp -msgid "Save scenes, re-import and restart" +#, fuzzy +msgid "Save Scenes, Re-Import, and Restart" msgstr "Simpan skena, impor ulang, dan mulai ulang" #: editor/import_dock.cpp @@ -5874,7 +5881,6 @@ msgid "Couldn't create a single convex collision shape." msgstr "Tidak dapat membuat convex collision shape tunggal." #: editor/plugins/mesh_instance_editor_plugin.cpp -#, fuzzy msgid "Create Single Convex Shape" msgstr "Buat Bentuk Cembung" @@ -5887,7 +5893,6 @@ msgid "Couldn't create any collision shapes." msgstr "Tidak dapat membuat bentuk collision." #: editor/plugins/mesh_instance_editor_plugin.cpp -#, fuzzy msgid "Create Multiple Convex Shapes" msgstr "Buat Beberapa Bentuk Cembung" @@ -5964,7 +5969,6 @@ msgstr "" "collision." #: editor/plugins/mesh_instance_editor_plugin.cpp -#, fuzzy msgid "Create Single Convex Collision Sibling" msgstr "Buat Saudara Tunggal Convex Collision" @@ -6855,14 +6859,6 @@ msgid "Open Godot online documentation." msgstr "Buka dokumentasi daring Godot." #: editor/plugins/script_editor_plugin.cpp -msgid "Request Docs" -msgstr "Minta Dokumentasi" - -#: editor/plugins/script_editor_plugin.cpp -msgid "Help improve the Godot documentation by giving feedback." -msgstr "Bantu tingkatkan dokumentasi Godot dengan memberikan tanggapan." - -#: editor/plugins/script_editor_plugin.cpp msgid "Search the reference documentation." msgstr "Cari dokumentasi referensi." @@ -7301,6 +7297,11 @@ msgid "This operation requires a single selected node." msgstr "Operasi ini membutuhkan satu node yang dipilih." #: editor/plugins/spatial_editor_plugin.cpp +#, fuzzy +msgid "Auto Orthogonal Enabled" +msgstr "Ortogonal" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Lock View Rotation" msgstr "Kunci Rotasi Tampilan" @@ -7389,6 +7390,10 @@ msgid "Freelook Slow Modifier" msgstr "Pengubah Lambat Tampilan Bebas" #: editor/plugins/spatial_editor_plugin.cpp +msgid "View Rotation Locked" +msgstr "Rotasi Tampilan Terkunci" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." @@ -7397,10 +7402,6 @@ msgstr "" "Tidak bisa digunakan sebagai indikasi kinerja gim yang dapat dihandalkan." #: editor/plugins/spatial_editor_plugin.cpp -msgid "View Rotation Locked" -msgstr "Rotasi Tampilan Terkunci" - -#: editor/plugins/spatial_editor_plugin.cpp msgid "XForm Dialog" msgstr "Dialog XForm" @@ -10914,6 +10915,12 @@ msgid "Script file already exists." msgstr "Berkas skrip sudah ada." #: editor/script_create_dialog.cpp +msgid "" +"Note: Built-in scripts have some limitations and can't be edited using an " +"external editor." +msgstr "" + +#: editor/script_create_dialog.cpp msgid "Class Name:" msgstr "Nama Kelas:" @@ -11298,7 +11305,6 @@ msgid "GridMap Paste Selection" msgstr "Rekat(Paste) Seleksi GridMap" #: modules/gridmap/grid_map_editor_plugin.cpp -#, fuzzy msgid "GridMap Paint" msgstr "Cat GridMap" @@ -11716,7 +11722,7 @@ msgstr "Tidak dapat membuat fungsi dengan node fungsi." #: modules/visual_script/visual_script_editor.cpp msgid "Can't create function of nodes from nodes of multiple functions." -msgstr "" +msgstr "Tidak dapat membuat fungsi node dari node beberapa fungsi." #: modules/visual_script/visual_script_editor.cpp msgid "Select at least one node with sequence port." @@ -11881,19 +11887,19 @@ msgstr "Nama paket tidak ada." #: platform/android/export/export.cpp msgid "Package segments must be of non-zero length." -msgstr "" +msgstr "Segmen paket panjangnya harus tidak boleh nol." #: platform/android/export/export.cpp msgid "The character '%s' is not allowed in Android application package names." -msgstr "" +msgstr "Karakter '%s' tidak diizinkan dalam penamaan paket aplikasi Android." #: platform/android/export/export.cpp msgid "A digit cannot be the first character in a package segment." -msgstr "" +msgstr "Digit tidak boleh diletakkan sebagai karakter awal di segmen paket." #: platform/android/export/export.cpp msgid "The character '%s' cannot be the first character in a package segment." -msgstr "" +msgstr "Karakter '%s' tidak bisa dijadikan karakter awal dalam segmen paket." #: platform/android/export/export.cpp msgid "The package must have at least one '.' separator." @@ -11939,7 +11945,7 @@ msgstr "" #: platform/android/export/export.cpp msgid "Invalid public key for APK expansion." -msgstr "" +msgstr "Kunci Publik untuk ekspansi APK tidak valid." #: platform/android/export/export.cpp msgid "Invalid package name:" @@ -11950,6 +11956,8 @@ msgid "" "Trying to build from a custom built template, but no version info for it " "exists. Please reinstall from the 'Project' menu." msgstr "" +"Mencoba untuk membangun dari templat build khusus, tapi tidak ada informasi " +"versinya. Silakan pasang ulang dari menu 'Proyek'." #: platform/android/export/export.cpp msgid "" @@ -11958,24 +11966,30 @@ msgid "" " Godot Version: %s\n" "Please reinstall Android build template from 'Project' menu." msgstr "" +"Versi build Android tidak cocok:\n" +" Templat terpasang: %s\n" +" Versi Godot: %s\n" +"Silakan pasang ulang templat build Android dari menu 'Project'." #: platform/android/export/export.cpp msgid "Building Android Project (gradle)" -msgstr "" +msgstr "Membangun Proyek Android (gradle)" #: platform/android/export/export.cpp msgid "" "Building of Android project failed, check output for the error.\n" "Alternatively visit docs.godotengine.org for Android build documentation." msgstr "" +"Pembangunan proyek Android gagal, periksa output untuk galatnya.\n" +"Atau kunjungi docs.godotengine.org untuk dokumentasi build Android." #: platform/android/export/export.cpp msgid "No build apk generated at: " -msgstr "" +msgstr "Tak ada build apk yang dihasilkan di: " #: platform/iphone/export/export.cpp msgid "Identifier is missing." -msgstr "" +msgstr "Kurang identifier." #: platform/iphone/export/export.cpp msgid "The character '%s' is not allowed in Identifier." @@ -11984,6 +11998,7 @@ msgstr "Karakter '%s' tidak diizinkan dalam Identifier." #: platform/iphone/export/export.cpp msgid "App Store Team ID not specified - cannot configure the project." msgstr "" +"App Store Team ID tidak ditetapkan - tidak dapat mengonfigurasi proyek." #: platform/iphone/export/export.cpp msgid "Invalid Identifier:" @@ -11991,19 +12006,19 @@ msgstr "Identifier tidak valid:" #: platform/iphone/export/export.cpp msgid "Required icon is not specified in the preset." -msgstr "" +msgstr "Ikon yang dibutuhkan tidak ditentukan dalam preset." #: platform/javascript/export/export.cpp msgid "Stop HTTP Server" -msgstr "" +msgstr "Hentikan Server HTTP" #: platform/javascript/export/export.cpp msgid "Run in Browser" -msgstr "" +msgstr "Jalankan di Peramban" #: platform/javascript/export/export.cpp msgid "Run exported HTML in the system's default browser." -msgstr "" +msgstr "Jalankan HTML yang diekspor dalam peramban baku sistem." #: platform/javascript/export/export.cpp msgid "Could not write file:" @@ -12055,31 +12070,31 @@ msgstr "Warna latar belakang tidak valid." #: platform/uwp/export/export.cpp msgid "Invalid Store Logo image dimensions (should be 50x50)." -msgstr "" +msgstr "Dimensi gambar Logo Store tidak valid (harus 50x50)." #: platform/uwp/export/export.cpp msgid "Invalid square 44x44 logo image dimensions (should be 44x44)." -msgstr "" +msgstr "Dimensi gambar logo persegi 44x44 tidak valid (harus 44x44)." #: platform/uwp/export/export.cpp msgid "Invalid square 71x71 logo image dimensions (should be 71x71)." -msgstr "" +msgstr "Dimensi gambar logo persegi 71x71 tidak valid (harus 71x71)." #: platform/uwp/export/export.cpp msgid "Invalid square 150x150 logo image dimensions (should be 150x150)." -msgstr "" +msgstr "Dimensi gambar logo persegi 150x150 tidak valid (harus 150x150)." #: platform/uwp/export/export.cpp msgid "Invalid square 310x310 logo image dimensions (should be 310x310)." -msgstr "" +msgstr "Dimensi gambar logo persegi 310x310 tidak valid (harus 310x310)." #: platform/uwp/export/export.cpp msgid "Invalid wide 310x150 logo image dimensions (should be 310x150)." -msgstr "" +msgstr "Dimensi gambar logo 310x150 lebarnya tidak valid (harus 310x150)." #: platform/uwp/export/export.cpp msgid "Invalid splash screen image dimensions (should be 620x300)." -msgstr "" +msgstr "Dimensi gambar splash screen tidak valid (harus 620x300)." #: scene/2d/animated_sprite.cpp msgid "" @@ -12104,6 +12119,10 @@ msgid "" "Consider adding a CollisionShape2D or CollisionPolygon2D as a child to " "define its shape." msgstr "" +"Node ini tidak punya shape, jadi dia tidak bisa bertabrakan atau " +"berinteraksi dengan objek lain.\n" +"Pertimbangkan untuk menambahkan CollisionShape2D atau CollisionPolygon2D " +"sebagai anak untuk mendefinisikan bentuknya." #: scene/2d/collision_polygon_2d.cpp msgid "" @@ -12145,6 +12164,8 @@ msgid "" "CPUParticles2D animation requires the usage of a CanvasItemMaterial with " "\"Particles Animation\" enabled." msgstr "" +"Animasi CPUParticles2D membutuhkan penggunaan CanvasItemMaterial dengan " +"\"Animasi Partikel\" diaktifkan." #: scene/2d/light_2d.cpp msgid "" @@ -12194,18 +12215,25 @@ msgid "" "Use the CPUParticles2D node instead. You can use the \"Convert to " "CPUParticles\" option for this purpose." msgstr "" +"Partikel berbasis GPU tidak didukung oleh video driver GLES2.\n" +"Gunakan node CPUParticles2D sebagai gantinya. Anda dapat menggunakan opsi " +"\"Konversikan jadi CPUParticles\" untuk tujuan ini." #: scene/2d/particles_2d.cpp scene/3d/particles.cpp msgid "" "A material to process the particles is not assigned, so no behavior is " "imprinted." msgstr "" +"Material untuk memproses partikel belum ditetapkan, jadi tidak ada perilaku " +"yang dimunculkan." #: scene/2d/particles_2d.cpp msgid "" "Particles2D animation requires the usage of a CanvasItemMaterial with " "\"Particles Animation\" enabled." msgstr "" +"Animasi Particles2D membutuhkan penggunaan CanvasItemMaterial dengan " +"\"Animasi Partikel\" diaktifkan." #: scene/2d/path_2d.cpp msgid "PathFollow2D only works when set as a child of a Path2D node." @@ -12219,6 +12247,9 @@ msgid "" "by the physics engine when running.\n" "Change the size in children collision shapes instead." msgstr "" +"Perubahan ukuran RigidBody2D (dalam mode karakter atau rigid/pejal) akan " +"ditimpa oleh mesin fisika saat menjalankan.\n" +"Sebagai gantinya, ubahlah ukuran di anakan collision shape-nya saja." #: scene/2d/remote_transform_2d.cpp msgid "Path property must point to a valid Node2D node to work." @@ -12227,16 +12258,19 @@ msgstr "" #: scene/2d/skeleton_2d.cpp msgid "This Bone2D chain should end at a Skeleton2D node." -msgstr "" +msgstr "Ikatan Bone2D ini harus diakhiri dengan node Skeleton2D." #: scene/2d/skeleton_2d.cpp msgid "A Bone2D only works with a Skeleton2D or another Bone2D as parent node." msgstr "" +"Bone2D hanya bekerja dengan Skeleton2D atau Bone2D lain sebagai node induk." #: scene/2d/skeleton_2d.cpp msgid "" "This bone lacks a proper REST pose. Go to the Skeleton2D node and set one." msgstr "" +"Tulang ini tidak memiliki pose REST yang sesuai. Pergi ke node Skeleton2D " +"dan tetapkan." #: scene/2d/tile_map.cpp msgid "" @@ -12258,47 +12292,51 @@ msgstr "" #: scene/3d/arvr_nodes.cpp msgid "ARVRCamera must have an ARVROrigin node as its parent." -msgstr "" +msgstr "ARVRCamera wajib memiliki node ARVROrigin sebagai induknya." #: scene/3d/arvr_nodes.cpp msgid "ARVRController must have an ARVROrigin node as its parent." -msgstr "" +msgstr "ARVRController wajib memiliki node ARVROrigin sebagai induknya." #: scene/3d/arvr_nodes.cpp msgid "" "The controller ID must not be 0 or this controller won't be bound to an " "actual controller." msgstr "" +"ID pengontrol tidak boleh 0 atau pengontrol ini tidak terikat ke pengontrol " +"yang sebenarnya." #: scene/3d/arvr_nodes.cpp msgid "ARVRAnchor must have an ARVROrigin node as its parent." -msgstr "" +msgstr "ARVRAnchor wajib memiliki node ARVROrigin sebagai induknya." #: scene/3d/arvr_nodes.cpp msgid "" "The anchor ID must not be 0 or this anchor won't be bound to an actual " "anchor." msgstr "" +"ID jangkar tidak boleh 0 atau jangkar ini tidak akan terikat ke jangkar " +"aslinya." #: scene/3d/arvr_nodes.cpp msgid "ARVROrigin requires an ARVRCamera child node." -msgstr "" +msgstr "ARVROrigin membutuhkan node anak ARVRCamera." #: scene/3d/baked_lightmap.cpp msgid "%d%%" -msgstr "" +msgstr "%d%%" #: scene/3d/baked_lightmap.cpp msgid "(Time Left: %d:%02d s)" -msgstr "" +msgstr "(Waktu tersisa: %d:%02d s)" #: scene/3d/baked_lightmap.cpp msgid "Plotting Meshes: " -msgstr "" +msgstr "Plotting Meshes: " #: scene/3d/baked_lightmap.cpp msgid "Plotting Lights:" -msgstr "" +msgstr "Plotting Lights:" #: scene/3d/baked_lightmap.cpp scene/3d/gi_probe.cpp msgid "Finishing Plot" @@ -12642,6 +12680,10 @@ msgstr "" "tidak, jadikan sebagai RenderTarget dan tetapkan tekstur internal nya ke " "beberapa node untuk ditampilkan." +#: scene/main/viewport.cpp +msgid "Viewport size must be greater than 0 to render anything." +msgstr "" + #: scene/resources/visual_shader_nodes.cpp msgid "Invalid source for preview." msgstr "Sumber tidak sah untuk pratinjau." @@ -12670,6 +12712,15 @@ msgstr "Variasi hanya bisa ditetapkan dalam fungsi vertex." msgid "Constants cannot be modified." msgstr "Konstanta tidak dapat dimodifikasi." +#~ msgid "Issue Tracker" +#~ msgstr "Pelacak Isu" + +#~ msgid "Request Docs" +#~ msgstr "Minta Dokumentasi" + +#~ msgid "Help improve the Godot documentation by giving feedback." +#~ msgstr "Bantu tingkatkan dokumentasi Godot dengan memberikan tanggapan." + #~ msgid "Replaced %d occurrence(s)." #~ msgstr "kejadian %d diganti." diff --git a/editor/translations/is.po b/editor/translations/is.po index 213e7d239b..bb865e255a 100644 --- a/editor/translations/is.po +++ b/editor/translations/is.po @@ -4,12 +4,13 @@ # This file is distributed under the same license as the Godot source code. # Jóhannes G. Þorsteinsson <johannesg@johannesg.com>, 2017, 2018. # Kaan Gül <qaantum@hotmail.com>, 2018. +# Einar Magnús Einarsson <einar.m.einarsson@gmail.com>, 2020. msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2018-12-13 14:40+0100\n" -"Last-Translator: Jóhannes G. Þorsteinsson <johannesg@johannesg.com>\n" +"PO-Revision-Date: 2020-04-16 11:03+0000\n" +"Last-Translator: Einar Magnús Einarsson <einar.m.einarsson@gmail.com>\n" "Language-Team: Icelandic <https://hosted.weblate.org/projects/godot-engine/" "godot/is/>\n" "Language: is\n" @@ -17,34 +18,35 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Poedit 2.2\n" +"X-Generator: Weblate 4.0.1-dev\n" #: core/math/expression.cpp modules/gdscript/gdscript_functions.cpp #: modules/visual_script/visual_script_builtin_funcs.cpp msgid "Invalid type argument to convert(), use TYPE_* constants." -msgstr "" +msgstr "Ógild breyta send til convert(), notaðu TYPE_ * fasti." #: core/math/expression.cpp modules/gdscript/gdscript_functions.cpp msgid "Expected a string of length 1 (a character)." -msgstr "" +msgstr "Búist var við streng með lengd 1 (a character)." #: core/math/expression.cpp modules/gdscript/gdscript_functions.cpp #: modules/mono/glue/gd_glue.cpp #: modules/visual_script/visual_script_builtin_funcs.cpp msgid "Not enough bytes for decoding bytes, or invalid format." -msgstr "" +msgstr "Ekki nægt minni til að umskrá bæti eða ógilt snið." #: core/math/expression.cpp msgid "Invalid input %i (not passed) in expression" -msgstr "" +msgstr "Ógild inntak % i (ekki sent áfram)" #: core/math/expression.cpp msgid "self can't be used because instance is null (not passed)" msgstr "" +"Ekki hægt að nota \"self\" vegna þess að tilvik er \"null\" (ekki samþykkt)" #: core/math/expression.cpp msgid "Invalid operands to operator %s, %s and %s." -msgstr "" +msgstr "Ógilt reiknitákn notað í útreikningi % s,% s og% s." #: core/math/expression.cpp msgid "Invalid index of type %s for base type %s" @@ -1441,7 +1443,7 @@ msgstr "" msgid "Remove Autoload" msgstr "" -#: editor/editor_autoload_settings.cpp +#: editor/editor_autoload_settings.cpp editor/editor_plugin_settings.cpp msgid "Enable" msgstr "" @@ -2852,7 +2854,11 @@ msgid "Q&A" msgstr "" #: editor/editor_node.cpp -msgid "Issue Tracker" +msgid "Report a Bug" +msgstr "" + +#: editor/editor_node.cpp +msgid "Send Docs Feedback" msgstr "" #: editor/editor_node.cpp editor/plugins/asset_library_editor_plugin.cpp @@ -3878,7 +3884,7 @@ msgid "Reimport" msgstr "" #: editor/import_dock.cpp -msgid "Save scenes, re-import and restart" +msgid "Save Scenes, Re-Import, and Restart" msgstr "" #: editor/import_dock.cpp @@ -6689,14 +6695,6 @@ msgid "Open Godot online documentation." msgstr "" #: editor/plugins/script_editor_plugin.cpp -msgid "Request Docs" -msgstr "" - -#: editor/plugins/script_editor_plugin.cpp -msgid "Help improve the Godot documentation by giving feedback." -msgstr "" - -#: editor/plugins/script_editor_plugin.cpp msgid "Search the reference documentation." msgstr "" @@ -7127,6 +7125,10 @@ msgid "This operation requires a single selected node." msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Auto Orthogonal Enabled" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Lock View Rotation" msgstr "" @@ -7215,13 +7217,13 @@ msgid "Freelook Slow Modifier" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "" -"Note: The FPS value displayed is the editor's framerate.\n" -"It cannot be used as a reliable indication of in-game performance." +msgid "View Rotation Locked" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "View Rotation Locked" +msgid "" +"Note: The FPS value displayed is the editor's framerate.\n" +"It cannot be used as a reliable indication of in-game performance." msgstr "" #: editor/plugins/spatial_editor_plugin.cpp @@ -10588,6 +10590,12 @@ msgid "Script file already exists." msgstr "" #: editor/script_create_dialog.cpp +msgid "" +"Note: Built-in scripts have some limitations and can't be edited using an " +"external editor." +msgstr "" + +#: editor/script_create_dialog.cpp msgid "Class Name:" msgstr "" @@ -12215,6 +12223,10 @@ msgid "" "texture to some node for display." msgstr "" +#: scene/main/viewport.cpp +msgid "Viewport size must be greater than 0 to render anything." +msgstr "" + #: scene/resources/visual_shader_nodes.cpp msgid "Invalid source for preview." msgstr "" diff --git a/editor/translations/it.po b/editor/translations/it.po index 738718a0fa..4ce247c712 100644 --- a/editor/translations/it.po +++ b/editor/translations/it.po @@ -44,12 +44,13 @@ # nickfla1 <lanterniniflavio@gmail.com>, 2019. # Fabio Iotti <fabiogiopla@gmail.com>, 2020. # Douglas Fiedler <dognew@gmail.com>, 2020. +# E440QF <ettore.beltra@gmail.com>, 2020. msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2020-02-27 07:01+0000\n" -"Last-Translator: Micila Micillotto <micillotto@gmail.com>\n" +"PO-Revision-Date: 2020-04-08 16:36+0000\n" +"Last-Translator: E440QF <ettore.beltra@gmail.com>\n" "Language-Team: Italian <https://hosted.weblate.org/projects/godot-engine/" "godot/it/>\n" "Language: it\n" @@ -1484,7 +1485,7 @@ msgstr "Sposta Autoload" msgid "Remove Autoload" msgstr "Rimuovi Autoload" -#: editor/editor_autoload_settings.cpp +#: editor/editor_autoload_settings.cpp editor/editor_plugin_settings.cpp msgid "Enable" msgstr "Abilita" @@ -2983,8 +2984,13 @@ msgid "Q&A" msgstr "Domande e risposte" #: editor/editor_node.cpp -msgid "Issue Tracker" -msgstr "Tracciatore segnalazioni" +#, fuzzy +msgid "Report a Bug" +msgstr "Reimporta" + +#: editor/editor_node.cpp +msgid "Send Docs Feedback" +msgstr "" #: editor/editor_node.cpp editor/plugins/asset_library_editor_plugin.cpp msgid "Community" @@ -4043,7 +4049,8 @@ msgid "Reimport" msgstr "Reimporta" #: editor/import_dock.cpp -msgid "Save scenes, re-import and restart" +#, fuzzy +msgid "Save Scenes, Re-Import, and Restart" msgstr "Salva scene, importa nuovamente e riavvia" #: editor/import_dock.cpp @@ -6918,14 +6925,6 @@ msgid "Open Godot online documentation." msgstr "Apri la documentazione online di Godot." #: editor/plugins/script_editor_plugin.cpp -msgid "Request Docs" -msgstr "Documentazione richiesta" - -#: editor/plugins/script_editor_plugin.cpp -msgid "Help improve the Godot documentation by giving feedback." -msgstr "Aiutate a migliorare la documentazione di Godot fornendo feedback." - -#: editor/plugins/script_editor_plugin.cpp msgid "Search the reference documentation." msgstr "Cerca Riferimenti nella documentazione." @@ -7361,6 +7360,11 @@ msgid "This operation requires a single selected node." msgstr "Questa operazione richiede un solo nodo selezionato." #: editor/plugins/spatial_editor_plugin.cpp +#, fuzzy +msgid "Auto Orthogonal Enabled" +msgstr "Ortogonale" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Lock View Rotation" msgstr "Blocca Rotazione Vista" @@ -7449,6 +7453,10 @@ msgid "Freelook Slow Modifier" msgstr "Modificatore Vista Libera Velocità Lenta" #: editor/plugins/spatial_editor_plugin.cpp +msgid "View Rotation Locked" +msgstr "Rotazione Vista Bloccata" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." @@ -7458,10 +7466,6 @@ msgstr "" "gioco." #: editor/plugins/spatial_editor_plugin.cpp -msgid "View Rotation Locked" -msgstr "Rotazione Vista Bloccata" - -#: editor/plugins/spatial_editor_plugin.cpp msgid "XForm Dialog" msgstr "Finestra di XForm" @@ -10975,6 +10979,12 @@ msgid "Script file already exists." msgstr "Il file di script esiste già." #: editor/script_create_dialog.cpp +msgid "" +"Note: Built-in scripts have some limitations and can't be edited using an " +"external editor." +msgstr "" + +#: editor/script_create_dialog.cpp msgid "Class Name:" msgstr "Nome Classe:" @@ -12477,6 +12487,7 @@ msgstr "" msgid "" "ConcavePolygonShape doesn't support RigidBody in another mode than static." msgstr "" +"ConcavePolygonShape non supporta RigidBody in modalità diverse da static." #: scene/3d/cpu_particles.cpp msgid "Nothing is visible because no mesh has been assigned." @@ -12774,6 +12785,10 @@ msgstr "" "Control, in modo che possa ottenere una dimensione. Altrimenti, renderlo un " "RenderTarget e assegnare alla sua texture interna qualche nodo da mostrare." +#: scene/main/viewport.cpp +msgid "Viewport size must be greater than 0 to render anything." +msgstr "" + #: scene/resources/visual_shader_nodes.cpp msgid "Invalid source for preview." msgstr "Fonte non valida per l'anteprima." @@ -12802,6 +12817,15 @@ msgstr "Varyings può essere assegnato soltanto nella funzione del vertice." msgid "Constants cannot be modified." msgstr "Le constanti non possono essere modificate." +#~ msgid "Issue Tracker" +#~ msgstr "Tracciatore segnalazioni" + +#~ msgid "Request Docs" +#~ msgstr "Documentazione richiesta" + +#~ msgid "Help improve the Godot documentation by giving feedback." +#~ msgstr "Aiutate a migliorare la documentazione di Godot fornendo feedback." + #~ msgid "Replaced %d occurrence(s)." #~ msgstr "Rimpiazzate %d occorrenze." diff --git a/editor/translations/ja.po b/editor/translations/ja.po index 0bb76f1261..ab503d8294 100644 --- a/editor/translations/ja.po +++ b/editor/translations/ja.po @@ -35,8 +35,8 @@ msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2020-03-16 09:43+0000\n" -"Last-Translator: Akihiro Ogoshi <technical@palsystem-game.com>\n" +"PO-Revision-Date: 2020-04-15 14:29+0000\n" +"Last-Translator: Wataru Onuki <bettawat@yahoo.co.jp>\n" "Language-Team: Japanese <https://hosted.weblate.org/projects/godot-engine/" "godot/ja/>\n" "Language: ja\n" @@ -53,7 +53,7 @@ msgstr "convert() の引数の型が無効です。TYPE_* 定数を使ってく #: core/math/expression.cpp modules/gdscript/gdscript_functions.cpp msgid "Expected a string of length 1 (a character)." -msgstr "長さが1の文字列(文字)を予期しました。" +msgstr "長さ1の文字列(文字)が必要です。" #: core/math/expression.cpp modules/gdscript/gdscript_functions.cpp #: modules/mono/glue/gd_glue.cpp @@ -63,19 +63,19 @@ msgstr "デコードするにはバイトが足りないか、または無効な #: core/math/expression.cpp msgid "Invalid input %i (not passed) in expression" -msgstr "入力された式 %i は無効です" +msgstr "式中の無効な入力 %i (渡されていません)" #: core/math/expression.cpp msgid "self can't be used because instance is null (not passed)" -msgstr "インスタンスが null のため、self は使用できません" +msgstr "インスタンスがnull(渡されない)であるため、selfは使用できません" #: core/math/expression.cpp msgid "Invalid operands to operator %s, %s and %s." -msgstr "演算子 %s, %s, %s に対する値が無効です。" +msgstr "演算子 %s に対する無効なオペランドです、%s 及び %s。" #: core/math/expression.cpp msgid "Invalid index of type %s for base type %s" -msgstr "基本型 %s の型 %s のインデックスが無効です" +msgstr "タイプ %s のインデックスが無効、これは基底型 %s 用です" #: core/math/expression.cpp msgid "Invalid named index '%s' for base type %s" @@ -83,39 +83,39 @@ msgstr "インデックス '%s' (基底型 %s) は無効な名前です" #: core/math/expression.cpp msgid "Invalid arguments to construct '%s'" -msgstr "'%s' の引数は無効です" +msgstr "'%s' を構築するための引数が無効です" #: core/math/expression.cpp msgid "On call to '%s':" -msgstr "'%s' への呼び出し:" +msgstr "'%s' の呼び出し時:" #: core/ustring.cpp msgid "B" -msgstr "\\ B" +msgstr "B" #: core/ustring.cpp msgid "KiB" -msgstr "\\ KiB" +msgstr "KiB" #: core/ustring.cpp msgid "MiB" -msgstr "\\ MiB" +msgstr "MiB" #: core/ustring.cpp msgid "GiB" -msgstr "\\ GiB" +msgstr "GiB" #: core/ustring.cpp msgid "TiB" -msgstr "\\ TiB" +msgstr "TiB" #: core/ustring.cpp msgid "PiB" -msgstr "\\ PiB" +msgstr "PiB" #: core/ustring.cpp msgid "EiB" -msgstr "\\ EiB" +msgstr "EiB" #: editor/animation_bezier_editor.cpp msgid "Free" @@ -330,11 +330,11 @@ msgstr "キュービック" #: editor/animation_track_editor.cpp msgid "Clamp Loop Interp" -msgstr "ループインタプリタを抑え込み(clamp)" +msgstr "ループインタプリタを抑え込み(clamp)" #: editor/animation_track_editor.cpp msgid "Wrap Loop Interp" -msgstr "ループインタプリタをラップ(wrap)" +msgstr "ループインタプリタをラップ(wrap)" #: editor/animation_track_editor.cpp #: editor/plugins/canvas_item_editor_plugin.cpp @@ -721,11 +721,11 @@ msgstr "%d を置換しました。" #: editor/code_editor.cpp editor/editor_help.cpp msgid "%d match." -msgstr "%d件の一致が見つかりました。" +msgstr "%d件の一致が見つかりました。" #: editor/code_editor.cpp editor/editor_help.cpp msgid "%d matches." -msgstr "%d件の一致が見つかりました。" +msgstr "%d件の一致が見つかりました。" #: editor/code_editor.cpp editor/find_in_files.cpp msgid "Match Case" @@ -1049,7 +1049,7 @@ msgstr "次のオーナー:" #: editor/dependency_editor.cpp msgid "Remove selected files from the project? (Can't be restored)" -msgstr "選択したファイルをプロジェクトから削除しますか? (元に戻せません)" +msgstr "選択したファイルをプロジェクトから削除しますか?(元に戻せません)" #: editor/dependency_editor.cpp msgid "" @@ -1058,7 +1058,7 @@ msgid "" "Remove them anyway? (no undo)" msgstr "" "除去しようとしているファイルは他のリソースの動作に必要です。\n" -"無視して除去しますか? (元に戻せません)" +"無視して除去しますか?(元に戻せません)" #: editor/dependency_editor.cpp msgid "Cannot remove:" @@ -1090,7 +1090,7 @@ msgstr "読み込みエラー!" #: editor/dependency_editor.cpp msgid "Permanently delete %d item(s)? (No undo!)" -msgstr "%d 個のアイテムを完全に削除しますか?(元に戻せません!)" +msgstr "%d 個のアイテムを完全に削除しますか?(元に戻せません!)" #: editor/dependency_editor.cpp msgid "Show Dependencies" @@ -1299,7 +1299,7 @@ msgstr "バスエフェクトを削除" #: editor/editor_audio_buses.cpp msgid "Drag & drop to rearrange." -msgstr "ドラッグ・アンド・ドロップで並び替えることができます。" +msgstr "ドラッグ&ドロップで並び替えることができます。" #: editor/editor_audio_buses.cpp msgid "Solo" @@ -1340,7 +1340,7 @@ msgstr "オーディオバスを追加" #: editor/editor_audio_buses.cpp msgid "Master bus can't be deleted!" -msgstr "マスター バスは削除できません!" +msgstr "マスターバスは削除できません!" #: editor/editor_audio_buses.cpp msgid "Delete Audio Bus" @@ -1372,7 +1372,7 @@ msgstr "オーディオバスのレイアウトを開く" #: editor/editor_audio_buses.cpp msgid "There is no '%s' file." -msgstr "'%s' ファイルがありません。" +msgstr "'%s' ファイルがありません。" #: editor/editor_audio_buses.cpp editor/plugins/canvas_item_editor_plugin.cpp msgid "Layout" @@ -1468,7 +1468,7 @@ msgstr "自動読込みを移動" msgid "Remove Autoload" msgstr "自動読込みを除去" -#: editor/editor_autoload_settings.cpp +#: editor/editor_autoload_settings.cpp editor/editor_plugin_settings.cpp msgid "Enable" msgstr "有効" @@ -1549,7 +1549,7 @@ msgstr "ディレクトリを選択" #: editor/filesystem_dock.cpp editor/project_manager.cpp #: scene/gui/file_dialog.cpp msgid "Create Folder" -msgstr "フォルダーを作成" +msgstr "フォルダを作成" #: editor/editor_dir_dialog.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp editor/filesystem_dock.cpp @@ -1777,7 +1777,7 @@ msgstr "エディタ機能のプロファイルの管理" #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Select Current Folder" -msgstr "現在のフォルダーを選択" +msgstr "現在のフォルダを選択" #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "File Exists, Overwrite?" @@ -1785,7 +1785,7 @@ msgstr "ファイルが既に存在します。上書きしますか?" #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Select This Folder" -msgstr "このフォルダーを選択" +msgstr "このフォルダを選択" #: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp msgid "Copy Path" @@ -2393,7 +2393,7 @@ msgstr "閉じる前に、'%s' への変更を保存しますか?" #: editor/editor_node.cpp msgid "Saved %s modified resource(s)." -msgstr "%s個の変更されたリソースを保存しました。" +msgstr "%s個の変更されたリソースを保存しました。" #: editor/editor_node.cpp msgid "A root node is required to save the scene." @@ -2449,7 +2449,7 @@ msgstr "元に戻す" #: editor/editor_node.cpp msgid "This action cannot be undone. Revert anyway?" -msgstr "この操作は元に戻せません。それでも元に戻しますか?" +msgstr "この操作は取り消せません。それでも元に戻しますか?" #: editor/editor_node.cpp msgid "Quick Run Scene..." @@ -2461,7 +2461,7 @@ msgstr "終了" #: editor/editor_node.cpp msgid "Exit the editor?" -msgstr "エディターを終了しますか?" +msgstr "エディタを終了しますか?" #: editor/editor_node.cpp msgid "Open Project Manager?" @@ -2696,7 +2696,7 @@ msgstr "新規シーン" #: editor/editor_node.cpp msgid "New Inherited Scene..." -msgstr "新しい継承したシーン..." +msgstr "新しい継承シーン..." #: editor/editor_node.cpp msgid "Open Scene..." @@ -2804,7 +2804,7 @@ msgid "" "connect to the IP of this computer in order to be debugged." msgstr "" "エクスポートまたはデプロイを行う場合、生成された実行ファイルはデバッグのため" -"に、このコンピューターのIPに接続を試みます。" +"に、このコンピューターのIPに接続を試みます。" #: editor/editor_node.cpp msgid "Small Deploy with Network FS" @@ -2951,8 +2951,13 @@ msgid "Q&A" msgstr "Q&A" #: editor/editor_node.cpp -msgid "Issue Tracker" -msgstr "課題管理システム" +#, fuzzy +msgid "Report a Bug" +msgstr "再インポート" + +#: editor/editor_node.cpp +msgid "Send Docs Feedback" +msgstr "" #: editor/editor_node.cpp editor/plugins/asset_library_editor_plugin.cpp msgid "Community" @@ -3079,7 +3084,7 @@ msgid "" "operation again." msgstr "" "Androidビルドテンプレートはすでにインストールされており、上書きされません。\n" -"この操作を再試行する前に、 \"res://android/build\" ディレクトリを手動で削除し" +"この操作を再試行する前に、\"res://android/build\" ディレクトリを手動で削除し" "てください。" #: editor/editor_node.cpp @@ -3096,7 +3101,7 @@ msgstr "ライブラリのエクスポート" #: editor/editor_node.cpp msgid "Merge With Existing" -msgstr "既存の(ライブラリを)マージ" +msgstr "既存の(ライブラリを)マージ" #: editor/editor_node.cpp msgid "Open & Run a Script" @@ -3193,11 +3198,11 @@ msgstr "測定:" #: editor/editor_profiler.cpp msgid "Frame Time (sec)" -msgstr "フレーム時間(秒)" +msgstr "フレーム時間(秒)" #: editor/editor_profiler.cpp msgid "Average Time (sec)" -msgstr "平均時間(秒)" +msgstr "平均時間(秒)" #: editor/editor_profiler.cpp msgid "Frame %" @@ -3348,7 +3353,7 @@ msgstr "新規の値:" #: editor/editor_properties_array_dict.cpp msgid "Add Key/Value Pair" -msgstr "キー・値のペアを追加" +msgstr "キー/値のペアを追加" #: editor/editor_run_native.cpp msgid "" @@ -3421,7 +3426,7 @@ msgstr "公式の書き出しテンプレートは開発用ビルドの場合は #: editor/export_template_manager.cpp msgid "(Missing)" -msgstr "(見つかりません)" +msgstr "(見つかりません)" #: editor/export_template_manager.cpp msgid "(Current)" @@ -3607,7 +3612,7 @@ msgstr "テンプレートをダウンロード" #: editor/export_template_manager.cpp msgid "Select mirror from list: (Shift+Click: Open in Browser)" -msgstr "リストからミラーを選択: (Shift+クリック: ブラウザで開く)" +msgstr "リストからミラーを選択: (Shift+クリック: ブラウザで開く)" #: editor/filesystem_dock.cpp msgid "Favorites" @@ -3621,7 +3626,7 @@ msgstr "" #: editor/filesystem_dock.cpp msgid "Cannot move/rename resources root." -msgstr "ルートのリソースは移動・リネームできません。" +msgstr "ルートのリソースは移動/リネームできません。" #: editor/filesystem_dock.cpp msgid "Cannot move a folder into itself." @@ -3673,7 +3678,7 @@ msgstr "フォルダを複製:" #: editor/filesystem_dock.cpp msgid "New Inherited Scene" -msgstr "新しい継承したシーン" +msgstr "新しい継承シーン" #: editor/filesystem_dock.cpp msgid "Set As Main Scene" @@ -3806,7 +3811,7 @@ msgstr "フォルダ:" #: editor/find_in_files.cpp msgid "Filters:" -msgstr "フィルター:" +msgstr "フィルタ:" #: editor/find_in_files.cpp msgid "" @@ -3968,7 +3973,7 @@ msgstr "インポート済のスクリプトを読込めませんでした:" #: editor/import/resource_importer_scene.cpp msgid "Invalid/broken script for post-import (check console):" -msgstr "無効・壊れたインポート済スクリプト(コンソールを確認してください):" +msgstr "無効または壊れたインポート済スクリプト(コンソールを確認してください):" #: editor/import/resource_importer_scene.cpp msgid "Error running post-import script:" @@ -4003,7 +4008,8 @@ msgid "Reimport" msgstr "再インポート" #: editor/import_dock.cpp -msgid "Save scenes, re-import and restart" +#, fuzzy +msgid "Save Scenes, Re-Import, and Restart" msgstr "シーンを保存して、再インポートして再起動してください" #: editor/import_dock.cpp @@ -4052,7 +4058,7 @@ msgstr "ビルトインを作成" #: editor/inspector_dock.cpp msgid "Make Sub-Resources Unique" -msgstr "ユニークなサブリソースを生成" +msgstr "サブリソースをユニーク化する" #: editor/inspector_dock.cpp msgid "Open in Help" @@ -4166,7 +4172,7 @@ msgstr "ポイント挿入" #: editor/plugins/abstract_polygon_2d_editor.cpp msgid "Edit Polygon (Remove Point)" -msgstr "ポリゴンを編集(点を除去)" +msgstr "ポリゴンを編集(点を除去)" #: editor/plugins/abstract_polygon_2d_editor.cpp msgid "Remove Polygon And Point" @@ -4374,11 +4380,11 @@ msgstr "ノードを削除" #: editor/plugins/animation_blend_tree_editor_plugin.cpp msgid "Toggle Filter On/Off" -msgstr "フィルターの オン/オフ を切り替え" +msgstr "フィルタの オン/オフ を切り替え" #: editor/plugins/animation_blend_tree_editor_plugin.cpp msgid "Change Filter" -msgstr "フィルターを変更" +msgstr "フィルタを変更" #: editor/plugins/animation_blend_tree_editor_plugin.cpp msgid "No animation player set, so unable to retrieve track names." @@ -4506,27 +4512,27 @@ msgstr "編集するアニメーションがありません!" #: editor/plugins/animation_player_editor_plugin.cpp msgid "Play selected animation backwards from current pos. (A)" -msgstr "選択したアニメーションを現在の位置から逆再生する。(A)" +msgstr "選択したアニメーションを現在の位置から逆再生する。(A)" #: editor/plugins/animation_player_editor_plugin.cpp msgid "Play selected animation backwards from end. (Shift+A)" -msgstr "選択したアニメーションを最後から逆再生する。(Shift+A)" +msgstr "選択したアニメーションを最後から逆再生する。(Shift+A)" #: editor/plugins/animation_player_editor_plugin.cpp msgid "Stop animation playback. (S)" -msgstr "アニメーションの再生を停止する。(S)" +msgstr "アニメーションの再生を停止する。(S)" #: editor/plugins/animation_player_editor_plugin.cpp msgid "Play selected animation from start. (Shift+D)" -msgstr "選択したアニメーションを最初から再生する。(Shift+D)" +msgstr "選択したアニメーションを最初から再生する。(Shift+D)" #: editor/plugins/animation_player_editor_plugin.cpp msgid "Play selected animation from current pos. (D)" -msgstr "選択したアニメーションを現在の位置から再生する。(D)" +msgstr "選択したアニメーションを現在の位置から再生する。(D)" #: editor/plugins/animation_player_editor_plugin.cpp msgid "Animation position (in seconds)." -msgstr "アニメーションの位置(秒)。" +msgstr "アニメーションの位置 (秒)。" #: editor/plugins/animation_player_editor_plugin.cpp msgid "Scale animation playback globally for the node." @@ -4629,7 +4635,7 @@ msgstr "ブレンド時間:" #: editor/plugins/animation_player_editor_plugin.cpp msgid "Next (Auto Queue):" -msgstr "次(自動キュー):" +msgstr "次 (自動キュー):" #: editor/plugins/animation_player_editor_plugin.cpp msgid "Cross-Animation Blend Times" @@ -4678,7 +4684,7 @@ msgstr "サブトランジションには、開始ノードと終了ノードが #: editor/plugins/animation_state_machine_editor.cpp msgid "No playback resource set at path: %s." -msgstr "パス( %s )に再生リソースが設定されていません。" +msgstr "パス: %s に再生リソースが設定されていません。" #: editor/plugins/animation_state_machine_editor.cpp msgid "Node Removed" @@ -4793,7 +4799,7 @@ msgstr "ブレンド 1:" #: editor/plugins/animation_tree_player_editor_plugin.cpp msgid "X-Fade Time (s):" -msgstr "クロスフェード時間(秒):" +msgstr "クロスフェード時間 (秒):" #: editor/plugins/animation_tree_player_editor_plugin.cpp msgid "Current:" @@ -5386,7 +5392,7 @@ msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Alt+RMB: Depth list selection" -msgstr "Alt+右クリック: 奥行き(被写界深度)リストの選択" +msgstr "Alt+右クリック: 奥行き(被写界深度)リストの選択" #: editor/plugins/canvas_item_editor_plugin.cpp #: editor/plugins/spatial_editor_plugin.cpp @@ -5597,8 +5603,8 @@ msgid "" "Keys are only added to existing tracks, no new tracks will be created.\n" "Keys must be inserted manually for the first time." msgstr "" -"キーの自動挿入は(マスクに基づいて)オブジェクトが移動、回転、または拡大縮小" -"された際に行われます。\n" +"キーの自動挿入は(マスクに基づいて)オブジェクトが移動、回転、または拡大縮小さ" +"れた際に行われます。\n" "キーは既存のトラックにのみ追加され、新しいトラックは作成されません。\n" "初回のキー挿入は手動で行う必要があります。" @@ -5678,7 +5684,7 @@ msgstr "ポリゴンを編集" #: editor/plugins/collision_polygon_editor_plugin.cpp msgid "Edit Poly (Remove Point)" -msgstr "ポリゴンを編集(点を除去)" +msgstr "ポリゴンを編集(点を除去)" #: editor/plugins/collision_shape_2d_editor_plugin.cpp msgid "Set Handle" @@ -6064,14 +6070,13 @@ msgstr "シーンからアップデート" #: editor/plugins/multimesh_editor_plugin.cpp msgid "No mesh source specified (and no MultiMesh set in node)." msgstr "" -"メッシュのソースが指定されていません(ノードにMultiMeshが設定されていませ" -"ん)。" +"メッシュのソースが指定されていません(ノードにMultiMeshが設定されていません)。" #: editor/plugins/multimesh_editor_plugin.cpp msgid "No mesh source specified (and MultiMesh contains no Mesh)." msgstr "" -"メッシュのソースが指定されていません(そしてMultiMeshにはメッシュが含まれてい" -"ません)。" +"メッシュのソースが指定されていません(そしてMultiMeshにはメッシュが含まれてい" +"ません)。" #: editor/plugins/multimesh_editor_plugin.cpp msgid "Mesh source is invalid (invalid path)." @@ -6854,15 +6859,6 @@ msgid "Open Godot online documentation." msgstr "Godotのオンラインドキュメントを開く。" #: editor/plugins/script_editor_plugin.cpp -msgid "Request Docs" -msgstr "ドキュメントを要求" - -#: editor/plugins/script_editor_plugin.cpp -msgid "Help improve the Godot documentation by giving feedback." -msgstr "" -"フィードバックを提供して、Godotのドキュメントの改善に役立ててください。" - -#: editor/plugins/script_editor_plugin.cpp msgid "Search the reference documentation." msgstr "リファレンス文書を探す." @@ -6924,8 +6920,8 @@ msgstr "ターゲット" msgid "" "Missing connected method '%s' for signal '%s' from node '%s' to node '%s'." msgstr "" -"ノード'%s'からノード'%s'へ送るシグナル'%s'のメソッド'%s'への接続が見つか" -"りません。" +"メソッド'%s' (シグナル'%s'用) が見つかりません、これはノード'%s'からノー" +"ド'%s'へのシグナル用です。" #: editor/plugins/script_text_editor.cpp msgid "Line" @@ -6947,8 +6943,8 @@ msgstr "ファイルシステムのリソースのみドロップできます." #: modules/visual_script/visual_script_editor.cpp msgid "Can't drop nodes because script '%s' is not used in this scene." msgstr "" -"スクリプト '%s' はこのシーンで使われていないため、ノードを(ドラッグ&)ドロッ" -"プすることができません。" +"スクリプト '%s' はこのシーンで使われていないため、ノードを(ドラッグ&)ドロップ" +"することができません。" #: editor/plugins/script_text_editor.cpp msgid "Lookup Symbol" @@ -7112,7 +7108,7 @@ msgid "" "This shader has been modified on on disk.\n" "What action should be taken?" msgstr "" -"このシェーダはディスク上で修正されています。\n" +"このシェーダーはディスク上で修正されています。\n" "どうしますか?" #: editor/plugins/shader_editor_plugin.cpp @@ -7201,7 +7197,7 @@ msgstr "%s 度回転." #: editor/plugins/spatial_editor_plugin.cpp msgid "Keying is disabled (no key inserted)." -msgstr "キーは無効化されています(キーは挿入されていません)." +msgstr "キーは無効化されています(キーは挿入されていません)。" #: editor/plugins/spatial_editor_plugin.cpp msgid "Animation Key Inserted." @@ -7241,11 +7237,11 @@ msgstr "頂点" #: editor/plugins/spatial_editor_plugin.cpp msgid "Top View." -msgstr "上面図." +msgstr "上面図。" #: editor/plugins/spatial_editor_plugin.cpp msgid "Bottom View." -msgstr "下面図." +msgstr "下面図。" #: editor/plugins/spatial_editor_plugin.cpp msgid "Bottom" @@ -7269,7 +7265,7 @@ msgstr "右側面" #: editor/plugins/spatial_editor_plugin.cpp msgid "Front View." -msgstr "前面図." +msgstr "前面図。" #: editor/plugins/spatial_editor_plugin.cpp msgid "Front" @@ -7300,6 +7296,11 @@ msgid "This operation requires a single selected node." msgstr "単一の選択されたノードがないと、この操作は行えません。" #: editor/plugins/spatial_editor_plugin.cpp +#, fuzzy +msgid "Auto Orthogonal Enabled" +msgstr "平行投影" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Lock View Rotation" msgstr "ビューの回転を固定" @@ -7388,18 +7389,18 @@ msgid "Freelook Slow Modifier" msgstr "フリールックの減速を調整" #: editor/plugins/spatial_editor_plugin.cpp +msgid "View Rotation Locked" +msgstr "ビューの回転を固定中" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." msgstr "" -"注意:表示されるFPS値は、エディタのフレームレートです。\n" +"注意: 表示されるFPS値は、エディタのフレームレートです。\n" "ゲーム内のパフォーマンスを確実に示すものとして使用することはできません。" #: editor/plugins/spatial_editor_plugin.cpp -msgid "View Rotation Locked" -msgstr "ビューの回転を固定中" - -#: editor/plugins/spatial_editor_plugin.cpp msgid "XForm Dialog" msgstr "Xformダイアログ" @@ -7537,7 +7538,7 @@ msgstr "スナップを移動:" #: editor/plugins/spatial_editor_plugin.cpp msgid "Rotate Snap (deg.):" -msgstr "スナップの回転(度):" +msgstr "スナップの回転(度):" #: editor/plugins/spatial_editor_plugin.cpp msgid "Scale Snap (%):" @@ -7569,7 +7570,7 @@ msgstr "移動:" #: editor/plugins/spatial_editor_plugin.cpp msgid "Rotate (deg.):" -msgstr "回転(度):" +msgstr "回転(度):" #: editor/plugins/spatial_editor_plugin.cpp msgid "Scale (ratio):" @@ -7593,7 +7594,7 @@ msgstr "無名のギズモ" #: editor/plugins/sprite_editor_plugin.cpp msgid "Create Mesh2D" -msgstr "Mesh2Dを作成する" +msgstr "Mesh2Dを作成" #: editor/plugins/sprite_editor_plugin.cpp msgid "Mesh2D Preview" @@ -7645,11 +7646,11 @@ msgstr "ジオメトリが無効です。ポリゴンを作成できません。 #: editor/plugins/sprite_editor_plugin.cpp msgid "Convert to Polygon2D" -msgstr "Polygon2Dに変換" +msgstr "Polygon2Dに変換する" #: editor/plugins/sprite_editor_plugin.cpp msgid "Invalid geometry, can't create collision polygon." -msgstr "ジオメトリが無効です。衝突ポリゴンを作成できません。" +msgstr "ジオメトリが無効です。コリジョンポリゴンを作成できません。" #: editor/plugins/sprite_editor_plugin.cpp msgid "Create CollisionPolygon2D Sibling" @@ -7725,7 +7726,7 @@ msgstr "アニメーションのFPSを変更" #: editor/plugins/sprite_frames_editor_plugin.cpp msgid "(empty)" -msgstr "(空)" +msgstr "(空)" #: editor/plugins/sprite_frames_editor_plugin.cpp msgid "Move Frame" @@ -7866,7 +7867,7 @@ msgstr "テーマを編集" #: editor/plugins/theme_editor_plugin.cpp msgid "Theme editing menu." -msgstr "テーマ編集メニュー." +msgstr "テーマ編集メニュー。" #: editor/plugins/theme_editor_plugin.cpp msgid "Add Class Items" @@ -8036,7 +8037,7 @@ msgstr "タイルを検索する" #: editor/plugins/tile_map_editor_plugin.cpp msgid "Transpose" -msgstr "行列(縦横)入れ替え" +msgstr "行列(縦横)入れ替え" #: editor/plugins/tile_map_editor_plugin.cpp msgid "Disable Autotile" @@ -9282,9 +9283,9 @@ msgid "" "output ports. This is a direct injection of code into the vertex/fragment/" "light function, do not use it to write the function declarations inside." msgstr "" -"カスタムのGodotシェーダ言語式。カスタムの量の入出力ポートを持ちます。 これは" -"vertex / fragment / light関数へのコードの直接注入です。内部で関数宣言を書くた" -"めにそれを使用しないでください。" +"カスタムのGodotシェーダー言語式。カスタムの量の入出力ポートを持ちます。 これ" +"はvertex / fragment / light関数へのコードの直接注入です。内部で関数宣言を書く" +"ためにそれを使用しないでください。" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" @@ -9458,11 +9459,11 @@ msgstr "プロジェクト内のリソースをすべてエクスポート" #: editor/project_export.cpp msgid "Export selected scenes (and dependencies)" -msgstr "選択したシーン(と依存関係にあるもの)をエクスポート" +msgstr "選択したシーン(と依存関係にあるもの)をエクスポート" #: editor/project_export.cpp msgid "Export selected resources (and dependencies)" -msgstr "選択したリソース(と依存関係にあるもの)をエクスポート" +msgstr "選択したリソース(と依存関係にあるもの)をエクスポート" #: editor/project_export.cpp msgid "Export Mode:" @@ -9594,7 +9595,7 @@ msgstr "" #: editor/project_manager.cpp msgid "Please choose an empty folder." -msgstr "空のフォルダーを選択してください。" +msgstr "空のフォルダを選択してください。" #: editor/project_manager.cpp msgid "Please choose a \"project.godot\" or \".zip\" file." @@ -9622,7 +9623,7 @@ msgstr "フォルダを作成できませんでした。" #: editor/project_manager.cpp msgid "There is already a folder in this path with the specified name." -msgstr "このパスには、指定された名前のフォルダーが既に存在します。" +msgstr "このパスには、指定された名前のフォルダが既に存在します。" #: editor/project_manager.cpp msgid "It would be a good idea to name your project." @@ -9877,7 +9878,7 @@ msgstr "スキャン" #: editor/project_manager.cpp msgid "Select a Folder to Scan" -msgstr "スキャンするフォルダーを選択" +msgstr "スキャンするフォルダを選択" #: editor/project_manager.cpp msgid "New Project" @@ -9928,8 +9929,8 @@ msgid "" "Invalid action name. it cannot be empty nor contain '/', ':', '=', '\\' or " "'\"'" msgstr "" -"アクション名が無効です。空にしたり、「/ 」、「: 」、「= 」、「\\ 」を含めるこ" -"とはできません" +"アクション名が無効です。空にしたり、'/'、':'、'='、'\\'等を含めることはできま" +"せん" #: editor/project_settings_editor.cpp msgid "An action with the name '%s' already exists." @@ -10041,11 +10042,11 @@ msgstr "中クリック" #: editor/project_settings_editor.cpp msgid "Wheel Up." -msgstr "マウスホイールを上." +msgstr "マウスホイールを上に。" #: editor/project_settings_editor.cpp msgid "Wheel Down." -msgstr "マウスホイールを下." +msgstr "マウスホイールを下に。" #: editor/project_settings_editor.cpp msgid "Add Global Property" @@ -10072,8 +10073,8 @@ msgid "" "Invalid action name. It cannot be empty nor contain '/', ':', '=', '\\' or " "'\"'." msgstr "" -"無効なアクション名です。空もしくは'/', ':', '=', '\\' や '\"'を含めることはで" -"きません。" +"無効なアクション名です。空もしくは'/'、':'、'='、'\\' 、'\"'等を含めることは" +"できません。" #: editor/project_settings_editor.cpp msgid "Add Input Action" @@ -10081,11 +10082,11 @@ msgstr "入力アクションの追加" #: editor/project_settings_editor.cpp msgid "Error saving settings." -msgstr "設定を保存できませんでした." +msgstr "設定を保存できませんでした。" #: editor/project_settings_editor.cpp msgid "Settings saved OK." -msgstr "設定の保存に成功しました." +msgstr "設定の保存に成功しました。" #: editor/project_settings_editor.cpp msgid "Moved Input Action Event" @@ -10201,7 +10202,7 @@ msgstr "ロケール" #: editor/project_settings_editor.cpp msgid "Locales Filter" -msgstr "ロケールフィルター" +msgstr "ロケールフィルタ" #: editor/project_settings_editor.cpp msgid "Show All Locales" @@ -10213,7 +10214,7 @@ msgstr "選択したロケールのみ表示" #: editor/project_settings_editor.cpp msgid "Filter mode:" -msgstr "フィルターモード:" +msgstr "フィルタモード:" #: editor/project_settings_editor.cpp msgid "Locales:" @@ -10790,7 +10791,7 @@ msgstr "ノードの名前を変更" #: editor/scene_tree_editor.cpp msgid "Scene Tree (Nodes):" -msgstr "シーンツリー(ノード):" +msgstr "シーンツリー(ノード):" #: editor/scene_tree_editor.cpp msgid "Node Configuration Warning!" @@ -10874,7 +10875,7 @@ msgstr "スクリプトのパス/名前は有効です。" #: editor/script_create_dialog.cpp msgid "Allowed: a-z, A-Z, 0-9, _ and ." -msgstr "使用可能: a-z, A-Z, 0-9 と ." +msgstr "使用可能: a-z、A-Z、0-9及び_。" #: editor/script_create_dialog.cpp msgid "Built-in script (into scene file)." @@ -10893,6 +10894,12 @@ msgid "Script file already exists." msgstr "スクリプトファイルが既にあります。" #: editor/script_create_dialog.cpp +msgid "" +"Note: Built-in scripts have some limitations and can't be edited using an " +"external editor." +msgstr "" + +#: editor/script_create_dialog.cpp msgid "Class Name:" msgstr "クラス名:" @@ -11202,7 +11209,7 @@ msgstr "ライブラリ: " #: modules/gdnative/register_types.cpp msgid "GDNative" -msgstr "\\ GDNative" +msgstr "GDNative" #: modules/gdscript/gdscript_functions.cpp msgid "Step argument is zero!" @@ -11384,7 +11391,7 @@ msgstr "NavMeshを焼き込む" #: modules/recast/navigation_mesh_editor_plugin.cpp msgid "Clear the navigation mesh." -msgstr "ナビメッシュ(ナビゲーションメッシュ)の消去." +msgstr "ナビメッシュ(ナビゲーションメッシュ)の消去。" #: modules/recast/navigation_mesh_generator.cpp msgid "Setting up Configuration..." @@ -11428,7 +11435,7 @@ msgstr "ネイティブナビゲーションメッシュに変換しています #: modules/recast/navigation_mesh_generator.cpp msgid "Navigation Mesh Generator Setup:" -msgstr "ナビメッシュ(ナビゲーションメッシュ)生成設定:" +msgstr "ナビメッシュ(ナビゲーションメッシュ)生成設定:" #: modules/recast/navigation_mesh_generator.cpp msgid "Parsing Geometry..." @@ -11586,34 +11593,33 @@ msgstr "VisualScriptノードを複製" #: modules/visual_script/visual_script_editor.cpp msgid "Hold %s to drop a Getter. Hold Shift to drop a generic signature." msgstr "" -"%sを押したままGetterを(ドラッグ&)ドロップする。Shiftを押したまま汎用署名を" -"(ドラッグ&)ドロップする。" +"%sを押したままGetterを(ドラッグ&)ドロップする。Shiftを押したまま汎用署名を" +"(ドラッグ&)ドロップする。" #: modules/visual_script/visual_script_editor.cpp msgid "Hold Ctrl to drop a Getter. Hold Shift to drop a generic signature." msgstr "" -"Ctrlを押したままGetterを(ドラッグ&)ドロップする。Shiftを押したまま汎用シグ" -"ネチャを(ドラッグ&)ドロップする." +"Ctrlを押したままGetterを(ドラッグ&)ドロップする。Shiftを押したまま汎用シグネ" +"チャを(ドラッグ&)ドロップする." #: modules/visual_script/visual_script_editor.cpp msgid "Hold %s to drop a simple reference to the node." msgstr "" -"%sを押したままノードへ単純参照(simple reference)を(ドラッグ&)ドロップす" -"る。" +"%sを押したままノードへ単純参照(simple reference)を(ドラッグ&)ドロップする。" #: modules/visual_script/visual_script_editor.cpp msgid "Hold Ctrl to drop a simple reference to the node." msgstr "" -"Ctrlを押したままノードへ単純参照(simple reference)を(ドラッグ&)ドロップす" +"Ctrlを押したままノードへ単純参照(simple reference)を(ドラッグ&)ドロップす" "る。" #: modules/visual_script/visual_script_editor.cpp msgid "Hold %s to drop a Variable Setter." -msgstr "%sを押したまま変数のSetterを(ドラッグ&)ドロップする。" +msgstr "%sを押したまま変数のSetterを(ドラッグ&)ドロップする。" #: modules/visual_script/visual_script_editor.cpp msgid "Hold Ctrl to drop a Variable Setter." -msgstr "Ctrlを押したまま変数のSetterを(ドラッグ&)ドロップする。" +msgstr "Ctrlを押したまま変数のSetterを(ドラッグ&)ドロップする。" #: modules/visual_script/visual_script_editor.cpp msgid "Add Preload Node" @@ -11890,7 +11896,7 @@ msgstr "ADB実行可能ファイルがエディタ設定で設定されていま #: platform/android/export/export.cpp msgid "OpenJDK jarsigner not configured in the Editor Settings." -msgstr "OpenJDK jarsignerがエディター設定で設定されていません。" +msgstr "OpenJDK jarsignerがエディタ設定で設定されていません。" #: platform/android/export/export.cpp msgid "Debug keystore not configured in the Editor Settings nor in the preset." @@ -12127,8 +12133,8 @@ msgid "" "A shape must be provided for CollisionShape2D to function. Please create a " "shape resource for it!" msgstr "" -"関数に対して CollisionShape2D の形状(シェイプ)を指定する必要があります。そ" -"のためのシェイプリソースを作成してください!" +"関数に対して CollisionShape2D の形状(シェイプ)を指定する必要があります。その" +"ためのシェイプリソースを作成してください!" #: scene/2d/cpu_particles_2d.cpp msgid "" @@ -12540,7 +12546,7 @@ msgstr "無効なアニメーション: '%s'。" #: scene/animation/animation_tree.cpp msgid "Nothing connected to input '%s' of node '%s'." -msgstr "ノード '%s'の入力 '%s'に接続されているものがありません。" +msgstr "入力 '%s'(ノード '%s')に接続されているものはありません。" #: scene/animation/animation_tree.cpp msgid "No root AnimationNode for the graph is set." @@ -12584,7 +12590,7 @@ msgstr "HSV" #: scene/gui/color_picker.cpp msgid "Raw" -msgstr "ロー" +msgstr "Raw" #: scene/gui/color_picker.cpp msgid "Switch between hexadecimal and code values." @@ -12670,6 +12676,10 @@ msgstr "" "れ以外の場合は、RenderTarget にして、その内部テクスチャを表示するノードに割り" "当てます。" +#: scene/main/viewport.cpp +msgid "Viewport size must be greater than 0 to render anything." +msgstr "" + #: scene/resources/visual_shader_nodes.cpp msgid "Invalid source for preview." msgstr "プレビューのソースが無効です。" @@ -12698,6 +12708,16 @@ msgstr "Varying変数は頂点関数にのみ割り当てることができま msgid "Constants cannot be modified." msgstr "定数は変更できません。" +#~ msgid "Issue Tracker" +#~ msgstr "課題管理システム" + +#~ msgid "Request Docs" +#~ msgstr "ドキュメントを要求" + +#~ msgid "Help improve the Godot documentation by giving feedback." +#~ msgstr "" +#~ "フィードバックを提供して、Godotのドキュメントの改善に役立ててください。" + #~ msgid "Replaced %d occurrence(s)." #~ msgstr "%d 箇所を置換しました。" diff --git a/editor/translations/ka.po b/editor/translations/ka.po index 1aaa12d6a0..ad4d5072f6 100644 --- a/editor/translations/ka.po +++ b/editor/translations/ka.po @@ -1495,7 +1495,7 @@ msgstr "" msgid "Remove Autoload" msgstr "" -#: editor/editor_autoload_settings.cpp +#: editor/editor_autoload_settings.cpp editor/editor_plugin_settings.cpp msgid "Enable" msgstr "" @@ -2933,7 +2933,11 @@ msgid "Q&A" msgstr "" #: editor/editor_node.cpp -msgid "Issue Tracker" +msgid "Report a Bug" +msgstr "" + +#: editor/editor_node.cpp +msgid "Send Docs Feedback" msgstr "" #: editor/editor_node.cpp editor/plugins/asset_library_editor_plugin.cpp @@ -3979,7 +3983,7 @@ msgid "Reimport" msgstr "" #: editor/import_dock.cpp -msgid "Save scenes, re-import and restart" +msgid "Save Scenes, Re-Import, and Restart" msgstr "" #: editor/import_dock.cpp @@ -6837,14 +6841,6 @@ msgid "Open Godot online documentation." msgstr "" #: editor/plugins/script_editor_plugin.cpp -msgid "Request Docs" -msgstr "" - -#: editor/plugins/script_editor_plugin.cpp -msgid "Help improve the Godot documentation by giving feedback." -msgstr "" - -#: editor/plugins/script_editor_plugin.cpp msgid "Search the reference documentation." msgstr "" @@ -7288,6 +7284,10 @@ msgid "This operation requires a single selected node." msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Auto Orthogonal Enabled" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Lock View Rotation" msgstr "" @@ -7377,13 +7377,13 @@ msgid "Freelook Slow Modifier" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "" -"Note: The FPS value displayed is the editor's framerate.\n" -"It cannot be used as a reliable indication of in-game performance." +msgid "View Rotation Locked" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "View Rotation Locked" +msgid "" +"Note: The FPS value displayed is the editor's framerate.\n" +"It cannot be used as a reliable indication of in-game performance." msgstr "" #: editor/plugins/spatial_editor_plugin.cpp @@ -10800,6 +10800,12 @@ msgid "Script file already exists." msgstr "" #: editor/script_create_dialog.cpp +msgid "" +"Note: Built-in scripts have some limitations and can't be edited using an " +"external editor." +msgstr "" + +#: editor/script_create_dialog.cpp msgid "Class Name:" msgstr "" @@ -12452,6 +12458,10 @@ msgid "" "texture to some node for display." msgstr "" +#: scene/main/viewport.cpp +msgid "Viewport size must be greater than 0 to render anything." +msgstr "" + #: scene/resources/visual_shader_nodes.cpp #, fuzzy msgid "Invalid source for preview." diff --git a/editor/translations/ko.po b/editor/translations/ko.po index ec33599440..dd2d617eb8 100644 --- a/editor/translations/ko.po +++ b/editor/translations/ko.po @@ -15,12 +15,13 @@ # moolow <copyhyeon@gmail.com>, 2019. # Jiyoon Kim <kimjiy@dickinson.edu>, 2019. # Ervin <zetsmart@gmail.com>, 2019. +# Tilto_ <tilto0822@develable.xyz>, 2020. msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2020-03-14 00:33+0000\n" -"Last-Translator: Ch. <ccwpc@hanmail.net>\n" +"PO-Revision-Date: 2020-03-27 07:42+0000\n" +"Last-Translator: Tilto_ <tilto0822@develable.xyz>\n" "Language-Team: Korean <https://hosted.weblate.org/projects/godot-engine/" "godot/ko/>\n" "Language: ko\n" @@ -1449,7 +1450,7 @@ msgstr "오토로드 이동" msgid "Remove Autoload" msgstr "오토로드 삭제" -#: editor/editor_autoload_settings.cpp +#: editor/editor_autoload_settings.cpp editor/editor_plugin_settings.cpp msgid "Enable" msgstr "켜기" @@ -2923,8 +2924,13 @@ msgid "Q&A" msgstr "Q&A" #: editor/editor_node.cpp -msgid "Issue Tracker" -msgstr "이슈 트래커" +#, fuzzy +msgid "Report a Bug" +msgstr "다시 가져오기" + +#: editor/editor_node.cpp +msgid "Send Docs Feedback" +msgstr "" #: editor/editor_node.cpp editor/plugins/asset_library_editor_plugin.cpp msgid "Community" @@ -3970,7 +3976,8 @@ msgid "Reimport" msgstr "다시 가져오기" #: editor/import_dock.cpp -msgid "Save scenes, re-import and restart" +#, fuzzy +msgid "Save Scenes, Re-Import, and Restart" msgstr "씬 저장, 다시 가져오기 및 다시 시작" #: editor/import_dock.cpp @@ -5836,9 +5843,8 @@ msgid "Couldn't create a single convex collision shape." msgstr "단일 convex 충돌 모양을 만들 수 없습니다." #: editor/plugins/mesh_instance_editor_plugin.cpp -#, fuzzy msgid "Create Single Convex Shape" -msgstr "Convex 모양 만들기" +msgstr "개별 Convex 모양 만들기" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Can't create multiple convex collision shapes for the scene root." @@ -5923,9 +5929,8 @@ msgstr "" "이 방법은 가장 정확한 (하지만 가장 느린) 충돌 탐지 방법입니다." #: editor/plugins/mesh_instance_editor_plugin.cpp -#, fuzzy msgid "Create Single Convex Collision Sibling" -msgstr "Convex 충돌 형제 만들기" +msgstr "개별 Convex 충돌 형제 만들기" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "" @@ -5936,7 +5941,6 @@ msgstr "" "이 방법은 가장 빠른 (하지만 덜 정확한) 충돌 탐지 방법입니다." #: editor/plugins/mesh_instance_editor_plugin.cpp -#, fuzzy msgid "Create Multiple Convex Collision Siblings" msgstr "다중 Convex 충돌 형제 만들기" @@ -6810,14 +6814,6 @@ msgid "Open Godot online documentation." msgstr "Godot 온라인 문서를 열." #: editor/plugins/script_editor_plugin.cpp -msgid "Request Docs" -msgstr "문서 요청" - -#: editor/plugins/script_editor_plugin.cpp -msgid "Help improve the Godot documentation by giving feedback." -msgstr "피드백으로 Godot 문서를 개선하는데 도와주세요." - -#: editor/plugins/script_editor_plugin.cpp msgid "Search the reference documentation." msgstr "참조 문서 검색." @@ -7254,6 +7250,11 @@ msgid "This operation requires a single selected node." msgstr "이 작업은 하나의 노드를 선택해야 합니다." #: editor/plugins/spatial_editor_plugin.cpp +#, fuzzy +msgid "Auto Orthogonal Enabled" +msgstr "직교보기" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Lock View Rotation" msgstr "뷰 회전 잠금" @@ -7342,6 +7343,10 @@ msgid "Freelook Slow Modifier" msgstr "자유 시점 느린 수정자" #: editor/plugins/spatial_editor_plugin.cpp +msgid "View Rotation Locked" +msgstr "뷰 회전 잠김" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." @@ -7350,10 +7355,6 @@ msgstr "" "이것이 게임 내 성능을 보장할 수 없습니다." #: editor/plugins/spatial_editor_plugin.cpp -msgid "View Rotation Locked" -msgstr "뷰 회전 잠김" - -#: editor/plugins/spatial_editor_plugin.cpp msgid "XForm Dialog" msgstr "XForm 대화 상자" @@ -9530,9 +9531,8 @@ msgid "Please choose a \"project.godot\" or \".zip\" file." msgstr "\"project.godot\" 파일 또는 \".zip\" 파일을 선택해주세요." #: editor/project_manager.cpp -#, fuzzy msgid "This directory already contains a Godot project." -msgstr "디렉토리에 Godot 프로젝트가 이미 있습니다." +msgstr "디렉토리에 Godot 프로젝트가 이미 존재합니다." #: editor/project_manager.cpp msgid "New Game Project" @@ -10263,7 +10263,6 @@ msgstr "" "카운터 설정과 비교합니다." #: editor/rename_dialog.cpp -#, fuzzy msgid "Per-level Counter" msgstr "단계별 카운터" @@ -10817,6 +10816,12 @@ msgid "Script file already exists." msgstr "스크립트 파일이 이미 있습니다." #: editor/script_create_dialog.cpp +msgid "" +"Note: Built-in scripts have some limitations and can't be edited using an " +"external editor." +msgstr "" + +#: editor/script_create_dialog.cpp msgid "Class Name:" msgstr "클래스 이름:" @@ -12565,6 +12570,10 @@ msgstr "" "우, 화면에 표시하기 위해서는 뷰포트를 RenderTarget으로 만들고 내부적인 텍스처" "를 다른 노드에 지정해야 합니다." +#: scene/main/viewport.cpp +msgid "Viewport size must be greater than 0 to render anything." +msgstr "" + #: scene/resources/visual_shader_nodes.cpp msgid "Invalid source for preview." msgstr "미리 보기에 잘못된 소스." @@ -12593,6 +12602,15 @@ msgstr "Varying은 꼭짓점 함수에만 지정할 수 있습니다." msgid "Constants cannot be modified." msgstr "상수는 수정할 수 없습니다." +#~ msgid "Issue Tracker" +#~ msgstr "이슈 트래커" + +#~ msgid "Request Docs" +#~ msgstr "문서 요청" + +#~ msgid "Help improve the Godot documentation by giving feedback." +#~ msgstr "피드백으로 Godot 문서를 개선하는데 도와주세요." + #~ msgid "Replaced %d occurrence(s)." #~ msgstr "%d개를 바꿨습니다." diff --git a/editor/translations/lt.po b/editor/translations/lt.po index 1f58c4a658..25cec6842f 100644 --- a/editor/translations/lt.po +++ b/editor/translations/lt.po @@ -1457,7 +1457,7 @@ msgstr "" msgid "Remove Autoload" msgstr "" -#: editor/editor_autoload_settings.cpp +#: editor/editor_autoload_settings.cpp editor/editor_plugin_settings.cpp msgid "Enable" msgstr "" @@ -2898,7 +2898,11 @@ msgid "Q&A" msgstr "" #: editor/editor_node.cpp -msgid "Issue Tracker" +msgid "Report a Bug" +msgstr "" + +#: editor/editor_node.cpp +msgid "Send Docs Feedback" msgstr "" #: editor/editor_node.cpp editor/plugins/asset_library_editor_plugin.cpp @@ -3953,7 +3957,7 @@ msgid "Reimport" msgstr "" #: editor/import_dock.cpp -msgid "Save scenes, re-import and restart" +msgid "Save Scenes, Re-Import, and Restart" msgstr "" #: editor/import_dock.cpp @@ -6821,14 +6825,6 @@ msgid "Open Godot online documentation." msgstr "" #: editor/plugins/script_editor_plugin.cpp -msgid "Request Docs" -msgstr "" - -#: editor/plugins/script_editor_plugin.cpp -msgid "Help improve the Godot documentation by giving feedback." -msgstr "" - -#: editor/plugins/script_editor_plugin.cpp msgid "Search the reference documentation." msgstr "" @@ -7264,6 +7260,10 @@ msgid "This operation requires a single selected node." msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Auto Orthogonal Enabled" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Lock View Rotation" msgstr "" @@ -7353,13 +7353,13 @@ msgid "Freelook Slow Modifier" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "" -"Note: The FPS value displayed is the editor's framerate.\n" -"It cannot be used as a reliable indication of in-game performance." +msgid "View Rotation Locked" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "View Rotation Locked" +msgid "" +"Note: The FPS value displayed is the editor's framerate.\n" +"It cannot be used as a reliable indication of in-game performance." msgstr "" #: editor/plugins/spatial_editor_plugin.cpp @@ -10785,6 +10785,12 @@ msgid "Script file already exists." msgstr "" #: editor/script_create_dialog.cpp +msgid "" +"Note: Built-in scripts have some limitations and can't be edited using an " +"external editor." +msgstr "" + +#: editor/script_create_dialog.cpp #, fuzzy msgid "Class Name:" msgstr "Priedai" @@ -12439,6 +12445,10 @@ msgid "" "texture to some node for display." msgstr "" +#: scene/main/viewport.cpp +msgid "Viewport size must be greater than 0 to render anything." +msgstr "" + #: scene/resources/visual_shader_nodes.cpp #, fuzzy msgid "Invalid source for preview." diff --git a/editor/translations/lv.po b/editor/translations/lv.po index 14dfdff801..973e732e2d 100644 --- a/editor/translations/lv.po +++ b/editor/translations/lv.po @@ -1464,7 +1464,7 @@ msgstr "" msgid "Remove Autoload" msgstr "" -#: editor/editor_autoload_settings.cpp +#: editor/editor_autoload_settings.cpp editor/editor_plugin_settings.cpp msgid "Enable" msgstr "Iespējot" @@ -2896,7 +2896,11 @@ msgid "Q&A" msgstr "" #: editor/editor_node.cpp -msgid "Issue Tracker" +msgid "Report a Bug" +msgstr "" + +#: editor/editor_node.cpp +msgid "Send Docs Feedback" msgstr "" #: editor/editor_node.cpp editor/plugins/asset_library_editor_plugin.cpp @@ -3944,7 +3948,7 @@ msgid "Reimport" msgstr "" #: editor/import_dock.cpp -msgid "Save scenes, re-import and restart" +msgid "Save Scenes, Re-Import, and Restart" msgstr "" #: editor/import_dock.cpp @@ -6795,14 +6799,6 @@ msgid "Open Godot online documentation." msgstr "" #: editor/plugins/script_editor_plugin.cpp -msgid "Request Docs" -msgstr "" - -#: editor/plugins/script_editor_plugin.cpp -msgid "Help improve the Godot documentation by giving feedback." -msgstr "" - -#: editor/plugins/script_editor_plugin.cpp msgid "Search the reference documentation." msgstr "" @@ -7245,6 +7241,10 @@ msgid "This operation requires a single selected node." msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Auto Orthogonal Enabled" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Lock View Rotation" msgstr "" @@ -7334,13 +7334,13 @@ msgid "Freelook Slow Modifier" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "" -"Note: The FPS value displayed is the editor's framerate.\n" -"It cannot be used as a reliable indication of in-game performance." +msgid "View Rotation Locked" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "View Rotation Locked" +msgid "" +"Note: The FPS value displayed is the editor's framerate.\n" +"It cannot be used as a reliable indication of in-game performance." msgstr "" #: editor/plugins/spatial_editor_plugin.cpp @@ -10751,6 +10751,12 @@ msgid "Script file already exists." msgstr "" #: editor/script_create_dialog.cpp +msgid "" +"Note: Built-in scripts have some limitations and can't be edited using an " +"external editor." +msgstr "" + +#: editor/script_create_dialog.cpp msgid "Class Name:" msgstr "" @@ -12405,6 +12411,10 @@ msgid "" "texture to some node for display." msgstr "" +#: scene/main/viewport.cpp +msgid "Viewport size must be greater than 0 to render anything." +msgstr "" + #: scene/resources/visual_shader_nodes.cpp #, fuzzy msgid "Invalid source for preview." diff --git a/editor/translations/mi.po b/editor/translations/mi.po index 5ec6cc28e0..f0b661e381 100644 --- a/editor/translations/mi.po +++ b/editor/translations/mi.po @@ -1399,7 +1399,7 @@ msgstr "" msgid "Remove Autoload" msgstr "" -#: editor/editor_autoload_settings.cpp +#: editor/editor_autoload_settings.cpp editor/editor_plugin_settings.cpp msgid "Enable" msgstr "" @@ -2802,7 +2802,11 @@ msgid "Q&A" msgstr "" #: editor/editor_node.cpp -msgid "Issue Tracker" +msgid "Report a Bug" +msgstr "" + +#: editor/editor_node.cpp +msgid "Send Docs Feedback" msgstr "" #: editor/editor_node.cpp editor/plugins/asset_library_editor_plugin.cpp @@ -3823,7 +3827,7 @@ msgid "Reimport" msgstr "" #: editor/import_dock.cpp -msgid "Save scenes, re-import and restart" +msgid "Save Scenes, Re-Import, and Restart" msgstr "" #: editor/import_dock.cpp @@ -6605,14 +6609,6 @@ msgid "Open Godot online documentation." msgstr "" #: editor/plugins/script_editor_plugin.cpp -msgid "Request Docs" -msgstr "" - -#: editor/plugins/script_editor_plugin.cpp -msgid "Help improve the Godot documentation by giving feedback." -msgstr "" - -#: editor/plugins/script_editor_plugin.cpp msgid "Search the reference documentation." msgstr "" @@ -7042,6 +7038,10 @@ msgid "This operation requires a single selected node." msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Auto Orthogonal Enabled" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Lock View Rotation" msgstr "" @@ -7130,13 +7130,13 @@ msgid "Freelook Slow Modifier" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "" -"Note: The FPS value displayed is the editor's framerate.\n" -"It cannot be used as a reliable indication of in-game performance." +msgid "View Rotation Locked" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "View Rotation Locked" +msgid "" +"Note: The FPS value displayed is the editor's framerate.\n" +"It cannot be used as a reliable indication of in-game performance." msgstr "" #: editor/plugins/spatial_editor_plugin.cpp @@ -10454,6 +10454,12 @@ msgid "Script file already exists." msgstr "" #: editor/script_create_dialog.cpp +msgid "" +"Note: Built-in scripts have some limitations and can't be edited using an " +"external editor." +msgstr "" + +#: editor/script_create_dialog.cpp msgid "Class Name:" msgstr "" @@ -12067,6 +12073,10 @@ msgid "" "texture to some node for display." msgstr "" +#: scene/main/viewport.cpp +msgid "Viewport size must be greater than 0 to render anything." +msgstr "" + #: scene/resources/visual_shader_nodes.cpp msgid "Invalid source for preview." msgstr "" diff --git a/editor/translations/ml.po b/editor/translations/ml.po index 7e7149e05e..92ffb6f097 100644 --- a/editor/translations/ml.po +++ b/editor/translations/ml.po @@ -1409,7 +1409,7 @@ msgstr "" msgid "Remove Autoload" msgstr "" -#: editor/editor_autoload_settings.cpp +#: editor/editor_autoload_settings.cpp editor/editor_plugin_settings.cpp msgid "Enable" msgstr "" @@ -2814,7 +2814,11 @@ msgid "Q&A" msgstr "" #: editor/editor_node.cpp -msgid "Issue Tracker" +msgid "Report a Bug" +msgstr "" + +#: editor/editor_node.cpp +msgid "Send Docs Feedback" msgstr "" #: editor/editor_node.cpp editor/plugins/asset_library_editor_plugin.cpp @@ -3835,7 +3839,7 @@ msgid "Reimport" msgstr "" #: editor/import_dock.cpp -msgid "Save scenes, re-import and restart" +msgid "Save Scenes, Re-Import, and Restart" msgstr "" #: editor/import_dock.cpp @@ -6621,14 +6625,6 @@ msgid "Open Godot online documentation." msgstr "" #: editor/plugins/script_editor_plugin.cpp -msgid "Request Docs" -msgstr "" - -#: editor/plugins/script_editor_plugin.cpp -msgid "Help improve the Godot documentation by giving feedback." -msgstr "" - -#: editor/plugins/script_editor_plugin.cpp msgid "Search the reference documentation." msgstr "" @@ -7058,6 +7054,10 @@ msgid "This operation requires a single selected node." msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Auto Orthogonal Enabled" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Lock View Rotation" msgstr "" @@ -7146,13 +7146,13 @@ msgid "Freelook Slow Modifier" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "" -"Note: The FPS value displayed is the editor's framerate.\n" -"It cannot be used as a reliable indication of in-game performance." +msgid "View Rotation Locked" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "View Rotation Locked" +msgid "" +"Note: The FPS value displayed is the editor's framerate.\n" +"It cannot be used as a reliable indication of in-game performance." msgstr "" #: editor/plugins/spatial_editor_plugin.cpp @@ -10470,6 +10470,12 @@ msgid "Script file already exists." msgstr "" #: editor/script_create_dialog.cpp +msgid "" +"Note: Built-in scripts have some limitations and can't be edited using an " +"external editor." +msgstr "" + +#: editor/script_create_dialog.cpp msgid "Class Name:" msgstr "" @@ -12084,6 +12090,10 @@ msgid "" "texture to some node for display." msgstr "" +#: scene/main/viewport.cpp +msgid "Viewport size must be greater than 0 to render anything." +msgstr "" + #: scene/resources/visual_shader_nodes.cpp msgid "Invalid source for preview." msgstr "" diff --git a/editor/translations/mr.po b/editor/translations/mr.po index 4ae3df9f99..f368062a85 100644 --- a/editor/translations/mr.po +++ b/editor/translations/mr.po @@ -1405,7 +1405,7 @@ msgstr "" msgid "Remove Autoload" msgstr "" -#: editor/editor_autoload_settings.cpp +#: editor/editor_autoload_settings.cpp editor/editor_plugin_settings.cpp msgid "Enable" msgstr "" @@ -2809,7 +2809,11 @@ msgid "Q&A" msgstr "" #: editor/editor_node.cpp -msgid "Issue Tracker" +msgid "Report a Bug" +msgstr "" + +#: editor/editor_node.cpp +msgid "Send Docs Feedback" msgstr "" #: editor/editor_node.cpp editor/plugins/asset_library_editor_plugin.cpp @@ -3830,7 +3834,7 @@ msgid "Reimport" msgstr "" #: editor/import_dock.cpp -msgid "Save scenes, re-import and restart" +msgid "Save Scenes, Re-Import, and Restart" msgstr "" #: editor/import_dock.cpp @@ -6612,14 +6616,6 @@ msgid "Open Godot online documentation." msgstr "" #: editor/plugins/script_editor_plugin.cpp -msgid "Request Docs" -msgstr "" - -#: editor/plugins/script_editor_plugin.cpp -msgid "Help improve the Godot documentation by giving feedback." -msgstr "" - -#: editor/plugins/script_editor_plugin.cpp msgid "Search the reference documentation." msgstr "" @@ -7049,6 +7045,10 @@ msgid "This operation requires a single selected node." msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Auto Orthogonal Enabled" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Lock View Rotation" msgstr "" @@ -7137,13 +7137,13 @@ msgid "Freelook Slow Modifier" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "" -"Note: The FPS value displayed is the editor's framerate.\n" -"It cannot be used as a reliable indication of in-game performance." +msgid "View Rotation Locked" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "View Rotation Locked" +msgid "" +"Note: The FPS value displayed is the editor's framerate.\n" +"It cannot be used as a reliable indication of in-game performance." msgstr "" #: editor/plugins/spatial_editor_plugin.cpp @@ -10461,6 +10461,12 @@ msgid "Script file already exists." msgstr "" #: editor/script_create_dialog.cpp +msgid "" +"Note: Built-in scripts have some limitations and can't be edited using an " +"external editor." +msgstr "" + +#: editor/script_create_dialog.cpp msgid "Class Name:" msgstr "" @@ -12074,6 +12080,10 @@ msgid "" "texture to some node for display." msgstr "" +#: scene/main/viewport.cpp +msgid "Viewport size must be greater than 0 to render anything." +msgstr "" + #: scene/resources/visual_shader_nodes.cpp msgid "Invalid source for preview." msgstr "" diff --git a/editor/translations/ms.po b/editor/translations/ms.po index bdb52e4845..dc18540ce3 100644 --- a/editor/translations/ms.po +++ b/editor/translations/ms.po @@ -1429,7 +1429,7 @@ msgstr "" msgid "Remove Autoload" msgstr "" -#: editor/editor_autoload_settings.cpp +#: editor/editor_autoload_settings.cpp editor/editor_plugin_settings.cpp msgid "Enable" msgstr "" @@ -2836,7 +2836,11 @@ msgid "Q&A" msgstr "" #: editor/editor_node.cpp -msgid "Issue Tracker" +msgid "Report a Bug" +msgstr "" + +#: editor/editor_node.cpp +msgid "Send Docs Feedback" msgstr "" #: editor/editor_node.cpp editor/plugins/asset_library_editor_plugin.cpp @@ -3858,7 +3862,7 @@ msgid "Reimport" msgstr "" #: editor/import_dock.cpp -msgid "Save scenes, re-import and restart" +msgid "Save Scenes, Re-Import, and Restart" msgstr "" #: editor/import_dock.cpp @@ -6659,14 +6663,6 @@ msgid "Open Godot online documentation." msgstr "" #: editor/plugins/script_editor_plugin.cpp -msgid "Request Docs" -msgstr "" - -#: editor/plugins/script_editor_plugin.cpp -msgid "Help improve the Godot documentation by giving feedback." -msgstr "" - -#: editor/plugins/script_editor_plugin.cpp msgid "Search the reference documentation." msgstr "" @@ -7097,6 +7093,10 @@ msgid "This operation requires a single selected node." msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Auto Orthogonal Enabled" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Lock View Rotation" msgstr "" @@ -7185,13 +7185,13 @@ msgid "Freelook Slow Modifier" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "" -"Note: The FPS value displayed is the editor's framerate.\n" -"It cannot be used as a reliable indication of in-game performance." +msgid "View Rotation Locked" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "View Rotation Locked" +msgid "" +"Note: The FPS value displayed is the editor's framerate.\n" +"It cannot be used as a reliable indication of in-game performance." msgstr "" #: editor/plugins/spatial_editor_plugin.cpp @@ -10531,6 +10531,12 @@ msgid "Script file already exists." msgstr "" #: editor/script_create_dialog.cpp +msgid "" +"Note: Built-in scripts have some limitations and can't be edited using an " +"external editor." +msgstr "" + +#: editor/script_create_dialog.cpp msgid "Class Name:" msgstr "" @@ -12154,6 +12160,10 @@ msgid "" "texture to some node for display." msgstr "" +#: scene/main/viewport.cpp +msgid "Viewport size must be greater than 0 to render anything." +msgstr "" + #: scene/resources/visual_shader_nodes.cpp msgid "Invalid source for preview." msgstr "" diff --git a/editor/translations/nb.po b/editor/translations/nb.po index 90df4e7b4f..6ec911db7d 100644 --- a/editor/translations/nb.po +++ b/editor/translations/nb.po @@ -2,7 +2,7 @@ # Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. # Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). # This file is distributed under the same license as the Godot source code. -# Allan Nordhøy <epost@anotheragency.no>, 2017-2018, 2019. +# Allan Nordhøy <epost@anotheragency.no>, 2017-2018, 2019, 2020. # Anonymous <GentleSaucepan@protonmail.com>, 2017. # Elias <eliasnykrem@gmail.com>, 2018. # flesk <eivindkn@gmail.com>, 2017, 2019. @@ -14,13 +14,13 @@ # Byzantin <kasper-hoel@hotmail.com>, 2018. # Hans-Marius Øverås <hansmariusoveras@gmail.com>, 2019. # Revolution <revosw@gmail.com>, 2019. -# Petter Reinholdtsen <pere-weblate@hungry.com>, 2019. +# Petter Reinholdtsen <pere-weblate@hungry.com>, 2019, 2020. msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2019-10-29 12:49+0000\n" -"Last-Translator: Allan Nordhøy <epost@anotheragency.no>\n" +"PO-Revision-Date: 2020-04-16 11:03+0000\n" +"Last-Translator: Petter Reinholdtsen <pere-weblate@hungry.com>\n" "Language-Team: Norwegian Bokmål <https://hosted.weblate.org/projects/godot-" "engine/godot/nb_NO/>\n" "Language: nb\n" @@ -28,7 +28,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 3.9.1\n" +"X-Generator: Weblate 4.0.1-dev\n" #: core/math/expression.cpp modules/gdscript/gdscript_functions.cpp #: modules/visual_script/visual_script_builtin_funcs.cpp @@ -37,7 +37,7 @@ msgstr "Ugyldig argumenttype til convert(), bruk TYPE_*-konstantene." #: core/math/expression.cpp modules/gdscript/gdscript_functions.cpp msgid "Expected a string of length 1 (a character)." -msgstr "" +msgstr "Forventet en streng med lenge 1 (et tegn)." #: core/math/expression.cpp modules/gdscript/gdscript_functions.cpp #: modules/mono/glue/gd_glue.cpp @@ -243,7 +243,7 @@ msgstr "Legg til Spor" #: editor/animation_track_editor.cpp #, fuzzy msgid "Animation Looping" -msgstr "Animasjons-zoom." +msgstr "Animasjonsløkke" #: editor/animation_track_editor.cpp #: modules/visual_script/visual_script_editor.cpp @@ -283,14 +283,12 @@ msgid "Loop Wrap Mode (Interpolate end with beginning on loop)" msgstr "" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Remove this track." -msgstr "Fjern valgt spor." +msgstr "Fjern dette sporet." #: editor/animation_track_editor.cpp -#, fuzzy msgid "Time (s): " -msgstr "X-Fade Tid (s):" +msgstr "Tid (s): " #: editor/animation_track_editor.cpp msgid "Toggle Track Enabled" @@ -309,9 +307,8 @@ msgid "Trigger" msgstr "Avtrekker" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Capture" -msgstr "Framtid" +msgstr "Fang" #: editor/animation_track_editor.cpp msgid "Nearest" @@ -340,14 +337,12 @@ msgid "Insert Key" msgstr "Sett inn Nøkkel" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Duplicate Key(s)" -msgstr "Anim Dupliser Nøkler" +msgstr "Dupliser Nøkler" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Delete Key(s)" -msgstr "Anim Fjern Nøkler" +msgstr "Fjern Nøkler" #: editor/animation_track_editor.cpp #, fuzzy @@ -1181,7 +1176,7 @@ msgstr "Utviklingsleder" #: editor/editor_about.cpp msgid "Project Manager " -msgstr "Prosjektleder " +msgstr "Prosjektstyring " #: editor/editor_about.cpp msgid "Developers" @@ -1284,7 +1279,7 @@ msgstr "Vellykket Installering av Pakke!" #: editor/editor_asset_installer.cpp #: editor/plugins/asset_library_editor_plugin.cpp msgid "Success!" -msgstr "Suksess!" +msgstr "Vellykket!" #: editor/editor_asset_installer.cpp #, fuzzy @@ -1524,7 +1519,7 @@ msgstr "Flytt Autoload" msgid "Remove Autoload" msgstr "Fjern Autoload" -#: editor/editor_autoload_settings.cpp +#: editor/editor_autoload_settings.cpp editor/editor_plugin_settings.cpp msgid "Enable" msgstr "Aktiver" @@ -1588,7 +1583,7 @@ msgstr "Oppdaterer scene..." #: editor/editor_data.cpp editor/editor_properties.cpp msgid "[empty]" -msgstr "[tom]" +msgstr "[blank]" #: editor/editor_data.cpp msgid "[unsaved]" @@ -1669,16 +1664,14 @@ msgstr "" #: editor/editor_export.cpp platform/android/export/export.cpp #: platform/iphone/export/export.cpp platform/javascript/export/export.cpp #: platform/osx/export/export.cpp platform/uwp/export/export.cpp -#, fuzzy msgid "Custom debug template not found." -msgstr "Malfil ble ikke funnet:" +msgstr "Tilpasset feilsøkingsmal ble ikke funnet." #: editor/editor_export.cpp platform/android/export/export.cpp #: platform/iphone/export/export.cpp platform/javascript/export/export.cpp #: platform/osx/export/export.cpp platform/uwp/export/export.cpp -#, fuzzy msgid "Custom release template not found." -msgstr "Tilpasset utgivelsesmal ikke funnet." +msgstr "Fant ikke tilpasset utgivelsesmal." #: editor/editor_export.cpp platform/javascript/export/export.cpp msgid "Template file not found:" @@ -1699,9 +1692,8 @@ msgid "Script Editor" msgstr "Åpne SkriptEditor" #: editor/editor_feature_profile.cpp -#, fuzzy msgid "Asset Library" -msgstr "Åpne Assets-Bibliotek" +msgstr "Ressursbibliotek" #: editor/editor_feature_profile.cpp msgid "Scene Tree Editing" @@ -2024,7 +2016,7 @@ msgstr "Må ha en gyldig filutvidelse." #: editor/editor_file_system.cpp msgid "ScanSources" -msgstr "SkannKilder" +msgstr "Gjennomsøk kilder" #: editor/editor_file_system.cpp msgid "" @@ -2054,9 +2046,8 @@ msgid "Inherited by:" msgstr "Arvet av:" #: editor/editor_help.cpp -#, fuzzy msgid "Description" -msgstr "Beskrivelse:" +msgstr "Beskrivelse" #: editor/editor_help.cpp #, fuzzy @@ -2180,9 +2171,8 @@ msgid "Member Type" msgstr "Medlemmer" #: editor/editor_help_search.cpp -#, fuzzy msgid "Class" -msgstr "Klasse:" +msgstr "Klasse" #: editor/editor_help_search.cpp #, fuzzy @@ -2927,7 +2917,7 @@ msgstr "Avslutt til Prosjektliste" #: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp #: editor/project_export.cpp msgid "Debug" -msgstr "Debug" +msgstr "Feilsøk" #: editor/editor_node.cpp msgid "Deploy with Remote Debug" @@ -2943,9 +2933,8 @@ msgstr "" "koble til IP'en til denne datamaskinen for å bli debugget." #: editor/editor_node.cpp -#, fuzzy msgid "Small Deploy with Network FS" -msgstr "Liten Deploy med Network FS" +msgstr "Liten utrulling med Network FS" #: editor/editor_node.cpp msgid "" @@ -2963,9 +2952,8 @@ msgstr "" "alternativet gjør testing for spill med et stort fotavtrykk raskere." #: editor/editor_node.cpp -#, fuzzy msgid "Visible Collision Shapes" -msgstr "Synlige Kollisjons-Former" +msgstr "Synlige kollisjons-former" #: editor/editor_node.cpp msgid "" @@ -2977,7 +2965,7 @@ msgstr "" #: editor/editor_node.cpp msgid "Visible Navigation" -msgstr "Synlig Navigasjon" +msgstr "Synlig navigasjon" #: editor/editor_node.cpp msgid "" @@ -2989,7 +2977,7 @@ msgstr "" #: editor/editor_node.cpp msgid "Sync Scene Changes" -msgstr "Synkroniser Sceneforandringer" +msgstr "Synkroniser Sceneendringer" #: editor/editor_node.cpp msgid "" @@ -3005,7 +2993,7 @@ msgstr "" #: editor/editor_node.cpp msgid "Sync Script Changes" -msgstr "Synkroniser Skriptforandringer" +msgstr "Synkroniser Skriptendringer" #: editor/editor_node.cpp #, fuzzy @@ -3021,7 +3009,6 @@ msgstr "" "nettverksfilsystem." #: editor/editor_node.cpp editor/script_create_dialog.cpp -#, fuzzy msgid "Editor" msgstr "Redigeringsverktøy" @@ -3100,8 +3087,13 @@ msgid "Q&A" msgstr "Spørsmål og Svar" #: editor/editor_node.cpp -msgid "Issue Tracker" -msgstr "Problemtracker" +#, fuzzy +msgid "Report a Bug" +msgstr "Reimporter" + +#: editor/editor_node.cpp +msgid "Send Docs Feedback" +msgstr "" #: editor/editor_node.cpp editor/plugins/asset_library_editor_plugin.cpp msgid "Community" @@ -3365,7 +3357,6 @@ msgid "Inclusive" msgstr "Inklusiv" #: editor/editor_profiler.cpp -#, fuzzy msgid "Self" msgstr "Selv" @@ -3547,8 +3538,9 @@ msgid "Select Node(s) to Import" msgstr "Velg Node(r) for Importering" #: editor/editor_sub_scene.cpp editor/project_manager.cpp +#, fuzzy msgid "Browse" -msgstr "Utforsk" +msgstr "Bla gjennom" #: editor/editor_sub_scene.cpp msgid "Scene Path:" @@ -3953,7 +3945,7 @@ msgstr "Lag mappe" #: editor/filesystem_dock.cpp msgid "Re-Scan Filesystem" -msgstr "Re-Skann Filsystem" +msgstr "Gjennomsøk filsystem på ny" #: editor/filesystem_dock.cpp #, fuzzy @@ -3970,8 +3962,8 @@ msgid "" "Scanning Files,\n" "Please Wait..." msgstr "" -"Skanner Filer,\n" -"Vennligst Vent..." +"Gjennomgår filer,\n" +"Vent…" #: editor/filesystem_dock.cpp msgid "Move" @@ -4225,7 +4217,8 @@ msgid "Reimport" msgstr "Reimporter" #: editor/import_dock.cpp -msgid "Save scenes, re-import and restart" +#, fuzzy +msgid "Save Scenes, Re-Import, and Restart" msgstr "Lagre scener, om-importer og start om" #: editor/import_dock.cpp @@ -4670,9 +4663,8 @@ msgid "Audio Clips" msgstr "Lydklipp:" #: editor/plugins/animation_blend_tree_editor_plugin.cpp -#, fuzzy msgid "Functions" -msgstr "Funksjoner:" +msgstr "Funksjoner" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/animation_state_machine_editor.cpp @@ -5021,9 +5013,8 @@ msgstr "Panorerings-Modus" #: editor/plugins/animation_tree_editor_plugin.cpp #: editor/plugins/animation_tree_player_editor_plugin.cpp -#, fuzzy msgid "AnimationTree" -msgstr "Animasjon" +msgstr "Animasjontre" #: editor/plugins/animation_tree_player_editor_plugin.cpp msgid "New name:" @@ -7256,14 +7247,6 @@ msgid "Open Godot online documentation." msgstr "Åpne Godots nettbaserte dokumentasjon" #: editor/plugins/script_editor_plugin.cpp -msgid "Request Docs" -msgstr "" - -#: editor/plugins/script_editor_plugin.cpp -msgid "Help improve the Godot documentation by giving feedback." -msgstr "" - -#: editor/plugins/script_editor_plugin.cpp msgid "Search the reference documentation." msgstr "Søk i referanse-dokumentasjonen." @@ -7297,7 +7280,7 @@ msgstr "Lagre på nytt" #: editor/plugins/script_editor_plugin.cpp editor/script_editor_debugger.cpp msgid "Debugger" -msgstr "Feilretter" +msgstr "Feilsøking" #: editor/plugins/script_editor_plugin.cpp #, fuzzy @@ -7565,9 +7548,8 @@ msgid "Create physical bones" msgstr "" #: editor/plugins/skeleton_editor_plugin.cpp -#, fuzzy msgid "Skeleton" -msgstr "Singleton" +msgstr "Skelett" #: editor/plugins/skeleton_editor_plugin.cpp #, fuzzy @@ -7585,7 +7567,7 @@ msgstr "" #: editor/plugins/spatial_editor_plugin.cpp msgid "Perspective" -msgstr "" +msgstr "Perspektiv" #: editor/plugins/spatial_editor_plugin.cpp msgid "Transform Aborted." @@ -7724,6 +7706,10 @@ msgid "This operation requires a single selected node." msgstr "Denne operasjonen krever én valgt node." #: editor/plugins/spatial_editor_plugin.cpp +msgid "Auto Orthogonal Enabled" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp #, fuzzy msgid "Lock View Rotation" msgstr "Vis Informasjon" @@ -7780,7 +7766,7 @@ msgstr "Lager Forhåndsvisning av Mesh" #: editor/plugins/spatial_editor_plugin.cpp msgid "Not available when using the GLES2 renderer." -msgstr "" +msgstr "Ikke tilgjengelig ved bruk av GLES2-opptegner." #: editor/plugins/spatial_editor_plugin.cpp msgid "Freelook Left" @@ -7815,17 +7801,17 @@ msgid "Freelook Slow Modifier" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +#, fuzzy +msgid "View Rotation Locked" +msgstr "Vis Informasjon" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -#, fuzzy -msgid "View Rotation Locked" -msgstr "Vis Informasjon" - -#: editor/plugins/spatial_editor_plugin.cpp msgid "XForm Dialog" msgstr "" @@ -7879,7 +7865,7 @@ msgstr "Høyrevisning" #: editor/plugins/spatial_editor_plugin.cpp msgid "Switch Perspective/Orthogonal View" -msgstr "" +msgstr "Bytt perspektiv/ortogonal fremvisning" #: editor/plugins/spatial_editor_plugin.cpp msgid "Insert Animation Key" @@ -7975,7 +7961,7 @@ msgstr "" #: editor/plugins/spatial_editor_plugin.cpp msgid "Perspective FOV (deg.):" -msgstr "" +msgstr "Perspektiv-synsv. (deg.):" #: editor/plugins/spatial_editor_plugin.cpp msgid "View Z-Near:" @@ -9032,9 +9018,8 @@ msgid "Scalar" msgstr "Skala:" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Vector" -msgstr "Inspektør" +msgstr "Vektor" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Boolean" @@ -10071,7 +10056,7 @@ msgstr "" #: editor/project_manager.cpp msgid "Please choose an empty folder." -msgstr "" +msgstr "Velg en tom mappe." #: editor/project_manager.cpp msgid "Please choose a \"project.godot\" or \".zip\" file." @@ -10144,9 +10129,8 @@ msgid "Create New Project" msgstr "Opprett Nytt Prosjekt" #: editor/project_manager.cpp -#, fuzzy msgid "Create & Edit" -msgstr "Opprett skript" +msgstr "Opprett og rediger" #: editor/project_manager.cpp msgid "Install Project:" @@ -10171,7 +10155,7 @@ msgstr "Prosjektsti:" #: editor/project_manager.cpp msgid "Renderer:" -msgstr "" +msgstr "Opptegner:" #: editor/project_manager.cpp msgid "OpenGL ES 3.0" @@ -10184,6 +10168,10 @@ msgid "" "Incompatible with older hardware\n" "Not recommended for web games" msgstr "" +"Høyere visuell kvalitet\n" +"All funksjonalitet tilgjengelig\n" +"Fungerer ikke med eldre maskinvare\n" +"Ikke anbefalt for nettsidebaserte spill" #: editor/project_manager.cpp msgid "OpenGL ES 2.0" @@ -10196,10 +10184,14 @@ msgid "" "Works on most hardware\n" "Recommended for web games" msgstr "" +"Lavere visuell kvalitet\n" +"Noe funksjonalitet er ikke tilgjengelig\n" +"Virker på det meste av maskinvare\n" +"Anbefalt for nettsidebaserte spill" #: editor/project_manager.cpp msgid "Renderer can be changed later, but scenes may need to be adjusted." -msgstr "" +msgstr "Rendrer kan endres senere, men scener må kanskje justeres." #: editor/project_manager.cpp msgid "Unnamed Project" @@ -10304,22 +10296,21 @@ msgid "" msgstr "" #: editor/project_manager.cpp -#, fuzzy msgid "" "Are you sure to scan %s folders for existing Godot projects?\n" "This could take a while." msgstr "" -"Du er i ferd med å skanne %s mapper for eksisterende Godotprosjekter. " -"Bekrefter du?" +"Er du sikker på at du vil søke gjennom %s mapper etter eksisterende " +"Godotprosjekter.\n" +"Det kan ta en stund." #: editor/project_manager.cpp msgid "Project Manager" -msgstr "Prosjektleder" +msgstr "Prosjektstyring" #: editor/project_manager.cpp -#, fuzzy msgid "Projects" -msgstr "Prosjekt" +msgstr "Prosjekter" #: editor/project_manager.cpp msgid "Last Modified" @@ -10327,11 +10318,11 @@ msgstr "" #: editor/project_manager.cpp msgid "Scan" -msgstr "Skann" +msgstr "Gjennomsøk" #: editor/project_manager.cpp msgid "Select a Folder to Scan" -msgstr "Velg en Mappe å Skanne" +msgstr "Velg en mappe å søke gjennom" #: editor/project_manager.cpp msgid "New Project" @@ -10344,7 +10335,7 @@ msgstr "Fjern punkt" #: editor/project_manager.cpp msgid "Templates" -msgstr "" +msgstr "Maler" #: editor/project_manager.cpp msgid "Restart Now" @@ -10402,15 +10393,15 @@ msgstr "" #: editor/project_settings_editor.cpp msgid "All Devices" -msgstr "" +msgstr "Alle enheter" #: editor/project_settings_editor.cpp msgid "Device" -msgstr "" +msgstr "Enhet" #: editor/project_settings_editor.cpp editor/settings_config_dialog.cpp msgid "Press a Key..." -msgstr "" +msgstr "Trykk en tast..." #: editor/project_settings_editor.cpp msgid "Mouse Button Index:" @@ -10418,15 +10409,15 @@ msgstr "" #: editor/project_settings_editor.cpp msgid "Left Button" -msgstr "" +msgstr "Venstre knapp" #: editor/project_settings_editor.cpp msgid "Right Button" -msgstr "" +msgstr "Høyre knapp" #: editor/project_settings_editor.cpp msgid "Middle Button" -msgstr "" +msgstr "Midtknapp" #: editor/project_settings_editor.cpp msgid "Wheel Up Button" @@ -10460,7 +10451,7 @@ msgstr "" #: editor/project_settings_editor.cpp msgid "Axis" -msgstr "" +msgstr "Akse" #: editor/project_settings_editor.cpp msgid "Joypad Button Index:" @@ -10477,23 +10468,23 @@ msgstr "" #: editor/project_settings_editor.cpp msgid "Add Event" -msgstr "" +msgstr "Legg til hendelse" #: editor/project_settings_editor.cpp msgid "Button" -msgstr "" +msgstr "Knapp" #: editor/project_settings_editor.cpp msgid "Left Button." -msgstr "" +msgstr "Venstre knapp." #: editor/project_settings_editor.cpp msgid "Right Button." -msgstr "" +msgstr "Høyre knapp." #: editor/project_settings_editor.cpp msgid "Middle Button." -msgstr "" +msgstr "Midtknapp." #: editor/project_settings_editor.cpp msgid "Wheel Up." @@ -10513,7 +10504,7 @@ msgstr "" #: editor/project_settings_editor.cpp msgid "No property '%s' exists." -msgstr "" +msgstr "Egenskapen «%s» eksisterer ikke." #: editor/project_settings_editor.cpp msgid "Setting '%s' is internal, and it can't be deleted." @@ -10553,11 +10544,11 @@ msgstr "" #: editor/project_settings_editor.cpp msgid "Add Translation" -msgstr "" +msgstr "Legg til oversettelse" #: editor/project_settings_editor.cpp msgid "Remove Translation" -msgstr "" +msgstr "Fjern oversettelse" #: editor/project_settings_editor.cpp msgid "Add Remapped Path" @@ -10597,7 +10588,7 @@ msgstr "Generelt" #: editor/project_settings_editor.cpp msgid "Override For..." -msgstr "" +msgstr "Overstyr for..." #: editor/project_settings_editor.cpp editor/settings_config_dialog.cpp msgid "The editor must be restarted for changes to take effect." @@ -10612,17 +10603,16 @@ msgid "Action:" msgstr "" #: editor/project_settings_editor.cpp -#, fuzzy msgid "Action" -msgstr "Flytt Handling" +msgstr "Handling" #: editor/project_settings_editor.cpp msgid "Deadzone" -msgstr "" +msgstr "Dødsone" #: editor/project_settings_editor.cpp msgid "Device:" -msgstr "" +msgstr "Enhet:" #: editor/project_settings_editor.cpp msgid "Index:" @@ -10634,11 +10624,11 @@ msgstr "" #: editor/project_settings_editor.cpp msgid "Translations" -msgstr "" +msgstr "Oversettelser" #: editor/project_settings_editor.cpp msgid "Translations:" -msgstr "" +msgstr "Oversettelser:" #: editor/project_settings_editor.cpp msgid "Remaps" @@ -10684,9 +10674,8 @@ msgid "AutoLoad" msgstr "" #: editor/project_settings_editor.cpp -#, fuzzy msgid "Plugins" -msgstr "Plugins" +msgstr "Innstikkmoduler" #: editor/property_editor.cpp #, fuzzy @@ -10707,7 +10696,7 @@ msgstr "" #: editor/property_editor.cpp msgid "File..." -msgstr "" +msgstr "Fil..." #: editor/property_editor.cpp msgid "Dir..." @@ -10715,12 +10704,11 @@ msgstr "" #: editor/property_editor.cpp msgid "Assign" -msgstr "" +msgstr "Tildel" #: editor/property_editor.cpp -#, fuzzy msgid "Select Node" -msgstr "Kutt Noder" +msgstr "Velg node" #: editor/property_editor.cpp msgid "Error loading file: Not a resource!" @@ -11031,9 +11019,8 @@ msgid "New Scene Root" msgstr "Lagre Scene" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Create Root Node:" -msgstr "Lag Node" +msgstr "Opprett rot-node:" #: editor/scene_tree_dock.cpp #, fuzzy @@ -11047,12 +11034,11 @@ msgstr "Scene" #: editor/scene_tree_dock.cpp msgid "User Interface" -msgstr "" +msgstr "Brukergrensesnitt" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Other Node" -msgstr "Kutt Noder" +msgstr "Andre noder" #: editor/scene_tree_dock.cpp msgid "Can't operate on nodes from a foreign scene!" @@ -11161,6 +11147,8 @@ msgid "" "Instance a scene file as a Node. Creates an inherited scene if no root node " "exists." msgstr "" +"Opprett en scenefil som en node. Oppretter en arvet scene hvis det ikke " +"finnes en rot-node." #: editor/scene_tree_dock.cpp msgid "Attach a new or existing script for the selected node." @@ -11381,6 +11369,12 @@ msgid "Script file already exists." msgstr "Eksisterer allerede" #: editor/script_create_dialog.cpp +msgid "" +"Note: Built-in scripts have some limitations and can't be edited using an " +"external editor." +msgstr "" + +#: editor/script_create_dialog.cpp #, fuzzy msgid "Class Name:" msgstr "Klasse:" @@ -11487,9 +11481,8 @@ msgid "Profiler" msgstr "" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "Network Profiler" -msgstr "Eksporter Prosjekt" +msgstr "" #: editor/script_editor_debugger.cpp msgid "Monitor" @@ -12209,11 +12202,11 @@ msgstr "Endre CanvasItem" #: modules/visual_script/visual_script_editor.cpp msgid "Can't copy the function node." -msgstr "" +msgstr "Kan ikke kopiere funksjonsnoden." #: modules/visual_script/visual_script_editor.cpp msgid "Clipboard is empty!" -msgstr "" +msgstr "Utklippsbordet er tomt!" #: modules/visual_script/visual_script_editor.cpp #, fuzzy @@ -13084,6 +13077,10 @@ msgid "" "texture to some node for display." msgstr "" +#: scene/main/viewport.cpp +msgid "Viewport size must be greater than 0 to render anything." +msgstr "" + #: scene/resources/visual_shader_nodes.cpp #, fuzzy msgid "Invalid source for preview." @@ -13114,6 +13111,9 @@ msgstr "" msgid "Constants cannot be modified." msgstr "Konstanter kan ikke endres." +#~ msgid "Issue Tracker" +#~ msgstr "Problemtracker" + #~ msgid "Replaced %d occurrence(s)." #~ msgstr "Erstattet %d forekomst(er)." diff --git a/editor/translations/nl.po b/editor/translations/nl.po index a729ea6119..d270e51f6f 100644 --- a/editor/translations/nl.po +++ b/editor/translations/nl.po @@ -40,11 +40,12 @@ # Tirrin <lensenjoe@gmail.com>, 2019. # Filip Van Raemdonck <arrawn@gmail.com>, 2019. # Julian <jdhoogvorst@gmail.com>, 2019, 2020. +# anonymous <noreply@weblate.org>, 2020. msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2020-03-16 09:43+0000\n" +"PO-Revision-Date: 2020-04-15 14:29+0000\n" "Last-Translator: Stijn Hinlopen <f.a.hinlopen@gmail.com>\n" "Language-Team: Dutch <https://hosted.weblate.org/projects/godot-engine/godot/" "nl/>\n" @@ -1466,7 +1467,7 @@ msgstr "Autoload '%s' bestaat al!" #: editor/editor_autoload_settings.cpp msgid "Rename Autoload" -msgstr "Autoload Hernoemen" +msgstr "Naam Autoload-script wijzigen" #: editor/editor_autoload_settings.cpp msgid "Toggle AutoLoad Globals" @@ -1480,7 +1481,7 @@ msgstr "Autoload verplaatsen" msgid "Remove Autoload" msgstr "Autoload verwijderen" -#: editor/editor_autoload_settings.cpp +#: editor/editor_autoload_settings.cpp editor/editor_plugin_settings.cpp msgid "Enable" msgstr "Inschakelen" @@ -1748,7 +1749,7 @@ msgstr "Nieuw" #: editor/editor_feature_profile.cpp editor/editor_node.cpp #: editor/project_manager.cpp msgid "Import" -msgstr "Import" +msgstr "Importeren" #: editor/editor_feature_profile.cpp editor/project_export.cpp msgid "Export" @@ -2966,8 +2967,13 @@ msgid "Q&A" msgstr "Vragen en antwoorden" #: editor/editor_node.cpp -msgid "Issue Tracker" -msgstr "Issue Tracker" +#, fuzzy +msgid "Report a Bug" +msgstr "Opnieuw importeren" + +#: editor/editor_node.cpp +msgid "Send Docs Feedback" +msgstr "" #: editor/editor_node.cpp editor/plugins/asset_library_editor_plugin.cpp msgid "Community" @@ -3641,7 +3647,7 @@ msgstr "" #: editor/filesystem_dock.cpp msgid "Cannot move/rename resources root." -msgstr "Kan de hoofdmap voor bronnen niet verplaatsen of hernoemen." +msgstr "Kan de hoofdmap voor bronnen niet verplaatsen of van naam veranderen." #: editor/filesystem_dock.cpp msgid "Cannot move a folder into itself." @@ -3681,7 +3687,7 @@ msgstr "Bestandsnaam wijzigen:" #: editor/filesystem_dock.cpp msgid "Renaming folder:" -msgstr "Hernoemen folder:" +msgstr "Mapnaam wijzigen:" #: editor/filesystem_dock.cpp msgid "Duplicating file:" @@ -3762,7 +3768,7 @@ msgstr "Alles inklappen" #: editor/project_manager.cpp editor/rename_dialog.cpp #: editor/scene_tree_dock.cpp msgid "Rename" -msgstr "Hernoemen" +msgstr "Naam wijzigen" #: editor/filesystem_dock.cpp msgid "Previous Folder/File" @@ -4024,7 +4030,8 @@ msgid "Reimport" msgstr "Opnieuw importeren" #: editor/import_dock.cpp -msgid "Save scenes, re-import and restart" +#, fuzzy +msgid "Save Scenes, Re-Import, and Restart" msgstr "Opnieuw importeren en herstarten (alle scènes worden opgeslagen)" #: editor/import_dock.cpp @@ -5997,9 +6004,8 @@ msgstr "" "Dit is de meest preciese (maar langzaamste) optie voor botsingsberekeningen." #: editor/plugins/mesh_instance_editor_plugin.cpp -#, fuzzy msgid "Create Single Convex Collision Sibling" -msgstr "Een enkele convexe botsingsonderelement aanmaken" +msgstr "Maak een enkel convex botsingselement als subelement" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "" @@ -6888,14 +6894,6 @@ msgid "Open Godot online documentation." msgstr "Open Godot online documentatie." #: editor/plugins/script_editor_plugin.cpp -msgid "Request Docs" -msgstr "Verzoek documentatie" - -#: editor/plugins/script_editor_plugin.cpp -msgid "Help improve the Godot documentation by giving feedback." -msgstr "Help de Godot-documentatie te verbeteren door feedback te geven." - -#: editor/plugins/script_editor_plugin.cpp msgid "Search the reference documentation." msgstr "Zoek in de referentie documentatie." @@ -7330,6 +7328,11 @@ msgid "This operation requires a single selected node." msgstr "Deze bewerking vereist één geselecteerde knoop." #: editor/plugins/spatial_editor_plugin.cpp +#, fuzzy +msgid "Auto Orthogonal Enabled" +msgstr "Orthogonaal" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Lock View Rotation" msgstr "Beeldrotatie vergrendelen" @@ -7418,6 +7421,10 @@ msgid "Freelook Slow Modifier" msgstr "Vrijekijk Snelheid Modificator" #: editor/plugins/spatial_editor_plugin.cpp +msgid "View Rotation Locked" +msgstr "Beeldrotatie vergrendeld" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." @@ -7427,10 +7434,6 @@ msgstr "" "Het is geen betrouwbare indicatie voor werkelijke spelprestaties." #: editor/plugins/spatial_editor_plugin.cpp -msgid "View Rotation Locked" -msgstr "Beeldrotatie vergrendeld" - -#: editor/plugins/spatial_editor_plugin.cpp msgid "XForm Dialog" msgstr "XForm Dialoog" @@ -8169,7 +8172,7 @@ msgstr "Selecteer de vorige shape, subtegel of Tegel." #: editor/plugins/tile_set_editor_plugin.cpp msgid "Region" -msgstr "Bereik" +msgstr "Gebied" #: editor/plugins/tile_set_editor_plugin.cpp msgid "Collision" @@ -8197,7 +8200,7 @@ msgstr "Z Index" #: editor/plugins/tile_set_editor_plugin.cpp msgid "Region Mode" -msgstr "Bereikmodus" +msgstr "Gebiedmodus" #: editor/plugins/tile_set_editor_plugin.cpp msgid "Collision Mode" @@ -8249,7 +8252,7 @@ msgstr "Nieuwe veelhoek aanmaken." #: editor/plugins/tile_set_editor_plugin.cpp msgid "Keep polygon inside region Rect." -msgstr "Hou de veelhoek binnen een rechthoekig bereik." +msgstr "Houd de veelhoek binnen het rechthoekige gebied." #: editor/plugins/tile_set_editor_plugin.cpp msgid "Enable snap and show grid (configurable via the Inspector)." @@ -9877,7 +9880,7 @@ msgid "" "The project folders' contents won't be modified." msgstr "" "%d projecten uit de lijst verwijderen?\n" -"De inhoud van de projectmappen wordt niet geraakt." +"De inhoud van de projectmappen wordt niet gewijzigd." #: editor/project_manager.cpp msgid "" @@ -9885,7 +9888,7 @@ msgid "" "The project folder's contents won't be modified." msgstr "" "Project uit de lijst verwijderen?\n" -"De inhoud van de projectmap wordt niet geraakt." +"De inhoud van de projectmap wordt niet gewijzigd." #: editor/project_manager.cpp msgid "" @@ -10338,7 +10341,7 @@ msgstr "Selecteer Method" #: editor/rename_dialog.cpp editor/scene_tree_dock.cpp msgid "Batch Rename" -msgstr "Hernoemen meerdere" +msgstr "Bulk hernoemen" #: editor/rename_dialog.cpp msgid "Prefix" @@ -10647,7 +10650,7 @@ msgstr "Kan niet werken aan knopen waar de huidige scène van erft!" #: editor/scene_tree_dock.cpp msgid "Attach Script" -msgstr "Verbind Script" +msgstr "Script toevoegen" #: editor/scene_tree_dock.cpp msgid "Remove Node(s)" @@ -10950,6 +10953,12 @@ msgid "Script file already exists." msgstr "Scriptbestand bestaat al." #: editor/script_create_dialog.cpp +msgid "" +"Note: Built-in scripts have some limitations and can't be edited using an " +"external editor." +msgstr "" + +#: editor/script_create_dialog.cpp msgid "Class Name:" msgstr "Klasse Naam:" @@ -12733,6 +12742,10 @@ msgstr "" "maken, zodat het een grootte kan ontvangen. Anders, maak er een RenderTarget " "van en wijs zijn interne textuur toe aan een knoop om te tonen." +#: scene/main/viewport.cpp +msgid "Viewport size must be greater than 0 to render anything." +msgstr "" + #: scene/resources/visual_shader_nodes.cpp msgid "Invalid source for preview." msgstr "Ongeldige bron voor voorvertoning." @@ -12761,6 +12774,15 @@ msgstr "Varyings kunnen alleen worden toegewezenin vertex functies." msgid "Constants cannot be modified." msgstr "Constanten kunnen niet worden aangepast." +#~ msgid "Issue Tracker" +#~ msgstr "Issue Tracker" + +#~ msgid "Request Docs" +#~ msgstr "Verzoek documentatie" + +#~ msgid "Help improve the Godot documentation by giving feedback." +#~ msgstr "Help de Godot-documentatie te verbeteren door feedback te geven." + #~ msgid "Replaced %d occurrence(s)." #~ msgstr "%d voorgekomen waarde(s) vervangen." diff --git a/editor/translations/or.po b/editor/translations/or.po index 6819e53f38..1858bad087 100644 --- a/editor/translations/or.po +++ b/editor/translations/or.po @@ -1405,7 +1405,7 @@ msgstr "" msgid "Remove Autoload" msgstr "" -#: editor/editor_autoload_settings.cpp +#: editor/editor_autoload_settings.cpp editor/editor_plugin_settings.cpp msgid "Enable" msgstr "" @@ -2808,7 +2808,11 @@ msgid "Q&A" msgstr "" #: editor/editor_node.cpp -msgid "Issue Tracker" +msgid "Report a Bug" +msgstr "" + +#: editor/editor_node.cpp +msgid "Send Docs Feedback" msgstr "" #: editor/editor_node.cpp editor/plugins/asset_library_editor_plugin.cpp @@ -3829,7 +3833,7 @@ msgid "Reimport" msgstr "" #: editor/import_dock.cpp -msgid "Save scenes, re-import and restart" +msgid "Save Scenes, Re-Import, and Restart" msgstr "" #: editor/import_dock.cpp @@ -6611,14 +6615,6 @@ msgid "Open Godot online documentation." msgstr "" #: editor/plugins/script_editor_plugin.cpp -msgid "Request Docs" -msgstr "" - -#: editor/plugins/script_editor_plugin.cpp -msgid "Help improve the Godot documentation by giving feedback." -msgstr "" - -#: editor/plugins/script_editor_plugin.cpp msgid "Search the reference documentation." msgstr "" @@ -7048,6 +7044,10 @@ msgid "This operation requires a single selected node." msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Auto Orthogonal Enabled" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Lock View Rotation" msgstr "" @@ -7136,13 +7136,13 @@ msgid "Freelook Slow Modifier" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "" -"Note: The FPS value displayed is the editor's framerate.\n" -"It cannot be used as a reliable indication of in-game performance." +msgid "View Rotation Locked" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "View Rotation Locked" +msgid "" +"Note: The FPS value displayed is the editor's framerate.\n" +"It cannot be used as a reliable indication of in-game performance." msgstr "" #: editor/plugins/spatial_editor_plugin.cpp @@ -10460,6 +10460,12 @@ msgid "Script file already exists." msgstr "" #: editor/script_create_dialog.cpp +msgid "" +"Note: Built-in scripts have some limitations and can't be edited using an " +"external editor." +msgstr "" + +#: editor/script_create_dialog.cpp msgid "Class Name:" msgstr "" @@ -12073,6 +12079,10 @@ msgid "" "texture to some node for display." msgstr "" +#: scene/main/viewport.cpp +msgid "Viewport size must be greater than 0 to render anything." +msgstr "" + #: scene/resources/visual_shader_nodes.cpp msgid "Invalid source for preview." msgstr "" diff --git a/editor/translations/pl.po b/editor/translations/pl.po index de1d6d5375..eb40e7ecaa 100644 --- a/editor/translations/pl.po +++ b/editor/translations/pl.po @@ -42,7 +42,7 @@ msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2020-03-16 09:43+0000\n" +"PO-Revision-Date: 2020-03-26 05:19+0000\n" "Last-Translator: Tomek <kobewi4e@gmail.com>\n" "Language-Team: Polish <https://hosted.weblate.org/projects/godot-engine/" "godot/pl/>\n" @@ -1474,7 +1474,7 @@ msgstr "Przemieść Autoload" msgid "Remove Autoload" msgstr "Usuń Autoload" -#: editor/editor_autoload_settings.cpp +#: editor/editor_autoload_settings.cpp editor/editor_plugin_settings.cpp msgid "Enable" msgstr "Włącz" @@ -2952,8 +2952,13 @@ msgid "Q&A" msgstr "Pytania i odpowiedzi" #: editor/editor_node.cpp -msgid "Issue Tracker" -msgstr "Lista problemów" +#, fuzzy +msgid "Report a Bug" +msgstr "Importuj ponownie" + +#: editor/editor_node.cpp +msgid "Send Docs Feedback" +msgstr "" #: editor/editor_node.cpp editor/plugins/asset_library_editor_plugin.cpp msgid "Community" @@ -4008,7 +4013,8 @@ msgid "Reimport" msgstr "Importuj ponownie" #: editor/import_dock.cpp -msgid "Save scenes, re-import and restart" +#, fuzzy +msgid "Save Scenes, Re-Import, and Restart" msgstr "Zapisz sceny, re-importuj i zrestartuj" #: editor/import_dock.cpp @@ -6867,14 +6873,6 @@ msgid "Open Godot online documentation." msgstr "Otwórz dokumentację Godota online." #: editor/plugins/script_editor_plugin.cpp -msgid "Request Docs" -msgstr "Poproś o dokumentację" - -#: editor/plugins/script_editor_plugin.cpp -msgid "Help improve the Godot documentation by giving feedback." -msgstr "Pomóż polepszyć dokumentację Godota przesyłając opinię." - -#: editor/plugins/script_editor_plugin.cpp msgid "Search the reference documentation." msgstr "Poszukaj w dokumentacji referencyjnej." @@ -7311,6 +7309,11 @@ msgid "This operation requires a single selected node." msgstr "Ta operacja wymaga pojedynczego wybranego węzła." #: editor/plugins/spatial_editor_plugin.cpp +#, fuzzy +msgid "Auto Orthogonal Enabled" +msgstr "Ortogonalna" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Lock View Rotation" msgstr "Zablokuj obrót widoku" @@ -7399,6 +7402,10 @@ msgid "Freelook Slow Modifier" msgstr "Wolny modyfikator swobodnego widoku" #: editor/plugins/spatial_editor_plugin.cpp +msgid "View Rotation Locked" +msgstr "Obroty widoku zablokowane" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." @@ -7407,10 +7414,6 @@ msgstr "" "Nie może być używana jako miarodajny wskaźnik wydajności w grze." #: editor/plugins/spatial_editor_plugin.cpp -msgid "View Rotation Locked" -msgstr "Obroty widoku zablokowane" - -#: editor/plugins/spatial_editor_plugin.cpp msgid "XForm Dialog" msgstr "Okno dialogowe XForm" @@ -8040,7 +8043,7 @@ msgstr "Wypełnienie" #: editor/plugins/tile_map_editor_plugin.cpp msgid "Erase TileMap" -msgstr "Wyczyść TileMap" +msgstr "Usuń TileMap" #: editor/plugins/tile_map_editor_plugin.cpp msgid "Find Tile" @@ -10914,6 +10917,12 @@ msgid "Script file already exists." msgstr "Plik skryptu już istnieje." #: editor/script_create_dialog.cpp +msgid "" +"Note: Built-in scripts have some limitations and can't be edited using an " +"external editor." +msgstr "" + +#: editor/script_create_dialog.cpp msgid "Class Name:" msgstr "Nazwa klasy:" @@ -12697,6 +12706,10 @@ msgstr "" "otrzymał jakiś rozmiar. W przeciwnym wypadku ustawi opcję RenderTarget i " "przyporządkuj jego teksturę dla któregoś węzła." +#: scene/main/viewport.cpp +msgid "Viewport size must be greater than 0 to render anything." +msgstr "" + #: scene/resources/visual_shader_nodes.cpp msgid "Invalid source for preview." msgstr "Nieprawidłowe źródło do podglądu." @@ -12725,6 +12738,15 @@ msgstr "Varying może być przypisane tylko w funkcji wierzchołków." msgid "Constants cannot be modified." msgstr "Stałe nie mogą być modyfikowane." +#~ msgid "Issue Tracker" +#~ msgstr "Lista problemów" + +#~ msgid "Request Docs" +#~ msgstr "Poproś o dokumentację" + +#~ msgid "Help improve the Godot documentation by giving feedback." +#~ msgstr "Pomóż polepszyć dokumentację Godota przesyłając opinię." + #~ msgid "Replaced %d occurrence(s)." #~ msgstr "Zastąpiono %d wystąpień." diff --git a/editor/translations/pr.po b/editor/translations/pr.po index 873a2d506b..70a061783c 100644 --- a/editor/translations/pr.po +++ b/editor/translations/pr.po @@ -1453,7 +1453,7 @@ msgstr "" msgid "Remove Autoload" msgstr "" -#: editor/editor_autoload_settings.cpp +#: editor/editor_autoload_settings.cpp editor/editor_plugin_settings.cpp msgid "Enable" msgstr "" @@ -2897,7 +2897,11 @@ msgid "Q&A" msgstr "" #: editor/editor_node.cpp -msgid "Issue Tracker" +msgid "Report a Bug" +msgstr "" + +#: editor/editor_node.cpp +msgid "Send Docs Feedback" msgstr "" #: editor/editor_node.cpp editor/plugins/asset_library_editor_plugin.cpp @@ -3956,7 +3960,7 @@ msgid "Reimport" msgstr "" #: editor/import_dock.cpp -msgid "Save scenes, re-import and restart" +msgid "Save Scenes, Re-Import, and Restart" msgstr "" #: editor/import_dock.cpp @@ -6823,14 +6827,6 @@ msgid "Open Godot online documentation." msgstr "Yer functions:" #: editor/plugins/script_editor_plugin.cpp -msgid "Request Docs" -msgstr "" - -#: editor/plugins/script_editor_plugin.cpp -msgid "Help improve the Godot documentation by giving feedback." -msgstr "" - -#: editor/plugins/script_editor_plugin.cpp msgid "Search the reference documentation." msgstr "" @@ -7277,6 +7273,10 @@ msgid "This operation requires a single selected node." msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Auto Orthogonal Enabled" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Lock View Rotation" msgstr "" @@ -7366,13 +7366,13 @@ msgid "Freelook Slow Modifier" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "" -"Note: The FPS value displayed is the editor's framerate.\n" -"It cannot be used as a reliable indication of in-game performance." +msgid "View Rotation Locked" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "View Rotation Locked" +msgid "" +"Note: The FPS value displayed is the editor's framerate.\n" +"It cannot be used as a reliable indication of in-game performance." msgstr "" #: editor/plugins/spatial_editor_plugin.cpp @@ -10812,6 +10812,12 @@ msgid "Script file already exists." msgstr "" #: editor/script_create_dialog.cpp +msgid "" +"Note: Built-in scripts have some limitations and can't be edited using an " +"external editor." +msgstr "" + +#: editor/script_create_dialog.cpp msgid "Class Name:" msgstr "" @@ -12501,6 +12507,10 @@ msgid "" "texture to some node for display." msgstr "" +#: scene/main/viewport.cpp +msgid "Viewport size must be greater than 0 to render anything." +msgstr "" + #: scene/resources/visual_shader_nodes.cpp #, fuzzy msgid "Invalid source for preview." diff --git a/editor/translations/pt_BR.po b/editor/translations/pt_BR.po index a96186e434..82bd304311 100644 --- a/editor/translations/pt_BR.po +++ b/editor/translations/pt_BR.po @@ -84,12 +84,13 @@ # Leonardo Dimano <leodimano@live.com>, 2020. # anonymous <noreply@weblate.org>, 2020. # Guilherme Souza Reis de Melo Lopes <gsrmlopes@gmail.com>, 2020. +# Richard Urban <redasuio1@gmail.com>, 2020. msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: 2016-05-30\n" -"PO-Revision-Date: 2020-03-08 22:32+0000\n" -"Last-Translator: Guilherme Souza Reis de Melo Lopes <gsrmlopes@gmail.com>\n" +"PO-Revision-Date: 2020-04-16 11:03+0000\n" +"Last-Translator: Richard Urban <redasuio1@gmail.com>\n" "Language-Team: Portuguese (Brazil) <https://hosted.weblate.org/projects/" "godot-engine/godot/pt_BR/>\n" "Language: pt_BR\n" @@ -97,7 +98,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n > 1;\n" -"X-Generator: Weblate 4.0-dev\n" +"X-Generator: Weblate 4.0.1-dev\n" #: core/math/expression.cpp modules/gdscript/gdscript_functions.cpp #: modules/visual_script/visual_script_builtin_funcs.cpp @@ -1519,7 +1520,7 @@ msgstr "Mover Autoload" msgid "Remove Autoload" msgstr "Remover Autoload" -#: editor/editor_autoload_settings.cpp +#: editor/editor_autoload_settings.cpp editor/editor_plugin_settings.cpp msgid "Enable" msgstr "Habilitar" @@ -3005,8 +3006,13 @@ msgid "Q&A" msgstr "Perguntas & Respostas" #: editor/editor_node.cpp -msgid "Issue Tracker" -msgstr "Rastreador de Problemas" +#, fuzzy +msgid "Report a Bug" +msgstr "Reimportar" + +#: editor/editor_node.cpp +msgid "Send Docs Feedback" +msgstr "" #: editor/editor_node.cpp editor/plugins/asset_library_editor_plugin.cpp msgid "Community" @@ -4065,7 +4071,8 @@ msgid "Reimport" msgstr "Reimportar" #: editor/import_dock.cpp -msgid "Save scenes, re-import and restart" +#, fuzzy +msgid "Save Scenes, Re-Import, and Restart" msgstr "Salvar cenas, reimportar e reiniciar" #: editor/import_dock.cpp @@ -6038,7 +6045,6 @@ msgstr "" "Este é a opção mais precisa (mas lenta) para detecção de colisão." #: editor/plugins/mesh_instance_editor_plugin.cpp -#, fuzzy msgid "Create Single Convex Collision Sibling" msgstr "Criar Simples Colisão Convexa Irmã(s)" @@ -6930,14 +6936,6 @@ msgid "Open Godot online documentation." msgstr "Abrir a documentação online da Godot." #: editor/plugins/script_editor_plugin.cpp -msgid "Request Docs" -msgstr "Solicitar documentos" - -#: editor/plugins/script_editor_plugin.cpp -msgid "Help improve the Godot documentation by giving feedback." -msgstr "Ajude a melhorar a documentação do Godot dando seu feedback." - -#: editor/plugins/script_editor_plugin.cpp msgid "Search the reference documentation." msgstr "Pesquise a documentação de referência." @@ -7372,6 +7370,11 @@ msgid "This operation requires a single selected node." msgstr "Essa operação requer um único nó selecionado." #: editor/plugins/spatial_editor_plugin.cpp +#, fuzzy +msgid "Auto Orthogonal Enabled" +msgstr "Ortogonal" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Lock View Rotation" msgstr "Bloquear Rotação da Visão" @@ -7460,6 +7463,10 @@ msgid "Freelook Slow Modifier" msgstr "Modificador de velocidade lenta da Visão Livre" #: editor/plugins/spatial_editor_plugin.cpp +msgid "View Rotation Locked" +msgstr "Ver Rotação Bloqueada" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." @@ -7468,10 +7475,6 @@ msgstr "" "Ele não deve ser usado como indicação confiável de desempenho do jogo." #: editor/plugins/spatial_editor_plugin.cpp -msgid "View Rotation Locked" -msgstr "Ver Rotação Bloqueada" - -#: editor/plugins/spatial_editor_plugin.cpp msgid "XForm Dialog" msgstr "Diálogo XForm" @@ -10972,6 +10975,12 @@ msgid "Script file already exists." msgstr "O arquivo de script já existe." #: editor/script_create_dialog.cpp +msgid "" +"Note: Built-in scripts have some limitations and can't be edited using an " +"external editor." +msgstr "" + +#: editor/script_create_dialog.cpp msgid "Class Name:" msgstr "Nome da Classe:" @@ -12453,7 +12462,7 @@ msgstr "" #: scene/3d/collision_shape.cpp msgid "" "ConcavePolygonShape doesn't support RigidBody in another mode than static." -msgstr "" +msgstr "Lol." #: scene/3d/cpu_particles.cpp msgid "Nothing is visible because no mesh has been assigned." @@ -12753,6 +12762,10 @@ msgstr "" "para que ele possa ter um tamanho. Caso contrário, defina-o como destino de " "render e atribua sua textura interna a algum nó para exibir." +#: scene/main/viewport.cpp +msgid "Viewport size must be greater than 0 to render anything." +msgstr "" + #: scene/resources/visual_shader_nodes.cpp msgid "Invalid source for preview." msgstr "Fonte inválida para a prévia." @@ -12781,6 +12794,15 @@ msgstr "Variáveis só podem ser atribuídas na função de vértice." msgid "Constants cannot be modified." msgstr "Constantes não podem serem modificadas." +#~ msgid "Issue Tracker" +#~ msgstr "Rastreador de Problemas" + +#~ msgid "Request Docs" +#~ msgstr "Solicitar documentos" + +#~ msgid "Help improve the Godot documentation by giving feedback." +#~ msgstr "Ajude a melhorar a documentação do Godot dando seu feedback." + #~ msgid "Replaced %d occurrence(s)." #~ msgstr "%d ocorrência(s) substituída(s)." diff --git a/editor/translations/pt_PT.po b/editor/translations/pt_PT.po index d7532e38d4..f3b1014123 100644 --- a/editor/translations/pt_PT.po +++ b/editor/translations/pt_PT.po @@ -15,12 +15,13 @@ # Vinicius Gonçalves <viniciusgoncalves21@gmail.com>, 2017. # ssantos <ssantos@web.de>, 2018, 2019. # Gonçalo Dinis Guerreiro João <goncalojoao205@gmail.com>, 2019. +# Manuela Silva <mmsrs@sky.com>, 2020. msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2020-03-16 09:43+0000\n" -"Last-Translator: João Lopes <linux-man@hotmail.com>\n" +"PO-Revision-Date: 2020-04-07 13:38+0000\n" +"Last-Translator: Manuela Silva <mmsrs@sky.com>\n" "Language-Team: Portuguese (Portugal) <https://hosted.weblate.org/projects/" "godot-engine/godot/pt_PT/>\n" "Language: pt_PT\n" @@ -33,18 +34,18 @@ msgstr "" #: core/math/expression.cpp modules/gdscript/gdscript_functions.cpp #: modules/visual_script/visual_script_builtin_funcs.cpp msgid "Invalid type argument to convert(), use TYPE_* constants." -msgstr "Tipo de argumento inválido para convert(), use constantes TYPE_*." +msgstr "Tipo de argumento inválido para convert(), utilize constantes TYPE_*." #: core/math/expression.cpp modules/gdscript/gdscript_functions.cpp msgid "Expected a string of length 1 (a character)." -msgstr "Esperado um string de comprimento 1 (um carácter)." +msgstr "Esperado uma \"string\" de comprimento 1 (um caráter)." #: core/math/expression.cpp modules/gdscript/gdscript_functions.cpp #: modules/mono/glue/gd_glue.cpp #: modules/visual_script/visual_script_builtin_funcs.cpp msgid "Not enough bytes for decoding bytes, or invalid format." msgstr "" -"Número de bytes insuficientes para descodificar, ou o formato é inválido." +"Número de \"bytes\" insuficientes para descodificar, ou o formato é inválido." #: core/math/expression.cpp msgid "Invalid input %i (not passed) in expression" @@ -1454,7 +1455,7 @@ msgstr "Mover Carregamento Automático" msgid "Remove Autoload" msgstr "Remover Carregamento Automático" -#: editor/editor_autoload_settings.cpp +#: editor/editor_autoload_settings.cpp editor/editor_plugin_settings.cpp msgid "Enable" msgstr "Ativar" @@ -2939,8 +2940,13 @@ msgid "Q&A" msgstr "Perguntas & Respostas" #: editor/editor_node.cpp -msgid "Issue Tracker" -msgstr "Rastreador de Problemas" +#, fuzzy +msgid "Report a Bug" +msgstr "Reimportar" + +#: editor/editor_node.cpp +msgid "Send Docs Feedback" +msgstr "" #: editor/editor_node.cpp editor/plugins/asset_library_editor_plugin.cpp msgid "Community" @@ -3994,7 +4000,8 @@ msgid "Reimport" msgstr "Reimportar" #: editor/import_dock.cpp -msgid "Save scenes, re-import and restart" +#, fuzzy +msgid "Save Scenes, Re-Import, and Restart" msgstr "Guardar cenas, reimportar e reiniciar" #: editor/import_dock.cpp @@ -6844,14 +6851,6 @@ msgid "Open Godot online documentation." msgstr "Abrir documentação online do Godot." #: editor/plugins/script_editor_plugin.cpp -msgid "Request Docs" -msgstr "Requisitar Docs" - -#: editor/plugins/script_editor_plugin.cpp -msgid "Help improve the Godot documentation by giving feedback." -msgstr "Dê a sua opinião para ajudar a melhorar a documentação Godot." - -#: editor/plugins/script_editor_plugin.cpp msgid "Search the reference documentation." msgstr "Procurar na documentação de referência." @@ -7285,6 +7284,11 @@ msgid "This operation requires a single selected node." msgstr "Esta operação requer um único nó selecionado." #: editor/plugins/spatial_editor_plugin.cpp +#, fuzzy +msgid "Auto Orthogonal Enabled" +msgstr "Ortogonal" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Lock View Rotation" msgstr "Bloquear Rotação da Vista" @@ -7373,6 +7377,10 @@ msgid "Freelook Slow Modifier" msgstr "Modificador de Velocidade Freelook" #: editor/plugins/spatial_editor_plugin.cpp +msgid "View Rotation Locked" +msgstr "Rotação da Vista Bloqueada" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." @@ -7381,10 +7389,6 @@ msgstr "" "Não é uma indicação fiável do desempenho do jogo." #: editor/plugins/spatial_editor_plugin.cpp -msgid "View Rotation Locked" -msgstr "Rotação da Vista Bloqueada" - -#: editor/plugins/spatial_editor_plugin.cpp msgid "XForm Dialog" msgstr "Diálogo XForm" @@ -10881,6 +10885,12 @@ msgid "Script file already exists." msgstr "Ficheiro Script já existe." #: editor/script_create_dialog.cpp +msgid "" +"Note: Built-in scripts have some limitations and can't be edited using an " +"external editor." +msgstr "" + +#: editor/script_create_dialog.cpp msgid "Class Name:" msgstr "Nome de Classe:" @@ -12659,6 +12669,10 @@ msgstr "" "Control de modo a que obtenha um tamanho. Caso contrário, torne-a um " "RenderTarget e atribua a sua textura interna a outro nó para visualizar." +#: scene/main/viewport.cpp +msgid "Viewport size must be greater than 0 to render anything." +msgstr "" + #: scene/resources/visual_shader_nodes.cpp msgid "Invalid source for preview." msgstr "Fonte inválida para pré-visualização." @@ -12687,6 +12701,15 @@ msgstr "Variações só podem ser atribuídas na função vértice." msgid "Constants cannot be modified." msgstr "Constantes não podem ser modificadas." +#~ msgid "Issue Tracker" +#~ msgstr "Rastreador de Problemas" + +#~ msgid "Request Docs" +#~ msgstr "Requisitar Docs" + +#~ msgid "Help improve the Godot documentation by giving feedback." +#~ msgstr "Dê a sua opinião para ajudar a melhorar a documentação Godot." + #~ msgid "Replaced %d occurrence(s)." #~ msgstr "Substituído %d ocorrência(s)." diff --git a/editor/translations/ro.po b/editor/translations/ro.po index d52127fd95..28d33d4609 100644 --- a/editor/translations/ro.po +++ b/editor/translations/ro.po @@ -1437,7 +1437,7 @@ msgstr "Mutați Autoload" msgid "Remove Autoload" msgstr "Eliminați Autoload" -#: editor/editor_autoload_settings.cpp +#: editor/editor_autoload_settings.cpp editor/editor_plugin_settings.cpp msgid "Enable" msgstr "Activați" @@ -2935,8 +2935,13 @@ msgid "Q&A" msgstr "Întrebări și Răspunsuri" #: editor/editor_node.cpp -msgid "Issue Tracker" -msgstr "Agent de Monitorizare al Problemelor" +#, fuzzy +msgid "Report a Bug" +msgstr "Reimportă" + +#: editor/editor_node.cpp +msgid "Send Docs Feedback" +msgstr "" #: editor/editor_node.cpp editor/plugins/asset_library_editor_plugin.cpp msgid "Community" @@ -4026,7 +4031,7 @@ msgid "Reimport" msgstr "Reimportă" #: editor/import_dock.cpp -msgid "Save scenes, re-import and restart" +msgid "Save Scenes, Re-Import, and Restart" msgstr "" #: editor/import_dock.cpp @@ -7030,14 +7035,6 @@ msgid "Open Godot online documentation." msgstr "Deschide Recente" #: editor/plugins/script_editor_plugin.cpp -msgid "Request Docs" -msgstr "" - -#: editor/plugins/script_editor_plugin.cpp -msgid "Help improve the Godot documentation by giving feedback." -msgstr "" - -#: editor/plugins/script_editor_plugin.cpp msgid "Search the reference documentation." msgstr "" @@ -7489,6 +7486,10 @@ msgid "This operation requires a single selected node." msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Auto Orthogonal Enabled" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp #, fuzzy msgid "Lock View Rotation" msgstr "Curăță Rotația Cursorului" @@ -7580,17 +7581,17 @@ msgid "Freelook Slow Modifier" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +#, fuzzy +msgid "View Rotation Locked" +msgstr "Curăță Rotația Cursorului" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -#, fuzzy -msgid "View Rotation Locked" -msgstr "Curăță Rotația Cursorului" - -#: editor/plugins/spatial_editor_plugin.cpp msgid "XForm Dialog" msgstr "" @@ -11107,6 +11108,12 @@ msgid "Script file already exists." msgstr "AutoLoad '%s' există deja!" #: editor/script_create_dialog.cpp +msgid "" +"Note: Built-in scripts have some limitations and can't be edited using an " +"external editor." +msgstr "" + +#: editor/script_create_dialog.cpp #, fuzzy msgid "Class Name:" msgstr "Clasă:" @@ -12779,6 +12786,10 @@ msgid "" "texture to some node for display." msgstr "" +#: scene/main/viewport.cpp +msgid "Viewport size must be greater than 0 to render anything." +msgstr "" + #: scene/resources/visual_shader_nodes.cpp msgid "Invalid source for preview." msgstr "" @@ -12807,6 +12818,9 @@ msgstr "" msgid "Constants cannot be modified." msgstr "" +#~ msgid "Issue Tracker" +#~ msgstr "Agent de Monitorizare al Problemelor" + #~ msgid "Replaced %d occurrence(s)." #~ msgstr "Înlocuit %d potriviri." diff --git a/editor/translations/ru.po b/editor/translations/ru.po index d3402fd63e..a0e80d0ce8 100644 --- a/editor/translations/ru.po +++ b/editor/translations/ru.po @@ -67,12 +67,15 @@ # Smadjavul <o1985af@gmail.com>, 2020. # anonymous <noreply@weblate.org>, 2020. # Vinsent Insaider_red <vinsent.in7aider@gmail.com>, 2020. +# TMF <themysticalfox@mail.ru>, 2020. +# Ivan Kuzmenko <kuzmenko.ivan2002@yandex.com>, 2020. +# Super Pracion <superpracion2@gmail.com>, 2020. msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2020-03-11 12:20+0000\n" -"Last-Translator: Vinsent Insaider_red <vinsent.in7aider@gmail.com>\n" +"PO-Revision-Date: 2020-04-10 09:09+0000\n" +"Last-Translator: Danil Alexeev <danil@alexeev.xyz>\n" "Language-Team: Russian <https://hosted.weblate.org/projects/godot-engine/" "godot/ru/>\n" "Language: ru\n" @@ -96,7 +99,7 @@ msgstr "Ожидалась строка длиной 1 (символ)." #: modules/mono/glue/gd_glue.cpp #: modules/visual_script/visual_script_builtin_funcs.cpp msgid "Not enough bytes for decoding bytes, or invalid format." -msgstr "Недостаточно байтов для декодирования байтов или неверный формат." +msgstr "Недостаточно байтов для декодирования или неверный формат." #: core/math/expression.cpp msgid "Invalid input %i (not passed) in expression" @@ -232,9 +235,8 @@ msgid "Anim Multi Change Transition" msgstr "Многократное изменение перехода" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Anim Multi Change Transform" -msgstr "Анимационное многосменное преобразование" +msgstr "Анимационное многократное изменение положения" #: editor/animation_track_editor.cpp msgid "Anim Multi Change Keyframe Value" @@ -1505,7 +1507,7 @@ msgstr "Переместить автозагрузку" msgid "Remove Autoload" msgstr "Удалить автозагрузку" -#: editor/editor_autoload_settings.cpp +#: editor/editor_autoload_settings.cpp editor/editor_plugin_settings.cpp msgid "Enable" msgstr "Включить" @@ -2988,8 +2990,13 @@ msgid "Q&A" msgstr "Вопросы и ответы" #: editor/editor_node.cpp -msgid "Issue Tracker" -msgstr "Система отслеживания ошибок" +#, fuzzy +msgid "Report a Bug" +msgstr "Переимпортировать" + +#: editor/editor_node.cpp +msgid "Send Docs Feedback" +msgstr "" #: editor/editor_node.cpp editor/plugins/asset_library_editor_plugin.cpp msgid "Community" @@ -4043,7 +4050,8 @@ msgid "Reimport" msgstr "Переимпортировать" #: editor/import_dock.cpp -msgid "Save scenes, re-import and restart" +#, fuzzy +msgid "Save Scenes, Re-Import, and Restart" msgstr "Сохранить сцены, переимпортировать и перезапустить" #: editor/import_dock.cpp @@ -5241,8 +5249,9 @@ msgid "" msgstr "Якоря и отступы дочерних контейнеров переопределяются их родителями." #: editor/plugins/canvas_item_editor_plugin.cpp +#, fuzzy msgid "Presets for the anchors and margins values of a Control node." -msgstr "Предустановки для якорей и значения отступов контрольного узла." +msgstr "Пресеты значений для якорей и отступов узла Control." #: editor/plugins/canvas_item_editor_plugin.cpp msgid "" @@ -5653,7 +5662,7 @@ msgstr "Автовставка ключа" #: editor/plugins/canvas_item_editor_plugin.cpp #, fuzzy msgid "Animation Key and Pose Options" -msgstr "Ключ анимации вставлен." +msgstr "Опции анимационных Ключей и Позы" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Insert Key (Existing Tracks)" @@ -5764,9 +5773,8 @@ msgstr "Маска излучения" #: editor/plugins/cpu_particles_2d_editor_plugin.cpp #: editor/plugins/particles_2d_editor_plugin.cpp -#, fuzzy msgid "Solid Pixels" -msgstr "Твёрдые пиксели" +msgstr "Сплошные пиксели" #: editor/plugins/cpu_particles_2d_editor_plugin.cpp #: editor/plugins/particles_2d_editor_plugin.cpp @@ -5775,9 +5783,8 @@ msgstr "Граничные пиксели" #: editor/plugins/cpu_particles_2d_editor_plugin.cpp #: editor/plugins/particles_2d_editor_plugin.cpp -#, fuzzy msgid "Directed Border Pixels" -msgstr "Направленные граничные пиксели" +msgstr "Направленные пограничные пиксели" #: editor/plugins/cpu_particles_2d_editor_plugin.cpp #: editor/plugins/particles_2d_editor_plugin.cpp @@ -5912,22 +5919,21 @@ msgid "This doesn't work on scene root!" msgstr "Это не работает на корне сцены!" #: editor/plugins/mesh_instance_editor_plugin.cpp -#, fuzzy msgid "Create Trimesh Static Shape" -msgstr "Создать вогнутую форму" +msgstr "Создать треугольную сетку статической формы" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Can't create a single convex collision shape for the scene root." msgstr "" +"Не удается создать единственную выпуклую форму столкновения для корня сцены." #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Couldn't create a single convex collision shape." -msgstr "" +msgstr "Не удалось создать одну выпуклую форму столкновений." #: editor/plugins/mesh_instance_editor_plugin.cpp -#, fuzzy msgid "Create Single Convex Shape" -msgstr "Создать выпуклую форму(ы)" +msgstr "Создать одну выпуклую форму" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Can't create multiple convex collision shapes for the scene root." @@ -5935,14 +5941,12 @@ msgstr "" "Невозможно создать несколько выпуклых форм столкновения для корня сцены." #: editor/plugins/mesh_instance_editor_plugin.cpp -#, fuzzy msgid "Couldn't create any collision shapes." -msgstr "Не удалось создать папку." +msgstr "Не удалось создать ни одной форму столкновения." #: editor/plugins/mesh_instance_editor_plugin.cpp -#, fuzzy msgid "Create Multiple Convex Shapes" -msgstr "Создать выпуклую форму(ы)" +msgstr "Создать несколько выпуклых форм" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Create Navigation Mesh" @@ -5986,7 +5990,7 @@ msgstr "Создать контур" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Mesh" -msgstr "Массив" +msgstr "Меш" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "Create Trimesh Static Body" @@ -6015,9 +6019,8 @@ msgstr "" "Это самый точный (но самый медленный) способ обнаружения столкновений." #: editor/plugins/mesh_instance_editor_plugin.cpp -#, fuzzy msgid "Create Single Convex Collision Sibling" -msgstr "Создать выпуклую область столкновения" +msgstr "Создать одну выпуклую область столкновения" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "" @@ -6028,9 +6031,8 @@ msgstr "" "Это самый быстрый (но наименее точный) способ обнаружения столкновений." #: editor/plugins/mesh_instance_editor_plugin.cpp -#, fuzzy msgid "Create Multiple Convex Collision Siblings" -msgstr "Создать выпуклую область столкновения" +msgstr "Создать несколько соседних выпуклых форм столкновения" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "" @@ -6045,12 +6047,17 @@ msgid "Create Outline Mesh..." msgstr "Создать полисетку обводки..." #: editor/plugins/mesh_instance_editor_plugin.cpp +#, fuzzy msgid "" "Creates a static outline mesh. The outline mesh will have its normals " "flipped automatically.\n" "This can be used instead of the SpatialMaterial Grow property when using " "that property isn't possible." msgstr "" +"Создаёт статичную контурную полисетку. Её нормали будут перевёрнуты " +"автоматически.\n" +"Она может быть заменой свойству Grow ресурса SpatialMaterial, когда это " +"свойство невозможно использовать." #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "View UV1" @@ -6900,14 +6907,6 @@ msgid "Open Godot online documentation." msgstr "Открыть онлайн-документацию Godot." #: editor/plugins/script_editor_plugin.cpp -msgid "Request Docs" -msgstr "Проблема" - -#: editor/plugins/script_editor_plugin.cpp -msgid "Help improve the Godot documentation by giving feedback." -msgstr "Помогите улучшить документацию Godot, оставьте сообщение об ошибке." - -#: editor/plugins/script_editor_plugin.cpp msgid "Search the reference documentation." msgstr "Поиск справочной документации." @@ -7344,6 +7343,11 @@ msgid "This operation requires a single selected node." msgstr "Эта операция требует одного выбранного узла." #: editor/plugins/spatial_editor_plugin.cpp +#, fuzzy +msgid "Auto Orthogonal Enabled" +msgstr "Ортогональный" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Lock View Rotation" msgstr "Блокировать вращение камеры" @@ -7432,6 +7436,10 @@ msgid "Freelook Slow Modifier" msgstr "Медленный модификатор свободного просмотра" #: editor/plugins/spatial_editor_plugin.cpp +msgid "View Rotation Locked" +msgstr "Блокировать вращение камеры" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." @@ -7441,10 +7449,6 @@ msgstr "" "игры." #: editor/plugins/spatial_editor_plugin.cpp -msgid "View Rotation Locked" -msgstr "Блокировать вращение камеры" - -#: editor/plugins/spatial_editor_plugin.cpp msgid "XForm Dialog" msgstr "XForm диалоговое окно" @@ -7662,7 +7666,7 @@ msgstr "Предпросмотр CollisionPolygon2D" #: editor/plugins/sprite_editor_plugin.cpp msgid "Create LightOccluder2D" -msgstr "Создан LightOccluder2D" +msgstr "Создать LightOccluder2D" #: editor/plugins/sprite_editor_plugin.cpp msgid "LightOccluder2D Preview" @@ -8436,14 +8440,12 @@ msgid "Edit Tile Z Index" msgstr "Редактирование Z индекса плитки" #: editor/plugins/tile_set_editor_plugin.cpp -#, fuzzy msgid "Make Convex" -msgstr "Сделать Convex" +msgstr "Сделать выпуклым" #: editor/plugins/tile_set_editor_plugin.cpp -#, fuzzy msgid "Make Concave" -msgstr "Сделать Concave" +msgstr "Сделать вогнутым" #: editor/plugins/tile_set_editor_plugin.cpp msgid "Create Collision Polygon" @@ -8708,9 +8710,8 @@ msgid "Dodge operator." msgstr "Оператор выцветания." #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "HardLight operator." -msgstr "Оператор жёсткого света." +msgstr "Оператор HardLight." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Lighten operator." @@ -9114,12 +9115,12 @@ msgstr "Изменить текстурную единицу" #: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy msgid "2D texture uniform lookup." -msgstr "Изменить текстурную единицу" +msgstr "Равномерный поиск 2D-текстур." #: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy msgid "2D texture uniform lookup with triplanar." -msgstr "Изменить текстурную единицу" +msgstr "Форменный поиск 2d текстуры с трипланаром." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Transform function." @@ -9229,9 +9230,8 @@ msgid "Linear interpolation between two vectors." msgstr "Линейная интерполяция между двумя векторами." #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Linear interpolation between two vectors using scalar." -msgstr "Линейная интерполяция между двумя векторами." +msgstr "Линейная интерполяция между двумя векторами с использованием скаляра." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Calculates the normalize product of vector." @@ -9352,17 +9352,16 @@ msgstr "" "направления обзора камеры (пропустите соответствующие входы к ней)." #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "" "Custom Godot Shader Language expression, which is placed on top of the " "resulted shader. You can place various function definitions inside and call " "it later in the Expressions. You can also declare varyings, uniforms and " "constants." msgstr "" -"Пользовательское выражение языка шейдеров Godot, которое помещается поверх " -"шейдера. Вы можете разместить внутри различные объявления функций и вызвать " -"их позже в Выражениях. Вы также можете объявить varyings, uniforms и " -"константы." +"Пользовательское выражение на языке шейдеров Godot, которое помещается " +"поверх шейдера. Вы можете разместить внутри различные объявления функций и " +"вызвать их позже в Выражениях. Вы также можете объявить переменные типа " +"varying, uniform и константы." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "(Fragment/Light mode only) Scalar derivative function." @@ -9637,35 +9636,30 @@ msgid "Export With Debug" msgstr "Экспорт в режиме отладки" #: editor/project_manager.cpp -#, fuzzy msgid "The path specified doesn't exist." -msgstr "Путь не существует." +msgstr "Указанный путь не существует." #: editor/project_manager.cpp -#, fuzzy msgid "Error opening package file (it's not in ZIP format)." -msgstr "Ошибка при открытии файла пакета, не в формате zip." +msgstr "Ошибка при открытии файла пакета (Не является ZIP форматом)." #: editor/project_manager.cpp -#, fuzzy msgid "" "Invalid \".zip\" project file; it doesn't contain a \"project.godot\" file." msgstr "" -"Недействительный '.zip' файл проекта, не содержит файл 'project.godot'." +"Недействительный \".zip\" файл проекта; не содержит файл \"project.godot\"." #: editor/project_manager.cpp msgid "Please choose an empty folder." msgstr "Пожалуйста, выберите пустую папку." #: editor/project_manager.cpp -#, fuzzy msgid "Please choose a \"project.godot\" or \".zip\" file." -msgstr "Пожалуйста, выберите файл 'project.godot' или '.zip'." +msgstr "Пожалуйста, выберите файл \"project.godot\" или \".zip\"." #: editor/project_manager.cpp -#, fuzzy msgid "This directory already contains a Godot project." -msgstr "Каталог уже содержит проект Godot." +msgstr "Этот каталог уже содержит проект Godot." #: editor/project_manager.cpp msgid "New Game Project" @@ -10362,9 +10356,8 @@ msgid "Suffix" msgstr "Суффикс" #: editor/rename_dialog.cpp -#, fuzzy msgid "Use Regular Expressions" -msgstr "Регулярное выражение" +msgstr "Использовать регулярные выражения" #: editor/rename_dialog.cpp msgid "Advanced Options" @@ -10446,14 +10439,12 @@ msgid "Keep" msgstr "Оставить оригинал" #: editor/rename_dialog.cpp -#, fuzzy msgid "PascalCase to snake_case" -msgstr "CamelCase в under_scored" +msgstr "ВерблюжийРегистр в змеиный_регистр" #: editor/rename_dialog.cpp -#, fuzzy msgid "snake_case to PascalCase" -msgstr "under_scored к CamelCase" +msgstr "змеиный_регистр в ВерблюжийРегистр" #: editor/rename_dialog.cpp msgid "Case" @@ -10472,9 +10463,8 @@ msgid "Reset" msgstr "Сбросить" #: editor/rename_dialog.cpp -#, fuzzy msgid "Regular Expression Error" -msgstr "Регулярное выражение" +msgstr "Ошибка в регулярном выражении" #: editor/rename_dialog.cpp #, fuzzy @@ -10947,7 +10937,7 @@ msgstr "Неверное имя или путь наследуемого пре #: editor/script_create_dialog.cpp #, fuzzy msgid "Script path/name is valid." -msgstr "Скрипт корректен." +msgstr "Путь/имя скрипта действителен." #: editor/script_create_dialog.cpp msgid "Allowed: a-z, A-Z, 0-9, _ and ." @@ -10970,6 +10960,12 @@ msgid "Script file already exists." msgstr "Файл скрипта уже существует." #: editor/script_create_dialog.cpp +msgid "" +"Note: Built-in scripts have some limitations and can't be edited using an " +"external editor." +msgstr "" + +#: editor/script_create_dialog.cpp msgid "Class Name:" msgstr "Имя класса:" @@ -12452,7 +12448,7 @@ msgstr "" #: scene/3d/collision_shape.cpp msgid "" "ConcavePolygonShape doesn't support RigidBody in another mode than static." -msgstr "" +msgstr "ConcavePolygonShape поддерживает RigidBody только в статичном режиме." #: scene/3d/cpu_particles.cpp msgid "Nothing is visible because no mesh has been assigned." @@ -12752,6 +12748,10 @@ msgstr "" "сделайте её целью рендеринга и назначьте её внутреннюю текстуру какому-либо " "узлу для отображения." +#: scene/main/viewport.cpp +msgid "Viewport size must be greater than 0 to render anything." +msgstr "" + #: scene/resources/visual_shader_nodes.cpp msgid "Invalid source for preview." msgstr "Неверный источник для предпросмотра." @@ -12780,6 +12780,15 @@ msgstr "Изменения могут быть назначены только msgid "Constants cannot be modified." msgstr "Константы не могут быть изменены." +#~ msgid "Issue Tracker" +#~ msgstr "Система отслеживания ошибок" + +#~ msgid "Request Docs" +#~ msgstr "Проблема" + +#~ msgid "Help improve the Godot documentation by giving feedback." +#~ msgstr "Помогите улучшить документацию Godot, оставьте сообщение об ошибке." + #~ msgid "Replaced %d occurrence(s)." #~ msgstr "Заменено %d совпадений." diff --git a/editor/translations/si.po b/editor/translations/si.po index 119818e11f..f46a3ca292 100644 --- a/editor/translations/si.po +++ b/editor/translations/si.po @@ -1428,7 +1428,7 @@ msgstr "" msgid "Remove Autoload" msgstr "" -#: editor/editor_autoload_settings.cpp +#: editor/editor_autoload_settings.cpp editor/editor_plugin_settings.cpp msgid "Enable" msgstr "" @@ -2832,7 +2832,11 @@ msgid "Q&A" msgstr "" #: editor/editor_node.cpp -msgid "Issue Tracker" +msgid "Report a Bug" +msgstr "" + +#: editor/editor_node.cpp +msgid "Send Docs Feedback" msgstr "" #: editor/editor_node.cpp editor/plugins/asset_library_editor_plugin.cpp @@ -3856,7 +3860,7 @@ msgid "Reimport" msgstr "" #: editor/import_dock.cpp -msgid "Save scenes, re-import and restart" +msgid "Save Scenes, Re-Import, and Restart" msgstr "" #: editor/import_dock.cpp @@ -6662,14 +6666,6 @@ msgid "Open Godot online documentation." msgstr "" #: editor/plugins/script_editor_plugin.cpp -msgid "Request Docs" -msgstr "" - -#: editor/plugins/script_editor_plugin.cpp -msgid "Help improve the Godot documentation by giving feedback." -msgstr "" - -#: editor/plugins/script_editor_plugin.cpp msgid "Search the reference documentation." msgstr "" @@ -7100,6 +7096,10 @@ msgid "This operation requires a single selected node." msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Auto Orthogonal Enabled" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Lock View Rotation" msgstr "" @@ -7188,13 +7188,13 @@ msgid "Freelook Slow Modifier" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "" -"Note: The FPS value displayed is the editor's framerate.\n" -"It cannot be used as a reliable indication of in-game performance." +msgid "View Rotation Locked" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "View Rotation Locked" +msgid "" +"Note: The FPS value displayed is the editor's framerate.\n" +"It cannot be used as a reliable indication of in-game performance." msgstr "" #: editor/plugins/spatial_editor_plugin.cpp @@ -10539,6 +10539,12 @@ msgid "Script file already exists." msgstr "" #: editor/script_create_dialog.cpp +msgid "" +"Note: Built-in scripts have some limitations and can't be edited using an " +"external editor." +msgstr "" + +#: editor/script_create_dialog.cpp msgid "Class Name:" msgstr "" @@ -12165,6 +12171,10 @@ msgid "" "texture to some node for display." msgstr "" +#: scene/main/viewport.cpp +msgid "Viewport size must be greater than 0 to render anything." +msgstr "" + #: scene/resources/visual_shader_nodes.cpp msgid "Invalid source for preview." msgstr "" diff --git a/editor/translations/sk.po b/editor/translations/sk.po index 50cf59efdc..d0fe10184e 100644 --- a/editor/translations/sk.po +++ b/editor/translations/sk.po @@ -5,15 +5,17 @@ # J08nY <johnenter@gmail.com>, 2016. # MineGame 159 <minegame459@gmail.com>, 2018. # Zuzana Palenikova <sousana.is@gmail.com>, 2019. -# MineGame159 <petulko08@gmail.com>, 2019. +# MineGame159 <petulko08@gmail.com>, 2019, 2020. # Michal <alladinsiffon@gmail.com>, 2019. # Richard <rgarlik@gmail.com>, 2019. +# Richard Urban <redasuio1@gmail.com>, 2020. +# anonymous <noreply@weblate.org>, 2020. msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2019-07-02 10:51+0000\n" -"Last-Translator: Richard <rgarlik@gmail.com>\n" +"PO-Revision-Date: 2020-04-16 11:03+0000\n" +"Last-Translator: Richard Urban <redasuio1@gmail.com>\n" "Language-Team: Slovak <https://hosted.weblate.org/projects/godot-engine/" "godot/sk/>\n" "Language: sk\n" @@ -21,7 +23,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" -"X-Generator: Weblate 3.8-dev\n" +"X-Generator: Weblate 4.0.1-dev\n" #: core/math/expression.cpp modules/gdscript/gdscript_functions.cpp #: modules/visual_script/visual_script_builtin_funcs.cpp @@ -30,7 +32,7 @@ msgstr "Chybný argument convert(), použite TYPE_* konštanty." #: core/math/expression.cpp modules/gdscript/gdscript_functions.cpp msgid "Expected a string of length 1 (a character)." -msgstr "" +msgstr "Očakávaná dĺžka stringu 1 (písmeno)." #: core/math/expression.cpp modules/gdscript/gdscript_functions.cpp #: modules/mono/glue/gd_glue.cpp @@ -40,12 +42,11 @@ msgstr "Nedostatok bajtov na dekódovanie, možný chybný formát." #: core/math/expression.cpp msgid "Invalid input %i (not passed) in expression" -msgstr "" +msgstr "Nesprávny vstup %i (chýba) vo výraze" #: core/math/expression.cpp -#, fuzzy msgid "self can't be used because instance is null (not passed)" -msgstr "self nemožno použiť lebo inštancia je rovná null (not passed)" +msgstr "self sa nedá použiť lebo inštancia je null (neprešiel)" #: core/math/expression.cpp msgid "Invalid operands to operator %s, %s and %s." @@ -69,31 +70,31 @@ msgstr "Pri volaní '%s':" #: core/ustring.cpp msgid "B" -msgstr "" +msgstr "B" #: core/ustring.cpp msgid "KiB" -msgstr "" +msgstr "KiB" #: core/ustring.cpp msgid "MiB" -msgstr "" +msgstr "MiB" #: core/ustring.cpp msgid "GiB" -msgstr "" +msgstr "GiB" #: core/ustring.cpp msgid "TiB" -msgstr "" +msgstr "TiB" #: core/ustring.cpp msgid "PiB" -msgstr "" +msgstr "PiB" #: core/ustring.cpp msgid "EiB" -msgstr "" +msgstr "EiB" #: editor/animation_bezier_editor.cpp msgid "Free" @@ -153,41 +154,35 @@ msgstr "Animácia zmeniť prechod" #: editor/animation_track_editor.cpp msgid "Anim Change Transform" -msgstr "" +msgstr "Zmeniť Veľkosť Animácie" #: editor/animation_track_editor.cpp msgid "Anim Change Keyframe Value" msgstr "Animácia Zmeniť Keyframe Hodnotu" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Anim Change Call" -msgstr "Animácia Zmeniť Hovor" +msgstr "Animácia zmenila Hovor" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Anim Multi Change Keyframe Time" -msgstr "Animácia Zmeniť Keyframe Čas" +msgstr "Animácia Zmeniť čas Keyframe-u" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Anim Multi Change Transition" -msgstr "Animácia zmeniť prechod" +msgstr "Zmeniť Transition Animácie" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Anim Multi Change Transform" -msgstr "Animácia zmeniť prechod" +msgstr "Animácia zmeniť Transform" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Anim Multi Change Keyframe Value" -msgstr "Animácia Zmeniť Keyframe Hodnotu" +msgstr "Animácia Zmeniť hodnotu Keyframe-u" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Anim Multi Change Call" -msgstr "Animácia Zmeniť Hovor" +msgstr "Animácia Zmenila Hovor" #: editor/animation_track_editor.cpp msgid "Change Animation Length" @@ -200,45 +195,43 @@ msgstr "Zmeniť Dĺžku Animácie" #: editor/animation_track_editor.cpp msgid "Property Track" -msgstr "" +msgstr "Property Track" #: editor/animation_track_editor.cpp msgid "3D Transform Track" -msgstr "" +msgstr "3D Transform Track" #: editor/animation_track_editor.cpp msgid "Call Method Track" -msgstr "" +msgstr "Call Method Track" #: editor/animation_track_editor.cpp msgid "Bezier Curve Track" -msgstr "" +msgstr "Krivka Bezier Track" #: editor/animation_track_editor.cpp msgid "Audio Playback Track" -msgstr "" +msgstr "Audio Playback Track" #: editor/animation_track_editor.cpp msgid "Animation Playback Track" -msgstr "" +msgstr "Playback Track Animácie" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Animation length (frames)" msgstr "Dĺžka Času Animácie (v sekundách)" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Animation length (seconds)" msgstr "Dĺžka Času Animácie (v sekundách)" #: editor/animation_track_editor.cpp msgid "Add Track" -msgstr "" +msgstr "Pridať Track" #: editor/animation_track_editor.cpp msgid "Animation Looping" -msgstr "" +msgstr "Opakovanie Animácie" #: editor/animation_track_editor.cpp #: modules/visual_script/visual_script_editor.cpp @@ -255,15 +248,15 @@ msgstr "Klipy Animácie:" #: editor/animation_track_editor.cpp msgid "Change Track Path" -msgstr "" +msgstr "Zmeniť cestu Tracku" #: editor/animation_track_editor.cpp msgid "Toggle this track on/off." -msgstr "" +msgstr "Zapnúť/Vypnúť tento track." #: editor/animation_track_editor.cpp msgid "Update Mode (How this property is set)" -msgstr "" +msgstr "Update Mode (ako je nastavená táto možnosť)" #: editor/animation_track_editor.cpp msgid "Interpolation Mode" @@ -271,12 +264,11 @@ msgstr "Režim Interpolácie" #: editor/animation_track_editor.cpp msgid "Loop Wrap Mode (Interpolate end with beginning on loop)" -msgstr "" +msgstr "Loop Wrap Mode (interpoluje koniec zo začiatkom opakovania)" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Remove this track." -msgstr "Všetky vybrané" +msgstr "Vymazať tento track." #: editor/animation_track_editor.cpp msgid "Time (s): " @@ -284,7 +276,7 @@ msgstr "Čas (s): " #: editor/animation_track_editor.cpp msgid "Toggle Track Enabled" -msgstr "" +msgstr "Zmena Tracku Povolená" #: editor/animation_track_editor.cpp msgid "Continuous" @@ -317,11 +309,11 @@ msgstr "Kubický" #: editor/animation_track_editor.cpp msgid "Clamp Loop Interp" -msgstr "" +msgstr "Clamp Loop Interp" #: editor/animation_track_editor.cpp msgid "Wrap Loop Interp" -msgstr "" +msgstr "Wrap Loop Interp" #: editor/animation_track_editor.cpp #: editor/plugins/canvas_item_editor_plugin.cpp @@ -329,38 +321,36 @@ msgid "Insert Key" msgstr "Vložiť Kľúč" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Duplicate Key(s)" -msgstr "Duplikovať výber" +msgstr "Duplikovanie Kľúčov" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Delete Key(s)" -msgstr "Všetky vybrané" +msgstr "Vymazanie kľúča(ov)" #: editor/animation_track_editor.cpp msgid "Change Animation Update Mode" -msgstr "" +msgstr "Zmeniť Update Mode Animácie" #: editor/animation_track_editor.cpp msgid "Change Animation Interpolation Mode" -msgstr "" +msgstr "Zmeniť Interpolacný Mód Animácie" #: editor/animation_track_editor.cpp msgid "Change Animation Loop Mode" -msgstr "" +msgstr "Zmeniť Loop Mode Animacie" #: editor/animation_track_editor.cpp msgid "Remove Anim Track" -msgstr "" +msgstr "Vymazať Track Animácie" #: editor/animation_track_editor.cpp msgid "Create NEW track for %s and insert key?" -msgstr "" +msgstr "Vytvoriť NOVÝ track za %s a vložiť kľúč?" #: editor/animation_track_editor.cpp msgid "Create %d NEW tracks and insert keys?" -msgstr "" +msgstr "Vytvoriť %d NOVÉ track-y a vložiť kľúče?" #: editor/animation_track_editor.cpp editor/create_dialog.cpp #: editor/editor_audio_buses.cpp editor/editor_feature_profile.cpp @@ -388,25 +378,23 @@ msgstr "Animácia Vytvoriť & Vložiť" #: editor/animation_track_editor.cpp msgid "Anim Insert Track & Key" -msgstr "" +msgstr "Anim Vložiť Track & kľúč" #: editor/animation_track_editor.cpp msgid "Anim Insert Key" msgstr "Animácia Vložiť Kľúč" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Change Animation Step" -msgstr "Animácia zmeniť prechod" +msgstr "Zmeniť krok Animácie" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Rearrange Tracks" -msgstr "Vložiť" +msgstr "Preskupiť Track-y" #: editor/animation_track_editor.cpp msgid "Transform tracks only apply to Spatial-based nodes." -msgstr "" +msgstr "Transformovať track-y a aplikovať do Spatial-based node-ov." #: editor/animation_track_editor.cpp msgid "" @@ -422,73 +410,72 @@ msgstr "" #: editor/animation_track_editor.cpp msgid "Animation tracks can only point to AnimationPlayer nodes." -msgstr "" +msgstr "Track-y Animácií môžu ukazovať iba na node-y AnimationPlayer." #: editor/animation_track_editor.cpp msgid "An animation player can't animate itself, only other players." -msgstr "" +msgstr "Animation player sa nemôže naanimovať sám, iba ostatné player-y." #: editor/animation_track_editor.cpp msgid "Not possible to add a new track without a root" -msgstr "" +msgstr "Není možné pridať nový track bez root-u" #: editor/animation_track_editor.cpp msgid "Invalid track for Bezier (no suitable sub-properties)" -msgstr "" +msgstr "Neplatný track pre Bezier (niesu vhodné sub-properties)" #: editor/animation_track_editor.cpp msgid "Add Bezier Track" -msgstr "" +msgstr "Pridať Bezier Track" #: editor/animation_track_editor.cpp msgid "Track path is invalid, so can't add a key." -msgstr "" +msgstr "Cesta Track-u je neplatná, takže sa nedá pridať kľúč." #: editor/animation_track_editor.cpp msgid "Track is not of type Spatial, can't insert key" -msgstr "" +msgstr "Track není typ Spatial, nedá sa vložiť kľúč" #: editor/animation_track_editor.cpp msgid "Add Transform Track Key" -msgstr "" +msgstr "Pridať Transform Track Key" #: editor/animation_track_editor.cpp msgid "Add Track Key" -msgstr "" +msgstr "Pridať Track Key" #: editor/animation_track_editor.cpp msgid "Track path is invalid, so can't add a method key." -msgstr "" +msgstr "Cesta track-u je neplatná, takže sa nedá pridať do method key." #: editor/animation_track_editor.cpp msgid "Add Method Track Key" -msgstr "" +msgstr "Pridať Method Track Key" #: editor/animation_track_editor.cpp msgid "Method not found in object: " -msgstr "" +msgstr "Metóda nebola nájdená v objekte: " #: editor/animation_track_editor.cpp msgid "Anim Move Keys" -msgstr "" +msgstr "Pohybové kľúče Animácie" #: editor/animation_track_editor.cpp msgid "Clipboard is empty" -msgstr "" +msgstr "Schránka je prázdna" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Paste Tracks" -msgstr "Vložiť" +msgstr "Vložiť Track-y" #: editor/animation_track_editor.cpp msgid "Anim Scale Keys" -msgstr "" +msgstr "Scale keys Animácie" #: editor/animation_track_editor.cpp msgid "" "This option does not work for Bezier editing, as it's only a single track." -msgstr "" +msgstr "Táto možnosť nefunguje pre Bezier editovanie, lebo je to jeden track." #: editor/animation_track_editor.cpp msgid "" @@ -502,38 +489,47 @@ msgid "" "Alternatively, use an import preset that imports animations to separate " "files." msgstr "" +"Táto Animácia patrí importovanej scéne, takže zmeny pre importované track-y " +"nebudú uložené.\n" +" \n" +"Na povolenie abilite pridať vlastné track-y, prejdite na nastavenia importu " +"scén a nastavte\n" +"\" Animation > Storage\" na \"Files\", povolte \"Animation > Keep Custom " +"Tracks\", a potom re-import.\n" +"Alternatívne, použite import preset ktorý importuje animácie pre oddelenie " +"file-ov." #: editor/animation_track_editor.cpp msgid "Warning: Editing imported animation" -msgstr "" +msgstr "Upozornenie: Editovanie importovaných animácií" #: editor/animation_track_editor.cpp msgid "Select an AnimationPlayer node to create and edit animations." -msgstr "" +msgstr "Označte AnimationPlayer node aby ste vytvorili a upravili animácie." #: editor/animation_track_editor.cpp msgid "Only show tracks from nodes selected in tree." -msgstr "" +msgstr "Iba show track-y z node-ov označené v strome." #: editor/animation_track_editor.cpp msgid "Group tracks by node or display them as plain list." -msgstr "" +msgstr "Zoskupte track-y pomocou node-u alebo ich zobrazte ako plain list." #: editor/animation_track_editor.cpp msgid "Snap:" -msgstr "" +msgstr "Snap:" #: editor/animation_track_editor.cpp msgid "Animation step value." -msgstr "" +msgstr "Hodnota kroku Animácie." #: editor/animation_track_editor.cpp msgid "Seconds" -msgstr "" +msgstr "Sekundy" #: editor/animation_track_editor.cpp msgid "FPS" -msgstr "" +msgstr "FPS" #: editor/animation_track_editor.cpp editor/editor_properties.cpp #: editor/plugins/polygon_2d_editor_plugin.cpp @@ -543,15 +539,15 @@ msgstr "" #: editor/project_settings_editor.cpp editor/property_editor.cpp #: modules/visual_script/visual_script_editor.cpp msgid "Edit" -msgstr "" +msgstr "Edit" #: editor/animation_track_editor.cpp msgid "Animation properties." -msgstr "" +msgstr "Vlastnosti Animácie." #: editor/animation_track_editor.cpp msgid "Copy Tracks" -msgstr "" +msgstr "Kopírovať track-y" #: editor/animation_track_editor.cpp msgid "Scale Selection" @@ -567,87 +563,83 @@ msgstr "Duplikovať výber" #: editor/animation_track_editor.cpp msgid "Duplicate Transposed" -msgstr "" +msgstr "Duplikovanie transponovaných" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Delete Selection" -msgstr "Všetky vybrané" +msgstr "Vymazať výber" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Go to Next Step" msgstr "Prejsť na ďalší krok" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Go to Previous Step" msgstr "Prejsť na predchádzajúci krok" #: editor/animation_track_editor.cpp msgid "Optimize Animation" -msgstr "" +msgstr "Optimalizácia Animacie" #: editor/animation_track_editor.cpp msgid "Clean-Up Animation" -msgstr "" +msgstr "Vyčistenie Animácie" #: editor/animation_track_editor.cpp msgid "Pick the node that will be animated:" -msgstr "" +msgstr "Vyberte node ktorý bude animovaný:" #: editor/animation_track_editor.cpp msgid "Use Bezier Curves" -msgstr "" +msgstr "Použiť Bezier Curves" #: editor/animation_track_editor.cpp msgid "Anim. Optimizer" -msgstr "" +msgstr "Optimalizér Animácií" #: editor/animation_track_editor.cpp msgid "Max. Linear Error:" -msgstr "" +msgstr "Max. Linear Error:" #: editor/animation_track_editor.cpp msgid "Max. Angular Error:" -msgstr "" +msgstr "Max. Angular Error:" #: editor/animation_track_editor.cpp msgid "Max Optimizable Angle:" -msgstr "" +msgstr "Maximálny Optimalizovatelný Uhol:" #: editor/animation_track_editor.cpp msgid "Optimize" -msgstr "" +msgstr "Optimalizácia" #: editor/animation_track_editor.cpp msgid "Remove invalid keys" -msgstr "" +msgstr "Vymazať neplatné kľúče" #: editor/animation_track_editor.cpp msgid "Remove unresolved and empty tracks" -msgstr "" +msgstr "Vymazať nevyriešené a prázdne track-y" #: editor/animation_track_editor.cpp msgid "Clean-up all animations" -msgstr "" +msgstr "Vyčistiť všetky animácie" #: editor/animation_track_editor.cpp msgid "Clean-Up Animation(s) (NO UNDO!)" -msgstr "" +msgstr "Vyčistenie Animácií (NIEJE KROK SPÄŤ!)" #: editor/animation_track_editor.cpp msgid "Clean-Up" -msgstr "" +msgstr "Vyčistenie" #: editor/animation_track_editor.cpp msgid "Scale Ratio:" -msgstr "" +msgstr "Pomer mierky:" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Select Tracks to Copy" -msgstr "Nastaviť prechody na:" +msgstr "Vybrať Track-y na skopírovanie" #: editor/animation_track_editor.cpp editor/editor_log.cpp #: editor/editor_properties.cpp @@ -659,136 +651,133 @@ msgid "Copy" msgstr "Kopírovať" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Select All/None" -msgstr "Všetky vybrané" +msgstr "Vybrať všetko/nič" #: editor/animation_track_editor_plugins.cpp msgid "Add Audio Track Clip" -msgstr "" +msgstr "Pridať Audio Track Clip" #: editor/animation_track_editor_plugins.cpp msgid "Change Audio Track Clip Start Offset" -msgstr "" +msgstr "Zmeniť Audio Track Clip spustiť Offset" #: editor/animation_track_editor_plugins.cpp msgid "Change Audio Track Clip End Offset" -msgstr "" +msgstr "Zmeniť Audio Track Clip koniec Offset-u" #: editor/array_property_edit.cpp msgid "Resize Array" -msgstr "" +msgstr "Zmeniť veľkosť Array-u" #: editor/array_property_edit.cpp msgid "Change Array Value Type" -msgstr "" +msgstr "Zmeniť hodnotu Array-u" #: editor/array_property_edit.cpp msgid "Change Array Value" -msgstr "" +msgstr "Zmeniť hodnotu Array-u" #: editor/code_editor.cpp msgid "Go to Line" -msgstr "" +msgstr "Choďte na Líniu" #: editor/code_editor.cpp msgid "Line Number:" -msgstr "" +msgstr "Číslo línie:" #: editor/code_editor.cpp msgid "%d replaced." -msgstr "" +msgstr "%d náhradené." #: editor/code_editor.cpp editor/editor_help.cpp msgid "%d match." -msgstr "" +msgstr "%d sa zhoduje." #: editor/code_editor.cpp editor/editor_help.cpp -#, fuzzy msgid "%d matches." -msgstr "Zhody:" +msgstr "%d zhody." #: editor/code_editor.cpp editor/find_in_files.cpp msgid "Match Case" -msgstr "" +msgstr "Match Case" #: editor/code_editor.cpp editor/find_in_files.cpp msgid "Whole Words" -msgstr "" +msgstr "Celé slová" #: editor/code_editor.cpp editor/rename_dialog.cpp msgid "Replace" -msgstr "" +msgstr "Nahradiť" #: editor/code_editor.cpp msgid "Replace All" -msgstr "" +msgstr "Nahradiť Všetko" #: editor/code_editor.cpp msgid "Selection Only" -msgstr "" +msgstr "Iba Výber" #: editor/code_editor.cpp editor/plugins/script_text_editor.cpp #: editor/plugins/text_editor.cpp msgid "Standard" -msgstr "" +msgstr "Štandard" #: editor/code_editor.cpp editor/plugins/script_editor_plugin.cpp msgid "Toggle Scripts Panel" -msgstr "" +msgstr "Vypnúť Panel Script-ov" #: editor/code_editor.cpp editor/plugins/canvas_item_editor_plugin.cpp #: editor/plugins/texture_region_editor_plugin.cpp #: editor/plugins/tile_set_editor_plugin.cpp scene/gui/graph_edit.cpp msgid "Zoom In" -msgstr "" +msgstr "Priblížiť" #: editor/code_editor.cpp editor/plugins/canvas_item_editor_plugin.cpp #: editor/plugins/texture_region_editor_plugin.cpp #: editor/plugins/tile_set_editor_plugin.cpp scene/gui/graph_edit.cpp msgid "Zoom Out" -msgstr "" +msgstr "Oddialiť" #: editor/code_editor.cpp msgid "Reset Zoom" -msgstr "" +msgstr "Resetovať priblíženie" #: editor/code_editor.cpp msgid "Warnings" -msgstr "" +msgstr "Varovania" #: editor/code_editor.cpp msgid "Line and column numbers." -msgstr "" +msgstr "Čísla riadkov a stĺpcov." #: editor/connections_dialog.cpp msgid "Method in target node must be specified." -msgstr "" +msgstr "Metóda v target node-e musí byť špecifikovaná." #: editor/connections_dialog.cpp msgid "" "Target method not found. Specify a valid method or attach a script to the " "target node." msgstr "" +"Metóda Target sa nenašla. Špecifikujte platnú metódu alebo pripojte script k " +"target node-u." #: editor/connections_dialog.cpp -#, fuzzy msgid "Connect to Node:" -msgstr "Pripojiť k Node:" +msgstr "Pripojiť k Node-u:" #: editor/connections_dialog.cpp -#, fuzzy msgid "Connect to Script:" -msgstr "Pripojiť k Node:" +msgstr "Pripojiť k Scriptu:" #: editor/connections_dialog.cpp -#, fuzzy msgid "From Signal:" -msgstr "Signály:" +msgstr "Zo Signálu:" #: editor/connections_dialog.cpp msgid "Scene does not contain any script." -msgstr "" +msgstr "Scéna neobsahuje žiadny script." #: editor/connections_dialog.cpp editor/editor_autoload_settings.cpp #: editor/groups_editor.cpp editor/plugins/item_list_editor_plugin.cpp @@ -809,43 +798,40 @@ msgstr "Odstrániť" #: editor/connections_dialog.cpp msgid "Add Extra Call Argument:" -msgstr "" +msgstr "Pridajte Extra Call Argument:" #: editor/connections_dialog.cpp msgid "Extra Call Arguments:" -msgstr "" +msgstr "Extra Call Argumenty:" #: editor/connections_dialog.cpp -#, fuzzy msgid "Receiver Method:" -msgstr "Filter:" +msgstr "Metóda Prijímača:" #: editor/connections_dialog.cpp -#, fuzzy msgid "Advanced" -msgstr "Vyvážený" +msgstr "Pokročilé" #: editor/connections_dialog.cpp msgid "Deferred" -msgstr "" +msgstr "Odložené" #: editor/connections_dialog.cpp msgid "" "Defers the signal, storing it in a queue and only firing it at idle time." -msgstr "" +msgstr "Odloží signál, uloží ho do queue a vystrelí ho iba cez idle time." #: editor/connections_dialog.cpp msgid "Oneshot" -msgstr "" +msgstr "Oneshot" #: editor/connections_dialog.cpp msgid "Disconnects the signal after its first emission." -msgstr "" +msgstr "Odpojí signál po jeho prvej emisii." #: editor/connections_dialog.cpp -#, fuzzy msgid "Cannot connect signal" -msgstr "Pripojiť Signál: " +msgstr "Nedá sa pripojiť signál" #: editor/connections_dialog.cpp editor/dependency_editor.cpp #: editor/export_template_manager.cpp editor/groups_editor.cpp @@ -867,9 +853,8 @@ msgid "Connect" msgstr "Pripojiť" #: editor/connections_dialog.cpp -#, fuzzy msgid "Signal:" -msgstr "Signály:" +msgstr "Signál:" #: editor/connections_dialog.cpp msgid "Connect '%s' to '%s'" @@ -893,14 +878,12 @@ msgid "Disconnect" msgstr "Odpojiť" #: editor/connections_dialog.cpp -#, fuzzy msgid "Connect a Signal to a Method" -msgstr "Pripojiť Signál: " +msgstr "Pripojiť Signál k Metóde" #: editor/connections_dialog.cpp -#, fuzzy msgid "Edit Connection:" -msgstr "Upraviť Pripojenie: " +msgstr "Upraviť Pripojenie:" #: editor/connections_dialog.cpp msgid "Are you sure you want to remove all connections from the \"%s\" signal?" @@ -976,22 +959,20 @@ msgid "Dependencies For:" msgstr "Závislosti pre:" #: editor/dependency_editor.cpp -#, fuzzy msgid "" "Scene '%s' is currently being edited.\n" "Changes will only take effect when reloaded." msgstr "" "Scéna '%s' sa práve upravuje.\n" -"Zmeny sa neprejavia, pokiaľ znovu načítané." +"Zmeny sa prejavia iba keď sa znovu načítajú." #: editor/dependency_editor.cpp -#, fuzzy msgid "" "Resource '%s' is in use.\n" "Changes will only take effect when reloaded." msgstr "" "Scéna '%s' sa práve upravuje.\n" -"Zmeny sa neprejavia, pokiaľ znovu načítané." +"Zmeny sa prejavia iba keď sa znovu načítajú." #: editor/dependency_editor.cpp #: modules/gdnative/gdnative_library_editor_plugin.cpp @@ -1038,7 +1019,6 @@ msgid "Owners Of:" msgstr "Majitelia:" #: editor/dependency_editor.cpp -#, fuzzy msgid "Remove selected files from the project? (Can't be restored)" msgstr "Odstrániť vybraté súbory z projektu? (nedá sa vrátiť späť)" @@ -1084,13 +1064,12 @@ msgid "Permanently delete %d item(s)? (No undo!)" msgstr "Natrvalo odstrániť %d položky? (Nedá sa vrátiť späť!)" #: editor/dependency_editor.cpp -#, fuzzy msgid "Show Dependencies" -msgstr "Závislostí" +msgstr "Zobraziť Závislosťi" #: editor/dependency_editor.cpp msgid "Orphan Resource Explorer" -msgstr "" +msgstr "Orphan Resource Explorer" #: editor/dependency_editor.cpp editor/editor_audio_buses.cpp #: editor/editor_file_dialog.cpp editor/editor_node.cpp @@ -1177,7 +1156,6 @@ msgid "License" msgstr "Licencia" #: editor/editor_about.cpp -#, fuzzy msgid "Third-party Licenses" msgstr "Thirdparty Licencie" @@ -1188,13 +1166,16 @@ msgid "" "is an exhaustive list of all such third-party components with their " "respective copyright statements and license terms." msgstr "" +"Godot Engine sa spolieha na množstvo bezplatných a otvorených knižníc " +"tretích strán, ktoré sú kompatibilné s podmienkami licencie MIT. Nasleduje " +"vyčerpávajúci zoznam všetkých takýchto komponentov tretích strán s ich " +"príslušnými prehláseniami o autorských právach a licenčnými podmienkami." #: editor/editor_about.cpp msgid "All Components" msgstr "Všetky Komponenty" #: editor/editor_about.cpp -#, fuzzy msgid "Components" msgstr "Komponenty" @@ -1203,26 +1184,24 @@ msgid "Licenses" msgstr "Licencie" #: editor/editor_asset_installer.cpp editor/project_manager.cpp -#, fuzzy msgid "Error opening package file, not in ZIP format." msgstr "Chyba pri otváraní súboru balíka, nie je vo formáte zip." #: editor/editor_asset_installer.cpp msgid "%s (Already Exists)" -msgstr "" +msgstr "%s (Už Existuje)" #: editor/editor_asset_installer.cpp msgid "Uncompressing Assets" -msgstr "" +msgstr "Dekompresia Prostriedkov" #: editor/editor_asset_installer.cpp editor/project_manager.cpp msgid "The following files failed extraction from package:" -msgstr "" +msgstr "Nasledovné súbory sa nepodarilo extrahovať z balíka:" #: editor/editor_asset_installer.cpp -#, fuzzy msgid "And %s more files." -msgstr "Vytvoriť adresár" +msgstr "A %s viac súborov." #: editor/editor_asset_installer.cpp editor/project_manager.cpp msgid "Package installed successfully!" @@ -1234,9 +1213,8 @@ msgid "Success!" msgstr "Úspech!" #: editor/editor_asset_installer.cpp -#, fuzzy msgid "Package Contents:" -msgstr "Konštanty:" +msgstr "Balíček Obsahu:" #: editor/editor_asset_installer.cpp editor/editor_node.cpp msgid "Install" @@ -1255,46 +1233,44 @@ msgid "Add Effect" msgstr "Pridať Efekt" #: editor/editor_audio_buses.cpp -#, fuzzy msgid "Rename Audio Bus" -msgstr "Všetky vybrané" +msgstr "Premenovať Audio Bus" #: editor/editor_audio_buses.cpp -#, fuzzy msgid "Change Audio Bus Volume" -msgstr "Všetky vybrané" +msgstr "Zmeniť hlasitosť Audio Bus-u" #: editor/editor_audio_buses.cpp msgid "Toggle Audio Bus Solo" -msgstr "" +msgstr "Prepnúť Audio Bus Solo" #: editor/editor_audio_buses.cpp msgid "Toggle Audio Bus Mute" -msgstr "" +msgstr "Prepnúť Audio Bus Mute" #: editor/editor_audio_buses.cpp msgid "Toggle Audio Bus Bypass Effects" -msgstr "" +msgstr "Prepnúť Audio Bus Bypass Effects" #: editor/editor_audio_buses.cpp msgid "Select Audio Bus Send" -msgstr "" +msgstr "Vybrať Audio Bus Send" #: editor/editor_audio_buses.cpp msgid "Add Audio Bus Effect" -msgstr "" +msgstr "Pridať Audio Bus Effect" #: editor/editor_audio_buses.cpp msgid "Move Bus Effect" -msgstr "" +msgstr "Posunúť Bus Effect" #: editor/editor_audio_buses.cpp msgid "Delete Bus Effect" -msgstr "" +msgstr "Vymazať Bus Effect" #: editor/editor_audio_buses.cpp msgid "Drag & drop to rearrange." -msgstr "" +msgstr "Zoberte a položte(drag & drop) pre rearandžovanie." #: editor/editor_audio_buses.cpp msgid "Solo" @@ -1310,7 +1286,7 @@ msgstr "Obísť" #: editor/editor_audio_buses.cpp msgid "Bus options" -msgstr "" +msgstr "Možnosti pre Bus" #: editor/editor_audio_buses.cpp editor/filesystem_dock.cpp #: editor/plugins/animation_player_editor_plugin.cpp editor/scene_tree_dock.cpp @@ -1331,64 +1307,63 @@ msgstr "Audio" #: editor/editor_audio_buses.cpp msgid "Add Audio Bus" -msgstr "" +msgstr "Pridať Audio Bus" #: editor/editor_audio_buses.cpp msgid "Master bus can't be deleted!" -msgstr "" +msgstr "Master bus nemôžete vymazať!" #: editor/editor_audio_buses.cpp msgid "Delete Audio Bus" -msgstr "" +msgstr "Vymazať Audio Bus" #: editor/editor_audio_buses.cpp msgid "Duplicate Audio Bus" -msgstr "" +msgstr "Duplikovať Audio Bus" #: editor/editor_audio_buses.cpp msgid "Reset Bus Volume" -msgstr "" +msgstr "Resetovať hlasitosť Bus-u" #: editor/editor_audio_buses.cpp msgid "Move Audio Bus" -msgstr "" +msgstr "Presunúť Audio Bus" #: editor/editor_audio_buses.cpp msgid "Save Audio Bus Layout As..." -msgstr "" +msgstr "Uložiť Audio Bus Layaut Ako..." #: editor/editor_audio_buses.cpp msgid "Location for New Layout..." -msgstr "" +msgstr "Lokácia pre Nový Layout..." #: editor/editor_audio_buses.cpp msgid "Open Audio Bus Layout" -msgstr "" +msgstr "Otvoriť Audio Bus Layout" #: editor/editor_audio_buses.cpp msgid "There is no '%s' file." -msgstr "" +msgstr "Není tu žiadny '%s' súbor." #: editor/editor_audio_buses.cpp editor/plugins/canvas_item_editor_plugin.cpp msgid "Layout" -msgstr "" +msgstr "Layout" #: editor/editor_audio_buses.cpp msgid "Invalid file, not an audio bus layout." -msgstr "" +msgstr "Neplatný súbor, není audio bus layout." #: editor/editor_audio_buses.cpp -#, fuzzy msgid "Error saving file: %s" -msgstr "Chyba pri načítaní:" +msgstr "Chyba uloženia súbora: %s" #: editor/editor_audio_buses.cpp msgid "Add Bus" -msgstr "" +msgstr "Pridať Bus" #: editor/editor_audio_buses.cpp msgid "Add a new Audio Bus to this layout." -msgstr "" +msgstr "Pridať nový Audio Bus do tohoto layout-u." #: editor/editor_audio_buses.cpp editor/editor_properties.cpp #: editor/plugins/animation_player_editor_plugin.cpp editor/property_editor.cpp @@ -1397,9 +1372,8 @@ msgid "Load" msgstr "Načítať" #: editor/editor_audio_buses.cpp -#, fuzzy msgid "Load an existing Bus Layout." -msgstr "Popis:" +msgstr "Načítať existujúci Bus Layout." #: editor/editor_audio_buses.cpp msgid "Save As" @@ -1407,7 +1381,7 @@ msgstr "Uložiť Ako" #: editor/editor_audio_buses.cpp msgid "Save this Bus Layout to a file." -msgstr "" +msgstr "Uložiť tento Bus Layout do súboru." #: editor/editor_audio_buses.cpp editor/import_dock.cpp msgid "Load Default" @@ -1415,11 +1389,11 @@ msgstr "Načítať predvolené" #: editor/editor_audio_buses.cpp msgid "Load the default Bus Layout." -msgstr "" +msgstr "Načítať základný Bus Layout." #: editor/editor_audio_buses.cpp msgid "Create a new Bus Layout." -msgstr "" +msgstr "Vytvoriť nový Bus Layout." #: editor/editor_autoload_settings.cpp msgid "Invalid name." @@ -1427,68 +1401,67 @@ msgstr "Neplatný Názov." #: editor/editor_autoload_settings.cpp msgid "Valid characters:" -msgstr "" +msgstr "Platné písmená:" #: editor/editor_autoload_settings.cpp msgid "Must not collide with an existing engine class name." -msgstr "" +msgstr "Nesmie kolidovať(collide) s existujúcim názvom engine class-u." #: editor/editor_autoload_settings.cpp msgid "Must not collide with an existing built-in type name." -msgstr "" +msgstr "Nesmie kolidovať(collide) s existujúcim menom pre built-in-type." #: editor/editor_autoload_settings.cpp msgid "Must not collide with an existing global constant name." -msgstr "" +msgstr "Nesmie kolidovať s existujúcim menom pre global constant." #: editor/editor_autoload_settings.cpp msgid "Keyword cannot be used as an autoload name." -msgstr "" +msgstr "Kľúčové slovo nemožno použiť ako AutoLoad názvu." #: editor/editor_autoload_settings.cpp msgid "Autoload '%s' already exists!" -msgstr "" +msgstr "AutoLoad '%s' už existujuje!" #: editor/editor_autoload_settings.cpp msgid "Rename Autoload" -msgstr "" +msgstr "Premenovať AutoLoad" #: editor/editor_autoload_settings.cpp msgid "Toggle AutoLoad Globals" -msgstr "" +msgstr "Prepnúť globálne AutoLoad-y" #: editor/editor_autoload_settings.cpp msgid "Move Autoload" -msgstr "" +msgstr "Presunúť AutoLoad-y" #: editor/editor_autoload_settings.cpp msgid "Remove Autoload" -msgstr "" +msgstr "Vymazať AutoLoad" -#: editor/editor_autoload_settings.cpp +#: editor/editor_autoload_settings.cpp editor/editor_plugin_settings.cpp msgid "Enable" -msgstr "" +msgstr "Povoliť" #: editor/editor_autoload_settings.cpp msgid "Rearrange Autoloads" -msgstr "" +msgstr "Rearandžovať AutoLoad-y" #: editor/editor_autoload_settings.cpp editor/script_create_dialog.cpp -#, fuzzy msgid "Invalid path." -msgstr "Neplatný Názov." +msgstr "Neplatná cesta." #: editor/editor_autoload_settings.cpp editor/script_create_dialog.cpp msgid "File does not exist." -msgstr "" +msgstr "Súbor neexistuje." #: editor/editor_autoload_settings.cpp msgid "Not in resource path." -msgstr "" +msgstr "Nieje v resource path." #: editor/editor_autoload_settings.cpp msgid "Add AutoLoad" -msgstr "" +msgstr "Pridať AutoLoad" #: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp #: editor/editor_plugin_settings.cpp @@ -1499,49 +1472,49 @@ msgstr "Cesta:" #: editor/editor_autoload_settings.cpp msgid "Node Name:" -msgstr "" +msgstr "Meno Node-u:" #: editor/editor_autoload_settings.cpp editor/editor_help_search.cpp #: editor/editor_profiler.cpp editor/project_manager.cpp #: editor/settings_config_dialog.cpp msgid "Name" -msgstr "" +msgstr "Meno" #: editor/editor_autoload_settings.cpp msgid "Singleton" -msgstr "" +msgstr "Singleton" #: editor/editor_data.cpp editor/inspector_dock.cpp msgid "Paste Params" -msgstr "" +msgstr "Vložiť Params" #: editor/editor_data.cpp msgid "Updating Scene" -msgstr "" +msgstr "Aktualizovať Scénu" #: editor/editor_data.cpp msgid "Storing local changes..." -msgstr "" +msgstr "Ukladanie lokálnych zmien..." #: editor/editor_data.cpp msgid "Updating scene..." -msgstr "" +msgstr "Aktualizovanie scény..." #: editor/editor_data.cpp editor/editor_properties.cpp msgid "[empty]" -msgstr "" +msgstr "[Prázdne]" #: editor/editor_data.cpp msgid "[unsaved]" -msgstr "" +msgstr "[Neuložené]" #: editor/editor_dir_dialog.cpp msgid "Please select a base directory first." -msgstr "" +msgstr "Najprv vyberte základný adresár." #: editor/editor_dir_dialog.cpp msgid "Choose a Directory" -msgstr "" +msgstr "Vyberte adresár" #: editor/editor_dir_dialog.cpp editor/editor_file_dialog.cpp #: editor/filesystem_dock.cpp editor/project_manager.cpp @@ -1559,35 +1532,39 @@ msgstr "Meno:" #: editor/editor_dir_dialog.cpp editor/editor_file_dialog.cpp #: editor/filesystem_dock.cpp scene/gui/file_dialog.cpp msgid "Could not create folder." -msgstr "" +msgstr "Priečinok sa nepodarilo vytvoriť." #: editor/editor_dir_dialog.cpp msgid "Choose" -msgstr "" +msgstr "Vyberte" #: editor/editor_export.cpp msgid "Storing File:" -msgstr "" +msgstr "Ukladanie súboru:" #: editor/editor_export.cpp msgid "No export template found at the expected path:" -msgstr "" +msgstr "Na očakávanej ceste sa nenašla žiadna exportná cesta:" #: editor/editor_export.cpp msgid "Packing" -msgstr "" +msgstr "Zabalovanie" #: editor/editor_export.cpp msgid "" "Target platform requires 'ETC' texture compression for GLES2. Enable 'Import " "Etc' in Project Settings." msgstr "" +"Target platforma potrebuje 'ETC' kompresor textúr pre GLES2. Povoliť 'Import " +"Etc' v Nastaveniach Projektu." #: editor/editor_export.cpp msgid "" "Target platform requires 'ETC2' texture compression for GLES3. Enable " "'Import Etc 2' in Project Settings." msgstr "" +"Target platforma potrebuje 'ETC2' kompresor textúr pre GLES3. Povoliť'Import " +"Etc 2' v Nastaveniach Projektu." #: editor/editor_export.cpp msgid "" @@ -1596,107 +1573,106 @@ msgid "" "Enable 'Import Etc' in Project Settings, or disable 'Driver Fallback " "Enabled'." msgstr "" +"Target platform potrebuje'ETC' kompresor textúr pre driver fallback do " +"GLES2.\n" +"Povoľte 'Import Etc' v Nastaveniach Projektu, alebo vipnite 'Driver Fallback " +"Enabled'." #: editor/editor_export.cpp platform/android/export/export.cpp #: platform/iphone/export/export.cpp platform/javascript/export/export.cpp #: platform/osx/export/export.cpp platform/uwp/export/export.cpp msgid "Custom debug template not found." -msgstr "" +msgstr "Vlastná debug šablóna sa nenašla." #: editor/editor_export.cpp platform/android/export/export.cpp #: platform/iphone/export/export.cpp platform/javascript/export/export.cpp #: platform/osx/export/export.cpp platform/uwp/export/export.cpp msgid "Custom release template not found." -msgstr "" +msgstr "Vlastná release šablóna sa nenašla." #: editor/editor_export.cpp platform/javascript/export/export.cpp msgid "Template file not found:" -msgstr "" +msgstr "Súbor Šablóny sa nenašiel:" #: editor/editor_export.cpp msgid "On 32-bit exports the embedded PCK cannot be bigger than 4 GiB." -msgstr "" +msgstr "Pri 32-bitovom exporte nemôže byť vložená PCK väčšia ako 4 GiB." #: editor/editor_feature_profile.cpp -#, fuzzy msgid "3D Editor" -msgstr "Otvorit priečinok" +msgstr "3D Editor" #: editor/editor_feature_profile.cpp -#, fuzzy msgid "Script Editor" -msgstr "Otvorit priečinok" +msgstr "Script Editor" #: editor/editor_feature_profile.cpp msgid "Asset Library" -msgstr "" +msgstr "Asset Library" #: editor/editor_feature_profile.cpp msgid "Scene Tree Editing" -msgstr "" +msgstr "Editovanie Stromu Scén" #: editor/editor_feature_profile.cpp msgid "Import Dock" -msgstr "" +msgstr "Importovať Dock" #: editor/editor_feature_profile.cpp msgid "Node Dock" -msgstr "" +msgstr "Node Dock" #: editor/editor_feature_profile.cpp msgid "FileSystem and Import Docks" -msgstr "" +msgstr "Systém súborov a Import Dock-y" #: editor/editor_feature_profile.cpp msgid "Erase profile '%s'? (no undo)" -msgstr "" +msgstr "Vymazať profil '%s'? (Nedá sa vrátiť späť)" #: editor/editor_feature_profile.cpp msgid "Profile must be a valid filename and must not contain '.'" -msgstr "" +msgstr "Profil musí mať platný názov súboru a musí obsahovať '.'" #: editor/editor_feature_profile.cpp msgid "Profile with this name already exists." -msgstr "" +msgstr "Profil s týmto menom už existuje." #: editor/editor_feature_profile.cpp msgid "(Editor Disabled, Properties Disabled)" -msgstr "" +msgstr "(Editor je vypnutý, Vlastnosti sú vypnuté)" #: editor/editor_feature_profile.cpp msgid "(Properties Disabled)" -msgstr "" +msgstr "(Vlastnosi sú vypnuté)" #: editor/editor_feature_profile.cpp -#, fuzzy msgid "(Editor Disabled)" -msgstr "Vypnuté" +msgstr "(Editor je vypnutý)" #: editor/editor_feature_profile.cpp -#, fuzzy msgid "Class Options:" -msgstr "Popis:" +msgstr "Možnosti pre Class:" #: editor/editor_feature_profile.cpp msgid "Enable Contextual Editor" -msgstr "" +msgstr "Povoliť Kontextuálny Editor" #: editor/editor_feature_profile.cpp -#, fuzzy msgid "Enabled Properties:" -msgstr "Filter:" +msgstr "Povolené Vlastnosti:" #: editor/editor_feature_profile.cpp msgid "Enabled Features:" -msgstr "" +msgstr "Povolené Funkcie:" #: editor/editor_feature_profile.cpp msgid "Enabled Classes:" -msgstr "" +msgstr "Povolené Class-y:" #: editor/editor_feature_profile.cpp msgid "File '%s' format is invalid, import aborted." -msgstr "" +msgstr "Formát súboru '%s' je neplatny, Import bol prerušený." #: editor/editor_feature_profile.cpp msgid "" @@ -2841,7 +2817,7 @@ msgstr "" #: editor/editor_node.cpp editor/script_create_dialog.cpp msgid "Editor" -msgstr "" +msgstr "Editor" #: editor/editor_node.cpp #, fuzzy @@ -2912,7 +2888,11 @@ msgid "Q&A" msgstr "" #: editor/editor_node.cpp -msgid "Issue Tracker" +msgid "Report a Bug" +msgstr "" + +#: editor/editor_node.cpp +msgid "Send Docs Feedback" msgstr "" #: editor/editor_node.cpp editor/plugins/asset_library_editor_plugin.cpp @@ -3972,7 +3952,7 @@ msgid "Reimport" msgstr "" #: editor/import_dock.cpp -msgid "Save scenes, re-import and restart" +msgid "Save Scenes, Re-Import, and Restart" msgstr "" #: editor/import_dock.cpp @@ -4518,7 +4498,7 @@ msgstr "" #: editor/plugins/animation_player_editor_plugin.cpp msgid "Animation" -msgstr "" +msgstr "Animácie" #: editor/plugins/animation_player_editor_plugin.cpp #, fuzzy @@ -6858,14 +6838,6 @@ msgid "Open Godot online documentation." msgstr "Popis:" #: editor/plugins/script_editor_plugin.cpp -msgid "Request Docs" -msgstr "" - -#: editor/plugins/script_editor_plugin.cpp -msgid "Help improve the Godot documentation by giving feedback." -msgstr "" - -#: editor/plugins/script_editor_plugin.cpp msgid "Search the reference documentation." msgstr "" @@ -7310,6 +7282,10 @@ msgid "This operation requires a single selected node." msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Auto Orthogonal Enabled" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Lock View Rotation" msgstr "" @@ -7400,13 +7376,13 @@ msgid "Freelook Slow Modifier" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "" -"Note: The FPS value displayed is the editor's framerate.\n" -"It cannot be used as a reliable indication of in-game performance." +msgid "View Rotation Locked" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "View Rotation Locked" +msgid "" +"Note: The FPS value displayed is the editor's framerate.\n" +"It cannot be used as a reliable indication of in-game performance." msgstr "" #: editor/plugins/spatial_editor_plugin.cpp @@ -10198,7 +10174,7 @@ msgstr "" #: editor/project_settings_editor.cpp msgid "Plugins" -msgstr "" +msgstr "Pluginy" #: editor/property_editor.cpp msgid "Preset..." @@ -10860,6 +10836,12 @@ msgid "Script file already exists." msgstr "" #: editor/script_create_dialog.cpp +msgid "" +"Note: Built-in scripts have some limitations and can't be edited using an " +"external editor." +msgstr "" + +#: editor/script_create_dialog.cpp #, fuzzy msgid "Class Name:" msgstr "Trieda:" @@ -12542,6 +12524,10 @@ msgid "" "texture to some node for display." msgstr "" +#: scene/main/viewport.cpp +msgid "Viewport size must be greater than 0 to render anything." +msgstr "" + #: scene/resources/visual_shader_nodes.cpp #, fuzzy msgid "Invalid source for preview." diff --git a/editor/translations/sl.po b/editor/translations/sl.po index e8a0b4c2a1..8145e5e5d9 100644 --- a/editor/translations/sl.po +++ b/editor/translations/sl.po @@ -1515,7 +1515,7 @@ msgstr "Premakni SamodejnoNalaganje" msgid "Remove Autoload" msgstr "Odstrani SamodejnoNalaganje" -#: editor/editor_autoload_settings.cpp +#: editor/editor_autoload_settings.cpp editor/editor_plugin_settings.cpp msgid "Enable" msgstr "Omogoči" @@ -3066,8 +3066,13 @@ msgid "Q&A" msgstr "V&O" #: editor/editor_node.cpp -msgid "Issue Tracker" -msgstr "Sledilnik Napak" +#, fuzzy +msgid "Report a Bug" +msgstr "Ponovno Uvozi" + +#: editor/editor_node.cpp +msgid "Send Docs Feedback" +msgstr "" #: editor/editor_node.cpp editor/plugins/asset_library_editor_plugin.cpp msgid "Community" @@ -4155,7 +4160,7 @@ msgid "Reimport" msgstr "Ponovno Uvozi" #: editor/import_dock.cpp -msgid "Save scenes, re-import and restart" +msgid "Save Scenes, Re-Import, and Restart" msgstr "" #: editor/import_dock.cpp @@ -7140,14 +7145,6 @@ msgid "Open Godot online documentation." msgstr "Odpri Nedavne" #: editor/plugins/script_editor_plugin.cpp -msgid "Request Docs" -msgstr "" - -#: editor/plugins/script_editor_plugin.cpp -msgid "Help improve the Godot documentation by giving feedback." -msgstr "" - -#: editor/plugins/script_editor_plugin.cpp msgid "Search the reference documentation." msgstr "" @@ -7599,6 +7596,10 @@ msgid "This operation requires a single selected node." msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Auto Orthogonal Enabled" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Lock View Rotation" msgstr "" @@ -7689,13 +7690,13 @@ msgid "Freelook Slow Modifier" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "" -"Note: The FPS value displayed is the editor's framerate.\n" -"It cannot be used as a reliable indication of in-game performance." +msgid "View Rotation Locked" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "View Rotation Locked" +msgid "" +"Note: The FPS value displayed is the editor's framerate.\n" +"It cannot be used as a reliable indication of in-game performance." msgstr "" #: editor/plugins/spatial_editor_plugin.cpp @@ -11215,6 +11216,12 @@ msgid "Script file already exists." msgstr "SamodejnoNalaganje '%s' že obstaja!" #: editor/script_create_dialog.cpp +msgid "" +"Note: Built-in scripts have some limitations and can't be edited using an " +"external editor." +msgstr "" + +#: editor/script_create_dialog.cpp #, fuzzy msgid "Class Name:" msgstr "Razred:" @@ -12926,6 +12933,10 @@ msgid "" "texture to some node for display." msgstr "" +#: scene/main/viewport.cpp +msgid "Viewport size must be greater than 0 to render anything." +msgstr "" + #: scene/resources/visual_shader_nodes.cpp #, fuzzy msgid "Invalid source for preview." @@ -12956,6 +12967,9 @@ msgstr "" msgid "Constants cannot be modified." msgstr "Konstante ni možno spreminjati." +#~ msgid "Issue Tracker" +#~ msgstr "Sledilnik Napak" + #~ msgid "Replaced %d occurrence(s)." #~ msgstr "Zamenjana %d ponovitev/e." diff --git a/editor/translations/sq.po b/editor/translations/sq.po index 60ac25f6f4..19b13a126b 100644 --- a/editor/translations/sq.po +++ b/editor/translations/sq.po @@ -1452,7 +1452,7 @@ msgstr "Lëviz Autoload-in" msgid "Remove Autoload" msgstr "Hiq Autoload-in" -#: editor/editor_autoload_settings.cpp +#: editor/editor_autoload_settings.cpp editor/editor_plugin_settings.cpp msgid "Enable" msgstr "Lejo" @@ -2991,8 +2991,13 @@ msgid "Q&A" msgstr "Pyetje&Përgjigje" #: editor/editor_node.cpp -msgid "Issue Tracker" -msgstr "Gjurmuesi i Problemeve" +#, fuzzy +msgid "Report a Bug" +msgstr "Ri-importo" + +#: editor/editor_node.cpp +msgid "Send Docs Feedback" +msgstr "" #: editor/editor_node.cpp editor/plugins/asset_library_editor_plugin.cpp msgid "Community" @@ -4066,7 +4071,8 @@ msgid "Reimport" msgstr "Ri-importo" #: editor/import_dock.cpp -msgid "Save scenes, re-import and restart" +#, fuzzy +msgid "Save Scenes, Re-Import, and Restart" msgstr "Ruaj skenat, ri-importo dhe rifillo" #: editor/import_dock.cpp @@ -6897,14 +6903,6 @@ msgid "Open Godot online documentation." msgstr "" #: editor/plugins/script_editor_plugin.cpp -msgid "Request Docs" -msgstr "" - -#: editor/plugins/script_editor_plugin.cpp -msgid "Help improve the Godot documentation by giving feedback." -msgstr "" - -#: editor/plugins/script_editor_plugin.cpp msgid "Search the reference documentation." msgstr "" @@ -7343,6 +7341,10 @@ msgid "This operation requires a single selected node." msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Auto Orthogonal Enabled" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Lock View Rotation" msgstr "" @@ -7432,13 +7434,13 @@ msgid "Freelook Slow Modifier" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "" -"Note: The FPS value displayed is the editor's framerate.\n" -"It cannot be used as a reliable indication of in-game performance." +msgid "View Rotation Locked" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "View Rotation Locked" +msgid "" +"Note: The FPS value displayed is the editor's framerate.\n" +"It cannot be used as a reliable indication of in-game performance." msgstr "" #: editor/plugins/spatial_editor_plugin.cpp @@ -10835,6 +10837,12 @@ msgid "Script file already exists." msgstr "Emri i grupit ekziston që më parë." #: editor/script_create_dialog.cpp +msgid "" +"Note: Built-in scripts have some limitations and can't be edited using an " +"external editor." +msgstr "" + +#: editor/script_create_dialog.cpp #, fuzzy msgid "Class Name:" msgstr "Klasa:" @@ -12481,6 +12489,10 @@ msgid "" "texture to some node for display." msgstr "" +#: scene/main/viewport.cpp +msgid "Viewport size must be greater than 0 to render anything." +msgstr "" + #: scene/resources/visual_shader_nodes.cpp msgid "Invalid source for preview." msgstr "" @@ -12509,6 +12521,9 @@ msgstr "" msgid "Constants cannot be modified." msgstr "" +#~ msgid "Issue Tracker" +#~ msgstr "Gjurmuesi i Problemeve" + #~ msgid "" #~ "There are currently no tutorials for this class, you can [color=$color]" #~ "[url=$url]contribute one[/url][/color] or [color=$color][url=" diff --git a/editor/translations/sr_Cyrl.po b/editor/translations/sr_Cyrl.po index 5f5f3786a7..f83bc8bcd1 100644 --- a/editor/translations/sr_Cyrl.po +++ b/editor/translations/sr_Cyrl.po @@ -1516,7 +1516,7 @@ msgstr "Помери аутоматско учитавање" msgid "Remove Autoload" msgstr "Обриши аутоматско учитавање" -#: editor/editor_autoload_settings.cpp +#: editor/editor_autoload_settings.cpp editor/editor_plugin_settings.cpp msgid "Enable" msgstr "Укључи" @@ -3073,8 +3073,13 @@ msgid "Q&A" msgstr "Питања и одговори" #: editor/editor_node.cpp -msgid "Issue Tracker" -msgstr "Пратилац грешака" +#, fuzzy +msgid "Report a Bug" +msgstr "Поново увези" + +#: editor/editor_node.cpp +msgid "Send Docs Feedback" +msgstr "" #: editor/editor_node.cpp editor/plugins/asset_library_editor_plugin.cpp msgid "Community" @@ -4181,7 +4186,7 @@ msgid "Reimport" msgstr "Поново увези" #: editor/import_dock.cpp -msgid "Save scenes, re-import and restart" +msgid "Save Scenes, Re-Import, and Restart" msgstr "" #: editor/import_dock.cpp @@ -7191,14 +7196,6 @@ msgid "Open Godot online documentation." msgstr "Отвори Godot онлајн документацију" #: editor/plugins/script_editor_plugin.cpp -msgid "Request Docs" -msgstr "" - -#: editor/plugins/script_editor_plugin.cpp -msgid "Help improve the Godot documentation by giving feedback." -msgstr "" - -#: editor/plugins/script_editor_plugin.cpp msgid "Search the reference documentation." msgstr "Претражи документацију." @@ -7666,6 +7663,11 @@ msgstr "Ова операција захтева један изабран чв #: editor/plugins/spatial_editor_plugin.cpp #, fuzzy +msgid "Auto Orthogonal Enabled" +msgstr "Ортогонална пројекција" + +#: editor/plugins/spatial_editor_plugin.cpp +#, fuzzy msgid "Lock View Rotation" msgstr "Прикажи информације" @@ -7757,17 +7759,17 @@ msgid "Freelook Slow Modifier" msgstr "Брзина слободног погледа" #: editor/plugins/spatial_editor_plugin.cpp +#, fuzzy +msgid "View Rotation Locked" +msgstr "Прикажи информације" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -#, fuzzy -msgid "View Rotation Locked" -msgstr "Прикажи информације" - -#: editor/plugins/spatial_editor_plugin.cpp msgid "XForm Dialog" msgstr "XForm дијалог" @@ -11343,6 +11345,12 @@ msgid "Script file already exists." msgstr "Аутоматско учитавање '%s' већ постоји!" #: editor/script_create_dialog.cpp +msgid "" +"Note: Built-in scripts have some limitations and can't be edited using an " +"external editor." +msgstr "" + +#: editor/script_create_dialog.cpp #, fuzzy msgid "Class Name:" msgstr "Класа:" @@ -13031,6 +13039,10 @@ msgid "" "texture to some node for display." msgstr "" +#: scene/main/viewport.cpp +msgid "Viewport size must be greater than 0 to render anything." +msgstr "" + #: scene/resources/visual_shader_nodes.cpp #, fuzzy msgid "Invalid source for preview." @@ -13062,6 +13074,9 @@ msgstr "" msgid "Constants cannot be modified." msgstr "" +#~ msgid "Issue Tracker" +#~ msgstr "Пратилац грешака" + #~ msgid "Replaced %d occurrence(s)." #~ msgstr "Замени %d појаве/а." diff --git a/editor/translations/sr_Latn.po b/editor/translations/sr_Latn.po index c36e64d459..80ff3bc4fa 100644 --- a/editor/translations/sr_Latn.po +++ b/editor/translations/sr_Latn.po @@ -1437,7 +1437,7 @@ msgstr "" msgid "Remove Autoload" msgstr "" -#: editor/editor_autoload_settings.cpp +#: editor/editor_autoload_settings.cpp editor/editor_plugin_settings.cpp msgid "Enable" msgstr "" @@ -2848,7 +2848,11 @@ msgid "Q&A" msgstr "" #: editor/editor_node.cpp -msgid "Issue Tracker" +msgid "Report a Bug" +msgstr "" + +#: editor/editor_node.cpp +msgid "Send Docs Feedback" msgstr "" #: editor/editor_node.cpp editor/plugins/asset_library_editor_plugin.cpp @@ -3873,7 +3877,7 @@ msgid "Reimport" msgstr "" #: editor/import_dock.cpp -msgid "Save scenes, re-import and restart" +msgid "Save Scenes, Re-Import, and Restart" msgstr "" #: editor/import_dock.cpp @@ -6698,14 +6702,6 @@ msgid "Open Godot online documentation." msgstr "" #: editor/plugins/script_editor_plugin.cpp -msgid "Request Docs" -msgstr "" - -#: editor/plugins/script_editor_plugin.cpp -msgid "Help improve the Godot documentation by giving feedback." -msgstr "" - -#: editor/plugins/script_editor_plugin.cpp msgid "Search the reference documentation." msgstr "" @@ -7142,6 +7138,10 @@ msgid "This operation requires a single selected node." msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Auto Orthogonal Enabled" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Lock View Rotation" msgstr "" @@ -7230,13 +7230,13 @@ msgid "Freelook Slow Modifier" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "" -"Note: The FPS value displayed is the editor's framerate.\n" -"It cannot be used as a reliable indication of in-game performance." +msgid "View Rotation Locked" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "View Rotation Locked" +msgid "" +"Note: The FPS value displayed is the editor's framerate.\n" +"It cannot be used as a reliable indication of in-game performance." msgstr "" #: editor/plugins/spatial_editor_plugin.cpp @@ -10621,6 +10621,12 @@ msgid "Script file already exists." msgstr "" #: editor/script_create_dialog.cpp +msgid "" +"Note: Built-in scripts have some limitations and can't be edited using an " +"external editor." +msgstr "" + +#: editor/script_create_dialog.cpp msgid "Class Name:" msgstr "" @@ -12253,6 +12259,10 @@ msgid "" "texture to some node for display." msgstr "" +#: scene/main/viewport.cpp +msgid "Viewport size must be greater than 0 to render anything." +msgstr "" + #: scene/resources/visual_shader_nodes.cpp msgid "Invalid source for preview." msgstr "" diff --git a/editor/translations/sv.po b/editor/translations/sv.po index 3f7fee23b7..cb1d4c22d6 100644 --- a/editor/translations/sv.po +++ b/editor/translations/sv.po @@ -1507,7 +1507,7 @@ msgstr "Flytta Autoload" msgid "Remove Autoload" msgstr "Ta bort Autoload" -#: editor/editor_autoload_settings.cpp +#: editor/editor_autoload_settings.cpp editor/editor_plugin_settings.cpp msgid "Enable" msgstr "Aktivera" @@ -3043,7 +3043,12 @@ msgid "Q&A" msgstr "Frågor och svar" #: editor/editor_node.cpp -msgid "Issue Tracker" +#, fuzzy +msgid "Report a Bug" +msgstr "Importera om" + +#: editor/editor_node.cpp +msgid "Send Docs Feedback" msgstr "" #: editor/editor_node.cpp editor/plugins/asset_library_editor_plugin.cpp @@ -4139,7 +4144,7 @@ msgid "Reimport" msgstr "Importera om" #: editor/import_dock.cpp -msgid "Save scenes, re-import and restart" +msgid "Save Scenes, Re-Import, and Restart" msgstr "" #: editor/import_dock.cpp @@ -7086,14 +7091,6 @@ msgid "Open Godot online documentation." msgstr "Öppna Senaste" #: editor/plugins/script_editor_plugin.cpp -msgid "Request Docs" -msgstr "" - -#: editor/plugins/script_editor_plugin.cpp -msgid "Help improve the Godot documentation by giving feedback." -msgstr "" - -#: editor/plugins/script_editor_plugin.cpp msgid "Search the reference documentation." msgstr "" @@ -7550,6 +7547,10 @@ msgid "This operation requires a single selected node." msgstr "Åtgärden kräver en enstaka vald Node." #: editor/plugins/spatial_editor_plugin.cpp +msgid "Auto Orthogonal Enabled" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp #, fuzzy msgid "Lock View Rotation" msgstr "Visa Information" @@ -7640,17 +7641,17 @@ msgid "Freelook Slow Modifier" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +#, fuzzy +msgid "View Rotation Locked" +msgstr "Visa Information" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -#, fuzzy -msgid "View Rotation Locked" -msgstr "Visa Information" - -#: editor/plugins/spatial_editor_plugin.cpp msgid "XForm Dialog" msgstr "" @@ -11166,6 +11167,12 @@ msgid "Script file already exists." msgstr "Autoload '%s' finns redan!" #: editor/script_create_dialog.cpp +msgid "" +"Note: Built-in scripts have some limitations and can't be edited using an " +"external editor." +msgstr "" + +#: editor/script_create_dialog.cpp #, fuzzy msgid "Class Name:" msgstr "Klassnamn" @@ -12871,6 +12878,10 @@ msgid "" "texture to some node for display." msgstr "" +#: scene/main/viewport.cpp +msgid "Viewport size must be greater than 0 to render anything." +msgstr "" + #: scene/resources/visual_shader_nodes.cpp #, fuzzy msgid "Invalid source for preview." diff --git a/editor/translations/ta.po b/editor/translations/ta.po index 5300f984bb..b93e16a597 100644 --- a/editor/translations/ta.po +++ b/editor/translations/ta.po @@ -1429,7 +1429,7 @@ msgstr "" msgid "Remove Autoload" msgstr "" -#: editor/editor_autoload_settings.cpp +#: editor/editor_autoload_settings.cpp editor/editor_plugin_settings.cpp msgid "Enable" msgstr "" @@ -2836,7 +2836,11 @@ msgid "Q&A" msgstr "" #: editor/editor_node.cpp -msgid "Issue Tracker" +msgid "Report a Bug" +msgstr "" + +#: editor/editor_node.cpp +msgid "Send Docs Feedback" msgstr "" #: editor/editor_node.cpp editor/plugins/asset_library_editor_plugin.cpp @@ -3860,7 +3864,7 @@ msgid "Reimport" msgstr "" #: editor/import_dock.cpp -msgid "Save scenes, re-import and restart" +msgid "Save Scenes, Re-Import, and Restart" msgstr "" #: editor/import_dock.cpp @@ -6663,14 +6667,6 @@ msgid "Open Godot online documentation." msgstr "" #: editor/plugins/script_editor_plugin.cpp -msgid "Request Docs" -msgstr "" - -#: editor/plugins/script_editor_plugin.cpp -msgid "Help improve the Godot documentation by giving feedback." -msgstr "" - -#: editor/plugins/script_editor_plugin.cpp msgid "Search the reference documentation." msgstr "" @@ -7101,6 +7097,10 @@ msgid "This operation requires a single selected node." msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Auto Orthogonal Enabled" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Lock View Rotation" msgstr "" @@ -7189,13 +7189,13 @@ msgid "Freelook Slow Modifier" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "" -"Note: The FPS value displayed is the editor's framerate.\n" -"It cannot be used as a reliable indication of in-game performance." +msgid "View Rotation Locked" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "View Rotation Locked" +msgid "" +"Note: The FPS value displayed is the editor's framerate.\n" +"It cannot be used as a reliable indication of in-game performance." msgstr "" #: editor/plugins/spatial_editor_plugin.cpp @@ -10537,6 +10537,12 @@ msgid "Script file already exists." msgstr "" #: editor/script_create_dialog.cpp +msgid "" +"Note: Built-in scripts have some limitations and can't be edited using an " +"external editor." +msgstr "" + +#: editor/script_create_dialog.cpp msgid "Class Name:" msgstr "" @@ -12160,6 +12166,10 @@ msgid "" "texture to some node for display." msgstr "" +#: scene/main/viewport.cpp +msgid "Viewport size must be greater than 0 to render anything." +msgstr "" + #: scene/resources/visual_shader_nodes.cpp msgid "Invalid source for preview." msgstr "" diff --git a/editor/translations/te.po b/editor/translations/te.po index d76be13ec1..38d8b80709 100644 --- a/editor/translations/te.po +++ b/editor/translations/te.po @@ -1407,7 +1407,7 @@ msgstr "" msgid "Remove Autoload" msgstr "" -#: editor/editor_autoload_settings.cpp +#: editor/editor_autoload_settings.cpp editor/editor_plugin_settings.cpp msgid "Enable" msgstr "" @@ -2810,7 +2810,11 @@ msgid "Q&A" msgstr "" #: editor/editor_node.cpp -msgid "Issue Tracker" +msgid "Report a Bug" +msgstr "" + +#: editor/editor_node.cpp +msgid "Send Docs Feedback" msgstr "" #: editor/editor_node.cpp editor/plugins/asset_library_editor_plugin.cpp @@ -3831,7 +3835,7 @@ msgid "Reimport" msgstr "" #: editor/import_dock.cpp -msgid "Save scenes, re-import and restart" +msgid "Save Scenes, Re-Import, and Restart" msgstr "" #: editor/import_dock.cpp @@ -6613,14 +6617,6 @@ msgid "Open Godot online documentation." msgstr "" #: editor/plugins/script_editor_plugin.cpp -msgid "Request Docs" -msgstr "" - -#: editor/plugins/script_editor_plugin.cpp -msgid "Help improve the Godot documentation by giving feedback." -msgstr "" - -#: editor/plugins/script_editor_plugin.cpp msgid "Search the reference documentation." msgstr "" @@ -7050,6 +7046,10 @@ msgid "This operation requires a single selected node." msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Auto Orthogonal Enabled" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Lock View Rotation" msgstr "" @@ -7138,13 +7138,13 @@ msgid "Freelook Slow Modifier" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "" -"Note: The FPS value displayed is the editor's framerate.\n" -"It cannot be used as a reliable indication of in-game performance." +msgid "View Rotation Locked" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "View Rotation Locked" +msgid "" +"Note: The FPS value displayed is the editor's framerate.\n" +"It cannot be used as a reliable indication of in-game performance." msgstr "" #: editor/plugins/spatial_editor_plugin.cpp @@ -10463,6 +10463,12 @@ msgid "Script file already exists." msgstr "" #: editor/script_create_dialog.cpp +msgid "" +"Note: Built-in scripts have some limitations and can't be edited using an " +"external editor." +msgstr "" + +#: editor/script_create_dialog.cpp msgid "Class Name:" msgstr "" @@ -12076,6 +12082,10 @@ msgid "" "texture to some node for display." msgstr "" +#: scene/main/viewport.cpp +msgid "Viewport size must be greater than 0 to render anything." +msgstr "" + #: scene/resources/visual_shader_nodes.cpp msgid "Invalid source for preview." msgstr "" diff --git a/editor/translations/th.po b/editor/translations/th.po index a56f6338ab..3ad01b7d05 100644 --- a/editor/translations/th.po +++ b/editor/translations/th.po @@ -5,11 +5,12 @@ # Kaveeta Vivatchai <goodytong@gmail.com>, 2017. # Poommetee Ketson (Noshyaar) <poommetee@protonmail.com>, 2017-2018. # Thanachart Monpassorn <nunf_2539@hotmail.com>, 2020. +# anonymous <noreply@weblate.org>, 2020. msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2020-01-03 21:21+0000\n" +"PO-Revision-Date: 2020-03-31 02:26+0000\n" "Last-Translator: Thanachart Monpassorn <nunf_2539@hotmail.com>\n" "Language-Team: Thai <https://hosted.weblate.org/projects/godot-engine/godot/" "th/>\n" @@ -18,7 +19,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Weblate 3.10\n" +"X-Generator: Weblate 4.0-dev\n" #: core/math/expression.cpp modules/gdscript/gdscript_functions.cpp #: modules/visual_script/visual_script_builtin_funcs.cpp @@ -41,30 +42,27 @@ msgstr "ค่าอินพุตผิดพลาด %i (ไม่ผ่า #: core/math/expression.cpp msgid "self can't be used because instance is null (not passed)" -msgstr "self ไม่สามารถใช้ได้เนื่องจาก instance มีค่า null (ไม่ผ่าน)" +msgstr "self ไม่สามารถใช้ได้เนื่องจากอินสแตนซ์มีค่า null (ไม่ผ่าน)" #: core/math/expression.cpp -#, fuzzy msgid "Invalid operands to operator %s, %s and %s." -msgstr "ไม่พบคุณสมบัติ '%s' ในโหนด %s" +msgstr "ดำเนินการผิดพลาดที่ตัวดำเนินการ %s, %s และ %s" #: core/math/expression.cpp -#, fuzzy msgid "Invalid index of type %s for base type %s" -msgstr "ไม่พบคุณสมบัติ '%s' ในโหนด %s" +msgstr "ดัชนีของชนิด '%s' ผิดพลาด ในชนิดฐาน %s" #: core/math/expression.cpp msgid "Invalid named index '%s' for base type %s" -msgstr "" +msgstr "ชื่อดัชนีของ '%s' ผิดพลาด สำหรับฐาน %s" #: core/math/expression.cpp -#, fuzzy msgid "Invalid arguments to construct '%s'" -msgstr ": ประเภทตัวแปรไม่ถูกต้อง: " +msgstr "อากิวเมนต์ไม่ถูกต้องในคอนสตรัก '%s'" #: core/math/expression.cpp msgid "On call to '%s':" -msgstr "" +msgstr "เรียก '%s':" #: core/ustring.cpp msgid "B" @@ -103,9 +101,8 @@ msgid "Balanced" msgstr "สมดุล" #: editor/animation_bezier_editor.cpp -#, fuzzy msgid "Mirror" -msgstr "สะท้อนซ้ายขวา" +msgstr "กระจก" #: editor/animation_bezier_editor.cpp editor/editor_profiler.cpp msgid "Time:" @@ -116,29 +113,24 @@ msgid "Value:" msgstr "ค่า:" #: editor/animation_bezier_editor.cpp -#, fuzzy msgid "Insert Key Here" -msgstr "เพิ่มคีย์" +msgstr "เพิ่มคีย์ที่นี่" #: editor/animation_bezier_editor.cpp -#, fuzzy msgid "Duplicate Selected Key(s)" -msgstr "ทำซ้ำที่เลือก" +msgstr "ทำซ้ำคีย์ที่เลือก" #: editor/animation_bezier_editor.cpp -#, fuzzy msgid "Delete Selected Key(s)" -msgstr "ลบสิ่งที่เลือก" +msgstr "ลบคีย์ที่เลือก" #: editor/animation_bezier_editor.cpp -#, fuzzy msgid "Add Bezier Point" -msgstr "เพิ่มจุด" +msgstr "เพิ่มจุดเบซิเยร์" #: editor/animation_bezier_editor.cpp -#, fuzzy msgid "Move Bezier Points" -msgstr "ย้ายจุด" +msgstr "ย้ายจุดเบซิเยร์" #: editor/animation_bezier_editor.cpp editor/animation_track_editor.cpp msgid "Anim Duplicate Keys" @@ -169,34 +161,28 @@ msgid "Anim Change Call" msgstr "แก้ไขการเรียกฟังก์ชันแอนิเมชัน" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Anim Multi Change Keyframe Time" -msgstr "แก้ไขเวลาคีย์เฟรมแอนิเมชัน" +msgstr "แก้ไขเวลาคีย์เฟรมแอนิเมชันแบบหลายครั้ง" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Anim Multi Change Transition" -msgstr "แก้ไขทรานสิชันแอนิเมชัน" +msgstr "แก้ไขทรานสิชันแอนิเมชันแบบหลายครั้ง" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Anim Multi Change Transform" -msgstr "เคลื่อนย้ายแอนิเมชัน" +msgstr "แก้ไขการเปลี่ยนแปลงแอนิเมชันแบบหลายครั้ง" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Anim Multi Change Keyframe Value" -msgstr "แก้ไขค่าคีย์เฟรมแอนิเมชัน" +msgstr "แก้ไขคีย์เฟรมแอนิเมชันแบบหลายครั้ง" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Anim Multi Change Call" -msgstr "แก้ไขการเรียกฟังก์ชันแอนิเมชัน" +msgstr "แก้ไขการเรียกแอนิเมชันแบบหลายครั้ง" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Change Animation Length" -msgstr "แก้ไขการวนซ้ำแอนิเมชัน" +msgstr "แก้ไขความยาวแอนิเมชัน" #: editor/animation_track_editor.cpp #: editor/plugins/sprite_frames_editor_plugin.cpp @@ -204,51 +190,44 @@ msgid "Change Animation Loop" msgstr "แก้ไขการวนซ้ำแอนิเมชัน" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Property Track" -msgstr "คุณสมบัติ:" +msgstr "คุณสมบัติแทร็ก" #: editor/animation_track_editor.cpp -#, fuzzy msgid "3D Transform Track" -msgstr "ประเภทการเคลื่อนย้าย" +msgstr "แทร็ก 3D Transform" #: editor/animation_track_editor.cpp msgid "Call Method Track" -msgstr "" +msgstr "เรียกแทร็กเมธอด" #: editor/animation_track_editor.cpp msgid "Bezier Curve Track" -msgstr "" +msgstr "แทร็กเส้นโค้งเบซิเยร์" #: editor/animation_track_editor.cpp msgid "Audio Playback Track" -msgstr "" +msgstr "แทร็กการเล่นเสียง" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Animation Playback Track" -msgstr "หยุดการเล่นแอนิเมชัน (S)" +msgstr "แทร็กการเล่นแอนิเมชัน" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Animation length (frames)" -msgstr "ความยาวแอนิเมชัน (วินาที)" +msgstr "ความยาวแอนิเมชัน (เฟรม)" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Animation length (seconds)" msgstr "ความยาวแอนิเมชัน (วินาที)" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Add Track" -msgstr "เพิ่มแทร็กแอนิเมชัน" +msgstr "เพิ่มแทร็ก" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Animation Looping" -msgstr "ซูมแอนิเมชัน" +msgstr "การวนซ้ำแอนิเมชัน" #: editor/animation_track_editor.cpp #: modules/visual_script/visual_script_editor.cpp @@ -256,52 +235,44 @@ msgid "Functions:" msgstr "ฟังก์ชัน:" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Audio Clips:" -msgstr "ตัวรับเสียง" +msgstr "คลิปเสียง:" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Anim Clips:" -msgstr "คลิป" +msgstr "คลิปแอนิเมชั่น:" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Change Track Path" -msgstr "เปลี่ยนค่าในอาร์เรย์" +msgstr "เปลี่ยนที่อยู่แทร็ก" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Toggle this track on/off." -msgstr "โหมดไร้สิ่งรบกวน" +msgstr "เปิด/ปิดการติดตามแทร็กนี้" #: editor/animation_track_editor.cpp msgid "Update Mode (How this property is set)" -msgstr "" +msgstr "โหมดอัพเดท (วิธีตั้งค่าคุณสมบัตินี้)" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Interpolation Mode" -msgstr "โหนดแอนิเมชัน" +msgstr "โหมดการแก้ไข" #: editor/animation_track_editor.cpp msgid "Loop Wrap Mode (Interpolate end with beginning on loop)" -msgstr "" +msgstr "โหมดวนรอบ (ต่อจุดสิ้นสุดด้วยจุดเริ่มต้นของลูป)" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Remove this track." -msgstr "ลบแทร็กที่เลือก" +msgstr "ลบแทร็กนี้" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Time (s): " -msgstr "ระยะเวลาเฟด (วิ):" +msgstr "เวลา (วินาที): " #: editor/animation_track_editor.cpp -#, fuzzy msgid "Toggle Track Enabled" -msgstr "เปิดดอปเพลอร์" +msgstr "เปิดการใช้งานการติดตามแทร็ก" #: editor/animation_track_editor.cpp msgid "Continuous" @@ -316,13 +287,12 @@ msgid "Trigger" msgstr "ทริกเกอร์" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Capture" -msgstr "ฟีเจอร์" +msgstr "จับ" #: editor/animation_track_editor.cpp msgid "Nearest" -msgstr "" +msgstr "ใกล้ที่สุด" #: editor/animation_track_editor.cpp editor/plugins/curve_editor_plugin.cpp #: editor/property_editor.cpp @@ -331,15 +301,15 @@ msgstr "เส้นตรง" #: editor/animation_track_editor.cpp msgid "Cubic" -msgstr "" +msgstr "ลูกบาศก์" #: editor/animation_track_editor.cpp msgid "Clamp Loop Interp" -msgstr "" +msgstr "การจำกัดการวนลูป" #: editor/animation_track_editor.cpp msgid "Wrap Loop Interp" -msgstr "" +msgstr "ล้อมการวนซ้ำ" #: editor/animation_track_editor.cpp #: editor/plugins/canvas_item_editor_plugin.cpp @@ -347,19 +317,16 @@ msgid "Insert Key" msgstr "เพิ่มคีย์" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Duplicate Key(s)" -msgstr "ทำซ้ำโหนด" +msgstr "สร้างคีย์ซ้ำอีกอัน" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Delete Key(s)" -msgstr "ลบโหนด" +msgstr "ลบคีย์" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Change Animation Update Mode" -msgstr "เปลี่ยนชื่อแอนิเมชัน:" +msgstr "เปลี่ยนโหมดการอัพเดทแอนิเมชัน" #: editor/animation_track_editor.cpp #, fuzzy @@ -367,9 +334,8 @@ msgid "Change Animation Interpolation Mode" msgstr "โหนดแอนิเมชัน" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Change Animation Loop Mode" -msgstr "แก้ไขการวนซ้ำแอนิเมชัน" +msgstr "เปลี่ยนโหมดการวนซ้ำแอนิเมชัน" #: editor/animation_track_editor.cpp msgid "Remove Anim Track" @@ -401,7 +367,7 @@ msgstr "แทรกแอนิเมชัน" #: editor/animation_track_editor.cpp msgid "AnimationPlayer can't animate itself, only other players." -msgstr "" +msgstr "ตัวเล่นอนิเมชั่นไม่สามารถเล่นอนิเมชั่นด้วยตัวมันเองได้ เล่นได้เฉพาะตัวเล่นอื่นเท่านั้น" #: editor/animation_track_editor.cpp msgid "Anim Create & Insert" @@ -421,9 +387,8 @@ msgid "Change Animation Step" msgstr "แก้ไขความเร็วแอนิเมชัน" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Rearrange Tracks" -msgstr "จัดลำดับออโต้โหลด" +msgstr "จัดเรียงแทร็ก" #: editor/animation_track_editor.cpp msgid "Transform tracks only apply to Spatial-based nodes." @@ -436,73 +401,70 @@ msgid "" "-AudioStreamPlayer2D\n" "-AudioStreamPlayer3D" msgstr "" +"แทร็กเสียงสามารถติดไว้บนโหนดชนิดเหล่านี้เท่านั้น:\n" +"-AudioStreamPlayer\n" +"-AudioStreamPlayer2D\n" +"-AudioStreamPlayer3D" #: editor/animation_track_editor.cpp msgid "Animation tracks can only point to AnimationPlayer nodes." -msgstr "" +msgstr "แทร็กอนิเมชั่นสามารถติดไว้บนโหนด AnimationPlayer เท่านั้น" #: editor/animation_track_editor.cpp msgid "An animation player can't animate itself, only other players." -msgstr "" +msgstr "แทร็กอนิเมชั่นไม่สามารถเล่นตัวมันเองได้ แต่สามารถเล่นตัวเล่นอื่นได้" #: editor/animation_track_editor.cpp msgid "Not possible to add a new track without a root" -msgstr "" +msgstr "ไม่สามารถที่จะเพิ่มแทร็กใหม่โดยที่ไม่มีรูท" #: editor/animation_track_editor.cpp msgid "Invalid track for Bezier (no suitable sub-properties)" -msgstr "" +msgstr "แทร็กผิดพลาดสำหรับเบซิเยร์ (ไม่มีคุณสมบัติย่อยที่เข้ากันได้)" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Add Bezier Track" -msgstr "เพิ่มแทร็กแอนิเมชัน" +msgstr "เพิ่มแทร็กเบซิเยร์" #: editor/animation_track_editor.cpp msgid "Track path is invalid, so can't add a key." -msgstr "" +msgstr "ที่อยู่แทร็กผิดพลาด ไม่สามารถเพิ่มคีย์ได้" #: editor/animation_track_editor.cpp msgid "Track is not of type Spatial, can't insert key" -msgstr "" +msgstr "แทร็กไม่ใช่ชนิด Spatial, ไม่สามารถเพิ่มคีย์ได้" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Add Transform Track Key" -msgstr "ประเภทการเคลื่อนย้าย" +msgstr "เพิ่มคีย์แทร็กการแปลง" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Add Track Key" -msgstr "เพิ่มแทร็กแอนิเมชัน" +msgstr "เพิ่มแทร็กคีย์" #: editor/animation_track_editor.cpp msgid "Track path is invalid, so can't add a method key." -msgstr "" +msgstr "ที่อยู่แทร็กผิดพลาด ไม่สามารถเพิ่มคีย์เมธอดได้" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Add Method Track Key" -msgstr "เพิ่มแทร็กและคีย์แอนิเมชัน" +msgstr "เพิ่มคีย์แทร็กเมธอด" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Method not found in object: " -msgstr "ไม่พบ VariableGet ในสคริปต์: " +msgstr "ไม่พบเมธอดในออบเจกต์: " #: editor/animation_track_editor.cpp msgid "Anim Move Keys" msgstr "ย้ายคีย์แอนิเมชัน" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Clipboard is empty" -msgstr "คลิปบอร์ดว่างเปล่า!" +msgstr "คลิปบอร์ดว่างเปล่า" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Paste Tracks" -msgstr "วางตัวแปร" +msgstr "วางแทร็ก" #: editor/animation_track_editor.cpp msgid "Anim Scale Keys" @@ -511,7 +473,7 @@ msgstr "ปรับคีย์แอนิเมชัน" #: editor/animation_track_editor.cpp msgid "" "This option does not work for Bezier editing, as it's only a single track." -msgstr "" +msgstr "ตัวเลือกนี้ไม่สามารถทำงานกับแทร็กเบซิเยร์ เนื่องจากเป็นแค่แทร็กเดี่ยว" #: editor/animation_track_editor.cpp msgid "" @@ -528,16 +490,15 @@ msgstr "" #: editor/animation_track_editor.cpp msgid "Warning: Editing imported animation" -msgstr "" +msgstr "คำเตือน: กำลังแก้ไขแอนิเมชันที่นำเข้ามา" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Select an AnimationPlayer node to create and edit animations." -msgstr "เลือก AnimationPlayer จากผังฉากเพื่อแก้ไขแอนิเมชัน" +msgstr "เลือกโหนด AnimationPlayer เพื่อสร้างและแก้ไขแอนิเมชัน" #: editor/animation_track_editor.cpp msgid "Only show tracks from nodes selected in tree." -msgstr "" +msgstr "โชว์แทร็กจากโหนดที่เลือกในผังเท่านั้น" #: editor/animation_track_editor.cpp msgid "Group tracks by node or display them as plain list." @@ -555,11 +516,11 @@ msgstr "ผังแอนิเมชันถูกต้อง" #: editor/animation_track_editor.cpp msgid "Seconds" -msgstr "" +msgstr "วินาที" #: editor/animation_track_editor.cpp msgid "FPS" -msgstr "เฟรมต่อวินาที" +msgstr "เฟรมเรท" #: editor/animation_track_editor.cpp editor/editor_properties.cpp #: editor/plugins/polygon_2d_editor_plugin.cpp @@ -572,14 +533,12 @@ msgid "Edit" msgstr "แก้ไข" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Animation properties." -msgstr "ผังแอนิเมชัน" +msgstr "คุณสมบัติแอนิเมชัน" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Copy Tracks" -msgstr "คัดลอกตัวแปร" +msgstr "คัดลอกแทร็ก" #: editor/animation_track_editor.cpp msgid "Scale Selection" @@ -598,19 +557,16 @@ msgid "Duplicate Transposed" msgstr "ทำซ้ำเปลี่ยนแทร็ก" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Delete Selection" -msgstr "ลบสิ่งที่เลือก" +msgstr "ลบที่เลือก" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Go to Next Step" -msgstr "ถัดไป" +msgstr "ไปยังขั้นถัดไป" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Go to Previous Step" -msgstr "ก่อนหน้า" +msgstr "ไปยังขั้นก่อนหน้า" #: editor/animation_track_editor.cpp msgid "Optimize Animation" @@ -622,11 +578,11 @@ msgstr "เก็บกวาดแอนิเมชัน" #: editor/animation_track_editor.cpp msgid "Pick the node that will be animated:" -msgstr "" +msgstr "เลือกโหนดที่จะให้เคลื่อนไหว:" #: editor/animation_track_editor.cpp msgid "Use Bezier Curves" -msgstr "" +msgstr "ใช้เส้นโค้งเบซิเยร์" #: editor/animation_track_editor.cpp msgid "Anim. Optimizer" @@ -673,9 +629,8 @@ msgid "Scale Ratio:" msgstr "อัตราส่วนเวลา:" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Select Tracks to Copy" -msgstr "เลือกคุณสมบัติ" +msgstr "เลือกแทร็กที่จะคัดลอก" #: editor/animation_track_editor.cpp editor/editor_log.cpp #: editor/editor_properties.cpp @@ -687,22 +642,20 @@ msgid "Copy" msgstr "คัดลอก" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Select All/None" -msgstr "ไม่เลือก" +msgstr "เลือกทั้งหมด/ไม่เลือก" #: editor/animation_track_editor_plugins.cpp -#, fuzzy msgid "Add Audio Track Clip" -msgstr "ตัวรับเสียง" +msgstr "เพิ่มคลิปแทร็กเสียง" #: editor/animation_track_editor_plugins.cpp msgid "Change Audio Track Clip Start Offset" -msgstr "" +msgstr "เปลี่ยนออฟเซ็ตเริ่มต้นของคลิปแทร็กเสียง" #: editor/animation_track_editor_plugins.cpp msgid "Change Audio Track Clip End Offset" -msgstr "" +msgstr "เปลี่ยนออฟเซ็ตตอนจบของคลิปแทร็กเสียง" #: editor/array_property_edit.cpp msgid "Resize Array" @@ -725,18 +678,16 @@ msgid "Line Number:" msgstr "บรรทัดที่:" #: editor/code_editor.cpp -#, fuzzy msgid "%d replaced." -msgstr "แทนที่..." +msgstr "แทนที่ %d" #: editor/code_editor.cpp editor/editor_help.cpp msgid "%d match." -msgstr "" +msgstr "จับคู่ %d" #: editor/code_editor.cpp editor/editor_help.cpp -#, fuzzy msgid "%d matches." -msgstr "ไม่พบ" +msgstr "%d ตรงกัน" #: editor/code_editor.cpp editor/find_in_files.cpp msgid "Match Case" @@ -761,7 +712,7 @@ msgstr "เฉพาะที่กำลังเลือก" #: editor/code_editor.cpp editor/plugins/script_text_editor.cpp #: editor/plugins/text_editor.cpp msgid "Standard" -msgstr "" +msgstr "มาตรฐาน" #: editor/code_editor.cpp editor/plugins/script_editor_plugin.cpp msgid "Toggle Scripts Panel" @@ -789,39 +740,33 @@ msgstr "คำเตือน" #: editor/code_editor.cpp msgid "Line and column numbers." -msgstr "" +msgstr "เลขบรรทัดและคอลัมน์" #: editor/connections_dialog.cpp -#, fuzzy msgid "Method in target node must be specified." -msgstr "ต้องระบุเมท็อดในโหนดปลายทาง!" +msgstr "ต้องระบุเมธอดในโหนดเป้าหมาย" #: editor/connections_dialog.cpp -#, fuzzy msgid "" "Target method not found. Specify a valid method or attach a script to the " "target node." -msgstr "ไม่พบเมท็อดปลายทาง! ระบุเมท็อดให้ถูกต้องหรือเพิ่มสคริปต์ในโหนดปลายทาง" +msgstr "ไม่พบโหนดเป้าหมาย ระบุเมธอดที่ถูกต้องหรือเพิ่มสคริปต์ในโหนดเป้าหมาย" #: editor/connections_dialog.cpp -#, fuzzy msgid "Connect to Node:" -msgstr "เชื่อมไปยังโหนด:" +msgstr "เชื่อมต่อกับโหนด:" #: editor/connections_dialog.cpp -#, fuzzy msgid "Connect to Script:" -msgstr "ไม่สามารถเชื่อมต่อกับโฮสต์:" +msgstr "เชื่อมต่อสคริปต์:" #: editor/connections_dialog.cpp -#, fuzzy msgid "From Signal:" -msgstr "สัญญาณ:" +msgstr "จากสัญญาณ:" #: editor/connections_dialog.cpp -#, fuzzy msgid "Scene does not contain any script." -msgstr "โหนดไม่มี geometry" +msgstr "ไม่มีสคริปต์ในฉาก" #: editor/connections_dialog.cpp editor/editor_autoload_settings.cpp #: editor/groups_editor.cpp editor/plugins/item_list_editor_plugin.cpp @@ -849,14 +794,12 @@ msgid "Extra Call Arguments:" msgstr "ตัวแปรเพิ่มเติม:" #: editor/connections_dialog.cpp -#, fuzzy msgid "Receiver Method:" -msgstr "เลือกเมท็อด" +msgstr "ตัวรับเมธอด:" #: editor/connections_dialog.cpp -#, fuzzy msgid "Advanced" -msgstr "ตัวเลือกการจำกัด" +msgstr "ขั้นสูง" #: editor/connections_dialog.cpp msgid "Deferred" @@ -876,9 +819,8 @@ msgid "Disconnects the signal after its first emission." msgstr "" #: editor/connections_dialog.cpp -#, fuzzy msgid "Cannot connect signal" -msgstr "เชื่อมโยงสัญญาณ:" +msgstr "ไม่สามารถเชื่อมต่อสัญญาณ" #: editor/connections_dialog.cpp editor/dependency_editor.cpp #: editor/export_template_manager.cpp editor/groups_editor.cpp @@ -900,7 +842,6 @@ msgid "Connect" msgstr "เชื่อม" #: editor/connections_dialog.cpp -#, fuzzy msgid "Signal:" msgstr "สัญญาณ:" @@ -910,12 +851,11 @@ msgstr "เชื่อม '%s' กับ '%s'" #: editor/connections_dialog.cpp msgid "Disconnect '%s' from '%s'" -msgstr "ลบการเชื่อมโยง '%s' กับ '%s'" +msgstr "ตัดการเชื่อมต่อ '%s' กับ '%s'" #: editor/connections_dialog.cpp -#, fuzzy msgid "Disconnect all from signal: '%s'" -msgstr "ลบการเชื่อมโยง '%s' กับ '%s'" +msgstr "ตัดการเชื่อมต่อทั้งหมดจากสัญญาณ: '%s'" #: editor/connections_dialog.cpp msgid "Connect..." @@ -927,19 +867,16 @@ msgid "Disconnect" msgstr "ลบการเชื่อมโยง" #: editor/connections_dialog.cpp -#, fuzzy msgid "Connect a Signal to a Method" -msgstr "เชื่อมโยงสัญญาณ:" +msgstr "เชื่อมต่อสัญญาณไปยังเมธอด" #: editor/connections_dialog.cpp -#, fuzzy msgid "Edit Connection:" -msgstr "แก้ไขการเชื่อมโยง" +msgstr "แก้ไขการเชื่อมต่อ:" #: editor/connections_dialog.cpp -#, fuzzy msgid "Are you sure you want to remove all connections from the \"%s\" signal?" -msgstr "ยืนยันการรันโปรเจกต์มากกว่า 1 โปรเจกต์?" +msgstr "ยืนยันการลบการเชื่อมต่อสัญญาณจาก \"%s\"?" #: editor/connections_dialog.cpp editor/editor_help.cpp editor/node_dock.cpp msgid "Signals" @@ -950,19 +887,16 @@ msgid "Are you sure you want to remove all connections from this signal?" msgstr "" #: editor/connections_dialog.cpp -#, fuzzy msgid "Disconnect All" -msgstr "ลบการเชื่อมโยง" +msgstr "ตัดการเชื่อมต่อทั้งหมด" #: editor/connections_dialog.cpp -#, fuzzy msgid "Edit..." -msgstr "แก้ไข" +msgstr "แก้ไข..." #: editor/connections_dialog.cpp -#, fuzzy msgid "Go To Method" -msgstr "รายชื่อเมท็อด" +msgstr "ไปยังเมธอด" #: editor/create_dialog.cpp msgid "Change %s Type" @@ -1014,7 +948,6 @@ msgid "Dependencies For:" msgstr "การอ้างอิงของ:" #: editor/dependency_editor.cpp -#, fuzzy msgid "" "Scene '%s' is currently being edited.\n" "Changes will only take effect when reloaded." @@ -1023,12 +956,11 @@ msgstr "" "การแก้ไขจะไม่ส่งผลจนกว่าจะโหลดใหม่" #: editor/dependency_editor.cpp -#, fuzzy msgid "" "Resource '%s' is in use.\n" "Changes will only take effect when reloaded." msgstr "" -"รีซอร์ส '%s' กำลังถูกใช้งาน\n" +"ทรัพยากร '%s' กำลังถูกใช้งาน\n" "การแก้ไขจะไม่ส่งผลจนกว่าจะโหลดใหม่" #: editor/dependency_editor.cpp @@ -1038,12 +970,12 @@ msgstr "การอ้างอิง" #: editor/dependency_editor.cpp msgid "Resource" -msgstr "รีซอร์ส" +msgstr "ทรัพยากร" #: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp #: editor/project_manager.cpp editor/project_settings_editor.cpp msgid "Path" -msgstr "ตำแหน่ง" +msgstr "เส้นทาง" #: editor/dependency_editor.cpp msgid "Dependencies:" @@ -1059,7 +991,7 @@ msgstr "แก้ไขการอ้างอิง" #: editor/dependency_editor.cpp msgid "Search Replacement Resource:" -msgstr "ค้นหารีซอร์สมาแทนที่:" +msgstr "ค้นหาทรัพยากรมาแทนที่:" #: editor/dependency_editor.cpp editor/editor_file_dialog.cpp #: editor/editor_help_search.cpp editor/editor_node.cpp @@ -1076,9 +1008,8 @@ msgid "Owners Of:" msgstr "เจ้าของของ:" #: editor/dependency_editor.cpp -#, fuzzy msgid "Remove selected files from the project? (Can't be restored)" -msgstr "ลบไฟล์ที่เลือกออกจากโปรเจกต์? (ย้อนกลับไม่ได้)" +msgstr "ลบไฟล์ที่เลือกออกจากโปรเจกต์? (กู้คืนไม่ได้)" #: editor/dependency_editor.cpp msgid "" @@ -1086,8 +1017,8 @@ msgid "" "work.\n" "Remove them anyway? (no undo)" msgstr "" -"มีรีซอร์สอื่นต้องการไฟล์ที่กำลังลบ\n" -"ยืนยันจะลบหรือไม่? (ย้อนกลับไม่ได้)" +"ไฟล์ที่กำลังจะลบ จำเป็นสำหรับใช้งานโดยทรัพยากรอันอื่น\n" +"จะทำการลบหรือไม่? (คืนกลับไม่ได้)" #: editor/dependency_editor.cpp msgid "Cannot remove:" @@ -1098,9 +1029,8 @@ msgid "Error loading:" msgstr "ผิดพลาดขณะโหลด:" #: editor/dependency_editor.cpp -#, fuzzy msgid "Load failed due to missing dependencies:" -msgstr "โหลดฉากไม่ได้เนื่องจากการอ้างอิงสูญหาย:" +msgstr "โหลดผิดพลาดเนื่องจากการอ้างอิงสูญหาย:" #: editor/dependency_editor.cpp editor/editor_node.cpp msgid "Open Anyway" @@ -1120,16 +1050,15 @@ msgstr "ผิดพลาดขณะโหลด!" #: editor/dependency_editor.cpp msgid "Permanently delete %d item(s)? (No undo!)" -msgstr "ลบ %d ไฟล์ถาวร? (ย้อนกลับไม่ได้!)" +msgstr "ลบไอเทม %d ถาวรหรือไม่? (ย้อนกลับไม่ได้!)" #: editor/dependency_editor.cpp -#, fuzzy msgid "Show Dependencies" -msgstr "การอ้างอิง" +msgstr "แสดงการอ้างอิง" #: editor/dependency_editor.cpp msgid "Orphan Resource Explorer" -msgstr "ตัวจัดการรีซอร์สที่ไม่มีเจ้าของ" +msgstr "ทรัพยากรที่ไม่ได้ใช้" #: editor/dependency_editor.cpp editor/editor_audio_buses.cpp #: editor/editor_file_dialog.cpp editor/editor_node.cpp @@ -1216,12 +1145,10 @@ msgid "License" msgstr "สัญญาอนุญาต" #: editor/editor_about.cpp -#, fuzzy msgid "Third-party Licenses" -msgstr "สัญญาอนุญาตไลบรารี" +msgstr "สัญญาอนุญาตจากบุคคลที่สาม" #: editor/editor_about.cpp -#, fuzzy msgid "" "Godot Engine relies on a number of third-party free and open source " "libraries, all compatible with the terms of its MIT license. The following " @@ -1229,8 +1156,8 @@ msgid "" "respective copyright statements and license terms." msgstr "" "Godot Engine อาศัยไลบรารีต่าง ๆ ที่นำมาใช้ได้อย่างเสรีและเปิดเผยโค้ดเป็นจำนวนมาก " -"ซึ่งเข้ากันได้กับสัญญาอนุญาต MIT ต่อไปนี้เป็นรายชื่อของไลบรารีทั้งหมด รวมถึงข้อความลิขสิทธิ์ " -"และข้อกำหนดการใช้งานของแต่ละไลบรารี" +"ซึ่งเข้ากันได้กับสัญญาอนุญาต MIT ต่อไปนี้เป็นรายชื่อของไลบรารีทั้งหมดของบุคคลที่สาม " +"รวมถึงข้อความลิขสิทธิ์ และข้อกำหนดการใช้งานของแต่ละไลบรารี" #: editor/editor_about.cpp msgid "All Components" @@ -1245,14 +1172,12 @@ msgid "Licenses" msgstr "สัญญาอนุญาต" #: editor/editor_asset_installer.cpp editor/project_manager.cpp -#, fuzzy msgid "Error opening package file, not in ZIP format." msgstr "ผิดพลาดขณะเปิดไฟล์แพคเกจ, ไม่ใช่รูปแบบ zip" #: editor/editor_asset_installer.cpp -#, fuzzy msgid "%s (Already Exists)" -msgstr "มีอยู่ก่อนแล้ว" +msgstr "%s (มีอยู่ก่อนแล้ว)" #: editor/editor_asset_installer.cpp msgid "Uncompressing Assets" @@ -1263,12 +1188,10 @@ msgid "The following files failed extraction from package:" msgstr "ผิดพลาดขณะแยกไฟล์ต่อไปนี้จากแพคเกจ:" #: editor/editor_asset_installer.cpp -#, fuzzy msgid "And %s more files." msgstr "และอีก %d ไฟล์" #: editor/editor_asset_installer.cpp editor/project_manager.cpp -#, fuzzy msgid "Package installed successfully!" msgstr "ติดตั้งแพคเกจเสร็จสมบูรณ์!" @@ -1278,9 +1201,8 @@ msgid "Success!" msgstr "สำเร็จ!" #: editor/editor_asset_installer.cpp -#, fuzzy msgid "Package Contents:" -msgstr "ประกอบด้วย:" +msgstr "เนื้อหาแพคเกจ:" #: editor/editor_asset_installer.cpp editor/editor_node.cpp msgid "Install" @@ -1296,7 +1218,7 @@ msgstr "ลำโพง" #: editor/editor_audio_buses.cpp msgid "Add Effect" -msgstr "เอฟเฟกต์" +msgstr "เพิ่มเอฟเฟกต์" #: editor/editor_audio_buses.cpp msgid "Rename Audio Bus" @@ -1324,20 +1246,19 @@ msgstr "เลือก Audio Bus ที่ส่งต่อ" #: editor/editor_audio_buses.cpp msgid "Add Audio Bus Effect" -msgstr "เพิ่มเอฟเฟกต์เสียง" +msgstr "เพิ่มเอฟเฟกต์บัสเสียง" #: editor/editor_audio_buses.cpp msgid "Move Bus Effect" -msgstr "ย้ายเอฟเฟกต์เสียง" +msgstr "ย้ายเอฟเฟกต์บัสเสียง" #: editor/editor_audio_buses.cpp msgid "Delete Bus Effect" -msgstr "ลบเอฟเฟกต์เสียง" +msgstr "ลบเอฟเฟกต์บัสเสียง" #: editor/editor_audio_buses.cpp -#, fuzzy msgid "Drag & drop to rearrange." -msgstr "Audio Bus ลากและวางเพื่อย้ายตำแหน่ง" +msgstr "ลากและวางเพื่อจัดเรียง" #: editor/editor_audio_buses.cpp msgid "Solo" @@ -1378,15 +1299,15 @@ msgstr "เพิ่ม Audio Bus" #: editor/editor_audio_buses.cpp msgid "Master bus can't be deleted!" -msgstr "ลบ Bus หลักไม่ได้!" +msgstr "ลบบัสหลักไม่ได้!" #: editor/editor_audio_buses.cpp msgid "Delete Audio Bus" -msgstr "ลบ Audio Bus" +msgstr "ลบบัสเสียง" #: editor/editor_audio_buses.cpp msgid "Duplicate Audio Bus" -msgstr "ทำซ้ำ Audio Bus" +msgstr "ทำซ้ำบัสเสียง" #: editor/editor_audio_buses.cpp msgid "Reset Bus Volume" @@ -1394,11 +1315,11 @@ msgstr "รีเซ็ตระดับเสียงบัส" #: editor/editor_audio_buses.cpp msgid "Move Audio Bus" -msgstr "ย้าย Audio Bus" +msgstr "ย้ายบัสเสียง" #: editor/editor_audio_buses.cpp msgid "Save Audio Bus Layout As..." -msgstr "บันทึกเลย์เอาต์ของ Audio Bus เป็น..." +msgstr "บันทึกเลย์เอาต์ของบัสเสียงเป็น..." #: editor/editor_audio_buses.cpp msgid "Location for New Layout..." @@ -1406,11 +1327,11 @@ msgstr "ตำแหน่งของเลย์เอาต์ใหม่... #: editor/editor_audio_buses.cpp msgid "Open Audio Bus Layout" -msgstr "เปิดเลย์เอาต์ของ Audio Bus" +msgstr "เปิดเลย์เอาต์ของบัสเสียง" #: editor/editor_audio_buses.cpp msgid "There is no '%s' file." -msgstr "" +msgstr "ไม่มีไฟล์ '%s'" #: editor/editor_audio_buses.cpp editor/plugins/canvas_item_editor_plugin.cpp msgid "Layout" @@ -1421,18 +1342,16 @@ msgid "Invalid file, not an audio bus layout." msgstr "ไฟล์ไม่ถูกต้อง ไม่ใช่เลย์เอาต์ของ Audio Bus" #: editor/editor_audio_buses.cpp -#, fuzzy msgid "Error saving file: %s" -msgstr "ผิดพลาดขณะบันทึก TileSet!" +msgstr "ผิดพลาดขณะบันทึกไฟล์: %s" #: editor/editor_audio_buses.cpp msgid "Add Bus" -msgstr "เพิ่ม Bus" +msgstr "เพิ่มบัส" #: editor/editor_audio_buses.cpp -#, fuzzy msgid "Add a new Audio Bus to this layout." -msgstr "บันทึกเลย์เอาต์ของ Audio Bus เป็น..." +msgstr "เพิ่มบัสเสียงไปยังเลย์เอาต์นี้" #: editor/editor_audio_buses.cpp editor/editor_properties.cpp #: editor/plugins/animation_player_editor_plugin.cpp editor/property_editor.cpp @@ -1442,7 +1361,7 @@ msgstr "โหลด" #: editor/editor_audio_buses.cpp msgid "Load an existing Bus Layout." -msgstr "โหลดเลย์เอาต์ Bus จากดิสก์" +msgstr "โหลดเลย์เอาต์บัสจากดิสก์" #: editor/editor_audio_buses.cpp msgid "Save As" @@ -1450,7 +1369,7 @@ msgstr "บันทึกเป็น" #: editor/editor_audio_buses.cpp msgid "Save this Bus Layout to a file." -msgstr "บันทึกเลย์เอาต์ของ Bus นี้เป็นไฟล์" +msgstr "บันทึกเลย์เอาต์ของบัสนี้เป็นไฟล์" #: editor/editor_audio_buses.cpp editor/import_dock.cpp msgid "Load Default" @@ -1458,11 +1377,11 @@ msgstr "โหลดค่าเริ่มต้น" #: editor/editor_audio_buses.cpp msgid "Load the default Bus Layout." -msgstr "โหลดค่าเริ่มต้นเลย์เอาต์ Bus" +msgstr "โหลดค่าเริ่มต้นเลย์เอาต์บัส" #: editor/editor_audio_buses.cpp msgid "Create a new Bus Layout." -msgstr "สร้างเลย์เอาต์ Bus ใหม่" +msgstr "สร้างเลย์เอาต์บัสใหม่" #: editor/editor_autoload_settings.cpp msgid "Invalid name." @@ -1473,19 +1392,16 @@ msgid "Valid characters:" msgstr "ตัวอักษรที่ใช้ได้:" #: editor/editor_autoload_settings.cpp -#, fuzzy msgid "Must not collide with an existing engine class name." -msgstr "ชื่อผิดพลาด ต้องไม่ใช้ชื่อเดียวกับคลาสของโปรแกรม" +msgstr "ต้องไม่ใช้ชื่อเดียวกับชื่อคลาสของโปรแกรม" #: editor/editor_autoload_settings.cpp -#, fuzzy msgid "Must not collide with an existing built-in type name." -msgstr "ชื่อผิดพลาด ต้องไม่ใช้ชื่อเดียวกับชนิดตัวแปร" +msgstr "ต้องไม่ใช้ชื่อเดียวกับชื่อชนิดบิวท์อินที่มีอยู่แล้ว" #: editor/editor_autoload_settings.cpp -#, fuzzy msgid "Must not collide with an existing global constant name." -msgstr "ชื่อผิดพลาด ต้องไม่ใช้ชื่อเดียวกับค่าคงที่" +msgstr "ต้องไม่ใช้ชื่อเดียวกับชื่อค่าคงที่โกลบอล" #: editor/editor_autoload_settings.cpp msgid "Keyword cannot be used as an autoload name." @@ -1511,7 +1427,7 @@ msgstr "เลื่อนออโต้โหลด" msgid "Remove Autoload" msgstr "ลบออโต้โหลด" -#: editor/editor_autoload_settings.cpp +#: editor/editor_autoload_settings.cpp editor/editor_plugin_settings.cpp msgid "Enable" msgstr "เปิด" @@ -1520,7 +1436,6 @@ msgid "Rearrange Autoloads" msgstr "จัดลำดับออโต้โหลด" #: editor/editor_autoload_settings.cpp editor/script_create_dialog.cpp -#, fuzzy msgid "Invalid path." msgstr "ตำแหน่งผิดพลาด" @@ -1582,7 +1497,6 @@ msgid "[unsaved]" msgstr "[ไฟล์ใหม่]" #: editor/editor_dir_dialog.cpp -#, fuzzy msgid "Please select a base directory first." msgstr "กรุณาเลือกโฟลเดอร์เริ่มต้นก่อน" @@ -1617,11 +1531,8 @@ msgid "Storing File:" msgstr "เก็บไฟล์:" #: editor/editor_export.cpp -#, fuzzy msgid "No export template found at the expected path:" -msgstr "" -"ไม่มีแม่แบบสำหรับส่งออก\n" -"ดาวน์โหลดและติดตั้งแม่แบบ" +msgstr "ไม่พบแม่แบบส่งออกที่ที่อยู่ที่คาดไว้:" #: editor/editor_export.cpp msgid "Packing" @@ -1632,12 +1543,16 @@ msgid "" "Target platform requires 'ETC' texture compression for GLES2. Enable 'Import " "Etc' in Project Settings." msgstr "" +"แพลตฟอร์มเป้าหมายต้องการการบีบอัดเทกเจอร์ 'ETC' สำหรับ GLES2 เปิด 'Import Etc' " +"ในตั้งค่าโปรเจ็ค" #: editor/editor_export.cpp msgid "" "Target platform requires 'ETC2' texture compression for GLES3. Enable " "'Import Etc 2' in Project Settings." msgstr "" +"แพลตฟอร์มเป้าหมายต้องการการบีบอัดเทกเจอร์ 'ETC2' สำหรับ GLES3 เปิด 'Import Etc 2' " +"ในตั้งค่าโปรเจ็ค" #: editor/editor_export.cpp msgid "" @@ -1646,13 +1561,14 @@ msgid "" "Enable 'Import Etc' in Project Settings, or disable 'Driver Fallback " "Enabled'." msgstr "" +"แพลตฟอร์มเป้าหมายต้องการการบีบอัดเทกเจอร์ 'ETC' สำหรับการกลับมาใช้ GLES2\n" +"เปิด 'Import Etc' ในตั้งค่าโปรเจ็คหรือปิด 'Driver Fallback Enabled'" #: editor/editor_export.cpp platform/android/export/export.cpp #: platform/iphone/export/export.cpp platform/javascript/export/export.cpp #: platform/osx/export/export.cpp platform/uwp/export/export.cpp -#, fuzzy msgid "Custom debug template not found." -msgstr "ไม่พบแพคเกจดีบัคที่กำหนด" +msgstr "ไม่พบแม่แบบการดีบักแบบกำหนดเอง" #: editor/editor_export.cpp platform/android/export/export.cpp #: platform/iphone/export/export.cpp platform/javascript/export/export.cpp @@ -1663,31 +1579,27 @@ msgstr "ไม่พบแพคเกจจำหน่ายที่กำห #: editor/editor_export.cpp platform/javascript/export/export.cpp msgid "Template file not found:" -msgstr "ไม่พบแม่แบบ:" +msgstr "ไม่พบไฟล์แม่แบบ:" #: editor/editor_export.cpp msgid "On 32-bit exports the embedded PCK cannot be bigger than 4 GiB." -msgstr "" +msgstr "การส่งออกแบบ 32 bit PCK แบบฝังตัวไม่สามารถใหญ่ได้เกิน 4 GiB" #: editor/editor_feature_profile.cpp -#, fuzzy msgid "3D Editor" -msgstr "โปรแกรม" +msgstr "เอดิเตอร์ 3D" #: editor/editor_feature_profile.cpp -#, fuzzy msgid "Script Editor" -msgstr "เปิดตัวแก้ไขสคริปต์" +msgstr "เอดิเตอร์สคริปต์" #: editor/editor_feature_profile.cpp -#, fuzzy msgid "Asset Library" -msgstr "เปิดแหล่งรวมทรัพยากร" +msgstr "ไลบรารีทรัพยากร" #: editor/editor_feature_profile.cpp -#, fuzzy msgid "Scene Tree Editing" -msgstr "ผังฉาก (โหนด):" +msgstr "แก้ไขผังฉาก" #: editor/editor_feature_profile.cpp #, fuzzy @@ -1705,92 +1617,80 @@ msgid "FileSystem and Import Docks" msgstr "ระบบไฟล์" #: editor/editor_feature_profile.cpp -#, fuzzy msgid "Erase profile '%s'? (no undo)" -msgstr "แทนที่ทั้งหมด" +msgstr "ลบโปรไฟล์ '%s' หรือไม่? (ทำกลับไม่ได้)" #: editor/editor_feature_profile.cpp msgid "Profile must be a valid filename and must not contain '.'" -msgstr "" +msgstr "โปรไฟล์จะต้องมีชื่อไฟล์ที่ถูกต้อง และต้องไม่มี '.'" #: editor/editor_feature_profile.cpp -#, fuzzy msgid "Profile with this name already exists." -msgstr "มีชื่อกลุ่มนี้อยู่แล้ว" +msgstr "มีโปรไฟล์ที่มีชื่อนี้อยู๋แล้ว" #: editor/editor_feature_profile.cpp msgid "(Editor Disabled, Properties Disabled)" -msgstr "" +msgstr "(เอดิเตอร์ถูกปิดการใช้งาน, คุณสมบัติถูกปิดการใช้งาน)" #: editor/editor_feature_profile.cpp -#, fuzzy msgid "(Properties Disabled)" -msgstr "คุณสมบัติ" +msgstr "(ปิดการทำงานคุณสมบัติ)" #: editor/editor_feature_profile.cpp -#, fuzzy msgid "(Editor Disabled)" -msgstr "ปิดการตัด" +msgstr "(เอดิเตอร์ถูกปิดการใช้งาน)" #: editor/editor_feature_profile.cpp -#, fuzzy msgid "Class Options:" -msgstr "รายละเอียด:" +msgstr "ตั้งค่าคลาส:" #: editor/editor_feature_profile.cpp -#, fuzzy msgid "Enable Contextual Editor" -msgstr "เปิดตัวแก้ไขถัดไป" +msgstr "เปิดการทำงานเอดิเตอร์ตามบริบท" #: editor/editor_feature_profile.cpp -#, fuzzy msgid "Enabled Properties:" -msgstr "คุณสมบัติ:" +msgstr "เปิดการทำงานคุณสมบัติ:" #: editor/editor_feature_profile.cpp -#, fuzzy msgid "Enabled Features:" -msgstr "ฟีเจอร์" +msgstr "เปิดการทำงานฟีเจอร์:" #: editor/editor_feature_profile.cpp -#, fuzzy msgid "Enabled Classes:" -msgstr "ค้นหาคลาส" +msgstr "เปิดการทำงานคลาส:" #: editor/editor_feature_profile.cpp msgid "File '%s' format is invalid, import aborted." -msgstr "" +msgstr "นามสกุลของไฟล์ '%s' ผิดพลาด ยกเลิกการนำเข้า" #: editor/editor_feature_profile.cpp msgid "" "Profile '%s' already exists. Remove it first before importing, import " "aborted." -msgstr "" +msgstr "มีโปรไฟล์ '%s' อยู่แล้ว กรุณาลบก่อนที่จะนำเข้า, การนำเข้าถูกยกเลิก" #: editor/editor_feature_profile.cpp -#, fuzzy msgid "Error saving profile to path: '%s'." -msgstr "ผิดพลาดขณะโหลดแม่แบบ '%s'" +msgstr "ผิดพลาดขณะบันทึกโปรไฟล์ไปยังแพทช์: '%s'" #: editor/editor_feature_profile.cpp msgid "Unset" -msgstr "" +msgstr "ยกเลิกการตั้งค่า" #: editor/editor_feature_profile.cpp -#, fuzzy msgid "Current Profile:" -msgstr "รุ่นปัจจุบัน:" +msgstr "โปรไฟล์ปัจจุบัน:" #: editor/editor_feature_profile.cpp -#, fuzzy msgid "Make Current" -msgstr "ปัจจุบัน:" +msgstr "ทำให้เป็นปัจจุบัน" #: editor/editor_feature_profile.cpp #: editor/plugins/animation_player_editor_plugin.cpp #: editor/plugins/version_control_editor_plugin.cpp msgid "New" -msgstr "ไฟล์ใหม่" +msgstr "ใหม่" #: editor/editor_feature_profile.cpp editor/editor_node.cpp #: editor/project_manager.cpp @@ -1802,44 +1702,36 @@ msgid "Export" msgstr "ส่งออก" #: editor/editor_feature_profile.cpp -#, fuzzy msgid "Available Profiles:" -msgstr "โหนดที่มีให้ใช้:" +msgstr "โปรไฟล์ที่มีให้ใช้:" #: editor/editor_feature_profile.cpp -#, fuzzy msgid "Class Options" -msgstr "รายละเอียด" +msgstr "ตั้งค่าคลาส" #: editor/editor_feature_profile.cpp -#, fuzzy msgid "New profile name:" -msgstr "ชื่อใหม่:" +msgstr "ชื่อโปรไฟล์ใหม่:" #: editor/editor_feature_profile.cpp -#, fuzzy msgid "Erase Profile" -msgstr "ลบพื้นที่" +msgstr "ลบโปรไฟล์" #: editor/editor_feature_profile.cpp -#, fuzzy msgid "Godot Feature Profile" -msgstr "จัดการแม่แบบส่งออก" +msgstr "รายละเอียดคุณสมบัติ Godot" #: editor/editor_feature_profile.cpp -#, fuzzy msgid "Import Profile(s)" -msgstr "นำเข้าโปรเจกต์แล้ว" +msgstr "นำเข้าโปรไฟล์" #: editor/editor_feature_profile.cpp -#, fuzzy msgid "Export Profile" -msgstr "ส่งออกโปรเจกต์" +msgstr "ส่งออกโปรไฟล์" #: editor/editor_feature_profile.cpp -#, fuzzy msgid "Manage Editor Feature Profiles" -msgstr "จัดการแม่แบบส่งออก" +msgstr "จัดการรายละเอียดคุณสมบัติเอดิเตอร์" #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Select Current Folder" @@ -1850,7 +1742,6 @@ msgid "File Exists, Overwrite?" msgstr "มีไฟล์นี้อยู่แล้ว จะเขียนทับหรือไม่?" #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp -#, fuzzy msgid "Select This Folder" msgstr "เลือกโฟลเดอร์นี้" @@ -1859,13 +1750,11 @@ msgid "Copy Path" msgstr "คัดลอกตำแหน่ง" #: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp -#, fuzzy msgid "Open in File Manager" -msgstr "แสดงในตัวจัดการไฟล์" +msgstr "เปิดโฟลเดอร์" #: editor/editor_file_dialog.cpp editor/editor_node.cpp #: editor/filesystem_dock.cpp editor/project_manager.cpp -#, fuzzy msgid "Show in File Manager" msgstr "แสดงในตัวจัดการไฟล์" @@ -1950,44 +1839,36 @@ msgid "Move Favorite Down" msgstr "เลื่อนโฟลเดอร์ที่ชอบลง" #: editor/editor_file_dialog.cpp -#, fuzzy msgid "Go to previous folder." -msgstr "ไปยังโฟลเดอร์หลัก" +msgstr "ไปยังโฟลเดอร์ก่อนหน้า" #: editor/editor_file_dialog.cpp -#, fuzzy msgid "Go to next folder." -msgstr "ไปยังโฟลเดอร์หลัก" +msgstr "ไปยังโฟลเดอร์ถัดไป" #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp -#, fuzzy msgid "Go to parent folder." msgstr "ไปยังโฟลเดอร์หลัก" #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp -#, fuzzy msgid "Refresh files." -msgstr "ค้นหาคลาส" +msgstr "รีเฟรชไฟล์" #: editor/editor_file_dialog.cpp -#, fuzzy msgid "(Un)favorite current folder." -msgstr "ไม่สามารถสร้างโฟลเดอร์" +msgstr "เพิ่ม/ลบโฟลเดอร์ปัจจุบันไปยังที่ชื่นชอบ" #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp -#, fuzzy msgid "Toggle the visibility of hidden files." -msgstr "เปิด/ปิดไฟล์ที่ซ่อน" +msgstr "เปิด/ปิดการแสดงไฟล์ที่ซ่อน" #: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp -#, fuzzy msgid "View items as a grid of thumbnails." -msgstr "แสดงเป็นภาพตัวอย่าง" +msgstr "แสดงไอเทมในรูปแบบตาราง" #: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp -#, fuzzy msgid "View items as a list." -msgstr "แสดงเป็นรายชื่อไฟล์" +msgstr "แสดงไอเทมในรูปแบบลิสต์รายชื่อ" #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Directories & Files:" @@ -2015,7 +1896,7 @@ msgstr "สแกนต้นฉบับ" msgid "" "There are multiple importers for different types pointing to file %s, import " "aborted" -msgstr "" +msgstr "มีการนำเข้าไฟล์ %s หลายอัน การนำเข้าถูกยกเลิก" #: editor/editor_file_system.cpp msgid "(Re)Importing Assets" @@ -2039,55 +1920,48 @@ msgid "Inherited by:" msgstr "สืบทอดโดย:" #: editor/editor_help.cpp -#, fuzzy msgid "Description" -msgstr "รายละเอียด:" +msgstr "รายละเอียด" #: editor/editor_help.cpp -#, fuzzy msgid "Online Tutorials" -msgstr "สอนใช้งานออนไลน์:" +msgstr "บทสอนออนไลน์" #: editor/editor_help.cpp msgid "Properties" msgstr "คุณสมบัติ" #: editor/editor_help.cpp -#, fuzzy msgid "override:" -msgstr "กำหนดเฉพาะ..." +msgstr "แทนที่:" #: editor/editor_help.cpp -#, fuzzy msgid "default:" -msgstr "ค่าเริ่มต้น" +msgstr "ค่าเริ่มต้น:" #: editor/editor_help.cpp msgid "Methods" msgstr "รายชื่อเมท็อด" #: editor/editor_help.cpp -#, fuzzy msgid "Theme Properties" -msgstr "คุณสมบัติ" +msgstr "คุณสมบัติธีม" #: editor/editor_help.cpp msgid "Enumerations" -msgstr "ค่าคงที่" +msgstr "อีนัม" #: editor/editor_help.cpp msgid "Constants" msgstr "ค่าคงที่" #: editor/editor_help.cpp -#, fuzzy msgid "Property Descriptions" -msgstr "รายละเอียดตัวแปร:" +msgstr "รายละเอียดของคุณสมบัติ" #: editor/editor_help.cpp -#, fuzzy msgid "(value)" -msgstr "ค่า" +msgstr "(ค่า)" #: editor/editor_help.cpp msgid "" @@ -2096,9 +1970,8 @@ msgid "" msgstr "คุณสมบัตินี้ยังไม่มีคำอธิบาย โปรดช่วย[color=$color][url=$url]แก้ไข[/url][/color]!" #: editor/editor_help.cpp -#, fuzzy msgid "Method Descriptions" -msgstr "รายละเอียดเมท็อด:" +msgstr "รายละเอียดเมท็อด" #: editor/editor_help.cpp msgid "" @@ -2116,62 +1989,50 @@ msgid "Case Sensitive" msgstr "ตรงตามอักษรพิมพ์เล็ก-ใหญ่" #: editor/editor_help_search.cpp -#, fuzzy msgid "Show Hierarchy" -msgstr "แสดงตัวช่วย" +msgstr "แสดงลำดับชั้น" #: editor/editor_help_search.cpp -#, fuzzy msgid "Display All" -msgstr "แสดงปกติ" +msgstr "แสดงทั้งหมด" #: editor/editor_help_search.cpp -#, fuzzy msgid "Classes Only" -msgstr "คลาส" +msgstr "คลาสเท่านั้น" #: editor/editor_help_search.cpp -#, fuzzy msgid "Methods Only" -msgstr "รายชื่อเมท็อด" +msgstr "เมท็อดเท่านั้น" #: editor/editor_help_search.cpp -#, fuzzy msgid "Signals Only" -msgstr "สัญญาณ" +msgstr "สัญญาณเท่านั้น" #: editor/editor_help_search.cpp -#, fuzzy msgid "Constants Only" -msgstr "ค่าคงที่" +msgstr "ค่าคงที่เท่านั้น" #: editor/editor_help_search.cpp -#, fuzzy msgid "Properties Only" -msgstr "คุณสมบัติ" +msgstr "คุณสมบัติเท่านั้น" #: editor/editor_help_search.cpp -#, fuzzy msgid "Theme Properties Only" -msgstr "คุณสมบัติ" +msgstr "คุณสมบัติธีมเท่านั้น" #: editor/editor_help_search.cpp -#, fuzzy msgid "Member Type" -msgstr "ตัวแปร" +msgstr "ชนิดสมาชิก" #: editor/editor_help_search.cpp -#, fuzzy msgid "Class" -msgstr "คลาส:" +msgstr "คลาส" #: editor/editor_help_search.cpp -#, fuzzy msgid "Method" -msgstr "รายชื่อเมท็อด" +msgstr "เมธอด" #: editor/editor_help_search.cpp editor/plugins/script_text_editor.cpp -#, fuzzy msgid "Signal" msgstr "สัญญาณ" @@ -2180,14 +2041,12 @@ msgid "Constant" msgstr "คงที่" #: editor/editor_help_search.cpp -#, fuzzy msgid "Property" -msgstr "คุณสมบัติ:" +msgstr "คุณสมบัติ" #: editor/editor_help_search.cpp -#, fuzzy msgid "Theme Property" -msgstr "คุณสมบัติ" +msgstr "คุณสมบัติธีม" #: editor/editor_inspector.cpp editor/project_settings_editor.cpp msgid "Property:" @@ -2203,12 +2062,11 @@ msgstr "" #: editor/editor_log.cpp msgid "Output:" -msgstr "ข้อความ:" +msgstr "เอาท์พุต:" #: editor/editor_log.cpp editor/plugins/tile_map_editor_plugin.cpp -#, fuzzy msgid "Copy Selection" -msgstr "ลบที่เลือก" +msgstr "คัดลอกที่เลือก" #: editor/editor_log.cpp editor/editor_network_profiler.cpp #: editor/editor_profiler.cpp editor/editor_properties.cpp @@ -2218,7 +2076,7 @@ msgstr "ลบที่เลือก" #: modules/gdnative/gdnative_library_editor_plugin.cpp scene/gui/line_edit.cpp #: scene/gui/text_edit.cpp msgid "Clear" -msgstr "ลบ" +msgstr "เคลียร์" #: editor/editor_log.cpp msgid "Clear Output" @@ -2231,13 +2089,12 @@ msgstr "หยุด" #: editor/editor_network_profiler.cpp editor/editor_profiler.cpp #: editor/plugins/animation_state_machine_editor.cpp editor/rename_dialog.cpp -#, fuzzy msgid "Start" -msgstr "เริ่ม!" +msgstr "เริ่ม" #: editor/editor_network_profiler.cpp msgid "%s/s" -msgstr "" +msgstr "%s/s" #: editor/editor_network_profiler.cpp msgid "Down" @@ -2268,13 +2125,12 @@ msgid "Outgoing RSET" msgstr "" #: editor/editor_node.cpp editor/project_manager.cpp -#, fuzzy msgid "New Window" -msgstr "หน้าต่าง" +msgstr "หน้าต่างใหม่" #: editor/editor_node.cpp msgid "Imported resources can't be saved." -msgstr "" +msgstr "ทรัพยากรที่นำเข้ามา ไม่สามารถบันทึกได้" #: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp #: scene/gui/dialogs.cpp @@ -2283,7 +2139,7 @@ msgstr "ตกลง" #: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp msgid "Error saving resource!" -msgstr "บันทึกรีซอร์สผิดพลาด!" +msgstr "บันทึกทรัพยากรผิดพลาด!" #: editor/editor_node.cpp msgid "" @@ -2301,7 +2157,7 @@ msgstr "เปิดไฟล์เพื่อเขียนไม่ได้ #: editor/editor_node.cpp msgid "Requested file format unknown:" -msgstr "ไม่ทราบรูปแบบไฟล์ที่ร้องขอ:" +msgstr "ไม่ทราบนามสกุลไฟล์ที่ร้องขอ:" #: editor/editor_node.cpp msgid "Error while saving." @@ -2309,7 +2165,7 @@ msgstr "ผิดพลาดขณะบันทึก" #: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp msgid "Can't open '%s'. The file could have been moved or deleted." -msgstr "" +msgstr "ไม่สามารถเปิด '%s' เนื่องจากไฟล์ถูกย้ายหรือถูกลบ" #: editor/editor_node.cpp msgid "Error while parsing '%s'." @@ -2357,23 +2213,23 @@ msgstr "บันทึกฉากไม่ได้ อาจจะมีก #: editor/editor_node.cpp editor/scene_tree_dock.cpp msgid "Can't overwrite scene that is still open!" -msgstr "" +msgstr "ไม่สามารถเขียนทับฉากที่กำลังเปิดอยู่ได้!" #: editor/editor_node.cpp msgid "Can't load MeshLibrary for merging!" -msgstr "โหลด MeshLibrary เพื่อรวมไม่ได้!" +msgstr "ไม่สามารถโหลดไลบรารี Mesh เพื่อควบรวม!" #: editor/editor_node.cpp msgid "Error saving MeshLibrary!" -msgstr "ผิดพลาดขณะบันทึก MeshLibrary!" +msgstr "ผิดพลาดขณะบันทึกไลบรารี Mesh!" #: editor/editor_node.cpp msgid "Can't load TileSet for merging!" -msgstr "โหลด TileSet เพื่อรวมไม่ได้!" +msgstr "โหลดไทล์เซตเพื่อรวมไม่ได้!" #: editor/editor_node.cpp msgid "Error saving TileSet!" -msgstr "ผิดพลาดขณะบันทึก TileSet!" +msgstr "ผิดพลาดขณะบันทึกไทล์เซต!" #: editor/editor_node.cpp msgid "Error trying to save layout!" @@ -2401,13 +2257,12 @@ msgstr "" "อ่านรายละเอียดเพิ่มเติมได้จากคู่มือในส่วนของการนำเข้าฉาก" #: editor/editor_node.cpp -#, fuzzy msgid "" "This resource belongs to a scene that was instanced or inherited.\n" "Changes to it won't be kept when saving the current scene." msgstr "" -"รีซอร์สนี้เป็นของฉากที่ถูกอินสแตนซ์หรือสืบทอด\n" -"การแก้ไขจะไม่ถูกบันทึก" +"ทรัพยากรนี้เป็นฉากที่เป็นอินสแตนซ์หรือสืบทอด\n" +"การเปลี่ยนแปลงจะไม่ถูกเก็บไว้ เมื่อบันทึกฉากปัจจุบัน" #: editor/editor_node.cpp msgid "" @@ -2458,17 +2313,16 @@ msgid "Open Base Scene" msgstr "เปิดไฟล์ฉากที่ใช้สืบทอด" #: editor/editor_node.cpp -#, fuzzy msgid "Quick Open..." -msgstr "เปิดไฟล์ฉากด่วน..." +msgstr "เปิดด่วน..." #: editor/editor_node.cpp msgid "Quick Open Scene..." -msgstr "เปิดไฟล์ฉากด่วน..." +msgstr "เปิดฉากด่วน..." #: editor/editor_node.cpp msgid "Quick Open Script..." -msgstr "เปิดไฟล์สคริปต์ด่วน..." +msgstr "เปิดสคริปต์ด่วน..." #: editor/editor_node.cpp msgid "Save & Close" @@ -2479,14 +2333,12 @@ msgid "Save changes to '%s' before closing?" msgstr "บันทึก '%s' ก่อนปิดโปรแกรมหรือไม่?" #: editor/editor_node.cpp -#, fuzzy msgid "Saved %s modified resource(s)." -msgstr "โหลดรีซอร์สไม่ได้" +msgstr "บันทึกทรัพยากร %s ที่ถูกแก้ไขสำเร็จ" #: editor/editor_node.cpp -#, fuzzy msgid "A root node is required to save the scene." -msgstr "Texture ขนาดใหญ่ต้องการแค่ไฟล์เดียว" +msgstr "โหนดแม่จำเป็นต้องทำการบันทึกฉาก" #: editor/editor_node.cpp msgid "Save Scene As..." @@ -2510,11 +2362,11 @@ msgstr "ทำไม่ได้ถ้าไม่มีฉาก" #: editor/editor_node.cpp msgid "Export Mesh Library" -msgstr "ส่งออก Mesh Library" +msgstr "ส่งออกไลบรารี Mesh" #: editor/editor_node.cpp msgid "This operation can't be done without a root node." -msgstr "ทำไม่ได้ถ้าไม่มีโหนดราก" +msgstr "ไม่สามารถกระทำได้สำเร็จถ้าไม่มีโหนดแม่" #: editor/editor_node.cpp msgid "Export Tile Set" @@ -2584,9 +2436,8 @@ msgid "Close Scene" msgstr "ปิดไฟล์ฉาก" #: editor/editor_node.cpp -#, fuzzy msgid "Reopen Closed Scene" -msgstr "ปิดไฟล์ฉาก" +msgstr "เปิดไฟล์ฉากที่ปิดไปใหม่" #: editor/editor_node.cpp msgid "Unable to enable addon plugin at: '%s' parsing of config failed." @@ -2601,11 +2452,12 @@ msgid "Unable to load addon script from path: '%s'." msgstr "ไม่สามารถโหลดสคริปต์จาก: '%s'" #: editor/editor_node.cpp -#, fuzzy msgid "" "Unable to load addon script from path: '%s' There seems to be an error in " "the code, please check the syntax." -msgstr "ไม่สามารถโหลดสคริปต์จาก: '%s' ไม่ใช่สคริปต์ tool" +msgstr "" +"ไม่สามารถโหลดสคริปต์ส่วนเสริมจาก: '%s' เหมือนว่าจะเกิดข้อผิดพลาดขึ้นในโค้ด " +"กรุณาเช็ตรูปแบบการเขียนโค้ด" #: editor/editor_node.cpp msgid "" @@ -2682,24 +2534,20 @@ msgstr "ค่าเริ่มต้น" #: editor/editor_node.cpp editor/editor_properties.cpp #: editor/plugins/script_editor_plugin.cpp editor/property_editor.cpp -#, fuzzy msgid "Show in FileSystem" -msgstr "เปิดในตัวจัดการไฟล์" +msgstr "แสดงในรูปแบบไฟล์" #: editor/editor_node.cpp -#, fuzzy msgid "Play This Scene" -msgstr "เล่น" +msgstr "เล่นฉากนี้" #: editor/editor_node.cpp -#, fuzzy msgid "Close Tab" -msgstr "ปิดแท็บอื่น" +msgstr "ปิดแท็บ" #: editor/editor_node.cpp -#, fuzzy msgid "Undo Close Tab" -msgstr "ปิดแท็บอื่น" +msgstr "เลิกทำแท็บที่ปิด" #: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp msgid "Close Other Tabs" @@ -2707,12 +2555,11 @@ msgstr "ปิดแท็บอื่น" #: editor/editor_node.cpp msgid "Close Tabs to the Right" -msgstr "" +msgstr "ปิดแท็บทางด้านขวา" #: editor/editor_node.cpp -#, fuzzy msgid "Close All Tabs" -msgstr "ปิดทั้งหมด" +msgstr "ปิดแท็บทั้งหมด" #: editor/editor_node.cpp msgid "Switch Scene Tab" @@ -2755,9 +2602,8 @@ msgid "Go to previously opened scene." msgstr "ไปยังฉากที่เพิ่งเปิด" #: editor/editor_node.cpp -#, fuzzy msgid "Copy Text" -msgstr "คัดลอกตำแหน่ง" +msgstr "คัดลอกข้อความ" #: editor/editor_node.cpp msgid "Next tab" @@ -2796,9 +2642,8 @@ msgid "Save Scene" msgstr "บันทึกฉาก" #: editor/editor_node.cpp -#, fuzzy msgid "Save All Scenes" -msgstr "บันทึกทุกฉาก" +msgstr "บันทึกฉากทั้งหมด" #: editor/editor_node.cpp msgid "Convert To..." @@ -2806,11 +2651,11 @@ msgstr "แปลงเป็น..." #: editor/editor_node.cpp msgid "MeshLibrary..." -msgstr "MeshLibrary..." +msgstr "ไลบรารี Mesh..." #: editor/editor_node.cpp msgid "TileSet..." -msgstr "TileSet..." +msgstr "ไทล์เซต..." #: editor/editor_node.cpp editor/plugins/script_text_editor.cpp #: scene/gui/line_edit.cpp scene/gui/text_edit.cpp @@ -2836,22 +2681,20 @@ msgid "Project" msgstr "โปรเจกต์" #: editor/editor_node.cpp -#, fuzzy msgid "Project Settings..." -msgstr "ตัวเลือกโปรเจกต์" +msgstr "ตั้งค่าโปรเจกต์" #: editor/editor_node.cpp editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Version Control" -msgstr "รุ่น:" +msgstr "เวอร์ชันคอนโทรล" #: editor/editor_node.cpp editor/plugins/version_control_editor_plugin.cpp msgid "Set Up Version Control" -msgstr "" +msgstr "ตั้งเวอร์ชันคอนโทรน" #: editor/editor_node.cpp msgid "Shut Down Version Control" -msgstr "" +msgstr "ปิดเวอร์ชันคอนโทรล" #: editor/editor_node.cpp msgid "Export..." @@ -2859,21 +2702,19 @@ msgstr "ส่งออก..." #: editor/editor_node.cpp msgid "Install Android Build Template..." -msgstr "" +msgstr "ติดตั้งแม่แบบการสร้างของแอนดรอยด์" #: editor/editor_node.cpp -#, fuzzy msgid "Open Project Data Folder" -msgstr "เปิดตัวจัดการโปรเจกต์?" +msgstr "เปิดโฟลเดอร์ข้อมูลโปรเจกต์" #: editor/editor_node.cpp editor/plugins/tile_set_editor_plugin.cpp msgid "Tools" msgstr "เครื่องมือ" #: editor/editor_node.cpp -#, fuzzy msgid "Orphan Resource Explorer..." -msgstr "ตัวจัดการรีซอร์สที่ไม่มีเจ้าของ" +msgstr "การใช้ทรัพยากร" #: editor/editor_node.cpp msgid "Quit to Project List" @@ -2882,7 +2723,7 @@ msgstr "ปิดและกลับสู่รายชื่อโปรเ #: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp #: editor/project_export.cpp msgid "Debug" -msgstr "แก้จุดบกพร่อง" +msgstr "ดีบัก" #: editor/editor_node.cpp msgid "Deploy with Remote Debug" @@ -2913,7 +2754,7 @@ msgstr "" #: editor/editor_node.cpp msgid "Visible Collision Shapes" -msgstr "รูปทรงกายภาพมองเห็นได้" +msgstr "ขอบเขตการชนที่มองเห็นได้" #: editor/editor_node.cpp msgid "" @@ -2923,7 +2764,7 @@ msgstr "รูปทรงกายภาพและรังสี (2D แล #: editor/editor_node.cpp msgid "Visible Navigation" -msgstr "เส้นนำทางมองเห็นได้" +msgstr "แสดงการนำทาง" #: editor/editor_node.cpp msgid "" @@ -2947,7 +2788,7 @@ msgstr "" #: editor/editor_node.cpp msgid "Sync Script Changes" -msgstr "ซิงค์การแก้ไขสคริปต์" +msgstr "ซิงค์การเปลี่ยนแปลงสคริปต์" #: editor/editor_node.cpp msgid "" @@ -2961,59 +2802,51 @@ msgstr "" #: editor/editor_node.cpp editor/script_create_dialog.cpp msgid "Editor" -msgstr "โปรแกรม" +msgstr "เอดิเตอร์" #: editor/editor_node.cpp -#, fuzzy msgid "Editor Settings..." -msgstr "ตัวเลือกโปรแกรมสร้างเกม" +msgstr "ตั้งค่าเอดิเตอร์" #: editor/editor_node.cpp msgid "Editor Layout" -msgstr "เลย์เอาต์โปรแกรม" +msgstr "เลย์เอาต์เอดิเตอร์" #: editor/editor_node.cpp -#, fuzzy msgid "Take Screenshot" -msgstr "เข้าใจ!" +msgstr "ถ่ายภาพหน้าจอ" #: editor/editor_node.cpp -#, fuzzy msgid "Screenshots are stored in the Editor Data/Settings Folder." -msgstr "ตัวเลือกโปรแกรมสร้างเกม" +msgstr "ภาพหน้าจอจะถูกเก็บไว้ในโฟลเดอร์ข้อมูล/การตั้งค่าของเอดิเตอร์" #: editor/editor_node.cpp msgid "Toggle Fullscreen" -msgstr "สลับเต็มจอ" +msgstr "เปิด/ปิด โหมดเต็มหน้าจอ" #: editor/editor_node.cpp -#, fuzzy msgid "Toggle System Console" -msgstr "ซ่อน/แสดงโหนด CanvasItem" +msgstr "เปิด/ปิด คอนโซลระบบ" #: editor/editor_node.cpp -#, fuzzy msgid "Open Editor Data/Settings Folder" -msgstr "ตัวเลือกโปรแกรมสร้างเกม" +msgstr "เปิดโฟลเดอร์ข้อมูล/ตั้งค่าของเอดิเตอร์" #: editor/editor_node.cpp msgid "Open Editor Data Folder" -msgstr "" +msgstr "เปิดโฟลเดอร์ของเอดิเตอร์" #: editor/editor_node.cpp -#, fuzzy msgid "Open Editor Settings Folder" -msgstr "ตัวเลือกโปรแกรมสร้างเกม" +msgstr "เปิดโฟลเดอร์การตั้งค่าของเอดิเตอร์" #: editor/editor_node.cpp -#, fuzzy msgid "Manage Editor Features..." -msgstr "จัดการแม่แบบส่งออก" +msgstr "จัดการฟีเจอร์ของเอดิเตอร์..." #: editor/editor_node.cpp -#, fuzzy msgid "Manage Export Templates..." -msgstr "จัดการแม่แบบส่งออก" +msgstr "จัดการแม่แบบการส่งออก..." #: editor/editor_node.cpp editor/plugins/shader_editor_plugin.cpp msgid "Help" @@ -3038,8 +2871,13 @@ msgid "Q&A" msgstr "ถาม/ตอบ" #: editor/editor_node.cpp -msgid "Issue Tracker" -msgstr "ระบบติดตามบัค" +#, fuzzy +msgid "Report a Bug" +msgstr "นำเข้าใหม่" + +#: editor/editor_node.cpp +msgid "Send Docs Feedback" +msgstr "" #: editor/editor_node.cpp editor/plugins/asset_library_editor_plugin.cpp msgid "Community" @@ -3087,13 +2925,12 @@ msgstr "เลือกเล่นฉาก" #: editor/editor_node.cpp msgid "Changing the video driver requires restarting the editor." -msgstr "" +msgstr "การเปลี่ยนไดรเวอร์การ์ดจอจำเป็นต้องเริ่มเอดิเตอร์ใหม่" #: editor/editor_node.cpp editor/project_settings_editor.cpp #: editor/settings_config_dialog.cpp -#, fuzzy msgid "Save & Restart" -msgstr "บันทึกและนำเข้าอีกครั้ง" +msgstr "บันทึกและเริ่มใหม่" #: editor/editor_node.cpp #, fuzzy @@ -3101,19 +2938,16 @@ msgid "Spins when the editor window redraws." msgstr "หมุนเมื่อมีการวาดหน้าต่างโปรแกรมใหม่!" #: editor/editor_node.cpp -#, fuzzy msgid "Update Continuously" -msgstr "ต่อเนื่อง" +msgstr "อัพเดทอย่างต่อเนื่อง" #: editor/editor_node.cpp -#, fuzzy msgid "Update When Changed" msgstr "อัพเดทเมื่อเปลี่ยนแปลง" #: editor/editor_node.cpp -#, fuzzy msgid "Hide Update Spinner" -msgstr "ปิดการอัพเดทตัวหมุน" +msgstr "ซ่อนตัวหมุนการอัพเดท" #: editor/editor_node.cpp msgid "FileSystem" @@ -3124,9 +2958,8 @@ msgid "Inspector" msgstr "คุณสมบัติ" #: editor/editor_node.cpp -#, fuzzy msgid "Expand Bottom Panel" -msgstr "ขยายโฟลเดอร์" +msgstr "ขยายแผงล่าง" #: editor/editor_node.cpp msgid "Output" @@ -3141,9 +2974,8 @@ msgid "Android build template is missing, please install relevant templates." msgstr "" #: editor/editor_node.cpp -#, fuzzy msgid "Manage Templates" -msgstr "จัดการแม่แบบส่งออก" +msgstr "จัดการแม่แบบ" #: editor/editor_node.cpp msgid "" @@ -3169,9 +3001,8 @@ msgid "Import Templates From ZIP File" msgstr "นำเข้าแม่แบบจากไฟล์ ZIP" #: editor/editor_node.cpp -#, fuzzy msgid "Template Package" -msgstr "จัดการแม่แบบส่งออก" +msgstr "แพคเกจแม่แบบ" #: editor/editor_node.cpp msgid "Export Library" @@ -3199,15 +3030,15 @@ msgstr "เลือก" #: editor/editor_node.cpp msgid "Open 2D Editor" -msgstr "เปิดตัวแก้ไข 2 มิติ" +msgstr "เปิดเอดิเตอร์ 2D" #: editor/editor_node.cpp msgid "Open 3D Editor" -msgstr "เปิดตัวแก้ไข 3 มิติ" +msgstr "เปิดเอดิเตอร์ 3D" #: editor/editor_node.cpp msgid "Open Script Editor" -msgstr "เปิดตัวแก้ไขสคริปต์" +msgstr "เปิดเอดิเตอร์สคริปต์" #: editor/editor_node.cpp editor/project_manager.cpp msgid "Open Asset Library" @@ -3215,16 +3046,15 @@ msgstr "เปิดแหล่งรวมทรัพยากร" #: editor/editor_node.cpp msgid "Open the next Editor" -msgstr "เปิดตัวแก้ไขถัดไป" +msgstr "เปิดเอดิเตอร์ถัดไป" #: editor/editor_node.cpp msgid "Open the previous Editor" -msgstr "เปิดตัวแก้ไขก่อนหน้า" +msgstr "เปิดเอดิเตอร์ก่อนหน้า" #: editor/editor_node.h -#, fuzzy msgid "Warning!" -msgstr "คำเตือน" +msgstr "คำเตือน!" #: editor/editor_path.cpp #, fuzzy @@ -3240,14 +3070,12 @@ msgid "Thumbnail..." msgstr "รูปตัวอย่าง..." #: editor/editor_plugin_settings.cpp -#, fuzzy msgid "Main Script:" -msgstr "เปิดสคริปต์" +msgstr "สคริปต์หลัก:" #: editor/editor_plugin_settings.cpp -#, fuzzy msgid "Edit Plugin" -msgstr "แก้ไขรูปหลายเหลี่ยม" +msgstr "แก้ไขปลั๊กอิน" #: editor/editor_plugin_settings.cpp msgid "Installed Plugins:" @@ -3264,16 +3092,15 @@ msgstr "รุ่น:" #: editor/editor_plugin_settings.cpp editor/plugin_config_dialog.cpp msgid "Author:" -msgstr "โดย:" +msgstr "ผู้สร้าง:" #: editor/editor_plugin_settings.cpp msgid "Status:" msgstr "สถานะ:" #: editor/editor_plugin_settings.cpp -#, fuzzy msgid "Edit:" -msgstr "แก้ไข" +msgstr "แก้ไข:" #: editor/editor_profiler.cpp msgid "Measure:" @@ -3289,7 +3116,7 @@ msgstr "เวลาเฉลี่ย (วินาที)" #: editor/editor_profiler.cpp msgid "Frame %" -msgstr "% ของเฟรม" +msgstr "เฟรม %" #: editor/editor_profiler.cpp msgid "Physics Frame %" @@ -3316,9 +3143,8 @@ msgid "Calls" msgstr "จำนวนครั้ง" #: editor/editor_properties.cpp -#, fuzzy msgid "Edit Text:" -msgstr "แก้ไขธีม..." +msgstr "แก้ไขข้อความ:" #: editor/editor_properties.cpp editor/script_create_dialog.cpp msgid "On" @@ -3326,10 +3152,9 @@ msgstr "เปิด" #: editor/editor_properties.cpp msgid "Layer" -msgstr "" +msgstr "เลเยอร์" #: editor/editor_properties.cpp -#, fuzzy msgid "Bit %d, value %d" msgstr "บิต %d, ค่า %d" @@ -3338,14 +3163,12 @@ msgid "[Empty]" msgstr "[ว่างเปล่า]" #: editor/editor_properties.cpp editor/plugins/root_motion_editor_plugin.cpp -#, fuzzy msgid "Assign..." -msgstr "ระบุ" +msgstr "กำหนด..." #: editor/editor_properties.cpp -#, fuzzy msgid "Invalid RID" -msgstr "ตำแหน่งผิดพลาด" +msgstr "RID ผิดพลาด" #: editor/editor_properties.cpp msgid "" @@ -3376,9 +3199,8 @@ msgid "New Script" msgstr "สคริปต์ใหม่" #: editor/editor_properties.cpp editor/scene_tree_dock.cpp -#, fuzzy msgid "Extend Script" -msgstr "เปิดสคริปต์" +msgstr "สคริปต์เสริม" #: editor/editor_properties.cpp editor/property_editor.cpp msgid "New %s" @@ -3411,13 +3233,12 @@ msgid "Selected node is not a Viewport!" msgstr "โหนดที่เลือกไม่ใช่ Viewport!" #: editor/editor_properties_array_dict.cpp -#, fuzzy msgid "Size: " -msgstr "ขนาดเซลล์:" +msgstr "ขนาด: " #: editor/editor_properties_array_dict.cpp msgid "Page: " -msgstr "" +msgstr "หน้า: " #: editor/editor_properties_array_dict.cpp #: editor/plugins/theme_editor_plugin.cpp @@ -3425,18 +3246,16 @@ msgid "Remove Item" msgstr "ลบไอเทม" #: editor/editor_properties_array_dict.cpp -#, fuzzy msgid "New Key:" -msgstr "ชื่อใหม่:" +msgstr "คีย์ใหม่:" #: editor/editor_properties_array_dict.cpp -#, fuzzy msgid "New Value:" -msgstr "ชื่อใหม่:" +msgstr "ค่าใหม่:" #: editor/editor_properties_array_dict.cpp msgid "Add Key/Value Pair" -msgstr "" +msgstr "เพิ่มคู่ของคีย์/ค่า" #: editor/editor_run_native.cpp msgid "" @@ -3456,7 +3275,7 @@ msgstr "มีฉากที่แก้ไขอยู่แล้ว" #: editor/editor_run_script.cpp msgid "Couldn't instance script:" -msgstr "สร้างอินสแตนซ์ของสคริปต์ไม่ได้:" +msgstr "ไม่สามารถอินสแตนซ์สคริปต์ได้:" #: editor/editor_run_script.cpp msgid "Did you forget the 'tool' keyword?" @@ -3476,7 +3295,7 @@ msgstr "เลือกโหนดเพื่อนำเข้า" #: editor/editor_sub_scene.cpp editor/project_manager.cpp msgid "Browse" -msgstr "เลือก" +msgstr "ค้นหา" #: editor/editor_sub_scene.cpp msgid "Scene Path:" @@ -3487,7 +3306,6 @@ msgid "Import From Node:" msgstr "นำเข้าจากโหนด:" #: editor/export_template_manager.cpp -#, fuzzy msgid "Redownload" msgstr "ดาวน์โหลดอีกครั้ง" @@ -3529,9 +3347,8 @@ msgid "Can't open export templates zip." msgstr "เปิดไฟล์ zip แม่แบบส่งออกไม่ได้" #: editor/export_template_manager.cpp -#, fuzzy msgid "Invalid version.txt format inside templates: %s." -msgstr "รูปแบบของ version.txt ในแม่แบบไม่ถูกต้อง" +msgstr "รูปแบบของ version.txt ในแม่แบบ %s ไม่ถูกต้อง" #: editor/export_template_manager.cpp msgid "No version.txt found inside templates." @@ -3550,9 +3367,8 @@ msgid "Importing:" msgstr "นำเข้า:" #: editor/export_template_manager.cpp -#, fuzzy msgid "Error getting the list of mirrors." -msgstr "ผิดพลาดขณะสร้าง signature object" +msgstr "ผิดพลาดขณะกำลังรับรายชื่อของ mirrors" #: editor/export_template_manager.cpp msgid "Error parsing JSON of mirror list. Please report this issue!" @@ -3597,9 +3413,8 @@ msgid "Download Complete." msgstr "ดาวน์โหลดเสร็จสิ้น" #: editor/export_template_manager.cpp -#, fuzzy msgid "Cannot remove temporary file:" -msgstr "บันทึกธีมไม่ได้:" +msgstr "ไม่สามารถลบไฟล์ชั่วคราวได้:" #: editor/export_template_manager.cpp msgid "" @@ -3608,17 +3423,16 @@ msgid "" msgstr "" #: editor/export_template_manager.cpp -#, fuzzy msgid "Error requesting URL:" -msgstr "ผิดพลาดขณะร้องขอที่อยู่: " +msgstr "ผิดพลาดขณะกำลังร้องขอ URL:" #: editor/export_template_manager.cpp msgid "Connecting to Mirror..." -msgstr "กำลังเชื่อมต่อ..." +msgstr "กำลังเชื่อมต่อกับ Mirror" #: editor/export_template_manager.cpp msgid "Disconnected" -msgstr "การเชื่อมต่อสิ้นสุด" +msgstr "ตัดการเชื่อมต่อแล้ว" #: editor/export_template_manager.cpp msgid "Resolving" @@ -3659,9 +3473,8 @@ msgid "SSL Handshake Error" msgstr "การรับรองความปลอดภัยผิดพลาด" #: editor/export_template_manager.cpp -#, fuzzy msgid "Uncompressing Android Build Sources" -msgstr "กำลังคลายบีบอัด" +msgstr "กำลังคลาย Android Build Sources" #: editor/export_template_manager.cpp msgid "Current Version:" @@ -3680,14 +3493,12 @@ msgid "Remove Template" msgstr "ลบแม่แบบ" #: editor/export_template_manager.cpp -#, fuzzy msgid "Select Template File" msgstr "เลือกไฟล์แม่แบบ" #: editor/export_template_manager.cpp -#, fuzzy msgid "Godot Export Templates" -msgstr "กำลังโหลดแม่แบบส่งออก" +msgstr "แม่แบบการส่งออก Godot" #: editor/export_template_manager.cpp msgid "Export Template Manager" @@ -3698,14 +3509,12 @@ msgid "Download Templates" msgstr "ดาวน์โหลดแม่แบบ" #: editor/export_template_manager.cpp -#, fuzzy msgid "Select mirror from list: (Shift+Click: Open in Browser)" -msgstr "เลือกลิงก์ดาวน์โหลด: " +msgstr "เลือก mirror จากรายชื่อ: (Shift+คลิก: เปิดในเบราเซอร์)" #: editor/filesystem_dock.cpp -#, fuzzy msgid "Favorites" -msgstr "ที่ชื่นชอบ:" +msgstr "ที่ชื่นชอบ" #: editor/filesystem_dock.cpp msgid "Status: Import of file failed. Please fix file and reimport manually." @@ -3736,9 +3545,8 @@ msgid "No name provided." msgstr "ไม่ได้ระบุชื่อ" #: editor/filesystem_dock.cpp -#, fuzzy msgid "Provided name contains invalid characters." -msgstr "ไม่สามารถใช้อักษรบางตัวในชื่อได้" +msgstr "ชื่อที่ระบุประกอบไปด้วยตัวอักษรที่ไม่ถูกต้อง" #: editor/filesystem_dock.cpp msgid "A file or folder with this name already exists." @@ -3765,33 +3573,28 @@ msgid "Duplicating folder:" msgstr "ทำซ้ำโฟลเดอร์:" #: editor/filesystem_dock.cpp -#, fuzzy msgid "New Inherited Scene" -msgstr "สืบทอดฉากใหม่..." +msgstr "ฉากสืบทอดใหม่" #: editor/filesystem_dock.cpp -#, fuzzy msgid "Set As Main Scene" -msgstr "ฉากหลัก" +msgstr "ตั้งเป็นฉากหลัก" #: editor/filesystem_dock.cpp -#, fuzzy msgid "Open Scenes" -msgstr "เปิดไฟล์ฉาก" +msgstr "เปิดฉาก" #: editor/filesystem_dock.cpp msgid "Instance" msgstr "อินสแตนซ์" #: editor/filesystem_dock.cpp -#, fuzzy msgid "Add to Favorites" -msgstr "ที่ชื่นชอบ:" +msgstr "เพิ่มไปยังที่ชื่นชอบ" #: editor/filesystem_dock.cpp -#, fuzzy msgid "Remove from Favorites" -msgstr "ลบออกจากกลุ่ม" +msgstr "ลบจากที่่ชื่นชอบ" #: editor/filesystem_dock.cpp msgid "Edit Dependencies..." @@ -3814,9 +3617,8 @@ msgid "Move To..." msgstr "ย้ายไป..." #: editor/filesystem_dock.cpp -#, fuzzy msgid "New Scene..." -msgstr "ฉากใหม่" +msgstr "ฉากใหม่..." #: editor/filesystem_dock.cpp editor/plugins/script_editor_plugin.cpp msgid "New Script..." @@ -3861,9 +3663,8 @@ msgid "Toggle Split Mode" msgstr "สลับโหมด" #: editor/filesystem_dock.cpp -#, fuzzy msgid "Search files" -msgstr "ค้นหาคลาส" +msgstr "ค้นหาไฟล์" #: editor/filesystem_dock.cpp msgid "" @@ -3886,9 +3687,8 @@ msgid "Overwrite" msgstr "เขียนทับ" #: editor/filesystem_dock.cpp -#, fuzzy msgid "Create Scene" -msgstr "สร้างจากฉาก" +msgstr "สร้างฉาก" #: editor/filesystem_dock.cpp editor/plugins/script_editor_plugin.cpp msgid "Create Script" @@ -3900,16 +3700,15 @@ msgstr "ค้นหาในไฟล์" #: editor/find_in_files.cpp msgid "Find:" -msgstr "ค้นหา: " +msgstr "ค้นหา:" #: editor/find_in_files.cpp msgid "Folder:" -msgstr "โฟลเดอร์: " +msgstr "โฟลเดอร์:" #: editor/find_in_files.cpp -#, fuzzy msgid "Filters:" -msgstr "ตัวกรอง" +msgstr "ตัวกรอง:" #: editor/find_in_files.cpp msgid "" @@ -4084,9 +3883,8 @@ msgid "Saving..." msgstr "กำลังบันทึก..." #: editor/import_dock.cpp -#, fuzzy msgid "%d Files" -msgstr " ไฟล์" +msgstr "ไฟล์ %d" #: editor/import_dock.cpp msgid "Set as Default for '%s'" @@ -4101,21 +3899,21 @@ msgid "Import As:" msgstr "นำเข้าเป็น:" #: editor/import_dock.cpp -#, fuzzy msgid "Preset" -msgstr "การส่งออก" +msgstr "ตั้งล่วงหน้า" #: editor/import_dock.cpp msgid "Reimport" msgstr "นำเข้าใหม่" #: editor/import_dock.cpp -msgid "Save scenes, re-import and restart" -msgstr "" +#, fuzzy +msgid "Save Scenes, Re-Import, and Restart" +msgstr "บันทึกฉาก, นำเข้าและเริ่มต้นใหม่" #: editor/import_dock.cpp msgid "Changing the type of an imported file requires editor restart." -msgstr "" +msgstr "การเปลี่ยนแปลงชนิดของไฟล์ที่นำเข้า จำเป็นต้องเริ่มเอดิเตอร์ใหม่" #: editor/import_dock.cpp msgid "" @@ -4124,15 +3922,13 @@ msgstr "" #: editor/inspector_dock.cpp msgid "Failed to load resource." -msgstr "โหลดรีซอร์สไม่ได้" +msgstr "โหลดทรัพยากรไม่ได้" #: editor/inspector_dock.cpp -#, fuzzy msgid "Expand All Properties" msgstr "ขยายคุณสมบัติทั้งหมด" #: editor/inspector_dock.cpp -#, fuzzy msgid "Collapse All Properties" msgstr "ยุบคุณสมบัติทั้งหมด" @@ -4143,12 +3939,11 @@ msgstr "บันทึกเป็น..." #: editor/inspector_dock.cpp msgid "Copy Params" -msgstr "คัดลอกตัวแปร" +msgstr "คัดลอกพารามิเตอร์" #: editor/inspector_dock.cpp -#, fuzzy msgid "Edit Resource Clipboard" -msgstr "คลิปบอร์ดไม่มีรีซอร์ส!" +msgstr "แก้ไขคลิปบอร์ดทรัพยากร" #: editor/inspector_dock.cpp msgid "Copy Resource" @@ -4195,9 +3990,8 @@ msgid "Object properties." msgstr "คุณสมบัติวัตถุ" #: editor/inspector_dock.cpp -#, fuzzy msgid "Filter properties" -msgstr "ตัวกรอง" +msgstr "คุญสมบัติตัวกรอง" #: editor/inspector_dock.cpp msgid "Changes may be lost!" @@ -4222,15 +4016,15 @@ msgstr "สร้างปลั๊กอิน" #: editor/plugin_config_dialog.cpp msgid "Plugin Name:" -msgstr "ชื่อปลั๊กอิน" +msgstr "ชื่อปลั๊กอิน:" #: editor/plugin_config_dialog.cpp msgid "Subfolder:" -msgstr "โฟลเดอร์ย่อย: " +msgstr "โฟลเดอร์ย่อย:" #: editor/plugin_config_dialog.cpp editor/script_create_dialog.cpp msgid "Language:" -msgstr "ภาษา: " +msgstr "ภาษา:" #: editor/plugin_config_dialog.cpp msgid "Script Name:" @@ -4238,7 +4032,7 @@ msgstr "ชื่อสคริปต์:" #: editor/plugin_config_dialog.cpp msgid "Activate now?" -msgstr "" +msgstr "เปิดใช้งานตอนนี้?" #: editor/plugins/abstract_polygon_2d_editor.cpp #: editor/plugins/polygon_2d_editor_plugin.cpp @@ -4252,25 +4046,21 @@ msgid "Create points." msgstr "สร้างจุด" #: editor/plugins/abstract_polygon_2d_editor.cpp -#, fuzzy msgid "" "Edit points.\n" "LMB: Move Point\n" "RMB: Erase Point" msgstr "" -"แก้ไขรูปหลายเหลี่ยม:\n" -"เมาส์ซ้าย: ย้ายจุด\n" -"Ctrl+เมาส์ซ้าย: แยกส่วน\n" -"เมาส์ขวา: ลบจุด" +"แก้ไขจุด:\n" +"คลิกซ้าย: ย้ายจุด\n" +"คลิกขวา: ลบจุด" #: editor/plugins/abstract_polygon_2d_editor.cpp #: editor/plugins/animation_blend_space_1d_editor.cpp -#, fuzzy msgid "Erase points." -msgstr "คลิกขวา: ลบจุด" +msgstr "ลบจุด" #: editor/plugins/abstract_polygon_2d_editor.cpp -#, fuzzy msgid "Edit Polygon" msgstr "แก้ไขรูปหลายเหลี่ยม" @@ -4279,12 +4069,10 @@ msgid "Insert Point" msgstr "แทรกจุด" #: editor/plugins/abstract_polygon_2d_editor.cpp -#, fuzzy msgid "Edit Polygon (Remove Point)" msgstr "แก้ไขรูปหลายเหลี่ยม (ลบจุด)" #: editor/plugins/abstract_polygon_2d_editor.cpp -#, fuzzy msgid "Remove Polygon And Point" msgstr "ลบรูปหลายเหลี่ยมและจุด" @@ -4300,52 +4088,45 @@ msgstr "เพิ่มแอนิเมชัน" #: editor/plugins/animation_blend_space_2d_editor.cpp #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/animation_state_machine_editor.cpp -#, fuzzy msgid "Load..." -msgstr "โหลด" +msgstr "โหลด..." #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Move Node Point" -msgstr "ย้ายจุด" +msgstr "สร้างจุดโหนด" #: editor/plugins/animation_blend_space_1d_editor.cpp -#, fuzzy msgid "Change BlendSpace1D Limits" -msgstr "แก้ไขระยะเวลาการผสาน" +msgstr "เปลี่ยนค่าจำกัดของ BlendSpace1D" #: editor/plugins/animation_blend_space_1d_editor.cpp -#, fuzzy msgid "Change BlendSpace1D Labels" -msgstr "แก้ไขระยะเวลาการผสาน" +msgstr "เปลี่ยนป้ายกำกับ BlendSpace1D" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp #: editor/plugins/animation_state_machine_editor.cpp msgid "This type of node can't be used. Only root nodes are allowed." -msgstr "" +msgstr "โหนดชนิดนี้ไม่สามารถใช้ได้ มีแค่โหนดแม่เท่านั้นที่สามารถใช้ได้" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Add Node Point" -msgstr "เพิ่มโหนด" +msgstr "เพิ่มจุดโหนด" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Add Animation Point" -msgstr "เพิ่มแอนิเมชัน" +msgstr "เพิ่มจุดแอนิเมชัน" #: editor/plugins/animation_blend_space_1d_editor.cpp -#, fuzzy msgid "Remove BlendSpace1D Point" -msgstr "ลบจุด" +msgstr "ลบจุด BlendSpace1D" #: editor/plugins/animation_blend_space_1d_editor.cpp msgid "Move BlendSpace1D Node Point" -msgstr "" +msgstr "ย้ายจุดโหนด BlendSpace1D" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp @@ -4369,38 +4150,33 @@ msgstr "" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp scene/gui/graph_edit.cpp msgid "Enable snap and show grid." -msgstr "" +msgstr "เปิกการใช้งานการเข้าหาแลแสดงเส้นกริด" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Point" -msgstr "ย้ายจุด" +msgstr "จุด" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp #: editor/plugins/animation_blend_tree_editor_plugin.cpp -#, fuzzy msgid "Open Editor" -msgstr "เปิดในโปรแกรมแก้ไข" +msgstr "เปิดเอดิเตอร์" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/animation_state_machine_editor.cpp -#, fuzzy msgid "Open Animation Node" -msgstr "โหนดแอนิเมชัน" +msgstr "เปิดโหนดแอนิเมชัน" #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Triangle already exists." -msgstr "มีการกระทำ '%s' อยู่แล้ว!" +msgstr "มีสามเหลี่ยมอยู่แล้ว" #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Add Triangle" -msgstr "เพิ่มตัวแปร" +msgstr "เพิ่มสามเหลี่ยม" #: editor/plugins/animation_blend_space_2d_editor.cpp #, fuzzy @@ -4440,9 +4216,8 @@ msgid "Create triangles by connecting points." msgstr "" #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Erase points and triangles." -msgstr "วิเคราะห์สามเหลี่ยม %d อัน:" +msgstr "ลบจุดและสามเหลี่ยม" #: editor/plugins/animation_blend_space_2d_editor.cpp msgid "Generate blend triangles automatically (instead of manually)" @@ -4491,9 +4266,8 @@ msgid "Nodes Disconnected" msgstr "ตัดการเชื่อมต่อโหนดแล้ว" #: editor/plugins/animation_blend_tree_editor_plugin.cpp -#, fuzzy msgid "Set Animation" -msgstr "แอนิเมชัน" +msgstr "ตั้งแอนิเมชัน" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp @@ -4512,9 +4286,8 @@ msgid "Toggle Filter On/Off" msgstr "โหมดไร้สิ่งรบกวน" #: editor/plugins/animation_blend_tree_editor_plugin.cpp -#, fuzzy msgid "Change Filter" -msgstr "แก้ไขตัวกรองภูมิภาค" +msgstr "แก้ไขตัวกรอง" #: editor/plugins/animation_blend_tree_editor_plugin.cpp msgid "No animation player set, so unable to retrieve track names." @@ -4532,31 +4305,26 @@ msgid "" msgstr "" #: editor/plugins/animation_blend_tree_editor_plugin.cpp -#, fuzzy msgid "Anim Clips" -msgstr "คลิป" +msgstr "คลิปแอนิเมชัน" #: editor/plugins/animation_blend_tree_editor_plugin.cpp -#, fuzzy msgid "Audio Clips" -msgstr "ตัวรับเสียง" +msgstr "คลิปเสียง" #: editor/plugins/animation_blend_tree_editor_plugin.cpp -#, fuzzy msgid "Functions" -msgstr "ฟังก์ชัน:" +msgstr "ฟังก์ชัน" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/animation_state_machine_editor.cpp -#, fuzzy msgid "Node Renamed" -msgstr "ชื่อโหนด:" +msgstr "เปลี่ยนชื่อโหนดแล้ว" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Add Node..." -msgstr "เพิ่มโหนด" +msgstr "เพิ่มโหนด..." #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/root_motion_editor_plugin.cpp @@ -4565,9 +4333,8 @@ msgid "Edit Filtered Tracks:" msgstr "แก้ไขตัวกรอง" #: editor/plugins/animation_blend_tree_editor_plugin.cpp -#, fuzzy msgid "Enable Filtering" -msgstr "แก้ไขโหนดลูกได้" +msgstr "เปิดการใช้งานตัวกรอง" #: editor/plugins/animation_player_editor_plugin.cpp msgid "Toggle Autoplay" @@ -4596,14 +4363,12 @@ msgid "Remove Animation" msgstr "ลบแอนิเมชัน" #: editor/plugins/animation_player_editor_plugin.cpp -#, fuzzy msgid "Invalid animation name!" -msgstr "ผิดพลาด: ชื่อแอนิเมชันไม่ถูกต้อง!" +msgstr "ชื่อแอนิเมชันไม่ถูกต้อง!" #: editor/plugins/animation_player_editor_plugin.cpp -#, fuzzy msgid "Animation name already exists!" -msgstr "ผิดพลาด: มีชื่อแอนิเมชันนี้อยู่แล้ว!" +msgstr "ชื่อแอนิเมชันนี้ มีอยู่แล้ว!" #: editor/plugins/animation_player_editor_plugin.cpp #: editor/plugins/sprite_frames_editor_plugin.cpp @@ -4627,14 +4392,12 @@ msgid "Duplicate Animation" msgstr "ทำซ้ำแอนิเมชัน" #: editor/plugins/animation_player_editor_plugin.cpp -#, fuzzy msgid "No animation to copy!" -msgstr "ผิดพลาด: ไม่มีแอนิเมชันให้คัดลอก!" +msgstr "ไม่มีแอนิเมชันให้คัดลอก!" #: editor/plugins/animation_player_editor_plugin.cpp -#, fuzzy msgid "No animation resource on clipboard!" -msgstr "ผิดพลาด: ไม่มีแอนิเมชันในคลิปบอร์ด!" +msgstr "ไม่มีแอนิเมชันในคลิปบอร์ด!" #: editor/plugins/animation_player_editor_plugin.cpp msgid "Pasted Animation" @@ -4645,9 +4408,8 @@ msgid "Paste Animation" msgstr "วางแอนิเมชัน" #: editor/plugins/animation_player_editor_plugin.cpp -#, fuzzy msgid "No animation to edit!" -msgstr "ผิดพลาด: ไม่มีแอนิเมชันให้แก้ไข!" +msgstr "ไม่มีแอนิเมชันให้แก้ไข!" #: editor/plugins/animation_player_editor_plugin.cpp msgid "Play selected animation backwards from current pos. (A)" @@ -4753,9 +4515,8 @@ msgid "Include Gizmos (3D)" msgstr "รวมสัญลักษณ์ (3D)" #: editor/plugins/animation_player_editor_plugin.cpp -#, fuzzy msgid "Pin AnimationPlayer" -msgstr "วางแอนิเมชัน" +msgstr "ปักหมุด AnimationPlayer" #: editor/plugins/animation_player_editor_plugin.cpp msgid "Create New Animation" @@ -4785,9 +4546,8 @@ msgid "Cross-Animation Blend Times" msgstr "ระยะเวลาการผสาน Cross-Animation" #: editor/plugins/animation_state_machine_editor.cpp -#, fuzzy msgid "Move Node" -msgstr "โหมดเคลื่อนย้าย" +msgstr "เคลื่อนย้ายโหนด" #: editor/plugins/animation_state_machine_editor.cpp #, fuzzy @@ -4815,7 +4575,7 @@ msgstr "" #: editor/plugins/animation_state_machine_editor.cpp msgid "Sync" -msgstr "" +msgstr "ซิงค์" #: editor/plugins/animation_state_machine_editor.cpp msgid "At End" @@ -4835,9 +4595,8 @@ msgid "No playback resource set at path: %s." msgstr "ไม่อยู่ในโฟลเดอร์รีซอร์ส" #: editor/plugins/animation_state_machine_editor.cpp -#, fuzzy msgid "Node Removed" -msgstr "ลบ:" +msgstr "ลบโหนดแล้ว" #: editor/plugins/animation_state_machine_editor.cpp #, fuzzy @@ -4856,9 +4615,8 @@ msgid "" msgstr "" #: editor/plugins/animation_state_machine_editor.cpp -#, fuzzy msgid "Create new nodes." -msgstr "สร้าง %s ใหม่" +msgstr "สร้างโหนดใหม่" #: editor/plugins/animation_state_machine_editor.cpp #, fuzzy @@ -4884,9 +4642,8 @@ msgid "Transition: " msgstr "ทรานสิชัน" #: editor/plugins/animation_state_machine_editor.cpp -#, fuzzy msgid "Play Mode:" -msgstr "โหมดมุมมอง" +msgstr "โหมดการเล่น:" #: editor/plugins/animation_tree_editor_plugin.cpp #: editor/plugins/animation_tree_player_editor_plugin.cpp @@ -5058,7 +4815,6 @@ msgid "Request failed, return code:" msgstr "การร้องขอผิดพลาด รหัส:" #: editor/plugins/asset_library_editor_plugin.cpp -#, fuzzy msgid "Request failed." msgstr "ร้องขอผิดพลาด" @@ -5069,7 +4825,7 @@ msgstr "บันทึกธีมไม่ได้:" #: editor/plugins/asset_library_editor_plugin.cpp msgid "Write error." -msgstr "" +msgstr "การเขียนผิดพลาด" #: editor/plugins/asset_library_editor_plugin.cpp msgid "Request failed, too many redirects" @@ -5086,9 +4842,8 @@ msgid "Request failed, timeout" msgstr "การร้องขอผิดพลาด รหัส:" #: editor/plugins/asset_library_editor_plugin.cpp -#, fuzzy msgid "Timeout." -msgstr "เวลา" +msgstr "หมดเวลา" #: editor/plugins/asset_library_editor_plugin.cpp msgid "Bad download hash, assuming file has been tampered with." @@ -5111,9 +4866,8 @@ msgid "Asset Download Error:" msgstr "ดาวน์โหลดทรัพยากรผิดพลาด:" #: editor/plugins/asset_library_editor_plugin.cpp -#, fuzzy msgid "Downloading (%s / %s)..." -msgstr "กำลังดาวน์โหลด" +msgstr "กำลังดาวน์โหลด (%s / %s)..." #: editor/plugins/asset_library_editor_plugin.cpp msgid "Downloading..." @@ -5149,32 +4903,29 @@ msgstr "กำลังดาวน์โหลดไฟล์นี้อยู #: editor/plugins/asset_library_editor_plugin.cpp msgid "Recently Updated" -msgstr "" +msgstr "อัพเดทล่าสุด" #: editor/plugins/asset_library_editor_plugin.cpp msgid "Least Recently Updated" -msgstr "" +msgstr "อัพเดทน้อยสุด" #: editor/plugins/asset_library_editor_plugin.cpp msgid "Name (A-Z)" -msgstr "" +msgstr "ชื่อ (A-Z)" #: editor/plugins/asset_library_editor_plugin.cpp msgid "Name (Z-A)" -msgstr "" +msgstr "ชื่อ (Z-A)" #: editor/plugins/asset_library_editor_plugin.cpp -#, fuzzy msgid "License (A-Z)" -msgstr "สัญญาอนุญาต" +msgstr "สัญญาอนุญาต (A-Z)" #: editor/plugins/asset_library_editor_plugin.cpp -#, fuzzy msgid "License (Z-A)" -msgstr "สัญญาอนุญาต" +msgstr "สัญญาอนุญาต (Z-A)" #: editor/plugins/asset_library_editor_plugin.cpp -#, fuzzy msgid "First" msgstr "แรกสุด" @@ -5196,7 +4947,7 @@ msgstr "ทั้งหมด" #: editor/plugins/asset_library_editor_plugin.cpp msgid "No results for \"%s\"." -msgstr "" +msgstr "ไม่มีผลลัพธ์สำหรับ \"%s\"" #: editor/plugins/asset_library_editor_plugin.cpp msgid "Import..." @@ -5237,7 +4988,7 @@ msgstr "กำลังโหลด..." #: editor/plugins/asset_library_editor_plugin.cpp msgid "Assets ZIP File" -msgstr "ไฟล์ ZIP" +msgstr "ทรัพยากรไฟล์ ZIP" #: editor/plugins/baked_lightmap_editor_plugin.cpp msgid "" @@ -5278,7 +5029,7 @@ msgstr "จุดกำเนิดตาราง:" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Grid Step:" -msgstr "ระยะห่างเส้น:" +msgstr "ระยะห่างเส้นกริด:" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Primary Line Every:" @@ -5384,63 +5135,52 @@ msgid "" msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Top Left" -msgstr "ซ้าย" +msgstr "บนซ้าย" #: editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Top Right" -msgstr "ขวา" +msgstr "บนขวา" #: editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Bottom Right" -msgstr "ย้ายไปขวา" +msgstr "ล่างขวา" #: editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Bottom Left" -msgstr "มุมล่าง" +msgstr "ล่างซ้าย" #: editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Center Left" -msgstr "ย่อหน้าซ้าย" +msgstr "กลางซ้าย" #: editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Center Top" -msgstr "ให้สิ่งที่เลือกอยู่กลางจอ" +msgstr "กลางบน" #: editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Center Right" -msgstr "ย่อหน้าขวา" +msgstr "กลางขวา" #: editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Center Bottom" -msgstr "ล่าง" +msgstr "กลางล่าง" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Center" -msgstr "" +msgstr "กลาง" #: editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Left Wide" -msgstr "มุมซ้าย" +msgstr "ความกว้างซ้าย" #: editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Top Wide" -msgstr "มุมบน" +msgstr "ความกว้างบน" #: editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Right Wide" -msgstr "มุมขวา" +msgstr "ความกว้างขวา" #: editor/plugins/canvas_item_editor_plugin.cpp #, fuzzy @@ -5449,11 +5189,11 @@ msgstr "มุมล่าง" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "VCenter Wide" -msgstr "" +msgstr "ความกว้าง VCenter" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "HCenter Wide" -msgstr "" +msgstr "ความกว้าง HCenter" #: editor/plugins/canvas_item_editor_plugin.cpp #, fuzzy @@ -5461,9 +5201,8 @@ msgid "Full Rect" msgstr "ชื่อเต็ม" #: editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Keep Ratio" -msgstr "อัตราส่วนเวลา:" +msgstr "รักษาอัตราส่วน" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Anchors only" @@ -5483,6 +5222,8 @@ msgid "" "Game Camera Override\n" "Overrides game camera with editor viewport camera." msgstr "" +"เขียนทับกล้องของเกมส์\n" +"เขียนทับกล้องของเกมส์ด้วยเอดิเตอร์ของวิวพอร์ตของกล้อง" #: editor/plugins/canvas_item_editor_plugin.cpp #: editor/plugins/spatial_editor_plugin.cpp @@ -5490,18 +5231,18 @@ msgid "" "Game Camera Override\n" "No game instance running." msgstr "" +"เขียนทับกล้องของเกมส์\n" +"ไม่มีอินสแตนซ์ของเกมส์ทำงานอยู่" #: editor/plugins/canvas_item_editor_plugin.cpp #: editor/plugins/spatial_editor_plugin.cpp -#, fuzzy msgid "Lock Selected" -msgstr "เครื่องมือเลือก" +msgstr "ล็อกที่เลือก" #: editor/plugins/canvas_item_editor_plugin.cpp #: editor/plugins/spatial_editor_plugin.cpp -#, fuzzy msgid "Unlock Selected" -msgstr "ลบสิ่งที่เลือก" +msgstr "ปลดล็อคที่เลือก" #: editor/plugins/canvas_item_editor_plugin.cpp #: editor/plugins/spatial_editor_plugin.cpp @@ -5551,7 +5292,6 @@ msgstr "" #: editor/plugins/canvas_item_editor_plugin.cpp #: editor/plugins/texture_region_editor_plugin.cpp #: editor/plugins/tile_set_editor_plugin.cpp scene/gui/graph_edit.cpp -#, fuzzy msgid "Zoom Reset" msgstr "รีเซ็ตการซูม" @@ -5588,9 +5328,8 @@ msgstr "โหมดหมุน" #: editor/plugins/canvas_item_editor_plugin.cpp #: editor/plugins/spatial_editor_plugin.cpp -#, fuzzy msgid "Scale Mode" -msgstr "โหมดปรับขนาด (R)" +msgstr "โหมดปรับขนาด" #: editor/plugins/canvas_item_editor_plugin.cpp #: editor/plugins/spatial_editor_plugin.cpp @@ -5610,9 +5349,8 @@ msgid "Pan Mode" msgstr "โหมดมุมมอง" #: editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Ruler Mode" -msgstr "โหมดการทำงาน:" +msgstr "โหมดไม้บรรทัด" #: editor/plugins/canvas_item_editor_plugin.cpp #, fuzzy @@ -5630,9 +5368,8 @@ msgid "Toggle grid snapping." msgstr "เปิด/ปิด การจำกัด" #: editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Use Grid Snap" -msgstr "จำกัดด้วยเส้นตาราง" +msgstr "ใช้การเข้าหาเส้นกริด" #: editor/plugins/canvas_item_editor_plugin.cpp #, fuzzy @@ -5709,12 +5446,12 @@ msgstr "ปลดล็อควัตถุที่เลือก" #: editor/plugins/canvas_item_editor_plugin.cpp #: editor/plugins/spatial_editor_plugin.cpp msgid "Makes sure the object's children are not selectable." -msgstr "ทำให้เลือกโหนดลูกไม่ได้" +msgstr "เลือกโหนดลูกไม่ได้" #: editor/plugins/canvas_item_editor_plugin.cpp #: editor/plugins/spatial_editor_plugin.cpp msgid "Restores the object's children's ability to be selected." -msgstr "ทำให้เลือกโหนดลูกได้เหมือนเดิม" +msgstr "เลือกโหนดลูกได้" #: editor/plugins/canvas_item_editor_plugin.cpp #, fuzzy @@ -5740,9 +5477,8 @@ msgid "View" msgstr "มุมมอง" #: editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Always Show Grid" -msgstr "แสดงเส้นตาราง" +msgstr "แสดงเส้นกริด" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Show Helpers" @@ -5768,7 +5504,7 @@ msgstr "1 มุมมอง" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Show Group And Lock Icons" -msgstr "" +msgstr "แสดงกลุ่มและล็อคไอคอน" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Center Selection" @@ -5832,11 +5568,11 @@ msgstr "ลบท่าทาง" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Multiply grid step by 2" -msgstr "เพิ่มความถี่เส้นตารางขึ้น 2 เท่า" +msgstr "เพิ่มความถี่เส้นกริดขึ้น 2 เท่า" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Divide grid step by 2" -msgstr "ลดความถี่เส้นตารางลงครึ่งหนึ่ง" +msgstr "ลดความถี่กริดลงครึ่งหนึ่ง" #: editor/plugins/canvas_item_editor_plugin.cpp #, fuzzy @@ -5853,7 +5589,7 @@ msgstr "กำลังเพิ่ม %s..." #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Cannot instantiate multiple nodes without root." -msgstr "อินสแตนซ์หลาย ๆ โหนดโดยที่ไม่มีโหนดรากไม่ได้" +msgstr "อินสแตนซ์หลาย ๆ โหนดโดยที่ไม่มีโหนดแม่ไม่ได้" #: editor/plugins/canvas_item_editor_plugin.cpp #: editor/plugins/spatial_editor_plugin.cpp editor/scene_tree_dock.cpp @@ -5879,9 +5615,8 @@ msgstr "" "ลาก & วาง + Alt: เปลี่ยนประเภทโหนด" #: editor/plugins/collision_polygon_editor_plugin.cpp -#, fuzzy msgid "Create Polygon3D" -msgstr "สร้างรูปหลายเหลี่ยม" +msgstr "สร้าง Polygon3D" #: editor/plugins/collision_polygon_editor_plugin.cpp msgid "Edit Poly" @@ -5904,9 +5639,8 @@ msgstr "โหลด Mask การปะทุ" #: editor/plugins/cpu_particles_editor_plugin.cpp #: editor/plugins/particles_2d_editor_plugin.cpp #: editor/plugins/particles_editor_plugin.cpp -#, fuzzy msgid "Restart" -msgstr "เริ่มใหม่ทันที" +msgstr "เริ่มใหม่" #: editor/plugins/cpu_particles_2d_editor_plugin.cpp #: editor/plugins/particles_2d_editor_plugin.cpp @@ -5938,7 +5672,7 @@ msgstr "Snap (พิกเซล):" #: editor/plugins/cpu_particles_2d_editor_plugin.cpp #: editor/plugins/particles_2d_editor_plugin.cpp msgid "Border Pixels" -msgstr "" +msgstr "พิกเซลขอบ" #: editor/plugins/cpu_particles_2d_editor_plugin.cpp #: editor/plugins/particles_2d_editor_plugin.cpp @@ -6006,12 +5740,10 @@ msgid "Load Curve Preset" msgstr "โหลดเส้นโค้งตัวอย่าง" #: editor/plugins/curve_editor_plugin.cpp -#, fuzzy msgid "Add Point" msgstr "เพิ่มจุด" #: editor/plugins/curve_editor_plugin.cpp -#, fuzzy msgid "Remove Point" msgstr "ลบจุด" @@ -6053,7 +5785,7 @@ msgstr "สร้าง GI Probe" #: editor/plugins/gradient_editor_plugin.cpp msgid "Gradient Edited" -msgstr "" +msgstr "แก้ไขเกรเดียนต์" #: editor/plugins/item_list_editor_plugin.cpp msgid "Item %d" @@ -6408,7 +6140,7 @@ msgstr "โหนดไม่มี geometry (หน้า)" #: editor/plugins/particles_editor_plugin.cpp msgid "\"%s\" doesn't inherit from Spatial." -msgstr "" +msgstr "\"%s\" ไม่ได้สืบทอดมาจาก Spatial" #: editor/plugins/particles_editor_plugin.cpp #, fuzzy @@ -6610,6 +6342,8 @@ msgid "" "No texture in this polygon.\n" "Set a texture to be able to edit UV." msgstr "" +"ไม่มีเทกเจอร์ในรูปหลายเหลี่ยมนี้\n" +"ตั้งเทกเจอร์เพื่อที่จะแก้ไข UV ได้" #: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Create UV Map" @@ -6622,9 +6356,8 @@ msgid "" msgstr "" #: editor/plugins/polygon_2d_editor_plugin.cpp -#, fuzzy msgid "Create Polygon & UV" -msgstr "สร้างรูปหลายเหลี่ยม" +msgstr "สร้าง Polygon และ UV" #: editor/plugins/polygon_2d_editor_plugin.cpp #, fuzzy @@ -6674,7 +6407,7 @@ msgstr "แก้ไข UV รูปหลายเหลี่ยม 2D" #: editor/plugins/polygon_2d_editor_plugin.cpp msgid "UV" -msgstr "" +msgstr "UV" #: editor/plugins/polygon_2d_editor_plugin.cpp #, fuzzy @@ -6722,13 +6455,15 @@ msgstr "ปรับขนาดรูปหลายเหลี่ยม" #: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Create a custom polygon. Enables custom polygon rendering." -msgstr "" +msgstr "สร้างรูปหลายเหลี่ยมแบบกำหนดเอง เปิดการเรนเดอร์รูปหลายเหลี่ยมแบบกำหนดเอง" #: editor/plugins/polygon_2d_editor_plugin.cpp msgid "" "Remove a custom polygon. If none remain, custom polygon rendering is " "disabled." msgstr "" +"ลบรูปหลายเหลี่ยมแบบกำหนดเอง " +"ถ้าไม่มีรูปหลายเหลี่ยมอยู่จะปิดการเรนเดอร์รูปหลายเหลี่ยมแบบกำหนดเอง" #: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Paint weights with specified intensity." @@ -6740,7 +6475,7 @@ msgstr "" #: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Radius:" -msgstr "" +msgstr "รัศมี:" #: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Polygon->UV" @@ -6755,9 +6490,8 @@ msgid "Clear UV" msgstr "ลบ UV" #: editor/plugins/polygon_2d_editor_plugin.cpp -#, fuzzy msgid "Grid Settings" -msgstr "การตั้งค่า GridMap" +msgstr "ตั้งค่าเส้นกริด" #: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Snap" @@ -6769,36 +6503,31 @@ msgstr "จำกัดการเคลื่อนย้าย" #: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Grid" -msgstr "เส้นตาราง" +msgstr "เส้นกริด" #: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Show Grid" -msgstr "แสดงเส้นตาราง" +msgstr "แสดงเส้นกริด" #: editor/plugins/polygon_2d_editor_plugin.cpp -#, fuzzy msgid "Configure Grid:" -msgstr "ตั้งค่าการจำกัด" +msgstr "ตั้งค่าเส้นกริด:" #: editor/plugins/polygon_2d_editor_plugin.cpp -#, fuzzy msgid "Grid Offset X:" -msgstr "จุดกำเนิดตาราง:" +msgstr "จุดเริ่มเส้นกริดแกน X:" #: editor/plugins/polygon_2d_editor_plugin.cpp -#, fuzzy msgid "Grid Offset Y:" -msgstr "จุดกำเนิดตาราง:" +msgstr "จุดเริ่มเส้นกริดแกน Y:" #: editor/plugins/polygon_2d_editor_plugin.cpp -#, fuzzy msgid "Grid Step X:" -msgstr "ระยะห่างเส้น:" +msgstr "ระยะห่างกริดแกน X:" #: editor/plugins/polygon_2d_editor_plugin.cpp -#, fuzzy msgid "Grid Step Y:" -msgstr "ระยะห่างเส้น:" +msgstr "ระยะห่างกริดแกน Y:" #: editor/plugins/polygon_2d_editor_plugin.cpp #, fuzzy @@ -6898,33 +6627,28 @@ msgid "Error Saving" msgstr "ผิดพลาดขณะบันทึก" #: editor/plugins/script_editor_plugin.cpp -#, fuzzy msgid "Error importing theme." msgstr "ผิดพลาดขณะนำเข้าธีม" #: editor/plugins/script_editor_plugin.cpp -#, fuzzy msgid "Error Importing" msgstr "ผิดพลาดขณะนำเข้า" #: editor/plugins/script_editor_plugin.cpp -#, fuzzy msgid "New Text File..." -msgstr "สร้างโฟลเดอร์..." +msgstr "สร้างไฟล์ข้อความใหม่" #: editor/plugins/script_editor_plugin.cpp -#, fuzzy msgid "Open File" msgstr "เปิดไฟล์" #: editor/plugins/script_editor_plugin.cpp -#, fuzzy msgid "Save File As..." -msgstr "บันทึกเป็น..." +msgstr "บันทึกไฟล์เป็น..." #: editor/plugins/script_editor_plugin.cpp msgid "Can't obtain the script for running." -msgstr "" +msgstr "ไม่สามารถเรียกใช้สคริปต์ได้" #: editor/plugins/script_editor_plugin.cpp msgid "Script failed reloading, check console for errors." @@ -6956,9 +6680,8 @@ msgid "Save Theme As..." msgstr "บันทึกธีมเป็น" #: editor/plugins/script_editor_plugin.cpp -#, fuzzy msgid "%s Class Reference" -msgstr " ตำราอ้างอิงคลาส" +msgstr "%s อ้างอิงคลาส" #: editor/plugins/script_editor_plugin.cpp #: editor/plugins/script_text_editor.cpp @@ -7013,9 +6736,8 @@ msgid "File" msgstr "ไฟล์" #: editor/plugins/script_editor_plugin.cpp -#, fuzzy msgid "Open..." -msgstr "เปิด" +msgstr "เปิด..." #: editor/plugins/script_editor_plugin.cpp msgid "Reopen Closed Script" @@ -7047,9 +6769,8 @@ msgid "Theme" msgstr "ธีม" #: editor/plugins/script_editor_plugin.cpp -#, fuzzy msgid "Import Theme..." -msgstr "นำเข้าธีม" +msgstr "นำเข้าธีม..." #: editor/plugins/script_editor_plugin.cpp msgid "Reload Theme" @@ -7069,7 +6790,7 @@ msgstr "ปิดคู่มือ" #: editor/plugins/script_editor_plugin.cpp editor/project_manager.cpp msgid "Run" -msgstr "รัน" +msgstr "เริ่ม" #: editor/plugins/script_editor_plugin.cpp editor/script_editor_debugger.cpp msgid "Step Into" @@ -7090,25 +6811,15 @@ msgstr "ทำต่อไป" #: editor/plugins/script_editor_plugin.cpp msgid "Keep Debugger Open" -msgstr "เปิดตัวแก้ไขจุดบกพร่องค้างไว้" +msgstr "เปิดตัวดีบักค้างไว้" #: editor/plugins/script_editor_plugin.cpp -#, fuzzy msgid "Debug with External Editor" -msgstr "แก้จุดบกพร่องด้วยโปรแกรมอื่น" +msgstr "ดีบักด้วยเอดิเตอร์อื่น" #: editor/plugins/script_editor_plugin.cpp -#, fuzzy msgid "Open Godot online documentation." -msgstr "เปิดคู่มือ" - -#: editor/plugins/script_editor_plugin.cpp -msgid "Request Docs" -msgstr "" - -#: editor/plugins/script_editor_plugin.cpp -msgid "Help improve the Godot documentation by giving feedback." -msgstr "" +msgstr "เปิดคู่มือออนไลน์" #: editor/plugins/script_editor_plugin.cpp msgid "Search the reference documentation." @@ -7146,22 +6857,19 @@ msgstr "บันทึกอีกครั้ง" #: editor/plugins/script_editor_plugin.cpp editor/script_editor_debugger.cpp msgid "Debugger" -msgstr "ตัวแก้ไขจุดบกพร่อง" +msgstr "ตัวดีบัก" #: editor/plugins/script_editor_plugin.cpp -#, fuzzy msgid "Search Results" -msgstr "ค้นหาในคู่มือ" +msgstr "ผลการค้นหา" #: editor/plugins/script_editor_plugin.cpp -#, fuzzy msgid "Clear Recent Scripts" -msgstr "ล้างรายการฉากล่าสุด" +msgstr "เคลียร์สคริปต์ล่าสุด" #: editor/plugins/script_text_editor.cpp -#, fuzzy msgid "Connections to method:" -msgstr "เชื่อมไปยังโหนด:" +msgstr "เชื่อมไปยังเมธอด:" #: editor/plugins/script_text_editor.cpp editor/script_editor_debugger.cpp #, fuzzy @@ -7169,9 +6877,8 @@ msgid "Source" msgstr "ต้นฉบับ:" #: editor/plugins/script_text_editor.cpp -#, fuzzy msgid "Target" -msgstr "ตำแหน่งที่อยู่:" +msgstr "เป้าหมาย" #: editor/plugins/script_text_editor.cpp #, fuzzy @@ -7186,7 +6893,7 @@ msgstr "บรรทัด:" #: editor/plugins/script_text_editor.cpp msgid "(ignore)" -msgstr "" +msgstr "(ละเว้น)" #: editor/plugins/script_text_editor.cpp #, fuzzy @@ -7229,17 +6936,17 @@ msgstr "อักษรแรกพิมพ์ใหญ่" #: editor/plugins/script_text_editor.cpp editor/plugins/text_editor.cpp msgid "Syntax Highlighter" -msgstr "" +msgstr "ไฮไลท์ไวยากรณ์" #: editor/plugins/script_text_editor.cpp #: editor/plugins/shader_editor_plugin.cpp editor/plugins/text_editor.cpp msgid "Go To" -msgstr "" +msgstr "ไปยัง" #: editor/plugins/script_text_editor.cpp #: editor/plugins/shader_editor_plugin.cpp editor/plugins/text_editor.cpp msgid "Bookmarks" -msgstr "" +msgstr "บุ๊คมาร์ค" #: editor/plugins/script_text_editor.cpp #, fuzzy @@ -7576,6 +7283,11 @@ msgstr "ต้องเลือกเพียงโหนดเดียว" #: editor/plugins/spatial_editor_plugin.cpp #, fuzzy +msgid "Auto Orthogonal Enabled" +msgstr "ขนาน" + +#: editor/plugins/spatial_editor_plugin.cpp +#, fuzzy msgid "Lock View Rotation" msgstr "แสดงข้อมูล" @@ -7667,17 +7379,17 @@ msgid "Freelook Slow Modifier" msgstr "ปรับความเร็วมุมมองอิสระ" #: editor/plugins/spatial_editor_plugin.cpp +#, fuzzy +msgid "View Rotation Locked" +msgstr "แสดงข้อมูล" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -#, fuzzy -msgid "View Rotation Locked" -msgstr "แสดงข้อมูล" - -#: editor/plugins/spatial_editor_plugin.cpp msgid "XForm Dialog" msgstr "เครื่องมือเคลื่อนย้าย" @@ -7807,9 +7519,8 @@ msgstr "แสดงเส้นตาราง" #: editor/plugins/spatial_editor_plugin.cpp #: modules/gridmap/grid_map_editor_plugin.cpp -#, fuzzy msgid "Settings..." -msgstr "ตัวเลือก" +msgstr "ตั้งค่า..." #: editor/plugins/spatial_editor_plugin.cpp msgid "Snap Settings" @@ -7915,9 +7626,8 @@ msgid "LightOccluder2D Preview" msgstr "สร้างรูปหลายเหลี่ยมกั้นแสง" #: editor/plugins/sprite_editor_plugin.cpp -#, fuzzy msgid "Sprite is empty!" -msgstr "ตำแหน่งบันทึกว่างเปล่า!" +msgstr "สไปรต์ว่างเปล่า!" #: editor/plugins/sprite_editor_plugin.cpp msgid "Can't convert a sprite using animation frames to mesh." @@ -7937,9 +7647,8 @@ msgid "Invalid geometry, can't create polygon." msgstr "" #: editor/plugins/sprite_editor_plugin.cpp -#, fuzzy msgid "Convert to Polygon2D" -msgstr "ย้ายรูปหลายเหลี่ยม" +msgstr "แปลงเป็น Polygon2D" #: editor/plugins/sprite_editor_plugin.cpp msgid "Invalid geometry, can't create collision polygon." @@ -7960,23 +7669,20 @@ msgid "Create LightOccluder2D Sibling" msgstr "สร้างรูปหลายเหลี่ยมกั้นแสง" #: editor/plugins/sprite_editor_plugin.cpp -#, fuzzy msgid "Sprite" -msgstr "SpriteFrames" +msgstr "สไปรต์" #: editor/plugins/sprite_editor_plugin.cpp msgid "Simplification: " -msgstr "" +msgstr "ลดความซับซ้อน: " #: editor/plugins/sprite_editor_plugin.cpp -#, fuzzy msgid "Shrink (Pixels): " -msgstr "Snap (พิกเซล):" +msgstr "หด (พิกเซล): " #: editor/plugins/sprite_editor_plugin.cpp -#, fuzzy msgid "Grow (Pixels): " -msgstr "Snap (พิกเซล):" +msgstr "ขยาย (พิกเซล): " #: editor/plugins/sprite_editor_plugin.cpp #, fuzzy @@ -7984,28 +7690,24 @@ msgid "Update Preview" msgstr "ตัวอย่าง Atlas" #: editor/plugins/sprite_editor_plugin.cpp -#, fuzzy msgid "Settings:" -msgstr "ตัวเลือก" +msgstr "ตั้งค่า:" #: editor/plugins/sprite_frames_editor_plugin.cpp -#, fuzzy msgid "No Frames Selected" -msgstr "ให้สิ่งที่เลือกเต็มจอ" +msgstr "ไม่มีเฟรมที่เลือก" #: editor/plugins/sprite_frames_editor_plugin.cpp -#, fuzzy msgid "Add %d Frame(s)" -msgstr "เพิ่มเฟรม" +msgstr "เพิ่ม %d เฟรม(วินาที)" #: editor/plugins/sprite_frames_editor_plugin.cpp msgid "Add Frame" msgstr "เพิ่มเฟรม" #: editor/plugins/sprite_frames_editor_plugin.cpp -#, fuzzy msgid "Unable to load images" -msgstr "โหลดรูปไม่ได้:" +msgstr "โหลดรูปไม่ได้" #: editor/plugins/sprite_frames_editor_plugin.cpp msgid "ERROR: Couldn't load frame resource!" @@ -8032,19 +7734,16 @@ msgid "(empty)" msgstr "(ว่างเปล่า)" #: editor/plugins/sprite_frames_editor_plugin.cpp -#, fuzzy msgid "Move Frame" -msgstr "วางเฟรม" +msgstr "เลื่อนเฟรม" #: editor/plugins/sprite_frames_editor_plugin.cpp -#, fuzzy msgid "Animations:" -msgstr "แอนิเมชัน" +msgstr "แอนิเมชัน:" #: editor/plugins/sprite_frames_editor_plugin.cpp -#, fuzzy msgid "New Animation" -msgstr "แอนิเมชัน" +msgstr "แอนิเมชันใหม่" #: editor/plugins/sprite_frames_editor_plugin.cpp msgid "Speed (FPS):" @@ -8055,18 +7754,16 @@ msgid "Loop" msgstr "วน" #: editor/plugins/sprite_frames_editor_plugin.cpp -#, fuzzy msgid "Animation Frames:" -msgstr "เฟรมแอนิเมชัน" +msgstr "เฟรมแอนิเมชัน:" #: editor/plugins/sprite_frames_editor_plugin.cpp -#, fuzzy msgid "Add a Texture from File" -msgstr "เพิ่มโหนดจากผัง" +msgstr "เพิ่มเทกเจอร์จากไฟล์" #: editor/plugins/sprite_frames_editor_plugin.cpp msgid "Add Frames from a Sprite Sheet" -msgstr "" +msgstr "เพิ่มเฟรมจากสไปรต์ชีต" #: editor/plugins/sprite_frames_editor_plugin.cpp msgid "Insert Empty (Before)" @@ -8085,32 +7782,28 @@ msgid "Move (After)" msgstr "ย้าย (หลัง)" #: editor/plugins/sprite_frames_editor_plugin.cpp -#, fuzzy msgid "Select Frames" -msgstr "สแตค" +msgstr "เลือกเฟรม" #: editor/plugins/sprite_frames_editor_plugin.cpp msgid "Horizontal:" -msgstr "" +msgstr "แนวนอน:" #: editor/plugins/sprite_frames_editor_plugin.cpp -#, fuzzy msgid "Vertical:" -msgstr "มุมรูปทรง" +msgstr "แนวตั้ง:" #: editor/plugins/sprite_frames_editor_plugin.cpp -#, fuzzy msgid "Select/Clear All Frames" -msgstr "เลือกทั้งหมด" +msgstr "เลือก/เคลียร์เฟรมทั้งหมด" #: editor/plugins/sprite_frames_editor_plugin.cpp -#, fuzzy msgid "Create Frames from Sprite Sheet" -msgstr "สร้างจากฉาก" +msgstr "สร้างเฟรมจากสไปรต์ชีต" #: editor/plugins/sprite_frames_editor_plugin.cpp msgid "SpriteFrames" -msgstr "SpriteFrames" +msgstr "สไปรต์เฟรม" #: editor/plugins/texture_region_editor_plugin.cpp msgid "Set Region Rect" @@ -8127,9 +7820,8 @@ msgstr "โหมดการจำกัด:" #: editor/plugins/texture_region_editor_plugin.cpp #: scene/resources/visual_shader.cpp -#, fuzzy msgid "None" -msgstr "<ไม่มี>" +msgstr "ไม่มี" #: editor/plugins/texture_region_editor_plugin.cpp msgid "Pixel Snap" @@ -8137,7 +7829,7 @@ msgstr "จำกัดให้ย้ายเป็นพิกเซล" #: editor/plugins/texture_region_editor_plugin.cpp msgid "Grid Snap" -msgstr "จำกัดด้วยเส้นตาราง" +msgstr "เข้าหาเส้นกริด" #: editor/plugins/texture_region_editor_plugin.cpp msgid "Auto Slice" @@ -8177,9 +7869,8 @@ msgid "Remove All" msgstr "ลบทั้งหมด" #: editor/plugins/theme_editor_plugin.cpp -#, fuzzy msgid "Edit Theme" -msgstr "แก้ไขธีม..." +msgstr "แก้ไขธีม" #: editor/plugins/theme_editor_plugin.cpp msgid "Theme editing menu." @@ -8211,9 +7902,8 @@ msgid "Toggle Button" msgstr "ปุ่มเมาส์" #: editor/plugins/theme_editor_plugin.cpp -#, fuzzy msgid "Disabled Button" -msgstr "เมาส์กลาง" +msgstr "ปิดการทำงานปุ่ม" #: editor/plugins/theme_editor_plugin.cpp msgid "Item" @@ -8248,17 +7938,15 @@ msgstr "" #: editor/plugins/theme_editor_plugin.cpp msgid "Submenu" -msgstr "" +msgstr "เมนูย่อย" #: editor/plugins/theme_editor_plugin.cpp -#, fuzzy msgid "Subitem 1" -msgstr "ไอเทม" +msgstr "ไอเทมย่อย 1" #: editor/plugins/theme_editor_plugin.cpp -#, fuzzy msgid "Subitem 2" -msgstr "ไอเทม" +msgstr "ไอเทมย่อย 2" #: editor/plugins/theme_editor_plugin.cpp msgid "Has" @@ -8286,18 +7974,16 @@ msgid "Tab 3" msgstr "แท็บ 3" #: editor/plugins/theme_editor_plugin.cpp -#, fuzzy msgid "Editable Item" -msgstr "แก้ไขโหนดลูกได้" +msgstr "ไอเทมที่สามารถแก้ไขได้" #: editor/plugins/theme_editor_plugin.cpp msgid "Subtree" -msgstr "" +msgstr "ผังย่อย" #: editor/plugins/theme_editor_plugin.cpp -#, fuzzy msgid "Has,Many,Options" -msgstr "มี,มากมาย,หลาย,ตัวเลือก!" +msgstr "มี,หลาย,ตัวเลือก" #: editor/plugins/theme_editor_plugin.cpp msgid "Data Type:" @@ -8321,28 +8007,25 @@ msgid "Color" msgstr "สี" #: editor/plugins/theme_editor_plugin.cpp -#, fuzzy msgid "Theme File" -msgstr "ธีม" +msgstr "ไฟล์ธีม" #: editor/plugins/tile_map_editor_plugin.cpp msgid "Erase Selection" msgstr "ลบที่เลือก" #: editor/plugins/tile_map_editor_plugin.cpp -#, fuzzy msgid "Fix Invalid Tiles" -msgstr "ชื่อผิดพลาด" +msgstr "แก้ไขไทล์ที่ไม่ถูกต้อง" #: editor/plugins/tile_map_editor_plugin.cpp #: modules/gridmap/grid_map_editor_plugin.cpp -#, fuzzy msgid "Cut Selection" -msgstr "ให้สิ่งที่เลือกอยู่กลางจอ" +msgstr "ตัดที่เลือก" #: editor/plugins/tile_map_editor_plugin.cpp msgid "Paint TileMap" -msgstr "วาด TileMap" +msgstr "วาดไทล์แมพ" #: editor/plugins/tile_map_editor_plugin.cpp msgid "Line Draw" @@ -8354,16 +8037,15 @@ msgstr "วาดสี่เหลี่ยม" #: editor/plugins/tile_map_editor_plugin.cpp msgid "Bucket Fill" -msgstr "ถมเต็ม" +msgstr "เทสี" #: editor/plugins/tile_map_editor_plugin.cpp msgid "Erase TileMap" -msgstr "ลบ TileMap" +msgstr "ลบไทล์แมพ" #: editor/plugins/tile_map_editor_plugin.cpp -#, fuzzy msgid "Find Tile" -msgstr "ค้นหา tile" +msgstr "ค้นหาไทล์" #: editor/plugins/tile_map_editor_plugin.cpp msgid "Transpose" @@ -8375,14 +8057,12 @@ msgid "Disable Autotile" msgstr "Autotiles" #: editor/plugins/tile_map_editor_plugin.cpp -#, fuzzy msgid "Enable Priority" -msgstr "แก้ไขตัวกรอง" +msgstr "เปิดการจัดลำดับความสำคัญ" #: editor/plugins/tile_map_editor_plugin.cpp -#, fuzzy msgid "Filter tiles" -msgstr "คัดกรองไฟล์..." +msgstr "ตัวกรองไทล์" #: editor/plugins/tile_map_editor_plugin.cpp msgid "Give a TileSet resource to this TileMap to use its tiles." @@ -8390,35 +8070,35 @@ msgstr "" #: editor/plugins/tile_map_editor_plugin.cpp msgid "Paint Tile" -msgstr "วาด Tile" +msgstr "วาดไทล์" #: editor/plugins/tile_map_editor_plugin.cpp msgid "" "Shift+LMB: Line Draw\n" "Shift+Ctrl+LMB: Rectangle Paint" msgstr "" +"Shift+LMB: วาดเส้น\n" +"Shift+Ctrl+LMB: วาดสี่เหลี่ยม" #: editor/plugins/tile_map_editor_plugin.cpp msgid "Pick Tile" -msgstr "เลือก Tile" +msgstr "เลือกไทล์" #: editor/plugins/tile_map_editor_plugin.cpp -#, fuzzy msgid "Rotate Left" -msgstr "โหมดหมุน" +msgstr "หมุนซ้าย" #: editor/plugins/tile_map_editor_plugin.cpp -#, fuzzy msgid "Rotate Right" -msgstr "ย้ายไปขวา" +msgstr "หมุนขวา" #: editor/plugins/tile_map_editor_plugin.cpp msgid "Flip Horizontally" -msgstr "" +msgstr "พลิกแนวนอน" #: editor/plugins/tile_map_editor_plugin.cpp msgid "Flip Vertically" -msgstr "" +msgstr "พลิกแนวตั้ง" #: editor/plugins/tile_map_editor_plugin.cpp #, fuzzy @@ -8426,14 +8106,12 @@ msgid "Clear Transform" msgstr "เคลื่อนย้าย" #: editor/plugins/tile_set_editor_plugin.cpp -#, fuzzy msgid "Add Texture(s) to TileSet." -msgstr "เพิ่มโหนดจากผัง" +msgstr "เพิ่มเทกเจอร์ให้ไทล์เซต" #: editor/plugins/tile_set_editor_plugin.cpp -#, fuzzy msgid "Remove selected Texture from TileSet." -msgstr "ลบรายการ" +msgstr "ลบเทกเจอร์ที่เลือกจากไทล์เซต" #: editor/plugins/tile_set_editor_plugin.cpp msgid "Create from Scene" @@ -8445,7 +8123,7 @@ msgstr "รวมจากฉาก" #: editor/plugins/tile_set_editor_plugin.cpp msgid "New Single Tile" -msgstr "" +msgstr "ไทล์เดี่ยวใหม่" #: editor/plugins/tile_set_editor_plugin.cpp #, fuzzy @@ -8458,22 +8136,20 @@ msgid "New Atlas" msgstr "%s ใหม่" #: editor/plugins/tile_set_editor_plugin.cpp -#, fuzzy msgid "Next Coordinate" -msgstr "ไปชั้นบน" +msgstr "พิกัดถัดไป" #: editor/plugins/tile_set_editor_plugin.cpp msgid "Select the next shape, subtile, or Tile." -msgstr "" +msgstr "เลือกรูปร่าง, ไทล์ย่อย หรือไทล์อันถัดไป" #: editor/plugins/tile_set_editor_plugin.cpp -#, fuzzy msgid "Previous Coordinate" -msgstr "ไปชั้นล่าง" +msgstr "พิกัดก่อนหน้า" #: editor/plugins/tile_set_editor_plugin.cpp msgid "Select the previous shape, subtile, or Tile." -msgstr "" +msgstr "เลือกรูปร่าง, ไทล์ย่อยหรือไทล์ก่อนหน้า" #: editor/plugins/tile_set_editor_plugin.cpp #, fuzzy @@ -8481,9 +8157,8 @@ msgid "Region" msgstr "โหมดการทำงาน:" #: editor/plugins/tile_set_editor_plugin.cpp -#, fuzzy msgid "Collision" -msgstr "โหนดแอนิเมชัน" +msgstr "ขอบเขตการชน" #: editor/plugins/tile_set_editor_plugin.cpp #, fuzzy @@ -8501,9 +8176,8 @@ msgid "Bitmask" msgstr "โหมดหมุน" #: editor/plugins/tile_set_editor_plugin.cpp -#, fuzzy msgid "Priority" -msgstr "วิธีการส่งออก:" +msgstr "การจัดลำดับความสำคัญ" #: editor/plugins/tile_set_editor_plugin.cpp #, fuzzy @@ -8516,9 +8190,8 @@ msgid "Region Mode" msgstr "โหมดการทำงาน:" #: editor/plugins/tile_set_editor_plugin.cpp -#, fuzzy msgid "Collision Mode" -msgstr "โหนดแอนิเมชัน" +msgstr "โหมดขอบเขตการชน" #: editor/plugins/tile_set_editor_plugin.cpp #, fuzzy @@ -8536,14 +8209,12 @@ msgid "Bitmask Mode" msgstr "โหมดหมุน" #: editor/plugins/tile_set_editor_plugin.cpp -#, fuzzy msgid "Priority Mode" -msgstr "วิธีการส่งออก:" +msgstr "โหมดการจัดลำดับความสำคัญ" #: editor/plugins/tile_set_editor_plugin.cpp -#, fuzzy msgid "Icon Mode" -msgstr "โหมดมุมมอง" +msgstr "โหมดไอคอน" #: editor/plugins/tile_set_editor_plugin.cpp #, fuzzy @@ -8565,26 +8236,24 @@ msgid "Erase bitmask." msgstr "คลิกขวา: ลบจุด" #: editor/plugins/tile_set_editor_plugin.cpp -#, fuzzy msgid "Create a new rectangle." -msgstr "สร้าง %s ใหม่" +msgstr "สร้างสี่เหลี่ยมใหม่" #: editor/plugins/tile_set_editor_plugin.cpp -#, fuzzy msgid "Create a new polygon." -msgstr "สร้างรูปหลายเหลี่ยมจากความว่างเปล่า" +msgstr "สร้างรูปหลายเหลี่ยมใหม่" #: editor/plugins/tile_set_editor_plugin.cpp msgid "Keep polygon inside region Rect." -msgstr "" +msgstr "ให้รูปหลายเหลี่ยมอยู่ในขอบเขตของสี่เหลี่ยม" #: editor/plugins/tile_set_editor_plugin.cpp msgid "Enable snap and show grid (configurable via the Inspector)." -msgstr "" +msgstr "โชว์เส้นกริด และ จุดตามกริด (ตั้งค่าใน Inspector)" #: editor/plugins/tile_set_editor_plugin.cpp msgid "Display Tile Names (Hold Alt Key)" -msgstr "" +msgstr "แสดงชื่อไทล์ (กดAltค้างไว้)" #: editor/plugins/tile_set_editor_plugin.cpp msgid "" @@ -8609,13 +8278,12 @@ msgid "Merge from scene?" msgstr "รวมจากฉาก?" #: editor/plugins/tile_set_editor_plugin.cpp -#, fuzzy msgid "Remove Texture" -msgstr "ลบแม่แบบ" +msgstr "ลบเทกเจอร์" #: editor/plugins/tile_set_editor_plugin.cpp msgid "%s file(s) were not added because was already on the list." -msgstr "" +msgstr "%s ไฟล์ไม่สามารถเพิ่มเข้าได้ เนื่องจากอยู่ในลิสต์เรียบร้อยแล้ว" #: editor/plugins/tile_set_editor_plugin.cpp msgid "" @@ -8636,20 +8304,20 @@ msgid "" msgstr "เลือกไทล์ย่อยที่กำลังปรับแต่ง" #: editor/plugins/tile_set_editor_plugin.cpp -#, fuzzy msgid "Delete polygon." -msgstr "ลบจุด" +msgstr "ลบรูปหลายเหลี่ยม" #: editor/plugins/tile_set_editor_plugin.cpp -#, fuzzy msgid "" "LMB: Set bit on.\n" "RMB: Set bit off.\n" "Shift+LMB: Set wildcard bit.\n" "Click on another Tile to edit it." msgstr "" -"คลิกซ้าย: กำหนดค่าบิต เปิด\n" -"คลิกขวา: กำหนดค่าบิต ปิด" +"คลิกซ้าย: เปิด bit.\n" +"คลิกขวา: ปิด bit.\n" +"Shift+คลิกซ้าย: ตั้ง wildcard bit.\n" +"คลิกไทล์อันอื่นเพื่อปรับแต่ง" #: editor/plugins/tile_set_editor_plugin.cpp #, fuzzy @@ -8660,11 +8328,12 @@ msgid "" msgstr "เลือกรูปภาพย่อยเพื่อทำเป็นไอคอน ภาพนี้จะใช้แสดงเมื่อการ" #: editor/plugins/tile_set_editor_plugin.cpp -#, fuzzy msgid "" "Select sub-tile to change its priority.\n" "Click on another Tile to edit it." -msgstr "เลือกไทล์ย่อยเพื่อจัดลำดับความสำคัญ" +msgstr "" +"เลือกไทล์ย่อยเพื่อจัดลำดับความสำคัญ\n" +"คลิกไทล์อันอื่นเพื่อแก้ไขไทล์นั้น" #: editor/plugins/tile_set_editor_plugin.cpp #, fuzzy @@ -8674,18 +8343,16 @@ msgid "" msgstr "เลือกไทล์ย่อยเพื่อจัดลำดับความสำคัญ" #: editor/plugins/tile_set_editor_plugin.cpp -#, fuzzy msgid "Set Tile Region" -msgstr "กำหนดขอบเขต Texture" +msgstr "ตั้งขอบเขตไทล์" #: editor/plugins/tile_set_editor_plugin.cpp -#, fuzzy msgid "Create Tile" -msgstr "สร้างโฟลเดอร์" +msgstr "สร้างไทล์" #: editor/plugins/tile_set_editor_plugin.cpp msgid "Set Tile Icon" -msgstr "" +msgstr "ตั้งไอคอนไทล์" #: editor/plugins/tile_set_editor_plugin.cpp #, fuzzy @@ -8727,9 +8394,8 @@ msgid "Make Polygon Convex" msgstr "ย้ายรูปหลายเหลี่ยม" #: editor/plugins/tile_set_editor_plugin.cpp -#, fuzzy msgid "Remove Tile" -msgstr "ลบแม่แบบ" +msgstr "ลบไทล์" #: editor/plugins/tile_set_editor_plugin.cpp #, fuzzy @@ -8747,13 +8413,12 @@ msgid "Remove Navigation Polygon" msgstr "สร้างรูปทรงนำทาง" #: editor/plugins/tile_set_editor_plugin.cpp -#, fuzzy msgid "Edit Tile Priority" -msgstr "แก้ไขตัวกรอง" +msgstr "แก้ลำดับความสำคัญของไทล์" #: editor/plugins/tile_set_editor_plugin.cpp msgid "Edit Tile Z Index" -msgstr "" +msgstr "แก้ไขดัชนี Z ของไทล์" #: editor/plugins/tile_set_editor_plugin.cpp #, fuzzy @@ -8761,14 +8426,12 @@ msgid "Make Convex" msgstr "ย้ายรูปหลายเหลี่ยม" #: editor/plugins/tile_set_editor_plugin.cpp -#, fuzzy msgid "Make Concave" -msgstr "ย้ายรูปหลายเหลี่ยม" +msgstr "ทำให้เว้า" #: editor/plugins/tile_set_editor_plugin.cpp -#, fuzzy msgid "Create Collision Polygon" -msgstr "สร้างรูปทรงนำทาง" +msgstr "สร้างรูปหลายเหลี่ยมของเขตการชน" #: editor/plugins/tile_set_editor_plugin.cpp #, fuzzy @@ -8776,18 +8439,16 @@ msgid "Create Occlusion Polygon" msgstr "สร้างรูปหลายเหลี่ยมกั้นแสง" #: editor/plugins/tile_set_editor_plugin.cpp -#, fuzzy msgid "This property can't be changed." -msgstr "ทำไม่ได้ถ้าไม่มีฉาก" +msgstr "ไม่สามารถเปลี่ยนแปลงคุณสมบัติได้" #: editor/plugins/tile_set_editor_plugin.cpp -#, fuzzy msgid "TileSet" -msgstr "Tile Set" +msgstr "ไทล์เซต" #: editor/plugins/version_control_editor_plugin.cpp msgid "No VCS addons are available." -msgstr "" +msgstr "ไม่พบส่วนเสริม VCS" #: editor/plugins/version_control_editor_plugin.cpp msgid "Error" @@ -8816,9 +8477,8 @@ msgid "Version Control System" msgstr "" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Initialize" -msgstr "อักษรแรกพิมพ์ใหญ่" +msgstr "เริ่มต้น" #: editor/plugins/version_control_editor_plugin.cpp msgid "Staging area" @@ -8830,7 +8490,6 @@ msgid "Detect new changes" msgstr "สร้าง %s ใหม่" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Changes" msgstr "เปลี่ยน" @@ -8839,14 +8498,12 @@ msgid "Modified" msgstr "" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Renamed" -msgstr "เปลี่ยนชื่อ" +msgstr "เปลี่ยนชื่อแล้ว" #: editor/plugins/version_control_editor_plugin.cpp -#, fuzzy msgid "Deleted" -msgstr "ลบ" +msgstr "ลบแล้ว" #: editor/plugins/version_control_editor_plugin.cpp #, fuzzy @@ -8892,26 +8549,23 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "(GLES3 only)" -msgstr "" +msgstr "(GLES3 เท่านั้น)" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Add Output" -msgstr "เพิ่มอินพุต" +msgstr "เพิ่มเอาท์พุต" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Scalar" -msgstr "อัตราส่วน:" +msgstr "สเกลาร์" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Vector" -msgstr "คุณสมบัติ" +msgstr "เวกเตอร์" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Boolean" -msgstr "" +msgstr "บูลีน" #: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy @@ -8919,43 +8573,36 @@ msgid "Sampler" msgstr "ไฟล์เสียง" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Add input port" -msgstr "เพิ่มอินพุต" +msgstr "เพิ่มพอร์ตอินพุต" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Add output port" -msgstr "" +msgstr "เพิ่มพอร์ตเอาต์พุต" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Change input port type" -msgstr "เปลี่ยนประเภท" +msgstr "เปลี่ยนชนิดพอร์ตอินพุต" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Change output port type" -msgstr "เปลี่ยนประเภท" +msgstr "เปลี่ยนชนิดพอร์ตเอาต์พุต" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Change input port name" -msgstr "เปลี่ยนชื่ออินพุต" +msgstr "เปลี่ยนชื่อพอร์ตอินพุต" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Change output port name" -msgstr "เปลี่ยนชื่ออินพุต" +msgstr "เปลี่ยนชื่อพอร์ตเอาต์พุต" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Remove input port" -msgstr "ลบจุด" +msgstr "ลบพอร์ตอินพุต" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Remove output port" -msgstr "ลบจุด" +msgstr "ลบพอร์ตเอาต์พุต" #: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy @@ -8963,26 +8610,22 @@ msgid "Set expression" msgstr "แก้ไขสมการ" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Resize VisualShader node" -msgstr "Shader" +msgstr "ปรับขนาดโหนดเวอร์ชวลเชดเดอร์" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Set Uniform Name" -msgstr "" +msgstr "ตั้งชื่อยูนิฟอร์ม" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Set Input Default Port" -msgstr "กำหนดเป็นค่าเริ่มต้นของ '%s'" +msgstr "กำหนดพอร์ตอินพุตเริ่มต้น" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Add Node to Visual Shader" -msgstr "Shader" +msgstr "เพิ่มโหนดไปยังเวอร์ชวลเชดเดอร์" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Duplicate Nodes" msgstr "ทำซ้ำโหนด" @@ -8992,13 +8635,12 @@ msgid "Paste Nodes" msgstr "วางโหนด" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Delete Nodes" msgstr "ลบโหนด" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Visual Shader Input Type Changed" -msgstr "" +msgstr "เปลี่ยนชนิดของอินพุตเวอร์ชวลเชดเดอร์" #: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy @@ -9006,9 +8648,8 @@ msgid "Vertex" msgstr "มุมรูปทรง" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Fragment" -msgstr "ตัวแปร:" +msgstr "แฟรกเมนต์" #: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy @@ -9021,44 +8662,40 @@ msgid "Show resulted shader code." msgstr "สร้างโหนด" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Create Shader Node" -msgstr "สร้างโหนด" +msgstr "สร้างโหนดเชดเดอร์" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Color function." -msgstr "ไปยังฟังก์ชัน..." +msgstr "ฟังก์ชันสี" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Color operator." -msgstr "" +msgstr "การดำเนินการสี" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Grayscale function." -msgstr "สร้างฟังก์ชัน" +msgstr "ฟังก์ชันขาว-ดำ" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Converts HSV vector to RGB equivalent." -msgstr "" +msgstr "แปลงเวกเตอร์ HSV เป็น RGB" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Converts RGB vector to HSV equivalent." -msgstr "" +msgstr "แปลงเวกเตอร์ RGB เป็น HSV" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Sepia function." -msgstr "เปลี่ยนชื่อฟังก์ชัน" +msgstr "ฟังก์ชันซีเปีย" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Burn operator." -msgstr "" +msgstr "ดำเนินการ Burn" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Darken operator." -msgstr "" +msgstr "ดำเนินการ Darken" #: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy @@ -9067,7 +8704,7 @@ msgstr "เฉพาะที่แตกต่าง" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Dodge operator." -msgstr "" +msgstr "ดำเนินการ Dodge" #: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy @@ -9076,19 +8713,19 @@ msgstr "แก้ไขเครื่องหมายสเกลาร์" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Lighten operator." -msgstr "" +msgstr "ดำเนินการ Lighten" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Overlay operator." -msgstr "" +msgstr "ดำเนินการ Overlay" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Screen operator." -msgstr "" +msgstr "ดำเนินการ Screen" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "SoftLight operator." -msgstr "" +msgstr "ดำเนินการ SoftLight" #: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy @@ -9102,165 +8739,161 @@ msgstr "เคลื่อนย้าย" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the boolean result of the %s comparison between two parameters." -msgstr "" +msgstr "คืนค่าผลบูลีนจากการเปรียบเทียบระหว่างสองตัวแปรของ %s" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Equal (==)" -msgstr "" +msgstr "เทียบเท่า (==)" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Greater Than (>)" -msgstr "" +msgstr "มากกว่า (>)" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Greater Than or Equal (>=)" -msgstr "" +msgstr "มากกว่าหรือเท่ากับ (>=)" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" "Returns an associated vector if the provided scalars are equal, greater or " "less." -msgstr "" +msgstr "คืนค่าเวกเตอร์ที่เกี่ยวข้องถ้าสเกลาร์ที่ให้มีค่าเท่ากับ มากกว่าหรือน้อยกว่า" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" "Returns the boolean result of the comparison between INF and a scalar " "parameter." -msgstr "" +msgstr "คืนค่าบูลีนจากการเปรียบเทียบค่า INF กับพารามิเตอร์ชนิดสเกลาร์" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" "Returns the boolean result of the comparison between NaN and a scalar " "parameter." -msgstr "" +msgstr "คืนค่าบูลีนซึ่งเปรียบเทียบค่าระหว่าง NaN กับพารามิเตอร์สเกลาร์" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Less Than (<)" -msgstr "" +msgstr "น้อยกว่า(<)" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Less Than or Equal (<=)" -msgstr "" +msgstr "น้อยกว่าหรือเท่ากับ(<=)" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Not Equal (!=)" -msgstr "" +msgstr "ไม่เท่ากับ (!=)" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" "Returns an associated vector if the provided boolean value is true or false." -msgstr "" +msgstr "คืนค่าเวกเตอร์ที่เกี่ยวข้องถ้าบูลีนที่ให้มีค่าเท่ากับ true หรือ false" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" "Returns an associated scalar if the provided boolean value is true or false." -msgstr "" +msgstr "คืนค่าสเกลาร์ที่เกี่ยวข้องถ้าต่าบูลีนที่ให้มีค่า true หรือ false" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the boolean result of the comparison between two parameters." -msgstr "" +msgstr "คืนค่าบูลีนจากการเปรียบเทียบพารามิเตอร์สองตัว" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" "Returns the boolean result of the comparison between INF (or NaN) and a " "scalar parameter." -msgstr "" +msgstr "คืนค่าบูลีนจากการเปรียบเทียบค่า INF (หรือ NaN) และพารามิเตอร์สเกลาร์" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Boolean constant." -msgstr "แก้ไขค่าคงที่เวกเตอร์" +msgstr "ค่าคงที่บูลีน" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Boolean uniform." -msgstr "" +msgstr "ยูนิฟอร์มบูลีน" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "'%s' input parameter for all shader modes." -msgstr "" +msgstr "'%s' พารามิเตอร์ของอินพุตสำหรับโหมดเชดเดอร์ทั้งหมด" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Input parameter." -msgstr "จำกัดด้วยโหนดแม่" +msgstr "พารามิเตอร์อินพุต" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "'%s' input parameter for vertex and fragment shader modes." -msgstr "" +msgstr "'%s' พารามิเตอร์อินพุตสำหรับโหมดเวอร์เท็กซ์เชดเดอร์และแฟรกเมนต์เชดเดอร์" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "'%s' input parameter for fragment and light shader modes." -msgstr "" +msgstr "'%s' พารามิเตอร์อินพุตสำหรับโหมดแฟรกเมนต์เชดเดอร์และโหมดไลท์เชดเดอร์" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "'%s' input parameter for fragment shader mode." -msgstr "" +msgstr "'%s' พารามิเตอร์อินพุตสำหรับโหมดแฟรกเมนต์เชดเดอร์" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "'%s' input parameter for light shader mode." -msgstr "" +msgstr "'%s' พารามิเตอร์อินพุตสำหรับโหมดไลท์เชดเดอร์" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "'%s' input parameter for vertex shader mode." -msgstr "" +msgstr "'%s' พารามิเตอร์อินพุตสำหรับโหมดเวอร์เท็กซ์เชดเดอร์" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "'%s' input parameter for vertex and fragment shader mode." -msgstr "" +msgstr "'%s' พารามิเตอร์อินพุตสำหรับโหมดเวอร์เท็กซ์เชดเดอร์และแฟรกเมนต์เชดเดอร์" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Scalar function." -msgstr "แก้ไขฟังก์ชันสเกลาร์" +msgstr "ฟังก์ชันสเกลาร์" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Scalar operator." -msgstr "แก้ไขเครื่องหมายสเกลาร์" +msgstr "ตัวดำเนินการสเกลาร์" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "E constant (2.718282). Represents the base of the natural logarithm." -msgstr "" +msgstr "ค่าคงที่ E (2.718282) แสดงในรูปลอกาลิทึมฐานธรรมชาติ" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Epsilon constant (0.00001). Smallest possible scalar number." -msgstr "" +msgstr "ค่าคงที่เอพซิลอน (0.00001) ค่าที่เล็กที่สุดของสเกลาร์" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Phi constant (1.618034). Golden ratio." -msgstr "" +msgstr "ค่าฟาย (1.618034) สัดส่วนทองคำ" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Pi/4 constant (0.785398) or 45 degrees." -msgstr "" +msgstr "ค่าพายส่วน 4 (0.785398) หรือ 45องศา" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Pi/2 constant (1.570796) or 90 degrees." -msgstr "" +msgstr "ค่าพายส่วน2 (1.570796) หรือ 90 องศา" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Pi constant (3.141593) or 180 degrees." -msgstr "" +msgstr "ค่าพาย (3.141593) หรือ 180 องศา" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Tau constant (6.283185) or 360 degrees." -msgstr "" +msgstr "ค่าเทา (6.283185) หรือ 360 องศา" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Sqrt2 constant (1.414214). Square root of 2." -msgstr "" +msgstr "ค่ารูท2 (1.414214)" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the absolute value of the parameter." -msgstr "" +msgstr "คืนค่าสัมบูรณ์ของพารามิเตอร์" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the arc-cosine of the parameter." -msgstr "" +msgstr "คืนค่า arc-cosine ของพารามิเตอร์" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the inverse hyperbolic cosine of the parameter." -msgstr "" +msgstr "คืนค่า arc cosh ของพารามิเตอร์" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the arc-sine of the parameter." @@ -9276,121 +8909,121 @@ msgstr "คืนค่า arc tan ของพารามิเตอร์" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the arc-tangent of the parameters." -msgstr "" +msgstr "คืนค่า arc tan ของพารามิเตอร์" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the inverse hyperbolic tangent of the parameter." -msgstr "" +msgstr "คืนค่า tanh ของพารามิเตอร์" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" "Finds the nearest integer that is greater than or equal to the parameter." -msgstr "" +msgstr "หาจำนวนเต็มใกล้ที่สุดที่มากกว่าหรือเท่ากับค่าพารามิเตอร์" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Constrains a value to lie between two further values." -msgstr "" +msgstr "จำกัดค่าไว้ระหว่างอีกสองค่า" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the cosine of the parameter." -msgstr "" +msgstr "คืนค่า cos ของพารามิเตอร์" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the hyperbolic cosine of the parameter." -msgstr "" +msgstr "คืนค่า cosh ของพารามิเตอร์" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Converts a quantity in radians to degrees." -msgstr "" +msgstr "แปลงเรเดียนเป็นองศา" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Base-e Exponential." -msgstr "" +msgstr "เลขยกกำลังฐาน e" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Base-2 Exponential." -msgstr "" +msgstr "เลขยกกำลังฐาน 2" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Finds the nearest integer less than or equal to the parameter." -msgstr "" +msgstr "หาค่าจำนวนเต็มที่ใกล้ที่สุดที่น้อยกว่าหรือเท่ากับพารามิเตอร์" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Computes the fractional part of the argument." -msgstr "" +msgstr "คำนวณสัดส่วนจากอากิวเมนต์" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the inverse of the square root of the parameter." -msgstr "" +msgstr "คืนค่ารูทสองของพารามิเตอร์" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Natural logarithm." -msgstr "" +msgstr "ลอกาลิทึมฐานธรรมชาติ" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Base-2 logarithm." -msgstr "" +msgstr "ลอกาลิทึมฐาน 2" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the greater of two values." -msgstr "" +msgstr "คืนค่ามากสุด จากสองค่า" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the lesser of two values." -msgstr "" +msgstr "คืนค่าน้อยสุด จากสองค่า" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Linear interpolation between two scalars." -msgstr "" +msgstr "ค่าประมาณเชิงเส้นระหว่างสเกลาร์สองค่า" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the opposite value of the parameter." -msgstr "" +msgstr "คืนค่าตรงกันข้ามจากพารามิเตอร์" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "1.0 - scalar" -msgstr "" +msgstr "1.0 - สเกลาร์" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" "Returns the value of the first parameter raised to the power of the second." -msgstr "" +msgstr "คืนค่าพารามิเตอร์ตัวแรกยกกำลังด้วยพารามิเตอร์ตัวที่สอง" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Converts a quantity in degrees to radians." -msgstr "" +msgstr "แปลงค่าองศาเป็นเรเดียน" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "1.0 / scalar" -msgstr "" +msgstr "1.0 / สเกลาร์" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Finds the nearest integer to the parameter." -msgstr "" +msgstr "หาจำนวนเต็มที่ใกล้กับพารามิเตอร์มากที่สุด" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Finds the nearest even integer to the parameter." -msgstr "" +msgstr "หาเลขคู่ที่ใกล้กับพารามิเตอร์มากที่สุด" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Clamps the value between 0.0 and 1.0." -msgstr "" +msgstr "จำกัดค่าให้อยู๋ระหว่าง 0.0 กับ 1.0" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Extracts the sign of the parameter." -msgstr "" +msgstr "หาเครื่องหมายของพาราพิเตอร์ (บวก/ลบ)" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the sine of the parameter." -msgstr "" +msgstr "คืนค่า sine ของพารามิเตอร์" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the hyperbolic sine of the parameter." -msgstr "" +msgstr "คืนค่า sinh ของพารามิเตอร์" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the square root of the parameter." -msgstr "" +msgstr "คืนค่ารูทสองของพารามิเตอร์" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" @@ -9400,6 +9033,10 @@ msgid "" "'edge1'. Otherwise the return value is interpolated between 0.0 and 1.0 " "using Hermite polynomials." msgstr "" +"SmoothStep function( สเกลาร์(edge0), สเกลาร์(edge1), สเกลาร์(x) )\n" +"\n" +"คืนค่า 0.0 ถ้า x น้อยกว่า 'edge0' และ 1.0 ถ้ามากกว่า 'edge1' หรือคืนค่าระหว่าง 0.0 - " +"1.0 โดยใช้ Hermite polynomials" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" @@ -9407,56 +9044,57 @@ msgid "" "\n" "Returns 0.0 if 'x' is smaller than 'edge' and otherwise 1.0." msgstr "" +"Step function( สเกลาร์(edge), สเกลาร์(x) )\n" +"\n" +"คืนค่า 0.0 ถ้า x น้อยกว่า edge ถ้าไม่ใช่จะคืนค่า 1.0" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the tangent of the parameter." -msgstr "" +msgstr "คืนค่า tan ของพารามิเตอร์" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the hyperbolic tangent of the parameter." -msgstr "" +msgstr "คืนค่า tanh ของพารามิเตอร์" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Finds the truncated value of the parameter." -msgstr "" +msgstr "หาค่าตัดหลักทศนิยม(truncated value) ของพารามิเตอร์" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Adds scalar to scalar." -msgstr "" +msgstr "บวกสเกลาร์ด้วยสเกลาร์" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Divides scalar by scalar." -msgstr "" +msgstr "หารสเกลาร์ด้วยสเกลาร์" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Multiplies scalar by scalar." -msgstr "" +msgstr "คูณสเกลาร์ด้วยสเกลาร์" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the remainder of the two scalars." -msgstr "" +msgstr "คืนค่าเศษผลหารของสเกลาร์สองอัน" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Subtracts scalar from scalar." -msgstr "" +msgstr "ลบสเกลาร์ด้วยสเกลาร์" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Scalar constant." -msgstr "แก้ไขค่าคงที่สเกลาร์" +msgstr "ค่าคงที่สเกลาร์" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Scalar uniform." -msgstr "แก้ไขสเกลาร์ Uniform" +msgstr "ยูนิฟอร์มสเกลาร์" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Perform the cubic texture lookup." -msgstr "" +msgstr "ทำการค้นหาเทกเจอร์ลูกบาศก์" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Perform the texture lookup." -msgstr "" +msgstr "ทำการค้นหาเทกเจอร์" #: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy @@ -9499,23 +9137,23 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Calculates the determinant of a transform." -msgstr "" +msgstr "คำนวณดีเทอร์มิแนนต์ของทรานฟอร์ม" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Calculates the inverse of a transform." -msgstr "" +msgstr "คำนวณอินเวอร์สของทรานฟอร์ม" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Calculates the transpose of a transform." -msgstr "" +msgstr "คำนวณทรานสโพสของทรานฟอร์ม" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Multiplies transform by transform." -msgstr "" +msgstr "คูณทรานฟอร์มด้วยทรานฟอร์ม" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Multiplies vector by transform." -msgstr "" +msgstr "คูณเวกเตอร์ด้วยทรานฟอร์ม" #: editor/plugins/visual_shader_editor_plugin.cpp #, fuzzy @@ -9528,34 +9166,32 @@ msgid "Transform uniform." msgstr "ยกเลิกการเคลื่อนย้าย" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Vector function." -msgstr "ไปยังฟังก์ชัน..." +msgstr "ฟังก์ชันเวกเตอร์" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Vector operator." -msgstr "แก้ไขเครื่องหมายเวกเตอร์" +msgstr "ตัวดำเนินการเวกเตอร์" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Composes vector from three scalars." -msgstr "" +msgstr "สร้างเวกเตอร์จากสเกลาร์สามตัว" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Decomposes vector to three scalars." -msgstr "" +msgstr "สร้างสเกลาร์สามตัวจากเวกเตอร์" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Calculates the cross product of two vectors." -msgstr "" +msgstr "หาผลคูณเชิงเวกเตอร์(cross product) ของเวกเตอร์สองตัว" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the distance between two points." -msgstr "" +msgstr "คืนค่าระยะห่างระหว่างสองจุด" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Calculates the dot product of two vectors." -msgstr "" +msgstr "คำนวณผลคูณเชิงสเกลลาร์ (dot) ของเวกเตอร์สองตัว" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" @@ -9567,27 +9203,27 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Calculates the length of a vector." -msgstr "" +msgstr "หาขนาดเวกเตอร์" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Linear interpolation between two vectors." -msgstr "" +msgstr "การประมาณค่าเชิงเส้นระหว่างสองเวกเตอร์" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Linear interpolation between two vectors using scalar." -msgstr "" +msgstr "การประมาณค่าเชิงเส้นระหว่างสองเวกเตอร์โดยใช้สเกลาร์" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Calculates the normalize product of vector." -msgstr "" +msgstr "คำนวณหาเวกเตอร์หน่วยของเวกเตอร์" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "1.0 - vector" -msgstr "" +msgstr "1.0 - เวกเตอร์" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "1.0 / vector" -msgstr "" +msgstr "1.0 / เวกเตอร์" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" @@ -9597,7 +9233,7 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the vector that points in the direction of refraction." -msgstr "" +msgstr "คืนค่าเวกเตอร์ที่มีทิศทางที่เกิดจากการหักเห" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" @@ -9607,6 +9243,10 @@ msgid "" "'edge1'. Otherwise the return value is interpolated between 0.0 and 1.0 " "using Hermite polynomials." msgstr "" +"SmoothStep function( เวกเตอร์(edge0), เวกเตอร์(edge1), เวกเตอร์(x) ).\n" +"\n" +"คืนค่า 0.0 ถ้า 'x' น้อยกว่า 'edge0' และ 1.0 ถ้า 'x' มากกว่า 'edge1' " +"นอกนั้นจะคืนค่าระหว่าง 0.0 กับ 1.0 โดยใช้สูตรพหุนามเฮอไมท์ (Hermite polynomials)" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" @@ -9616,6 +9256,10 @@ msgid "" "'edge1'. Otherwise the return value is interpolated between 0.0 and 1.0 " "using Hermite polynomials." msgstr "" +"SmoothStep function( สเกลาร์(edge0), สเกลาร์(edge1), เวกเตอร์(x) )\n" +"\n" +"คืนค่า 0.0 ถ้า 'x' น้อยกว่า 'edge0' และ 1.0 ถ้า 'x' มากกว่า 'edge1' " +"นอกนั้นจะคืนค่าระหว่าง 0.0 กับ 1.0 โดยใช้สูตรพหุนามเฮอไมท์ (Hermite polynomials)" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" @@ -9623,6 +9267,9 @@ msgid "" "\n" "Returns 0.0 if 'x' is smaller than 'edge' and otherwise 1.0." msgstr "" +"Step function( เวกเตอร์(edge), เวกเตอร์(x) ).\n" +"\n" +"คืนค่า 0.0 ถ้า x น้อยกว่า edge ถ้าไม่ใช่ คืนค่า 1.0" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" @@ -9630,36 +9277,37 @@ msgid "" "\n" "Returns 0.0 if 'x' is smaller than 'edge' and otherwise 1.0." msgstr "" +"Step function( สเกลาร์(edge), เวกเตอร์(x) ).\n" +"\n" +"คืนค่า 0.0 ถ้า 'x' น้อยกว่า 'edge' ถ้าไม่ใช่จะคืนค่า 1.0" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Adds vector to vector." -msgstr "" +msgstr "บวกเวกเตอร์ด้วยเวกเตอร์" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Divides vector by vector." -msgstr "" +msgstr "หารเวกเตอร์ด้วยเวกเตอร์" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Multiplies vector by vector." -msgstr "" +msgstr "คูณเวกเตอร์ด้วยเวกเตอร์" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Returns the remainder of the two vectors." -msgstr "" +msgstr "คืนค่าเศษหารของเวกเตอร์สองเวกเตอร์" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Subtracts vector from vector." -msgstr "" +msgstr "ลบเวกเตอร์ด้วยเวกเตอร์" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Vector constant." -msgstr "แก้ไขค่าคงที่เวกเตอร์" +msgstr "ค่าคงที่เวกเตอร์" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Vector uniform." -msgstr "แก้ไขเวกเตอร์ Uniform" +msgstr "ยูนิฟอร์มเวกเตอร์" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" @@ -9684,11 +9332,11 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "(Fragment/Light mode only) Scalar derivative function." -msgstr "" +msgstr "(โหมดแฟรกเมนต์/แสง เท่านั้น) ฟังก์ชันอนุพันธ์สเกลาร์" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "(Fragment/Light mode only) Vector derivative function." -msgstr "" +msgstr "(โหมดแฟรกเมนต์/แสง เท่านั้น) ฟังก์ชันอนุพันธ์เวกเตอร์" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" @@ -9718,41 +9366,37 @@ msgstr "" msgid "" "(Fragment/Light mode only) (Vector) Sum of absolute derivative in 'x' and " "'y'." -msgstr "" +msgstr "(โหมดแฟรกเมนต์/แสง เท่านั้น) (เวกเตอร์) ผลรวมของอนุพันธ์สัมบูรณ์ใน 'x' และ 'y'" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" "(Fragment/Light mode only) (Scalar) Sum of absolute derivative in 'x' and " "'y'." -msgstr "" +msgstr "(โหมดแฟรกเมนต์/แสง เท่านั้น) (สเกลาร์) ผลรวมของอนุพันธ์สัมบูรณ์ใน 'x' และ 'y'" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "VisualShader" -msgstr "Shader" +msgstr "เวอร์ชวลเชดเดอร์" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Edit Visual Property" -msgstr "แก้ไขตัวกรอง" +msgstr "แก้ไขคุณสมบัติเวอร์ชวล" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Visual Shader Mode Changed" -msgstr "จำนวนครั้งที่เปลี่ยน Shader" +msgstr "เปลี่ยนโหมดเวอร์ชวลเชดเดอร์แล้ว" #: editor/project_export.cpp msgid "Runnable" -msgstr "รันได้" +msgstr "สามารถรันได้" #: editor/project_export.cpp -#, fuzzy msgid "Add initial export..." -msgstr "เพิ่มอินพุต" +msgstr "เพิ่มการส่งออกเริ่มต้น..." #: editor/project_export.cpp msgid "Add previous patches..." -msgstr "" +msgstr "เพิ่มแพทช์ก่อนหน้า..." #: editor/project_export.cpp msgid "Delete patch '%s' from list?" @@ -9776,19 +9420,16 @@ msgid "" msgstr "" #: editor/project_export.cpp -#, fuzzy msgid "Release" -msgstr "เพิ่งปล่อย" +msgstr "เผยแพร่" #: editor/project_export.cpp -#, fuzzy msgid "Exporting All" -msgstr "ส่งออกสำหรับ %s" +msgstr "ส่งออกทั้งหมด" #: editor/project_export.cpp -#, fuzzy msgid "The given export path doesn't exist:" -msgstr "ไม่พบไฟล์" +msgstr "ไม่พบที่อยู่ส่งออก:" #: editor/project_export.cpp msgid "Export templates for this platform are missing/corrupted:" @@ -9809,17 +9450,16 @@ msgid "" msgstr "" #: editor/project_export.cpp -#, fuzzy msgid "Export Path" -msgstr "ส่งออกโปรเจกต์" +msgstr "ไดเรกทอรีส่งออก" #: editor/project_export.cpp msgid "Resources" -msgstr "รีซอร์ส" +msgstr "ทรัพยากร" #: editor/project_export.cpp msgid "Export all resources in the project" -msgstr "ส่งออกทุกรีซอร์สในโปรเจกต์" +msgstr "ส่งออกทรัพยากรทั้งหมดในโปรเจกต์" #: editor/project_export.cpp msgid "Export selected scenes (and dependencies)" @@ -9877,9 +9517,8 @@ msgid "Feature List:" msgstr "รายชื่อฟีเจอร์:" #: editor/project_export.cpp -#, fuzzy msgid "Script" -msgstr "สคริปต์ใหม่" +msgstr "สคริปต์" #: editor/project_export.cpp msgid "Script Export Mode:" @@ -9899,7 +9538,7 @@ msgstr "เข้ารหัส (ใส่คีย์ด้านล่าง) #: editor/project_export.cpp msgid "Invalid Encryption Key (must be 64 characters long)" -msgstr "" +msgstr "คีย์เข้ารหัสไม่ถูกต้อง (ต้องมี 64 อักษร)" #: editor/project_export.cpp msgid "Script Encryption Key (256-bits as hex):" @@ -9914,23 +9553,20 @@ msgid "Export Project" msgstr "ส่งออกโปรเจกต์" #: editor/project_export.cpp -#, fuzzy msgid "Export mode?" -msgstr "วิธีการส่งออก:" +msgstr "ส่งออกโหมด?" #: editor/project_export.cpp -#, fuzzy msgid "Export All" -msgstr "ส่งออก" +msgstr "ส่งออกทั้งหมด" #: editor/project_export.cpp editor/project_manager.cpp -#, fuzzy msgid "ZIP File" -msgstr " ไฟล์" +msgstr "ไฟล์ ZIP" #: editor/project_export.cpp msgid "Godot Game Pack" -msgstr "" +msgstr "Godot เกมแพ็ค" #: editor/project_export.cpp msgid "Export templates for this platform are missing:" @@ -9945,50 +9581,45 @@ msgid "Export With Debug" msgstr "ส่งออกพร้อมการแก้ไขจุดบกพร่อง" #: editor/project_manager.cpp -#, fuzzy msgid "The path specified doesn't exist." -msgstr "ไม่พบไฟล์" +msgstr "ไม่พบที่อยู่ที่ระบุเอาไว้" #: editor/project_manager.cpp -#, fuzzy msgid "Error opening package file (it's not in ZIP format)." -msgstr "ผิดพลาดขณะเปิดไฟล์แพคเกจ, ไม่ใช่รูปแบบ zip" +msgstr "ผิดพลาดขณะเปิดไฟล์แพคเกจ (ไม่ใช่ไฟล์นามสกุล zip)" #: editor/project_manager.cpp -#, fuzzy msgid "" "Invalid \".zip\" project file; it doesn't contain a \"project.godot\" file." -msgstr "กรุณาเลือกโฟลเดอร์ที่ไม่มีไฟล์ 'project.godot'" +msgstr "ไฟล์โปรเจกต์ \".zip\" ผิดพลาด เนื่องจากไม่มีไฟล์ \"project.godot\"" #: editor/project_manager.cpp msgid "Please choose an empty folder." msgstr "กรุณาเลือกโฟลเดอร์ว่างเปล่า" #: editor/project_manager.cpp -#, fuzzy msgid "Please choose a \"project.godot\" or \".zip\" file." -msgstr "กรุณาเลือกไฟล์ 'project.godot'" +msgstr "กรุณาเลือกไฟล์ \"project.godot\" หรือไฟล์ \".zip\"" #: editor/project_manager.cpp msgid "This directory already contains a Godot project." -msgstr "" +msgstr "ไดเรกทอรีนี้มีโปรเจกต์ Godot อยู่แล้ว" #: editor/project_manager.cpp msgid "New Game Project" -msgstr "โปรเจกต์ใหม่" +msgstr "โปรเจกต์เกมใหม่" #: editor/project_manager.cpp msgid "Imported Project" msgstr "นำเข้าโปรเจกต์แล้ว" #: editor/project_manager.cpp -#, fuzzy msgid "Invalid Project Name." -msgstr "ชื่อโปรเจกต์:" +msgstr "ชื่อโปรเจกต์ไม่ถูกต้อง" #: editor/project_manager.cpp msgid "Couldn't create folder." -msgstr "ไม่สามารถสร้างโฟลเดอร์" +msgstr "ไม่สามารถสร้างโฟลเดอร์ได้" #: editor/project_manager.cpp msgid "There is already a folder in this path with the specified name." @@ -10054,17 +9685,16 @@ msgid "Project Path:" msgstr "ที่อยู่โปรเจกต์:" #: editor/project_manager.cpp -#, fuzzy msgid "Project Installation Path:" -msgstr "ที่อยู่โปรเจกต์:" +msgstr "ที่อยู่ที่ใช้ติดตั้งโปรเจกต์:" #: editor/project_manager.cpp msgid "Renderer:" -msgstr "" +msgstr "ตัวเรนเดอร์:" #: editor/project_manager.cpp msgid "OpenGL ES 3.0" -msgstr "" +msgstr "OpenGL ES 3.0" #: editor/project_manager.cpp msgid "" @@ -10073,10 +9703,14 @@ msgid "" "Incompatible with older hardware\n" "Not recommended for web games" msgstr "" +"การแสดงผลที่ดีกว่า\n" +"คุณสมบัติที่มากกว่า\n" +"ไม่รองรับฮาร์ดแวร์รุ่นเก่า\n" +"ไม่เหมาะสำหรับเกมส์บนเว็บ" #: editor/project_manager.cpp msgid "OpenGL ES 2.0" -msgstr "" +msgstr "OpenGL ES 2.0" #: editor/project_manager.cpp msgid "" @@ -10085,28 +9719,30 @@ msgid "" "Works on most hardware\n" "Recommended for web games" msgstr "" +"คุณภาพการแสดงผลน้อยกว่า\n" +"ระบบที่น้อยกว่า\n" +"ทำงานได้บนฮาร์ดแวร์ส่วนใหญ่\n" +"เหมาะสำหรับสร้างเกมส์บนเว็บ" #: editor/project_manager.cpp msgid "Renderer can be changed later, but scenes may need to be adjusted." -msgstr "" +msgstr "ตัวเรนเดอร์สามารถเปลี่ยนทีหลังได้ แต่ฉากจำเป็นต้องปรับแต่ง" #: editor/project_manager.cpp msgid "Unnamed Project" msgstr "โปรเจกต์ไม่มีชื่อ" #: editor/project_manager.cpp -#, fuzzy msgid "Missing Project" -msgstr "นำเข้าโปรเจกต์ที่มีอยู่เดิม" +msgstr "โปรเจกต์หายไป" #: editor/project_manager.cpp msgid "Error: Project is missing on the filesystem." -msgstr "" +msgstr "Error:โปรเจกต์หายไปจากระบบไฟล์" #: editor/project_manager.cpp -#, fuzzy msgid "Can't open project at '%s'." -msgstr "ไม่สามารถเปิดโปรเจกต์" +msgstr "ไม่สามารถเปิดโปรเจกต์ที่ '%s'" #: editor/project_manager.cpp msgid "Are you sure to open more than one project?" @@ -10142,6 +9778,7 @@ msgid "" "The project settings were created by a newer engine version, whose settings " "are not compatible with this version." msgstr "" +"การตั้งค่าโปรเจกต์ถูกสร้างโดยโดยเอนจิ้นรุ่นใหม่กว่า ซึ่งการตั้งค่านี้ไม่สามารถเข้ากันได้กับเอนจิ้นรุ่นนี้" #: editor/project_manager.cpp #, fuzzy @@ -10162,9 +9799,8 @@ msgstr "" "กรุณาเปิดแก้ไขโปรเจกต์เพื่อนำเข้าไฟล์" #: editor/project_manager.cpp -#, fuzzy msgid "Are you sure to run %d projects at once?" -msgstr "ยืนยันการรันโปรเจกต์มากกว่า 1 โปรเจกต์?" +msgstr "ยืนยันการรันโปรเจกต์ %d โปรเจกต์ทีเดียว?" #: editor/project_manager.cpp #, fuzzy @@ -10181,40 +9817,40 @@ msgid "" msgstr "ลบโปรเจกต์ออกจากรายชื่อ? (โฟลเดอร์จะไม่ถูกลบ)" #: editor/project_manager.cpp -#, fuzzy msgid "" "Remove all missing projects from the list?\n" "The project folders' contents won't be modified." -msgstr "ลบโปรเจกต์ออกจากรายชื่อ? (โฟลเดอร์จะไม่ถูกลบ)" +msgstr "" +"ลบโปรเจกต์ที่หายไปออกจากรายชื่อหรือไม่?\n" +"เนื้อหาโฟลเดอร์โปรเจกต์จะไม่ถูกแก้ไข" #: editor/project_manager.cpp -#, fuzzy msgid "" "Language changed.\n" "The interface will update after restarting the editor or project manager." msgstr "" "เปลี่ยนภาษาแล้ว\n" -"การเปลี่ยนแปลงจะมีผลเมื่อเปิดโปรแกรมแก้ไขหรือตัวจัดการโปรเจกต์ใหม่" +"การเปลี่ยนแปลงจะมีผลเมื่อเปิดเอดิเตอร์หรือตัวจัดการโปรเจกต์ใหม่" #: editor/project_manager.cpp -#, fuzzy msgid "" "Are you sure to scan %s folders for existing Godot projects?\n" "This could take a while." -msgstr "จะทำการสแกนหาโปรเจกต์ใน %s โฟลเดอร์ ยืนยัน?" +msgstr "" +"ทำการสแกนหาโปรเจกต์ ในโฟลเดอร์ %s หรือไม่?\n" +"อาจจะใช้เวลาสักครู่" #: editor/project_manager.cpp msgid "Project Manager" msgstr "ตัวจัดการโปรเจกต์" #: editor/project_manager.cpp -#, fuzzy msgid "Projects" msgstr "โปรเจกต์" #: editor/project_manager.cpp msgid "Last Modified" -msgstr "" +msgstr "แก้ไขล่าสุด" #: editor/project_manager.cpp msgid "Scan" @@ -10229,9 +9865,8 @@ msgid "New Project" msgstr "โปรเจกต์ใหม่" #: editor/project_manager.cpp -#, fuzzy msgid "Remove Missing" -msgstr "ลบจุด" +msgstr "ลบที่หายไป" #: editor/project_manager.cpp msgid "Templates" @@ -10295,9 +9930,8 @@ msgid "Add Input Action Event" msgstr "เพิ่มปุ่มกดของการกระทำ" #: editor/project_settings_editor.cpp -#, fuzzy msgid "All Devices" -msgstr "อุปกรณ์" +msgstr "อุปกรณ์ทั้งหมด" #: editor/project_settings_editor.cpp msgid "Device" @@ -10342,14 +9976,12 @@ msgid "Wheel Right Button" msgstr "เมาส์ขวา" #: editor/project_settings_editor.cpp -#, fuzzy msgid "X Button 1" -msgstr "ปุ่ม 6" +msgstr "X ปุ่ม 1" #: editor/project_settings_editor.cpp -#, fuzzy msgid "X Button 2" -msgstr "ปุ่ม 6" +msgstr "X ปุ่ม 2" #: editor/project_settings_editor.cpp msgid "Joypad Axis Index:" @@ -10435,7 +10067,7 @@ msgstr "ผิดพลาดขณะบันทึกค่า" #: editor/project_settings_editor.cpp msgid "Settings saved OK." -msgstr "บันทึกแล้ว" +msgstr "บันทึกการตั้งค่าแล้ว" #: editor/project_settings_editor.cpp #, fuzzy @@ -10496,7 +10128,7 @@ msgstr "กำหนดเฉพาะ..." #: editor/project_settings_editor.cpp editor/settings_config_dialog.cpp msgid "The editor must be restarted for changes to take effect." -msgstr "" +msgstr "ต้องเปิดเอดิเตอร์ใหม่เพื่อให้การเปลี่ยนแปลงมีผล" #: editor/project_settings_editor.cpp msgid "Input Map" @@ -10507,9 +10139,8 @@ msgid "Action:" msgstr "การกระทำ:" #: editor/project_settings_editor.cpp -#, fuzzy msgid "Action" -msgstr "การกระทำ:" +msgstr "การกระทำ" #: editor/project_settings_editor.cpp msgid "Deadzone" @@ -10541,7 +10172,7 @@ msgstr "การแทนที่" #: editor/project_settings_editor.cpp msgid "Resources:" -msgstr "รีซอร์ส:" +msgstr "ทรัพยากร:" #: editor/project_settings_editor.cpp msgid "Remaps by Locale:" @@ -10556,7 +10187,6 @@ msgid "Locales Filter" msgstr "ตัวกรองภูมิภาค" #: editor/project_settings_editor.cpp -#, fuzzy msgid "Show All Locales" msgstr "แสดงทุกภูมิภาค" @@ -10603,7 +10233,7 @@ msgstr "ไฟล์..." #: editor/property_editor.cpp msgid "Dir..." -msgstr "โฟลเดอร์..." +msgstr "ไดเรกทอรี..." #: editor/property_editor.cpp msgid "Assign" @@ -10644,11 +10274,11 @@ msgstr "เปลี่ยนชื่อ" #: editor/rename_dialog.cpp msgid "Prefix" -msgstr "" +msgstr "คำนำหน้า" #: editor/rename_dialog.cpp msgid "Suffix" -msgstr "" +msgstr "คำต่อท้าย" #: editor/rename_dialog.cpp #, fuzzy @@ -10656,37 +10286,32 @@ msgid "Use Regular Expressions" msgstr "แก้ไขสมการ" #: editor/rename_dialog.cpp -#, fuzzy msgid "Advanced Options" -msgstr "ตัวเลือกการจำกัด" +msgstr "ตัวเลือกขั้นสูง" #: editor/rename_dialog.cpp msgid "Substitute" -msgstr "" +msgstr "การแทนที่" #: editor/rename_dialog.cpp -#, fuzzy msgid "Node name" -msgstr "ชื่อโหนด:" +msgstr "ชื่อโหนด" #: editor/rename_dialog.cpp msgid "Node's parent name, if available" -msgstr "" +msgstr "ชื่อโหนดแม่ (ถ้ามี)" #: editor/rename_dialog.cpp -#, fuzzy msgid "Node type" -msgstr "หาประเภทของโหนด" +msgstr "ชนิดโหนด" #: editor/rename_dialog.cpp -#, fuzzy msgid "Current scene name" -msgstr "ฉากปัจจุบัน" +msgstr "ชื่อฉากปัจจุบัน" #: editor/rename_dialog.cpp -#, fuzzy msgid "Root node name" -msgstr "ชื่อโหนดราก:" +msgstr "ชื่อโหนดแม่" #: editor/rename_dialog.cpp msgid "" @@ -10696,7 +10321,7 @@ msgstr "" #: editor/rename_dialog.cpp msgid "Per-level Counter" -msgstr "" +msgstr "ตัวนับต่อเลเวล" #: editor/rename_dialog.cpp msgid "If set the counter restarts for each group of child nodes" @@ -10704,12 +10329,11 @@ msgstr "" #: editor/rename_dialog.cpp msgid "Initial value for the counter" -msgstr "" +msgstr "ค่าเริ่มต้นในการนับ" #: editor/rename_dialog.cpp -#, fuzzy msgid "Step" -msgstr "ขนาด:" +msgstr "ขั้น" #: editor/rename_dialog.cpp msgid "Amount by which counter is incremented for each node" @@ -10747,14 +10371,12 @@ msgid "Case" msgstr "" #: editor/rename_dialog.cpp -#, fuzzy msgid "To Lowercase" -msgstr "ตัวพิมพ์เล็ก" +msgstr "ไปตัวพิมพ์เล็ก" #: editor/rename_dialog.cpp -#, fuzzy msgid "To Uppercase" -msgstr "ตัวพิมพ์ใหญ่" +msgstr "ไปตัวพิมพ์ใหญ่" #: editor/rename_dialog.cpp #, fuzzy @@ -10767,9 +10389,8 @@ msgid "Regular Expression Error" msgstr "แก้ไขสมการ" #: editor/rename_dialog.cpp -#, fuzzy msgid "At character %s" -msgstr "ตัวอักษรที่ใช้ได้:" +msgstr "ตัวอักษรที่ใช้ได้ %s" #: editor/reparent_dialog.cpp editor/scene_tree_dock.cpp msgid "Reparent Node" @@ -10826,9 +10447,8 @@ msgid "Instance Scene(s)" msgstr "อินสแตนซ์ฉาก" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Replace with Branch Scene" -msgstr "บันทึกกิ่งเป็นฉาก" +msgstr "แทนที่ด้วยฉากย่อย" #: editor/scene_tree_dock.cpp msgid "Instance Child Scene" @@ -10867,32 +10487,28 @@ msgid "Instantiated scenes can't become root" msgstr "" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Make node as Root" -msgstr "เข้าใจ!" +msgstr "ทำโหนดให้เป็นโหนดแม่" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Delete %d nodes?" -msgstr "ลบโหนด" +msgstr "ลบโหนด %d ?" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Delete the root node \"%s\"?" -msgstr "ลบโหนด" +msgstr "ลบโหนดแม่ \"%s\"?" #: editor/scene_tree_dock.cpp msgid "Delete node \"%s\" and its children?" -msgstr "" +msgstr "ลบโหนด \"%s\" และโหนดลูก?" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Delete node \"%s\"?" -msgstr "ลบโหนด" +msgstr "ลบโหนด \"%s\"?" #: editor/scene_tree_dock.cpp msgid "Can not perform with the root node." -msgstr "ทำกับโหนดรากไม่ได้" +msgstr "ไม่สามารถกระทำกับโหนดแม่ได้" #: editor/scene_tree_dock.cpp msgid "This operation can't be done on instanced scenes." @@ -10920,34 +10536,28 @@ msgid "Make Local" msgstr "ระยะใกล้" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "New Scene Root" -msgstr "เข้าใจ!" +msgstr "ฉากแม่ใหม่" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Create Root Node:" -msgstr "สร้างโหนด" +msgstr "สร้างโหนดแม่:" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "2D Scene" -msgstr "ฉาก" +msgstr "ฉาก 2D" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "3D Scene" -msgstr "ฉาก" +msgstr "ฉาก 3D" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "User Interface" -msgstr "ลบการสืบทอด" +msgstr "อินเตอร์เฟส" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Other Node" -msgstr "ลบโหนด" +msgstr "โหนดอื่นๆ" #: editor/scene_tree_dock.cpp msgid "Can't operate on nodes from a foreign scene!" @@ -10959,16 +10569,15 @@ msgstr "ทำกับโหนดที่ฉากปัจจุบันส #: editor/scene_tree_dock.cpp msgid "Attach Script" -msgstr "เชื่อมสคริปต์" +msgstr "แนบสคริปต์" #: editor/scene_tree_dock.cpp msgid "Remove Node(s)" msgstr "ลบโหนด" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Change type of node(s)" -msgstr "เปลี่ยนชื่ออินพุต" +msgstr "เปลี่ยนชนิดของโหนด" #: editor/scene_tree_dock.cpp msgid "" @@ -11001,7 +10610,6 @@ msgid "Load As Placeholder" msgstr "โหลดเป็นตัวแทน" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Open Documentation" msgstr "เปิดคู่มือ" @@ -11010,23 +10618,20 @@ msgid "Add Child Node" msgstr "เพิ่มโหนดลูก" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Expand/Collapse All" -msgstr "ยุบโฟลเดอร์" +msgstr "ขยาย/ยุบทั้งหมด" #: editor/scene_tree_dock.cpp msgid "Change Type" -msgstr "เปลี่ยนประเภท" +msgstr "เปลี่ยนชนิด" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Reparent to New Node" msgstr "หาโหนดแม่ใหม่" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Make Scene Root" -msgstr "เข้าใจ!" +msgstr "ตั้งเป็นฉากแม่" #: editor/scene_tree_dock.cpp msgid "Merge From Scene" @@ -11045,7 +10650,6 @@ msgid "Delete (No Confirm)" msgstr "ลบ (ไม่ยืนยัน)" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Add/Create a New Node." msgstr "เพิ่ม/สร้างโหนดใหม่" @@ -11057,7 +10661,7 @@ msgstr "อินสแตนซ์ฉากเป็นโหนด สร้ #: editor/scene_tree_dock.cpp msgid "Attach a new or existing script for the selected node." -msgstr "เชื่อมสคริปต์ใหม่หรือที่มีอยู่เดิมให้กับโหนดที่เลือก" +msgstr "สร้างสคริปต์ให้โหนดที่เลือก" #: editor/scene_tree_dock.cpp msgid "Clear a script for the selected node." @@ -11081,9 +10685,8 @@ msgid "Toggle Visible" msgstr "ซ่อน/แสดง" #: editor/scene_tree_editor.cpp -#, fuzzy msgid "Unlock Node" -msgstr "เลือกโหนด" +msgstr "ปลดล็อคโหนด" #: editor/scene_tree_editor.cpp #, fuzzy @@ -11091,9 +10694,8 @@ msgid "Button Group" msgstr "ปุ่ม 7" #: editor/scene_tree_editor.cpp -#, fuzzy msgid "(Connecting From)" -msgstr "เชื่อมต่อผิดพลาด" +msgstr "(เชื่อมต่อจาก)" #: editor/scene_tree_editor.cpp msgid "Node configuration warning:" @@ -11127,12 +10729,10 @@ msgstr "" "คลิกเพื่อแสดงแผงกลุ่ม" #: editor/scene_tree_editor.cpp -#, fuzzy msgid "Open Script:" -msgstr "เปิดสคริปต์" +msgstr "เปิดสคริปต์:" #: editor/scene_tree_editor.cpp -#, fuzzy msgid "" "Node is locked.\n" "Click to unlock it." @@ -11158,6 +10758,8 @@ msgid "" "AnimationPlayer is pinned.\n" "Click to unpin." msgstr "" +"ปักหมุด AnimationPlayer แล้ว\n" +"คลิกเพื่อเลิกปักหมุด" #: editor/scene_tree_editor.cpp msgid "Invalid node name, the following characters are not allowed:" @@ -11180,14 +10782,12 @@ msgid "Select a Node" msgstr "เลือกโหนด" #: editor/script_create_dialog.cpp -#, fuzzy msgid "Path is empty." -msgstr "ตำแหน่งที่อยู่ว่างเปล่า" +msgstr "ที่อยู่ว่างเปล่า" #: editor/script_create_dialog.cpp -#, fuzzy msgid "Filename is empty." -msgstr "ตำแหน่งบันทึกว่างเปล่า!" +msgstr "ชื่อไฟล์ว่างเปล่า" #: editor/script_create_dialog.cpp #, fuzzy @@ -11200,9 +10800,8 @@ msgid "Invalid base path." msgstr "ตำแหน่งเริ่มต้นไม่ถูกต้อง" #: editor/script_create_dialog.cpp -#, fuzzy msgid "A directory with the same name exists." -msgstr "มีโฟลเดอร์ชื่อนี้อยู่แล้ว" +msgstr "มีไดเรกทอรีชื่อนี้อยู่แล้ว" #: editor/script_create_dialog.cpp #, fuzzy @@ -11227,21 +10826,18 @@ msgid "Error loading script from %s" msgstr "ผิดพลาดขณะโหลดสคริปต์จาก %s" #: editor/script_create_dialog.cpp -#, fuzzy msgid "Overrides" -msgstr "กำหนดเฉพาะ..." +msgstr "แทนที่" #: editor/script_create_dialog.cpp msgid "N/A" msgstr "ไม่มี" #: editor/script_create_dialog.cpp -#, fuzzy msgid "Open Script / Choose Location" -msgstr "เปิดตัวแก้ไขสคริปต์" +msgstr "เปิดสคริปต์ / เลือกที่อยู่" #: editor/script_create_dialog.cpp -#, fuzzy msgid "Open Script" msgstr "เปิดสคริปต์" @@ -11251,19 +10847,16 @@ msgid "File exists, it will be reused." msgstr "มีไฟล์นี้อยู่แล้ว จะนำมาใช้" #: editor/script_create_dialog.cpp -#, fuzzy msgid "Invalid class name." msgstr "ชื่อคลาสไม่ถูกต้อง" #: editor/script_create_dialog.cpp -#, fuzzy msgid "Invalid inherited parent name or path." msgstr "ชื่อหรือตำแหน่งทีสืบทอดไม่ถูกต้อง" #: editor/script_create_dialog.cpp -#, fuzzy msgid "Script path/name is valid." -msgstr "สคริปต์ถูกต้อง" +msgstr "ที่อยู่/ชื่อของสคริปต์ถูกต้อง" #: editor/script_create_dialog.cpp #, fuzzy @@ -11276,29 +10869,30 @@ msgid "Built-in script (into scene file)." msgstr "ฝังสคริปต์ในไฟล์ฉาก" #: editor/script_create_dialog.cpp -#, fuzzy msgid "Will create a new script file." -msgstr "สร้างสคริปต์ใหม่" +msgstr "จะทำการสร้างสคริปต์ใหม่" #: editor/script_create_dialog.cpp -#, fuzzy msgid "Will load an existing script file." -msgstr "โหลดสคริปต์จากดิสก์" +msgstr "จะทำการโหลดไฟล์สคริปต์ที่มีอยู่" #: editor/script_create_dialog.cpp -#, fuzzy msgid "Script file already exists." -msgstr "มีการกระทำ '%s' อยู่แล้ว!" +msgstr "ไฟล์สคริปต์มีอยู่แล้ว" + +#: editor/script_create_dialog.cpp +msgid "" +"Note: Built-in scripts have some limitations and can't be edited using an " +"external editor." +msgstr "" #: editor/script_create_dialog.cpp -#, fuzzy msgid "Class Name:" -msgstr "ชื่อคลาส" +msgstr "ชื่อคลาส:" #: editor/script_create_dialog.cpp -#, fuzzy msgid "Template:" -msgstr "แม่แบบ" +msgstr "แม่แบบ:" #: editor/script_create_dialog.cpp #, fuzzy @@ -11318,38 +10912,32 @@ msgid "Bytes:" msgstr "ไบต์:" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "Warning:" -msgstr "คำเตือน" +msgstr "คำเตือน:" #: editor/script_editor_debugger.cpp msgid "Error:" msgstr "ผิดพลาด:" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "C++ Error" -msgstr "คัดลอกผิดพลาด" +msgstr "C++ ผิดพลาด" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "C++ Error:" -msgstr "ผิดพลาด:" +msgstr "C++ ผิดพลาด:" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "C++ Source" -msgstr "ต้นฉบับ:" +msgstr "C++ ต้นฉบับ" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "Source:" msgstr "ต้นฉบับ:" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "C++ Source:" -msgstr "ต้นฉบับ:" +msgstr "C++ ต้นฉบับ:" #: editor/script_editor_debugger.cpp #, fuzzy @@ -11375,9 +10963,8 @@ msgid "Video RAM" msgstr "หน่วยความจำวีดีโอ" #: editor/script_editor_debugger.cpp -#, fuzzy msgid "Skip Breakpoints" -msgstr "ลบจุด" +msgstr "ข้ามเบรกพอยต์" #: editor/script_editor_debugger.cpp msgid "Inspect Previous Instance" @@ -11393,7 +10980,7 @@ msgstr "สแตค" #: editor/script_editor_debugger.cpp msgid "Profiler" -msgstr "ประสิทธิภาพ" +msgstr "ตัวตรวจวิเคราะห์ประสิทธิภาพ (Profiler)" #: editor/script_editor_debugger.cpp #, fuzzy @@ -11430,7 +11017,7 @@ msgstr "ตำแหน่งรีซอร์ส" #: editor/script_editor_debugger.cpp msgid "Type" -msgstr "ประเภท" +msgstr "ชนิด" #: editor/script_editor_debugger.cpp msgid "Format" @@ -11438,7 +11025,7 @@ msgstr "รูปแบบ" #: editor/script_editor_debugger.cpp msgid "Usage" -msgstr "ใช้" +msgstr "การใช้" #: editor/script_editor_debugger.cpp msgid "Misc" @@ -11462,26 +11049,23 @@ msgstr "กำหนดจากผัง" #: editor/script_editor_debugger.cpp msgid "Export measures as CSV" -msgstr "" +msgstr "ส่งออกค่าเป็น CSV" #: editor/settings_config_dialog.cpp -#, fuzzy msgid "Erase Shortcut" -msgstr "ออกนุ่มนวล" +msgstr "ลบทางลัด" #: editor/settings_config_dialog.cpp -#, fuzzy msgid "Restore Shortcut" -msgstr "ทางลัด" +msgstr "คืนค่าทางลัด" #: editor/settings_config_dialog.cpp -#, fuzzy msgid "Change Shortcut" -msgstr "แก้ไขการตรึง" +msgstr "แก้ไขทางลัด" #: editor/settings_config_dialog.cpp msgid "Editor Settings" -msgstr "ตัวเลือกโปรแกรมสร้างเกม" +msgstr "ตั้งค่าเอดิเตอร์" #: editor/settings_config_dialog.cpp msgid "Shortcuts" @@ -11501,11 +11085,11 @@ msgstr "แก้ไของศาการเปล่งเสียงขอ #: editor/spatial_editor_gizmos.cpp msgid "Change Camera FOV" -msgstr "ปรับขอบเขตการมองเห็นของกล้อง" +msgstr "ปรับกล้อง FOV" #: editor/spatial_editor_gizmos.cpp msgid "Change Camera Size" -msgstr "ปรับขนาดกล้อง" +msgstr "เปลี่ยนขนาดกล้อง" #: editor/spatial_editor_gizmos.cpp #, fuzzy @@ -11537,7 +11121,6 @@ msgid "Change Capsule Shape Height" msgstr "ปรับความสูงทรงแคปซูล" #: editor/spatial_editor_gizmos.cpp -#, fuzzy msgid "Change Cylinder Shape Radius" msgstr "ปรับรัศมีทรงแคปซูล" @@ -11551,14 +11134,12 @@ msgid "Change Ray Shape Length" msgstr "ปรับความยาวรังสี" #: modules/csg/csg_gizmos.cpp -#, fuzzy msgid "Change Cylinder Radius" -msgstr "ปรับรัศมีแสง" +msgstr "ปรับรัศมีทรงกระบอก" #: modules/csg/csg_gizmos.cpp -#, fuzzy msgid "Change Cylinder Height" -msgstr "ปรับความสูงทรงแคปซูล" +msgstr "ปรับความสูงทรงกระบอก" #: modules/csg/csg_gizmos.cpp #, fuzzy @@ -11608,12 +11189,11 @@ msgstr "GDNativeLibrary" #: modules/gdnative/gdnative_library_singleton_editor.cpp msgid "Enabled GDNative Singleton" -msgstr "" +msgstr "เปิดการทำงานซิงเกิลตัน GDNative" #: modules/gdnative/gdnative_library_singleton_editor.cpp -#, fuzzy msgid "Disabled GDNative Singleton" -msgstr "ปิดการอัพเดทตัวหมุน" +msgstr "ปิดการทำงานซิงเกิลตัน GDNative" #: modules/gdnative/gdnative_library_singleton_editor.cpp msgid "Library" @@ -11628,9 +11208,8 @@ msgid "GDNative" msgstr "GDNative" #: modules/gdscript/gdscript_functions.cpp -#, fuzzy msgid "Step argument is zero!" -msgstr "ตัวแปร step เป็นศูนย์!" +msgstr "ช่วงอากิวเมนต์เป็นศูนย์!" #: modules/gdscript/gdscript_functions.cpp msgid "Not a script with an instance" @@ -11658,7 +11237,7 @@ msgstr "รูปแบบดิกชันนารีที่เก็บอ #: modules/gdscript/gdscript_functions.cpp msgid "Invalid instance dictionary (invalid subclasses)" -msgstr "ดิกชันนารีที่เก็บอินสแตนซ์ผิดพลาด (คลาสย่อยผิดพลาด)" +msgstr "ดิกชันนารีอินสแตนซ์ผิดพลาด (คลาสย่อยผิดพลาด)" #: modules/gdscript/gdscript_functions.cpp msgid "Object can't provide a length." @@ -11767,18 +11346,16 @@ msgid "Cursor Clear Rotation" msgstr "เคอร์เซอร์ลบการหมุน" #: modules/gridmap/grid_map_editor_plugin.cpp -#, fuzzy msgid "Paste Selects" -msgstr "ลบที่เลือก" +msgstr "วางที่เลือก" #: modules/gridmap/grid_map_editor_plugin.cpp msgid "Clear Selection" msgstr "ลบที่เลือก" #: modules/gridmap/grid_map_editor_plugin.cpp -#, fuzzy msgid "Fill Selection" -msgstr "เลือกทั้งหมด" +msgstr "เติมส่วนที่เลือก" #: modules/gridmap/grid_map_editor_plugin.cpp msgid "GridMap Settings" @@ -11819,7 +11396,7 @@ msgstr "กำลังจัดการโครงร่าง..." #: modules/recast/navigation_mesh_generator.cpp msgid "Calculating grid size..." -msgstr "กำลังคำนวณขนาดตาราง..." +msgstr "กำลังคำนวณขนาดกริด..." #: modules/recast/navigation_mesh_generator.cpp msgid "Creating heightfield..." @@ -11917,42 +11494,36 @@ msgid "Set Variable Type" msgstr "แก้ไขประเภทตัวแปร" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Add Input Port" -msgstr "เพิ่มอินพุต" +msgstr "เพิ่มพอร์ตอินพุต" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Add Output Port" -msgstr "เพิ่มอินพุต" +msgstr "เพิ่มพอร์ตเอาท์พุต" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Override an existing built-in function." -msgstr "ชื่อผิดพลาด ต้องไม่ใช้ชื่อเดียวกับชนิดตัวแปร" +msgstr "เขียนทับฟังก์ชันบิวท์อินที่มีอยู่" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Create a new function." -msgstr "สร้าง %s ใหม่" +msgstr "สร้างฟังก์ชันใหม่" #: modules/visual_script/visual_script_editor.cpp msgid "Variables:" msgstr "ตัวแปร:" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Create a new variable." -msgstr "สร้าง %s ใหม่" +msgstr "สร้างตัวแปรใหม่" #: modules/visual_script/visual_script_editor.cpp msgid "Signals:" msgstr "สัญญาณ:" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Create a new signal." -msgstr "สร้างรูปหลายเหลี่ยมจากความว่างเปล่า" +msgstr "สร้างสัญญาณใหม่" #: modules/visual_script/visual_script_editor.cpp msgid "Name is not a valid identifier:" @@ -11979,9 +11550,8 @@ msgid "Add Function" msgstr "เพิ่มฟังก์ชัน" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Delete input port" -msgstr "ลบจุด" +msgstr "ลบพอร์ตอินพุต" #: modules/visual_script/visual_script_editor.cpp msgid "Add Variable" @@ -11992,14 +11562,12 @@ msgid "Add Signal" msgstr "เพิ่มสัญญาณ" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Remove Input Port" -msgstr "ลบจุด" +msgstr "ลบพอร์ตอินพุต" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Remove Output Port" -msgstr "ลบจุด" +msgstr "ลบพอร์ตเอาต์พุต" #: modules/visual_script/visual_script_editor.cpp msgid "Change Expression" @@ -12007,11 +11575,11 @@ msgstr "แก้ไขสมการ" #: modules/visual_script/visual_script_editor.cpp msgid "Remove VisualScript Nodes" -msgstr "ลบโหนด" +msgstr "ลบโหนด VisualScript" #: modules/visual_script/visual_script_editor.cpp msgid "Duplicate VisualScript Nodes" -msgstr "ทำซ้ำโหนด" +msgstr "ทำซ้ำโหนด VisualScript" #: modules/visual_script/visual_script_editor.cpp msgid "Hold %s to drop a Getter. Hold Shift to drop a generic signature." @@ -12069,26 +11637,23 @@ msgstr "ย้ายโหนด" #: modules/visual_script/visual_script_editor.cpp msgid "Remove VisualScript Node" -msgstr "ลบโหนด" +msgstr "ลบโหนด VisualScript" #: modules/visual_script/visual_script_editor.cpp msgid "Connect Nodes" msgstr "เชื่อมโหนด" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Disconnect Nodes" msgstr "ตัดการเชื่อมต่อโหนด" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Connect Node Data" -msgstr "เชื่อมโหนด" +msgstr "เชื่อมต่อข้อมูลโหนด" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Connect Node Sequence" -msgstr "เชื่อมโหนด" +msgstr "เชื่อมต่อกับลำดับของโหนด" #: modules/visual_script/visual_script_editor.cpp msgid "Script already has function '%s'" @@ -12099,9 +11664,8 @@ msgid "Change Input Value" msgstr "แก้ไขค่าอินพุต" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Resize Comment" -msgstr "แก้ไข CanvasItem" +msgstr "แก้ขนาดคอมเม้นต์" #: modules/visual_script/visual_script_editor.cpp msgid "Can't copy the function node." @@ -12113,12 +11677,11 @@ msgstr "คลิปบอร์ดว่างเปล่า!" #: modules/visual_script/visual_script_editor.cpp msgid "Paste VisualScript Nodes" -msgstr "วางโหนด" +msgstr "วางโหนด VisualScript" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Can't create function with a function node." -msgstr "คัดลอกโหนดฟังก์ชันไม่ได้" +msgstr "ไม่สามารถสร้างฟังก์ชันได้จากโหนดฟังก์ชัน" #: modules/visual_script/visual_script_editor.cpp msgid "Can't create function of nodes from nodes of multiple functions." @@ -12133,9 +11696,8 @@ msgid "Try to only have one sequence input in selection." msgstr "" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Create Function" -msgstr "เปลี่ยนชื่อฟังก์ชัน" +msgstr "สร้างฟังก์ชัน" #: modules/visual_script/visual_script_editor.cpp msgid "Remove Function" @@ -12158,33 +11720,28 @@ msgid "Editing Signal:" msgstr "แก้ไขสัญญาณ:" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Make Tool:" -msgstr "ระยะใกล้" +msgstr "เครื่องมือสร้าง:" #: modules/visual_script/visual_script_editor.cpp msgid "Members:" -msgstr "ตัวแปร:" +msgstr "สมาชิก:" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Change Base Type:" -msgstr "เปลี่ยนประเภท" +msgstr "เปลี่ยนประเภทฐาน:" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Add Nodes..." -msgstr "เพิ่มโหนด" +msgstr "เพิ่มโหนด..." #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Add Function..." -msgstr "เพิ่มฟังก์ชัน" +msgstr "เพิ่มฟังก์ชัน..." #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "function_name" -msgstr "ฟังก์ชัน:" +msgstr "ชื่อฟังก์ชั่น" #: modules/visual_script/visual_script_editor.cpp #, fuzzy @@ -12208,19 +11765,16 @@ msgid "Cut Nodes" msgstr "ตัดโหนด" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Make Function" -msgstr "เปลี่ยนชื่อฟังก์ชัน" +msgstr "สร้างฟังก์ชัน" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Refresh Graph" -msgstr "รีเฟรช" +msgstr "รีเฟรชกราฟ" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Edit Member" -msgstr "ตัวแปร" +msgstr "แก้ไขสมาชิก" #: modules/visual_script/visual_script_flow_control.cpp msgid "Input type not iterable: " @@ -12277,41 +11831,40 @@ msgid "" msgstr "ค่าคืนจาก _step() ผิดพลาด ต้องเป็นจำนวนเต็ม (ลำดับ) หรือสตริง (ข้อผิดพลาด)" #: modules/visual_script/visual_script_property_selector.cpp -#, fuzzy msgid "Search VisualScript" -msgstr "ลบโหนด" +msgstr "ค้นหาโหนด VisualScript" #: modules/visual_script/visual_script_property_selector.cpp msgid "Get %s" -msgstr "" +msgstr "รับ %s" #: modules/visual_script/visual_script_property_selector.cpp msgid "Set %s" -msgstr "" +msgstr "ตั้ง %s" #: platform/android/export/export.cpp msgid "Package name is missing." -msgstr "" +msgstr "ชื่อแพ็คเกจหายไป" #: platform/android/export/export.cpp msgid "Package segments must be of non-zero length." -msgstr "" +msgstr "ส่วนของแพ็คเกจจะต้องมีความยาวไม่เป็นศูนย์" #: platform/android/export/export.cpp msgid "The character '%s' is not allowed in Android application package names." -msgstr "" +msgstr "ตัวอักษร '%s' ไม่อนุญาตให้ใช้ในชื่อของ Android application package" #: platform/android/export/export.cpp msgid "A digit cannot be the first character in a package segment." -msgstr "" +msgstr "ไม่สามารถใช้ตัวเลขเป็นตัวแรกในส่วนของแพ็คเกจ" #: platform/android/export/export.cpp msgid "The character '%s' cannot be the first character in a package segment." -msgstr "" +msgstr "ตัวอักษร '%s' ไม่สามารถเป็นตัวอักษรตัวแรกในส่วนของแพ็คเกจ" #: platform/android/export/export.cpp msgid "The package must have at least one '.' separator." -msgstr "" +msgstr "แพ็คเกจจำเป็นต้องมี '.' อย่างน้อยหนึ่งตัว" #: platform/android/export/export.cpp msgid "Select device from the list" @@ -12319,11 +11872,11 @@ msgstr "เลือกอุปกรณ์จากรายชื่อ" #: platform/android/export/export.cpp msgid "ADB executable not configured in the Editor Settings." -msgstr "" +msgstr "ADB executable ยังไม่ได้กำหนดค่าในตั้งค่าเอดิเตอร์" #: platform/android/export/export.cpp msgid "OpenJDK jarsigner not configured in the Editor Settings." -msgstr "" +msgstr "OpenJDK jarsigner ยังไม่ได้กำหนดค่าในตั้งค่าเอดิเตอร์" #: platform/android/export/export.cpp msgid "Debug keystore not configured in the Editor Settings nor in the preset." @@ -12348,9 +11901,8 @@ msgid "Invalid public key for APK expansion." msgstr "" #: platform/android/export/export.cpp -#, fuzzy msgid "Invalid package name:" -msgstr "ชื่อคลาสไม่ถูกต้อง" +msgstr "ชื่อแพ็คเกจผิดพลาด:" #: platform/android/export/export.cpp msgid "" @@ -12368,7 +11920,7 @@ msgstr "" #: platform/android/export/export.cpp msgid "Building Android Project (gradle)" -msgstr "" +msgstr "กำลังสร้างโปรเจคแอนดรอยด์ (gradle)" #: platform/android/export/export.cpp msgid "" @@ -12391,7 +11943,7 @@ msgstr "ไม่สามารถใช้ชื่อนี้ได้:" #: platform/iphone/export/export.cpp msgid "App Store Team ID not specified - cannot configure the project." -msgstr "" +msgstr "App Store Team ID ยังไม่ได้ระบุ - ไม่สามารถกำหนดค่าให้โปรเจกต์ได้" #: platform/iphone/export/export.cpp #, fuzzy @@ -12404,7 +11956,7 @@ msgstr "" #: platform/javascript/export/export.cpp msgid "Stop HTTP Server" -msgstr "" +msgstr "หยุดเซิฟเวอร์ HTTP" #: platform/javascript/export/export.cpp msgid "Run in Browser" @@ -12449,9 +12001,8 @@ msgid "Invalid package unique name." msgstr "ชื่อเฉพาะไม่ถูกต้อง" #: platform/uwp/export/export.cpp -#, fuzzy msgid "Invalid package publisher display name." -msgstr "ชื่อเฉพาะไม่ถูกต้อง" +msgstr "ชื่อแสดงผู้จัดจำหน่ายแพคเกจไม่ถูกต้อง" #: platform/uwp/export/export.cpp msgid "Invalid product GUID." @@ -12505,7 +12056,7 @@ msgid "" "Only one visible CanvasModulate is allowed per scene (or set of instanced " "scenes). The first created one will work, while the rest will be ignored." msgstr "" -"จะมี CanvasModulate ที่มองเห็นได้เพียงโหนดเดียวในฉาก (หรือกลุ่มของฉากที่เป็นอินสแตนซ์) " +"จะมี CanvasModulate ที่มองเห็นได้ เพียงโหนดเดียวในฉาก (หรือกลุ่มของฉากที่เป็นอินสแตนซ์) " "โหนดแรกเท่านั้นที่จะทำงานได้ปกติ ที่เหลือจะไม่ทำงาน" #: scene/2d/collision_object_2d.cpp @@ -12584,7 +12135,7 @@ msgid "" "node. It only provides navigation data." msgstr "" "NavigationPolygonInstance ต้องเป็นโหนดลูก/หลานของโหนด Navigation2D " -"เนื่องจากโหนดนี้ใช้เก็บข้อมูลการนำทางเท่านั้น" +"โดยจะให้ข้อมูลการนำทางเท่านั้น" #: scene/2d/parallax_layer.cpp msgid "" @@ -12633,7 +12184,7 @@ msgstr "" #: scene/2d/skeleton_2d.cpp msgid "A Bone2D only works with a Skeleton2D or another Bone2D as parent node." -msgstr "" +msgstr "Bone2D สามารถทำงานได้กับ Skeleton2D หรือ Bone2D ตัวอื่นโดยเป็นโหนดแม่" #: scene/2d/skeleton_2d.cpp msgid "" @@ -12676,9 +12227,8 @@ msgid "" msgstr "Controller id ต้องไม่เป็น 0 ไม่เช่นนั้นตัวควบคุมนี้จะไม่เชื่อมกับอุปกรณ์จริง" #: scene/3d/arvr_nodes.cpp -#, fuzzy msgid "ARVRAnchor must have an ARVROrigin node as its parent." -msgstr "ARVRAnchor ต้องมี ARVROrigin เป็นโหนดแม่" +msgstr "ARVRAnchor ต้องมีโหนด ARVROrigin เป็นโหนดแม่" #: scene/3d/arvr_nodes.cpp #, fuzzy @@ -12688,9 +12238,8 @@ msgid "" msgstr "Anchor id ต้องไม่เป็น 0 ไม่เช่นนั้น anchor นี้จะไม่เชื่อมกับ anchor จริง" #: scene/3d/arvr_nodes.cpp -#, fuzzy msgid "ARVROrigin requires an ARVRCamera child node." -msgstr "ARVROrigin ต้องมี ARVRCamera เป็นโหนดลูก" +msgstr "ARVROrigin จำเป็นต้องมี ARVRCamera เป็นโหนดลูก" #: scene/3d/baked_lightmap.cpp msgid "%d%%" @@ -12786,6 +12335,8 @@ msgid "" "GIProbes are not supported by the GLES2 video driver.\n" "Use a BakedLightmap instead." msgstr "" +"ไดรเวอร์วีดีโอ GLES2 ไม่สนับสนุน GIProbe\n" +"ใช้ BakedLightmap แทน" #: scene/3d/light.cpp msgid "A SpotLight with an angle wider than 90 degrees cannot cast shadows." @@ -12801,7 +12352,7 @@ msgid "" "It only provides navigation data." msgstr "" "NavigationMeshInstance ต้องเป็นโหนดลูก/หลานของโหนด Navigation " -"โหนดนี้ใช้เพื่อเป็นข้อมูลในการนำทางเท่านั้น" +"โดยจะให้ข้อมูลการนำทางเท่านั้น" #: scene/3d/particles.cpp msgid "" @@ -12884,7 +12435,7 @@ msgstr "" #: scene/3d/world_environment.cpp msgid "" "Only one WorldEnvironment is allowed per scene (or set of instanced scenes)." -msgstr "จะมี WorldEnvironment ได้เพียงโหนดเดียวในฉาก (หรือกลุ่มของฉากที่เป็นอินสแตนซ์)" +msgstr "จะมี WorldEnvironment ได้เพียงอันเดียวในฉาก (หรือกลุ่มของฉากที่เป็นอินสแตนซ์)" #: scene/3d/world_environment.cpp msgid "" @@ -12897,23 +12448,20 @@ msgid "On BlendTree node '%s', animation not found: '%s'" msgstr "" #: scene/animation/animation_blend_tree.cpp -#, fuzzy msgid "Animation not found: '%s'" -msgstr "เครื่องมือแอนิเมชัน" +msgstr "ไม่พบแอนิเมชัน: '%s'" #: scene/animation/animation_tree.cpp msgid "In node '%s', invalid animation: '%s'." msgstr "" #: scene/animation/animation_tree.cpp -#, fuzzy msgid "Invalid animation: '%s'." -msgstr "ผิดพลาด: ชื่อแอนิเมชันไม่ถูกต้อง!" +msgstr "แอนิเมชันผิดพลาด: '%s'." #: scene/animation/animation_tree.cpp -#, fuzzy msgid "Nothing connected to input '%s' of node '%s'." -msgstr "ลบการเชื่อมโยง '%s' กับ '%s'" +msgstr "ไม่มีการเชื่อมต่อไปที่อินพุต '%s' ของโหนด '%s'." #: scene/animation/animation_tree.cpp msgid "No root AnimationNode for the graph is set." @@ -12943,6 +12491,9 @@ msgid "" "LMB: Set color\n" "RMB: Remove preset" msgstr "" +"สี: #%s\n" +"คลิกซ้าย: เลือกสี\n" +"คลิกขวา: ลบสี" #: scene/gui/color_picker.cpp msgid "Pick a color from the editor window." @@ -12950,11 +12501,11 @@ msgstr "" #: scene/gui/color_picker.cpp msgid "HSV" -msgstr "" +msgstr "HSV" #: scene/gui/color_picker.cpp msgid "Raw" -msgstr "" +msgstr "Raw" #: scene/gui/color_picker.cpp msgid "Switch between hexadecimal and code values." @@ -13034,6 +12585,10 @@ msgstr "" "ให้แก้ไขโหนดนี้ให้เป็นโหนดลูกของ Control แต่ถ้าไม่ ให้ปรับเป็น render target และนำไปใช้เป็น " "texture ของโหนดอื่น" +#: scene/main/viewport.cpp +msgid "Viewport size must be greater than 0 to render anything." +msgstr "" + #: scene/resources/visual_shader_nodes.cpp #, fuzzy msgid "Invalid source for preview." @@ -13063,7 +12618,16 @@ msgstr "" #: servers/visual/shader_language.cpp msgid "Constants cannot be modified." -msgstr "" +msgstr "ค่าคงที่ไม่สามารถแก้ไขได้" + +#~ msgid "Issue Tracker" +#~ msgstr "ติดตามปัญหา" + +#~ msgid "Request Docs" +#~ msgstr "ร้องขอคู่มือ" + +#~ msgid "Help improve the Godot documentation by giving feedback." +#~ msgstr "ช่วยพัฒนาคู่มือโดยการให้ข้อเสนอแนะ" #~ msgid "Replaced %d occurrence(s)." #~ msgstr "แทนที่แล้ว %d ครั้ง" diff --git a/editor/translations/tr.po b/editor/translations/tr.po index 83eb878d8c..e5e8f0ba97 100644 --- a/editor/translations/tr.po +++ b/editor/translations/tr.po @@ -1481,7 +1481,7 @@ msgstr "KendindenYüklenme'yi Taşı" msgid "Remove Autoload" msgstr "KendindenYüklenme'yi Kaldır" -#: editor/editor_autoload_settings.cpp +#: editor/editor_autoload_settings.cpp editor/editor_plugin_settings.cpp msgid "Enable" msgstr "Etkin" @@ -2961,8 +2961,13 @@ msgid "Q&A" msgstr "S&C" #: editor/editor_node.cpp -msgid "Issue Tracker" -msgstr "Sorun İzleyici" +#, fuzzy +msgid "Report a Bug" +msgstr "Yeniden İçe Aktar" + +#: editor/editor_node.cpp +msgid "Send Docs Feedback" +msgstr "" #: editor/editor_node.cpp editor/plugins/asset_library_editor_plugin.cpp msgid "Community" @@ -4013,7 +4018,8 @@ msgid "Reimport" msgstr "Yeniden İçe Aktar" #: editor/import_dock.cpp -msgid "Save scenes, re-import and restart" +#, fuzzy +msgid "Save Scenes, Re-Import, and Restart" msgstr "Sahneleri kaydet, tekrar içe aktar ve baştan başlat" #: editor/import_dock.cpp @@ -6857,14 +6863,6 @@ msgid "Open Godot online documentation." msgstr "Çevrimiçi Godot dökümanlarını aç." #: editor/plugins/script_editor_plugin.cpp -msgid "Request Docs" -msgstr "Belgeleri İste" - -#: editor/plugins/script_editor_plugin.cpp -msgid "Help improve the Godot documentation by giving feedback." -msgstr "Dönüt vererek Godot belgelerini iyileştirmeye yardımcı olun." - -#: editor/plugins/script_editor_plugin.cpp msgid "Search the reference documentation." msgstr "Başvuru belgelerinde arama yap." @@ -7300,6 +7298,11 @@ msgid "This operation requires a single selected node." msgstr "Bu işlem, seçilmiş tek bir düğüm gerektirir." #: editor/plugins/spatial_editor_plugin.cpp +#, fuzzy +msgid "Auto Orthogonal Enabled" +msgstr "Dikey" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Lock View Rotation" msgstr "Dönüşü Görüntülemeyi kilitle" @@ -7388,6 +7391,10 @@ msgid "Freelook Slow Modifier" msgstr "Serbestbakış Hız Değiştirici" #: editor/plugins/spatial_editor_plugin.cpp +msgid "View Rotation Locked" +msgstr "Dönme Kilitli Görünüm" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." @@ -7396,10 +7403,6 @@ msgstr "" "Oyun içi performansın gösteri olarak ele alınamaz." #: editor/plugins/spatial_editor_plugin.cpp -msgid "View Rotation Locked" -msgstr "Dönme Kilitli Görünüm" - -#: editor/plugins/spatial_editor_plugin.cpp msgid "XForm Dialog" msgstr "XForm İletişim Kutusu" @@ -10911,6 +10914,12 @@ msgid "Script file already exists." msgstr "Betik dosyası zaten mevcut." #: editor/script_create_dialog.cpp +msgid "" +"Note: Built-in scripts have some limitations and can't be edited using an " +"external editor." +msgstr "" + +#: editor/script_create_dialog.cpp msgid "Class Name:" msgstr "Sınıf İsmi:" @@ -12682,6 +12691,10 @@ msgstr "" "yapın böylece bir boyut elde edebilir. Aksi takdirde, Görüntüleme için bunu " "bir RenderTarget yap ve dahili dokusunu herhangi bir düğüme ata." +#: scene/main/viewport.cpp +msgid "Viewport size must be greater than 0 to render anything." +msgstr "" + #: scene/resources/visual_shader_nodes.cpp msgid "Invalid source for preview." msgstr "Önizleme için geçersiz kaynak." @@ -12710,6 +12723,15 @@ msgstr "varyings yalnızca vertex işlevinde atanabilir." msgid "Constants cannot be modified." msgstr "Sabit değerler değiştirilemez." +#~ msgid "Issue Tracker" +#~ msgstr "Sorun İzleyici" + +#~ msgid "Request Docs" +#~ msgstr "Belgeleri İste" + +#~ msgid "Help improve the Godot documentation by giving feedback." +#~ msgstr "Dönüt vererek Godot belgelerini iyileştirmeye yardımcı olun." + #~ msgid "Replaced %d occurrence(s)." #~ msgstr "%d değişiklik gerçekleştirildi." diff --git a/editor/translations/uk.po b/editor/translations/uk.po index bfb614f493..60e61d3bf7 100644 --- a/editor/translations/uk.po +++ b/editor/translations/uk.po @@ -17,7 +17,7 @@ msgid "" msgstr "" "Project-Id-Version: Ukrainian (Godot Engine)\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2020-02-21 23:32+0000\n" +"PO-Revision-Date: 2020-03-18 00:10+0000\n" "Last-Translator: Yuri Chornoivan <yurchor@ukr.net>\n" "Language-Team: Ukrainian <https://hosted.weblate.org/projects/godot-engine/" "godot/uk/>\n" @@ -27,7 +27,7 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" "%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" -"X-Generator: Weblate 3.11.1\n" +"X-Generator: Weblate 4.0-dev\n" #: core/math/expression.cpp modules/gdscript/gdscript_functions.cpp #: modules/visual_script/visual_script_builtin_funcs.cpp @@ -1458,7 +1458,7 @@ msgstr "Перемістити автозавантаження" msgid "Remove Autoload" msgstr "Видалити автозавантаження" -#: editor/editor_autoload_settings.cpp +#: editor/editor_autoload_settings.cpp editor/editor_plugin_settings.cpp msgid "Enable" msgstr "Активувати" @@ -2945,8 +2945,13 @@ msgid "Q&A" msgstr "Запитання та відповіді" #: editor/editor_node.cpp -msgid "Issue Tracker" -msgstr "Відстеження помилок" +#, fuzzy +msgid "Report a Bug" +msgstr "Переімпортувати" + +#: editor/editor_node.cpp +msgid "Send Docs Feedback" +msgstr "" #: editor/editor_node.cpp editor/plugins/asset_library_editor_plugin.cpp msgid "Community" @@ -4001,7 +4006,8 @@ msgid "Reimport" msgstr "Переімпортувати" #: editor/import_dock.cpp -msgid "Save scenes, re-import and restart" +#, fuzzy +msgid "Save Scenes, Re-Import, and Restart" msgstr "Зберегти сцени, повторно імпортувати і перезапустити" #: editor/import_dock.cpp @@ -5974,9 +5980,8 @@ msgstr "" "Цей найточніший (але найповільніший) варіант для виявлення зіткнень." #: editor/plugins/mesh_instance_editor_plugin.cpp -#, fuzzy msgid "Create Single Convex Collision Sibling" -msgstr "Створити єдині опуклі області зіткнення" +msgstr "Створити єдину опуклу область зіткнення" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "" @@ -6865,14 +6870,6 @@ msgid "Open Godot online documentation." msgstr "Відкрити онлайнову документацію Godot." #: editor/plugins/script_editor_plugin.cpp -msgid "Request Docs" -msgstr "Запит щодо документації" - -#: editor/plugins/script_editor_plugin.cpp -msgid "Help improve the Godot documentation by giving feedback." -msgstr "Допоможіть у поліпшенні документації Godot наданням відгуків." - -#: editor/plugins/script_editor_plugin.cpp msgid "Search the reference documentation." msgstr "Пошук довідкової документації." @@ -7310,6 +7307,11 @@ msgid "This operation requires a single selected node." msgstr "Ця операція вимагає одного обраного вузла." #: editor/plugins/spatial_editor_plugin.cpp +#, fuzzy +msgid "Auto Orthogonal Enabled" +msgstr "Ортогонально" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Lock View Rotation" msgstr "Зафіксувати обертання перегляду" @@ -7398,6 +7400,10 @@ msgid "Freelook Slow Modifier" msgstr "Модифікатор швидкості довільного огляду" #: editor/plugins/spatial_editor_plugin.cpp +msgid "View Rotation Locked" +msgstr "Обертання перегляду заблоковано" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." @@ -7407,10 +7413,6 @@ msgstr "" "грі." #: editor/plugins/spatial_editor_plugin.cpp -msgid "View Rotation Locked" -msgstr "Обертання перегляду заблоковано" - -#: editor/plugins/spatial_editor_plugin.cpp msgid "XForm Dialog" msgstr "Вікно XForm" @@ -10921,6 +10923,12 @@ msgid "Script file already exists." msgstr "Файл скрипту вже існує." #: editor/script_create_dialog.cpp +msgid "" +"Note: Built-in scripts have some limitations and can't be edited using an " +"external editor." +msgstr "" + +#: editor/script_create_dialog.cpp msgid "Class Name:" msgstr "Назва класу:" @@ -12415,6 +12423,8 @@ msgstr "" msgid "" "ConcavePolygonShape doesn't support RigidBody in another mode than static." msgstr "" +"У ConcavePolygonShape не передбачено підтримки RigidBody у режимі, " +"відмінному від статичного." #: scene/3d/cpu_particles.cpp msgid "Nothing is visible because no mesh has been assigned." @@ -12715,6 +12725,10 @@ msgstr "" "Control, щоб у неї був розмір. Крім того, можна зробити її RenderTarget і " "пов'язати її внутрішню текстуру з одним із вузлів для показу." +#: scene/main/viewport.cpp +msgid "Viewport size must be greater than 0 to render anything." +msgstr "" + #: scene/resources/visual_shader_nodes.cpp msgid "Invalid source for preview." msgstr "Некоректне джерело для попереднього перегляду." @@ -12743,6 +12757,15 @@ msgstr "Змінні величини можна пов'язувати лише msgid "Constants cannot be modified." msgstr "Сталі не можна змінювати." +#~ msgid "Issue Tracker" +#~ msgstr "Відстеження помилок" + +#~ msgid "Request Docs" +#~ msgstr "Запит щодо документації" + +#~ msgid "Help improve the Godot documentation by giving feedback." +#~ msgstr "Допоможіть у поліпшенні документації Godot наданням відгуків." + #~ msgid "Replaced %d occurrence(s)." #~ msgstr "Замінено %d випадок(-ів)." diff --git a/editor/translations/ur_PK.po b/editor/translations/ur_PK.po index 815f92af6a..1e2f87b352 100644 --- a/editor/translations/ur_PK.po +++ b/editor/translations/ur_PK.po @@ -1429,7 +1429,7 @@ msgstr "" msgid "Remove Autoload" msgstr "" -#: editor/editor_autoload_settings.cpp +#: editor/editor_autoload_settings.cpp editor/editor_plugin_settings.cpp msgid "Enable" msgstr "" @@ -2862,7 +2862,11 @@ msgid "Q&A" msgstr "" #: editor/editor_node.cpp -msgid "Issue Tracker" +msgid "Report a Bug" +msgstr "" + +#: editor/editor_node.cpp +msgid "Send Docs Feedback" msgstr "" #: editor/editor_node.cpp editor/plugins/asset_library_editor_plugin.cpp @@ -3907,7 +3911,7 @@ msgid "Reimport" msgstr "" #: editor/import_dock.cpp -msgid "Save scenes, re-import and restart" +msgid "Save Scenes, Re-Import, and Restart" msgstr "" #: editor/import_dock.cpp @@ -6762,14 +6766,6 @@ msgid "Open Godot online documentation." msgstr "" #: editor/plugins/script_editor_plugin.cpp -msgid "Request Docs" -msgstr "" - -#: editor/plugins/script_editor_plugin.cpp -msgid "Help improve the Godot documentation by giving feedback." -msgstr "" - -#: editor/plugins/script_editor_plugin.cpp msgid "Search the reference documentation." msgstr "" @@ -7209,6 +7205,10 @@ msgid "This operation requires a single selected node." msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Auto Orthogonal Enabled" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Lock View Rotation" msgstr "" @@ -7298,13 +7298,13 @@ msgid "Freelook Slow Modifier" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "" -"Note: The FPS value displayed is the editor's framerate.\n" -"It cannot be used as a reliable indication of in-game performance." +msgid "View Rotation Locked" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "View Rotation Locked" +msgid "" +"Note: The FPS value displayed is the editor's framerate.\n" +"It cannot be used as a reliable indication of in-game performance." msgstr "" #: editor/plugins/spatial_editor_plugin.cpp @@ -10719,6 +10719,12 @@ msgid "Script file already exists." msgstr "" #: editor/script_create_dialog.cpp +msgid "" +"Note: Built-in scripts have some limitations and can't be edited using an " +"external editor." +msgstr "" + +#: editor/script_create_dialog.cpp msgid "Class Name:" msgstr "" @@ -12370,6 +12376,10 @@ msgid "" "texture to some node for display." msgstr "" +#: scene/main/viewport.cpp +msgid "Viewport size must be greater than 0 to render anything." +msgstr "" + #: scene/resources/visual_shader_nodes.cpp msgid "Invalid source for preview." msgstr "" diff --git a/editor/translations/vi.po b/editor/translations/vi.po index 31b7f3ceb7..88ca61847e 100644 --- a/editor/translations/vi.po +++ b/editor/translations/vi.po @@ -1455,7 +1455,7 @@ msgstr "" msgid "Remove Autoload" msgstr "" -#: editor/editor_autoload_settings.cpp +#: editor/editor_autoload_settings.cpp editor/editor_plugin_settings.cpp msgid "Enable" msgstr "Mở" @@ -2927,8 +2927,13 @@ msgid "Q&A" msgstr "Hỏi và Đáp" #: editor/editor_node.cpp -msgid "Issue Tracker" -msgstr "Theo dõi vấn đề" +#, fuzzy +msgid "Report a Bug" +msgstr "Nhập vào lại" + +#: editor/editor_node.cpp +msgid "Send Docs Feedback" +msgstr "" #: editor/editor_node.cpp editor/plugins/asset_library_editor_plugin.cpp msgid "Community" @@ -3974,7 +3979,8 @@ msgid "Reimport" msgstr "Nhập vào lại" #: editor/import_dock.cpp -msgid "Save scenes, re-import and restart" +#, fuzzy +msgid "Save Scenes, Re-Import, and Restart" msgstr "Lưu các cảnh, nhập vào lại và khởi động lại" #: editor/import_dock.cpp @@ -6849,14 +6855,6 @@ msgid "Open Godot online documentation." msgstr "" #: editor/plugins/script_editor_plugin.cpp -msgid "Request Docs" -msgstr "" - -#: editor/plugins/script_editor_plugin.cpp -msgid "Help improve the Godot documentation by giving feedback." -msgstr "" - -#: editor/plugins/script_editor_plugin.cpp msgid "Search the reference documentation." msgstr "" @@ -7303,6 +7301,10 @@ msgid "This operation requires a single selected node." msgstr "Hoạt động yêu cầu chọn một nút duy nhất." #: editor/plugins/spatial_editor_plugin.cpp +msgid "Auto Orthogonal Enabled" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Lock View Rotation" msgstr "" @@ -7392,13 +7394,13 @@ msgid "Freelook Slow Modifier" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "" -"Note: The FPS value displayed is the editor's framerate.\n" -"It cannot be used as a reliable indication of in-game performance." +msgid "View Rotation Locked" msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -msgid "View Rotation Locked" +msgid "" +"Note: The FPS value displayed is the editor's framerate.\n" +"It cannot be used as a reliable indication of in-game performance." msgstr "" #: editor/plugins/spatial_editor_plugin.cpp @@ -10857,6 +10859,12 @@ msgid "Script file already exists." msgstr "Tam giác đã tồn tại." #: editor/script_create_dialog.cpp +msgid "" +"Note: Built-in scripts have some limitations and can't be edited using an " +"external editor." +msgstr "" + +#: editor/script_create_dialog.cpp #, fuzzy msgid "Class Name:" msgstr "Lớp:" @@ -12521,6 +12529,10 @@ msgid "" "texture to some node for display." msgstr "" +#: scene/main/viewport.cpp +msgid "Viewport size must be greater than 0 to render anything." +msgstr "" + #: scene/resources/visual_shader_nodes.cpp msgid "Invalid source for preview." msgstr "nguồn vô hiệu cho xem trước" @@ -12550,6 +12562,9 @@ msgstr "" msgid "Constants cannot be modified." msgstr "Không thể chỉnh sửa hằng số." +#~ msgid "Issue Tracker" +#~ msgstr "Theo dõi vấn đề" + #~ msgid "Replaced %d occurrence(s)." #~ msgstr "Đã thay thế %d biến cố." diff --git a/editor/translations/zh_CN.po b/editor/translations/zh_CN.po index e7108c6e61..df8b8e1725 100644 --- a/editor/translations/zh_CN.po +++ b/editor/translations/zh_CN.po @@ -64,8 +64,8 @@ msgid "" msgstr "" "Project-Id-Version: Chinese (Simplified) (Godot Engine)\n" "POT-Creation-Date: 2018-01-20 12:15+0200\n" -"PO-Revision-Date: 2020-03-08 22:33+0000\n" -"Last-Translator: Revan Ji <jiruifancr@gmail.com>\n" +"PO-Revision-Date: 2020-04-05 12:05+0000\n" +"Last-Translator: Haoyu Qiu <timothyqiu32@gmail.com>\n" "Language-Team: Chinese (Simplified) <https://hosted.weblate.org/projects/" "godot-engine/godot/zh_Hans/>\n" "Language: zh_CN\n" @@ -1481,7 +1481,7 @@ msgstr "移动Autoload" msgid "Remove Autoload" msgstr "移除Autoload" -#: editor/editor_autoload_settings.cpp +#: editor/editor_autoload_settings.cpp editor/editor_plugin_settings.cpp msgid "Enable" msgstr "启用" @@ -2919,8 +2919,13 @@ msgid "Q&A" msgstr "问答" #: editor/editor_node.cpp -msgid "Issue Tracker" -msgstr "问题跟踪器" +#, fuzzy +msgid "Report a Bug" +msgstr "重新导入" + +#: editor/editor_node.cpp +msgid "Send Docs Feedback" +msgstr "" #: editor/editor_node.cpp editor/plugins/asset_library_editor_plugin.cpp msgid "Community" @@ -3957,7 +3962,8 @@ msgid "Reimport" msgstr "重新导入" #: editor/import_dock.cpp -msgid "Save scenes, re-import and restart" +#, fuzzy +msgid "Save Scenes, Re-Import, and Restart" msgstr "保存场景,重新导入,从头开始" #: editor/import_dock.cpp @@ -6774,14 +6780,6 @@ msgid "Open Godot online documentation." msgstr "打开Godot在线文档。" #: editor/plugins/script_editor_plugin.cpp -msgid "Request Docs" -msgstr "请求文档" - -#: editor/plugins/script_editor_plugin.cpp -msgid "Help improve the Godot documentation by giving feedback." -msgstr "通过提供反馈帮助改进godot文档。" - -#: editor/plugins/script_editor_plugin.cpp msgid "Search the reference documentation." msgstr "搜索文档。" @@ -7215,6 +7213,11 @@ msgid "This operation requires a single selected node." msgstr "此操作只能应用于单个选中节点。" #: editor/plugins/spatial_editor_plugin.cpp +#, fuzzy +msgid "Auto Orthogonal Enabled" +msgstr "正交" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Lock View Rotation" msgstr "锁定视角旋转" @@ -7303,6 +7306,10 @@ msgid "Freelook Slow Modifier" msgstr "缓慢自由视图速度" #: editor/plugins/spatial_editor_plugin.cpp +msgid "View Rotation Locked" +msgstr "锁定视角旋转" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." @@ -7311,10 +7318,6 @@ msgstr "" "它不能用于表现游戏中的实际性能。" #: editor/plugins/spatial_editor_plugin.cpp -msgid "View Rotation Locked" -msgstr "锁定视角旋转" - -#: editor/plugins/spatial_editor_plugin.cpp msgid "XForm Dialog" msgstr "XForm对话框" @@ -7906,7 +7909,7 @@ msgstr "字体" #: editor/plugins/theme_editor_plugin.cpp msgid "Color" -msgstr "Color(颜色)" +msgstr "颜色" #: editor/plugins/theme_editor_plugin.cpp msgid "Theme File" @@ -10740,6 +10743,12 @@ msgid "Script file already exists." msgstr "脚本文件已存在。" #: editor/script_create_dialog.cpp +msgid "" +"Note: Built-in scripts have some limitations and can't be edited using an " +"external editor." +msgstr "" + +#: editor/script_create_dialog.cpp msgid "Class Name:" msgstr "类名:" @@ -12428,6 +12437,10 @@ msgstr "" "幕上显示其内容,使其成为子控件的所以它可以有一个尺寸大小值。否则请将其设置为 " "RenderTarget,并将其内部纹理分配给其它节点显示。" +#: scene/main/viewport.cpp +msgid "Viewport size must be greater than 0 to render anything." +msgstr "" + #: scene/resources/visual_shader_nodes.cpp msgid "Invalid source for preview." msgstr "预览的源资源无效。" @@ -12456,6 +12469,15 @@ msgstr "变量只能在顶点函数中指定。" msgid "Constants cannot be modified." msgstr "不允许修改常量。" +#~ msgid "Issue Tracker" +#~ msgstr "问题跟踪器" + +#~ msgid "Request Docs" +#~ msgstr "请求文档" + +#~ msgid "Help improve the Godot documentation by giving feedback." +#~ msgstr "通过提供反馈帮助改进godot文档。" + #~ msgid "Replaced %d occurrence(s)." #~ msgstr "替换了%d项。" diff --git a/editor/translations/zh_HK.po b/editor/translations/zh_HK.po index a228d6ee60..31306885ae 100644 --- a/editor/translations/zh_HK.po +++ b/editor/translations/zh_HK.po @@ -1533,7 +1533,7 @@ msgstr "移動Autoload" msgid "Remove Autoload" msgstr "移除Autoload" -#: editor/editor_autoload_settings.cpp +#: editor/editor_autoload_settings.cpp editor/editor_plugin_settings.cpp #, fuzzy msgid "Enable" msgstr "啟用" @@ -3070,7 +3070,12 @@ msgid "Q&A" msgstr "Q&A" #: editor/editor_node.cpp -msgid "Issue Tracker" +#, fuzzy +msgid "Report a Bug" +msgstr "導入" + +#: editor/editor_node.cpp +msgid "Send Docs Feedback" msgstr "" #: editor/editor_node.cpp editor/plugins/asset_library_editor_plugin.cpp @@ -4182,7 +4187,7 @@ msgid "Reimport" msgstr "導入" #: editor/import_dock.cpp -msgid "Save scenes, re-import and restart" +msgid "Save Scenes, Re-Import, and Restart" msgstr "" #: editor/import_dock.cpp @@ -7143,14 +7148,6 @@ msgid "Open Godot online documentation." msgstr "開啓最近的" #: editor/plugins/script_editor_plugin.cpp -msgid "Request Docs" -msgstr "" - -#: editor/plugins/script_editor_plugin.cpp -msgid "Help improve the Godot documentation by giving feedback." -msgstr "" - -#: editor/plugins/script_editor_plugin.cpp msgid "Search the reference documentation." msgstr "" @@ -7611,6 +7608,10 @@ msgid "This operation requires a single selected node." msgstr "" #: editor/plugins/spatial_editor_plugin.cpp +msgid "Auto Orthogonal Enabled" +msgstr "" + +#: editor/plugins/spatial_editor_plugin.cpp #, fuzzy msgid "Lock View Rotation" msgstr "本地化" @@ -7705,17 +7706,17 @@ msgid "Freelook Slow Modifier" msgstr "下滾" #: editor/plugins/spatial_editor_plugin.cpp +#, fuzzy +msgid "View Rotation Locked" +msgstr "本地化" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." msgstr "" #: editor/plugins/spatial_editor_plugin.cpp -#, fuzzy -msgid "View Rotation Locked" -msgstr "本地化" - -#: editor/plugins/spatial_editor_plugin.cpp msgid "XForm Dialog" msgstr "" @@ -11249,6 +11250,12 @@ msgid "Script file already exists." msgstr "AutoLoad '%s'已存在!" #: editor/script_create_dialog.cpp +msgid "" +"Note: Built-in scripts have some limitations and can't be edited using an " +"external editor." +msgstr "" + +#: editor/script_create_dialog.cpp #, fuzzy msgid "Class Name:" msgstr "名稱:" @@ -12946,6 +12953,10 @@ msgid "" "texture to some node for display." msgstr "" +#: scene/main/viewport.cpp +msgid "Viewport size must be greater than 0 to render anything." +msgstr "" + #: scene/resources/visual_shader_nodes.cpp #, fuzzy msgid "Invalid source for preview." diff --git a/editor/translations/zh_TW.po b/editor/translations/zh_TW.po index 466e8db554..235ce0d023 100644 --- a/editor/translations/zh_TW.po +++ b/editor/translations/zh_TW.po @@ -1521,7 +1521,7 @@ msgstr "移動 Autoload" msgid "Remove Autoload" msgstr "刪除 Autoload" -#: editor/editor_autoload_settings.cpp +#: editor/editor_autoload_settings.cpp editor/editor_plugin_settings.cpp msgid "Enable" msgstr "啟用" @@ -3062,8 +3062,12 @@ msgstr "Q&A" #: editor/editor_node.cpp #, fuzzy -msgid "Issue Tracker" -msgstr "問題追蹤器" +msgid "Report a Bug" +msgstr "重新導入" + +#: editor/editor_node.cpp +msgid "Send Docs Feedback" +msgstr "" #: editor/editor_node.cpp editor/plugins/asset_library_editor_plugin.cpp msgid "Community" @@ -4155,7 +4159,8 @@ msgid "Reimport" msgstr "重新導入" #: editor/import_dock.cpp -msgid "Save scenes, re-import and restart" +#, fuzzy +msgid "Save Scenes, Re-Import, and Restart" msgstr "保存場景,重新導入並重新啟動" #: editor/import_dock.cpp @@ -7125,15 +7130,6 @@ msgid "Open Godot online documentation." msgstr "打開 Godot 線上文檔" #: editor/plugins/script_editor_plugin.cpp -msgid "Request Docs" -msgstr "請求檔案" - -#: editor/plugins/script_editor_plugin.cpp -#, fuzzy -msgid "Help improve the Godot documentation by giving feedback." -msgstr "通過提供回饋幫助改進 Godot 文檔" - -#: editor/plugins/script_editor_plugin.cpp msgid "Search the reference documentation." msgstr "搜索參考文檔。" @@ -7589,6 +7585,11 @@ msgid "This operation requires a single selected node." msgstr "此操作需要單個選定的節點。" #: editor/plugins/spatial_editor_plugin.cpp +#, fuzzy +msgid "Auto Orthogonal Enabled" +msgstr "正交" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "Lock View Rotation" msgstr "鎖定視圖旋轉" @@ -7680,16 +7681,16 @@ msgid "Freelook Slow Modifier" msgstr "自由視圖速度調節" #: editor/plugins/spatial_editor_plugin.cpp +msgid "View Rotation Locked" +msgstr "視圖旋轉已鎖定" + +#: editor/plugins/spatial_editor_plugin.cpp msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." msgstr "注意: 顯示的FPS值是編輯器的幀率。 它不能用于表現遊戲內的實際性能" #: editor/plugins/spatial_editor_plugin.cpp -msgid "View Rotation Locked" -msgstr "視圖旋轉已鎖定" - -#: editor/plugins/spatial_editor_plugin.cpp msgid "XForm Dialog" msgstr "XForm對話框" @@ -11230,6 +11231,12 @@ msgid "Script file already exists." msgstr "Autoload「%s」已經存在!" #: editor/script_create_dialog.cpp +msgid "" +"Note: Built-in scripts have some limitations and can't be edited using an " +"external editor." +msgstr "" + +#: editor/script_create_dialog.cpp #, fuzzy msgid "Class Name:" msgstr "Class:" @@ -12956,6 +12963,10 @@ msgid "" "texture to some node for display." msgstr "" +#: scene/main/viewport.cpp +msgid "Viewport size must be greater than 0 to render anything." +msgstr "" + #: scene/resources/visual_shader_nodes.cpp #, fuzzy msgid "Invalid source for preview." @@ -12987,6 +12998,17 @@ msgstr "" msgid "Constants cannot be modified." msgstr "" +#, fuzzy +#~ msgid "Issue Tracker" +#~ msgstr "問題追蹤器" + +#~ msgid "Request Docs" +#~ msgstr "請求檔案" + +#, fuzzy +#~ msgid "Help improve the Godot documentation by giving feedback." +#~ msgstr "通過提供回饋幫助改進 Godot 文檔" + #~ msgid "Replaced %d occurrence(s)." #~ msgstr "取代了 %d 個。" |