Commit graph

339 commits

Author SHA1 Message Date
sent44 2b30728ebf Add get_base_editor to ScriptEditorBase 2021-05-15 18:47:00 +07:00
Hugo Locurcio 39f9b92f54
Save the current script when pressing Ctrl + S if no scene is open
- Tweak the dialog messages to be more informative.
  - The "Saved N modified resources" dialog is not a warning per se,
    so make it more explicit.
2021-05-09 12:29:50 +02:00
Rémi Verschelde 8962d36bb1
Merge pull request #33577 from Calinou/highlight-control-flow-keywords
Highlight control flow keywords with a different color
2021-05-07 00:52:50 +02:00
Rémi Verschelde 6e621441ca
Merge pull request #45607 from Calinou/improve-editor-theme
Improve the editor theme
2021-05-06 16:45:07 +02:00
Hugo Locurcio 0ade686601
Save the current script when adding a new method via signal connection
This makes it possible for external editors to pick up the changes.
Most modern editors should reload the file automatically,
but some older/lightweight editors may ask the user instead
(or only warn after trying to save in the external editor).

This closes #41283.
2021-05-05 23:31:15 +02:00
Hugo Locurcio e905e8f145
Highlight control flow keywords with a different color
This makes them easier to distinguish from other keywords.
2021-05-05 22:38:12 +02:00
Hugo Locurcio 60b70c77e0
Improve the editor theme
The editor theme now makes use of rounded corners and less borders
to follow modern visual trends.

The default theme's colors were also tweaked to make the blue hue
more subtle (similar to the Arc theme, which was removed as a
consequence). The Alien theme was replaced by a Breeze Dark theme,
which should blend in well with the KDE theme.
2021-04-27 22:38:26 +02:00
Rafał Mikrut 504bc5cc67 Fix crashes in *_input functions 2021-04-05 08:52:21 +02:00
Aaron Franke 10d7fccb54
Rename ButtonList enum and members to MouseButton 2021-03-23 07:13:23 -04:00
kobewi 12f5a5a701 Don't save unchanged script upon closing 2021-03-06 20:17:19 +01:00
reduz f8d03b98e7 Improve resource load cache
-Added a new method in Resource: reset_state , used for reloading the same resource from disk
-Added a new cache mode "replace" in ResourceLoader, which reuses existing loaded sub-resources but resets their data from disk (or replaces them if they chaged type)
-Because the correct sub-resource paths are always loaded now, this fixes bugs with subresource folding or subresource ordering when saving.
2021-02-11 15:44:28 -03:00
Rémi Verschelde 1218441b16
Merge pull request #44514 from madmiraal/split-os-execute
Split OS::execute into two methods
2021-01-12 16:17:04 +01:00
Michael Alexsander 4194447a21 Fix script list only showing their names regardless of display option 2021-01-11 18:01:21 -03:00
Marcel Admiraal 2a74b388d0 Split OS::execute into two methods
1. execute(): Executes a command and returns the results.
2. create_process(): Creates a new process and returns the new process' id.
2021-01-09 10:03:23 +00:00
Rémi Verschelde b5334d14f7
Update copyright statements to 2021
Happy new year to the wonderful Godot community!

2020 has been a tough year for most of us personally, but a good year for
Godot development nonetheless with a huge amount of work done towards Godot
4.0 and great improvements backported to the long-lived 3.2 branch.

We've had close to 400 contributors to engine code this year, authoring near
7,000 commit! (And that's only for the `master` branch and for the engine code,
there's a lot more when counting docs, demos and other first-party repos.)

Here's to a great year 2021 for all Godot users 🎆
2021-01-01 20:19:21 +01:00
Rémi Verschelde 44357ddc28
Editor: Fix invalid use of Node::get_viewport() after rename of EditorNode::get_viewport()
Fixes #44761, was a regression from #44524.

The PR passed CI because EditorNode::get_viewport() used to shadow Node::get_viewport()
(which was a bug in itself, fixed by #44524), so once it was renamed the existing code
relying on it fell back to the now available Node::get_viewport().
This might bite some thirdparty modules too.
2020-12-28 19:51:39 +01:00
Marcel Admiraal 5b937d493f Rename empty() to is_empty() 2020-12-28 10:39:56 +00:00
Michael Alexsander ed488b72a6 Fix filename disambiguation on scripts in certain occasions 2020-12-22 17:27:06 -03:00
Marcel Admiraal 8509c8c8fc Rename AcceptDialog get_ok() to get_ok_button()
Also renames:
- AcceptDialog add_cancel() to add_cancel_button()
- ConfirmationDiaglog get_cancel() to get_cancel_button()
2020-12-14 18:43:52 +00:00
Tomasz Chabora 2c048ea164 Cleanup unused engine code 2020-12-09 12:12:36 +01:00
Rafał Mikrut e1811b689b Initialize class/struct variables with default values in platform/ and editor/ 2020-12-02 16:09:11 +01:00
Thakee Nathees 42bfa16996 Refactor DocData into core and editor (DocTools) parts 2020-12-02 00:48:39 +05:30
Thakee Nathees d0e7d9b62f Documentation generation for GDScript
- ClassDoc added to GDScript and property reflection data were extracted
from parse tree

- GDScript comments are collected from tokenizer for documentation and
applied to the ClassDoc by the GDScript compiler

- private docs were excluded (name with underscore prefix and doesn't
have any doc comments)

- default values (of non exported vars), arguments are extraced from the
parser

- Integrated with GDScript 2.0 and new enums were added.

- merge conflicts fixed
2020-11-29 19:45:36 +05:30
Rémi Verschelde a09846e015
Merge pull request #42109 from EricEzaM/PR/input-and-shortcuts-rework
Shortcuts rework - fixed issues with input propagation and triggering of unwanted shortcuts.
2020-11-28 09:04:25 +01:00
bruvzg 99666de00f
[Complex Text Layouts] Refactor Font class, default themes and controls to use Text Server interface.
Implement interface mirroring.
Add TextLine and TextParagraph classes.
Handle UTF-16 input on macOS and Windows.
2020-11-26 14:25:48 +02:00
Eric M efe5c250d5 Implement new shortcuts system.
unhandled_key_input changed to unhandled_button_input. Controls can set a 'shortcut_context' which they can then use to determine if their shortcuts should be triggered or not, based on if the viewport's focused GUI control is a child of their 'shortcut context'.
2020-11-23 21:14:26 +10:00
reduz 127458ed17 Reorganized core/ directory, it was too fatty already
-Removed FuncRef, since Callable makes it obsolete
-Removed int_types.h as its obsolete in c++11+
-Changed color names code
2020-11-07 20:17:12 -03:00
reduz f2397809a8 Refactored Variant Operators.
-Using classes to call and a table
-For typed code (GDS or GDNative), can obtain functions to call prevalidated or ptr.
2020-11-06 12:45:50 -03:00
Paulb23 4d7df24d46 Add main_gutter (breakpoints, bookmarks, execution lines) to code_edit 2020-09-10 20:35:28 +01:00
Tomasz Chabora 3082def404 Properly disambiguate unsaved scripts 2020-07-31 22:43:40 +02:00
Rémi Verschelde e016859c3b Script editor: Fix crash when root script is null
Bug introduced in #40746.
2020-07-27 15:18:31 +02:00
Rémi Verschelde 6b3f013a82 Script editor: Fix open dominant logic for language-specific external editors
Follow-up to #40735.

Co-authored-by: Ignacio Etcheverry <ignalfonsore@gmail.com>
2020-07-27 10:30:03 +02:00
Rémi Verschelde b5f110c77e Script editor: Don't open dominant script in external editor
Fixes #13429.
2020-07-26 23:18:05 +02:00
Andrii Doroshenko (Xrayez) 7247247522 Make unsaved scripts in the script editor more user-friendly
Unsaved scripts were previously displayed with blank tabs, which are
mostly a result of deleted or improperly moved scripts.

This patch makes sure that those kind of scripts are displayed as
"[unsaved]" now, and ensures that scripts are removed from the list
while deleting scripts from the filesystem dock preventing the unsaved
tabs to appear in the first place (a user is already prompted with
"no undo" warning while deleting any file).

A user is always prompted to save those "[unsaved]" scripts if they
attempt to close them without saving in any case except as described
above.
2020-07-26 16:05:44 +03:00
Rémi Verschelde 5700429e4e
Merge pull request #33760 from nekomatata/script-editor-init-optimization
Optimized ScriptEditor initialization when many scripts are loaded
2020-07-26 14:05:56 +02:00
Andrii Doroshenko (Xrayez) 1c70a33d9c Skip internal scripts for breakpoints without printing an error
This removes:
```
ERROR: get_breakpoints: Condition ' base.begins_with("local://")
```
while running a project with blank scripts caused by deleting
or moving, or built-in scripts which are not yet saved within a scene
on running a project.
2020-07-23 20:51:17 +03:00
PouleyKetchoupp ccff2f2551 Optimized ScriptEditor initialization when many scripts are loaded
This change avoids the editor to freeze for several seconds when a
project with lots of scripts is loaded in the editor.

It focuses on a few heavy operations previously executed on all
previously loaded scripts:
- Initialize script resource (script validation/parsing) only
on focus
- ScriptTextEditor: code editor and edit menu are added to the
scene only on focus
- Add to recent scripts only when opening new scripts
(load/save scene metadata)
2020-07-17 09:02:24 +02:00
Paulb23 54bca425b2 Fix crash when closing a TextFile 2020-07-16 15:50:23 +01:00
Rémi Verschelde 6497a3fb50
Merge pull request #40291 from hinlopen/dialog-size
Resize various dialogs
2020-07-15 12:13:33 +02:00
Rémi Verschelde c8523038cc
Merge pull request #40268 from DanielZTing/master
Fix cancel/OK button order on macOS
2020-07-15 09:21:04 +02:00
Stijn Hinlopen 526e060b73 Resize dialogs (FileDialog, EditorFileDialog, Reparent, SceneTreeDialog and resource depency dialogs). 2020-07-14 14:35:22 +02:00
Paulb23 bc4cee4458 Extract Syntax highlighting from TextEdit and add EditorSyntaxHighlighter
- Extacted all syntax highlighting code from text edit
- Removed enable syntax highlighting from text edit
- Added line_edited_from signal to text_edit
- Renamed get/set_syntax_highlighting to get/set_syntax_highlighter
- Added EditorSyntaxHighligher
2020-07-11 17:09:58 +01:00
Paulb23 156daddaaf Expose Syntax highlighter for editor plugins 2020-07-11 15:40:00 +01:00
Paulb23 2f1080be9b Convert syntax highlighters into a resource 2020-07-11 15:26:58 +01:00
Daniel Ting 9605fc54c7 Fix cancel/OK button order on macOS
The macOS platform convention regarding button order is cancel on left,
OK on right.
2020-07-10 15:10:11 -05:00
Daniel Ting d6c979d91b Do not try to save internal scripts
Fixes #40175
2020-07-08 11:53:18 -05:00
Rémi Verschelde 8a484756de
Merge pull request #39076 from rileylyman/editor_tab_names
Implement filename disambiguation for scene tabs and script names
2020-07-01 16:46:32 +02:00
Daniel Ting d2a5b92e9b Make "Close and save changes?" actually save
This fixes issue #39844, where the confirmation dialog when a user
attempts to close an unsaved script did not actually save it even after
clicking "Save."
2020-06-30 21:39:12 -05:00
Juan Linietsky 438c380458 Add a separate application focus/in notification out from Window focus notification. 2020-06-30 10:40:06 -03:00
rileylyman 4285211f40 implement generic filename disambiguation
A static function is added to EditorNode which allows for filename
disambiguation given a list of filenames and the corresponding list of
absolute paths for those files. This function is then used to
disambiguate scene and script tabs in the editor.
2020-06-26 16:12:08 -07:00