* Replaces `find(...) != -1` with `contains` for `String`
* Replaces `find(...) == -1` with `!contains` for `String`
* Replaces `find(...) != -1` with `has` for containers
* Replaces `find(...) == -1` with `!has` for containers
Random-access access to `List` when iterating is `O(n^2)` (`O(n)` when
accessing a single element)
* Removed subscript operator, in favor of a more explicit `get`
* Added conversion from `Iterator` to `ConstIterator`
* Remade existing operations into other solutions when applicable
There were (at least) three cases where thumbnails would not display, if they were generated while the FileSystemDock was not visible:
- current_path == "Favorites", due to p_path not starting with "Favorites"
- current_path == "res://", due to current_path having last "/" trimmed for comparison
- current_path pointing to a selected file instead of folder, since it no longer matches p_path's base directory
This change removes the current_path and is_visible_in_tree checks when determining whether to update the file's icon.
Fixes#90801Fixes#91432
When renaming or moving global scripts, the following errors can appear:
- Attempt to open script 'xxx' resulted in error 'File not found'.
- Failed loading resource: xxx. Make sure resources have been imported by opening the project in the editor at least once.
- Parser Error: Class 'xxx' hides a global script class.
When deleting scripts, errors appear when opening the 'Create Node Dialog' as the script cache still contains the removed global scripts. The following errors can appear:
- Attempt to open script 'xxx' resulted in error 'File not found'.
- Failed loading resource: xxx. Make sure resources have been imported by opening the project in the editor at least once.
editor/create_dialog.cpp:241 - Condition "scr.is_null()" is true.
All this errors can be fixed by correctly handling the cases. They involves removing the old path and adding the new one (if not deleted) to the ScriptServer. This is somewhat similar if the file is moved or deleted outside Godot and detected by the file watcher, but more specialized for this particular usecase, since we know the old and the new path / correctly know what the user just did.
This also tweaks EditorFileDialog to use the same shortcut,
while making it select the path text after focusing
(like in most file managers).
Ctrl + L / Cmd + Shift + G can also now be used to focus on the
property name in the project settings editor, as well in the
Input Map, Autoload, Shader Globals and Global Groups tabs.