Commit Graph

30677 Commits

Author SHA1 Message Date
Paul Chote
2246922118 Fix lobby crash if a map's DefaultCash isn't Selectable. 2025-12-29 13:53:13 +02:00
Paul Chote
fdb4ce4e0f Save map generation args in replays/saves instead of full map. 2025-12-28 16:19:14 +02:00
Paul Chote
0d479e7c18 Move settings tabs to fluent. 2025-12-28 15:53:16 +02:00
Paul Chote
4436f07fbf Move settings to Gameplay tab. 2025-12-28 15:53:16 +02:00
Paul Chote
27fbd3ddeb Restore lobby UI when a force-start is rejected by the server. 2025-12-28 15:35:39 +02:00
Paul Chote
6ae03038cf Fix crash if the host force-starts a game while in the Invalid state. 2025-12-28 15:35:39 +02:00
Paul Chote
17210c1088 Fix Carryalls attempting to deliver units that they aren't carrying. 2025-12-28 15:07:46 +02:00
RoosterDragon
827f4682a5 ActorReference takes MiniYaml as input instead of a Dict.
As the InitDict is lazy, this removes the possibility for a mutable collection to be used but the values not to be consumed until later, which would be confusing. As all existing callers actually create a throw-away dictionary from MiniYaml, this is an easy switch.
2025-12-28 14:12:02 +02:00
RoosterDragon
a546ca2f92 Tweaks for map generator performance.
The map generator is already performant, but we can remove a few rough edges from infrastructure it interacts with.

- Add TypeDictionary constructor to clone from an existing copy. The map editor infrastructure relies heavily on cloning ActorReferences and the underlying dictionaries. A dedicated clone method avoids reflection overhead for CreateTypeContainer on a fresh instance.
- Use ThrowIndexOutOfRangeException helper. This allows the Index method to be inlined.
- Reuse lists in FloodFill. This avoids allocating and resizing new lists on each loop when we can reuse the existing capacity.
- Manage CellEntryChanged at the layer rather than individual previews. We only need to attach/detach from the delegate once at the layer, rather than many times as previews are added and removed.
2025-12-28 14:12:02 +02:00
RoosterDragon
3ea5b08848 Fix usage of MapGeneratorMultiChoiceOption.Default
When this switched to an ImmutableArray, this expression has to be updated as the struct is not nullable. It supports an overloaded equals (==) but not a null-conditional (?.) operator. This expression was rewritten incorrectly and failed to use the first valid choice as a fallback in all cases. Update the code to do this.

Fixes regression from 649e7e8c28.
2025-12-23 20:35:45 +02:00
Gustas
4aec67c0c6 Display map name first 2025-12-22 23:05:07 +00:00
Paul Chote
bca1dd599d Remove remaining non-fluent server->client messages. 2025-12-22 23:05:07 +00:00
Gustas
d69deba56f Use lobby option cache for suppressing old options 2025-12-22 23:05:07 +00:00
Paul Chote
81fec36fbb Resolve lobby option notifications client-side. 2025-12-22 23:05:07 +00:00
Paul Chote
f8b9dfc73e Resolve mission briefing notifications client-side. 2025-12-22 23:05:07 +00:00
Pavel Penev
d4fd66adf9 Renamed SyncAttribute to VerifySyncAttribute 2025-12-22 19:09:53 +02:00
Paul Chote
ec75dcd9e9 Standardize and simplify settings menu settings access. 2025-12-22 15:28:09 +02:00
Paul Chote
2e16ad47e5 Migrate skirmish state to a mod-specific settings module. 2025-12-22 15:28:09 +02:00
Paul Chote
7e9d87a808 Move auto-saving settings to mod code. 2025-12-22 15:28:09 +02:00
Paul Chote
98f7fe0db7 Remove special-case hotkey parsing. 2025-12-22 15:28:09 +02:00
Paul Chote
575f6624a2 Implement modular settings backend. 2025-12-22 15:28:09 +02:00
Paul Chote
962e7e911d Replace MouseButtonPreference with MouseActionType. 2025-12-22 10:34:40 +02:00
Pavel Penev
c588c3ef8d Added missing ISync for conditional traits 2025-12-22 09:28:07 +02:00
Pavel Penev
70624fa44f Stopped syncing IsTraitPaused/Disabled
A discussion on Discord (https://discord.com/channels/153649279762694144/388282819371204608/1181890238759587881) decided we don't need to sync these.
2025-12-22 09:28:07 +02:00
michaeldgg2
06e3e013be ActorIndex: make constructor protected to allow defining custom actor indexes 2025-12-21 14:21:42 +02:00
RoosterDragon
06e4a2e010 Reduce allocations in main game loop.
Target a couple of hot paths:
- In Actor, cache the renderables enumerable by tracking the last used WorldRenderer. It's slightly uncouth but in practise the WorldRenderer will be the same for the lifetime of the Actor and outlive it anyway.
- In RenderSprites, cache the renderables enumerable. If we refresh the palettes directly, we don't need the WorldRenderer for anything else so can return a cached enumerable. This could result in iterating the animation list twice, so use a flag to only do it when required, which is rare.
- In AutoTarget, the compiler has an unfortunate behaviour where it allocates the helper class for a capturing lambda at the top of the loop, but it's on a rare path and so this allocation is usually unused. We can discourage the compiler from allocating until it's actually needed by wrapping the call in a local function.
2025-12-20 15:13:15 +02:00
RoosterDragon
bcfaa44d66 Amortize allocations when sorting renderables.
Using OrderBy provides a stable sort, but internally allocates a buffer every time for storing the sort keys. We'd like to avoid this allocation, but we also can't directly use Array.Sort/Span.Sort as these are unstable sorts.

By calculating sort keys with the item index embedded, we can ensure a stable sorting result whilst being able to reuse the buffer for the sort keys across future calls.
2025-12-15 19:33:19 +02:00
Matthias Mailänder
1539741e71 Don't run the CI build when only Python scripts are edited. 2025-12-15 19:14:12 +02:00
Matthias Mailänder
3ad38ba503 Shorten trait requirement prefix. 2025-12-15 19:14:12 +02:00
dependabot[bot]
7cef83c51c Bump actions/upload-artifact from 5 to 6
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 5 to 6.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-15 14:40:21 +01:00
Gustas
493cf3f1eb Update TD map pool 2025-12-12 23:05:10 +00:00
Paul Chote
3c7389f582 Implement InstallShieldPackage.OpenPackage. 2025-12-12 12:39:21 +02:00
Paul Chote
374166e9d3 Add a minimal iso9660 package reader. 2025-12-12 12:39:21 +02:00
Paul Chote
31607bd0cf Stop passing around partially constructed ModData instances. 2025-12-12 12:32:10 +02:00
Paul Chote
2b6977d53f Remove legacy SpriteSequenceLoader metadata plumbing. 2025-12-12 12:32:10 +02:00
Paul Chote
a04cfaec78 Move GlobalModData state to ModData. 2025-12-12 12:32:10 +02:00
Paul Chote
13313b4270 Finish removing GraphicSettings.SheetSize/BatchSize. 2025-12-12 12:32:10 +02:00
Paul Chote
7175e9062d Initialize mod using its manifest. 2025-12-12 12:32:10 +02:00
Paul Chote
94177848a8 Remove CursorProvider. 2025-12-12 12:32:10 +02:00
RoosterDragon
9e548fd0f0 Freeze non-mutable readonly static dictionaries.
Since these will live for the lifetime of the process, it is worth freezing them on creation to improve lookup performance. If the dictionaries were iterated, change to an immutable array instead to preserve the order.
2025-12-12 09:51:27 +02:00
Gustas
f4eb5739d6 Fix PauseShellmap not pausing 2025-12-10 21:42:34 +00:00
Paul Chote
637d8689f5 Fix invalid cast. 2025-12-08 21:37:57 +02:00
Gustas
a3ee6645c1 Fix units being picked up when they no longer want it 2025-12-08 18:04:01 +00:00
RoosterDragon
649e7e8c28 Change classes that use FieldLoader to use read-only collections. 2025-12-08 17:39:28 +00:00
RoosterDragon
797c71e500 Add FieldLoader/Saver support for ImmutableArray, FrozenSet, FrozenDictionary.
As config is often meant to be loaded and then never modified, it is helpful to support collections that are read-only after creation. This allows various classes that load config from YAML and elsewhere to deserialize straight into read-only collections and enforce invariants around data mutation.
2025-12-08 17:39:28 +00:00
Gustas
e53f2b6044 Fix templete palette overwrites not working 2025-12-08 17:32:05 +00:00
Gustas
2b2e2d6fe3 Fix itch integration ruining commander's name 2025-12-06 14:05:09 +02:00
Gustas
027e38ee69 Handle race conditions and manage package ownership 2025-12-05 18:17:15 +02:00
Gustas
9e926b0f53 Fix large dropdowns overlapping 2025-12-05 18:17:15 +02:00
Gustas
f9bce6252c Don't generate maps when not needed 2025-12-05 18:17:15 +02:00