Commit graph

89 commits

Author SHA1 Message Date
kobewi
1a60509699 Close built-in script from any scene 2021-09-07 22:19:45 +02:00
Gilles Roudière
4bd7700e89 Implement properties arrays in the Inspector. 2021-09-07 09:51:28 +02: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
Lightning_A
e28fd07b2b Rename instance()->instantiate() when it's a verb 2021-06-19 20:49:18 -06:00
Pedro J. Estébanez
04688b92ff Rename Reference to RefCounted 2021-06-11 18:48:42 +02:00
Rémi Verschelde
9e328bb5b7
Core: Move DirAccess and FileAccess to core/io
File handling APIs are typically considered part of I/O, and we did have most
`FileAccess` implementations in `core/io` already.
2021-06-11 14:52:39 +02:00
Gilles Roudière
b46672db72 Provide a way to hook into Inspectors UndoRedo. 2021-05-04 09:55:22 +02:00
Hugo Locurcio
218d124755
Display scene file extensions in the editor only if there's ambiguity
This also simplifies the Editor Settings as the extension is now
automatically shown to avoid ambiguity.
2021-03-20 20:38:18 +01:00
kobewi
4db47eb32e Don't save project settings when not necessary 2021-02-13 18:51:48 +01:00
Rémi Verschelde
b1c60c757f
Merge pull request #31747 from KoBeWi/scene_stalking
Detect external modification of scenes
2021-02-10 14:31:29 +01:00
Rémi Verschelde
e856c5593b
Merge pull request #43222 from KoBeWi/sub_editor_oblivion
Remove unused get_subeditor() method
2021-01-29 12:28:55 +01:00
Tomasz Chabora
412125f191 Detect external modification of scenes 2021-01-16 23:33:04 +01:00
Pedro J. Estébanez
6fbe0a494b Fix cases of resources destroyed too early 2021-01-06 23:40:50 +01: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
Tomasz Chabora
2c048ea164 Cleanup unused engine code 2020-12-09 12:12:36 +01: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
Tomasz Chabora
16af326a46 Remove unused get_subeditor() method 2020-10-30 22:23:08 +01:00
Aaron Franke
1ca501d7d4
Check for global script class information before clearing it 2020-10-05 15:45:54 -04:00
Aaron Franke
3163611f0c
Don't write global script class information if there is none 2020-10-03 04:36:07 -04:00
Aaron Franke
2b44b0cc43
Iterate backwards over EditorPlugin's list of plugins in get_editor etc 2020-08-27 00:26:22 -04:00
Rémi Verschelde
0ee0fa42e6 Style: Enforce braces around if blocks and loops
Using clang-tidy's `readability-braces-around-statements`.
https://clang.llvm.org/extra/clang-tidy/checks/readability-braces-around-statements.html
2020-05-14 21:57:34 +02:00
Rémi Verschelde
07bc4e2f96 Style: Enforce separation line between function definitions
I couldn't find a tool that enforces it, so I went the manual route:
```
find -name "thirdparty" -prune \
  -o -name "*.cpp" -o -name "*.h" -o -name "*.m" -o -name "*.mm" \
  -o -name "*.glsl" > files
perl -0777 -pi -e 's/\n}\n([^#])/\n}\n\n\1/g' $(cat files)
misc/scripts/fix_style.sh -c
```

This adds a newline after all `}` on the first column, unless they
are followed by `#` (typically `#endif`). This leads to having lots
of places with two lines between function/class definitions, but
clang-format then fixes it as we enforce max one line of separation.

This doesn't fix potential occurrences of function definitions which
are indented (e.g. for a helper class defined in a .cpp), but it's
better than nothing. Also can't be made to run easily on CI/hooks so
we'll have to be careful with new code.

Part of #33027.
2020-05-14 16:54:55 +02:00
Rémi Verschelde
0be6d925dc Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks
Which means that reduz' beloved style which we all became used to
will now be changed automatically to remove the first empty line.

This makes us lean closer to 1TBS (the one true brace style) instead
of hybridating it with some Allman-inspired spacing.

There's still the case of braces around single-statement blocks that
needs to be addressed (but clang-format can't help with that, but
clang-tidy may if we agree about it).

Part of #33027.
2020-05-14 16:54:55 +02:00
Juan Linietsky
f8ef38efed Add proper type to most public API uses of Array 2020-04-21 12:16:45 -03:00
lupoDharkael
95a1400a2a Replace NULL with nullptr 2020-04-02 13:38:00 +02:00
Rémi Verschelde
cb282c6ef0 Style: Set clang-format Standard to Cpp11
For us, it practically only changes the fact that `A<A<int>>` is now
used instead of the C++03 compatible `A<A<int> >`.

Note: clang-format 10+ changed the `Standard` arguments to fully
specified `c++11`, `c++14`, etc. versions, but we can't use `c++17`
now if we want to preserve compatibility with clang-format 8 and 9.
`Cpp11` is still supported as deprecated alias for `Latest`.
2020-03-17 07:36:24 +01:00
simpuid
f817ba8379 Implement undo-redo feature for Parameter Paste in the Inspector
EditorData::undo_redo.add_do_property and EditorData::undo_redo.add_undo_property is used in EditorData::paste_object_params to implement this feature. It's action name is set to "Paste Params"

Changes made
* Removed the call for clearing the history on paste params case.
* Instead of directly setting the properties value, EditorData::undo_redo is used.
2020-02-29 16:52:12 +05:30
Rémi Verschelde
01afc442c7 Signals: Port connect calls to use callable_mp
Remove now unnecessary bindings of signal callbacks in the public API.
There might be some false positives that need rebinding if they were
meant to be public.

No regular expressions were harmed in the making of this commit.
(Nah, just kidding.)
2020-02-28 14:24:09 +01:00
Juan Linietsky
69c95f4b4c Reworked signal connection system, added support for Callable and Signal objects and made them default. 2020-02-20 08:24:50 +01:00
Juan Linietsky
867d073b98 Changed logic and optimized ObjectID in ObjectDB and Variant, removed RefPtr. 2020-02-15 08:36:04 -03:00
Juan Linietsky
cf8c679a23 ObjectID converted to a structure, fixes many bugs where used incorrectly as 32 bits. 2020-02-12 14:24:54 -03:00
Juan Linietsky
3f335ce3d4 Texture refactor
-Texture renamed to Texture2D
-TextureLayered as base now inherits 2Darray, cubemap and cubemap array
-Removed all references to flags in textures (they will go in the shader)
-Texture3D gone for now (will come back later done properly)
-Create base rasterizer for RenderDevice, RasterizerRD
2020-02-11 11:53:26 +01:00
volzhs
f61cd51643 Don't copy script with copy params 2020-01-09 06:34:47 +09:00
Rémi Verschelde
a7f49ac9a1 Update copyright statements to 2020
Happy new year to the wonderful Godot community!

We're starting a new decade with a well-established, non-profit, free
and open source game engine, and tons of further improvements in the
pipeline from hundreds of contributors.

Godot will keep getting better, and we're looking forward to all the
games that the community will keep developing and releasing with it.
2020-01-01 11:16:22 +01:00
Rafał Mikrut
ed1c4bc77d Removed unused variables, add some constants numbers 2019-12-10 05:13:02 +01:00
PouleyKetchoupp
b777d9b34a Multi-selection restored properly after switching scenes
Fixes #33511
2019-11-10 09:32:07 +01:00
Rémi Verschelde
99cc4d246f
Merge pull request #33343 from KoBeWi/scene_tree_dusting
Another scene tree dock menu cleanup
2019-11-07 15:17:14 +01:00
PouleyKetchoupp
fb9ff92c29 Node create dialog filtering optimization
Avoid loading the same scripts again and parse them when updating the node type tree.
2019-11-06 17:21:14 +01:00
Tomasz Chabora
4ed2abb0bf Another scene tree dock menu cleanup 2019-11-04 16:45:16 +01:00
qarmin
17732fe698 Added some obvious errors explanations 2019-09-25 10:28:50 +02:00
Tomasz Chabora
cedee8281b Allow to create scene from FileSystem dock 2019-08-15 19:47:21 +02:00
Bojidar Marinov
4f72178868
Make custom types more subtle and more useful
Implements #6067 (aaronfranke's idea)
Fixes #26980
2019-07-19 22:33:58 +03:00
Hein-Pieter van Braam-Stewart
0ac7715a27 Fix moving and renaming files
This commit fixes several issues related to moving scenes and resources
in an open project.

* Don't try to reload scenes while not all scenes are updated yet.
* Don't use the UndoRedo system to update non-user initiated editor
state.
* Resave scenes after moving files and updating resource path(s).
2019-06-04 16:24:32 +02:00
George Marques
25f9aee005
Allow class_name scripts to have nested inheritance 2019-03-09 00:47:27 -03:00
Rémi Verschelde
b16c309f82 Update copyright statements to 2019
Happy new year to the wonderful Godot community!
2019-01-01 12:58:10 +01:00
Rémi Verschelde
af92b7dc14
Merge pull request #23060 from willnationsdev/inherit-non-class-script
Fix Script -> Script Class not in CreateDialog
2018-11-26 10:52:52 +01:00
DrNochi
911d3a4586 Check if setting exists to prevent warning
Fixes #23332
2018-11-16 15:26:55 +01:00