Compare commits

..

8 commits

Author SHA1 Message Date
Rémi Verschelde
d3b052df8f
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
2025-10-10 13:01:22 +02:00
Anish Mishra
d632731ba8
Android: Only validate keystore relevant to current export mode
- Debug builds skip release keystore validation.
- Release builds skip debug keystore validation.

(cherry picked from commit 097ccbc5cd)
2025-10-10 11:07:41 +02:00
Pāvels Nadtočajevs
eb7c869f84
[macOS] Remove old embedded window joystick init code.
(cherry picked from commit 77dd83efbf)
2025-10-10 11:06:47 +02:00
Artemy Fedotov
183f6cdd63
Fix favorite folders that are outside of the project being displayed in FileSystemDock's file list
(cherry picked from commit 8d137bcd29)
2025-10-10 11:04:56 +02:00
Artemy Fedotov
83a78186ca
Fix crash due to null pointer dereference when moving/renaming folders in FileSystemDock
(cherry picked from commit 4e3a39a2e8)
2025-10-10 11:04:36 +02:00
Rémi Verschelde
1c078fee01
SCons: Don't activate fast_unsafe automatically on dev_build
We experienced first hand why it's called unsafe, and so we should leave it
as an explicit choice for contributors, informing themselves of the caveats.

See #111408.

(cherry picked from commit fa57282a1e)
2025-10-10 11:03:16 +02:00
kobewi
07596299e6
Enable script templates by default
(cherry picked from commit a299004622)
2025-10-10 11:02:15 +02:00
Fredia Huya-Kouadio
ce8f9dfea8
Fix the bug causing java.lang.StringIndexOutOfBoundsException crashes when showing the virtual keyboard
(cherry picked from commit ff3eee7df6)
2025-10-10 11:00:26 +02:00
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("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_auto_run", "Run ninja automatically after generating the ninja file", True))
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
# more than 10 s speed up for incremental rebuilds.
# Unsafe as they reduce the certainty of rebuilding all changed files, so it's
# enabled by default for `debug` builds, and can be overridden from command line.
# Unsafe as they reduce the certainty of rebuilding all changed files.
# If you use it and run into corrupted incremental builds, try to turn it off.
# 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("max_drift", 60)

View file

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

View file

@ -124,7 +124,7 @@ void ScriptCreateDialog::_notification(int p_what) {
} else {
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);
} break;
@ -849,6 +849,7 @@ void ScriptCreateDialog::_bind_methods() {
ScriptCreateDialog::ScriptCreateDialog() {
if (EditorSettings::get_singleton()) {
EDITOR_DEF("_script_setup_templates_dictionary", Dictionary());
EDITOR_DEF("_script_setup_use_script_templates", true);
}
/* Main Controls */

View file

@ -2853,36 +2853,38 @@ bool EditorExportPlatformAndroid::has_valid_export_configuration(const Ref<Edito
// Validate the rest of the export configuration.
String dk = _get_keystore_path(p_preset, true);
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 (p_debug) {
String dk = _get_keystore_path(p_preset, true);
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())) {
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)) {
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("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);
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);
// Use OR to make the export UI able to show this error.
if (!dk.is_empty() && !FileAccess::exists(dk)) {
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())) {
valid = false;
err += TTR("Either Release Keystore, Release User AND Release Password settings must be configured OR none of them.") + "\n";
}
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;
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)) {
valid = false;
err += TTR("Release keystore incorrectly configured in the export preset.") + "\n";
if (!rk.is_empty() && !FileAccess::exists(rk)) {
valid = false;
err += TTR("Release keystore incorrectly configured in the export preset.") + "\n";
}
}
#ifndef ANDROID_ENABLED

View file

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

View file

@ -150,16 +150,6 @@ void EmbeddedProcessMacOS::_try_embed_process() {
queue_redraw();
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();
} else {
// Another unknown error.