Commit graph

263 commits

Author SHA1 Message Date
Rémi Verschelde ac3322b0af
Use const references where possible for List range iterators 2021-07-25 12:22:25 +02:00
Aaron Franke 4e6efd1b07
Use C++ iterators for Lists in many situations 2021-07-23 17:38:28 -04:00
Rémi Verschelde dfc1ec7fb9
Merge pull request #50606 from Chaosus/textedit_fix_guttertype
Fixed typos in `TextEdit::GutterType` enum
2021-07-19 16:40:42 +02:00
Yuri Roubinsky 1597045b09 Fixed typos in TextEdit::GutterType enum 2021-07-19 11:18:54 +03:00
reduz 6631f66c2a Optimize StringName usage
* Added a new macro SNAME() that constructs and caches a local stringname.
* Subsequent usages use the cached version.
* Since these use a global static variable, a second refcounter of static usages need to be kept for cleanup time.
* Replaced all theme usages by this new macro.
* Replace all signal emission usages by this new macro.
* Replace all call_deferred usages by this new macro.

This is part of ongoing work to optimize GUI and the editor.
2021-07-18 21:20:02 -03:00
kobewi 5e593dda9b Support single quote when dropping files to script 2021-07-03 13:03:20 +02:00
Rémi Verschelde d41f4aca77
Script editor: Rename 'Clone Down' to 'Duplicate Selection'
Fixes #36670.
2021-06-29 12:14:24 +02:00
Paulb23 1a0cfc219b Move indent management to CodeEdit 2021-06-20 20:00:54 +01:00
Lightning_A e28fd07b2b Rename instance()->instantiate() when it's a verb 2021-06-19 20:49:18 -06:00
Rémi Verschelde 60dcc4f39c
Merge pull request #49742 from Paulb23/remove_keywords_textedit
Remove redundant keywords from TextEdit
2021-06-20 00:39:18 +02:00
Paulb23 ab49ea032c Remove redundant keywords from TextEdit 2021-06-19 13:56:54 +01:00
Eric M d0e78c86d7 Added support for scripts reporting multiple errors to ScriptTextEditor
Scripts can now report multiple errors to the scripting editors in the engine. UI elements were added to support multiple errors.
2021-06-19 22:20:30 +10:00
Rémi Verschelde 341cb8da31
Merge pull request #49238 from Paulb23/code_edit_code_folding
Move code folding into CodeEdit and hide line hiding API
2021-06-16 20:11:39 +02:00
kobewi 7ff135b015 Consistently prefix bound virtual methods with _ 2021-06-12 00:55:52 +02:00
kobewi da6aebeb4c Move FindReplaceBar out of CodeTextEditor 2021-06-08 23:23:07 +02:00
Paulb23 5c618dd03d Move code folding into CodeEdit and hide line hiding API 2021-06-01 17:07:01 +01:00
Paulb23 c1b9971ad8 Move and expose Code Hint in CodeEdit 2021-06-01 15:38:45 +01:00
Paulb23 1c16673798 Move and expose AutoComplete in CodeEdit 2021-06-01 15:38:45 +01:00
Paulb23 680dc9e81a Add comment and string tracking to CodeEdit 2021-06-01 15:38:45 +01:00
kobewi 4bee21bcc4 Add preload() to resource path when holding Ctrl 2021-05-27 12:22:32 +02:00
Hugo Locurcio 80f4e407b2
Add a keyboard shortcut to select the word under cursor in TextEdit
This also acts as a general-purpose "deselect" shortcut since pressing
it a second time will deselect text.

This is available both in the script editor and in TextEdit fields
in use, both in the editor and projects.

The Duplicate Line script editor shortcut was moved to Ctrl + Shift + D
since it conflicts with the new shortcut (Ctrl + D). The rationale for
doing so is that Duplicate Line is a less commonly used action, and
its behavior can be replicated by copying and pasting the current line
anyway. (With no selection active, the whole line will be copied.)
2021-05-22 23:47:43 +02:00
Paulb23 00e10a842f Add custom background line colour to TextEdit and remove marked lines 2021-05-22 14:41:55 +01:00
Rémi Verschelde 37c3b33253
Merge pull request #48605 from sent44/scripteditor_get_codeedit
Add `get_base_editor` to `ScriptEditorBase`
2021-05-16 23:06:01 +02:00
sent44 2b30728ebf Add get_base_editor to ScriptEditorBase 2021-05-15 18:47:00 +07:00
llschuster 6b55ec2ca9 text-editor: fix Clicking warning doesn't center around line 2021-05-13 17:07:39 +02:00
Kongfa Waroros 6294507acb Add Various ColorPicker shapes 2021-04-06 22:48:03 +07:00
Kyle 2b775bd698 Fixes ctrl-click function line centering
When ctrl-clicking in the code editor, the view will now be centered on the function result.

Also replaces a circumstance where goto_line_centered should be used.
2021-03-24 12:29:14 -04:00
Aaron Franke 10d7fccb54
Rename ButtonList enum and members to MouseButton 2021-03-23 07:13:23 -04:00
Eric M 49714b0963 Removed hardcoded shortcuts from /scene and converted to input actions
This removes hardcoded actions from things like LineEdit and TextEdit.

Previously, things like copy, paste, etc were all hardcoded to Ctrl+C, Ctrl+V, etc. They could not be changed. This allows the possibility of them being changed, by making them use the action map. This has the added benefit of greatly simplifying the input handling logic in those controls. The logic which was previously in a huge and hard to follow switch statement has been extracted to individual methods.
2021-02-18 16:22:51 +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
Marcel Admiraal 8eb39f4e8b Change themes *_color_* to *_*_color
Changed:
font_color_accel -> font_accelerator_color
font_color_bg -> font_unselected_color
font_color_disabled -> font_disabled_color
font_color_fg -> font_selected_color
font_color_hover -> font_hover_color
font_color_hover_pressed -> font_hover_pressed_color
font_color_pressed -> font_pressed_color
font_color_readonly -> font_readonly_color
font_color_selected -> font_selected_color
font_color_shadow -> font_shadow_color
font_color_uneditable -> font_uneditable_color
icon_color_disabled -> icon_disabled_color
icon_color_hover -> icon_hover_color
icon_color_hover_pressed -> icon_hover_pressed_color
icon_color_normal -> icon_normal_color
icon_color_pressed -> icon_pressed_color

Also includes:
font_outline_modulate -> font_outline_color
tab_fg -> tab_selected
tab_bg -> tab_unselected
2021-01-24 06:28:49 +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
Marcel Admiraal 5b937d493f Rename empty() to is_empty() 2020-12-28 10:39:56 +00:00
Marcel Admiraal 4b8b803931 Rename Control margin to offset 2020-12-23 06:25:56 +00:00
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 3be31c4960
[Complex Text Layouts] Refactor TextEdit and CodeEdit controls. 2020-11-26 14:25:50 +02: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
Paulb23 c0da97d29c Remove breakpoints from editor settings 2020-09-10 20:35:28 +01:00
Paulb23 33ab9cd621 Move safe line color into editor 2020-09-10 20:35:28 +01:00
Paulb23 d18a90b8f0 Move ConnectionGutter to editor code_editor 2020-09-10 20:35:28 +01:00
Paulb23 4d7df24d46 Add main_gutter (breakpoints, bookmarks, execution lines) to code_edit 2020-09-10 20:35:28 +01:00
Paulb23 a0b409cb14 Add and convert editor to use CodeEdit 2020-09-10 20:35:27 +01:00
Paulb23 b289bb514b Fixed script_editor info_clicked signal not being connected 2020-07-29 17:51:27 +01: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
George Marques 95c0909290
Add warning checks in GDScript analyzer
Reenable checking those when validating code.
2020-07-20 11:38:40 -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 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