Commit Graph

6681 Commits

Author SHA1 Message Date
Eduardo Cáceres
aed2b8afae Remove unnecessarily interpolated strings 2022-05-18 11:42:36 -05:00
Eduardo Cáceres
7eb64ea6fc Use read-only autoimplemented property when possible 2022-05-18 11:42:36 -05:00
Eduardo Cáceres
79f321cb44 .Any(), .Count() -> .Count or .Length 2022-05-18 11:42:36 -05:00
abcdefg30
581b5cfacf Resolve an IDE0017 warning in ImportLegacyMapCommand 2022-05-11 15:33:23 +02:00
Ivaylo Draganov
6a1a6b6397 Add platform override support for hotkeys and unhardcode editor hotkeys 2022-05-07 20:55:49 +01:00
Ivaylo Draganov
f0e69c3f64 Add hotkey filtering functionality (by name and by context) 2022-05-03 22:22:55 +02:00
RoosterDragon
714b38c97c Add CellCostChanged event to Locomotor.
This event allows subscribers to be made aware when the terrain costs for a cell change.
2022-04-30 15:56:04 +02:00
Ivaylo Draganov
24b9482cc1 Add support for transient text notifications matching speech notifications 2022-04-30 12:39:29 +01:00
Ivaylo Draganov
9f723be65a Add checkbox to settings for toggling transient notifications 2022-04-30 12:39:29 +01:00
Ivaylo Draganov
a1e6ac85dc Add transient notifications pool 2022-04-30 12:39:29 +01:00
RoosterDragon
e22b6de4e8 Rename PathGraph to MapPathGraph.
Move PathCostForInvalidPath and MovementCostForUnreachableCell constants into a new static class, PathGraph.
2022-04-27 23:19:59 +02:00
RoosterDragon
a1a583ea0a Split out a base class for PathGraph.
Move the domain logic involved into a base class named DensePathGraph. The base class contains all the domain logic necessary to traverse a graph including concepts such as custom movement layer.

PathGraph becomes responsible for proving a backing array for the pathfinding information, and is where the pooling logic lives instead, helping split the two concepts out.
2022-04-27 23:19:59 +02:00
penev92
86515610a5 Made all projectile and warhead fields readonly
This came up while working on the new documentation generation and comparing the results to ORAIDE's own code parser.
2022-04-26 22:37:12 +02:00
penev92
2bac492a65 Made all traitInfo fields readonly
This came up while working on the new documentation generation and comparing the results to ORAIDE's own code parser.
2022-04-26 22:37:12 +02:00
Gustas
135823fced fix crash when non-host exits map chooser 2022-04-25 23:03:27 +02:00
RoosterDragon
3e5666ca53 Return an empty path when a search with no locations is made.
The restores the previous behaviour before FindUnitPathToTargetCell was introduced. This prevents callers such as the harvester code crashing when a harvester tries to route home to a refinery, but there are no refineries.
2022-04-24 12:52:18 +02:00
RoosterDragon
7df39f3522 On Locomotor initialization, update blocked cells.
Prior to ef44c31a72eab61a597cf539ee4b138e94b254fe, Locomotor would be earlier in the trait initialization sequence than SpawnMapActors. Locomotor would assume no actors on the map, and register to update blocked cells when new ones were added. When SpawnMapActors created actors, Locomotor was made aware and kept up-to-date.

After this commit, the initialization sequence was perturbed and SpawnMapActors would initialize first. Locomotor would assume no actors on the map and thus be unaware of these starting units, meaning those starting units would not cause blocking, allowing units to pass through them.

There are two possible fixes. SpawnMapActorsInfo can initialize NotBefore<LocomotorInfo>, enforcing that actors are spawned after locomotor is ready. Or we can remove the assumption in Locomotor that the map starts empty, and have it update blocked cells on startup. The latter seems cleaner, so any other traits that may want to spawn actors don't have to be aware sequencing their initialization with the Locomotor trait, instead things would "just work".
2022-04-24 12:48:52 +02:00
Matthias Mailänder
4c08e449e0 Fix master server respond not being localized. 2022-04-23 22:29:40 +01:00
Paul Chote
0dbd8264b8 Handle exceptions thrown by HttpClient.GetAsync. 2022-04-23 22:44:05 +02:00
RoosterDragon
d2935672ca Fix the shape of the IPathFinder interface, ensure all path searches use it.
Some path searches, using PathSearch, were created directly at the callsite rather than using the pathfinder trait. This means some searches did not not benefit from the performance checks done in the pathfinder trait. It also means the pathfinder trait was not responsible for all pathing done in the game. Fix this with the following changes:
- Create a sensible shape for the IPathFinder interface and promote it to a trait interface, allowing theoretical replacements of the implementation. Ensure none of the concrete classes in OpenRA.Mods.Common.Pathfinder are exposed in the interface to ensure this is possible.
- Update the PathFinder class to implement the interface, and update several callsites manually running pathfinding code to instead call the IPathFinder interface.
- Overall, this allows any implementation of the IPathFinder interface to intercept and control all path searching performed by the game. Previously some searches would not have used it, and no alternate implementations were possible as the existing implementation was hardcoded into the interface shape.

Additionally:
- Move the responsibility of finding paths on completed path searches from pathfinder to path search, which is a more sensible location.
- Clean up the pathfinder pre-search optimizations.
2022-04-18 11:18:43 +01:00
RoosterDragon
2583a7af31 After NotBefore<> support to control initialization order.
Requires<T> means that trait of type T will be initialized first, and asserts that at least one exists. The new NotBefore<T> means that trait of type T will be initialized first, but allows no traits.

This allows traits to control initialization order for optional dependencies. They want to be initialized second so they can rely on the dependencies having been initialized. But if the dependencies are optional then to not throw if none are present.

We apply this to Locomotor which was previously using AddFrameEndTask to work around trait order initialization. This improves the user experience as the initialization is applied whilst the loading screen is still visible, rather than the game starting and creating jank by performing initialization on the first tick.
2022-04-18 10:31:47 +01:00
Matthias Mailänder
648c56bca1 Don't crash when joining a game after asset installation. 2022-04-17 00:27:36 +03:00
Mustafa Alperen Seki
30f14dcc4c Fix Army Spectator tab not using FactionImages. 2022-04-15 18:17:49 +02:00
RoosterDragon
ac0969d688 Use nameof instead of hardcoded strings in reflection calls.
This helps improve the safety of code the uses reflection when methods may get renamed, and helps navigating code as the nameof will show up when searching for references to members.
2022-04-14 19:58:15 +02:00
Gustas
b254eb0f3d Add dynamic map refresh 2022-04-14 16:16:38 +02:00
Gustas
61df7974b0 Make the delete button not call MapCache every frame 2022-04-14 16:16:38 +02:00
Matthias Mailänder
af3362c62f Use string.Contains(char) instead of string.Contains(string)
with single characters
2022-04-13 20:09:57 +02:00
Matthias Mailänder
3bc28ba6e2 Use inline string replacement. 2022-04-13 20:09:57 +02:00
dnqbob
4f43b157a8 Add place variant building for BaseBuilderBotModule.
1. If it follow the refinery placing logic, then we can use Facings in PlaceBuildingVariants to help BaseBuilderBotModule "rotates" it to minefield.

2. If it is a normal building, BaseBuilderBotModule will place a random variant actor.
2022-04-12 22:28:03 +02:00
Mustafa Alperen Seki
c71af0e613 Make NukePower MissileImage optional. 2022-04-12 21:52:29 +02:00
Mustafa Alperen Seki
60b123c641 Split NukePower MissileImage from MissileWeapon. 2022-04-12 21:52:29 +02:00
Matthias Mailänder
0260884369 Added translation support for server orders. 2022-04-03 19:23:26 +02:00
Matthias Mailänder
ee95d2591f Code cleanup. 2022-04-03 19:23:26 +02:00
Matthias Mailänder
7735107deb Add a script trigger overlay. 2022-04-02 18:01:00 +02:00
Matthias Mailänder
0e7ad43425 Remove unused parameters. 2022-04-01 23:30:26 +02:00
abcdefg30
e685731b33 Add an update rule for the removal of AttackFrontal's FacingTolerance 2022-03-13 11:16:47 +01:00
abcdefg30
889425ab0f Remove AttackFrontal's FacingTolerance and define it explicitly in rules 2022-03-13 11:16:47 +01:00
dnqbob
9049ae6f20 Add a backawrd moving option for mobile 2022-03-13 10:46:04 +01:00
Matthias Mailänder
00356b8bbd Setup Tiberian Sun forest fires. 2022-03-12 17:16:43 +01:00
Mustafa Alperen Seki
b54a724aea Add ability to override CannotPlaceNotification per queue. 2022-03-12 12:55:41 +01:00
Matthias Mailänder
a6cb20a4ec Fix overlapping tracks when vehicle rotates.
Also optimize the function slightly.
2022-03-12 12:53:59 +01:00
Matthias Mailänder
5220da1bae This can never be null. 2022-03-12 12:53:59 +01:00
Mustafa Alperen Seki
2f1edd4516 Remove Replacable actors for LineBuild too. 2022-03-11 22:32:08 +01:00
Mustafa Alperen Seki
a7004b2db7 Check for placeablilty of LineBuild Segment instead of the Post. 2022-03-11 22:32:08 +01:00
Ivaylo Draganov
eadc8ad689 Change color of labels that correspond to disabled inputs
- Add a new widget type for input and extend it from other input widgets
- Add a new label type that can be linked to an input widget
- Change the label color when the input's disabled state changes
2022-03-07 21:01:33 +01:00
Mustafa Alperen Seki
0203476da9 Update variables for Flash lua function. 2022-03-05 15:19:01 +01:00
Mustafa Alperen Seki
7e4c3acda3 Fix ZRamp only allowing integer values. 2022-03-02 19:41:49 +01:00
darkademic
e082497a1a Corrected StartBurstReport sound synchronisation when used with FireDelay. 2022-02-26 10:40:19 -06:00
Matthias Mailänder
9605e5ad9c Use the new MiniYAML GitHub syntax. 2022-02-26 17:04:50 +01:00
Matthias Mailänder
da4fb27fca Use modern string syntax. 2022-02-26 17:04:50 +01:00