Commit graph

504 commits

Author SHA1 Message Date
Michael Alexsander
c9fe780239 Fix elements not being shown on first selected script/doc 2022-07-30 19:33:58 -03:00
Rémi Verschelde
ba3734e69a
Merge pull request #63603 from aaronfranke/editor-paths
Move editor paths into the EditorPaths class
2022-07-29 19:31:59 +02:00
Aaron Franke
ac870ab1c8
Move editor paths into the EditorPaths class 2022-07-29 11:07:30 -05:00
Juan Linietsky
d4433ae6d3 Remove Signal connect binds
Remove the optional argument p_binds from `Object::connect` since it was deprecated by Callable.bind().
Changed all uses of it to Callable.bind()
2022-07-29 16:26:13 +02:00
Rémi Verschelde
b942c1ffe3
Merge pull request #62827 from fire-forge/ok-cancel
Add `ok_button_text` to AcceptDialog and `cancel_button_text` to ConfirmationDialog
2022-07-13 14:10:38 +02:00
FireForge
af19501cc7 Seperate filter and description in FileDialog.add_filter() 2022-07-09 10:51:45 -05:00
FireForge
e4067064ce Add ok_button_text to AcceptDialog and cancel_button_text to ConfirmationDialog 2022-07-09 10:47:08 -05:00
Rémi Verschelde
b4804a2d3f
Merge pull request #61459 from reduz/new-shader-editor 2022-06-20 15:27:16 +02:00
FireForge
7f7244f04a Use consistent casing in editor filter/search bars 2022-05-28 18:43:16 -05:00
reduz
73c102f272 Redo the shader editor
* Shader editor is permanent (no longer transient).
* Can edit multiple files at the same time.

Likely fixes many usability issues (please lend me a hand Bugsquad team to identify them).
2022-05-28 11:03:16 +02:00
reduz
45af29da80 Add a new HashSet template
* Intended to replace RBSet in most cases.
* Optimized for iteration speed
2022-05-20 22:40:38 +02:00
Rémi Verschelde
5b02415fd0
Merge pull request #55134 from KoBeWi/script_pillow_or_something
Always soft-reload scripts
2022-05-17 15:09:09 +02:00
reduz
746dddc067 Replace most uses of Map by HashMap
* Map is unnecessary and inefficient in almost every case.
* Replaced by the new HashMap.
* Renamed Map to RBMap and Set to RBSet for cases that still make sense
  (order matters) but use is discouraged.

There were very few cases where replacing by HashMap was undesired because
keeping the key order was intended.
I tried to keep those (as RBMap) as much as possible, but might have missed
some. Review appreciated!
2022-05-16 10:37:48 +02:00
reduz
8b7c7f5a75 Add a new HashMap implementation
Adds a new, cleaned up, HashMap implementation.

* Uses Robin Hood Hashing (https://en.wikipedia.org/wiki/Hash_table#Robin_Hood_hashing).
* Keeps elements in a double linked list for simpler, ordered, iteration.
* Allows keeping iterators for later use in removal (Unlike Map<>, it does not do much
  for performance vs keeping the key, but helps replace old code).
* Uses a more modern C++ iterator API, deprecates the old one.
* Supports custom allocator (in case there is a wish to use a paged one).

This class aims to unify all the associative template usage and replace it by this one:
* Map<> (whereas key order does not matter, which is 99% of cases)
* HashMap<>
* OrderedHashMap<>
* OAHashMap<>
2022-05-12 11:21:29 +02:00
kobewi
1dc7bcc83c Cleanup metadata usage 2022-05-06 00:27:10 +02:00
Hugo Locurcio
180e5d3028
Remove RES and REF typedefs in favor of spelled out Ref<>
These typedefs don't save much typing compared to the full `Ref<Resource>`
and `Ref<RefCounted>`, yet they sometimes introduce confusion among
new contributors.
2022-05-03 01:43:50 +02:00
Hugo Locurcio
5626d026d8
Add an external link editor icon
This replaces the existing "chainlink" instance icon that was
used for external links. That icon is still used for scene instancing.

The icon was designed by redlamp.

Co-authored-by: Taylor Wright <taylor@redlamp.org>
2022-04-24 17:26:29 +02:00
bruvzg
4bf99f4af2 Narrow FileAccess scope to prevent deadlocks. 2022-04-12 10:54:39 +03:00
bruvzg
9381acb6a4
Make FileAccess and DirAccess classes reference counted. 2022-04-11 13:28:51 +03:00
Rémi Verschelde
f00803b8a5
Merge pull request #56695 from bruvzg/mod_unicode_input 2022-04-05 14:03:39 +02:00
bruvzg
d1207a0504
[Input] Add extra shortcut_input input processing step to process Unicode character input with Alt / Ctrl modifiers, after processing of shortcuts. 2022-04-05 13:46:45 +03:00
Yuri Roubinsky
5db47c5521 Fix lookup symbol in scripts which doesn't open a tab at first attempt 2022-04-05 10:18:45 +03:00
Michael Alexsander
1062bc9884 Fix creation and reopening of built-in scripts 2022-04-03 15:34:21 -03:00
reduz
360dea5348 Add GDExtension support to Script
* Ability to create script languages from GDExtension
* Some additions to gdnative_extension.h to make this happen
* Moved the GDExtension binder to core

This now allows creating scripting languages from GDExtension, with the same ease as if it was a module. It replaces the old PluginScript from Godot 3.x.
Warning: GodotCPP will need to be updated to support this (it may be a bit of work as ScriptInstance needs to be created over there again).
2022-03-27 16:13:00 +02:00
kobewi
42078dec9f Allow negative indexes in ItemList and PopupMenu 2022-03-12 01:14:03 +01:00
kobewi
2057ea2883 Remove duplicate editor settings definitions 2022-03-06 22:05:49 +01:00
kobewi
7d44bb8f06 Remove set_as_minsize() 2022-03-06 00:57:42 +01:00
Michael Alexsander
917dac78e7 Replace some bits of code left to work with the new TabContainer 2022-03-04 19:16:33 -03:00
Michael Alexsander
a811ebf699 Make TabContainer use TabBar internally 2022-03-03 21:49:58 -03:00
kobewi
f653107764 Fix scripts not saving when closing 2022-03-01 01:23:26 +01:00
Hugo Locurcio
958912a33f
Use versioned URL for "Online Documentation" buttons in the editor
This also avoids a redirect, making the page appear to load faster.
2022-02-17 18:17:02 +01:00
megalobyte
8824b6c5e9 Update if == NOTIFICATION_* to switch statements to match coding style 2022-02-16 08:44:37 -05:00
trollodel
05b56f316d Remove most EditorNode constructor parameters and fields 2022-02-14 14:16:24 +01:00
Rémi Verschelde
7a7fabe4f6
Merge pull request #57641 from Geometror/compilation-time-improvements-1 2022-02-12 09:46:02 +01:00
Hendrik Brucker
b396fd4eef Improve compilation speed (forward declarations/includes cleanup) 2022-02-12 02:46:22 +01:00
trollodel
e97e894aa0 Fix editor compile error when VisualScript is disabled 2022-02-11 18:45:41 +01:00
Rémi Verschelde
a66e55069e
Merge pull request #57796 from akien-mga/revert-sname-theme-setters 2022-02-08 11:13:24 +01:00
Rémi Verschelde
fc076ece3d
Revert "Add missing SNAME macro optimization to all theme methods call"
This reverts commit a988fad9a0.

As discussed in #57725 and clarified in #57788, `SNAME` is not meant to be used
everywhere but only in critical code paths. For theme methods specifically, it
was by design that only getters use `SNAME` and not setters.
2022-02-08 10:17:25 +01:00
Rémi Verschelde
317cd0b19a
Refactor some object type checking code with cast_to
Less stringly typed logic, and less String allocations and comparisons.
2022-02-08 10:08:34 +01:00
jmb462
a988fad9a0 Add missing SNAME macro optimization to all theme methods call 2022-02-06 23:06:11 +01:00
Rémi Verschelde
f8f19b313d
Merge pull request #57562 from AnilBK/string-add-contains
String: Add contains().
2022-02-03 22:21:24 +01:00
Anilforextra
adbe948bda String: Add contains(). 2022-02-04 01:28:02 +05:45
jmb462
71fb89390f Save script editor's function list split offset with the editor layout 2022-02-02 22:50:49 +01:00
Anilforextra
fc27636999 Vectors: Use clear() and has().
Use clear() instead of resize(0).

Use has() instead of "find(p_val) != -1".
2022-02-02 00:11:09 +05:45
Rémi Verschelde
e6caaf4c80
Merge pull request #57205 from TechnoPorg/variant-template-cast
Allow method binds to take Object subclasses as arguments
2022-01-27 23:46:37 +01:00
Wilson E. Alvarez
3eb5e0ac50
Rename String::is_subsequence_ofi to String::is_subsequence_ofn 2022-01-26 18:03:56 -05:00
TechnoPorg
051ef479c9 Allow method binds to take Object subclasses as arguments
This commit adds a condition to VariantCaster that casts Variants of type OBJECT to any type T, if T is derived from Object.
This change enables a fair bit of code cleanup. First, the Variant implicit cast operators for Node and Control can be removed, which allows for some invalid includes to be removed. Second, helper methods in Tree whose sole purpose was to cast arguments to TreeItem * are no longer necessary.
A few small changes also had to be made to other files, due to the changes cascading down all the includes.
2022-01-25 09:03:36 -07:00
Rémi Verschelde
eb5aa3218f
Merge pull request #57029 from timothyqiu/disable-script-editor-menu 2022-01-23 16:04:46 +01:00
Rémi Verschelde
c3d28ffa74
Merge pull request #57012 from Calinou/editor-add-new-script-textfile-shortcuts 2022-01-23 12:55:58 +01:00
Michael Alexsander
8383115666 Fix icon in drag preview of scripts/docs 2022-01-21 13:00:02 -03:00
Haoyu Qiu
e461e28c70 Disable ScriptEditor's menu items when they do nothing 2022-01-21 12:12:48 +08:00
Hugo Locurcio
990586b06b
Add shortcuts for New Script and New Text File in the script editor
These default to Ctrl + N and Ctrl + Shift + N respectively,
and will only work while the script editor is focused.
When the script editor is not focused, a new scene
(or inherited scene) will be created instead.
2022-01-20 23:10:42 +01:00
Rémi Verschelde
e6170aae39
Merge pull request #55066 from trollodel/less_singletons_in_editornode 2022-01-20 22:29:17 +01:00
trollodel
aa1102fc53 Store panels and docks singletons in their own classes 2022-01-20 20:13:26 +01:00
kobewi
b4ad04078c Fix unhandled_key_input() in Script Editor 2022-01-20 15:11:44 +01:00
Paulb23
f43f68f605 Convert TextEdit callbacks to Callable 2022-01-19 17:26:22 +00:00
Rémi Verschelde
3efa6644c4
Merge pull request #55541 from KoBeWi/outcognito_scripts 2022-01-14 21:04:13 +01:00
kobewi
f524ddebd5 Make script type distinguishable by icon 2022-01-13 12:29:05 +01:00
Rémi Verschelde
fe52458154
Update copyright statements to 2022
Happy new year to the wonderful Godot community!
2022-01-03 21:27:34 +01:00
Nathan Franke
49403cbfa0
Replace String comparisons with "", String() to is_empty()
Also:
- Adds two stress tests to test_string.h
- Changes to .empty() on std::strings
2021-12-09 04:48:38 -06:00
jmb462
81efebb3a1
Fix bad popups offset in editor with single window off
Co-authored-by: Gil Arasa Verge <gilarasaverge@gmail.com>
Co-authored-by: Tomasz Chabora <kobewi4e@gmail.com>
2021-12-06 14:29:48 +01:00
kobewi
512e260af4 Show scene when showing built-in script file 2021-11-24 13:05:18 +01:00
Lightning_A
e078f970db Rename remove() to remove_at() when removing by index 2021-11-23 18:58:57 -07:00
Yuri Roubinsky
eabf8f5edf Added reset_size method to Control and Window classes 2021-11-22 16:55:21 +03:00
kobewi
ca4c63d654 Always soft-reload scripts 2021-11-19 17:45:16 +01:00
Aaron Franke
3c0fdcc8ac
Use "enum class" for input enums 2021-11-12 15:37:54 -06:00
Aaron Franke
2ad3d1bd7a
Make OpenSimplex and VisualScript modules not depend on the editor 2021-11-12 12:03:54 -06:00
Rémi Verschelde
7211012c4f
Merge pull request #54745 from KoBeWi/find_in_scenes 2021-11-10 22:08:24 +01:00
kobewi
75e8eafa72 Properly reload built-in tool scripts 2021-11-09 21:58:06 +01:00
kobewi
31644fe280 Properly handle scenes in Find in Files 2021-11-08 02:28:55 +01:00
kobewi
134e4d168b Improve save handling for built-in scripts 2021-11-07 23:51:12 +01:00
kobewi
9abb07efb4 Ignore external editor for built-in scripts 2021-11-04 14:30:04 +01:00
kobewi
e393c2a734 Add is_built_in() method to Resource 2021-11-04 12:45:58 +01:00
Rémi Verschelde
3b11e33a09
clang-format: Disable alignment of operands, too unreliable
Sets `AlignOperands` to `DontAlign`.

`clang-format` developers seem to mostly care about space-based indentation and
every other version of clang-format breaks the bad mismatch of tabs and spaces
that it seems to use for operand alignment. So it's better without, so that it
respects our two-tabs `ContinuationIndentWidth`.
2021-10-28 15:19:35 +02:00
Rémi Verschelde
64ec08d70d
Merge pull request #53735 from Paulb23/text-file-drop-and-drag
Allow dragging TextFiles from the Filesystem dock
2021-10-12 22:21:02 +02:00
Paulb23
31c1215c25 Allow dragging TextFiles from the Filesystem dock 2021-10-12 18:16:08 +01:00
Paulb23
f33a6328b5 Fix TextFiles not saving when closing the tab 2021-10-12 17:13:24 +01:00
Paulb23
3010bca41b Move add_syntax_highlighter bind to ScriptEditorBase 2021-10-11 18:13:31 +01:00
Paulb23
44e260e247 Allow breakpoints in closed files 2021-10-07 19:48:58 +01:00
Paulb23
bec8ae7ba6 Preserve script editor state through tab closes 2021-10-07 19:44:23 +01:00
Paulb23
6596c7bdc2 Add TextFile support across the editor 2021-09-30 13:29:29 +01:00
Hugo Locurcio
3143e7df69
Add history navigation in the script editor using extra mouse buttons
This feature is enabled by default, but it can be disabled in the editor
settings in case it interferes with other uses of the extra buttons
(such as push-to-talk in a VoIP program).
2021-09-25 13:33:07 +02:00
Rémi Verschelde
80e2c084cd
Merge pull request #52479 from KoBeWi/the_close_of_all_tabs
Don't stop closing on unsaved script
2021-09-20 13:16:05 +02:00
Yuri Roubinsky
1dda47c280 Added status bar and toggle scripts panel button to EditorHelp/VScripts 2021-09-15 11:35:03 +03:00
kobewi
8fe664fb4b Don't stop closing on unsaved script 2021-09-07 23:38:19 +02:00
Fabio Alessandrelli
58c30b2626
Merge pull request #51639 from Ev1lbl0w/gsoc21-dap
Implement more advanced features for DAP
2021-09-01 16:17:32 +02:00
Ev1lbl0w
292ed61c18 Implemented advanced features of DAP
Respect client "supportsVariableType" capability

Implement "breakpointLocations" request

Implement "restart" request

Implement "evaluate" request

Fix error messages not being shown, and improved wrong path message

Removed thread option and behavior

Implemented detailed inspection of complex variables

Fix "const"ness of functions

Added a configurable timeout for requests

Implement Godot custom data request/event

Implement syncing of breakpoints

Added support for debugging native platforms
2021-08-31 15:17:58 +01:00
Lyuma
31f790299c Use OrderedHashMap for autoloads to preserve order 2021-08-26 21:55:26 -07:00
reduz
5cecdfa8af Entirely removes BIND_VMETHOD in favor of GDVIRTUAL
* `_gui_input`, `_input`, `_unhandled_input` and `_unhandled_key_input` are now regular C++ virutal functions.
* Everything else converted to GDVIRTUAL
* BIND_VMETHOD is gone, always use the new syntax from now on.

Creating `_gui_input` method and using the binder to register events will no longer work, simply override the virtual function now.
2021-08-23 08:10:13 -03:00
reduz
3682978aee Replace BIND_VMETHOD by new GDVIRTUAL syntax
* New syntax is type safe.
* New syntax allows for type safe virtuals in native extensions.
* New syntax permits extremely fast calling.

Note: Everything was replaced where possible except for `_gui_input` `_input` and `_unhandled_input`.
These will require API rework on a separate PR as they work different than the rest of the functions.

Added a new method flag METHOD_FLAG_OBJECT_CORE, used internally. Allows to not dump the core virtuals like `_notification` to the json API, since each language will implement those as it is best fits.
2021-08-22 08:23:58 -03:00
Rémi Verschelde
de7b6d13eb
Merge pull request #51627 from mhilbrunner/todo-for-neikeq 2021-08-18 20:13:50 +02:00
Max Hilbrunner
5161c97c9c Remove underscore hacks
Way less cruft. :)

Co-authored-by: Ignacio Roldán Etcheverry <neikeq@users.noreply.github.com>
2021-08-17 16:10:28 +02:00
Jihyun Yu
1c61245990 Auto-reload scripts with external editor 2021-08-17 21:43:45 +09:00
Paulb23
bcfc591f86 Reorganise text editor settings 2021-08-16 17:18:49 +01:00
fox
20201b56c2 Improve naming of a couple shortcuts 2021-08-10 13:01:07 -04:00
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
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
Rémi Verschelde
cb8f045de8
Merge pull request #49650 from KoBeWi/FindReplaceCrash
Fix crash with FindReplaceBar
2021-06-24 19:21:01 +02:00
kobewi
35a38717e2 Fix crash with FindReplaceBar 2021-06-24 15:38:29 +02:00