Commit Graph

102 Commits

Author SHA1 Message Date
kobewi 99a9401a2c Use layer's modulate for tile previews 2022-12-18 17:31:29 +01:00
henrlin24 afa38bd030 Hide Scattering label and controls within TileMap editor window when "Place Random Tile" is disabled 2022-12-11 13:16:36 -05:00
Rémi Verschelde 43bef98450
Merge pull request #60892 from KoBeWi/fat_selection
Improve tile editor selection appearance
2022-12-09 18:05:38 +01:00
kobewi 871278cdf0 Improve tile editor selection appearance 2022-12-09 14:46:17 +01:00
Haoyu Qiu af3ef844d9 Update tile source icons when editor theme changes 2022-12-08 17:21:37 +08:00
Rémi Verschelde de2d0f156e
Merge pull request #69713 from groud/rename_get_surrounding_tiles
Rename get_surrounding_tiles to get_surrounding_cells
2022-12-07 13:24:57 +01:00
Gilles Roudière 3ea54bb3a1 Rename get_surrounding_tiles to get_surrounding_cells 2022-12-07 11:09:10 +01:00
Haoyu Qiu 9893b04fda Make ID capitalization in tiles editor consistent 2022-12-07 10:07:10 +08:00
trollodel c90d0bd84f Use forward-declarations in big editor classes 2022-11-29 09:59:43 +01:00
kobewi 8a3d2f4e0c Cleanup remaining EditorUndoRedoManager usages 2022-11-24 18:56:22 +01:00
Michael Alexsander 02390693ce Properly center labels in the TileMap/Set editors 2022-11-12 21:35:07 -03:00
Rémi Verschelde 5947f22be9
Merge pull request #67578 from KoBeWi/GEDITOR
Unify usage of GLOBAL/EDITOR_GET
2022-10-31 13:15:58 +01:00
Gilles Roudière fe65d7aa7b Make terrain painting not change neighbors centers bits 2022-10-20 14:47:45 +02:00
kobewi e48c5daddf Unify usage of GLOBAL/EDITOR_GET 2022-10-18 19:01:48 +02:00
kobewi 985671012a Separate Line and CurveLinear icons 2022-10-15 02:00:39 +02:00
kobewi 386382d796 Fix source sort not saving in TileMap editor 2022-10-11 22:40:39 +02:00
bruvzg 0103af1ddd
Fix MSVC warnings, rename shadowed variables, fix uninitialized values, change warnings=all to use /W4. 2022-10-07 11:32:33 +03:00
Magian 7e30343a5c TileMap mouse right can delete autotile 2022-09-30 21:15:15 +08:00
Guilherme Sousa 1ae1a02098 Fix mouse release leaving dock area 2022-09-27 13:35:01 +02:00
kobewi aafe72fcec Fix broken patterns on TileMap layer change 2022-09-10 16:45:51 +02:00
Michael Alexsander c4c9e41073 Make `Vector2i` values paired with `EDSCALE` be just `Vector2` 2022-09-08 14:46:32 -03:00
bruvzg 6f4d233062
Fix key mapping changes when moving from macOS to other platform
Removes separate `Command` key (use `Meta` instead).
Adds an event flag to automatically remap `Command` <-> `Control` (cannot be set alongside `Control` or `Meta`).
2022-09-07 18:45:35 +02:00
kobewi 35cae71842 Fix tile source selection from picking 2022-09-07 15:02:49 +02:00
Rémi Verschelde 5fb84e5702 Merge pull request #64661 from Mickeon/rename-tilemap-world
Rename TileMap/GridMap.`world_to_map` and opposite to `local_to_map`
2022-09-06 17:01:16 +02:00
Micky 694190a354 Rename TileMap/GridMap.`world_to_map` and opposite to `local_to_map`
For both TileMap and GridMap:
- `world_to_map` -> `local_to_map`
- `map_to_world` -> `map_to_local`

Also changes any mention of "world" in this context to "local" to avoid future confusion.

Finally, updates the docs of both methods for consistency.
In particular, adding a note on how to convert the returned values from local to global coordinates and vice versa.
2022-09-05 18:08:39 +02:00
Aaron Franke 995b9f94e8
Replace Rect2(i) has_no_area with has_area 2022-09-04 23:03:36 -05:00
Micky 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
Rémi Verschelde 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
Rémi Verschelde 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
Aaron Record 4b817a565c Remove NOTIFICATION_ENTER_TREE when paired with NOTIFICATION_THEME_CHANGED 2022-08-27 11:52:29 -06:00
Micky 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
kobewi ece3df3938 Add per-scene UndoRedo 2022-08-22 18:05:10 +02: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
luz paz 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
kobewi 2ccef6616e Fix crash when drawing invalid tiles 2022-06-23 14:34:23 +02:00
bruvzg b5c96df277
Move duplicate AutoWrap, Overrun and VisibleChar behavior enums to the TextServer. 2022-06-16 16:49:37 +03:00
FireForge b8720500b0 Improve TileMap editor layer selection button 2022-06-14 14:14:19 -05:00
Gilles Roudière 62d2549e9e Add terrain center bit 2022-06-10 14:37:39 +02:00
FireForge 87cfe90f6e Update viewport when toggling TileMap grid 2022-06-03 13:52:53 -05:00
Aaron Record 900c676b02 Use range iterators for RBSet in most cases 2022-05-19 12:09:16 +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
Vitika9 aef3b5681d Changed signals of ItemList 2022-05-06 13:09:04 +05:30
kobewi 142d0e7d75 Change Place Random Tiles to an icon 2022-05-01 22:13:30 +02:00
Michael Alexsander deb1342036 Make `TabBar/Container` default their alignments to the left instead of center 2022-03-17 18:12:23 -03:00
kobewi 42078dec9f Allow negative indexes in ItemList and PopupMenu 2022-03-12 01:14:03 +01:00
bruvzg 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
kobewi b727b81468 Fix source picking with sort 2022-02-24 01:20:21 +01:00
Rémi Verschelde 009254d87c
Merge pull request #58187 from jakobbouchard/notification-switch-chunk-c
Convert _notification methods to switch - Chunk C
2022-02-16 20:58:55 +01:00
Jakob Bouchard 6553f5c242
Convert _notification methods to switch - Chunk C 2022-02-16 13:03:05 -05:00
kobewi 547786650f Automatically select source of the picked tile 2022-02-16 00:39:00 +01:00