Commit Graph

1424 Commits

Author SHA1 Message Date
Eduardo Cáceres
a1811b4b04 Add fixed issues as warnings to .editorconfig 2022-05-18 11:42:36 -05:00
Eduardo Cáceres
8ced155ca3 Simplify 'always true' expressions
Co-authored-by: atlimit8 <atlimit8-vcs@gmx.com>
2022-05-18 11:42:36 -05:00
Eduardo Cáceres
aa998a46d9 Simplify collection initialization 2022-05-18 11:42:36 -05:00
Eduardo Cáceres
b71402f64d Convert extension in real extension 2022-05-18 11:42:36 -05:00
Eduardo Cáceres
2677e9c013 Use pattern matching 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
Ivaylo Draganov
24b9482cc1 Add support for transient text notifications matching speech notifications 2022-04-30 12:39:29 +01:00
Mustafa Alperen Seki
62e7c7a318 Make PortableChrono PausableConditional. 2022-04-17 12:14:50 +02:00
Mustafa Alperen Seki
9de8d8854d Pass PortableChrono instead of PortableChronoInfo to PortableChronoOrderGenerator. 2022-04-17 12:14:50 +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
Matthias Mailänder
0e7ad43425 Remove unused parameters. 2022-04-01 23:30:26 +02:00
RoosterDragon
ea243b8558 Fix crash in TSEditorResourceLayer when adding resources.
Ensure cells are within map bounds when checking if adjacent cells should be cleared during resource placement.
2022-03-26 23:07:41 +01:00
Mustafa Alperen Seki
91f626c42a Make WithVoxelWalkerBody PausableConditional. 2022-02-18 12:24:23 +01:00
RoosterDragon
d8a4d7fd1d Cache the global mix database in MixLoader
We can reuse this global database as it doesn't change, rather than loading a new copy each time a new mix file is parsed.
2022-02-11 14:05:55 +01:00
RoosterDragon
9cd55df584 Ensure editorconfig naming styles align with StyleCop SA13XX style rules.
Aligns the naming conventions defined in editorconfig (dotnet_naming_style, dotnet_naming_symbols, dotnet_naming_rule) which are reported under the IDE1006 rule with the existing StyleCop rules from the SA13XX range.

This ensures the two rulesets agree when rejecting and accepting naming conventions within the IDE, with a few edges cases where only one ruleset can enforce the convention. IDE1006 allows use to specify a naming convention for type parameters, const locals and protected readonly fields which SA13XX cannot enforce. Some StyleCop SA13XX rules such as SA1309 'Field names should not begin with underscore' are not possible to enforce with the naming rules of IDE1006.

Therefore we enable the IDE1006 as a build time warning to enforce conventions and extend them. We disable SA13XX rules that can now be covered by IDE1006 to avoid double-reporting but leave the remaining SA13XX rules that cover additional cases enabled.

We also re-enable the SA1311 rule convention but enforce it via IDE1006, requiring some violations to be fixed or duplication of existing suppressions. Most violations fixes are trivial renames with the following exception. In ActorInitializer.cs, we prefer to make the fields private instead. ValueActorInit provides a publicly accessible property for access and OwnerInit provides a publicly accessible method. Health.cs is adjusted to access the property base instead when overriding. The reflection calls must be adjusted to target the base class specifically, as searching for a private field from the derived class will fail to locate it on the base class.

Unused suppressions were removed.
2022-02-07 19:14:45 +01:00
Ivaylo Draganov
7a93b9ea8c Make control group hotkeys configurable
- Split control groups management to its own interface
- Add hotkeys for selecting, creating, adding to and combining with control groups
- Add a ControlGroups widget to manage the player interaction
2022-01-28 18:38:18 +01:00
penev92
ab09ce21b4 Changed code to use object initializers everywhere 2022-01-23 13:14:57 +01:00
penev92
bf332b6619 Fixed fields missing the readonly modifier 2022-01-22 18:47:06 +00:00
penev92
0d24ccc47a Fixed unnecessary zero-length array allocations
Changed all currently present zero-length array allocations in the codebase to use `Array.Empty` instead.
2022-01-20 22:10:28 +01:00
penev92
860ec642b8 Addressed review comments
- Renamed `IVideo.CurrentFrameNumber` to `CurrentFrameIndex`
 - Improved logged error message in VideoPlayerWidget
 - Renumbered fields in ThreadedGraphicsContext
2022-01-11 18:16:31 +01:00
penev92
248b8d1102 Renamed IVideo implementations
To match the interface they are implementing.
2022-01-11 18:16:31 +01:00
penev92
cb8530fbae Reworked internal palettes in video reader classes
This removes the need to pack & unpack color bytes as uints for no gain.
2022-01-11 18:16:31 +01:00
penev92
c4ab7041b8 Updated VideoPlayerWidget to play new IVideo data
Added optional padding to video frames because that's what VideoPlayerWidget expects.
Keeping the option to not use padding for other use-cases like converting frames to PNG.
2022-01-11 18:16:31 +01:00
penev92
ee29d0f9c7 Changed IVideo.CurrentFrameData uint[,] -> byte[] 2022-01-11 18:16:31 +01:00
penev92
1b5f2f1b39 Removed caching properties from video readers
Those seem redundant since the frame number is guaranteed to match the loaded data inside CurrentFrameData.
2022-01-11 18:16:31 +01:00
penev92
0df3b34c52 Did a beautification pass on IVideo and family
Removed property backing fields where applicable, introduced C#7 syntax for properties.
Renamed a bunch of interface properties and class private members with more descriptive names.
Did some inconsequential reordering.
2022-01-11 18:16:31 +01:00
penev92
87b92b53a4 Reworked ISoundFormat.LengthInSeconds implementations 2022-01-09 18:40:32 +01:00
penev92
abea3a0f74 Fixed AudFormat and WavFormat implementations of ISoundFormat.LengthInSeconds
- Fixed a rounding issue in `WavReader.WaveLength()`.
- Fixed `AudReader.SoundLength()` not resetting the stream position.
- Fixed crashes caused by disposed streams because `LengthInSeconds` would try and calculate the length on the fly. It is now precalculated and cached (making it consistent across all 5 current `ISoundFormat` implementations).
- Fixed a crash in `AudReader.LoadSound()`'s `out Func<Stream> result` because that func would try and access the disposed stream's `Length` property. That works for `SegmentStream`, but not for `FileStream`.
- Fixed frameCount/soundLength label positioning in the AssetBrowser window to avoid text clipping .
2022-01-09 18:40:32 +01:00
Matthias Mailänder
9d905d8291 Remove unused parameters and variables. 2021-12-06 13:19:28 +01:00
Matthias Mailänder
07815143f1 Fix CA1825 warnings on empty array initialisation. 2021-12-06 13:19:28 +01:00
RoosterDragon
727084c5fc Run spell check over solution 2021-12-05 19:23:43 +01:00
abcdefg30
9916e4c4ac Fix a crash in the TSEditorResourceLayer neighbour validation 2021-11-11 15:09:24 +01:00
abcdefg30
31cec0c17f Fix a crash in the TSResourceLayer neighbour validation 2021-11-11 15:09:24 +01:00
RoosterDragon
3bee524c6b Avoid allocation in PackageEntry.HashFilename
This is a very frequently called method during loading, and taking some care to avoid allocations improves performance noticeably.
2021-10-24 21:40:01 +02:00
penev92
f056cbba13 Added a bunch of TraitLocationAttributes
Also moved a few traits to their proper subfolders.
2021-10-16 20:52:50 +02:00
penev92
8ba6d13b2f Removed unused using directives 2021-10-15 13:12:33 +02:00
Zimmermann Gyula
a13d046304 Add twinkle effects to the gems. 2021-10-02 20:17:03 +02:00
Matthias Mailänder
a2a668077c Refactor RandomDelay:
Allow different types of random
and reflect other use cases by renaming.
2021-10-02 20:17:03 +02:00
Paul Chote
7f94d67d39 Replace Map.CustomTerrain radar colors with IRadarTerrainLayer.
* TSVeinsRenderer now shows border cells on the radar
* BuildableTerrainLayer now uses the radar colors defined on the individual tiles
* CliffBackImpassabilityLayer no longer overrides the underlying terrain color.
2021-08-21 14:16:02 +02:00
Paul Chote
a9c6430924 Fix TS map importer:
- Fix infantry subcells and facing
- Import sandbags/walls.
2021-08-20 20:17:55 +02:00
Matthias Mailänder
f1f5df3749 Fix .shp icons being misdetected as .wsa animations. 2021-07-12 11:49:06 +02:00
Matthias Mailänder
af0b7621d2 Minor fixes. 2021-07-12 00:35:16 +02:00
Andre Mohren
6810469634 Updated copyright years. 2021-06-29 18:33:21 -05:00
tjk-ws
a893cf9cb6 Unhardcode weapon ammo consumption
fix gh actions
2021-06-11 10:21:24 -05:00
Paul Chote
98caae106f Move Palette traits to their own directory.
Also adds missing TraitLocation definitions.
2021-05-15 15:29:46 +02:00
Paul Chote
4042d5b179 Preserve original brightness when remapping player colors. 2021-05-15 15:29:46 +02:00
teinarss
10676be377 Replace F extension with string interpolation 2021-05-08 22:20:59 +02:00
reaperrr
e3fd54e147 Replace * 25 in internal tick defaults with actual total
While the idea behind it is understandable,
this was inconsistent with the bulk of other defaults.
2021-04-19 20:03:08 +02:00
CrazyAlex25
2d05e10819 Modify build properties 2021-04-12 00:44:17 +02:00