Commit Graph

7230 Commits

Author SHA1 Message Date
7aae9bbd1b Improve channel bindable logic in ChatOverlay to avoid potential nullrefs 2022-03-17 08:31:38 +03:00
603527d72d Fix potential crash when highlighting chat messages
Test failed locally in `TestPublicChannelMention`. This test seems to
specify that the same message may arrive twice with the same ID, so
rather than overthinking this one I propose we just use `FirstOrDefault`.

```csharp
TearDown : System.AggregateException : One or more errors occurred.
(Sequence contains more than one matching element)
  ----> System.InvalidOperationException : Sequence contains more than
one matching element
--TearDown
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean
includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout,
CancellationToken cancellationToken)
   at osu.Framework.Extensions.TaskExtensions.WaitSafely(Task task)
   at osu.Framework.Testing.TestScene.checkForErrors()
--InvalidOperationException
   at System.Linq.ThrowHelper.ThrowMoreThanOneMatchException()
   at System.Linq.Enumerable.TryGetSingle[TSource](IEnumerable`1 source,
Func`2 predicate, Boolean& found)
   at System.Linq.Enumerable.SingleOrDefault[TSource](IEnumerable`1
source, Func`2 predicate)
   at
osu.Game.Overlays.Chat.DrawableChannel.<processMessageHighlighting>b__14_0()
in
/Users/dean/Projects/osu/osu.Game/Overlays/Chat/DrawableChannel.cs:line
102
   at osu.Framework.Threading.ScheduledDelegate.RunTaskInternal()
```
2022-03-16 18:38:06 +09:00
53c57661c7 Move implementtaion detail to inline comment 2022-03-11 18:34:22 +03:00
5b70139b33 Avoid running message highlight processing more than once 2022-03-11 18:32:49 +03:00
cc87563d57 Merge branch 'master' into chat-mention-highlight 2022-03-11 17:51:22 +03:00
d07e3101ea Improve message highlight handling in DrawableChannel 2022-03-10 23:07:15 +03:00
a31611bdec Improve channel switching flow in HighlightMessage 2022-03-10 23:07:15 +03:00
5315ff794a Handle non-existing channels on message highlighting gracefully 2022-03-10 21:29:32 +03:00
717ddbba4e Fix skin components toolbox not autosizing properly 2022-03-10 16:30:20 +03:00
46f2db1712 Move ChannelListingItem spacing into item so input is always handled by an item in the list
Without this change, there would be a couple of pixels between each list
item where nothing would be hovered. This is a pretty annoying UX which
we should be avoiding we possible.
2022-03-10 15:58:57 +09:00
1a187d4dec Add animation to checkbox when joning/leaving a channel 2022-03-10 15:54:42 +09:00
0155519343 Merge branch 'master' into new-chat-channel-listing 2022-03-10 15:49:06 +09:00
022dd88aef Merge branch 'master' into chat-mention-highlight 2022-03-10 14:23:23 +09:00
b25c37ce62 Instantiate highlight background container on animation
Also removes the necessity of scheduling as it actually never worked as
intended, `Scheduler` will still update even when the chat line is
masked away, and the animation will never be held anyways.

The new duration of the animation should be enough for long scrolls
either way.
2022-03-10 03:49:42 +03:00
cf9671cafb Increase highlight delay to 1500ms 2022-03-10 02:50:15 +03:00
80c0df6af5 Scroll chat line to channel center
We may eventually want that encapsulated within `ScrollIntoView`, as it
would also come in handy for `GameplayLeaderboard`.
2022-03-10 02:50:15 +03:00
93cf93943f Schedule chat line highlight after children to handle non-loaded lines 2022-03-10 02:48:33 +03:00
2d8983383a Revert newMessagesArrived changes and always schedule highlight
In the case a message arrives and the chat overlay is hidden, clicking
on the mention notification will not work as the `HighlightedMessage`
bindable callback will execute before the scheduled `newMessagesArrived`
logic (which was hanging since the message arrived until the chat
overlay became open because of the notification).

Simplify things by always scheduling the `HighlightedMessage` bindable
callback.
2022-03-10 01:11:27 +03:00
b67f9269f9 Remove NewChat namespace 2022-03-09 18:13:56 +00:00
affcf5180b Merge pull request #17161 from smoogipoo/fix-listing-score-conversion
Fix scores not being recalculated in beatmap overlay
2022-03-09 13:32:45 +09:00
58aef25ad5 Merge pull request #17152 from bdach/mod-overlay/difficulty-multiplier
Implement difficulty multiplier display for new mod select design
2022-03-09 12:11:16 +09:00
7daa2d0ea4 Use correct fonts and colours in ChannelListingItem 2022-03-09 00:36:19 +00:00
7dd51a9c4a Reorder class attributes 2022-03-09 00:12:44 +00:00
a3477c3841 Implement ChannelListing for new chat design
Adds components `ChannelListing` and `ChannelListing` item with visual
test. Essentially a more simplified version of the existing
`ChannelSelectionOverlay` component.

Correctly implements `IFilterable` behaviour to filter child channel
items. Channel joined state is based on the underlying `Joined` bindable
of the `Channel` class.

Channel join/leave events are exposed via `OnRequestJoin` and
`OnRequestLeave` events which should be handled by parent component.

Requires a cached `OverlayColourScheme` instance to be provided by the
parent overlay component when added.
2022-03-08 22:30:58 +00:00
a2ef086c1f Fix potential crash on rare incorrect firing of skin dropdown update methods
As brought to light by https://gist.github.com/smoogipoo/56eda7ab56b9d1966556f2ca7a80a847.

There's a chance that the dropdown is not populated by the time
`updateSelectedSkinFromConfig` is fired via an external means (config
changes).
2022-03-09 01:08:13 +09:00
f5cd967635 Fix scores not being recalculated in beatmap listing 2022-03-08 19:07:39 +09:00
5e0882df8d Simplify message highlighting transforms 2022-03-08 04:00:11 +03:00
d74064b94b Use Equals instead of reference equality operator 2022-03-08 03:56:27 +03:00
f645869958 Update ChannelManager.CurrentChannel directly to handle non-loaded chat scenario
`currentChannel` gets instantiated once the chat overlay is open, while
`HighlightMessage` could be called while the chat overlay has never been
open.

This will all be rewritten with the new chat overlay design anyways, so
should be fine for now.
2022-03-08 03:42:18 +03:00
7f47be4680 Refactor message highlighting logic to rely on a Channel data bindable 2022-03-08 03:19:37 +03:00
22a2ef42c5 Check channel ID on message highlight using currentDrawableChannel 2022-03-08 01:22:47 +03:00
643f68e844 Better annotate initial rolling counter value set 2022-03-07 23:11:20 +01:00
019f4d965d Show two decimal digits on mod multiplier rather than one 2022-03-07 22:55:55 +01:00
c25d7a1c75 Use rolling counter for multiplier display 2022-03-07 22:50:51 +01:00
78a3b5961e Implement basic difficulty multiplier display 2022-03-07 22:50:51 +01:00
f4fa80c1e3 Add support to highlight messages in chat overlay 2022-03-07 05:10:49 +03:00
30b38345aa Add ability to highlight chat lines 2022-03-07 05:08:36 +03:00
a13a087f5d Add xmldoc to trackNewContent to explain its purpose 2022-03-06 23:51:27 +03:00
9ec0e74813 Move scrolling to UpdateAfterChildren to avoid scheduling
At least that's what I believe "let FillFlow update to new size" means.
2022-03-06 23:50:58 +03:00
9bc1f3f014 Further refactor and simplify ChannelScrollContainer 2022-03-06 23:34:12 +03:00
5b3ffb12b7 Refactor channel scrolling container to handle manual scrolls resiliently 2022-03-05 23:27:07 +03:00
6264dd266d Merge pull request #17087 from peppy/combine-time-slider-implementation
Centralise implementation of slider bars which display millisecond time values
2022-03-05 23:48:26 +09:00
346cec3577 Merge branch 'add-offset-adjust-tooltip-text' into combine-time-slider-implementation 2022-03-05 14:58:56 +01:00
38abfbf4d1 Merge branch 'master' into add-display-choice-dropdown 2022-03-05 14:39:59 +01:00
1e34aca984 Rename method to better fit purpose 2022-03-05 14:38:15 +01:00
524b8e02ef Revert "Update all usages of OsuSlider.TooltipText overrides to instead implement GetTooltipText"
This reverts commit abba49fd8f.
2022-03-05 22:37:36 +09:00
bbc2b36117 Merge branch 'master' into add-offset-adjust-tooltip-text 2022-03-05 22:37:04 +09:00
6673e456c5 Merge pull request #17090 from miniriley2012/wiki-locale-fix
Fix wiki links containing locale not loading when opened from chat.
2022-03-04 19:36:14 +09:00
3fdc7ed9d2 Remove brackets surrounding one-line statements 2022-03-04 10:14:19 +03:00
129c290ca0 Dispose cancellation token source on disposal 2022-03-04 10:01:07 +03:00