Commit Graph

60 Commits

Author SHA1 Message Date
Paul Chote
b29b685058 Rename Fluent-related code to be more precise. 2024-10-04 15:11:27 +03:00
RoosterDragon
cf0e73e75e Improve performance of copy-paste in map editor.
- EditorActorLayer now tracks previews on map with a SpatiallyPartitioned instead of a Dictionary. This allows the copy-paste logic to call an efficient PreviewsInCellRegion method, instead of asking for previews cell-by-cell.
- EditorActorPreview subscribes to the CellEntryChanged methods on the map. Previously the preview was refreshed regardless of which cell changed. Now the preview only regenerates if the preview's footprint has been affected.
2024-06-16 13:35:13 +03:00
RoosterDragon
799c4c9e3c Fix map editor not removing an actor properly.
If you edit an actor name, then delete the actor - it fails to be removed from the map in the editor. This is because the actor previews are keyed by ID. Editing their name edits their ID and breaks the stability of their hash code. This unstable hash code means the preview will now fail to be removed from collections, even though it's the "same" object.

Fix this by making the ID immutable to ensure hash stability - this means that a preview can be added and removed from collections successfully. Now when we edit the ID in the UI, we can't update the ID in place on the preview. Instead we must generate a new preview with the correct ID and swap it with the preview currently in use.
2024-03-28 12:11:26 +02:00
Wojciech Walaszek
7b82d85b27 Editor actor move 2024-03-03 14:27:35 +02:00
Wojciech Walaszek
00857df990 adds tilting on slopes to suitable actor previews 2024-01-09 14:56:30 +02:00
Gustas
0f5b78442b Extract unit names and descriptions 2023-11-25 16:28:19 +01:00
RoosterDragon
3275875ae5 Fix CA1851 2023-08-20 20:41:27 +02:00
RoosterDragon
8a285f9b19 Fix IDE0090 2023-04-08 16:51:51 +03:00
RoosterDragon
d4135d608e Fix IDE0039 2023-02-27 10:09:11 +01:00
RoosterDragon
4991f2f892 Fix IDE0041 2023-02-24 22:00:25 +02:00
abcdefg30
5bf7fe852c Remove the copyright year numbers 2023-01-11 11:58:54 +02:00
Matthias Mailänder
81020e70fa Fix actors with immobile actors that don't occupy space
to be placed everywhere way outside the map boundaries.
2022-11-05 21:41:39 +01:00
abcdefg30
6a31b1f9f3 Update the copyright header year 2022-05-28 00:35:10 -05:00
Eduardo Cáceres
7eb64ea6fc Use read-only autoimplemented property when possible 2022-05-18 11:42:36 -05:00
abc013
0898655175 Fix radar preview not updating when editing actor owner 2021-10-24 22:54:10 +02:00
penev92
8ba6d13b2f Removed unused using directives 2021-10-15 13:12:33 +02:00
Andre Mohren
6810469634 Updated copyright years. 2021-06-29 18:33:21 -05:00
teinarss
10676be377 Replace F extension with string interpolation 2021-05-08 22:20:59 +02:00
teinarss
8b0a3ea680 Remove our own impl of ReadOnlyList and update usages 2021-04-03 11:33:31 +02:00
teinarss
e12ff2c59d Remove our own ReadOnlyDictionary and update usages 2021-04-03 11:33:31 +02:00
teinarss
d60c05eff3 Change to use pattern matching 2021-03-27 17:29:20 +01:00
teinarss
4a1e4f3e16 Use expression body syntax 2021-03-07 13:00:52 +00:00
Paul Chote
96641873ae Replace highlight palette with tint effects. 2021-01-06 00:06:51 +01:00
Paul Chote
b88495c689 Remove palettes from base IRenderable. 2021-01-06 00:06:51 +01:00
Paul Chote
60195e2842 Prevent Health: 100 from being added to actors. 2021-01-02 15:12:20 +01:00
Paul Chote
3bc5d2d02c Add INotifyEditorPlacementInfo interface.
This allows TraitInfos to act when the actor preview is placed
in the editor, returning arbitrary data which the editor stores
and gives back if the preview is removed.
2020-07-13 14:02:02 +02:00
Nikita Pozdeev
cb41be113a Fix map editor radar ignoring color from terrain 2020-06-20 14:37:23 +02:00
Paul Chote
c6c3a8c60d Make ActorPreview and EditorActorPreview wrap ActorReference. 2020-06-19 17:57:56 +02:00
Paul Chote
7c6ec577dc Rewrite ActorInit queries. 2020-05-28 19:04:53 +02:00
abcdefg30
23b3c237b7 Update the year numbers in all license headers to 2020 2020-01-05 17:00:34 +00:00
Paul Chote
630ca0aefb Draw editor selection box using the UI renderers. 2019-12-11 11:02:04 +01:00
Paul Chote
1599eac66c Rename SelectionBoxRenderable to SelectionBoxAnnotationRenderable. 2019-10-20 23:46:33 +02:00
teinarss
76034c198e Added Undo Redo to editor 2019-09-27 17:40:32 +02:00
RoosterDragon
31918e8712 Add UnionRectangles extension method. 2019-09-14 22:09:40 +02:00
Paul Chote
ab4a7e3558 Replace System.Drawing primitives with our own. 2019-03-04 18:26:42 +00:00
abcdefg30
cadbd0d9ab Change the year number in all cs headers from 2018 to 2019 2019-01-26 23:15:21 +01:00
Paul Chote
4723e5ddb9 Expose common actor Inits in the map editor. 2018-12-08 22:53:13 +01:00
David Wilson
22bece2dc9 Add a basic actor properties panel to the editor. 2018-11-24 10:14:17 +00:00
Arular101
8a60918841 Update copyright notice year to 2018 2018-01-17 00:47:34 +01:00
Paul Chote
2794b14f52 Calculate actor preview bounds directly. 2017-12-23 17:16:13 +00:00
RoosterDragon
5338784e45 Fix bad uses of FirstEnabledTraitOrDefault on TraitInfos.
These are not traits so this method does not work. We can use EnabledByDefault on the ConditionalTraitInfo instead.
2017-12-10 13:39:24 +00:00
RoosterDragon
7a7eed4fb7 Add FirstEnabledTraitOrDefault helper method.
This avoids the allocations caused by LINQ when using traits.FirstOrDefault(Exts.IsTraitEnabled). This is important in FrozenActorLayer.RefreshState which is called very often. We apply the new helper method to all areas using the old pattern. An overload that takes an array allows arrays to be enumerated without causing allocations.
2017-12-10 13:39:24 +00:00
reaperrr
fdb3866238 Remove FootprintUtils 2017-07-13 17:43:41 +02:00
Taryn Hill
43317e0f5d Update copyright notice year to 2017 2016-12-31 23:46:13 -06:00
reaperrr
074bb78cbd Made Tooltip trait upgradable 2016-10-23 14:59:18 +02:00
Matthias Mailänder
fc523ae953 Print actor information instead of the function name. 2016-05-15 16:21:32 +02:00
Paul Chote
e71225496b Clarify GPL version. 2016-02-21 16:30:48 +00:00
Paul Chote
b396965fd9 Update licence header year. 2016-02-21 16:27:31 +00:00
RoosterDragon
8e89a6a696 Simplify names, remove unused usings, remove redundant casts. 2016-01-17 21:35:36 +00:00
atlimit8
e417ecb93f Add map editor only tooltips 2015-11-25 17:28:29 -06:00