Merge pull request #111472 from akien-mga/4.5-cherrypicks

[4.5] Cherry-picks for the 4.5 branch (future 4.5.1) - 4th batch
This commit is contained in:
Rémi Verschelde 2025-10-10 13:01:22 +02:00 committed by GitHub
commit d3b052df8f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 48 additions and 47 deletions

View file

@ -210,7 +210,7 @@ opts.Add(
) )
) )
opts.Add(BoolVariable("tests", "Build the unit tests", False)) opts.Add(BoolVariable("tests", "Build the unit tests", False))
opts.Add(BoolVariable("fast_unsafe", "Enable unsafe options for faster rebuilds", False)) opts.Add(BoolVariable("fast_unsafe", "Enable unsafe options for faster incremental builds", False))
opts.Add(BoolVariable("ninja", "Use the ninja backend for faster rebuilds", False)) opts.Add(BoolVariable("ninja", "Use the ninja backend for faster rebuilds", False))
opts.Add(BoolVariable("ninja_auto_run", "Run ninja automatically after generating the ninja file", True)) opts.Add(BoolVariable("ninja_auto_run", "Run ninja automatically after generating the ninja file", True))
opts.Add("ninja_file", "Path to the generated ninja file", "build.ninja") opts.Add("ninja_file", "Path to the generated ninja file", "build.ninja")
@ -520,10 +520,10 @@ env.Decider("MD5-timestamp")
# SCons speed optimization controlled by the `fast_unsafe` option, which provide # SCons speed optimization controlled by the `fast_unsafe` option, which provide
# more than 10 s speed up for incremental rebuilds. # more than 10 s speed up for incremental rebuilds.
# Unsafe as they reduce the certainty of rebuilding all changed files, so it's # Unsafe as they reduce the certainty of rebuilding all changed files.
# enabled by default for `debug` builds, and can be overridden from command line. # If you use it and run into corrupted incremental builds, try to turn it off.
# Ref: https://github.com/SCons/scons/wiki/GoFastButton # Ref: https://github.com/SCons/scons/wiki/GoFastButton
if methods.get_cmdline_bool("fast_unsafe", env.dev_build): if env["fast_unsafe"]:
env.SetOption("implicit_cache", 1) env.SetOption("implicit_cache", 1)
env.SetOption("max_drift", 60) env.SetOption("max_drift", 60)

View file

@ -991,6 +991,9 @@ void FileSystemDock::_update_file_list(bool p_keep_selection) {
// Display the favorites. // Display the favorites.
Vector<String> favorites_list = EditorSettings::get_singleton()->get_favorites(); Vector<String> favorites_list = EditorSettings::get_singleton()->get_favorites();
for (const String &favorite : favorites_list) { for (const String &favorite : favorites_list) {
if (!favorite.begins_with("res://")) {
continue;
}
String text; String text;
Ref<Texture2D> icon; Ref<Texture2D> icon;
if (favorite == "res://") { if (favorite == "res://") {
@ -2033,6 +2036,7 @@ void FileSystemDock::_before_move(HashMap<String, ResourceUID::ID> &r_uids, Hash
} }
} else { } else {
EditorFileSystemDirectory *current_folder = EditorFileSystem::get_singleton()->get_filesystem_path(to_move[i].path); EditorFileSystemDirectory *current_folder = EditorFileSystem::get_singleton()->get_filesystem_path(to_move[i].path);
ERR_CONTINUE(current_folder == nullptr);
List<EditorFileSystemDirectory *> folders; List<EditorFileSystemDirectory *> folders;
folders.push_back(current_folder); folders.push_back(current_folder);
while (folders.front()) { while (folders.front()) {

View file

@ -124,7 +124,7 @@ void ScriptCreateDialog::_notification(int p_what) {
} else { } else {
language_menu->select(default_language); language_menu->select(default_language);
} }
is_using_templates = EDITOR_DEF("_script_setup_use_script_templates", false); is_using_templates = EDITOR_GET("_script_setup_use_script_templates");
use_templates->set_pressed(is_using_templates); use_templates->set_pressed(is_using_templates);
} break; } break;
@ -849,6 +849,7 @@ void ScriptCreateDialog::_bind_methods() {
ScriptCreateDialog::ScriptCreateDialog() { ScriptCreateDialog::ScriptCreateDialog() {
if (EditorSettings::get_singleton()) { if (EditorSettings::get_singleton()) {
EDITOR_DEF("_script_setup_templates_dictionary", Dictionary()); EDITOR_DEF("_script_setup_templates_dictionary", Dictionary());
EDITOR_DEF("_script_setup_use_script_templates", true);
} }
/* Main Controls */ /* Main Controls */

View file

@ -2853,36 +2853,38 @@ bool EditorExportPlatformAndroid::has_valid_export_configuration(const Ref<Edito
// Validate the rest of the export configuration. // Validate the rest of the export configuration.
String dk = _get_keystore_path(p_preset, true); if (p_debug) {
String dk_user = p_preset->get_or_env("keystore/debug_user", ENV_ANDROID_KEYSTORE_DEBUG_USER); String dk = _get_keystore_path(p_preset, true);
String dk_password = p_preset->get_or_env("keystore/debug_password", ENV_ANDROID_KEYSTORE_DEBUG_PASS); String dk_user = p_preset->get_or_env("keystore/debug_user", ENV_ANDROID_KEYSTORE_DEBUG_USER);
String dk_password = p_preset->get_or_env("keystore/debug_password", ENV_ANDROID_KEYSTORE_DEBUG_PASS);
if ((dk.is_empty() || dk_user.is_empty() || dk_password.is_empty()) && (!dk.is_empty() || !dk_user.is_empty() || !dk_password.is_empty())) { if ((dk.is_empty() || dk_user.is_empty() || dk_password.is_empty()) && (!dk.is_empty() || !dk_user.is_empty() || !dk_password.is_empty())) {
valid = false;
err += TTR("Either Debug Keystore, Debug User AND Debug Password settings must be configured OR none of them.") + "\n";
}
// Use OR to make the export UI able to show this error.
if ((p_debug || !dk.is_empty()) && !FileAccess::exists(dk)) {
dk = EDITOR_GET("export/android/debug_keystore");
if (!FileAccess::exists(dk)) {
valid = false; valid = false;
err += TTR("Debug keystore not configured in the Editor Settings nor in the preset.") + "\n"; err += TTR("Either Debug Keystore, Debug User AND Debug Password settings must be configured OR none of them.") + "\n";
} }
}
String rk = _get_keystore_path(p_preset, false); // Use OR to make the export UI able to show this error.
String rk_user = p_preset->get_or_env("keystore/release_user", ENV_ANDROID_KEYSTORE_RELEASE_USER); if (!dk.is_empty() && !FileAccess::exists(dk)) {
String rk_password = p_preset->get_or_env("keystore/release_password", ENV_ANDROID_KEYSTORE_RELEASE_PASS); dk = EDITOR_GET("export/android/debug_keystore");
if (!FileAccess::exists(dk)) {
valid = false;
err += TTR("Debug keystore not configured in the Editor Settings nor in the preset.") + "\n";
}
}
} else {
String rk = _get_keystore_path(p_preset, false);
String rk_user = p_preset->get_or_env("keystore/release_user", ENV_ANDROID_KEYSTORE_RELEASE_USER);
String rk_password = p_preset->get_or_env("keystore/release_password", ENV_ANDROID_KEYSTORE_RELEASE_PASS);
if ((rk.is_empty() || rk_user.is_empty() || rk_password.is_empty()) && (!rk.is_empty() || !rk_user.is_empty() || !rk_password.is_empty())) { if ((rk.is_empty() || rk_user.is_empty() || rk_password.is_empty()) && (!rk.is_empty() || !rk_user.is_empty() || !rk_password.is_empty())) {
valid = false; valid = false;
err += TTR("Either Release Keystore, Release User AND Release Password settings must be configured OR none of them.") + "\n"; err += TTR("Either Release Keystore, Release User AND Release Password settings must be configured OR none of them.") + "\n";
} }
if (!p_debug && !rk.is_empty() && !FileAccess::exists(rk)) { if (!rk.is_empty() && !FileAccess::exists(rk)) {
valid = false; valid = false;
err += TTR("Release keystore incorrectly configured in the export preset.") + "\n"; err += TTR("Release keystore incorrectly configured in the export preset.") + "\n";
}
} }
#ifndef ANDROID_ENABLED #ifndef ANDROID_ENABLED

View file

@ -276,16 +276,20 @@ public class GodotEditText extends EditText {
return; return;
} }
int cursorStart = p_cursor_start;
int cursorEnd = p_cursor_end;
int maxInputLength = (p_max_input_length <= 0) ? Integer.MAX_VALUE : p_max_input_length; int maxInputLength = (p_max_input_length <= 0) ? Integer.MAX_VALUE : p_max_input_length;
if (p_cursor_start == -1) { // cursor position not given if (cursorStart == -1) { // cursor position not given
this.mOriginText = p_existing_text; this.mOriginText = p_existing_text;
this.mMaxInputLength = maxInputLength; this.mMaxInputLength = maxInputLength;
} else if (p_cursor_end == -1) { // not text selection } else if (cursorEnd == -1) { // not text selection
this.mOriginText = p_existing_text.substring(0, p_cursor_start); cursorStart = Math.min(p_existing_text.length(), cursorStart);
this.mMaxInputLength = maxInputLength - (p_existing_text.length() - p_cursor_start); this.mOriginText = p_existing_text.substring(0, cursorStart);
this.mMaxInputLength = maxInputLength - (p_existing_text.length() - cursorStart);
} else { } else {
this.mOriginText = p_existing_text.substring(0, p_cursor_end); cursorEnd = Math.min(p_existing_text.length(), cursorEnd);
this.mMaxInputLength = maxInputLength - (p_existing_text.length() - p_cursor_end); this.mOriginText = p_existing_text.substring(0, cursorEnd);
this.mMaxInputLength = maxInputLength - (p_existing_text.length() - cursorEnd);
} }
this.mKeyboardType = p_type; this.mKeyboardType = p_type;
@ -293,8 +297,8 @@ public class GodotEditText extends EditText {
final Message msg = new Message(); final Message msg = new Message();
msg.what = HANDLER_OPEN_IME_KEYBOARD; msg.what = HANDLER_OPEN_IME_KEYBOARD;
msg.obj = this; msg.obj = this;
msg.arg1 = p_cursor_start; msg.arg1 = cursorStart;
msg.arg2 = p_cursor_end; msg.arg2 = cursorEnd;
sHandler.sendMessage(msg); sHandler.sendMessage(msg);
} }

View file

@ -150,16 +150,6 @@ void EmbeddedProcessMacOS::_try_embed_process() {
queue_redraw(); queue_redraw();
emit_signal(SNAME("embedding_completed")); emit_signal(SNAME("embedding_completed"));
// Send initial joystick state.
{
Input *input = Input::get_singleton();
TypedArray<int> joy_pads = input->get_connected_joypads();
for (const Variant &idx : joy_pads) {
String name = input->get_joy_name(idx);
script_debugger->send_message("embed:joy_add", { idx, name });
}
}
layer_host->grab_focus(); layer_host->grab_focus();
} else { } else {
// Another unknown error. // Another unknown error.