Commit graph

92 commits

Author SHA1 Message Date
kleonc ad7a6102ae SpriteFramesEditor Fix preview grid in "Select Frames" dialog 2021-09-07 15:27:19 +02: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
kleonc 8a48cb466e SpriteFramesEditor: preserve source texture margins when creating frames from AtlasTexture 2021-07-29 20:18:39 +02:00
Rémi Verschelde 92299989bd
Use Ref<T> references as iterators where relevant
And const when possible.
2021-07-26 19:27:11 +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
foxydevloper 429382b7e5 Fix hidden seperators when horizontal frames is 1 2021-07-20 19:01:08 -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
Hugo Locurcio 5e8eb20ad6
Allow selecting frames by holding down the mouse in SpriteFrames editor
This complements the existing (Ctrl +) Shift + Left mouse button
multiple frame (de)selection.
2021-06-17 20:11:50 +02:00
kobewi 7ff135b015 Consistently prefix bound virtual methods with _ 2021-06-12 00:55:52 +02:00
kleonc 07d346dfa5 SpriteFramesEditor Minor fixes 2021-05-23 10:59:21 +02:00
Aaron Franke b5b6d3a8ec
Make is_equal_approx have explicit float and double versions 2021-05-20 06:18:11 -04:00
Lightning_A 97fecd1b69 Rename "Control" key to "Ctrl" and add "_pressed" suffix to all InputEventWithModifiers properties/methods 2021-05-07 14:00:50 -06:00
Aaron Franke 10d7fccb54
Rename ButtonList enum and members to MouseButton 2021-03-23 07:13:23 -04:00
Hugo Locurcio e5c5b9570f
Scale zoom values in the SpriteFrames editor for hiDPI displays
This closes #46836.
2021-03-12 19:05:45 +01:00
dankan1890 390ff22a8c Create spritesheet for SpriteFrames by drag and dropping.
Close godotengine/godot-proposals#378
2021-01-12 00:51:59 +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
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
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
Rémi Verschelde 2da7d2c172
Merge pull request #41050 from Calinou/spriteframes-editor-compact
Make the SpriteFrames animation speed SpinBox take less vertical space
2020-09-03 14:40:45 +02:00
Javier Dehesa f2ef5253f0 Added zoom functionality to sprite frames editor plugin
Zoom buttons and mouse control added to spritesheet preview and animation frames pane.
2020-08-14 11:48:44 +01:00
Hugo Locurcio 2427a9cafc
Make the SpriteFrames animation speed SpinBox take less vertical space
This makes it possible to display one more animation with the same
vertical space.
2020-08-05 17:25:41 +02:00
Aaron Franke 56e2c6c704
Make all String float conversion methods be 64-bit 2020-07-27 18:38:53 -04:00
Stijn Hinlopen 526e060b73 Resize dialogs (FileDialog, EditorFileDialog, Reparent, SceneTreeDialog and resource depency dialogs). 2020-07-14 14:35:22 +02:00
Hugo Locurcio 31b7f02a29
Remove ToolButton in favor of Button
ToolButton has no redeeming differences with Button;
it's just a Button with the Flat property enabled by default.
Removing it avoids some confusion when creating GUIs.

Existing ToolButtons will be converted to Buttons, but the Flat
property won't be enabled automatically.

This closes https://github.com/godotengine/godot-proposals/issues/1081.
2020-06-19 20:49:49 +02: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
MrRevington 13770ac08d Add AtlasTexture support in SpriteFrames Editor - Add Frames from a Sprite Sheet 2020-04-30 23:28:58 +02:00
Juan Linietsky eaae4b6408 Renamed 2D and 3D nodes to make their types explicit
Fixes #30736.
2020-03-27 14:54:04 +01:00
Juan Linietsky 441f1a5fe9 Popups are now windows also (broken!) 2020-03-26 15:49:42 +01:00
Juan Linietsky 4758057f20 Working multiple window support, including editor 2020-03-26 15:49:40 +01: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
Rémi Verschelde 48ed841dd0 Signals: Fix some regressions from #36426
- Fix `callable_mp` bindings to methods which used to have default
  arguments passed to `bind_method`. We now have to re-specify them
  manually when connecting.
- Re-add `GroupsEditor::update_tree` binding.
- Misc code quality changes along the way.
2020-03-03 11:44:06 +01:00
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
Rémi Verschelde 2cf6ac6c50 Replace FALLTHROUGH macro by C++17 [[fallthrough]]
This attribute is now part of the standard we target so we no longer
need compiler-specific hacks.

Also enables -Wimplicit-fallthrough for Clang now that we can properly
support it. It's already on by default for GCC's -Wextra.

Fixes new warnings raised by Clang's -Wimplicit-fallthrough.
2020-02-23 00:52:50 +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 3205a92ad8 PoolVector is gone, replaced by Vector
Typed `PoolTypeArray` types are now renamed `PackedTypeArray` and are
sugar for `Vector<Type>`.
2020-02-18 10:10:36 +01: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
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
Rémi Verschelde e37ad996a1
Merge pull request #34625 from timothyqiu/i18n
Makes more editor strings translatable
2019-12-30 17:28:11 +01:00
Haoyu Qiu 8cf941a8cb Makes more editor strings translatable
* Title of Sprite Editor convert preview dialogs
* Title of UV Channel Debug dialog
* Various editor warnings
* GridMap popup menu item "Paste Selects"
* Tileset editor shape button texts
* MeshLibrary update confirmation text
2019-12-30 10:36:31 +08:00
Haoyu Qiu 078c0d75f2 Cleans up headers included in editor_node.h 2019-12-24 21:46:05 +08:00
Rafał Mikrut ed1c4bc77d Removed unused variables, add some constants numbers 2019-12-10 05:13:02 +01:00
Rémi Verschelde ab3bccdb78 Fix typos with codespell
Using codespell 1.16.0.

Method:
```
$ cat > ../godot-word-whitelist.txt << EOF
ang
curvelinear
dof
doubleclick
leapyear
lod
merchantibility
nd
numer
ois
ony
que
seeked
synching
te
uint
unselect
webp
EOF

$ codespell -w -q 3 -I ../godot-word-whitelist.txt --skip="./thirdparty,*.po"
$ git diff // undo unwanted changes
```
2019-11-22 08:35:03 +01:00
Rémi Verschelde 242e6cb904
Merge pull request #32000 from codecustard/Add_Reorder_frames_via_dragndrop
Add ability to reorder animation frames via drag and drop
2019-09-23 08:44:22 +02:00
PouleyKetchoupp a701d4e940 SpriteFramesEditor improvements around deleting animations
- Reorganized buttons layout to make it clearer between deleting animation & frame
- Added a confirmation popup for deleting an animation
- Fixed errors on selecting an animation after deleting one
2019-09-06 11:11:12 +02:00
Emmanuel Barroga 0048468658 Add ability to reorder animation frames via drag and drop
Allows you to reorder the frames of the animation by dragging the frames around.
2019-09-05 17:08:17 -07:00