Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cherry-picks for the 3.x branch (future 3.4) - 9th batch #50202

Merged
merged 29 commits into from
Jul 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
09b231e
Enable Camera2D smoothing on limit change
ek68794998 Jun 7, 2021
f0e7637
LocalVector: Don't error if `from` >= `count`
akien-mga Jul 1, 2021
b35e61b
Script editor: Rename 'Clone Down' to 'Duplicate Selection'
akien-mga Jun 29, 2021
65063db
Tweak the 2D game camera override tooltips to match 3D
Calinou Jun 29, 2021
76c1a0e
Fix unchecked call to put() warning in GodotInputHandler.java
madmiraal Jun 30, 2021
cd64bcd
Android: Add `isGame` application attribute, default to true
akien-mga Jun 30, 2021
d3dab1d
Fix GridMap erase Octans
Valeryn4 Jul 1, 2021
ca1a2e1
Add `get_dead_zone()` method to `InputMap`
SirQuartz Jul 2, 2021
2b78d61
Remove unnecessary semicolons from Android Java code
madmiraal Jul 2, 2021
01ecec4
Use Java array declarations not C-style declarations in Android Java …
madmiraal Jul 2, 2021
c1abbfb
Fix raw use of parameterized Class
madmiraal Jul 2, 2021
6a07253
Use StringBuilder instead StringBuffer in Godot Java code
madmiraal Jul 2, 2021
ab1162e
Remove redundant explicit types in Godot Java code
madmiraal Jul 2, 2021
d453b59
Make invisible `SplitContainer` nodes correctly calculate the minimal…
YeldhamDev Jul 2, 2021
245b940
Support single quote when dropping files to script
KoBeWi Jul 2, 2021
32e91b2
[Crypto] Delete mbedtls ctx in deconstructor.
Faless Jul 3, 2021
8c08b52
Add icons for more file types in the editor asset installer
Calinou Jul 3, 2021
daa0977
NodePath properly updated in the editor in more cases
pouleyKetchoupp Jun 21, 2021
5a66ab1
Coding style fix in editor NodePath update
pouleyKetchoupp Jun 30, 2021
59c5c04
Allow using the 3D editor's View menu while previewing a camera
Calinou Jul 1, 2021
3b11b10
Remove unused code related to Travis CI
Calinou Jul 1, 2021
f252622
Add numpad emulation in 3D viewport
timothyqiu Jul 2, 2021
4b03e05
Use static inner classes in Godot Java code
madmiraal Jul 3, 2021
9a22f4b
Replace backslash with forward slash in OS_Windows path methods
miere43 Jul 3, 2021
c7a0113
Fix Variant tags parsing.
bruvzg Jul 5, 2021
9c74452
Windows error logs directed to stderr
ThakeeNathees May 29, 2020
aaacc75
Fix gdnative api generation for methods that return enums
raniejade Feb 2, 2020
6f3b038
Change search results limit in FileSystem dock from 128 to 10000
Listwon Mar 22, 2021
37ff524
Improve error reporting in WebSocketServer
Calinou Jun 28, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions core/crypto/crypto.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ class HMACContext : public Reference {
virtual PoolByteArray finish() = 0;

HMACContext() {}
virtual ~HMACContext() {}
};

class Crypto : public Reference {
Expand Down
7 changes: 7 additions & 0 deletions core/input_map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ void InputMap::_bind_methods() {
ClassDB::bind_method(D_METHOD("erase_action", "action"), &InputMap::erase_action);

ClassDB::bind_method(D_METHOD("action_set_deadzone", "action", "deadzone"), &InputMap::action_set_deadzone);
ClassDB::bind_method(D_METHOD("action_get_deadzone", "action"), &InputMap::action_get_deadzone);
ClassDB::bind_method(D_METHOD("action_add_event", "action", "event"), &InputMap::action_add_event);
ClassDB::bind_method(D_METHOD("action_has_event", "action", "event"), &InputMap::action_has_event);
ClassDB::bind_method(D_METHOD("action_erase_event", "action", "event"), &InputMap::action_erase_event);
Expand Down Expand Up @@ -148,6 +149,12 @@ bool InputMap::has_action(const StringName &p_action) const {
return input_map.has(p_action);
}

float InputMap::action_get_deadzone(const StringName &p_action) {
ERR_FAIL_COND_V_MSG(!input_map.has(p_action), 0.0f, _suggest_actions(p_action));

return input_map[p_action].deadzone;
}

void InputMap::action_set_deadzone(const StringName &p_action, float p_deadzone) {
ERR_FAIL_COND_MSG(!input_map.has(p_action), _suggest_actions(p_action));

Expand Down
1 change: 1 addition & 0 deletions core/input_map.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ class InputMap : public Object {
void add_action(const StringName &p_action, float p_deadzone = 0.5);
void erase_action(const StringName &p_action);

float action_get_deadzone(const StringName &p_action);
void action_set_deadzone(const StringName &p_action, float p_deadzone);
void action_add_event(const StringName &p_action, const Ref<InputEvent> &p_event);
bool action_has_event(const StringName &p_action, const Ref<InputEvent> &p_event);
Expand Down
1 change: 0 additions & 1 deletion core/local_vector.h
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ class LocalVector {
}

int64_t find(const T &p_val, U p_from = 0) const {
ERR_FAIL_UNSIGNED_INDEX_V(p_from, count, -1);
for (U i = p_from; i < count; i++) {
if (data[i] == p_val) {
return int64_t(i);
Expand Down
32 changes: 24 additions & 8 deletions core/variant_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1297,16 +1297,32 @@ Error VariantParser::_parse_tag(Token &token, Stream *p_stream, int &line, Strin
r_tag.name = "";
r_tag.fields.clear();

while (true) {
CharType c = p_stream->get_char();
if (p_stream->is_eof()) {
r_err_str = "Unexpected EOF while parsing simple tag";
return ERR_PARSE_ERROR;
if (p_stream->is_utf8()) {
CharString cs;
while (true) {
CharType c = p_stream->get_char();
if (p_stream->is_eof()) {
r_err_str = "Unexpected EOF while parsing simple tag";
return ERR_PARSE_ERROR;
}
if (c == ']') {
break;
}
cs += c;
}
if (c == ']') {
break;
r_tag.name.parse_utf8(cs.get_data(), cs.length());
} else {
while (true) {
CharType c = p_stream->get_char();
if (p_stream->is_eof()) {
r_err_str = "Unexpected EOF while parsing simple tag";
return ERR_PARSE_ERROR;
}
if (c == ']') {
break;
}
r_tag.name += String::chr(c);
}
r_tag.name += String::chr(c);
}

r_tag.name = r_tag.name.strip_edges();
Expand Down
2 changes: 2 additions & 0 deletions doc/classes/Camera2D.xml
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@
</member>
<member name="limit_smoothed" type="bool" setter="set_limit_smoothing_enabled" getter="is_limit_smoothing_enabled" default="false">
If [code]true[/code], the camera smoothly stops when reaches its limits.
This has no effect if smoothing is disabled.
[b]Note:[/b] To immediately update the camera's position to be within limits without smoothing, even with this setting enabled, invoke [method reset_smoothing].
</member>
<member name="limit_top" type="int" setter="set_limit" getter="get_limit" default="-10000000">
Top scroll limit in pixels. The camera stops moving when reaching this value.
Expand Down
9 changes: 9 additions & 0 deletions doc/classes/InputMap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,15 @@
Removes all events from an action.
</description>
</method>
<method name="action_get_deadzone">
<return type="float">
</return>
<argument index="0" name="action" type="String">
</argument>
<description>
Returns a deadzone value for the action.
</description>
</method>
<method name="action_has_event">
<return type="bool">
</return>
Expand Down
1 change: 1 addition & 0 deletions doc/classes/NodePath.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
@"/root/Main" # If your main scene's root node were named "Main".
@"/root/MyAutoload" # If you have an autoloaded node or scene.
[/codeblock]
[b]Note:[/b] In the editor, [NodePath] properties are automatically updated when moving, renaming or deleting a node in the scene tree, but they are never updated at runtime.
</description>
<tutorials>
<link title="2D Role Playing Game Demo">https://godotengine.org/asset-library/asset/520</link>
Expand Down
12 changes: 0 additions & 12 deletions drivers/unix/ip_unix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,7 @@
#include <windows.h>
#include <ws2tcpip.h>
#ifndef UWP_ENABLED
#if defined(__MINGW32__) && (!defined(__MINGW64_VERSION_MAJOR) || __MINGW64_VERSION_MAJOR < 4)
// MinGW-w64 on Ubuntu 12.04 (our Travis build env) has bugs in this code where
// some includes are missing in dependencies of iphlpapi.h for WINVER >= 0x0600 (Vista).
// We don't use this Vista code for now, so working it around by disabling it.
// MinGW-w64 >= 4.0 seems to be better judging by its headers.
#undef _WIN32_WINNT
#define _WIN32_WINNT 0x0501 // Windows XP, disable Vista API
#include <iphlpapi.h>
#undef _WIN32_WINNT
#define _WIN32_WINNT 0x0600 // Re-enable Vista API
#else
#include <iphlpapi.h>
#endif // MINGW hack
#endif
#else // UNIX
#include <netdb.h>
Expand Down
6 changes: 3 additions & 3 deletions editor/code_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -712,8 +712,8 @@ void CodeTextEditor::_input(const Ref<InputEvent> &event) {
accept_event();
return;
}
if (ED_IS_SHORTCUT("script_text_editor/clone_down", key_event)) {
clone_lines_down();
if (ED_IS_SHORTCUT("script_text_editor/duplicate_selection", key_event)) {
duplicate_selection();
accept_event();
return;
}
Expand Down Expand Up @@ -1249,7 +1249,7 @@ void CodeTextEditor::delete_lines() {
text_editor->end_complex_operation();
}

void CodeTextEditor::clone_lines_down() {
void CodeTextEditor::duplicate_selection() {
const int cursor_column = text_editor->cursor_get_column();
int from_line = text_editor->cursor_get_line();
int to_line = text_editor->cursor_get_line();
Expand Down
2 changes: 1 addition & 1 deletion editor/code_editor.h
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ class CodeTextEditor : public VBoxContainer {
void move_lines_up();
void move_lines_down();
void delete_lines();
void clone_lines_down();
void duplicate_selection();

/// Toggle inline comment on currently selected lines, or on current line if nothing is selected,
/// by adding or removing comment delimiter
Expand Down
56 changes: 48 additions & 8 deletions editor/editor_asset_installer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,54 @@ void EditorAssetInstaller::open(const String &p_path, int p_depth) {

Map<String, Ref<Texture>> 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["bmp"] = tree->get_icon("ImageTexture", "EditorIcons");
extension_guess["dds"] = tree->get_icon("ImageTexture", "EditorIcons");
extension_guess["exr"] = tree->get_icon("ImageTexture", "EditorIcons");
extension_guess["hdr"] = tree->get_icon("ImageTexture", "EditorIcons");
extension_guess["jpg"] = tree->get_icon("ImageTexture", "EditorIcons");
extension_guess["jpeg"] = tree->get_icon("ImageTexture", "EditorIcons");
extension_guess["png"] = tree->get_icon("ImageTexture", "EditorIcons");
extension_guess["svg"] = tree->get_icon("ImageTexture", "EditorIcons");
extension_guess["svgz"] = tree->get_icon("ImageTexture", "EditorIcons");
extension_guess["tga"] = tree->get_icon("ImageTexture", "EditorIcons");
extension_guess["webp"] = tree->get_icon("ImageTexture", "EditorIcons");

extension_guess["wav"] = tree->get_icon("AudioStreamSample", "EditorIcons");
extension_guess["ogg"] = tree->get_icon("AudioStreamOGGVorbis", "EditorIcons");
extension_guess["mp3"] = tree->get_icon("AudioStreamMP3", "EditorIcons");

extension_guess["scn"] = tree->get_icon("PackedScene", "EditorIcons");
extension_guess["tscn"] = tree->get_icon("PackedScene", "EditorIcons");
extension_guess["escn"] = tree->get_icon("PackedScene", "EditorIcons");
extension_guess["dae"] = tree->get_icon("PackedScene", "EditorIcons");
extension_guess["gltf"] = tree->get_icon("PackedScene", "EditorIcons");
extension_guess["glb"] = tree->get_icon("PackedScene", "EditorIcons");

extension_guess["gdshader"] = tree->get_icon("Shader", "EditorIcons");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#49983 hasn't been merged yet, so as-is this cherry-pick is wrong. I fixed this in #49983 though.

extension_guess["gd"] = tree->get_icon("GDScript", "EditorIcons");
if (Engine::get_singleton()->has_singleton("GodotSharp")) {
extension_guess["cs"] = tree->get_icon("CSharpScript", "EditorIcons");
} else {
// Mark C# support as unavailable.
extension_guess["cs"] = tree->get_icon("ImportFail", "EditorIcons");
}
extension_guess["vs"] = tree->get_icon("VisualScript", "EditorIcons");

extension_guess["res"] = tree->get_icon("Resource", "EditorIcons");
extension_guess["tres"] = tree->get_icon("Resource", "EditorIcons");
extension_guess["atlastex"] = tree->get_icon("AtlasTexture", "EditorIcons");
// By default, OBJ files are imported as Mesh resources rather than PackedScenes.
extension_guess["obj"] = tree->get_icon("Mesh", "EditorIcons");

extension_guess["txt"] = tree->get_icon("TextFile", "EditorIcons");
extension_guess["md"] = tree->get_icon("TextFile", "EditorIcons");
extension_guess["rst"] = tree->get_icon("TextFile", "EditorIcons");
extension_guess["json"] = tree->get_icon("TextFile", "EditorIcons");
extension_guess["yml"] = tree->get_icon("TextFile", "EditorIcons");
extension_guess["yaml"] = tree->get_icon("TextFile", "EditorIcons");
extension_guess["toml"] = tree->get_icon("TextFile", "EditorIcons");
extension_guess["cfg"] = tree->get_icon("TextFile", "EditorIcons");
extension_guess["ini"] = tree->get_icon("TextFile", "EditorIcons");
}

Ref<Texture> generic_extension = get_icon("Object", "EditorIcons");
Expand Down
1 change: 1 addition & 0 deletions editor/editor_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,7 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
_initial_set("editors/3d/navigation/zoom_style", 0);
hints["editors/3d/navigation/zoom_style"] = PropertyInfo(Variant::INT, "editors/3d/navigation/zoom_style", PROPERTY_HINT_ENUM, "Vertical, Horizontal");

_initial_set("editors/3d/navigation/emulate_numpad", false);
_initial_set("editors/3d/navigation/emulate_3_button_mouse", false);
_initial_set("editors/3d/navigation/orbit_modifier", 0);
hints["editors/3d/navigation/orbit_modifier"] = PropertyInfo(Variant::INT, "editors/3d/navigation/orbit_modifier", PROPERTY_HINT_ENUM, "None,Shift,Alt,Meta,Ctrl");
Expand Down
3 changes: 2 additions & 1 deletion editor/filesystem_dock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,8 @@ void FileSystemDock::_update_file_list(bool p_keep_selection) {

if (searched_string.length() > 0) {
// Display the search results.
_search(EditorFileSystem::get_singleton()->get_filesystem(), &filelist, 128);
// Limit the number of results displayed to avoid an infinite loop.
_search(EditorFileSystem::get_singleton()->get_filesystem(), &filelist, 10000);
} else {
if (display_mode == DISPLAY_MODE_TREE_ONLY || always_show_folders) {
// Display folders in the list.
Expand Down
4 changes: 2 additions & 2 deletions editor/plugins/canvas_item_editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4625,11 +4625,11 @@ void CanvasItemEditor::_button_toggle_anchor_mode(bool p_status) {
void CanvasItemEditor::_update_override_camera_button(bool p_game_running) {
if (p_game_running) {
override_camera_button->set_disabled(false);
override_camera_button->set_tooltip(TTR("Game Camera Override\nOverrides game camera with editor viewport camera."));
override_camera_button->set_tooltip(TTR("Project Camera Override\nOverrides the running project's camera with the editor viewport camera."));
} else {
override_camera_button->set_disabled(true);
override_camera_button->set_pressed(false);
override_camera_button->set_tooltip(TTR("Game Camera Override\nNo game instance running."));
override_camera_button->set_tooltip(TTR("Project Camera Override\nNo project instance running. Run the project from the editor to use this feature."));
}
}

Expand Down
15 changes: 8 additions & 7 deletions editor/plugins/script_text_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1119,8 +1119,8 @@ void ScriptTextEditor::_edit_option(int p_op) {
case EDIT_DELETE_LINE: {
code_editor->delete_lines();
} break;
case EDIT_CLONE_DOWN: {
code_editor->clone_lines_down();
case EDIT_DUPLICATE_SELECTION: {
code_editor->duplicate_selection();
} break;
case EDIT_TOGGLE_FOLD_LINE: {
tx->toggle_fold_line(tx->cursor_get_line());
Expand Down Expand Up @@ -1504,6 +1504,7 @@ void ScriptTextEditor::drop_data_fw(const Point2 &p_point, const Variant &p_data
}

if (d.has("type") && (String(d["type"]) == "files" || String(d["type"]) == "files_and_dirs")) {
const String quote_style = EDITOR_DEF("text_editor/completion/use_single_quotes", false) ? "'" : "\"";
Array files = d["files"];

String text_to_drop;
Expand All @@ -1514,9 +1515,9 @@ void ScriptTextEditor::drop_data_fw(const Point2 &p_point, const Variant &p_data
}

if (preload) {
text_to_drop += "preload(\"" + String(files[i]).c_escape() + "\")";
text_to_drop += "preload(" + String(files[i]).c_escape().quote(quote_style) + ")";
} else {
text_to_drop += "\"" + String(files[i]).c_escape() + "\"";
text_to_drop += String(files[i]).c_escape().quote(quote_style);
}
}

Expand Down Expand Up @@ -1802,7 +1803,7 @@ void ScriptTextEditor::_enable_code_editor() {
edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/fold_all_lines"), EDIT_FOLD_ALL_LINES);
edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/unfold_all_lines"), EDIT_UNFOLD_ALL_LINES);
edit_menu->get_popup()->add_separator();
edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/clone_down"), EDIT_CLONE_DOWN);
edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/duplicate_selection"), EDIT_DUPLICATE_SELECTION);
edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/complete_symbol"), EDIT_COMPLETE);
edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/evaluate_selection"), EDIT_EVALUATE);
edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/trim_trailing_whitespace"), EDIT_TRIM_TRAILING_WHITESAPCE);
Expand Down Expand Up @@ -1969,10 +1970,10 @@ void ScriptTextEditor::register_editor() {
ED_SHORTCUT("script_text_editor/fold_all_lines", TTR("Fold All Lines"), 0);
ED_SHORTCUT("script_text_editor/unfold_all_lines", TTR("Unfold All Lines"), 0);
#ifdef OSX_ENABLED
ED_SHORTCUT("script_text_editor/clone_down", TTR("Clone Down"), KEY_MASK_SHIFT | KEY_MASK_CMD | KEY_C);
ED_SHORTCUT("script_text_editor/duplicate_selection", TTR("Duplicate Selection"), KEY_MASK_SHIFT | KEY_MASK_CMD | KEY_C);
ED_SHORTCUT("script_text_editor/complete_symbol", TTR("Complete Symbol"), KEY_MASK_CTRL | KEY_SPACE);
#else
ED_SHORTCUT("script_text_editor/clone_down", TTR("Clone Down"), KEY_MASK_CMD | KEY_D);
ED_SHORTCUT("script_text_editor/duplicate_selection", TTR("Duplicate Selection"), KEY_MASK_CMD | KEY_D);
ED_SHORTCUT("script_text_editor/complete_symbol", TTR("Complete Symbol"), KEY_MASK_CMD | KEY_SPACE);
#endif
ED_SHORTCUT("script_text_editor/evaluate_selection", TTR("Evaluate Selection"), KEY_MASK_CMD | KEY_MASK_SHIFT | KEY_E);
Expand Down
2 changes: 1 addition & 1 deletion editor/plugins/script_text_editor.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ class ScriptTextEditor : public ScriptEditorBase {
EDIT_INDENT_RIGHT,
EDIT_INDENT_LEFT,
EDIT_DELETE_LINE,
EDIT_CLONE_DOWN,
EDIT_DUPLICATE_SELECTION,
EDIT_PICK_COLOR,
EDIT_TO_UPPERCASE,
EDIT_TO_LOWERCASE,
Expand Down
6 changes: 3 additions & 3 deletions editor/plugins/shader_editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,8 @@ void ShaderEditor::_menu_option(int p_option) {
case EDIT_DELETE_LINE: {
shader_editor->delete_lines();
} break;
case EDIT_CLONE_DOWN: {
shader_editor->clone_lines_down();
case EDIT_DUPLICATE_SELECTION: {
shader_editor->duplicate_selection();
} break;
case EDIT_TOGGLE_COMMENT: {
if (shader.is_null()) {
Expand Down Expand Up @@ -627,7 +627,7 @@ ShaderEditor::ShaderEditor(EditorNode *p_node) {
edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/indent_right"), EDIT_INDENT_RIGHT);
edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/delete_line"), EDIT_DELETE_LINE);
edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/toggle_comment"), EDIT_TOGGLE_COMMENT);
edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/clone_down"), EDIT_CLONE_DOWN);
edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/duplicate_selection"), EDIT_DUPLICATE_SELECTION);
edit_menu->get_popup()->add_separator();
edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/complete_symbol"), EDIT_COMPLETE);
edit_menu->get_popup()->connect("id_pressed", this, "_menu_option");
Expand Down
2 changes: 1 addition & 1 deletion editor/plugins/shader_editor_plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class ShaderEditor : public PanelContainer {
EDIT_INDENT_LEFT,
EDIT_INDENT_RIGHT,
EDIT_DELETE_LINE,
EDIT_CLONE_DOWN,
EDIT_DUPLICATE_SELECTION,
EDIT_TOGGLE_COMMENT,
EDIT_COMPLETE,
SEARCH_FIND,
Expand Down
10 changes: 7 additions & 3 deletions editor/plugins/spatial_editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1927,6 +1927,13 @@ void SpatialEditorViewport::_sinput(const Ref<InputEvent> &p_event) {
return;
}

if (EditorSettings::get_singleton()->get("editors/3d/navigation/emulate_numpad")) {
const uint32_t code = k->get_scancode();
if (code >= KEY_0 && code <= KEY_9) {
k->set_scancode(code - KEY_0 + KEY_KP_0);
}
}

if (ED_IS_SHORTCUT("spatial_editor/snap", p_event)) {
if (_edit.mode != TRANSFORM_NONE) {
_edit.snap = !_edit.snap;
Expand Down Expand Up @@ -3076,14 +3083,12 @@ void SpatialEditorViewport::_toggle_camera_preview(bool p_activate) {
if (!preview) {
preview_camera->hide();
}
view_menu->set_disabled(false);
surface->update();

} else {
previewing = preview;
previewing->connect("tree_exiting", this, "_preview_exited_scene");
VS::get_singleton()->viewport_attach_camera(viewport->get_viewport_rid(), preview->get_camera()); //replace
view_menu->set_disabled(true);
surface->update();
}
}
Expand Down Expand Up @@ -3316,7 +3321,6 @@ void SpatialEditorViewport::set_state(const Dictionary &p_state) {
previewing = Object::cast_to<Camera>(pv);
previewing->connect("tree_exiting", this, "_preview_exited_scene");
VS::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();
Expand Down
Loading