Commit Graph

49 Commits

Author SHA1 Message Date
Yuri Sizov 9b500ab53c Fix premature theme item access in editor tools 2023-04-03 18:01:11 +02:00
kobewi be6d5bbba6 Fix some TileMap errors and crashes 2023-02-14 00:39:41 +01:00
Rémi Verschelde 525db733c8
Merge pull request #72129 from groud/unclamp_texture_origin
Rename texture_offset and unclamp it
2023-01-27 15:40:52 +01:00
Gilles Roudière d7f3bd50bd Rename texture_offset and unclamp it 2023-01-27 11:04:45 +01:00
Gilles Roudière a3b431b09d Add gesture to ViewPanner and simplify a bit its API 2023-01-23 16:43:53 +01:00
Gilles Roudière 6285d6e5f5 Fixes rectangle painting when dragging outside the atlas area 2023-01-17 10:30:07 +01:00
kleonc 4276752608 TileAtlasView Update zoom and panning before emitting signal 2023-01-05 22:00:05 +01:00
Rémi Verschelde d95794ec8a
One Copyright Update to rule them all
As many open source projects have started doing it, we're removing the
current year from the copyright notice, so that we don't need to bump
it every year.

It seems like only the first year of publication is technically
relevant for copyright notices, and even that seems to be something
that many companies stopped listing altogether (in a version controlled
codebase, the commits are a much better source of date of publication
than a hardcoded copyright statement).

We also now list Godot Engine contributors first as we're collectively
the current maintainers of the project, and we clarify that the
"exclusive" copyright of the co-founders covers the timespan before
opensourcing (their further contributions are included as part of Godot
Engine contributors).

Also fixed "cf." Frenchism - it's meant as "refer to / see".
2023-01-05 13:25:55 +01:00
clayjohn 3c1e5003ab Fix pathological corner case in drawing tileset editor
Interleaving draw_rect calls with and without a texture forces every rect to
have its own draw call. In this case it meant that there is a draw call for every single
tile in the atlas. This change makes it so the renderer can batch draw calls
which reduced the draw call count by a factor of 512
2022-11-04 13:04:20 -07:00
kobewi e48c5daddf Unify usage of GLOBAL/EDITOR_GET 2022-10-18 19:01:48 +02:00
Eric M 16a3cec71e Fix zoom in/out keyboard shortcuts not working since the introduction of EditorZoomWidget. Add KP shortcuts to zoom in/out. 2022-09-24 18:24:59 +10:00
MinusKube 0ff2020bd4 Fix atlas view drawing roots having zoom applied twice 2022-09-17 19:07:56 +02:00
Jonathan Nicholl 15d057c521 Add `is_zero_approx` methods to `Vector2`, `3`, and `4` 2022-09-02 00:29:50 -04: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
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
MinusKube d71b02cd19 Fix tileset image and background sometimes disappearing 2022-08-25 16:18:39 +02:00
FireForge 97dfbea6ad Rename Control PRESET_WIDE to PRESET_FULL_RECT 2022-07-18 20:08:11 -05: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
bruvzg de4c97758a
Fix more issues found by cppcheck. 2022-04-20 10:34:00 +03:00
Jakob Bouchard 6553f5c242
Convert _notification methods to switch - Chunk C 2022-02-16 13:03:05 -05:00
Rémi Verschelde 6d708dfd6a
Merge pull request #57329 from Ev01/tileset-editor-minimum-zoom 2022-02-15 14:20:22 +01:00
Hendrik Brucker b396fd4eef Improve compilation speed (forward declarations/includes cleanup) 2022-02-12 02:46:22 +01:00
Rémi Verschelde fc076ece3d
Revert "Add missing SNAME macro optimization to all theme methods call"
This reverts commit a988fad9a0.

As discussed in #57725 and clarified in #57788, `SNAME` is not meant to be used
everywhere but only in critical code paths. For theme methods specifically, it
was by design that only getters use `SNAME` and not setters.
2022-02-08 10:17:25 +01:00
jmb462 a988fad9a0 Add missing SNAME macro optimization to all theme methods call 2022-02-06 23:06:11 +01:00
Ev01 c66ab56544 Set a minimum zoom of 1% and a maximum zoom of 10,000% on the tileset editor
Fixes issue #57292 where zooming out too much stops
you from being able to zoom back in
2022-01-30 13:45:14 +11:00
Rémi Verschelde b8b33df178
TileSetAtlasSource: Make `get_tile_data` return `TileData *`
This is now possible thanks to `Variant` changes.

Also unbind some `_` prefixed methods which don't need to be exposed.
2022-01-28 14:27:12 +01:00
kobewi 98692d68c3 Minor tweaks and fixes to panning 2022-01-23 13:49:53 +01:00
kobewi 74bfe88267 Add ViewPanner to 2D editor 2022-01-21 18:35:06 +01:00
kobewi ba7ed05792 Unify panning in sub-editors and make it configurable 2022-01-11 13:57:19 +01:00
Rémi Verschelde fe52458154
Update copyright statements to 2022
Happy new year to the wonderful Godot community!
2022-01-03 21:27:34 +01:00
Nathan Franke 41a20171eb
align to horizontal_alignment, valign to vertical_alignment, related 2021-12-09 01:38:46 -06:00
Aaron Franke 3c0fdcc8ac
Use "enum class" for input enums 2021-11-12 15:37:54 -06:00
Gilles Roudière b9151860f3 Prevent tiles outside atlas texture 2021-10-13 13:44:02 +02:00
Lightning_A c63b18507d Use range iterators for `Map` 2021-09-30 15:09:12 -06:00
Gilles Roudière f9e6329496 Implement animated tiles 2021-09-23 17:24:37 +02:00
Anilforextra 90908cd67d Add Get Center Method for Rect2/Rect2i and AABB. 2021-09-21 21:14:17 +05:45
Gilles Roudière 73cc6f94bf Fix transform of TileMap nodes and tilemap selection 2021-09-14 12:18:36 +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
Gilles Roudière ad8b5cd5a4 Implements TileMap layers and move TileSetPlugins's functions to the TileMap node instead 2021-08-02 13:54:39 +02:00
Michael Alexsander be1d5b0e73 Minor enhancements for the TileMap editor 2021-07-20 11:20:14 -03:00
kobewi 1bb2340652 Add scrolling to tile atlas view 2021-07-20 12:36:01 +02: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
Gilles Roudière 30a615dd94 Implement painting properties over TileSets 2021-06-29 11:07:46 +02:00
Gilles Roudière 78ad206d74 Add TileMap grid editor settings. 2021-05-25 10:23:57 +02:00
Gilles Roudière d8bb53cd21 Implement scenes tiles in TileMaps 2021-05-20 13:12:03 +02:00
Rémi Verschelde 6c367f8e0d
Merge pull request #48168 from LightningAA/control-to-ctrl-4.0 2021-05-17 17:38:02 +02:00
Michael Alexsander 6dad72db69 Fix small issues with capitalization in the new TileMap editor 2021-05-10 18:08:07 -03: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
Gilles Roudière a3dda2df85 Rework the TileSet resource and TileMap nodes:
- Move most properties from TileMap to TileSet,
- Make TileSet more flexible, supporting more feature (several
  collision layers, etc...),
- Fusion both the TileMap and TileSet editor,
- Implement TileSetSources, and thus a new way to index tiles in the TileSet,
- Rework the TileSet and TileMap editors completely,
- Implement an editor zoom widget (and use it in several places)
2021-05-07 18:06:17 +02:00