Commit Graph

39406 Commits

Author SHA1 Message Date
ae71389ebe Ignore possible nulls from stream reader in IPC
Any failures will be caught. They're not logged, but they also weren't
before. Error handling can be improved at a future date, this series of
changes is primarily intending to unblock a new inspection.
2021-05-15 00:09:34 +02:00
d581e0a252 Ignore possible nulls in NotifyCollectionChangedArgs
Safe to access by the virtue of the preceding case labels on
`args.Action`.  And they're in test code anyways.
2021-05-15 00:09:34 +02:00
e62e473bb2 Ignore possible null in multiplayer test
A null value will fail the test anyhow.
2021-05-15 00:09:34 +02:00
b51d038088 Ignore possible path-related nulls
They're all in test code anyway, so any issue there will cause a test to
fail.
2021-05-15 00:09:34 +02:00
fa6b5515b7 Ignore possible null from JsonConvert.DeserializeObject()
Nothing better can be done if a `null` is indeed returned.
2021-05-15 00:09:34 +02:00
5b2b701915 Ignore possible null in GetResponseString()
A null there indicates a deserialisation error and therefore due to the
catch block immediately succeeding the changed line everything will
continue to work as intended.
2021-05-15 00:09:34 +02:00
628e7a71ed Ignore possible nulls in Type.GetType() calls
They're mostly used in extensibility scenarios, so everything happens in
runtime. There is no better resolution than to crash with a null
reference exception.
2021-05-15 00:09:34 +02:00
43c73f9583 Mark access to exception if task faulted as safe
There are seemingly no C#-side compile-time guarantees that it is safe,
but if the task's state is `Faulted` (as is checked right before), the
exception cannot be null as per the documentation.
2021-05-15 00:09:34 +02:00
f2d0f7db99 Remove list null-checks in LogoTrackingContainer test
If the null-checks were tripped, the test would crash anyway. It is not
possible to call `.Any()` and get a valid result instead of an exception
on a null reference.
2021-05-15 00:09:34 +02:00
483e0dd943 Pass placeholder hitobject instead of null 2021-05-15 00:09:34 +02:00
f716fb0968 Remove bogus InternalChildren null-check
`InternalChildren` can't viably be `null`, and if it were, we have
bigger problems. The removed null-check was triggering false-positive
inspections further down.
2021-05-15 00:09:34 +02:00
c9facf70f9 Use conditional nullability attribute
As it turns out, C# 8 provides an attribute that allows annotating that
an `out` parameter's nullability depends on the method's return value,
which is exactly what is desired here.
2021-05-15 00:09:34 +02:00
aaa7c7eb05 Handle null case explicitly in SpectatorState.Equals()
Uses the usual pattern of two `ReferenceEquals` checks against `this`
and `null` before proceeding to inspect field values. Doing this causes
the compiler to infer that at the point that field values are checked,
`other` can no longer viably be `null`.
2021-05-14 23:58:07 +02:00
044770f1a2 Locally suppress warning in SerializationReader
`SerializationReader` is not written in a form that would support
turning nullability checking on for the entire class. The biggest
problem there is the inner `DynamicDeserializer` static class, whose
members are initialised via an `initialize()` method, which the compiler
knows nothing about.

For this reason, just opt to suppress the single inspection about
returning a `null` from a method with a return type of `string` (rider
expects `string?`). It would have been also viable to enable nullability
checking for this one method, but that's pretty much the same thing and
adds no safety anyways, so just disable the warning to minimise
surprise.
2021-05-14 23:29:34 +02:00
b36c991ba1 Fix single case of incorrect usage 2021-05-14 12:04:38 +09:00
447371478e Switch null assignment to non-nullable warnings on 2021-05-14 12:03:06 +09:00
10f008ae62 Merge pull request #12780 from peppy/skin-blueprint-aspect-lock
Add aspect ratio locking and flip support to skin editor
2021-05-14 00:55:18 +09:00
6a64a705b8 Merge branch 'master' into skin-blueprint-aspect-lock 2021-05-13 17:53:00 +02:00
25b1443c50 Remove dead branch and mark implementation as temporary
The previous implementation was checking if the `x0` or `x2` anchors
were selected to decide on which way to transfer the drawable's scale,
but that check actually ends up being always true for corner anchors. To
visualise, this is how the corner anchors correspond to `Anchor` flags:

    x0  x1  x2
    |   |   |
y0 -O---O---O-
    |   |   |
y1 -O---+---O-
    |   |   |
y2 -O---O---O-
    |   |   |

The Os indicate where the reference anchors are on a selection box.
The first conditional eliminates the middle ones, which makes sense.
But after excluding them from further deliberations (marking via X):

    x0  x1  x2
    |   |   |
y0 -O---X---O-
    |   |   |
y1 -X---+---X-
    |   |   |
y2 -O---X---O-
    |   |   |

The remaining anchors always have `x0` or `x2` set. So to avoid
confusion, just always transfer one way for now. At some point this
should be torn out in favour of an actual implementation of the desired
behaviour.
2021-05-13 17:50:12 +02:00
879ef46354 Merge pull request #12765 from peppy/skin-blueprint-anchor-origin 2021-05-13 17:24:37 +02:00
0fa90a80d4 Merge branch 'master' into skin-blueprint-aspect-lock 2021-05-13 23:38:53 +09:00
3ecbb9ec4b Merge branch 'master' into skin-blueprint-anchor-origin 2021-05-13 23:38:04 +09:00
98830dadda Merge pull request #12762 from peppy/skin-blueprint-visual-improvements
Improve the visual appearance of skin editor blueprints
2021-05-13 23:37:21 +09:00
cef39eb4fa Merge pull request #12766 from peppy/stable-anchor-origin
Keep component positions stable when changing anchor/origin
2021-05-13 23:36:40 +09:00
caa3e1dca5 Merge pull request #12767 from peppy/save-on-forced-exit
Save skin editor changes on forced exit
2021-05-13 23:35:52 +09:00
4183a1c556 Merge pull request #12769 from peppy/remove-skinnable-hud-classes
Remove remaining test usage of SkinnableXXX HUD components
2021-05-13 22:56:18 +09:00
6c12cae105 Remove unnecessary property 2021-05-13 22:25:11 +09:00
c57a2f43fa Merge branch 'master' into skin-blueprint-visual-improvements 2021-05-13 22:22:42 +09:00
63fbbc848e Merge pull request #12778 from peppy/skin-editor-shortcut-fix
Change default skin editor shortcut to Ctrl+Shift+S
2021-05-13 22:14:03 +09:00
4cf4817ad2 Remove redundant parens 2021-05-13 22:11:58 +09:00
d2fdd1e521 Merge branch 'master' into stable-anchor-origin 2021-05-13 22:06:21 +09:00
67f795cfa6 Merge branch 'master' into save-on-forced-exit 2021-05-13 22:00:38 +09:00
1e23c53507 Fix inspection 2021-05-13 21:59:38 +09:00
c519e4f558 Merge pull request #12763 from peppy/skin-editor-default-placement-location
Give newly added skin components a centered location to make them easier to find
2021-05-13 21:42:02 +09:00
d5b14b6b99 Merge branch 'master' into remove-skinnable-hud-classes 2021-05-13 21:06:48 +09:00
1b62947469 Merge branch 'master' into skin-editor-default-placement-location 2021-05-13 20:58:31 +09:00
746862dcb1 Merge pull request #12750 from peppy/skin-serialisation
Add skin editor saving / loading support
2021-05-13 20:58:03 +09:00
ee67c0ddc7 Merge pull request #12768 from frenzibyte/fix-two-hovered-handles
Fix rotation handle visibility logic not handling two handles hovered at one point
2021-05-13 20:57:47 +09:00
3c471837f8 Merge branch 'master' into skin-serialisation 2021-05-13 19:49:55 +09:00
a3869c02f4 Merge branch 'master' into fix-two-hovered-handles 2021-05-13 19:24:42 +09:00
b939318922 Merge branch 'skin-serialisation' into skin-editor-default-placement-location 2021-05-13 19:09:34 +09:00
e5f765d1a8 Fix broken exception message 2021-05-13 19:06:58 +09:00
bda0ea463a Merge branch 'skin-serialisation' into save-on-forced-exit 2021-05-13 19:05:47 +09:00
c8b7cfc753 Merge branch 'skin-serialisation' into remove-skinnable-hud-classes 2021-05-13 19:05:08 +09:00
07e475cd13 Fix skin blueprint box drawing incorrectly when both scale and rotation are applied 2021-05-13 18:54:40 +09:00
2f025f1967 SkinnableTargetWrapper -> SkinnableTargetComponentsContainer 2021-05-13 18:54:30 +09:00
01bc71acd2 Improve ability to parse xmldoc of SkinnableTargetWrapper
Co-authored-by: Dan Balasescu <smoogipoo@smgi.me>
2021-05-13 18:40:28 +09:00
df77b28b48 Add a flimsy guard against null parent to avoid crashes on exit sequence 2021-05-13 18:39:21 +09:00
9f8e6979dd Fix display of skin blueprints when flipped 2021-05-13 18:00:25 +09:00
1cda55393e Add aspect ratio locking and flip support to skin editor 2021-05-13 17:51:57 +09:00