Commit Graph

168 Commits

Author SHA1 Message Date
e31bb5ffeb Rename CanvasItem.update() to queue_redraw()
Affects a lot of classes. Very thoroughly checked signal connections and deferred calls to this method, add_do_method/add_undo_method calls, and so on.

Also renames the internal `_update_callback()` to `_redraw_callback()` for consistency.

Just a few comments have also been changed to say "redraw".

In CPUParticles2D, there was a private variable with the same name. It has been renamed to `do_redraw`.
2022-08-29 14:59:47 +02:00
fd6453c45e Revert "Remove NOTIFICATION_ENTER_TREE when paired with NOTIFICATION_THEME_CHANGED"
This reverts commit 4b817a565c.

Fixes #64988.
Fixes #64997.

This caused several regressions (#64988, #64997,
https://github.com/godotengine/godot/issues/64997#issuecomment-1229970605)
which point at a flaw in the current logic:

- `Control::NOTIFICATION_ENTER_TREE` triggers a *deferred* notification with
  `NOTIFCATION_THEME_CHANGED` as introduced in #62845.
- Some classes use their `THEME_CHANGED` to cache theme items in
  member variables (e.g. `style_normal`, etc.), and use those member
  variables in `ENTER_TREE`, `READY`, `DRAW`, etc. Since the `THEME_CHANGE`
  notification is now deferred, they end up accessing invalid state and this
  can lead to not applying theme properly (e.g. for EditorHelp) or crashing
  (e.g. for EditorLog or CodeEdit).

So we need to go back to the drawing board and see if `THEME_CHANGED` can be
called earlier so that the previous logic still works?

Or can we refactor all engine code to make sure that:
- `ENTER_TREE` and similar do not depend on theme properties cached in member
  variables.
- Or `THEME_CHANGE` does trigger a general UI update to make sure that any
  bad theme handling in `ENTER_TREE` and co. gets fixed when `THEME_CHANGE`
  does arrive for the first time. But that means having a temporary invalid
  (and possibly still crashing) state, and doing some computations twice
  which might be heavy (e.g. `EditorHelp::_update_doc()`).
2022-08-29 11:11:29 +02:00
f7f8af232c Merge pull request #64885 from Mickeon/rename-tooltip-hint
Rename `hint_tooltip` to `tooltip_text` & setter getter
2022-08-28 17:43:01 +02:00
4b817a565c Remove NOTIFICATION_ENTER_TREE when paired with NOTIFICATION_THEME_CHANGED 2022-08-27 11:52:29 -06:00
ef5b9a06a9 Rename hint_tooltip to tooltip_text & setget
`hint_tooltip` -> `tooltip_text`
`set_tooltip` -> `set_tooltip_text`
`_get_tooltip` -> `get_tooltip_text`

Updates documentation, too.
2022-08-27 01:35:01 +02:00
dadebb95aa Merge pull request #64601 from MinusKube/alternative-tile-popup-bug
Fix alternative tile popup menu not being openable
2022-08-26 10:35:43 +02:00
2abccb018e Fix alternative tile popup menu not being openable 2022-08-25 16:20:56 +02:00
d71b02cd19 Fix tileset image and background sometimes disappearing 2022-08-25 16:18:39 +02:00
ece3df3938 Add per-scene UndoRedo 2022-08-22 18:05:10 +02:00
6ba7dacf6b Merge pull request #63415 from ajreckof/expose_tilemap_custom_data_methods
Expose TileMap methods related to the name of custom data layers
2022-07-29 19:43:55 +02:00
7199314eb3 Merge pull request #63595 from reduz/remove-signal-connect-binds
Remove Signal connect binds
2022-07-29 18:10:39 +02:00
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
8433ad5353 expose TileMap methods related to the name of custom data layers 2022-07-29 15:05:42 +02:00
d5926b435e Make the alternative tile control correctly handle right-click dragging. 2022-07-29 03:11:08 +02:00
2e05cc3314 Merge pull request #58361 from V-Sekai/tileset_editor_selection
Fix tileset editor visiblity and selection context
2022-07-28 17:31:21 +02:00
199ea349f5 Merge pull request #57698 from bluenote10/feature/rename_translated_to_translated_local 2022-07-28 10:03:07 +02:00
222e489dfd Merge pull request #63496 from groud/fix_tile_set_not_saving
Fix TileSet not loading correctly when embedded in a scene
2022-07-26 18:27:05 +02:00
8da2710911 Fix TileSet not loading correctly when embedded in a scene 2022-07-26 17:39:35 +02:00
90019676b0 Code quality: Fix header guards consistency
Adds `header_guards.sh` bash script, used in CI to validate future
changes. Can be run locally to fix invalid header guards.
2022-07-25 11:17:40 +02:00
38aaaa3cf9 Fix various typos not caught by codespell
Revert upstream `core/input/gamecontrollerdb.txt`. Upstream fix: https://github.com/gabomdq/SDL_GameControllerDB/pull/600
2022-07-21 07:38:23 -04:00
97dfbea6ad Rename Control PRESET_WIDE to PRESET_FULL_RECT 2022-07-18 20:08:11 -05:00
2bf9e6090c rename translate(d) to translate(d)_local in Transform 2D/3D 2022-07-16 11:47:54 +02:00
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
e4067064ce Add ok_button_text to AcceptDialog and cancel_button_text to ConfirmationDialog 2022-07-09 10:47:08 -05:00
d2900429e8 Add static methods for creating Image and ImageTexture 2022-07-08 13:40:47 +02:00
344ba0ffaf Refactor Font configuration and import UI, and Font resources. 2022-07-06 14:12:36 +03:00
2ccef6616e Fix crash when drawing invalid tiles 2022-06-23 14:34:23 +02:00
88589c091b Improve TileSet editor and add more suffixes 2022-06-20 15:28:19 -05:00
b5c96df277 Move duplicate AutoWrap, Overrun and VisibleChar behavior enums to the TextServer. 2022-06-16 16:49:37 +03:00
b8720500b0 Improve TileMap editor layer selection button 2022-06-14 14:14:19 -05:00
d4f31e201d Merge pull request #61809 from groud/terrain_center_bit 2022-06-13 17:06:34 +02:00
62d2549e9e Add terrain center bit 2022-06-10 14:37:39 +02:00
cf2287a2b4 Add shortcuts to GenericTilePolygonEditor 2022-06-07 02:03:04 +02:00
87cfe90f6e Update viewport when toggling TileMap grid 2022-06-03 13:52:53 -05:00
900c676b02 Use range iterators for RBSet in most cases 2022-05-19 12:09:16 +02:00
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
aef3b5681d Changed signals of ItemList 2022-05-06 13:09:04 +05:30
c273ddc3ee Style: Partially apply clang-tidy's cppcoreguidelines-pro-type-member-init
Didn't commit all the changes where it wants to initialize a struct
with `{}`. Should be reviewed in a separate PR.

Option `IgnoreArrays` enabled for now to be conservative, can be
disabled to see if it proposes more useful changes.

Also fixed manually a handful of other missing initializations / moved
some from constructors.
2022-05-02 16:28:25 +02:00
142d0e7d75 Change Place Random Tiles to an icon 2022-05-01 22:13:30 +02:00
8dfa12cae7 Merge pull request #59979 from bruvzg/cpp_check2 2022-04-27 10:08:26 +02:00
3073b85de9 Rename theme properties to include underscores
- check_vadjust -> check_v_adjust
- close_h_ofs -> close_h_offset
- close_v_ofs -> close_v_offset
- commentfocus -> comment_focus
- hseparation -> h_separation
- ofs -> offset
- selectedframe -> selected_frame
- state_machine_selectedframe -> state_machine_selected_frame
- table_hseparation -> table_h_separation
- table_vseparation -> table_v_separation
- vseparation -> v_separation
2022-04-23 11:16:18 -05:00
de4c97758a Fix more issues found by cppcheck. 2022-04-20 10:34:00 +03:00
f851c4aa33 Fix some issues found by cppcheck. 2022-04-06 14:34:37 +03:00
f8ab79e68a Zero initialize all pointer class and struct members
This prevents the pitfall of UB when checking if they have been
assigned something valid by comparing to nullptr.
2022-04-04 19:49:50 +02:00
deb1342036 Make TabBar/Container default their alignments to the left instead of center 2022-03-17 18:12:23 -03:00
42078dec9f Allow negative indexes in ItemList and PopupMenu 2022-03-12 01:14:03 +01:00
ed0da06958 Added property hint to id property in tile set atlas source editor 2022-03-02 20:33:03 +01:00
74ff5921d6 Improve popup window handling.
Add window FLAG_POPUP and a platform specific routines to control popup auto-hiding and event forwarding.
2022-02-25 09:33:27 +02:00
b727b81468 Fix source picking with sort 2022-02-24 01:20:21 +01:00
04535bdc7d Fix contextual tileset editor and ensure button is always visible when tileset is available 2022-02-21 13:34:11 +00:00