mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 12:53:11 +08:00
Merge branch 'master' into editor-new-beatmap
This commit is contained in:
commit
1f2f21e07a
@ -51,7 +51,7 @@
|
||||
<Reference Include="Java.Interop" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2020.812.0" />
|
||||
<PackageReference Include="ppy.osu.Framework.Android" Version="2020.819.0" />
|
||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2020.903.0" />
|
||||
<PackageReference Include="ppy.osu.Framework.Android" Version="2020.903.0" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
@ -91,7 +91,7 @@ namespace osu.Game.Tests.Visual.Menus
|
||||
|
||||
public class TestToolbar : Toolbar
|
||||
{
|
||||
public new Bindable<OverlayActivation> OverlayActivationMode => base.OverlayActivationMode;
|
||||
public new Bindable<OverlayActivation> OverlayActivationMode => base.OverlayActivationMode as Bindable<OverlayActivation>;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -12,7 +12,7 @@ namespace osu.Game.Tests.Visual.Online
|
||||
[TestFixture]
|
||||
public class TestSceneFullscreenOverlay : OsuTestScene
|
||||
{
|
||||
private FullscreenOverlay overlay;
|
||||
private FullscreenOverlay<OverlayHeader> overlay;
|
||||
|
||||
protected override void LoadComplete()
|
||||
{
|
||||
@ -38,10 +38,10 @@ namespace osu.Game.Tests.Visual.Online
|
||||
AddAssert("fire count 3", () => fireCount == 3);
|
||||
}
|
||||
|
||||
private class TestFullscreenOverlay : FullscreenOverlay
|
||||
private class TestFullscreenOverlay : FullscreenOverlay<OverlayHeader>
|
||||
{
|
||||
public TestFullscreenOverlay()
|
||||
: base(OverlayColourScheme.Pink)
|
||||
: base(OverlayColourScheme.Pink, null)
|
||||
{
|
||||
Children = new Drawable[]
|
||||
{
|
||||
|
@ -5,9 +5,9 @@ using System;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Online.Leaderboards;
|
||||
using osu.Game.Overlays;
|
||||
using osu.Game.Rulesets.Mods;
|
||||
using osu.Game.Rulesets.Osu.Mods;
|
||||
using osu.Game.Scoring;
|
||||
using osu.Game.Screens.Select.Leaderboards;
|
||||
@ -53,16 +53,13 @@ namespace osu.Game.Tests.Visual.SongSelect
|
||||
|
||||
private void showPersonalBestWithNullPosition()
|
||||
{
|
||||
leaderboard.TopScore = new APILegacyUserTopScoreInfo
|
||||
{
|
||||
Position = null,
|
||||
Score = new APILegacyScoreInfo
|
||||
leaderboard.TopScore = new ScoreInfo
|
||||
{
|
||||
Rank = ScoreRank.XH,
|
||||
Accuracy = 1,
|
||||
MaxCombo = 244,
|
||||
TotalScore = 1707827,
|
||||
Mods = new[] { new OsuModHidden().Acronym, new OsuModHardRock().Acronym, },
|
||||
Mods = new Mod[] { new OsuModHidden(), new OsuModHardRock() },
|
||||
User = new User
|
||||
{
|
||||
Id = 6602580,
|
||||
@ -73,22 +70,19 @@ namespace osu.Game.Tests.Visual.SongSelect
|
||||
FlagName = @"ES",
|
||||
},
|
||||
},
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private void showPersonalBest()
|
||||
{
|
||||
leaderboard.TopScore = new APILegacyUserTopScoreInfo
|
||||
leaderboard.TopScore = new ScoreInfo
|
||||
{
|
||||
Position = 999,
|
||||
Score = new APILegacyScoreInfo
|
||||
{
|
||||
Rank = ScoreRank.XH,
|
||||
Accuracy = 1,
|
||||
MaxCombo = 244,
|
||||
TotalScore = 1707827,
|
||||
Mods = new[] { new OsuModHidden().Acronym, new OsuModHardRock().Acronym, },
|
||||
Mods = new Mod[] { new OsuModHidden(), new OsuModHardRock(), },
|
||||
User = new User
|
||||
{
|
||||
Id = 6602580,
|
||||
@ -99,7 +93,6 @@ namespace osu.Game.Tests.Visual.SongSelect
|
||||
FlagName = @"ES",
|
||||
},
|
||||
},
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -6,11 +6,11 @@ using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osuTK.Graphics;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Online.Leaderboards;
|
||||
using osu.Game.Overlays;
|
||||
using osu.Game.Rulesets.Mods;
|
||||
using osu.Game.Scoring;
|
||||
using osu.Game.Rulesets.Osu.Mods;
|
||||
using osu.Game.Screens.Select.Leaderboards;
|
||||
using osu.Game.Users;
|
||||
|
||||
namespace osu.Game.Tests.Visual.SongSelect
|
||||
@ -22,7 +22,7 @@ namespace osu.Game.Tests.Visual.SongSelect
|
||||
|
||||
public TestSceneUserTopScoreContainer()
|
||||
{
|
||||
UserTopScoreContainer topScoreContainer;
|
||||
UserTopScoreContainer<ScoreInfo> topScoreContainer;
|
||||
|
||||
Add(dialogOverlay = new DialogOverlay
|
||||
{
|
||||
@ -42,7 +42,7 @@ namespace osu.Game.Tests.Visual.SongSelect
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Colour = Color4.DarkGreen,
|
||||
},
|
||||
topScoreContainer = new UserTopScoreContainer
|
||||
topScoreContainer = new UserTopScoreContainer<ScoreInfo>(s => new LeaderboardScore(s, s.Position, false))
|
||||
{
|
||||
Origin = Anchor.BottomCentre,
|
||||
Anchor = Anchor.BottomCentre,
|
||||
@ -52,16 +52,14 @@ namespace osu.Game.Tests.Visual.SongSelect
|
||||
|
||||
var scores = new[]
|
||||
{
|
||||
new APILegacyUserTopScoreInfo
|
||||
new ScoreInfo
|
||||
{
|
||||
Position = 999,
|
||||
Score = new APILegacyScoreInfo
|
||||
{
|
||||
Rank = ScoreRank.XH,
|
||||
Accuracy = 1,
|
||||
MaxCombo = 244,
|
||||
TotalScore = 1707827,
|
||||
Mods = new[] { new OsuModHidden().Acronym, new OsuModHardRock().Acronym, },
|
||||
Mods = new Mod[] { new OsuModHidden(), new OsuModHardRock(), },
|
||||
User = new User
|
||||
{
|
||||
Id = 6602580,
|
||||
@ -72,13 +70,10 @@ namespace osu.Game.Tests.Visual.SongSelect
|
||||
FlagName = @"ES",
|
||||
},
|
||||
},
|
||||
}
|
||||
},
|
||||
new APILegacyUserTopScoreInfo
|
||||
new ScoreInfo
|
||||
{
|
||||
Position = 110000,
|
||||
Score = new APILegacyScoreInfo
|
||||
{
|
||||
Rank = ScoreRank.X,
|
||||
Accuracy = 1,
|
||||
MaxCombo = 244,
|
||||
@ -93,13 +88,10 @@ namespace osu.Game.Tests.Visual.SongSelect
|
||||
FlagName = @"BR",
|
||||
},
|
||||
},
|
||||
}
|
||||
},
|
||||
new APILegacyUserTopScoreInfo
|
||||
new ScoreInfo
|
||||
{
|
||||
Position = 22333,
|
||||
Score = new APILegacyScoreInfo
|
||||
{
|
||||
Rank = ScoreRank.S,
|
||||
Accuracy = 1,
|
||||
MaxCombo = 244,
|
||||
@ -115,7 +107,6 @@ namespace osu.Game.Tests.Visual.SongSelect
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
AddStep(@"Trigger visibility", topScoreContainer.ToggleVisibility);
|
||||
|
@ -35,7 +35,7 @@ namespace osu.Game.Graphics.Containers
|
||||
[Resolved]
|
||||
private PreviewTrackManager previewTrackManager { get; set; }
|
||||
|
||||
protected readonly Bindable<OverlayActivation> OverlayActivationMode = new Bindable<OverlayActivation>(OverlayActivation.All);
|
||||
protected readonly IBindable<OverlayActivation> OverlayActivationMode = new Bindable<OverlayActivation>(OverlayActivation.All);
|
||||
|
||||
[BackgroundDependencyLoader(true)]
|
||||
private void load(AudioManager audio)
|
||||
|
@ -26,8 +26,11 @@ namespace osu.Game.Graphics.Containers
|
||||
{
|
||||
if (value == expandableHeader) return;
|
||||
|
||||
expandableHeader?.Expire();
|
||||
if (expandableHeader != null)
|
||||
RemoveInternal(expandableHeader);
|
||||
|
||||
expandableHeader = value;
|
||||
|
||||
if (value == null) return;
|
||||
|
||||
AddInternal(expandableHeader);
|
||||
|
@ -3,6 +3,8 @@
|
||||
|
||||
using System.Collections.Generic;
|
||||
using Newtonsoft.Json;
|
||||
using osu.Game.Rulesets;
|
||||
using osu.Game.Scoring;
|
||||
|
||||
namespace osu.Game.Online.API.Requests.Responses
|
||||
{
|
||||
@ -22,5 +24,12 @@ namespace osu.Game.Online.API.Requests.Responses
|
||||
|
||||
[JsonProperty(@"score")]
|
||||
public APILegacyScoreInfo Score;
|
||||
|
||||
public ScoreInfo CreateScoreInfo(RulesetStore rulesets)
|
||||
{
|
||||
var score = Score.CreateScoreInfo(rulesets);
|
||||
score.Position = Position;
|
||||
return score;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -33,6 +33,9 @@ namespace osu.Game.Online.API.Requests.Responses
|
||||
[JsonProperty("user")]
|
||||
public User User { get; set; }
|
||||
|
||||
[JsonProperty("position")]
|
||||
public int? Position { get; set; }
|
||||
|
||||
public ScoreInfo CreateScoreInfo() =>
|
||||
new ScoreInfo
|
||||
{
|
||||
@ -40,6 +43,7 @@ namespace osu.Game.Online.API.Requests.Responses
|
||||
PP = PP,
|
||||
TotalScore = TotalScore,
|
||||
User = User,
|
||||
Position = Position
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -27,6 +27,7 @@ namespace osu.Game.Online.Leaderboards
|
||||
|
||||
private readonly OsuScrollContainer scrollContainer;
|
||||
private readonly Container placeholderContainer;
|
||||
private readonly UserTopScoreContainer<TScoreInfo> topScoreContainer;
|
||||
|
||||
private FillFlowContainer<LeaderboardScore> scrollFlow;
|
||||
|
||||
@ -87,6 +88,20 @@ namespace osu.Game.Online.Leaderboards
|
||||
}
|
||||
}
|
||||
|
||||
public TScoreInfo TopScore
|
||||
{
|
||||
get => topScoreContainer.Score.Value;
|
||||
set
|
||||
{
|
||||
topScoreContainer.Score.Value = value;
|
||||
|
||||
if (value == null)
|
||||
topScoreContainer.Hide();
|
||||
else
|
||||
topScoreContainer.Show();
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual FillFlowContainer<LeaderboardScore> CreateScoreFlow()
|
||||
=> new FillFlowContainer<LeaderboardScore>
|
||||
{
|
||||
@ -198,8 +213,9 @@ namespace osu.Game.Online.Leaderboards
|
||||
{
|
||||
AutoSizeAxes = Axes.Y,
|
||||
RelativeSizeAxes = Axes.X,
|
||||
Child = topScoreContainer = new UserTopScoreContainer<TScoreInfo>(CreateDrawableTopScore)
|
||||
},
|
||||
},
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -367,5 +383,7 @@ namespace osu.Game.Online.Leaderboards
|
||||
}
|
||||
|
||||
protected abstract LeaderboardScore CreateDrawableScore(TScoreInfo model, int index);
|
||||
|
||||
protected abstract LeaderboardScore CreateDrawableTopScore(TScoreInfo model);
|
||||
}
|
||||
}
|
||||
|
@ -9,31 +9,29 @@ using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Online.Leaderboards;
|
||||
using osu.Game.Rulesets;
|
||||
using osu.Game.Scoring;
|
||||
using osuTK;
|
||||
|
||||
namespace osu.Game.Screens.Select.Leaderboards
|
||||
namespace osu.Game.Online.Leaderboards
|
||||
{
|
||||
public class UserTopScoreContainer : VisibilityContainer
|
||||
public class UserTopScoreContainer<TScoreInfo> : VisibilityContainer
|
||||
{
|
||||
private const int duration = 500;
|
||||
|
||||
public Bindable<TScoreInfo> Score = new Bindable<TScoreInfo>();
|
||||
|
||||
private readonly Container scoreContainer;
|
||||
|
||||
public Bindable<APILegacyUserTopScoreInfo> Score = new Bindable<APILegacyUserTopScoreInfo>();
|
||||
|
||||
public Action<ScoreInfo> ScoreSelected;
|
||||
private readonly Func<TScoreInfo, LeaderboardScore> createScoreDelegate;
|
||||
|
||||
protected override bool StartHidden => true;
|
||||
|
||||
[Resolved]
|
||||
private RulesetStore rulesets { get; set; }
|
||||
|
||||
public UserTopScoreContainer()
|
||||
public UserTopScoreContainer(Func<TScoreInfo, LeaderboardScore> createScoreDelegate)
|
||||
{
|
||||
this.createScoreDelegate = createScoreDelegate;
|
||||
|
||||
RelativeSizeAxes = Axes.X;
|
||||
AutoSizeAxes = Axes.Y;
|
||||
|
||||
@ -72,7 +70,7 @@ namespace osu.Game.Screens.Select.Leaderboards
|
||||
|
||||
private CancellationTokenSource loadScoreCancellation;
|
||||
|
||||
private void onScoreChanged(ValueChangedEvent<APILegacyUserTopScoreInfo> score)
|
||||
private void onScoreChanged(ValueChangedEvent<TScoreInfo> score)
|
||||
{
|
||||
var newScore = score.NewValue;
|
||||
|
||||
@ -82,12 +80,7 @@ namespace osu.Game.Screens.Select.Leaderboards
|
||||
if (newScore == null)
|
||||
return;
|
||||
|
||||
var scoreInfo = newScore.Score.CreateScoreInfo(rulesets);
|
||||
|
||||
LoadComponentAsync(new LeaderboardScore(scoreInfo, newScore.Position, false)
|
||||
{
|
||||
Action = () => ScoreSelected?.Invoke(scoreInfo)
|
||||
}, drawableScore =>
|
||||
LoadComponentAsync(createScoreDelegate(newScore), drawableScore =>
|
||||
{
|
||||
scoreContainer.Child = drawableScore;
|
||||
drawableScore.FadeInFromZero(duration, Easing.OutQuint);
|
18
osu.Game/Online/Multiplayer/APILeaderboard.cs
Normal file
18
osu.Game/Online/Multiplayer/APILeaderboard.cs
Normal file
@ -0,0 +1,18 @@
|
||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using System.Collections.Generic;
|
||||
using Newtonsoft.Json;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
|
||||
namespace osu.Game.Online.Multiplayer
|
||||
{
|
||||
public class APILeaderboard
|
||||
{
|
||||
[JsonProperty("leaderboard")]
|
||||
public List<APIUserScoreAggregate> Leaderboard;
|
||||
|
||||
[JsonProperty("user_score")]
|
||||
public APIUserScoreAggregate UserScore;
|
||||
}
|
||||
}
|
@ -1,17 +1,15 @@
|
||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using System.Collections.Generic;
|
||||
using osu.Game.Online.API;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
|
||||
namespace osu.Game.Online.Multiplayer
|
||||
{
|
||||
public class GetRoomScoresRequest : APIRequest<List<APIUserScoreAggregate>>
|
||||
public class GetRoomLeaderboardRequest : APIRequest<APILeaderboard>
|
||||
{
|
||||
private readonly int roomId;
|
||||
|
||||
public GetRoomScoresRequest(int roomId)
|
||||
public GetRoomLeaderboardRequest(int roomId)
|
||||
{
|
||||
this.roomId = roomId;
|
||||
}
|
@ -88,7 +88,10 @@ namespace osu.Game
|
||||
|
||||
private IdleTracker idleTracker;
|
||||
|
||||
public readonly Bindable<OverlayActivation> OverlayActivationMode = new Bindable<OverlayActivation>();
|
||||
/// <summary>
|
||||
/// Whether overlays should be able to be opened game-wide. Value is sourced from the current active screen.
|
||||
/// </summary>
|
||||
public readonly IBindable<OverlayActivation> OverlayActivationMode = new Bindable<OverlayActivation>();
|
||||
|
||||
protected OsuScreenStack ScreenStack;
|
||||
|
||||
@ -695,9 +698,9 @@ namespace osu.Game
|
||||
float offset = 0;
|
||||
|
||||
if (Settings.State.Value == Visibility.Visible)
|
||||
offset += ToolbarButton.WIDTH / 2;
|
||||
offset += Toolbar.HEIGHT / 2;
|
||||
if (notifications.State.Value == Visibility.Visible)
|
||||
offset -= ToolbarButton.WIDTH / 2;
|
||||
offset -= Toolbar.HEIGHT / 2;
|
||||
|
||||
screenContainer.MoveToX(offset, SettingsPanel.TRANSITION_LENGTH, Easing.OutQuint);
|
||||
}
|
||||
@ -952,9 +955,12 @@ namespace osu.Game
|
||||
break;
|
||||
}
|
||||
|
||||
if (current is IOsuScreen currentOsuScreen)
|
||||
OverlayActivationMode.UnbindFrom(currentOsuScreen.OverlayActivationMode);
|
||||
|
||||
if (newScreen is IOsuScreen newOsuScreen)
|
||||
{
|
||||
OverlayActivationMode.Value = newOsuScreen.InitialOverlayActivationMode;
|
||||
OverlayActivationMode.BindTo(newOsuScreen.OverlayActivationMode);
|
||||
|
||||
MusicController.AllowRateAdjustments = newOsuScreen.AllowRateAdjustments;
|
||||
|
||||
|
@ -12,7 +12,8 @@ namespace osu.Game.Overlays.BeatmapListing
|
||||
public BeatmapListingTitle()
|
||||
{
|
||||
Title = "beatmap listing";
|
||||
IconTexture = "Icons/changelog";
|
||||
Description = "Browse for new beatmaps";
|
||||
IconTexture = "Icons/Hexacons/beatmap";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ using osuTK;
|
||||
|
||||
namespace osu.Game.Overlays
|
||||
{
|
||||
public class BeatmapListingOverlay : FullscreenOverlay
|
||||
public class BeatmapListingOverlay : FullscreenOverlay<BeatmapListingHeader>
|
||||
{
|
||||
[Resolved]
|
||||
private PreviewTrackManager previewTrackManager { get; set; }
|
||||
@ -38,7 +38,7 @@ namespace osu.Game.Overlays
|
||||
private OverlayScrollContainer resultScrollContainer;
|
||||
|
||||
public BeatmapListingOverlay()
|
||||
: base(OverlayColourScheme.Blue)
|
||||
: base(OverlayColourScheme.Blue, new BeatmapListingHeader())
|
||||
{
|
||||
}
|
||||
|
||||
@ -65,7 +65,7 @@ namespace osu.Game.Overlays
|
||||
Direction = FillDirection.Vertical,
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new BeatmapListingHeader(),
|
||||
Header,
|
||||
filterControl = new BeatmapListingFilterControl
|
||||
{
|
||||
SearchStarted = onSearchStarted,
|
||||
|
@ -25,7 +25,7 @@ namespace osu.Game.Overlays.BeatmapSet
|
||||
public BeatmapHeaderTitle()
|
||||
{
|
||||
Title = "beatmap info";
|
||||
IconTexture = "Icons/changelog";
|
||||
IconTexture = "Icons/Hexacons/beatmap";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -19,12 +19,14 @@ using osuTK;
|
||||
|
||||
namespace osu.Game.Overlays
|
||||
{
|
||||
public class BeatmapSetOverlay : FullscreenOverlay
|
||||
public class BeatmapSetOverlay : FullscreenOverlay<OverlayHeader> // we don't provide a standard header for now.
|
||||
{
|
||||
public const float X_PADDING = 40;
|
||||
public const float Y_PADDING = 25;
|
||||
public const float RIGHT_WIDTH = 275;
|
||||
protected readonly Header Header;
|
||||
|
||||
//todo: should be an OverlayHeader? or maybe not?
|
||||
protected new readonly Header Header;
|
||||
|
||||
[Resolved]
|
||||
private RulesetStore rulesets { get; set; }
|
||||
@ -37,7 +39,7 @@ namespace osu.Game.Overlays
|
||||
private readonly Box background;
|
||||
|
||||
public BeatmapSetOverlay()
|
||||
: base(OverlayColourScheme.Blue)
|
||||
: base(OverlayColourScheme.Blue, null)
|
||||
{
|
||||
OverlayScrollContainer scroll;
|
||||
Info info;
|
||||
|
@ -115,7 +115,8 @@ namespace osu.Game.Overlays.Changelog
|
||||
public ChangelogHeaderTitle()
|
||||
{
|
||||
Title = "changelog";
|
||||
IconTexture = "Icons/changelog";
|
||||
Description = "Track recent dev updates in the osu! ecosystem";
|
||||
IconTexture = "Icons/Hexacons/devtools";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -21,12 +21,10 @@ using osu.Game.Overlays.Changelog;
|
||||
|
||||
namespace osu.Game.Overlays
|
||||
{
|
||||
public class ChangelogOverlay : FullscreenOverlay
|
||||
public class ChangelogOverlay : FullscreenOverlay<ChangelogHeader>
|
||||
{
|
||||
public readonly Bindable<APIChangelogBuild> Current = new Bindable<APIChangelogBuild>();
|
||||
|
||||
protected ChangelogHeader Header;
|
||||
|
||||
private Container<ChangelogContent> content;
|
||||
|
||||
private SampleChannel sampleBack;
|
||||
@ -36,7 +34,7 @@ namespace osu.Game.Overlays
|
||||
protected List<APIUpdateStream> Streams;
|
||||
|
||||
public ChangelogOverlay()
|
||||
: base(OverlayColourScheme.Purple)
|
||||
: base(OverlayColourScheme.Purple, new ChangelogHeader())
|
||||
{
|
||||
}
|
||||
|
||||
@ -61,10 +59,11 @@ namespace osu.Game.Overlays
|
||||
Direction = FillDirection.Vertical,
|
||||
Children = new Drawable[]
|
||||
{
|
||||
Header = new ChangelogHeader
|
||||
Header.With(h =>
|
||||
{
|
||||
ListingSelected = ShowListing,
|
||||
},
|
||||
h.ListingSelected = ShowListing;
|
||||
h.Build.BindTarget = Current;
|
||||
}),
|
||||
content = new Container<ChangelogContent>
|
||||
{
|
||||
RelativeSizeAxes = Axes.X,
|
||||
@ -77,8 +76,6 @@ namespace osu.Game.Overlays
|
||||
|
||||
sampleBack = audio.Samples.Get(@"UI/generic-select-soft");
|
||||
|
||||
Header.Build.BindTo(Current);
|
||||
|
||||
Current.BindValueChanged(e =>
|
||||
{
|
||||
if (e.NewValue != null)
|
||||
|
@ -22,7 +22,7 @@ namespace osu.Game.Overlays.Chat.Selection
|
||||
{
|
||||
public class ChannelSelectionOverlay : WaveOverlayContainer
|
||||
{
|
||||
public const float WIDTH_PADDING = 170;
|
||||
public new const float WIDTH_PADDING = 170;
|
||||
|
||||
private const float transition_duration = 500;
|
||||
|
||||
|
@ -2,6 +2,7 @@
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Specialized;
|
||||
using System.Linq;
|
||||
using osuTK;
|
||||
using osuTK.Graphics;
|
||||
@ -25,8 +26,12 @@ using osu.Framework.Graphics.Sprites;
|
||||
|
||||
namespace osu.Game.Overlays
|
||||
{
|
||||
public class ChatOverlay : OsuFocusedOverlayContainer
|
||||
public class ChatOverlay : OsuFocusedOverlayContainer, INamedOverlayComponent
|
||||
{
|
||||
public string IconTexture => "Icons/Hexacons/messaging";
|
||||
public string Title => "chat";
|
||||
public string Description => "Join the real-time discussion";
|
||||
|
||||
private const float textbox_height = 60;
|
||||
private const float channel_selection_min_height = 0.3f;
|
||||
|
||||
@ -218,14 +223,13 @@ namespace osu.Game.Overlays
|
||||
Schedule(() =>
|
||||
{
|
||||
// TODO: consider scheduling bindable callbacks to not perform when overlay is not present.
|
||||
channelManager.JoinedChannels.ItemsAdded += onChannelAddedToJoinedChannels;
|
||||
channelManager.JoinedChannels.ItemsRemoved += onChannelRemovedFromJoinedChannels;
|
||||
channelManager.JoinedChannels.CollectionChanged += joinedChannelsChanged;
|
||||
|
||||
foreach (Channel channel in channelManager.JoinedChannels)
|
||||
ChannelTabControl.AddChannel(channel);
|
||||
|
||||
channelManager.AvailableChannels.ItemsAdded += availableChannelsChanged;
|
||||
channelManager.AvailableChannels.ItemsRemoved += availableChannelsChanged;
|
||||
ChannelSelectionOverlay.UpdateAvailableChannels(channelManager.AvailableChannels);
|
||||
channelManager.AvailableChannels.CollectionChanged += availableChannelsChanged;
|
||||
availableChannelsChanged(null, null);
|
||||
|
||||
currentChannel = channelManager.CurrentChannel.GetBoundCopy();
|
||||
currentChannel.BindValueChanged(currentChannelChanged, true);
|
||||
@ -384,15 +388,17 @@ namespace osu.Game.Overlays
|
||||
base.PopOut();
|
||||
}
|
||||
|
||||
private void onChannelAddedToJoinedChannels(IEnumerable<Channel> channels)
|
||||
private void joinedChannelsChanged(object sender, NotifyCollectionChangedEventArgs args)
|
||||
{
|
||||
foreach (Channel channel in channels)
|
||||
switch (args.Action)
|
||||
{
|
||||
case NotifyCollectionChangedAction.Add:
|
||||
foreach (Channel channel in args.NewItems.Cast<Channel>())
|
||||
ChannelTabControl.AddChannel(channel);
|
||||
}
|
||||
break;
|
||||
|
||||
private void onChannelRemovedFromJoinedChannels(IEnumerable<Channel> channels)
|
||||
{
|
||||
foreach (Channel channel in channels)
|
||||
case NotifyCollectionChangedAction.Remove:
|
||||
foreach (Channel channel in args.OldItems.Cast<Channel>())
|
||||
{
|
||||
ChannelTabControl.RemoveChannel(channel);
|
||||
|
||||
@ -408,10 +414,15 @@ namespace osu.Game.Overlays
|
||||
loaded.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void availableChannelsChanged(IEnumerable<Channel> channels)
|
||||
=> ChannelSelectionOverlay.UpdateAvailableChannels(channelManager.AvailableChannels);
|
||||
private void availableChannelsChanged(object sender, NotifyCollectionChangedEventArgs args)
|
||||
{
|
||||
ChannelSelectionOverlay.UpdateAvailableChannels(channelManager.AvailableChannels);
|
||||
}
|
||||
|
||||
protected override void Dispose(bool isDisposing)
|
||||
{
|
||||
@ -420,10 +431,8 @@ namespace osu.Game.Overlays
|
||||
if (channelManager != null)
|
||||
{
|
||||
channelManager.CurrentChannel.ValueChanged -= currentChannelChanged;
|
||||
channelManager.JoinedChannels.ItemsAdded -= onChannelAddedToJoinedChannels;
|
||||
channelManager.JoinedChannels.ItemsRemoved -= onChannelRemovedFromJoinedChannels;
|
||||
channelManager.AvailableChannels.ItemsAdded -= availableChannelsChanged;
|
||||
channelManager.AvailableChannels.ItemsRemoved -= availableChannelsChanged;
|
||||
channelManager.JoinedChannels.CollectionChanged -= joinedChannelsChanged;
|
||||
channelManager.AvailableChannels.CollectionChanged -= availableChannelsChanged;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -12,7 +12,8 @@ namespace osu.Game.Overlays.Dashboard
|
||||
public DashboardTitle()
|
||||
{
|
||||
Title = "dashboard";
|
||||
IconTexture = "Icons/changelog";
|
||||
Description = "View your friends and other information";
|
||||
IconTexture = "Icons/Hexacons/social";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -15,17 +15,21 @@ using osu.Game.Overlays.Dashboard.Friends;
|
||||
|
||||
namespace osu.Game.Overlays
|
||||
{
|
||||
public class DashboardOverlay : FullscreenOverlay
|
||||
public class DashboardOverlay : FullscreenOverlay<DashboardOverlayHeader>
|
||||
{
|
||||
private CancellationTokenSource cancellationToken;
|
||||
|
||||
private Container content;
|
||||
private DashboardOverlayHeader header;
|
||||
private LoadingLayer loading;
|
||||
private OverlayScrollContainer scrollFlow;
|
||||
|
||||
public DashboardOverlay()
|
||||
: base(OverlayColourScheme.Purple)
|
||||
: base(OverlayColourScheme.Purple, new DashboardOverlayHeader
|
||||
{
|
||||
Anchor = Anchor.TopCentre,
|
||||
Origin = Anchor.TopCentre,
|
||||
Depth = -float.MaxValue
|
||||
})
|
||||
{
|
||||
}
|
||||
|
||||
@ -50,12 +54,7 @@ namespace osu.Game.Overlays
|
||||
Direction = FillDirection.Vertical,
|
||||
Children = new Drawable[]
|
||||
{
|
||||
header = new DashboardOverlayHeader
|
||||
{
|
||||
Anchor = Anchor.TopCentre,
|
||||
Origin = Anchor.TopCentre,
|
||||
Depth = -float.MaxValue
|
||||
},
|
||||
Header,
|
||||
content = new Container
|
||||
{
|
||||
RelativeSizeAxes = Axes.X,
|
||||
@ -72,7 +71,7 @@ namespace osu.Game.Overlays
|
||||
{
|
||||
base.LoadComplete();
|
||||
|
||||
header.Current.BindValueChanged(onTabChanged);
|
||||
Header.Current.BindValueChanged(onTabChanged);
|
||||
}
|
||||
|
||||
private bool displayUpdateRequired = true;
|
||||
@ -84,7 +83,7 @@ namespace osu.Game.Overlays
|
||||
// We don't want to create a new display on every call, only when exiting from fully closed state.
|
||||
if (displayUpdateRequired)
|
||||
{
|
||||
header.Current.TriggerChange();
|
||||
Header.Current.TriggerChange();
|
||||
displayUpdateRequired = false;
|
||||
}
|
||||
}
|
||||
@ -136,7 +135,7 @@ namespace osu.Game.Overlays
|
||||
if (State.Value == Visibility.Hidden)
|
||||
return;
|
||||
|
||||
header.Current.TriggerChange();
|
||||
Header.Current.TriggerChange();
|
||||
}
|
||||
|
||||
protected override void Dispose(bool isDisposing)
|
||||
|
@ -12,16 +12,25 @@ using osuTK.Graphics;
|
||||
|
||||
namespace osu.Game.Overlays
|
||||
{
|
||||
public abstract class FullscreenOverlay : WaveOverlayContainer, IOnlineComponent
|
||||
public abstract class FullscreenOverlay<T> : WaveOverlayContainer, IOnlineComponent, INamedOverlayComponent
|
||||
where T : OverlayHeader
|
||||
{
|
||||
public virtual string IconTexture => Header?.Title.IconTexture ?? string.Empty;
|
||||
public virtual string Title => Header?.Title.Title ?? string.Empty;
|
||||
public virtual string Description => Header?.Title.Description ?? string.Empty;
|
||||
|
||||
public T Header { get; }
|
||||
|
||||
[Resolved]
|
||||
protected IAPIProvider API { get; private set; }
|
||||
|
||||
[Cached]
|
||||
protected readonly OverlayColourProvider ColourProvider;
|
||||
|
||||
protected FullscreenOverlay(OverlayColourScheme colourScheme)
|
||||
protected FullscreenOverlay(OverlayColourScheme colourScheme, T header)
|
||||
{
|
||||
Header = header;
|
||||
|
||||
ColourProvider = new OverlayColourProvider(colourScheme);
|
||||
|
||||
RelativeSizeAxes = Axes.Both;
|
||||
|
14
osu.Game/Overlays/INamedOverlayComponent.cs
Normal file
14
osu.Game/Overlays/INamedOverlayComponent.cs
Normal file
@ -0,0 +1,14 @@
|
||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
namespace osu.Game.Overlays
|
||||
{
|
||||
public interface INamedOverlayComponent
|
||||
{
|
||||
string IconTexture { get; }
|
||||
|
||||
string Title { get; }
|
||||
|
||||
string Description { get; }
|
||||
}
|
||||
}
|
@ -57,7 +57,8 @@ namespace osu.Game.Overlays.News
|
||||
public NewsHeaderTitle()
|
||||
{
|
||||
Title = "news";
|
||||
IconTexture = "Icons/news";
|
||||
Description = "Get up-to-date on community happenings";
|
||||
IconTexture = "Icons/Hexacons/news";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -13,17 +13,16 @@ using osu.Game.Overlays.News.Displays;
|
||||
|
||||
namespace osu.Game.Overlays
|
||||
{
|
||||
public class NewsOverlay : FullscreenOverlay
|
||||
public class NewsOverlay : FullscreenOverlay<NewsHeader>
|
||||
{
|
||||
private readonly Bindable<string> article = new Bindable<string>(null);
|
||||
|
||||
private Container content;
|
||||
private LoadingLayer loading;
|
||||
private NewsHeader header;
|
||||
private OverlayScrollContainer scrollFlow;
|
||||
|
||||
public NewsOverlay()
|
||||
: base(OverlayColourScheme.Purple)
|
||||
: base(OverlayColourScheme.Purple, new NewsHeader())
|
||||
{
|
||||
}
|
||||
|
||||
@ -48,10 +47,10 @@ namespace osu.Game.Overlays
|
||||
Direction = FillDirection.Vertical,
|
||||
Children = new Drawable[]
|
||||
{
|
||||
header = new NewsHeader
|
||||
Header.With(h =>
|
||||
{
|
||||
ShowFrontPage = ShowFrontPage
|
||||
},
|
||||
h.ShowFrontPage = ShowFrontPage;
|
||||
}),
|
||||
content = new Container
|
||||
{
|
||||
RelativeSizeAxes = Axes.X,
|
||||
@ -112,12 +111,12 @@ namespace osu.Game.Overlays
|
||||
|
||||
if (e.NewValue == null)
|
||||
{
|
||||
header.SetFrontPage();
|
||||
Header.SetFrontPage();
|
||||
LoadDisplay(new FrontPageDisplay());
|
||||
return;
|
||||
}
|
||||
|
||||
header.SetArticle(e.NewValue);
|
||||
Header.SetArticle(e.NewValue);
|
||||
LoadDisplay(Empty());
|
||||
}
|
||||
|
||||
|
@ -16,8 +16,12 @@ using osu.Framework.Threading;
|
||||
|
||||
namespace osu.Game.Overlays
|
||||
{
|
||||
public class NotificationOverlay : OsuFocusedOverlayContainer
|
||||
public class NotificationOverlay : OsuFocusedOverlayContainer, INamedOverlayComponent
|
||||
{
|
||||
public string IconTexture => "Icons/Hexacons/notification";
|
||||
public string Title => "Notifications";
|
||||
public string Description => "Waiting for 'ya";
|
||||
|
||||
private const float width = 320;
|
||||
|
||||
public const float TRANSITION_LENGTH = 600;
|
||||
|
@ -25,8 +25,12 @@ using osuTK.Graphics;
|
||||
|
||||
namespace osu.Game.Overlays
|
||||
{
|
||||
public class NowPlayingOverlay : OsuFocusedOverlayContainer
|
||||
public class NowPlayingOverlay : OsuFocusedOverlayContainer, INamedOverlayComponent
|
||||
{
|
||||
public string IconTexture => "Icons/Hexacons/music";
|
||||
public string Title => "now playing";
|
||||
public string Description => "Manage the currently playing track";
|
||||
|
||||
private const float player_height = 130;
|
||||
private const float transition_length = 800;
|
||||
private const float progress_height = 10;
|
||||
|
@ -12,6 +12,8 @@ namespace osu.Game.Overlays
|
||||
{
|
||||
public abstract class OverlayHeader : Container
|
||||
{
|
||||
public OverlayTitle Title { get; }
|
||||
|
||||
private float contentSidePadding;
|
||||
|
||||
/// <summary>
|
||||
@ -73,7 +75,7 @@ namespace osu.Game.Overlays
|
||||
AutoSizeAxes = Axes.Y,
|
||||
Children = new[]
|
||||
{
|
||||
CreateTitle().With(title =>
|
||||
Title = CreateTitle().With(title =>
|
||||
{
|
||||
title.Anchor = Anchor.CentreLeft;
|
||||
title.Origin = Anchor.CentreLeft;
|
||||
|
@ -17,7 +17,7 @@ using osuTK.Graphics;
|
||||
namespace osu.Game.Overlays
|
||||
{
|
||||
/// <summary>
|
||||
/// <see cref="OsuScrollContainer"/> which provides <see cref="ScrollToTopButton"/>. Mostly used in <see cref="FullscreenOverlay"/>.
|
||||
/// <see cref="OsuScrollContainer"/> which provides <see cref="ScrollToTopButton"/>. Mostly used in <see cref="FullscreenOverlay{T}"/>.
|
||||
/// </summary>
|
||||
public class OverlayScrollContainer : OsuScrollContainer
|
||||
{
|
||||
|
@ -12,19 +12,27 @@ using osuTK;
|
||||
|
||||
namespace osu.Game.Overlays
|
||||
{
|
||||
public abstract class OverlayTitle : CompositeDrawable
|
||||
public abstract class OverlayTitle : CompositeDrawable, INamedOverlayComponent
|
||||
{
|
||||
private readonly OsuSpriteText title;
|
||||
private readonly OsuSpriteText titleText;
|
||||
private readonly Container icon;
|
||||
|
||||
protected string Title
|
||||
private string title;
|
||||
|
||||
public string Title
|
||||
{
|
||||
set => title.Text = value;
|
||||
get => title;
|
||||
protected set => titleText.Text = title = value;
|
||||
}
|
||||
|
||||
protected string IconTexture
|
||||
public string Description { get; protected set; }
|
||||
|
||||
private string iconTexture;
|
||||
|
||||
public string IconTexture
|
||||
{
|
||||
set => icon.Child = new OverlayTitleIcon(value);
|
||||
get => iconTexture;
|
||||
protected set => icon.Child = new OverlayTitleIcon(iconTexture = value);
|
||||
}
|
||||
|
||||
protected OverlayTitle()
|
||||
@ -45,7 +53,7 @@ namespace osu.Game.Overlays
|
||||
Margin = new MarginPadding { Horizontal = 5 }, // compensates for osu-web sprites having around 5px of whitespace on each side
|
||||
Size = new Vector2(30)
|
||||
},
|
||||
title = new OsuSpriteText
|
||||
titleText = new OsuSpriteText
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
|
@ -9,7 +9,7 @@ using osu.Game.Online.API;
|
||||
namespace osu.Game.Overlays
|
||||
{
|
||||
/// <summary>
|
||||
/// A subview containing online content, to be displayed inside a <see cref="FullscreenOverlay"/>.
|
||||
/// A subview containing online content, to be displayed inside a <see cref="FullscreenOverlay{T}"/>.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Automatically performs a data fetch on load.
|
||||
|
@ -97,7 +97,7 @@ namespace osu.Game.Overlays.Profile
|
||||
public ProfileHeaderTitle()
|
||||
{
|
||||
Title = "player info";
|
||||
IconTexture = "Icons/profile";
|
||||
IconTexture = "Icons/Hexacons/profile";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -30,7 +30,8 @@ namespace osu.Game.Overlays.Rankings
|
||||
public RankingsTitle()
|
||||
{
|
||||
Title = "ranking";
|
||||
IconTexture = "Icons/rankings";
|
||||
Description = "Find out who's the best right now";
|
||||
IconTexture = "Icons/Hexacons/rankings";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -17,17 +17,16 @@ using osu.Game.Overlays.Rankings.Tables;
|
||||
|
||||
namespace osu.Game.Overlays
|
||||
{
|
||||
public class RankingsOverlay : FullscreenOverlay
|
||||
public class RankingsOverlay : FullscreenOverlay<RankingsOverlayHeader>
|
||||
{
|
||||
protected Bindable<Country> Country => header.Country;
|
||||
protected Bindable<Country> Country => Header.Country;
|
||||
|
||||
protected Bindable<RankingsScope> Scope => header.Current;
|
||||
protected Bindable<RankingsScope> Scope => Header.Current;
|
||||
|
||||
private readonly OverlayScrollContainer scrollFlow;
|
||||
private readonly Container contentContainer;
|
||||
private readonly LoadingLayer loading;
|
||||
private readonly Box background;
|
||||
private readonly RankingsOverlayHeader header;
|
||||
|
||||
private APIRequest lastRequest;
|
||||
private CancellationTokenSource cancellationToken;
|
||||
@ -36,7 +35,12 @@ namespace osu.Game.Overlays
|
||||
private IAPIProvider api { get; set; }
|
||||
|
||||
public RankingsOverlay()
|
||||
: base(OverlayColourScheme.Green)
|
||||
: base(OverlayColourScheme.Green, new RankingsOverlayHeader
|
||||
{
|
||||
Anchor = Anchor.TopCentre,
|
||||
Origin = Anchor.TopCentre,
|
||||
Depth = -float.MaxValue
|
||||
})
|
||||
{
|
||||
Children = new Drawable[]
|
||||
{
|
||||
@ -55,12 +59,7 @@ namespace osu.Game.Overlays
|
||||
Direction = FillDirection.Vertical,
|
||||
Children = new Drawable[]
|
||||
{
|
||||
header = new RankingsOverlayHeader
|
||||
{
|
||||
Anchor = Anchor.TopCentre,
|
||||
Origin = Anchor.TopCentre,
|
||||
Depth = -float.MaxValue
|
||||
},
|
||||
Header,
|
||||
new Container
|
||||
{
|
||||
RelativeSizeAxes = Axes.X,
|
||||
@ -97,7 +96,7 @@ namespace osu.Game.Overlays
|
||||
{
|
||||
base.LoadComplete();
|
||||
|
||||
header.Ruleset.BindTo(ruleset);
|
||||
Header.Ruleset.BindTo(ruleset);
|
||||
|
||||
Country.BindValueChanged(_ =>
|
||||
{
|
||||
|
@ -36,7 +36,7 @@ namespace osu.Game.Overlays.SearchableList
|
||||
/// <summary>
|
||||
/// The amount of padding added to content (does not affect background or tab control strip).
|
||||
/// </summary>
|
||||
protected virtual float ContentHorizontalPadding => SearchableListOverlay.WIDTH_PADDING;
|
||||
protected virtual float ContentHorizontalPadding => WaveOverlayContainer.WIDTH_PADDING;
|
||||
|
||||
protected SearchableListFilterControl()
|
||||
{
|
||||
|
@ -1,82 +0,0 @@
|
||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using System;
|
||||
using osuTK;
|
||||
using osuTK.Graphics;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
|
||||
namespace osu.Game.Overlays.SearchableList
|
||||
{
|
||||
public abstract class SearchableListHeader<T> : Container
|
||||
where T : struct, Enum
|
||||
{
|
||||
public readonly HeaderTabControl<T> Tabs;
|
||||
|
||||
protected abstract Color4 BackgroundColour { get; }
|
||||
protected abstract T DefaultTab { get; }
|
||||
protected abstract Drawable CreateHeaderText();
|
||||
protected abstract IconUsage Icon { get; }
|
||||
|
||||
protected SearchableListHeader()
|
||||
{
|
||||
RelativeSizeAxes = Axes.X;
|
||||
Height = 90;
|
||||
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new Box
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Colour = BackgroundColour,
|
||||
},
|
||||
new Container
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Padding = new MarginPadding { Left = SearchableListOverlay.WIDTH_PADDING, Right = SearchableListOverlay.WIDTH_PADDING },
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new FillFlowContainer
|
||||
{
|
||||
Anchor = Anchor.CentreLeft,
|
||||
Origin = Anchor.BottomLeft,
|
||||
Position = new Vector2(-35f, 5f),
|
||||
AutoSizeAxes = Axes.Both,
|
||||
Direction = FillDirection.Horizontal,
|
||||
Spacing = new Vector2(10f, 0f),
|
||||
Children = new[]
|
||||
{
|
||||
new SpriteIcon
|
||||
{
|
||||
Size = new Vector2(25),
|
||||
Icon = Icon,
|
||||
},
|
||||
CreateHeaderText(),
|
||||
},
|
||||
},
|
||||
Tabs = new HeaderTabControl<T>
|
||||
{
|
||||
Anchor = Anchor.BottomLeft,
|
||||
Origin = Anchor.BottomLeft,
|
||||
RelativeSizeAxes = Axes.X,
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
Tabs.Current.Value = DefaultTab;
|
||||
Tabs.Current.TriggerChange();
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuColour colours)
|
||||
{
|
||||
Tabs.StripColour = colours.Green;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,128 +0,0 @@
|
||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using System;
|
||||
using osuTK.Graphics;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Framework.Input.Events;
|
||||
using osu.Game.Graphics.Backgrounds;
|
||||
using osu.Game.Graphics.Cursor;
|
||||
|
||||
namespace osu.Game.Overlays.SearchableList
|
||||
{
|
||||
public abstract class SearchableListOverlay : FullscreenOverlay
|
||||
{
|
||||
public const float WIDTH_PADDING = 80;
|
||||
|
||||
protected SearchableListOverlay(OverlayColourScheme colourScheme)
|
||||
: base(colourScheme)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public abstract class SearchableListOverlay<THeader, TTab, TCategory> : SearchableListOverlay
|
||||
where THeader : struct, Enum
|
||||
where TTab : struct, Enum
|
||||
where TCategory : struct, Enum
|
||||
{
|
||||
private readonly Container scrollContainer;
|
||||
|
||||
protected readonly SearchableListHeader<THeader> Header;
|
||||
protected readonly SearchableListFilterControl<TTab, TCategory> Filter;
|
||||
protected readonly FillFlowContainer ScrollFlow;
|
||||
|
||||
protected abstract Color4 BackgroundColour { get; }
|
||||
protected abstract Color4 TrianglesColourLight { get; }
|
||||
protected abstract Color4 TrianglesColourDark { get; }
|
||||
protected abstract SearchableListHeader<THeader> CreateHeader();
|
||||
protected abstract SearchableListFilterControl<TTab, TCategory> CreateFilterControl();
|
||||
|
||||
protected SearchableListOverlay(OverlayColourScheme colourScheme)
|
||||
: base(colourScheme)
|
||||
{
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new Box
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Colour = BackgroundColour,
|
||||
},
|
||||
new Container
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Masking = true,
|
||||
Children = new[]
|
||||
{
|
||||
new Triangles
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
TriangleScale = 5,
|
||||
ColourLight = TrianglesColourLight,
|
||||
ColourDark = TrianglesColourDark,
|
||||
},
|
||||
},
|
||||
},
|
||||
scrollContainer = new Container
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Child = new OsuContextMenuContainer
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Masking = true,
|
||||
Child = new OverlayScrollContainer
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
ScrollbarVisible = false,
|
||||
Child = ScrollFlow = new FillFlowContainer
|
||||
{
|
||||
RelativeSizeAxes = Axes.X,
|
||||
AutoSizeAxes = Axes.Y,
|
||||
Padding = new MarginPadding { Horizontal = 10, Bottom = 50 },
|
||||
Direction = FillDirection.Vertical,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
new FillFlowContainer
|
||||
{
|
||||
RelativeSizeAxes = Axes.X,
|
||||
AutoSizeAxes = Axes.Y,
|
||||
Direction = FillDirection.Vertical,
|
||||
Children = new Drawable[]
|
||||
{
|
||||
Header = CreateHeader(),
|
||||
Filter = CreateFilterControl(),
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
protected override void Update()
|
||||
{
|
||||
base.Update();
|
||||
|
||||
scrollContainer.Padding = new MarginPadding { Top = Header.Height + Filter.Height };
|
||||
}
|
||||
|
||||
protected override void OnFocus(FocusEvent e)
|
||||
{
|
||||
Filter.Search.TakeFocus();
|
||||
}
|
||||
|
||||
protected override void PopIn()
|
||||
{
|
||||
base.PopIn();
|
||||
|
||||
Filter.Search.HoldFocus = true;
|
||||
}
|
||||
|
||||
protected override void PopOut()
|
||||
{
|
||||
base.PopOut();
|
||||
|
||||
Filter.Search.HoldFocus = false;
|
||||
}
|
||||
}
|
||||
}
|
@ -163,8 +163,7 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics
|
||||
scalingSettings.ForEach(s => s.TransferValueOnCommit = mode.NewValue == ScalingMode.Everything);
|
||||
}, true);
|
||||
|
||||
windowModes.ItemsAdded += _ => windowModesChanged();
|
||||
windowModes.ItemsRemoved += _ => windowModesChanged();
|
||||
windowModes.CollectionChanged += (sender, args) => windowModesChanged();
|
||||
|
||||
windowModesChanged();
|
||||
}
|
||||
|
@ -4,22 +4,21 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using osu.Framework;
|
||||
using osuTK;
|
||||
using osuTK.Graphics;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Framework.Input.Events;
|
||||
using osu.Framework.Threading;
|
||||
using osu.Game.Graphics.Containers;
|
||||
using osu.Game.Overlays.Toolbar;
|
||||
using osuTK;
|
||||
using osuTK.Graphics;
|
||||
|
||||
namespace osu.Game.Overlays.Settings
|
||||
{
|
||||
public class Sidebar : Container<SidebarButton>, IStateful<ExpandedState>
|
||||
{
|
||||
private readonly FillFlowContainer<SidebarButton> content;
|
||||
public const float DEFAULT_WIDTH = ToolbarButton.WIDTH;
|
||||
public const float DEFAULT_WIDTH = Toolbar.Toolbar.HEIGHT * 1.4f;
|
||||
public const int EXPANDED_WIDTH = 200;
|
||||
|
||||
public event Action<ExpandedState> StateChanged;
|
||||
|
@ -13,8 +13,12 @@ using osu.Framework.Bindables;
|
||||
|
||||
namespace osu.Game.Overlays
|
||||
{
|
||||
public class SettingsOverlay : SettingsPanel
|
||||
public class SettingsOverlay : SettingsPanel, INamedOverlayComponent
|
||||
{
|
||||
public string IconTexture => "Icons/Hexacons/settings";
|
||||
public string Title => "settings";
|
||||
public string Description => "Change the way osu! behaves";
|
||||
|
||||
protected override IEnumerable<SettingsSection> CreateSections() => new SettingsSection[]
|
||||
{
|
||||
new GeneralSection(),
|
||||
@ -30,7 +34,7 @@ namespace osu.Game.Overlays
|
||||
|
||||
private readonly List<SettingsSubPanel> subPanels = new List<SettingsSubPanel>();
|
||||
|
||||
protected override Drawable CreateHeader() => new SettingsHeader("settings", "Change the way osu! behaves");
|
||||
protected override Drawable CreateHeader() => new SettingsHeader(Title, Description);
|
||||
protected override Drawable CreateFooter() => new SettingsFooter();
|
||||
|
||||
public SettingsOverlay()
|
||||
|
@ -28,7 +28,7 @@ namespace osu.Game.Overlays.Toolbar
|
||||
|
||||
private const double transition_time = 500;
|
||||
|
||||
protected readonly Bindable<OverlayActivation> OverlayActivationMode = new Bindable<OverlayActivation>(OverlayActivation.All);
|
||||
protected readonly IBindable<OverlayActivation> OverlayActivationMode = new Bindable<OverlayActivation>(OverlayActivation.All);
|
||||
|
||||
// Toolbar components like RulesetSelector should receive keyboard input events even when the toolbar is hidden.
|
||||
public override bool PropagateNonPositionalInputSubTree => true;
|
||||
|
@ -2,7 +2,6 @@
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Input.Bindings;
|
||||
|
||||
namespace osu.Game.Overlays.Toolbar
|
||||
@ -11,10 +10,6 @@ namespace osu.Game.Overlays.Toolbar
|
||||
{
|
||||
public ToolbarBeatmapListingButton()
|
||||
{
|
||||
SetIcon(OsuIcon.ChevronDownCircle);
|
||||
TooltipMain = "Beatmap listing";
|
||||
TooltipSub = "Browse for new beatmaps";
|
||||
|
||||
Hotkey = GlobalAction.ToggleDirect;
|
||||
}
|
||||
|
||||
|
@ -9,6 +9,7 @@ using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Effects;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Graphics.Textures;
|
||||
using osu.Framework.Input.Bindings;
|
||||
using osu.Framework.Input.Events;
|
||||
using osu.Game.Graphics;
|
||||
@ -25,8 +26,6 @@ namespace osu.Game.Overlays.Toolbar
|
||||
{
|
||||
public abstract class ToolbarButton : OsuClickableContainer, IKeyBindingHandler<GlobalAction>
|
||||
{
|
||||
public const float WIDTH = Toolbar.HEIGHT * 1.4f;
|
||||
|
||||
protected GlobalAction? Hotkey { get; set; }
|
||||
|
||||
public void SetIcon(Drawable icon)
|
||||
@ -35,16 +34,14 @@ namespace osu.Game.Overlays.Toolbar
|
||||
IconContainer.Show();
|
||||
}
|
||||
|
||||
public void SetIcon(IconUsage icon) => SetIcon(new SpriteIcon
|
||||
{
|
||||
Size = new Vector2(20),
|
||||
Icon = icon
|
||||
});
|
||||
[Resolved]
|
||||
private TextureStore textures { get; set; }
|
||||
|
||||
public IconUsage Icon
|
||||
public void SetIcon(string texture) =>
|
||||
SetIcon(new Sprite
|
||||
{
|
||||
set => SetIcon(value);
|
||||
}
|
||||
Texture = textures.Get(texture),
|
||||
});
|
||||
|
||||
public string Text
|
||||
{
|
||||
@ -82,7 +79,7 @@ namespace osu.Game.Overlays.Toolbar
|
||||
protected ToolbarButton()
|
||||
: base(HoverSampleSet.Loud)
|
||||
{
|
||||
Width = WIDTH;
|
||||
Width = Toolbar.HEIGHT;
|
||||
RelativeSizeAxes = Axes.Y;
|
||||
|
||||
Children = new Drawable[]
|
||||
@ -116,7 +113,7 @@ namespace osu.Game.Overlays.Toolbar
|
||||
{
|
||||
Anchor = Anchor.CentreLeft,
|
||||
Origin = Anchor.CentreLeft,
|
||||
Size = new Vector2(20),
|
||||
Size = new Vector2(26),
|
||||
Alpha = 0,
|
||||
},
|
||||
DrawableText = new OsuSpriteText
|
||||
|
@ -2,19 +2,11 @@
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
|
||||
namespace osu.Game.Overlays.Toolbar
|
||||
{
|
||||
public class ToolbarChangelogButton : ToolbarOverlayToggleButton
|
||||
{
|
||||
public ToolbarChangelogButton()
|
||||
{
|
||||
SetIcon(FontAwesome.Solid.Bullhorn);
|
||||
TooltipMain = "Changelog";
|
||||
TooltipSub = "Track recent dev updates in the osu! ecosystem";
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader(true)]
|
||||
private void load(ChangelogOverlay changelog)
|
||||
{
|
||||
|
@ -2,7 +2,6 @@
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Game.Input.Bindings;
|
||||
|
||||
namespace osu.Game.Overlays.Toolbar
|
||||
@ -11,10 +10,6 @@ namespace osu.Game.Overlays.Toolbar
|
||||
{
|
||||
public ToolbarChatButton()
|
||||
{
|
||||
SetIcon(FontAwesome.Solid.Comments);
|
||||
TooltipMain = "Chat";
|
||||
TooltipSub = "Join the real-time discussion";
|
||||
|
||||
Hotkey = GlobalAction.ToggleChat;
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Game.Input.Bindings;
|
||||
|
||||
namespace osu.Game.Overlays.Toolbar
|
||||
@ -10,11 +10,16 @@ namespace osu.Game.Overlays.Toolbar
|
||||
{
|
||||
public ToolbarHomeButton()
|
||||
{
|
||||
Icon = FontAwesome.Solid.Home;
|
||||
TooltipMain = "Home";
|
||||
TooltipSub = "Return to the main menu";
|
||||
|
||||
Width *= 1.4f;
|
||||
Hotkey = GlobalAction.Home;
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
{
|
||||
TooltipMain = "Home";
|
||||
TooltipSub = "Return to the main menu";
|
||||
SetIcon("Icons/Hexacons/home");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3,7 +3,6 @@
|
||||
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Game.Input.Bindings;
|
||||
|
||||
namespace osu.Game.Overlays.Toolbar
|
||||
@ -14,10 +13,6 @@ namespace osu.Game.Overlays.Toolbar
|
||||
|
||||
public ToolbarMusicButton()
|
||||
{
|
||||
Icon = FontAwesome.Solid.Music;
|
||||
TooltipMain = "Now playing";
|
||||
TooltipSub = "Manage the currently playing track";
|
||||
|
||||
Hotkey = GlobalAction.ToggleNowPlaying;
|
||||
}
|
||||
|
||||
|
@ -2,19 +2,11 @@
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
|
||||
namespace osu.Game.Overlays.Toolbar
|
||||
{
|
||||
public class ToolbarNewsButton : ToolbarOverlayToggleButton
|
||||
{
|
||||
public ToolbarNewsButton()
|
||||
{
|
||||
Icon = FontAwesome.Solid.Newspaper;
|
||||
TooltipMain = "News";
|
||||
TooltipSub = "Get up-to-date on community happenings";
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader(true)]
|
||||
private void load(NewsOverlay news)
|
||||
{
|
||||
|
@ -6,7 +6,6 @@ using osu.Framework.Bindables;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using osu.Game.Input.Bindings;
|
||||
@ -25,10 +24,6 @@ namespace osu.Game.Overlays.Toolbar
|
||||
|
||||
public ToolbarNotificationButton()
|
||||
{
|
||||
Icon = FontAwesome.Solid.Bars;
|
||||
TooltipMain = "Notifications";
|
||||
TooltipSub = "Waiting for 'ya";
|
||||
|
||||
Hotkey = GlobalAction.ToggleNotifications;
|
||||
|
||||
Add(countDisplay = new CountCircle
|
||||
|
@ -32,6 +32,13 @@ namespace osu.Game.Overlays.Toolbar
|
||||
Action = stateContainer.ToggleVisibility;
|
||||
overlayState.BindTo(stateContainer.State);
|
||||
}
|
||||
|
||||
if (stateContainer is INamedOverlayComponent named)
|
||||
{
|
||||
TooltipMain = named.Title;
|
||||
TooltipSub = named.Description;
|
||||
SetIcon(named.IconTexture);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2,19 +2,11 @@
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
|
||||
namespace osu.Game.Overlays.Toolbar
|
||||
{
|
||||
public class ToolbarRankingsButton : ToolbarOverlayToggleButton
|
||||
{
|
||||
public ToolbarRankingsButton()
|
||||
{
|
||||
SetIcon(FontAwesome.Regular.ChartBar);
|
||||
TooltipMain = "Ranking";
|
||||
TooltipSub = "Find out who's the best right now";
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader(true)]
|
||||
private void load(RankingsOverlay rankings)
|
||||
{
|
||||
|
@ -37,7 +37,7 @@ namespace osu.Game.Overlays.Toolbar
|
||||
},
|
||||
ModeButtonLine = new Container
|
||||
{
|
||||
Size = new Vector2(ToolbarButton.WIDTH, 3),
|
||||
Size = new Vector2(Toolbar.HEIGHT, 3),
|
||||
Anchor = Anchor.BottomLeft,
|
||||
Origin = Anchor.TopLeft,
|
||||
Masking = true,
|
||||
|
@ -65,12 +65,6 @@ namespace osu.Game.Overlays.Toolbar
|
||||
Parent.Click();
|
||||
return base.OnClick(e);
|
||||
}
|
||||
|
||||
protected override void LoadComplete()
|
||||
{
|
||||
base.LoadComplete();
|
||||
IconContainer.Scale *= 1.4f;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2,7 +2,6 @@
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Game.Input.Bindings;
|
||||
|
||||
namespace osu.Game.Overlays.Toolbar
|
||||
@ -11,10 +10,7 @@ namespace osu.Game.Overlays.Toolbar
|
||||
{
|
||||
public ToolbarSettingsButton()
|
||||
{
|
||||
Icon = FontAwesome.Solid.Cog;
|
||||
TooltipMain = "Settings";
|
||||
TooltipSub = "Change your settings";
|
||||
|
||||
Width *= 1.4f;
|
||||
Hotkey = GlobalAction.ToggleSettings;
|
||||
}
|
||||
|
||||
|
@ -2,7 +2,6 @@
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Game.Input.Bindings;
|
||||
|
||||
namespace osu.Game.Overlays.Toolbar
|
||||
@ -11,10 +10,6 @@ namespace osu.Game.Overlays.Toolbar
|
||||
{
|
||||
public ToolbarSocialButton()
|
||||
{
|
||||
Icon = FontAwesome.Solid.Users;
|
||||
TooltipMain = "Friends";
|
||||
TooltipSub = "Interact with those close to you";
|
||||
|
||||
Hotkey = GlobalAction.ToggleSocial;
|
||||
}
|
||||
|
||||
|
@ -17,19 +17,18 @@ using osuTK;
|
||||
|
||||
namespace osu.Game.Overlays
|
||||
{
|
||||
public class UserProfileOverlay : FullscreenOverlay
|
||||
public class UserProfileOverlay : FullscreenOverlay<ProfileHeader>
|
||||
{
|
||||
private ProfileSection lastSection;
|
||||
private ProfileSection[] sections;
|
||||
private GetUserRequest userReq;
|
||||
protected ProfileHeader Header;
|
||||
private ProfileSectionsContainer sectionsContainer;
|
||||
private ProfileSectionTabControl tabs;
|
||||
|
||||
public const float CONTENT_X_MARGIN = 70;
|
||||
|
||||
public UserProfileOverlay()
|
||||
: base(OverlayColourScheme.Pink)
|
||||
: base(OverlayColourScheme.Pink, new ProfileHeader())
|
||||
{
|
||||
}
|
||||
|
||||
@ -45,6 +44,9 @@ namespace osu.Game.Overlays
|
||||
if (user.Id == Header?.User.Value?.Id)
|
||||
return;
|
||||
|
||||
if (sectionsContainer != null)
|
||||
sectionsContainer.ExpandableHeader = null;
|
||||
|
||||
userReq?.Cancel();
|
||||
Clear();
|
||||
lastSection = null;
|
||||
@ -77,7 +79,7 @@ namespace osu.Game.Overlays
|
||||
|
||||
Add(sectionsContainer = new ProfileSectionsContainer
|
||||
{
|
||||
ExpandableHeader = Header = new ProfileHeader(),
|
||||
ExpandableHeader = Header,
|
||||
FixedHeader = tabs,
|
||||
HeaderBackground = new Box
|
||||
{
|
||||
|
@ -14,6 +14,8 @@ namespace osu.Game.Overlays
|
||||
protected override bool BlockNonPositionalInput => true;
|
||||
protected override Container<Drawable> Content => Waves;
|
||||
|
||||
public const float WIDTH_PADDING = 80;
|
||||
|
||||
protected override bool StartHidden => true;
|
||||
|
||||
protected WaveOverlayContainer()
|
||||
|
@ -112,8 +112,7 @@ namespace osu.Game.Screens.Edit.Timing
|
||||
};
|
||||
|
||||
controlPoints = group.ControlPoints.GetBoundCopy();
|
||||
controlPoints.ItemsAdded += _ => createChildren();
|
||||
controlPoints.ItemsRemoved += _ => createChildren();
|
||||
controlPoints.CollectionChanged += (_, __) => createChildren();
|
||||
|
||||
createChildren();
|
||||
}
|
||||
|
@ -124,8 +124,7 @@ namespace osu.Game.Screens.Edit.Timing
|
||||
selectedGroup.BindValueChanged(selected => { deleteButton.Enabled.Value = selected.NewValue != null; }, true);
|
||||
|
||||
controlGroups = Beatmap.Value.Beatmap.ControlPointInfo.Groups.GetBoundCopy();
|
||||
controlGroups.ItemsAdded += _ => createContent();
|
||||
controlGroups.ItemsRemoved += _ => createContent();
|
||||
controlGroups.CollectionChanged += (sender, args) => createContent();
|
||||
createContent();
|
||||
}
|
||||
|
||||
|
@ -39,9 +39,9 @@ namespace osu.Game.Screens
|
||||
bool HideOverlaysOnEnter { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Whether overlays should be able to be opened once this screen is entered or resumed.
|
||||
/// Whether overlays should be able to be opened when this screen is current.
|
||||
/// </summary>
|
||||
OverlayActivation InitialOverlayActivationMode { get; }
|
||||
IBindable<OverlayActivation> OverlayActivationMode { get; }
|
||||
|
||||
/// <summary>
|
||||
/// The amount of parallax to be applied while this screen is displayed.
|
||||
|
@ -270,9 +270,6 @@ namespace osu.Game.Screens.Menu
|
||||
ButtonSystemState lastState = state;
|
||||
state = value;
|
||||
|
||||
if (game != null)
|
||||
game.OverlayActivationMode.Value = state == ButtonSystemState.Exit ? OverlayActivation.Disabled : OverlayActivation.All;
|
||||
|
||||
updateLogoState(lastState);
|
||||
|
||||
Logger.Log($"{nameof(ButtonSystem)}'s state changed from {lastState} to {state}");
|
||||
|
@ -46,8 +46,6 @@ namespace osu.Game.Screens.Menu
|
||||
|
||||
protected ITrack Track { get; private set; }
|
||||
|
||||
private readonly BindableDouble exitingVolumeFade = new BindableDouble(1);
|
||||
|
||||
private const int exit_delay = 3000;
|
||||
|
||||
private SampleChannel seeya;
|
||||
@ -127,17 +125,35 @@ namespace osu.Game.Screens.Menu
|
||||
this.FadeIn(300);
|
||||
|
||||
double fadeOutTime = exit_delay;
|
||||
|
||||
var track = musicController.CurrentTrack;
|
||||
|
||||
// ensure the track doesn't change or loop as we are exiting.
|
||||
track.Looping = false;
|
||||
Beatmap.Disabled = true;
|
||||
|
||||
// we also handle the exit transition.
|
||||
if (MenuVoice.Value)
|
||||
{
|
||||
seeya.Play();
|
||||
|
||||
// if playing the outro voice, we have more time to have fun with the background track.
|
||||
// initially fade to almost silent then ramp out over the remaining time.
|
||||
const double initial_fade = 200;
|
||||
track
|
||||
.VolumeTo(0.03f, initial_fade).Then()
|
||||
.VolumeTo(0, fadeOutTime - initial_fade, Easing.In);
|
||||
}
|
||||
else
|
||||
{
|
||||
fadeOutTime = 500;
|
||||
|
||||
audio.AddAdjustment(AdjustableProperty.Volume, exitingVolumeFade);
|
||||
this.TransformBindableTo(exitingVolumeFade, 0, fadeOutTime).OnComplete(_ => this.Exit());
|
||||
// if outro voice is turned off, just do a simple fade out.
|
||||
track.VolumeTo(0, fadeOutTime, Easing.Out);
|
||||
}
|
||||
|
||||
//don't want to fade out completely else we will stop running updates.
|
||||
Game.FadeTo(0.01f, fadeOutTime);
|
||||
Game.FadeTo(0.01f, fadeOutTime).OnComplete(_ => this.Exit());
|
||||
|
||||
base.OnResuming(last);
|
||||
}
|
||||
|
@ -280,6 +280,7 @@ namespace osu.Game.Screens.Menu
|
||||
}
|
||||
|
||||
buttons.State = ButtonSystemState.Exit;
|
||||
OverlayActivationMode.Value = OverlayActivation.Disabled;
|
||||
|
||||
songTicker.Hide();
|
||||
|
||||
|
@ -11,8 +11,8 @@ using osu.Framework.Graphics.UserInterface;
|
||||
using osu.Framework.Screens;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
using osu.Game.Overlays.SearchableList;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using osu.Game.Overlays;
|
||||
using osuTK;
|
||||
using osuTK.Graphics;
|
||||
|
||||
@ -42,7 +42,7 @@ namespace osu.Game.Screens.Multi
|
||||
Anchor = Anchor.CentreLeft,
|
||||
Origin = Anchor.CentreLeft,
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Padding = new MarginPadding { Left = SearchableListOverlay.WIDTH_PADDING + OsuScreen.HORIZONTAL_OVERFLOW_PADDING },
|
||||
Padding = new MarginPadding { Left = WaveOverlayContainer.WIDTH_PADDING + OsuScreen.HORIZONTAL_OVERFLOW_PADDING },
|
||||
Children = new Drawable[]
|
||||
{
|
||||
title = new MultiHeaderTitle
|
||||
|
@ -3,6 +3,7 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Specialized;
|
||||
using System.Linq;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Bindables;
|
||||
@ -53,8 +54,7 @@ namespace osu.Game.Screens.Multi.Lounge.Components
|
||||
|
||||
protected override void LoadComplete()
|
||||
{
|
||||
rooms.ItemsAdded += addRooms;
|
||||
rooms.ItemsRemoved += removeRooms;
|
||||
rooms.CollectionChanged += roomsChanged;
|
||||
roomManager.RoomsUpdated += updateSorting;
|
||||
|
||||
rooms.BindTo(roomManager.Rooms);
|
||||
@ -82,6 +82,20 @@ namespace osu.Game.Screens.Multi.Lounge.Components
|
||||
});
|
||||
}
|
||||
|
||||
private void roomsChanged(object sender, NotifyCollectionChangedEventArgs args)
|
||||
{
|
||||
switch (args.Action)
|
||||
{
|
||||
case NotifyCollectionChangedAction.Add:
|
||||
addRooms(args.NewItems.Cast<Room>());
|
||||
break;
|
||||
|
||||
case NotifyCollectionChangedAction.Remove:
|
||||
removeRooms(args.OldItems.Cast<Room>());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void addRooms(IEnumerable<Room> rooms)
|
||||
{
|
||||
foreach (var room in rooms)
|
||||
|
@ -12,7 +12,6 @@ using osu.Game.Graphics.Containers;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
using osu.Game.Online.Multiplayer;
|
||||
using osu.Game.Overlays;
|
||||
using osu.Game.Overlays.SearchableList;
|
||||
using osu.Game.Screens.Multi.Lounge.Components;
|
||||
using osu.Game.Screens.Multi.Match;
|
||||
|
||||
@ -102,8 +101,8 @@ namespace osu.Game.Screens.Multi.Lounge
|
||||
content.Padding = new MarginPadding
|
||||
{
|
||||
Top = Filter.DrawHeight,
|
||||
Left = SearchableListOverlay.WIDTH_PADDING - DrawableRoom.SELECTION_BORDER_WIDTH + HORIZONTAL_OVERFLOW_PADDING,
|
||||
Right = SearchableListOverlay.WIDTH_PADDING + HORIZONTAL_OVERFLOW_PADDING,
|
||||
Left = WaveOverlayContainer.WIDTH_PADDING - DrawableRoom.SELECTION_BORDER_WIDTH + HORIZONTAL_OVERFLOW_PADDING,
|
||||
Right = WaveOverlayContainer.WIDTH_PADDING + HORIZONTAL_OVERFLOW_PADDING,
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -14,8 +14,6 @@ namespace osu.Game.Screens.Multi.Match.Components
|
||||
{
|
||||
public class MatchLeaderboard : Leaderboard<MatchLeaderboardScope, APIUserScoreAggregate>
|
||||
{
|
||||
public Action<IEnumerable<APIUserScoreAggregate>> ScoresLoaded;
|
||||
|
||||
[Resolved(typeof(Room), nameof(Room.RoomID))]
|
||||
private Bindable<int?> roomId { get; set; }
|
||||
|
||||
@ -39,18 +37,20 @@ namespace osu.Game.Screens.Multi.Match.Components
|
||||
if (roomId.Value == null)
|
||||
return null;
|
||||
|
||||
var req = new GetRoomScoresRequest(roomId.Value ?? 0);
|
||||
var req = new GetRoomLeaderboardRequest(roomId.Value ?? 0);
|
||||
|
||||
req.Success += r =>
|
||||
{
|
||||
scoresCallback?.Invoke(r);
|
||||
ScoresLoaded?.Invoke(r);
|
||||
scoresCallback?.Invoke(r.Leaderboard);
|
||||
TopScore = r.UserScore;
|
||||
};
|
||||
|
||||
return req;
|
||||
}
|
||||
|
||||
protected override LeaderboardScore CreateDrawableScore(APIUserScoreAggregate model, int index) => new MatchLeaderboardScore(model, index);
|
||||
|
||||
protected override LeaderboardScore CreateDrawableTopScore(APIUserScoreAggregate model) => new MatchLeaderboardScore(model, model.Position, false);
|
||||
}
|
||||
|
||||
public enum MatchLeaderboardScope
|
||||
|
@ -14,8 +14,8 @@ namespace osu.Game.Screens.Multi.Match.Components
|
||||
{
|
||||
private readonly APIUserScoreAggregate score;
|
||||
|
||||
public MatchLeaderboardScore(APIUserScoreAggregate score, int rank)
|
||||
: base(score.CreateScoreInfo(), rank)
|
||||
public MatchLeaderboardScore(APIUserScoreAggregate score, int? rank, bool allowHighlight = true)
|
||||
: base(score.CreateScoreInfo(), rank, allowHighlight)
|
||||
{
|
||||
this.score = score;
|
||||
}
|
||||
|
@ -14,7 +14,7 @@ using osu.Game.Graphics.Containers;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
using osu.Game.Online.Multiplayer;
|
||||
using osu.Game.Overlays.SearchableList;
|
||||
using osu.Game.Overlays;
|
||||
using osuTK;
|
||||
using osuTK.Graphics;
|
||||
|
||||
@ -117,7 +117,7 @@ namespace osu.Game.Screens.Multi.Match.Components
|
||||
{
|
||||
new Container
|
||||
{
|
||||
Padding = new MarginPadding { Horizontal = SearchableListOverlay.WIDTH_PADDING },
|
||||
Padding = new MarginPadding { Horizontal = WaveOverlayContainer.WIDTH_PADDING },
|
||||
RelativeSizeAxes = Axes.X,
|
||||
AutoSizeAxes = Axes.Y,
|
||||
Children = new Drawable[]
|
||||
|
@ -172,7 +172,7 @@ namespace osu.Game.Screens.Multi.Match
|
||||
new Dimension(GridSizeMode.AutoSize),
|
||||
new Dimension(),
|
||||
new Dimension(GridSizeMode.AutoSize),
|
||||
new Dimension(GridSizeMode.Relative, size: 0.4f, minSize: 240),
|
||||
new Dimension(GridSizeMode.Relative, size: 0.4f, minSize: 120),
|
||||
}
|
||||
},
|
||||
null
|
||||
|
@ -44,9 +44,13 @@ namespace osu.Game.Screens
|
||||
public virtual bool HideOverlaysOnEnter => false;
|
||||
|
||||
/// <summary>
|
||||
/// Whether overlays should be able to be opened once this screen is entered or resumed.
|
||||
/// The initial overlay activation mode to use when this screen is entered for the first time.
|
||||
/// </summary>
|
||||
public virtual OverlayActivation InitialOverlayActivationMode => OverlayActivation.All;
|
||||
protected virtual OverlayActivation InitialOverlayActivationMode => OverlayActivation.All;
|
||||
|
||||
protected readonly Bindable<OverlayActivation> OverlayActivationMode;
|
||||
|
||||
IBindable<OverlayActivation> IOsuScreen.OverlayActivationMode => OverlayActivationMode;
|
||||
|
||||
public virtual bool CursorVisible => true;
|
||||
|
||||
@ -138,6 +142,8 @@ namespace osu.Game.Screens
|
||||
{
|
||||
Anchor = Anchor.Centre;
|
||||
Origin = Anchor.Centre;
|
||||
|
||||
OverlayActivationMode = new Bindable<OverlayActivation>(InitialOverlayActivationMode);
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader(true)]
|
||||
|
@ -50,7 +50,7 @@ namespace osu.Game.Screens.Play
|
||||
|
||||
public override bool HideOverlaysOnEnter => true;
|
||||
|
||||
public override OverlayActivation InitialOverlayActivationMode => OverlayActivation.UserTriggered;
|
||||
protected override OverlayActivation InitialOverlayActivationMode => OverlayActivation.UserTriggered;
|
||||
|
||||
// We are managing our own adjustments (see OnEntering/OnExiting).
|
||||
public override bool AllowRateAdjustments => false;
|
||||
|
@ -9,7 +9,6 @@ using osu.Framework.Bindables;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Online.API;
|
||||
using osu.Game.Online.API.Requests;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Online.Leaderboards;
|
||||
using osu.Game.Rulesets;
|
||||
using osu.Game.Rulesets.Mods;
|
||||
@ -41,25 +40,8 @@ namespace osu.Game.Screens.Select.Leaderboards
|
||||
}
|
||||
}
|
||||
|
||||
public APILegacyUserTopScoreInfo TopScore
|
||||
{
|
||||
get => topScoreContainer.Score.Value;
|
||||
set
|
||||
{
|
||||
if (value == null)
|
||||
topScoreContainer.Hide();
|
||||
else
|
||||
{
|
||||
topScoreContainer.Show();
|
||||
topScoreContainer.Score.Value = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private bool filterMods;
|
||||
|
||||
private UserTopScoreContainer topScoreContainer;
|
||||
|
||||
private IBindable<WeakReference<ScoreInfo>> itemRemoved;
|
||||
|
||||
/// <summary>
|
||||
@ -101,11 +83,6 @@ namespace osu.Game.Screens.Select.Leaderboards
|
||||
UpdateScores();
|
||||
};
|
||||
|
||||
Content.Add(topScoreContainer = new UserTopScoreContainer
|
||||
{
|
||||
ScoreSelected = s => ScoreSelected?.Invoke(s)
|
||||
});
|
||||
|
||||
itemRemoved = scoreManager.ItemRemoved.GetBoundCopy();
|
||||
itemRemoved.BindValueChanged(onScoreRemoved);
|
||||
}
|
||||
@ -183,7 +160,7 @@ namespace osu.Game.Screens.Select.Leaderboards
|
||||
req.Success += r =>
|
||||
{
|
||||
scoresCallback?.Invoke(r.Scores.Select(s => s.CreateScoreInfo(rulesets)));
|
||||
TopScore = r.UserScore;
|
||||
TopScore = r.UserScore?.CreateScoreInfo(rulesets);
|
||||
};
|
||||
|
||||
return req;
|
||||
@ -193,5 +170,10 @@ namespace osu.Game.Screens.Select.Leaderboards
|
||||
{
|
||||
Action = () => ScoreSelected?.Invoke(model)
|
||||
};
|
||||
|
||||
protected override LeaderboardScore CreateDrawableTopScore(ScoreInfo model) => new LeaderboardScore(model, model.Position, false)
|
||||
{
|
||||
Action = () => ScoreSelected?.Invoke(model)
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -18,6 +18,6 @@ namespace osu.Game.Screens
|
||||
|
||||
public override bool AllowRateAdjustments => false;
|
||||
|
||||
public override OverlayActivation InitialOverlayActivationMode => OverlayActivation.Disabled;
|
||||
protected override OverlayActivation InitialOverlayActivationMode => OverlayActivation.Disabled;
|
||||
}
|
||||
}
|
||||
|
@ -24,8 +24,8 @@
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.2.6" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.6" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
|
||||
<PackageReference Include="ppy.osu.Framework" Version="2020.819.0" />
|
||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2020.812.0" />
|
||||
<PackageReference Include="ppy.osu.Framework" Version="2020.903.0" />
|
||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2020.903.0" />
|
||||
<PackageReference Include="Sentry" Version="2.1.6" />
|
||||
<PackageReference Include="SharpCompress" Version="0.26.0" />
|
||||
<PackageReference Include="NUnit" Version="3.12.0" />
|
||||
|
@ -70,8 +70,8 @@
|
||||
<Reference Include="System.Net.Http" />
|
||||
</ItemGroup>
|
||||
<ItemGroup Label="Package References">
|
||||
<PackageReference Include="ppy.osu.Framework.iOS" Version="2020.819.0" />
|
||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2020.812.0" />
|
||||
<PackageReference Include="ppy.osu.Framework.iOS" Version="2020.903.0" />
|
||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2020.903.0" />
|
||||
</ItemGroup>
|
||||
<!-- Xamarin.iOS does not automatically handle transitive dependencies from NuGet packages. -->
|
||||
<ItemGroup Label="Transitive Dependencies">
|
||||
@ -80,7 +80,7 @@
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.2.6" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.6" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
|
||||
<PackageReference Include="ppy.osu.Framework" Version="2020.819.0" />
|
||||
<PackageReference Include="ppy.osu.Framework" Version="2020.903.0" />
|
||||
<PackageReference Include="SharpCompress" Version="0.26.0" />
|
||||
<PackageReference Include="NUnit" Version="3.12.0" />
|
||||
<PackageReference Include="SharpRaven" Version="2.4.0" />
|
||||
|
Loading…
Reference in New Issue
Block a user