Commit graph

132 commits

Author SHA1 Message Date
Rémi Verschelde 277d2f1f50
Merge pull request #39661 from dreamsComeTrue/restart-project-settings-msg
Project Settings 'restart' message put focus on editor rather than project itself
2020-06-21 12:21:15 +02:00
Dominik 'dreamsComeTrue' Jasiński 251f43d79e Project Settings 'restart' message put focus on editor rather than project itself
Fixes: #39613
2020-06-19 21:16:51 +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
Marcel Admiraal e7fee711b3 Update game controller enums. 2020-05-13 10:33:32 +01:00
Rémi Verschelde 69de7ce38c Style: clang-format: Disable AllowShortCaseLabelsOnASingleLine
Part of #33027.
2020-05-10 13:13:54 +02:00
Rémi Verschelde e956e80c1f Style: clang-format: Disable AllowShortIfStatementsOnASingleLine
Part of #33027, also discussed in #29848.

Enforcing the use of brackets even on single line statements would be
preferred, but `clang-format` doesn't have this functionality yet.
2020-05-10 13:12:16 +02:00
Juan Linietsky 0e1c66d9fc Implement global and per instance shader uniforms.
Adds two keywords to shader language for uniforms:
-'global'
-'instance'

This allows them to reference values outside the material.
2020-04-17 12:35:41 -03:00
lupoDharkael 95a1400a2a Replace NULL with nullptr 2020-04-02 13:38:00 +02: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
Juan Linietsky 4396e98834 Refactored Input, create DisplayServer and DisplayServerX11 2020-03-26 15:49:32 +01:00
alvaroHernandez e47d5691e4 prevent joypad button input dropdown going out of dialog 2020-03-16 21:44:50 -03:00
Rémi Verschelde e2b66cacf7
Merge pull request #18020 from bruvzg/input_fix_non_latin_and_add_hw_scancodes
Fix non-latin layout scancodes on Linux, adds access to physical scancodes.
2020-03-01 23:00:42 +01:00
Mateo Dev .59 b8f08b42e7 Signals: Fix signals error prints for the new signal system 2020-02-28 14:24:09 +01:00
Rémi Verschelde f742dabafe Signals: Manually port most of remaining connect_compat uses
It's tedious work...

Some can't be ported as they depend on private or protected methods
of different classes, which is not supported by callable_mp (even if
it's a class inherited by the current one).
2020-02-28 14:24:09 +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
bruvzg 1af06d3d46
Rename scancode to keycode.
Add `physical_keycode` (keyboard layout independent keycodes) to InputEventKey and InputMap.
Fix non-latin keyboard layout keycodes on Linux/X11 (fallback to physical keycodes).
2020-02-25 12:30:33 +02: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
Hugo Locurcio c695751654
Improve icons in the Input Map editor
- Add a disabled icon for built-in inputs with a tooltip explaining
  why they can't be removed. This also makes the Add button's horizontal
  position consistent between built-in and custom inputs.
- Fade out input event icons slightly to make them easier to distinguish
  from action icons.
- Remove unnecessary punctuation from mouse button and joypad event
  descriptions.
2020-02-05 18:22:47 +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
Haoyu Qiu 078c0d75f2 Cleans up headers included in editor_node.h 2019-12-24 21:46:05 +08:00
Gilles Roudière 0287baf078 Disable ok button if no key is selected when adding event to an action 2019-11-13 22:37:06 +01:00
Rémi Verschelde bcb6a99154
Merge pull request #32527 from OsamaElHariri/fix_locale_filter
Fix locale filter in project settings editor
2019-11-07 13:06:17 +01:00
Hugo Locurcio b14e391792
Fix key names being wrongly capitalized in the input map editor
This also fixes the prompt in the editor shortcuts dialog
while removing duplicated code.

This closes #33305.
2019-11-04 15:23:28 +01:00
Hugo Locurcio 929d8dd20c
Fix off-by-one error in the Project Settings type dropdown
This closes #33075.
2019-10-25 23:58:21 +02:00
qarmin 616ab4fac2 Small fixes to redundand code, copy paste bugs 2019-10-14 11:40:55 +02:00
Hugo Locurcio 753eff2f68
Allow all Variant types to be added as project settings 2019-10-07 17:17:13 +02:00
Hugo Locurcio 724b9bc0ce
Focus the search box when pressing Ctrl+F in Project/Editor Settings 2019-10-06 17:56:34 +02:00
Osama El Hariri b2d8b213f7 Fix locale filter in project settings editor 2019-10-03 21:17:35 +03:00
Michael Alexsander Silva Dias 4e9df13a40 Fix crash when moving an action into itself in the Input Map editor 2019-09-27 22:12:35 -03:00
Rémi Verschelde fd3c825034
Merge pull request #31970 from HaSa1002/i18n
Fixed out of range crash on remapping files for translation
2019-09-24 10:07:20 +02:00
Hugo Locurcio 364dfa8d28
Add some missing feature tags to the "Override For..." menu
This closes https://github.com/godotengine/godot-docs/issues/2782.
2019-09-23 15:13:50 +02:00
Rémi Verschelde 0490fc9ce3
Merge pull request #31061 from Abstract-Everything/input-actions-reorder-ui
Input actions can be reordered by drag and drop.
2019-09-23 08:10:17 +02:00
lupoDharkael d9b34d2a3d Fix right click crash in Locales Filter 2019-09-10 21:25:42 +02:00
J-Camilleri 892adf733c Input actions can be reordered by drag and drop. 2019-09-05 13:59:17 +02:00
HaSa1002 bbcf26b7bf Fix out of range crash on remapping files 2019-09-04 19:48:32 +02:00
Rémi Verschelde ca652bbc47
Merge pull request #25353 from azagaya/master
Use also invisible tabs to calculate minimum size of tab container
2019-08-30 13:58:37 +02:00
azagaya fa6f86b886 Make tab containers in editor, project settings, and export dialog, to use hidden tabs for min size computation. 2019-08-30 08:33:32 -03:00
Rémi Verschelde d15cf7b672
Merge pull request #30576 from qarmin/lgtm_coverage
Changed some code reported by LGTM and Coverity
2019-07-20 12:00:13 +02:00
qarmin 6cbaf7662f Changed some code showed in LGTM and Coverage 2019-07-20 08:09:57 +02:00
Daniel Larson ba6fbe5fa7 Added DualShock Equivalents to Joypad Button 10 and 11 2019-07-15 11:56:41 -05:00
Rémi Verschelde b0ce9401ff
Merge pull request #30126 from qarmin/remove_unnecessary_code
Remove unnecessary code and add some error explanations
2019-07-01 14:32:04 +02:00
qarmin 3c154eb93b Remove unnecessary code and add some error explanations 2019-07-01 12:59:42 +02:00
Hugo Locurcio 310b03d97e
Tweak gamepad button names to be consistent with the documentation 2019-07-01 12:18:59 +02:00
qarmin 4e5310cc60 Some code changed with Clang-Tidy 2019-06-26 15:08:25 +02:00
Rémi Verschelde 47f00925dc
Merge pull request #28454 from homer666/popup-centered-maxsize
Add `popup_centered_clamped()` method to Popup
2019-05-28 11:36:41 +02:00