diff --git a/osu.Game/Graphics/UserInterface/TooltipIconButton.cs b/osu.Game/Graphics/UserInterface/TooltipIconButton.cs index 1dfec5cb80..ecae010889 100644 --- a/osu.Game/Graphics/UserInterface/TooltipIconButton.cs +++ b/osu.Game/Graphics/UserInterface/TooltipIconButton.cs @@ -21,6 +21,7 @@ namespace osu.Game.Graphics.UserInterface { private readonly SpriteIcon icon; private SampleChannel sampleHover; + private SampleChannel sampleClick; public Action Action; @@ -64,7 +65,10 @@ namespace osu.Game.Graphics.UserInterface protected override bool OnClick(InputState state) { if (isEnabled) + { + sampleClick?.Play(); Action?.Invoke(); + } return base.OnClick(state); } @@ -79,6 +83,7 @@ namespace osu.Game.Graphics.UserInterface private void load(AudioManager audio) { sampleHover = audio.Sample.Get(@"UI/generic-hover-soft"); + sampleClick = audio.Sample.Get(@"UI/generic-select-soft"); } public string TooltipText { get; set; } diff --git a/osu.Game/Overlays/Changelog/ChangelogBadges.cs b/osu.Game/Overlays/Changelog/ChangelogBadges.cs index 6f088677d9..3d1762e9f6 100644 --- a/osu.Game/Overlays/Changelog/ChangelogBadges.cs +++ b/osu.Game/Overlays/Changelog/ChangelogBadges.cs @@ -80,9 +80,9 @@ namespace osu.Game.Overlays.Changelog { foreach (StreamBadge streamBadge in badgesContainer) { - if (streamBadge.ChangelogEntry.UpdateStream.Name == updateStream) + if (streamBadge.LatestBuild.UpdateStream.Name == updateStream) { - selectedStreamId = streamBadge.ChangelogEntry.UpdateStream.Id; + selectedStreamId = streamBadge.LatestBuild.UpdateStream.Id; streamBadge.Activate(); } else @@ -92,13 +92,13 @@ namespace osu.Game.Overlays.Changelog private void onBadgeSelected(StreamBadge source, EventArgs args) { - selectedStreamId = source.ChangelogEntry.UpdateStream.Id; + selectedStreamId = source.LatestBuild.UpdateStream.Id; OnSelected(source); } protected virtual void OnSelected(StreamBadge source) { - Selected?.Invoke(source.ChangelogEntry, EventArgs.Empty); + Selected?.Invoke(source.LatestBuild, EventArgs.Empty); } protected override bool OnHover(InputState state) @@ -107,7 +107,7 @@ namespace osu.Game.Overlays.Changelog { if (selectedStreamId < 0) { - if (selectedStreamId != streamBadge.ChangelogEntry.UpdateStream.Id) + if (selectedStreamId != streamBadge.LatestBuild.UpdateStream.Id) streamBadge.Deactivate(); else streamBadge.EnableDim(); @@ -124,7 +124,7 @@ namespace osu.Game.Overlays.Changelog { if (selectedStreamId < 0) streamBadge.Activate(); - else if (streamBadge.ChangelogEntry.UpdateStream.Id == selectedStreamId) + else if (streamBadge.LatestBuild.UpdateStream.Id == selectedStreamId) streamBadge.DisableDim(); } base.OnHoverLost(state); diff --git a/osu.Game/Overlays/Changelog/ChangelogContentGroup.cs b/osu.Game/Overlays/Changelog/ChangelogContentGroup.cs index 444e81a75d..763be79a43 100644 --- a/osu.Game/Overlays/Changelog/ChangelogContentGroup.cs +++ b/osu.Game/Overlays/Changelog/ChangelogContentGroup.cs @@ -159,7 +159,6 @@ namespace osu.Game.Overlays.Changelog Font = @"Exo2.0-Light", Colour = StreamColour.FromStreamName(build.UpdateStream.Name), Action = () => OnBuildSelected(build), - IsClickMuted = true, }, } }, diff --git a/osu.Game/Overlays/Changelog/ChangelogHeader.cs b/osu.Game/Overlays/Changelog/ChangelogHeader.cs index 8617aff6a0..37b9c0a047 100644 --- a/osu.Game/Overlays/Changelog/ChangelogHeader.cs +++ b/osu.Game/Overlays/Changelog/ChangelogHeader.cs @@ -160,6 +160,7 @@ namespace osu.Game.Overlays.Changelog }, }; listing.Activated += OnListingSelected; + releaseStream.Activated += OnReleaseSelected; } public void ShowBuild(string displayName, string displayVersion) @@ -175,6 +176,8 @@ namespace osu.Game.Overlays.Changelog { releaseStream.Deactivate(); listing.Activate(); + titleStream.Text = "Listing"; + titleStream.FlashColour(Color4.White, 500, Easing.OutQuad); chevron.MoveToX(-20, 100).FadeOut(100); } @@ -183,6 +186,11 @@ namespace osu.Game.Overlays.Changelog ListingSelected?.Invoke(); } + protected virtual void OnReleaseSelected(object source, EventArgs e) + { + titleStream.FlashColour(Color4.White, 500, Easing.OutQuad); + } + [BackgroundDependencyLoader] private void load(TextureStore textures) { diff --git a/osu.Game/Overlays/Changelog/Header/TextBadgePair.cs b/osu.Game/Overlays/Changelog/Header/TextBadgePair.cs index 732edc2a58..c8801771d3 100644 --- a/osu.Game/Overlays/Changelog/Header/TextBadgePair.cs +++ b/osu.Game/Overlays/Changelog/Header/TextBadgePair.cs @@ -25,7 +25,7 @@ namespace osu.Game.Overlays.Changelog.Header public event ActivatedEventHandler Activated; private SampleChannel sampleHover; - protected SampleChannel SampleActivate; + private SampleChannel sampleActivate; public TextBadgePair(ColourInfo badgeColour, string displayText = "Listing", bool startCollapsed = true) { @@ -86,7 +86,6 @@ namespace osu.Game.Overlays.Changelog.Header IsActivated = true; LineBadge.Uncollapse(); Text.Font = "Exo2.0-Bold"; - SampleActivate?.Play(); } public void SetTextColour(ColourInfo newColour, double duration = 0, Easing easing = Easing.None) @@ -125,6 +124,7 @@ namespace osu.Game.Overlays.Changelog.Header protected override bool OnClick(InputState state) { OnActivated(); + sampleActivate?.Play(); return base.OnClick(state); } @@ -137,7 +137,7 @@ namespace osu.Game.Overlays.Changelog.Header private void load(AudioManager audio) { sampleHover = audio.Sample.Get(@"UI/generic-hover-soft"); - SampleActivate = audio.Sample.Get(@"UI/generic-select-soft"); + sampleActivate = audio.Sample.Get(@"UI/generic-select-soft"); } } } diff --git a/osu.Game/Overlays/Changelog/Header/TextBadgePairListing.cs b/osu.Game/Overlays/Changelog/Header/TextBadgePairListing.cs index 3876e8a226..31a06ce67d 100644 --- a/osu.Game/Overlays/Changelog/Header/TextBadgePairListing.cs +++ b/osu.Game/Overlays/Changelog/Header/TextBadgePairListing.cs @@ -38,7 +38,6 @@ namespace osu.Game.Overlays.Changelog.Header LineBadge.Uncollapse(); Text.Font = "Exo2.0-Bold"; SetTextColour(Color4.White, 100); - SampleActivate?.Play(); } public override void Deactivate() diff --git a/osu.Game/Overlays/Changelog/Header/TextBadgePairRelease.cs b/osu.Game/Overlays/Changelog/Header/TextBadgePairRelease.cs index 7f60dbabbd..97ce799509 100644 --- a/osu.Game/Overlays/Changelog/Header/TextBadgePairRelease.cs +++ b/osu.Game/Overlays/Changelog/Header/TextBadgePairRelease.cs @@ -29,7 +29,6 @@ namespace osu.Game.Overlays.Changelog.Header else ShowText(transition_duration, displayText); IsActivated = true; - SampleActivate?.Play(); } public override void Deactivate() diff --git a/osu.Game/Overlays/Changelog/StreamBadge.cs b/osu.Game/Overlays/Changelog/StreamBadge.cs index 59ce97bcc7..2a82620995 100644 --- a/osu.Game/Overlays/Changelog/StreamBadge.cs +++ b/osu.Game/Overlays/Changelog/StreamBadge.cs @@ -29,15 +29,17 @@ namespace osu.Game.Overlays.Changelog private bool isActivated; private readonly LineBadge lineBadge; + private SampleChannel sampleClick; private SampleChannel sampleHover; - public readonly APIChangelog ChangelogEntry; + + public readonly APIChangelog LatestBuild; private readonly FillFlowContainer text; - public StreamBadge(APIChangelog changelogEntry) + public StreamBadge(APIChangelog latestBuild) { - ChangelogEntry = changelogEntry; + this.LatestBuild = latestBuild; Height = badge_height; - Width = ChangelogEntry.IsFeatured ? badge_width * 2 : badge_width; + base.Width = this.LatestBuild.IsFeatured ? badge_width * 2 : badge_width; Margin = new MarginPadding(5); isActivated = true; Children = new Drawable[] @@ -51,7 +53,7 @@ namespace osu.Game.Overlays.Changelog { new SpriteText { - Text = ChangelogEntry.UpdateStream.DisplayName, + Text = this.LatestBuild.UpdateStream.DisplayName, Font = @"Exo2.0-Bold", TextSize = 16, Margin = new MarginPadding @@ -61,14 +63,14 @@ namespace osu.Game.Overlays.Changelog }, new SpriteText { - Text = ChangelogEntry.DisplayVersion, + Text = this.LatestBuild.DisplayVersion, Font = @"Exo2.0-Light", TextSize = 21, }, new SpriteText { - Text = ChangelogEntry.Users > 0 ? - $"{ChangelogEntry.Users:N0} users online" : + Text = this.LatestBuild.Users > 0 ? + $"{this.LatestBuild.Users:N0} users online" : null, TextSize = 12, Font = @"Exo2.0-Regular", @@ -79,7 +81,7 @@ namespace osu.Game.Overlays.Changelog lineBadge = new LineBadge(false) { Anchor = Anchor.TopCentre, - Colour = StreamColour.FromStreamName(ChangelogEntry.UpdateStream.Name), + Colour = StreamColour.FromStreamName(this.LatestBuild.UpdateStream.Name), UncollapsedSize = 4, CollapsedSize = 2, }, @@ -111,6 +113,7 @@ namespace osu.Game.Overlays.Changelog protected override bool OnClick(InputState state) { Activate(false); + sampleClick?.Play(); return base.OnClick(state); } @@ -142,6 +145,7 @@ namespace osu.Game.Overlays.Changelog [BackgroundDependencyLoader] private void load(AudioManager audio) { + sampleClick = audio.Sample.Get(@"UI/generic-select-soft"); sampleHover = audio.Sample.Get(@"UI/generic-hover-soft"); } } diff --git a/osu.Game/Overlays/ChangelogOverlay.cs b/osu.Game/Overlays/ChangelogOverlay.cs index fd0515a0b3..4a133870f7 100644 --- a/osu.Game/Overlays/ChangelogOverlay.cs +++ b/osu.Game/Overlays/ChangelogOverlay.cs @@ -4,6 +4,8 @@ using OpenTK; using OpenTK.Graphics; using osu.Framework.Allocation; +using osu.Framework.Audio; +using osu.Framework.Audio.Sample; using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; @@ -26,6 +28,8 @@ namespace osu.Game.Overlays private readonly ChangelogChart chart; private readonly ChangelogContent content; + private SampleChannel sampleBack; + private readonly Color4 purple = new Color4(191, 4, 255, 255); private APIAccess api; @@ -96,7 +100,10 @@ namespace osu.Game.Overlays if (isAtListing) State = Visibility.Hidden; else + { FetchAndShowListing(); + sampleBack?.Play(); + } return true; } @@ -121,9 +128,10 @@ namespace osu.Game.Overlays } [BackgroundDependencyLoader] - private void load(APIAccess api) + private void load(APIAccess api, AudioManager audio) { this.api = api; + sampleBack = audio.Sample.Get(@"UI/generic-select-soft"); // @"UI/screen-back" feels non-fitting here } protected override void LoadComplete()