Commit Graph

30265 Commits

Author SHA1 Message Date
michaeldgg2
507cdf1256 Fix ProductionTabsWidget not picking up ProductionQueue getting enabled/disabled during its lifetime 2024-09-19 18:10:07 +02:00
tjk-ws
b5b16df9e0 Fix parallel queues not pausing production when more than one item is queued 2024-09-19 18:07:02 +02:00
Gustas
0e438dd508 Automated fixup 2024-09-19 17:53:43 +02:00
Gustas
b0899d0ee4 Added RenameOnDeath update rule 2024-09-19 17:53:43 +02:00
Gustas
9c60ac23a3 Rename ThrowsShrapnel to FireProjectilesOnDeath 2024-09-19 17:53:43 +02:00
Gustas
c050b211eb Rename Explodes to FireWarheadsOnDeath 2024-09-19 17:53:43 +02:00
Gustas
29c4aebe19 Add missing descriptions to AirstrikePower and ParatroopersPower 2024-09-19 17:53:43 +02:00
RoosterDragon
87aa7c11c5 Provide buffer size in ShpRemasteredSprite.
As the expected size is quite small here, providing an explicit buffer size helps as otherwise default buffers for 1024 characters are allocated by the StreamReader which must be cleaned up by the GC afterwards. These smaller buffers still need cleanup but waste less memory.
2024-09-18 12:32:44 +03:00
RoosterDragon
ab50182c92 Change ActorIndex to work in terms of TraitInfo, instead of Trait.
This allows actor.Info.HasTraitInfo to be used when checking if an actor needs to be added to the index, which is a cheaper call than actor.TraitsImplementing.
2024-09-18 12:29:28 +03:00
Matthias Mailänder
327c1ba23b Adapt to upcoming environment special folder change. 2024-09-17 23:11:27 +02:00
Matthias Mailänder
2aa37d9392 Adapt to upcoming environment special folder change. 2024-09-16 19:50:06 +03:00
Gustas
b09c4f3770 Polish up UI 2024-09-16 12:00:41 +01:00
Gustas
251680056d Rename selection tab 2024-09-16 12:00:41 +01:00
Gustas
e9eb0da2b3 Improve map editor Copy-Paste tooltip 2024-09-16 12:00:41 +01:00
Gustas
e2b26754fe Fix switching tabs not yielding keyboard focus
And some extra polish
2024-09-16 12:00:41 +01:00
Gustas
87850378c7 Make brush rendering self-contained 2024-09-16 12:00:41 +01:00
Gustas
b073155018 Polish map editor code 2024-09-16 12:00:41 +01:00
RoosterDragon
7775b42b59 Change constructOrderCache to an array. 2024-09-15 22:02:14 +03:00
Gustas
a9e5744a37 Fix opening up skirmish menu making it impossible to leave map editor 2024-09-15 20:05:42 +02:00
RoosterDragon
b3b82b97ea Teach ConvertSpriteToPngCommand to handle frames that extend outside FrameSize.
The rectangle defined by a frames's Offset+Size usually fits within the rectangle given by FrameSize. However it can sometimes extend outside this region due to padding added by the engine. This causes an array-out-of-bounds crash as we only allocate space to cover the FrameSize region.

Now, we teach the copying process to only copy the portion of the data that lies within the FrameSize region. If any data extends outside the region, it won't be copied.
2024-09-15 20:00:32 +02:00
michaeldgg2
2612e7f297 Update Production's Faction when its owner changes 2024-09-14 17:44:02 +03:00
Gustas
c39d10b780 Fix AddMarkerLayerOverlay update rule 2024-09-13 19:08:08 +02:00
Gustas
f21572d22a Fix DynamicFacingInit not being dynamic 2024-09-13 19:04:38 +02:00
Gustas
ab6dc5db32 Fix OrderManager being deleted in map editor 2024-09-13 00:31:40 +02:00
Gustas
b070c0818f Add sounds on joining and leaving skirmish menu 2024-09-08 16:41:22 +02:00
Gustas
ec4449f092 Fixed load-game menu staying open for too long 2024-09-08 16:31:13 +02:00
Matthias Mailänder
5d7a24d5d0 Fix namespace. 2024-09-01 22:31:35 +02:00
Matthias Mailänder
41f28f2519 Guard the trait lookup. 2024-08-31 09:47:33 +03:00
Matthias Mailänder
25dd0508c2 Remove unused movement class bit set. 2024-08-30 21:04:35 +02:00
test1232156
a79b449fb2 Fixup D2K Encyclopedia
Co-Authored-By: Gustas <37534529+punkpun@users.noreply.github.com>
2024-08-30 19:24:43 +02:00
Gustas
56fabb4561 Deduplicate the back button 2024-08-30 19:24:43 +02:00
JovialFeline
bdce0570bd Remove IRON offset from RA1 map imports 2024-08-29 21:26:35 +03:00
Paul Chote
0a7e802d4b Fix TFD asset installation. 2024-08-29 21:22:11 +03:00
RoosterDragon
dd9aca83dd Expose the default font and cursor sheet size settings to mod.yaml 2024-08-27 19:25:07 +03:00
RoosterDragon
32bc99a11a Restored missing IDisposable to CursorManager. 2024-08-27 19:25:07 +03:00
RoosterDragon
1218ca09ae Use a smaller sheet in CursorManager.
Provide an explicit size of 512, smaller than the default 2048. The cursors for all mods still pack onto this single sheet, so we avoid wasting memory on larger sheets.

Sorting the cursors also helps pack them onto the sheets more efficiently.
2024-08-27 19:25:07 +03:00
RoosterDragon
db2cf125f8 Update Pfim to 0.11.3.
This version reduces memory allocation necessary to decode images.
2024-08-26 16:43:52 +03:00
Orb370
f090f1a02b TD Encyclopedia
Co-Authored-By: Gustas <37534529+punkpun@users.noreply.github.com>
Co-Authored-By: test1232156 <126501603+test1232156@users.noreply.github.com>
2024-08-25 21:18:02 +02:00
test1232156
536ffb3f31 Fix spelling errors and add naming consistency to translation keys
Co-Authored-By: Gustas <37534529+punkpun@users.noreply.github.com>
2024-08-20 17:34:09 +02:00
test1232156
c124684197 Fix chrome typos 2024-08-20 17:34:09 +02:00
RoosterDragon
0c4dff77c9 Fix moves being reported as blocked when already at the destination.
When a move is made where the source and target locations are the same and no actual moving is required, a path of length 0 is returned. When a move cannot be made as there is no valid route, a path of length 0 is also returned. This means Move is unable to tell the difference between no movement required, and no path is possible. Currently it will hit the `hadNoPath` case and report CompleteDestinationBlocked.

To fix the scenario where the source and target location match, track a alreadyAtDestination field. When this scenario triggers, report CompleteDestinationReached instead.

This fixes activities that were using this result to inform their next actions. e.g. MoveOntoAndTurn would previously cancel the Turn portion of the activity, believing that the destination could not be reached. Now, it knows the destination was reached (since we are already there!) and will perform the turn.
2024-08-19 14:33:38 +03:00
RoosterDragon
8101c70c91 Allow sheet buffers to be reused in SheetBuilder.
Sheets can be buffered - where a copy of their data is kept in RAM. This allows for modifications to the sheet to be batched in the RAM buffer, before later being committed to VRAM in a single operation. The SheetBuilder class allows for sprites to be allocated onto one or more sheets. Each time a sheet is filled, it will allocate a new sheet. Sheets allocated by the sheet builder will typically use the buffering mechanism.

Previously each time the builder allocated a new sheet, the buffer would get thrown away, and the next sheet would allocate a fresh buffer. These buffers can be large and may accumulate before the GC cleans them up. So although only one buffer will be live at a time, they can cause a spike in memory used by the process during loading.

We can avoid this issue by allowing the buffer from the previous sheet to be reused by the next sheet. This is possible because the sheet builder only has one live sheet for modifications at a time, and they are all the same type and size. By allocating only one buffer per builder instead of one per sheet, we reduce the peak memory required during loading.
2024-08-19 14:08:04 +03:00
RoosterDragon
7f05227e56 Remove some unrequired Sheet.CreateBuffer or Sheet.ReleaseBuffer calls.
- In CursorManager, we can release the buffer on the final sheet after loading cursors. We don't need to release the buffer on every sheet in the builder, as the builder will handle that.
- In SpriteCache, we don't need to call CreateBuffer explicitly, as the builder will do that for us.
- In RadarWidget, we don't need to call CreateBuffer explicitly, as GetData will do that for us.
2024-08-19 14:08:04 +03:00
RoosterDragon
323204014c Flush logs when crashing.
When the process is running, we use a finally block to call Log.Dispose and flush any outstanding logs to disk before the process exits. This works when we handle any exception in a matching catch block.

When the exception is unhandled, then the finally block will not run and instead the process will just exit. To fix this, flush the logs inside a catch block instead before rethrowing the error. This ensures we get logs even when crashing.
2024-08-16 17:49:35 +03:00
RoosterDragon
8a56e14d7a Allow SpawnStartingUnits to have an immovable BaseActor
Fixes a regression from 2c435c0506 - where the support actors must be able to path to the base actor in order to prevent them from spawning in isolated areas. If the base actor is immovable, they cannot path onto it because the base actor blocks them, so no support actors will spawn.

Fix this by allowing the support actors to path back to any cell adjacent to an immovable base actor, rather than requiring them to be able to path to its location directly.
2024-08-16 17:38:17 +03:00
David Wilson
77eba309b2 Fix sizing of exported ts/ra/d2k glyphs-3x.png and cnc chrome-3x.png from ArtSrc 2024-08-15 19:44:15 +03:00
RoosterDragon
a2edc82b0c Fix tooltips in the Encyclopedia.
If multiple tooltips are defined with conditionals attached, the Encyclopedia could not handle this. Now, it selects the tooltip EnabledByDefault to match usage across the rest of the code.
2024-08-13 23:10:46 +02:00
JovialFeline
00203201f4 Lock starting units in Fort Lonestar & Oil Spill 2024-08-11 15:59:38 +02:00
Matthias Mailänder
c779f4de8d Update macOS runner. 2024-08-11 12:38:53 +03:00
Matthias Mailänder
fc8c533129 Fix click through for disabled command bar buttons. 2024-08-11 12:33:20 +03:00