Commit Graph

12694 Commits

Author SHA1 Message Date
RoosterDragon
b733465f33 General uncontroversial cleanup:
- Made private methods static where possible (runtime can elide checking the object for null).
- Declared attribute classes as sealed (allows reflection on attributes to complete faster).
- Moved some static cctor's into field initializers (static cctor's are slower than static field initializers).
- Made classes static if they contained only static methods (can't create instances of useless objects).
- Use inferable Exts.Lazy and not new Lazy<T>().
- Added required STAThread attribute to CrashDialog.
- Removed unused parameters in private methods.
- Added Serializable attribute to exceptions.
- Added parameter name in calls to ArgumentNullException.
- Use of as operator instead of is + cast.
- Changed (x as Foo).Bar anti-pattern into ((Foo)x).Bar. Results in sensible cast exceptions on error rather than null dereferences.
- Removed unused method in NullShader.
2014-05-23 15:50:54 +01:00
Paul Chote
db08357e36 Merge pull request #5215 from pavlos256/replay-meta
Replay meta
2014-05-23 11:30:12 +12:00
reaperrr
a5eb398840 Merge pull request #5379 from Mailaender/alpha-lamb
Added the Tiberian Sun light post
2014-05-22 21:20:48 +02:00
Pavlos Touboulidis
b8bbd55598 Misc changes
* Use Pair instead of KeyValuePair
* double -> var
* Butcher XML comments
* Change WinState default to Undefined and use it instead of the new GameOutcome
* Other changes
2014-05-22 21:57:07 +03:00
Pavlos Touboulidis
fe1eb1f3e0 Use the stream extensions instead of the BinaryReader/Writer 2014-05-22 21:54:15 +03:00
Pavlos Touboulidis
39cc4cc014 Use "debug" channel to report loading exceptions 2014-05-22 21:54:15 +03:00
Pavlos Touboulidis
38a5e326f6 Fix crash when trying to read empty replay files
It was crashing because it tried to seek 8 bytes before the end
of a file that was empty (zero length).

I also added a few more checks and another try/catch to prevent
any more crashes related to damaged files.
2014-05-22 21:54:15 +03:00
Pavlos Touboulidis
f4c52eefae Change date labels
Change "Last Week" to "Last 7 days" and "Last Month" to "Last 30 days".
Also added a "Last 14 days" option.
2014-05-22 21:54:15 +03:00
Pavlos Touboulidis
de0a5ebd43 Improve replay metadata and the replay browser
List of changes:

* Better and more filters with new layout, for both mods.

* Rename/Delete/Detele all functionality.

* Simplified ReplayMetadata class considerably by introducing a new
GameInformation data object. The new GameInformation class contains
more information than previously available so the new solution is not
compatible with old replays, meaning it can't read old replays.

* Better and cleaner game information gathering in order to be written
at the end of the replay file.

* Revert changes to ReplayConnection, no longer necessary.

* Better exception message on missing sprites and fonts.

* New "SpawnOccupant" class that holds all the information needed by the
MapPreviewWidget to visualize a spawn point. It was using Session.Client
before and it was necessary to separate it to be able to show information
not available at lobby time.

* Fix keyboard focus UI bug when closing a window would not remove focus.
2014-05-22 21:54:14 +03:00
Pavlos Touboulidis
042910bd5e New common dialog: TextInputPrompt to get a string from the user
For both ra and cnc
2014-05-22 21:54:14 +03:00
Pavlos Touboulidis
713141cf4d Support for input validation on TextFieldWidgets
See OnTextEdited(), IsValid(), TextColorInvalid (with the default in metrics.yaml).
2014-05-22 21:54:14 +03:00
Pavlos Touboulidis
ce8c42b552 Style & nit fixes 2014-05-22 21:54:14 +03:00
Pavlos Touboulidis
a80c4f086a Add filters to the replay browser dialog
This closes issue #2152. The filters added are:

* Game type (singleplayer / multiplayer)
* Date
* Duration
* Outcome
* Player name

Other changes:

* Added a 'CollapseHiddenChildren' option to the ScrollPanelWidget to
make hidden children take up no space.
* Removed the extension (.rep) from the replay filenames in the
replay browser.
2014-05-22 21:54:14 +03:00
Pavlos Touboulidis
98a05b61b3 Add metadata block to replays
The replay files are just streams all network communication so to
get any info out of them it is necessary to play back the stream
until the wanted information is reached.

This introduces a new metadata block placed at the end of the
replay files and logic to read the new block, or fall back to
playing back the stream for older files.

The replay browser is also updated to use the metadata information
instead of reading the replay stream directly.
2014-05-22 21:54:14 +03:00
Matthias Mailänder
20a441a1f4 add the Tiberian Sun light post 2014-05-22 14:59:43 +02:00
Paul Chote
4454c0c2f8 Merge pull request #5372 from Mailaender/desert-tree-exclude
Fixed temperat trees showing up in the Tiberian Dawn DESERT tileset
2014-05-23 00:57:27 +12:00
Paul Chote
d252d1cf18 Merge pull request #5366 from Mailaender/rpmlint-duplicates
Removed duplicates identified by RPMlint
2014-05-23 00:56:01 +12:00
Matthias Mailänder
4eaeff8ccb Merge pull request #5393 from pchote/palettehax
Support per-animation palettes in RenderSprites.
2014-05-22 14:54:39 +02:00
Paul Chote
892f3c834c Merge pull request #5365 from Mailaender/tools-shortcuts
Separated tools and /usr/bin shortcuts
2014-05-23 00:53:42 +12:00
Paul Chote
ab1ce4554d Fix star port and repair depot lights. 2014-05-23 00:37:21 +12:00
Paul Chote
8e18e34a8b Fix D2K construction yard overlays. 2014-05-23 00:37:20 +12:00
Paul Chote
46a7c9c469 Add custom palette support to With*Overlay. 2014-05-23 00:37:20 +12:00
Paul Chote
900f5bffb5 Change Bib to use RenderSprites. 2014-05-23 00:37:20 +12:00
Paul Chote
4c92c5da99 Support per-animation palettes. 2014-05-23 00:37:20 +12:00
Paul Chote
15f63fb5ea RenderSprites.anims is finally private.
Followup to #3348.
2014-05-23 00:37:20 +12:00
Paul Chote
4aa7376994 Add wrappers for RenderSprites anims dictionary. 2014-05-22 23:35:10 +12:00
Paul Chote
475aa93271 Merge pull request #5373 from Mailaender/repair-overlay
Added the Dune 2000 repair depot active overlay
2014-05-22 23:29:53 +12:00
Paul Chote
2b5667d5b0 Merge pull request #5376 from Mailaender/airdrop-overlay
Added the Dune 2000 starport lights
2014-05-22 23:27:32 +12:00
Matthias Mailänder
ecf199560a Merge pull request #5392 from reaperrr/levelup-palette
Adds separate LevelUpPalette to GainsExperience
2014-05-22 13:19:14 +02:00
reaperrr
61edd6bc89 Adds separate LevelUpPalette to GainsExperience.
Needed for TS mod, as TS veteran crate effect anim uses a different palette than the rank chevrons.
2014-05-22 13:01:35 +02:00
Matthias Mailänder
e80eb7e0ee Merge pull request #5353 from pchote/map-validation
Disable maps with invalid rules
2014-05-22 09:55:06 +02:00
Matthias Mailänder
6081a4f16b Merge pull request #5390 from Squiggles211/hpad_reserved
Fixes #4955 aircraft reservation crash
2014-05-22 09:50:08 +02:00
Matthias Mailänder
7fad385d8c Merge pull request #5381 from Squiggles211/bridge_targeting
Lower BridgeHut Selectable Priority
2014-05-22 09:09:59 +02:00
Squiggles211
0e4b1d28aa Fixes #4955 aircraft reservation crash
Fixes the specific cause of the crash reported in #4955 with HeliReturn
and adds an UnReserve call while attempting to reserve spawn building in
Aircraft.cs
2014-05-22 01:38:08 -05:00
Paul Chote
a040abd539 Merge pull request #5389 from pavlos256/preload-sequences
Preload sequences
2014-05-22 17:45:38 +12:00
Pavlos Touboulidis
531338a955 Preload sequences and fix #5382 2014-05-22 03:45:28 +03:00
Pavlos Touboulidis
df0d1360dd Give PerfTimer the ability to write only slow operations to the log
This is useful to ignore fast operations that just spam the log.

The class had to be reworked because it couldn't properly handle cases
where all of a node's children where below the threshold.

Also changed DoTimed() and RunActivity() to use PerfTimer.
2014-05-22 03:40:36 +03:00
Paul Chote
df7e82ee96 Merge pull request #5388 from reaperrr/shp-fixes
Various RA/TD mod shp fixes
2014-05-22 11:09:00 +12:00
reaperrr
a8cf41dba3 Compressed/re-compressed cnc mod shps. 2014-05-21 22:35:03 +02:00
reaperrr
40baf8e450 Compressed some more uncompressed shps in ra bits folder. 2014-05-21 21:51:50 +02:00
reaperrr
e01596034b Minor shp fixes.
Removed green pixels from mine.int, fixed a few non-remapable red pixels on afldidle.shp.
2014-05-21 21:50:34 +02:00
Matthias Mailänder
ad2ee2e75f Merge pull request #5385 from reaperrr/sniper-fix
Replaces uncompressed sniper.shp with a  XCC-Mixer-compressed version
2014-05-21 19:50:48 +02:00
Matthias Mailänder
daa58e150b Merge pull request #5367 from psydev/mapfix
Updated 2 of psydev's recent TD maps -- minor fixes
2014-05-21 19:27:36 +02:00
reaperrr
ada6df279b Replaces uncompressed sniper.shp with a XCC-Mixer-compressed version. 2014-05-21 18:26:56 +02:00
Psydev
ab7a3bd986 updated pirates & emperors - no TEMPERAT trees
All trees are from the original C&C Desert tileset. Made a few tiny
changes to layout as a result.

The dense tree/cactus/rock areas near the bases have been thinned out
slightly.
2014-05-21 03:55:35 -07:00
Squiggles211
099d2a5400 Lower BridgeHut Selectable Priority
Fixes #4738 where player was unable unable to attack units/buildings that
are next to or on a bridge.
2014-05-21 00:40:48 -05:00
Chris Forbes
65c990c274 Merge pull request #5380 from pavlos256/strategic-replay-crash
Fix strategic map replay exception
2014-05-21 16:32:10 +12:00
Pavlos Touboulidis
b38542643d Fix strategic map replay exception 2014-05-21 00:57:21 +03:00
Matthias Mailänder
d80edcd4e8 add Tiberian Sun repair depot 2014-05-20 20:52:47 +02:00
Matthias Mailänder
5274776d55 add the Dune 2000 repair depot active overlay 2014-05-20 11:48:52 +02:00