mirror of
https://github.com/osukey/osukey.git
synced 2025-05-25 23:47:30 +09:00
Merge branch 'master' into song_select_nullability
This commit is contained in:
commit
c5775aa452
@ -188,7 +188,8 @@ namespace osu.Game.Rulesets.Catch.Edit
|
|||||||
if (EditorBeatmap.PlacementObject.Value is JuiceStream)
|
if (EditorBeatmap.PlacementObject.Value is JuiceStream)
|
||||||
{
|
{
|
||||||
// Juice stream path is not subject to snapping.
|
// Juice stream path is not subject to snapping.
|
||||||
return null;
|
if (BlueprintContainer.CurrentPlacement.PlacementActive is PlacementBlueprint.PlacementState.Active)
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
double timeAtCursor = ((CatchPlayfield)Playfield).TimeAtScreenSpacePosition(inputManager.CurrentState.Mouse.Position);
|
double timeAtCursor = ((CatchPlayfield)Playfield).TimeAtScreenSpacePosition(inputManager.CurrentState.Mouse.Position);
|
||||||
|
@ -75,6 +75,8 @@ namespace osu.Game.Tests.Chat
|
|||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
AddUntilStep("wait for notifications client", () => channelManager.NotificationsConnected);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
|
@ -73,16 +73,6 @@ namespace osu.Game.Tests.Gameplay
|
|||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
[FlakyTest]
|
|
||||||
/*
|
|
||||||
* Fail rate around 0.15%
|
|
||||||
*
|
|
||||||
* TearDown : osu.Framework.Testing.Drawables.Steps.AssertButton+TracedException : gameplay clock time = 2500
|
|
||||||
* --TearDown
|
|
||||||
* at osu.Framework.Threading.ScheduledDelegate.RunTaskInternal()
|
|
||||||
* at osu.Framework.Threading.Scheduler.Update()
|
|
||||||
* at osu.Framework.Graphics.Drawable.UpdateSubTree()
|
|
||||||
*/
|
|
||||||
public void TestSeekPerformsInGameplayTime(
|
public void TestSeekPerformsInGameplayTime(
|
||||||
[Values(1.0, 0.5, 2.0)] double clockRate,
|
[Values(1.0, 0.5, 2.0)] double clockRate,
|
||||||
[Values(0.0, 200.0, -200.0)] double userOffset,
|
[Values(0.0, 200.0, -200.0)] double userOffset,
|
||||||
@ -92,6 +82,9 @@ namespace osu.Game.Tests.Gameplay
|
|||||||
ClockBackedTestWorkingBeatmap working = null;
|
ClockBackedTestWorkingBeatmap working = null;
|
||||||
GameplayClockContainer gameplayClockContainer = null;
|
GameplayClockContainer gameplayClockContainer = null;
|
||||||
|
|
||||||
|
// ReSharper disable once NotAccessedVariable
|
||||||
|
BindableDouble trackAdjustment = null; // keeping a reference for track adjustment
|
||||||
|
|
||||||
if (setAudioOffsetBeforeConstruction)
|
if (setAudioOffsetBeforeConstruction)
|
||||||
AddStep($"preset audio offset to {userOffset}", () => localConfig.SetValue(OsuSetting.AudioOffset, userOffset));
|
AddStep($"preset audio offset to {userOffset}", () => localConfig.SetValue(OsuSetting.AudioOffset, userOffset));
|
||||||
|
|
||||||
@ -103,16 +96,16 @@ namespace osu.Game.Tests.Gameplay
|
|||||||
gameplayClockContainer.Reset(startClock: !whileStopped);
|
gameplayClockContainer.Reset(startClock: !whileStopped);
|
||||||
});
|
});
|
||||||
|
|
||||||
AddStep($"set clock rate to {clockRate}", () => working.Track.AddAdjustment(AdjustableProperty.Frequency, new BindableDouble(clockRate)));
|
AddStep($"set clock rate to {clockRate}", () => working.Track.AddAdjustment(AdjustableProperty.Frequency, trackAdjustment = new BindableDouble(clockRate)));
|
||||||
|
|
||||||
if (!setAudioOffsetBeforeConstruction)
|
if (!setAudioOffsetBeforeConstruction)
|
||||||
AddStep($"set audio offset to {userOffset}", () => localConfig.SetValue(OsuSetting.AudioOffset, userOffset));
|
AddStep($"set audio offset to {userOffset}", () => localConfig.SetValue(OsuSetting.AudioOffset, userOffset));
|
||||||
|
|
||||||
AddStep("seek to 2500", () => gameplayClockContainer.Seek(2500));
|
AddStep("seek to 2500", () => gameplayClockContainer.Seek(2500));
|
||||||
AddStep("gameplay clock time = 2500", () => Assert.AreEqual(gameplayClockContainer.CurrentTime, 2500, 10f));
|
AddAssert("gameplay clock time = 2500", () => gameplayClockContainer.CurrentTime, () => Is.EqualTo(2500).Within(10f));
|
||||||
|
|
||||||
AddStep("seek to 10000", () => gameplayClockContainer.Seek(10000));
|
AddStep("seek to 10000", () => gameplayClockContainer.Seek(10000));
|
||||||
AddStep("gameplay clock time = 10000", () => Assert.AreEqual(gameplayClockContainer.CurrentTime, 10000, 10f));
|
AddAssert("gameplay clock time = 10000", () => gameplayClockContainer.CurrentTime, () => Is.EqualTo(10000).Within(10f));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Dispose(bool isDisposing)
|
protected override void Dispose(bool isDisposing)
|
||||||
|
@ -12,6 +12,7 @@ using System.Threading;
|
|||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using osu.Framework.Extensions;
|
using osu.Framework.Extensions;
|
||||||
using osu.Framework.IO.Stores;
|
using osu.Framework.IO.Stores;
|
||||||
|
using osu.Framework.Logging;
|
||||||
using osu.Framework.Testing;
|
using osu.Framework.Testing;
|
||||||
using osu.Framework.Utils;
|
using osu.Framework.Utils;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
@ -93,10 +94,12 @@ namespace osu.Game.Tests.Resources
|
|||||||
{
|
{
|
||||||
// Create random metadata, then we can check if sorting works based on these
|
// Create random metadata, then we can check if sorting works based on these
|
||||||
Artist = "Some Artist " + RNG.Next(0, 9),
|
Artist = "Some Artist " + RNG.Next(0, 9),
|
||||||
Title = $"Some Song (set id {setId}) {Guid.NewGuid()}",
|
Title = $"Some Song (set id {setId:000}) {Guid.NewGuid()}",
|
||||||
Author = { Username = "Some Guy " + RNG.Next(0, 9) },
|
Author = { Username = "Some Guy " + RNG.Next(0, 9) },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Logger.Log($"🛠️ Generating beatmap set \"{metadata}\" for test consumption.");
|
||||||
|
|
||||||
var beatmapSet = new BeatmapSetInfo
|
var beatmapSet = new BeatmapSetInfo
|
||||||
{
|
{
|
||||||
OnlineID = setId,
|
OnlineID = setId,
|
||||||
|
@ -181,7 +181,8 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
AddUntilStep("wait for fail", () => Player.GameplayState.HasFailed);
|
AddUntilStep("wait for fail", () => Player.GameplayState.HasFailed);
|
||||||
AddStep("exit", () => Player.Exit());
|
AddStep("exit", () => Player.Exit());
|
||||||
|
|
||||||
AddAssert("ensure failing submission", () => Player.SubmittedScore?.ScoreInfo.Passed == false);
|
AddUntilStep("wait for submission", () => Player.SubmittedScore != null);
|
||||||
|
AddAssert("ensure failing submission", () => Player.SubmittedScore.ScoreInfo.Passed == false);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
@ -209,7 +210,9 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
addFakeHit();
|
addFakeHit();
|
||||||
|
|
||||||
AddStep("exit", () => Player.Exit());
|
AddStep("exit", () => Player.Exit());
|
||||||
AddAssert("ensure failing submission", () => Player.SubmittedScore?.ScoreInfo.Passed == false);
|
|
||||||
|
AddUntilStep("wait for submission", () => Player.SubmittedScore != null);
|
||||||
|
AddAssert("ensure failing submission", () => Player.SubmittedScore.ScoreInfo.Passed == false);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
|
@ -5,12 +5,12 @@ using osu.Game.Overlays.Profile.Sections.Kudosu;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System;
|
using System;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Game.Graphics;
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Game.Online.API.Requests.Responses;
|
using osu.Game.Online.API.Requests.Responses;
|
||||||
using osu.Framework.Extensions.IEnumerableExtensions;
|
using osu.Framework.Extensions.IEnumerableExtensions;
|
||||||
|
using osu.Game.Overlays;
|
||||||
|
|
||||||
namespace osu.Game.Tests.Visual.Online
|
namespace osu.Game.Tests.Visual.Online
|
||||||
{
|
{
|
||||||
@ -18,6 +18,9 @@ namespace osu.Game.Tests.Visual.Online
|
|||||||
{
|
{
|
||||||
private readonly Box background;
|
private readonly Box background;
|
||||||
|
|
||||||
|
[Cached]
|
||||||
|
private OverlayColourProvider colourProvider = new OverlayColourProvider(OverlayColourScheme.Pink);
|
||||||
|
|
||||||
public TestSceneKudosuHistory()
|
public TestSceneKudosuHistory()
|
||||||
{
|
{
|
||||||
FillFlowContainer<DrawableKudosuHistoryItem> content;
|
FillFlowContainer<DrawableKudosuHistoryItem> content;
|
||||||
@ -42,9 +45,9 @@ namespace osu.Game.Tests.Visual.Online
|
|||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OsuColour colours)
|
private void load()
|
||||||
{
|
{
|
||||||
background.Colour = colours.GreySeaFoam;
|
background.Colour = colourProvider.Background4;
|
||||||
}
|
}
|
||||||
|
|
||||||
private readonly IEnumerable<APIKudosuHistory> items = new[]
|
private readonly IEnumerable<APIKudosuHistory> items = new[]
|
||||||
|
@ -86,12 +86,21 @@ namespace osu.Game.Tests.Visual.Online
|
|||||||
CoverUrl = @"https://osu.ppy.sh/images/headers/profile-covers/c1.jpg",
|
CoverUrl = @"https://osu.ppy.sh/images/headers/profile-covers/c1.jpg",
|
||||||
JoinDate = DateTimeOffset.Now.AddDays(-1),
|
JoinDate = DateTimeOffset.Now.AddDays(-1),
|
||||||
LastVisit = DateTimeOffset.Now,
|
LastVisit = DateTimeOffset.Now,
|
||||||
ProfileOrder = new[] { "me" },
|
|
||||||
Groups = new[]
|
Groups = new[]
|
||||||
{
|
{
|
||||||
new APIUserGroup { Colour = "#EB47D0", ShortName = "DEV", Name = "Developers" },
|
new APIUserGroup { Colour = "#EB47D0", ShortName = "DEV", Name = "Developers" },
|
||||||
new APIUserGroup { Colour = "#A347EB", ShortName = "BN", Name = "Beatmap Nominators", Playmodes = new[] { "osu", "taiko" } }
|
new APIUserGroup { Colour = "#A347EB", ShortName = "BN", Name = "Beatmap Nominators", Playmodes = new[] { "osu", "taiko" } }
|
||||||
},
|
},
|
||||||
|
ProfileOrder = new[]
|
||||||
|
{
|
||||||
|
@"me",
|
||||||
|
@"recent_activity",
|
||||||
|
@"beatmaps",
|
||||||
|
@"historical",
|
||||||
|
@"kudosu",
|
||||||
|
@"top_ranks",
|
||||||
|
@"medals"
|
||||||
|
},
|
||||||
Statistics = new UserStatistics
|
Statistics = new UserStatistics
|
||||||
{
|
{
|
||||||
IsRanked = true,
|
IsRanked = true,
|
||||||
@ -128,7 +137,12 @@ namespace osu.Game.Tests.Visual.Online
|
|||||||
Title = "osu!volunteer",
|
Title = "osu!volunteer",
|
||||||
Colour = "ff0000",
|
Colour = "ff0000",
|
||||||
Achievements = Array.Empty<APIUserAchievement>(),
|
Achievements = Array.Empty<APIUserAchievement>(),
|
||||||
PlayMode = "osu"
|
PlayMode = "osu",
|
||||||
|
Kudosu = new APIUser.KudosuCount
|
||||||
|
{
|
||||||
|
Available = 10,
|
||||||
|
Total = 50
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,9 @@ using osu.Framework.Utils;
|
|||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Configuration;
|
using osu.Game.Configuration;
|
||||||
using osu.Game.Rulesets;
|
using osu.Game.Rulesets;
|
||||||
|
using osu.Game.Rulesets.Catch;
|
||||||
using osu.Game.Rulesets.Osu;
|
using osu.Game.Rulesets.Osu;
|
||||||
|
using osu.Game.Rulesets.Taiko;
|
||||||
using osu.Game.Screens.Select;
|
using osu.Game.Screens.Select;
|
||||||
using osu.Game.Screens.Select.Carousel;
|
using osu.Game.Screens.Select.Carousel;
|
||||||
using osu.Game.Screens.Select.Filter;
|
using osu.Game.Screens.Select.Filter;
|
||||||
@ -926,10 +928,7 @@ namespace osu.Game.Tests.Visual.SongSelect
|
|||||||
|
|
||||||
// 10 sets that go osu! -> taiko -> catch -> osu! -> ...
|
// 10 sets that go osu! -> taiko -> catch -> osu! -> ...
|
||||||
for (int i = 0; i < 10; i++)
|
for (int i = 0; i < 10; i++)
|
||||||
{
|
sets.Add(TestResources.CreateTestBeatmapSetInfo(5, new[] { getRuleset(i) }));
|
||||||
var rulesetInfo = rulesets.AvailableRulesets.ElementAt(i % 3);
|
|
||||||
sets.Add(TestResources.CreateTestBeatmapSetInfo(5, new[] { rulesetInfo }));
|
|
||||||
}
|
|
||||||
|
|
||||||
// Sort mode is important to keep the ruleset order
|
// Sort mode is important to keep the ruleset order
|
||||||
loadBeatmaps(sets, () => new FilterCriteria { Sort = SortMode.Title });
|
loadBeatmaps(sets, () => new FilterCriteria { Sort = SortMode.Title });
|
||||||
@ -937,13 +936,29 @@ namespace osu.Game.Tests.Visual.SongSelect
|
|||||||
|
|
||||||
for (int i = 1; i < 10; i++)
|
for (int i = 1; i < 10; i++)
|
||||||
{
|
{
|
||||||
var rulesetInfo = rulesets.AvailableRulesets.ElementAt(i % 3);
|
var rulesetInfo = getRuleset(i % 3);
|
||||||
|
|
||||||
AddStep($"Set ruleset to {rulesetInfo.ShortName}", () =>
|
AddStep($"Set ruleset to {rulesetInfo.ShortName}", () =>
|
||||||
{
|
{
|
||||||
carousel.Filter(new FilterCriteria { Ruleset = rulesetInfo, Sort = SortMode.Title }, false);
|
carousel.Filter(new FilterCriteria { Ruleset = rulesetInfo, Sort = SortMode.Title }, false);
|
||||||
});
|
});
|
||||||
waitForSelection(i + 1, 1);
|
waitForSelection(i + 1, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static RulesetInfo getRuleset(int index)
|
||||||
|
{
|
||||||
|
switch (index % 3)
|
||||||
|
{
|
||||||
|
default:
|
||||||
|
return new OsuRuleset().RulesetInfo;
|
||||||
|
|
||||||
|
case 1:
|
||||||
|
return new TaikoRuleset().RulesetInfo;
|
||||||
|
|
||||||
|
case 2:
|
||||||
|
return new CatchRuleset().RulesetInfo;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
@ -953,10 +968,7 @@ namespace osu.Game.Tests.Visual.SongSelect
|
|||||||
|
|
||||||
// 10 sets that go taiko, osu!, osu!, osu!, taiko, osu!, osu!, osu!, ...
|
// 10 sets that go taiko, osu!, osu!, osu!, taiko, osu!, osu!, osu!, ...
|
||||||
for (int i = 0; i < 10; i++)
|
for (int i = 0; i < 10; i++)
|
||||||
{
|
sets.Add(TestResources.CreateTestBeatmapSetInfo(5, new[] { getRuleset(i) }));
|
||||||
var rulesetInfo = rulesets.AvailableRulesets.ElementAt(i % 4 == 0 ? 1 : 0);
|
|
||||||
sets.Add(TestResources.CreateTestBeatmapSetInfo(5, new[] { rulesetInfo }));
|
|
||||||
}
|
|
||||||
|
|
||||||
// Sort mode is important to keep the ruleset order
|
// Sort mode is important to keep the ruleset order
|
||||||
loadBeatmaps(sets, () => new FilterCriteria { Sort = SortMode.Title });
|
loadBeatmaps(sets, () => new FilterCriteria { Sort = SortMode.Title });
|
||||||
@ -974,6 +986,18 @@ namespace osu.Game.Tests.Visual.SongSelect
|
|||||||
carousel.Filter(new FilterCriteria { Sort = SortMode.Title }, false);
|
carousel.Filter(new FilterCriteria { Sort = SortMode.Title }, false);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static RulesetInfo getRuleset(int index)
|
||||||
|
{
|
||||||
|
switch (index % 4)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
return new TaikoRuleset().RulesetInfo;
|
||||||
|
|
||||||
|
default:
|
||||||
|
return new OsuRuleset().RulesetInfo;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void loadBeatmaps(List<BeatmapSetInfo> beatmapSets = null, Func<FilterCriteria> initialCriteria = null, Action<BeatmapCarousel> carouselAdjust = null, int? count = null,
|
private void loadBeatmaps(List<BeatmapSetInfo> beatmapSets = null, Func<FilterCriteria> initialCriteria = null, Action<BeatmapCarousel> carouselAdjust = null, int? count = null,
|
||||||
|
@ -1,13 +1,16 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
#nullable disable
|
using System.Linq;
|
||||||
|
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
|
using osu.Framework.Graphics.UserInterface;
|
||||||
|
using osu.Framework.Localisation;
|
||||||
|
using osu.Framework.Testing;
|
||||||
|
using osu.Game.Graphics.UserInterface;
|
||||||
using osu.Game.Overlays;
|
using osu.Game.Overlays;
|
||||||
using osu.Game.Overlays.Comments;
|
using osu.Game.Overlays.Comments;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
@ -20,8 +23,8 @@ namespace osu.Game.Tests.Visual.UserInterface
|
|||||||
[Cached]
|
[Cached]
|
||||||
private readonly OverlayColourProvider colourProvider = new OverlayColourProvider(OverlayColourScheme.Blue);
|
private readonly OverlayColourProvider colourProvider = new OverlayColourProvider(OverlayColourScheme.Blue);
|
||||||
|
|
||||||
private TestCommentEditor commentEditor;
|
private TestCommentEditor commentEditor = null!;
|
||||||
private TestCancellableCommentEditor cancellableCommentEditor;
|
private TestCancellableCommentEditor cancellableCommentEditor = null!;
|
||||||
|
|
||||||
[SetUp]
|
[SetUp]
|
||||||
public void SetUp() => Schedule(() =>
|
public void SetUp() => Schedule(() =>
|
||||||
@ -45,15 +48,16 @@ namespace osu.Game.Tests.Visual.UserInterface
|
|||||||
{
|
{
|
||||||
AddStep("click on text box", () =>
|
AddStep("click on text box", () =>
|
||||||
{
|
{
|
||||||
InputManager.MoveMouseTo(commentEditor);
|
InputManager.MoveMouseTo(commentEditor.ChildrenOfType<TextBox>().Single());
|
||||||
InputManager.Click(MouseButton.Left);
|
InputManager.Click(MouseButton.Left);
|
||||||
});
|
});
|
||||||
AddStep("enter text", () => commentEditor.Current.Value = "text");
|
AddStep("enter text", () => commentEditor.Current.Value = "text");
|
||||||
|
|
||||||
AddStep("press Enter", () => InputManager.Key(Key.Enter));
|
AddStep("press Enter", () => InputManager.Key(Key.Enter));
|
||||||
|
|
||||||
|
AddUntilStep("button is loading", () => commentEditor.IsSpinnerShown);
|
||||||
AddAssert("text committed", () => commentEditor.CommittedText == "text");
|
AddAssert("text committed", () => commentEditor.CommittedText == "text");
|
||||||
AddAssert("button is loading", () => commentEditor.IsLoading);
|
AddUntilStep("button is not loading", () => !commentEditor.IsSpinnerShown);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
@ -61,14 +65,14 @@ namespace osu.Game.Tests.Visual.UserInterface
|
|||||||
{
|
{
|
||||||
AddStep("click on text box", () =>
|
AddStep("click on text box", () =>
|
||||||
{
|
{
|
||||||
InputManager.MoveMouseTo(commentEditor);
|
InputManager.MoveMouseTo(commentEditor.ChildrenOfType<TextBox>().Single());
|
||||||
InputManager.Click(MouseButton.Left);
|
InputManager.Click(MouseButton.Left);
|
||||||
});
|
});
|
||||||
|
|
||||||
AddStep("press Enter", () => InputManager.Key(Key.Enter));
|
AddStep("press Enter", () => InputManager.Key(Key.Enter));
|
||||||
|
|
||||||
AddAssert("no text committed", () => commentEditor.CommittedText == null);
|
AddAssert("button is not loading", () => !commentEditor.IsSpinnerShown);
|
||||||
AddAssert("button is not loading", () => !commentEditor.IsLoading);
|
AddAssert("no text committed", () => commentEditor.CommittedText.Length == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
@ -76,7 +80,7 @@ namespace osu.Game.Tests.Visual.UserInterface
|
|||||||
{
|
{
|
||||||
AddStep("click on text box", () =>
|
AddStep("click on text box", () =>
|
||||||
{
|
{
|
||||||
InputManager.MoveMouseTo(commentEditor);
|
InputManager.MoveMouseTo(commentEditor.ChildrenOfType<TextBox>().Single());
|
||||||
InputManager.Click(MouseButton.Left);
|
InputManager.Click(MouseButton.Left);
|
||||||
});
|
});
|
||||||
AddStep("enter text", () => commentEditor.Current.Value = "some other text");
|
AddStep("enter text", () => commentEditor.Current.Value = "some other text");
|
||||||
@ -87,8 +91,9 @@ namespace osu.Game.Tests.Visual.UserInterface
|
|||||||
InputManager.Click(MouseButton.Left);
|
InputManager.Click(MouseButton.Left);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
AddUntilStep("button is loading", () => commentEditor.IsSpinnerShown);
|
||||||
AddAssert("text committed", () => commentEditor.CommittedText == "some other text");
|
AddAssert("text committed", () => commentEditor.CommittedText == "some other text");
|
||||||
AddAssert("button is loading", () => commentEditor.IsLoading);
|
AddUntilStep("button is not loading", () => !commentEditor.IsSpinnerShown);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
@ -96,7 +101,7 @@ namespace osu.Game.Tests.Visual.UserInterface
|
|||||||
{
|
{
|
||||||
AddStep("click cancel button", () =>
|
AddStep("click cancel button", () =>
|
||||||
{
|
{
|
||||||
InputManager.MoveMouseTo(cancellableCommentEditor.ButtonsContainer);
|
InputManager.MoveMouseTo(cancellableCommentEditor.ButtonsContainer[1]);
|
||||||
InputManager.Click(MouseButton.Left);
|
InputManager.Click(MouseButton.Left);
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -108,28 +113,27 @@ namespace osu.Game.Tests.Visual.UserInterface
|
|||||||
public new Bindable<string> Current => base.Current;
|
public new Bindable<string> Current => base.Current;
|
||||||
public new FillFlowContainer ButtonsContainer => base.ButtonsContainer;
|
public new FillFlowContainer ButtonsContainer => base.ButtonsContainer;
|
||||||
|
|
||||||
public string CommittedText { get; private set; }
|
public string CommittedText { get; private set; } = string.Empty;
|
||||||
|
|
||||||
public TestCommentEditor()
|
public bool IsSpinnerShown => this.ChildrenOfType<LoadingSpinner>().Single().IsPresent;
|
||||||
{
|
|
||||||
OnCommit = onCommit;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void onCommit(string value)
|
protected override void OnCommit(string value)
|
||||||
{
|
{
|
||||||
|
ShowLoadingSpinner = true;
|
||||||
CommittedText = value;
|
CommittedText = value;
|
||||||
Scheduler.AddDelayed(() => IsLoading = false, 1000);
|
Scheduler.AddDelayed(() => ShowLoadingSpinner = false, 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override string FooterText => @"Footer text. And it is pretty long. Cool.";
|
protected override LocalisableString FooterText => @"Footer text. And it is pretty long. Cool.";
|
||||||
protected override string CommitButtonText => @"Commit";
|
protected override LocalisableString CommitButtonText => @"Commit";
|
||||||
protected override string TextBoxPlaceholder => @"This text box is empty";
|
protected override LocalisableString TextBoxPlaceholder => @"This text box is empty";
|
||||||
}
|
}
|
||||||
|
|
||||||
private partial class TestCancellableCommentEditor : CancellableCommentEditor
|
private partial class TestCancellableCommentEditor : CancellableCommentEditor
|
||||||
{
|
{
|
||||||
public new FillFlowContainer ButtonsContainer => base.ButtonsContainer;
|
public new FillFlowContainer ButtonsContainer => base.ButtonsContainer;
|
||||||
protected override string FooterText => @"Wow, another one. Sicc";
|
|
||||||
|
protected override LocalisableString FooterText => @"Wow, another one. Sicc";
|
||||||
|
|
||||||
public bool Cancelled { get; private set; }
|
public bool Cancelled { get; private set; }
|
||||||
|
|
||||||
@ -138,8 +142,12 @@ namespace osu.Game.Tests.Visual.UserInterface
|
|||||||
OnCancel = () => Cancelled = true;
|
OnCancel = () => Cancelled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override string CommitButtonText => @"Save";
|
protected override void OnCommit(string text)
|
||||||
protected override string TextBoxPlaceholder => @"Multiline textboxes soon";
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override LocalisableString CommitButtonText => @"Save";
|
||||||
|
protected override LocalisableString TextBoxPlaceholder => @"Multiline textboxes soon";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -108,7 +108,7 @@ namespace osu.Game.Tests.Visual.UserInterface
|
|||||||
|
|
||||||
protected override OverlayTitle CreateTitle() => new TestTitle();
|
protected override OverlayTitle CreateTitle() => new TestTitle();
|
||||||
|
|
||||||
protected override Drawable CreateTitleContent() => new OverlayRulesetSelector();
|
protected override Drawable CreateTabControlContent() => new OverlayRulesetSelector();
|
||||||
|
|
||||||
public TestStringTabControlHeader()
|
public TestStringTabControlHeader()
|
||||||
{
|
{
|
||||||
|
@ -15,10 +15,52 @@ namespace osu.Game.Localisation
|
|||||||
public static LocalisableString HeaderTitle => new TranslatableString(getKey(@"header_title"), @"notifications");
|
public static LocalisableString HeaderTitle => new TranslatableString(getKey(@"header_title"), @"notifications");
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// "waiting for 'ya"
|
/// "waiting for 'ya"
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static LocalisableString HeaderDescription => new TranslatableString(getKey(@"header_description"), @"waiting for 'ya");
|
public static LocalisableString HeaderDescription => new TranslatableString(getKey(@"header_description"), @"waiting for 'ya");
|
||||||
|
|
||||||
private static string getKey(string key) => $"{prefix}:{key}";
|
/// <summary>
|
||||||
|
/// "Running Tasks"
|
||||||
|
/// </summary>
|
||||||
|
public static LocalisableString RunningTasks => new TranslatableString(getKey(@"running_tasks"), @"Running Tasks");
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// "Clear All"
|
||||||
|
/// </summary>
|
||||||
|
public static LocalisableString ClearAll => new TranslatableString(getKey(@"clear_all"), @"Clear All");
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// "Cancel All"
|
||||||
|
/// </summary>
|
||||||
|
public static LocalisableString CancelAll => new TranslatableString(getKey(@"cancel_all"), @"Cancel All");
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// "Your battery level is low! Charge your device to prevent interruptions during gameplay."
|
||||||
|
/// </summary>
|
||||||
|
public static LocalisableString BatteryLow => new TranslatableString(getKey(@"battery_low"), @"Your battery level is low! Charge your device to prevent interruptions during gameplay.");
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// "Your game volume is too low to hear anything! Click here to restore it."
|
||||||
|
/// </summary>
|
||||||
|
public static LocalisableString GameVolumeTooLow => new TranslatableString(getKey(@"game_volume_too_low"), @"Your game volume is too low to hear anything! Click here to restore it.");
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// "The current ruleset doesn't have an autoplay mod available!"
|
||||||
|
/// </summary>
|
||||||
|
public static LocalisableString NoAutoplayMod => new TranslatableString(getKey(@"no_autoplay_mod"), @"The current ruleset doesn't have an autoplay mod available!");
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// "osu! doesn't seem to be able to play audio correctly.\n\nPlease try changing your audio device to a working setting."
|
||||||
|
/// </summary>
|
||||||
|
public static LocalisableString AudioPlaybackIssue => new TranslatableString(getKey(@"audio_playback_issue"),
|
||||||
|
@"osu! doesn't seem to be able to play audio correctly.\n\nPlease try changing your audio device to a working setting.");
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// "The score overlay is currently disabled. You can toggle this by pressing {0}."
|
||||||
|
/// </summary>
|
||||||
|
public static LocalisableString ScoreOverlayDisabled(LocalisableString arg0) => new TranslatableString(getKey(@"score_overlay_disabled"),
|
||||||
|
@"The score overlay is currently disabled. You can toggle this by pressing {0}.", arg0);
|
||||||
|
|
||||||
|
private static string getKey(string key) => $@"{prefix}:{key}";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -329,12 +329,35 @@ namespace osu.Game.Online.API
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
return JObject.Parse(req.GetResponseString().AsNonNull()).SelectToken("form_error", true).AsNonNull().ToObject<RegistrationRequest.RegistrationRequestErrors>();
|
return JObject.Parse(req.GetResponseString().AsNonNull()).SelectToken(@"form_error", true).AsNonNull().ToObject<RegistrationRequest.RegistrationRequestErrors>();
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
// if we couldn't deserialize the error message let's throw the original exception outwards.
|
try
|
||||||
e.Rethrow();
|
{
|
||||||
|
// attempt to parse a non-form error message
|
||||||
|
var response = JObject.Parse(req.GetResponseString().AsNonNull());
|
||||||
|
|
||||||
|
string redirect = (string)response.SelectToken(@"url", true);
|
||||||
|
string message = (string)response.SelectToken(@"error", false);
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(redirect))
|
||||||
|
{
|
||||||
|
return new RegistrationRequest.RegistrationRequestErrors
|
||||||
|
{
|
||||||
|
Redirect = redirect,
|
||||||
|
Message = message,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
// if we couldn't deserialize the error message let's throw the original exception outwards.
|
||||||
|
e.Rethrow();
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
// if we couldn't deserialize the error message let's throw the original exception outwards.
|
||||||
|
e.Rethrow();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,17 +1,16 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
#nullable disable
|
using System;
|
||||||
|
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace osu.Game.Online.API
|
namespace osu.Game.Online.API
|
||||||
{
|
{
|
||||||
public class RegistrationRequest : OsuWebRequest
|
public class RegistrationRequest : OsuWebRequest
|
||||||
{
|
{
|
||||||
internal string Username;
|
internal string Username = string.Empty;
|
||||||
internal string Email;
|
internal string Email = string.Empty;
|
||||||
internal string Password;
|
internal string Password = string.Empty;
|
||||||
|
|
||||||
protected override void PrePerform()
|
protected override void PrePerform()
|
||||||
{
|
{
|
||||||
@ -24,18 +23,28 @@ namespace osu.Game.Online.API
|
|||||||
|
|
||||||
public class RegistrationRequestErrors
|
public class RegistrationRequestErrors
|
||||||
{
|
{
|
||||||
public UserErrors User;
|
/// <summary>
|
||||||
|
/// An optional error message.
|
||||||
|
/// </summary>
|
||||||
|
public string? Message;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// An optional URL which the user should be directed towards to complete registration.
|
||||||
|
/// </summary>
|
||||||
|
public string? Redirect;
|
||||||
|
|
||||||
|
public UserErrors? User;
|
||||||
|
|
||||||
public class UserErrors
|
public class UserErrors
|
||||||
{
|
{
|
||||||
[JsonProperty("username")]
|
[JsonProperty("username")]
|
||||||
public string[] Username;
|
public string[] Username = Array.Empty<string>();
|
||||||
|
|
||||||
[JsonProperty("user_email")]
|
[JsonProperty("user_email")]
|
||||||
public string[] Email;
|
public string[] Email = Array.Empty<string>();
|
||||||
|
|
||||||
[JsonProperty("password")]
|
[JsonProperty("password")]
|
||||||
public string[] Password;
|
public string[] Password = Array.Empty<string>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,7 @@ namespace osu.Game.Online.API.Requests.Responses
|
|||||||
public class APIUserGroup
|
public class APIUserGroup
|
||||||
{
|
{
|
||||||
[JsonProperty(@"colour")]
|
[JsonProperty(@"colour")]
|
||||||
public string Colour { get; set; } = null!;
|
public string? Colour { get; set; }
|
||||||
|
|
||||||
[JsonProperty(@"has_listing")]
|
[JsonProperty(@"has_listing")]
|
||||||
public bool HasListings { get; set; }
|
public bool HasListings { get; set; }
|
||||||
|
@ -64,6 +64,11 @@ namespace osu.Game.Online.Chat
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public IBindableList<Channel> AvailableChannels => availableChannels;
|
public IBindableList<Channel> AvailableChannels => availableChannels;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Whether the client responsible for channel notifications is connected.
|
||||||
|
/// </summary>
|
||||||
|
public bool NotificationsConnected => connector.IsConnected.Value;
|
||||||
|
|
||||||
private readonly IAPIProvider api;
|
private readonly IAPIProvider api;
|
||||||
private readonly NotificationsClientConnector connector;
|
private readonly NotificationsClientConnector connector;
|
||||||
|
|
||||||
|
@ -47,6 +47,9 @@ namespace osu.Game.Overlays.AccountCreation
|
|||||||
[Resolved]
|
[Resolved]
|
||||||
private GameHost host { get; set; }
|
private GameHost host { get; set; }
|
||||||
|
|
||||||
|
[Resolved]
|
||||||
|
private OsuGame game { get; set; }
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load()
|
private void load()
|
||||||
{
|
{
|
||||||
@ -194,9 +197,20 @@ namespace osu.Game.Overlays.AccountCreation
|
|||||||
{
|
{
|
||||||
if (errors != null)
|
if (errors != null)
|
||||||
{
|
{
|
||||||
usernameDescription.AddErrors(errors.User.Username);
|
if (errors.User != null)
|
||||||
emailAddressDescription.AddErrors(errors.User.Email);
|
{
|
||||||
passwordDescription.AddErrors(errors.User.Password);
|
usernameDescription.AddErrors(errors.User.Username);
|
||||||
|
emailAddressDescription.AddErrors(errors.User.Email);
|
||||||
|
passwordDescription.AddErrors(errors.User.Password);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(errors.Redirect))
|
||||||
|
{
|
||||||
|
if (!string.IsNullOrEmpty(errors.Message))
|
||||||
|
passwordDescription.AddErrors(new[] { errors.Message });
|
||||||
|
|
||||||
|
game.OpenUrlExternally($"{errors.Redirect}?username={usernameTextBox.Text}&email={emailTextBox.Text}");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Localisation;
|
using osu.Framework.Localisation;
|
||||||
|
using osu.Game.Extensions;
|
||||||
using osu.Game.Resources.Localisation.Web;
|
using osu.Game.Resources.Localisation.Web;
|
||||||
using osu.Game.Rulesets;
|
using osu.Game.Rulesets;
|
||||||
|
|
||||||
@ -28,7 +29,13 @@ namespace osu.Game.Overlays.BeatmapListing
|
|||||||
AddTabItem(new RulesetFilterTabItemAny());
|
AddTabItem(new RulesetFilterTabItemAny());
|
||||||
|
|
||||||
foreach (var r in rulesets.AvailableRulesets)
|
foreach (var r in rulesets.AvailableRulesets)
|
||||||
|
{
|
||||||
|
// Don't display non-legacy rulesets
|
||||||
|
if (!r.IsLegacyRuleset())
|
||||||
|
continue;
|
||||||
|
|
||||||
AddItem(r);
|
AddItem(r);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,6 +8,7 @@ using osu.Framework.Bindables;
|
|||||||
using osu.Framework.Extensions.Color4Extensions;
|
using osu.Framework.Extensions.Color4Extensions;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Effects;
|
using osu.Framework.Graphics.Effects;
|
||||||
|
using osu.Framework.Localisation;
|
||||||
using osu.Game.Online.API.Requests.Responses;
|
using osu.Game.Online.API.Requests.Responses;
|
||||||
using osu.Game.Resources.Localisation.Web;
|
using osu.Game.Resources.Localisation.Web;
|
||||||
using osu.Game.Rulesets;
|
using osu.Game.Rulesets;
|
||||||
@ -16,7 +17,7 @@ using osuTK.Graphics;
|
|||||||
|
|
||||||
namespace osu.Game.Overlays.BeatmapSet
|
namespace osu.Game.Overlays.BeatmapSet
|
||||||
{
|
{
|
||||||
public partial class BeatmapSetHeader : OverlayHeader
|
public partial class BeatmapSetHeader : TabControlOverlayHeader<BeatmapSetTabs>
|
||||||
{
|
{
|
||||||
public readonly Bindable<APIBeatmapSet> BeatmapSet = new Bindable<APIBeatmapSet>();
|
public readonly Bindable<APIBeatmapSet> BeatmapSet = new Bindable<APIBeatmapSet>();
|
||||||
|
|
||||||
@ -46,7 +47,7 @@ namespace osu.Game.Overlays.BeatmapSet
|
|||||||
BeatmapSet = { BindTarget = BeatmapSet }
|
BeatmapSet = { BindTarget = BeatmapSet }
|
||||||
};
|
};
|
||||||
|
|
||||||
protected override Drawable CreateTitleContent() => RulesetSelector = new BeatmapRulesetSelector
|
protected override Drawable CreateTabControlContent() => RulesetSelector = new BeatmapRulesetSelector
|
||||||
{
|
{
|
||||||
Current = ruleset
|
Current = ruleset
|
||||||
};
|
};
|
||||||
@ -62,4 +63,10 @@ namespace osu.Game.Overlays.BeatmapSet
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public enum BeatmapSetTabs
|
||||||
|
{
|
||||||
|
[LocalisableDescription(typeof(LayoutStrings), nameof(LayoutStrings.HeaderBeatmapsetsShow))]
|
||||||
|
Info,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,76 +1,24 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics;
|
|
||||||
using osu.Framework.Graphics.Containers;
|
|
||||||
using osu.Framework.Graphics.Shapes;
|
|
||||||
using osu.Game.Graphics;
|
|
||||||
using osu.Game.Graphics.Containers;
|
|
||||||
using osu.Game.Graphics.Sprites;
|
|
||||||
using osu.Game.Graphics.UserInterface;
|
|
||||||
using osu.Game.Resources.Localisation.Web;
|
using osu.Game.Resources.Localisation.Web;
|
||||||
|
|
||||||
namespace osu.Game.Overlays.Comments
|
namespace osu.Game.Overlays.Comments
|
||||||
{
|
{
|
||||||
public abstract partial class CancellableCommentEditor : CommentEditor
|
public abstract partial class CancellableCommentEditor : CommentEditor
|
||||||
{
|
{
|
||||||
public Action OnCancel;
|
public Action? OnCancel;
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load()
|
private void load()
|
||||||
{
|
{
|
||||||
ButtonsContainer.Add(new CancelButton
|
ButtonsContainer.Add(new EditorButton
|
||||||
{
|
{
|
||||||
Anchor = Anchor.CentreRight,
|
Action = () => OnCancel?.Invoke(),
|
||||||
Origin = Anchor.CentreRight,
|
Text = CommonStrings.ButtonsCancel,
|
||||||
Action = () => OnCancel?.Invoke()
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private partial class CancelButton : OsuHoverContainer
|
|
||||||
{
|
|
||||||
protected override IEnumerable<Drawable> EffectTargets => new[] { background };
|
|
||||||
|
|
||||||
private readonly Box background;
|
|
||||||
|
|
||||||
public CancelButton()
|
|
||||||
: base(HoverSampleSet.Button)
|
|
||||||
{
|
|
||||||
AutoSizeAxes = Axes.Both;
|
|
||||||
Child = new CircularContainer
|
|
||||||
{
|
|
||||||
Masking = true,
|
|
||||||
Height = 25,
|
|
||||||
AutoSizeAxes = Axes.X,
|
|
||||||
Children = new Drawable[]
|
|
||||||
{
|
|
||||||
background = new Box
|
|
||||||
{
|
|
||||||
RelativeSizeAxes = Axes.Both
|
|
||||||
},
|
|
||||||
new OsuSpriteText
|
|
||||||
{
|
|
||||||
Anchor = Anchor.Centre,
|
|
||||||
Origin = Anchor.Centre,
|
|
||||||
Font = OsuFont.GetFont(size: 12, weight: FontWeight.Bold),
|
|
||||||
Margin = new MarginPadding { Horizontal = 20 },
|
|
||||||
Text = CommonStrings.ButtonsCancel
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
|
||||||
private void load(OverlayColourProvider colourProvider)
|
|
||||||
{
|
|
||||||
IdleColour = colourProvider.Light4;
|
|
||||||
HoverColour = colourProvider.Light3;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,22 +1,20 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
|
using osu.Framework.Graphics.Sprites;
|
||||||
|
using osu.Framework.Graphics.UserInterface;
|
||||||
|
using osu.Framework.Localisation;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Graphics.Sprites;
|
using osu.Game.Graphics.Sprites;
|
||||||
using osu.Framework.Graphics.UserInterface;
|
|
||||||
using osu.Framework.Graphics.Sprites;
|
|
||||||
using osuTK.Graphics;
|
|
||||||
using osu.Game.Graphics.UserInterface;
|
using osu.Game.Graphics.UserInterface;
|
||||||
using System.Collections.Generic;
|
using osu.Game.Graphics.UserInterfaceV2;
|
||||||
using System;
|
|
||||||
using osuTK;
|
using osuTK;
|
||||||
using osu.Framework.Bindables;
|
using osuTK.Graphics;
|
||||||
|
|
||||||
namespace osu.Game.Overlays.Comments
|
namespace osu.Game.Overlays.Comments
|
||||||
{
|
{
|
||||||
@ -24,26 +22,32 @@ namespace osu.Game.Overlays.Comments
|
|||||||
{
|
{
|
||||||
private const int side_padding = 8;
|
private const int side_padding = 8;
|
||||||
|
|
||||||
public Action<string> OnCommit;
|
protected abstract LocalisableString FooterText { get; }
|
||||||
|
|
||||||
public bool IsLoading
|
protected abstract LocalisableString CommitButtonText { get; }
|
||||||
|
|
||||||
|
protected abstract LocalisableString TextBoxPlaceholder { get; }
|
||||||
|
|
||||||
|
protected FillFlowContainer ButtonsContainer { get; private set; } = null!;
|
||||||
|
|
||||||
|
protected readonly Bindable<string> Current = new Bindable<string>(string.Empty);
|
||||||
|
|
||||||
|
private RoundedButton commitButton = null!;
|
||||||
|
private LoadingSpinner loadingSpinner = null!;
|
||||||
|
|
||||||
|
protected bool ShowLoadingSpinner
|
||||||
{
|
{
|
||||||
get => commitButton.IsLoading;
|
set
|
||||||
set => commitButton.IsLoading = value;
|
{
|
||||||
|
if (value)
|
||||||
|
loadingSpinner.Show();
|
||||||
|
else
|
||||||
|
loadingSpinner.Hide();
|
||||||
|
|
||||||
|
updateCommitButtonState();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected abstract string FooterText { get; }
|
|
||||||
|
|
||||||
protected abstract string CommitButtonText { get; }
|
|
||||||
|
|
||||||
protected abstract string TextBoxPlaceholder { get; }
|
|
||||||
|
|
||||||
protected FillFlowContainer ButtonsContainer { get; private set; }
|
|
||||||
|
|
||||||
protected readonly Bindable<string> Current = new Bindable<string>();
|
|
||||||
|
|
||||||
private CommitButton commitButton;
|
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OverlayColourProvider colourProvider)
|
private void load(OverlayColourProvider colourProvider)
|
||||||
{
|
{
|
||||||
@ -79,7 +83,7 @@ namespace osu.Game.Overlays.Comments
|
|||||||
},
|
},
|
||||||
new Container
|
new Container
|
||||||
{
|
{
|
||||||
Name = "Footer",
|
Name = @"Footer",
|
||||||
RelativeSizeAxes = Axes.X,
|
RelativeSizeAxes = Axes.X,
|
||||||
Height = 35,
|
Height = 35,
|
||||||
Padding = new MarginPadding { Horizontal = side_padding },
|
Padding = new MarginPadding { Horizontal = side_padding },
|
||||||
@ -92,54 +96,64 @@ namespace osu.Game.Overlays.Comments
|
|||||||
Font = OsuFont.GetFont(size: 12, weight: FontWeight.SemiBold),
|
Font = OsuFont.GetFont(size: 12, weight: FontWeight.SemiBold),
|
||||||
Text = FooterText
|
Text = FooterText
|
||||||
},
|
},
|
||||||
ButtonsContainer = new FillFlowContainer
|
new FillFlowContainer
|
||||||
{
|
{
|
||||||
Name = "Buttons",
|
|
||||||
Anchor = Anchor.CentreRight,
|
Anchor = Anchor.CentreRight,
|
||||||
Origin = Anchor.CentreRight,
|
Origin = Anchor.CentreRight,
|
||||||
AutoSizeAxes = Axes.Both,
|
AutoSizeAxes = Axes.Both,
|
||||||
Direction = FillDirection.Horizontal,
|
Direction = FillDirection.Horizontal,
|
||||||
Spacing = new Vector2(5, 0),
|
Spacing = new Vector2(5, 0),
|
||||||
Child = commitButton = new CommitButton(CommitButtonText)
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
Anchor = Anchor.CentreRight,
|
ButtonsContainer = new FillFlowContainer
|
||||||
Origin = Anchor.CentreRight,
|
|
||||||
Action = () =>
|
|
||||||
{
|
{
|
||||||
OnCommit?.Invoke(Current.Value);
|
Name = @"Buttons",
|
||||||
Current.Value = string.Empty;
|
Anchor = Anchor.CentreRight,
|
||||||
}
|
Origin = Anchor.CentreRight,
|
||||||
|
AutoSizeAxes = Axes.Both,
|
||||||
|
Direction = FillDirection.Horizontal,
|
||||||
|
Spacing = new Vector2(5, 0),
|
||||||
|
Child = commitButton = new EditorButton
|
||||||
|
{
|
||||||
|
Text = CommitButtonText,
|
||||||
|
Action = () => OnCommit(Current.Value)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
loadingSpinner = new LoadingSpinner
|
||||||
|
{
|
||||||
|
Anchor = Anchor.CentreRight,
|
||||||
|
Origin = Anchor.CentreRight,
|
||||||
|
Size = new Vector2(18),
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
textBox.OnCommit += (_, _) =>
|
textBox.OnCommit += (_, _) => commitButton.TriggerClick();
|
||||||
{
|
|
||||||
if (commitButton.IsBlocked.Value)
|
|
||||||
return;
|
|
||||||
|
|
||||||
commitButton.TriggerClick();
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void LoadComplete()
|
protected override void LoadComplete()
|
||||||
{
|
{
|
||||||
base.LoadComplete();
|
base.LoadComplete();
|
||||||
|
Current.BindValueChanged(_ => updateCommitButtonState(), true);
|
||||||
Current.BindValueChanged(text => commitButton.IsBlocked.Value = string.IsNullOrEmpty(text.NewValue), true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected abstract void OnCommit(string text);
|
||||||
|
|
||||||
|
private void updateCommitButtonState() =>
|
||||||
|
commitButton.Enabled.Value = loadingSpinner.State.Value == Visibility.Hidden && !string.IsNullOrEmpty(Current.Value);
|
||||||
|
|
||||||
private partial class EditorTextBox : BasicTextBox
|
private partial class EditorTextBox : BasicTextBox
|
||||||
{
|
{
|
||||||
protected override float LeftRightPadding => side_padding;
|
protected override float LeftRightPadding => side_padding;
|
||||||
|
|
||||||
protected override Color4 SelectionColour => Color4.Gray;
|
protected override Color4 SelectionColour => Color4.Gray;
|
||||||
|
|
||||||
private OsuSpriteText placeholder;
|
private OsuSpriteText placeholder = null!;
|
||||||
|
|
||||||
public EditorTextBox()
|
public EditorTextBox()
|
||||||
{
|
{
|
||||||
@ -163,88 +177,26 @@ namespace osu.Game.Overlays.Comments
|
|||||||
protected override Drawable GetDrawableCharacter(char c) => new FallingDownContainer
|
protected override Drawable GetDrawableCharacter(char c) => new FallingDownContainer
|
||||||
{
|
{
|
||||||
AutoSizeAxes = Axes.Both,
|
AutoSizeAxes = Axes.Both,
|
||||||
Child = new OsuSpriteText { Text = c.ToString(), Font = OsuFont.GetFont(size: CalculatedTextSize) },
|
Child = new OsuSpriteText { Text = c.ToString(), Font = OsuFont.GetFont(size: CalculatedTextSize) }
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
private partial class CommitButton : LoadingButton
|
protected partial class EditorButton : RoundedButton
|
||||||
{
|
{
|
||||||
private const int duration = 200;
|
public EditorButton()
|
||||||
|
|
||||||
public readonly BindableBool IsBlocked = new BindableBool();
|
|
||||||
|
|
||||||
public override bool PropagatePositionalInputSubTree => !IsBlocked.Value && base.PropagatePositionalInputSubTree;
|
|
||||||
|
|
||||||
protected override IEnumerable<Drawable> EffectTargets => new[] { background };
|
|
||||||
|
|
||||||
private readonly string text;
|
|
||||||
|
|
||||||
[Resolved]
|
|
||||||
private OverlayColourProvider colourProvider { get; set; }
|
|
||||||
|
|
||||||
private OsuSpriteText drawableText;
|
|
||||||
private Box background;
|
|
||||||
private Box blockedBackground;
|
|
||||||
|
|
||||||
public CommitButton(string text)
|
|
||||||
{
|
{
|
||||||
this.text = text;
|
Width = 80;
|
||||||
|
Height = 25;
|
||||||
AutoSizeAxes = Axes.Both;
|
Anchor = Anchor.CentreRight;
|
||||||
LoadingAnimationSize = new Vector2(10);
|
Origin = Anchor.CentreRight;
|
||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
protected override SpriteText CreateText()
|
||||||
private void load()
|
|
||||||
{
|
{
|
||||||
IdleColour = colourProvider.Light4;
|
var t = base.CreateText();
|
||||||
HoverColour = colourProvider.Light3;
|
t.Font = OsuFont.GetFont(weight: FontWeight.Bold, size: 12);
|
||||||
blockedBackground.Colour = colourProvider.Background5;
|
return t;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void LoadComplete()
|
|
||||||
{
|
|
||||||
base.LoadComplete();
|
|
||||||
IsBlocked.BindValueChanged(onBlockedStateChanged, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void onBlockedStateChanged(ValueChangedEvent<bool> isBlocked)
|
|
||||||
{
|
|
||||||
drawableText.FadeColour(isBlocked.NewValue ? colourProvider.Foreground1 : Color4.White, duration, Easing.OutQuint);
|
|
||||||
background.FadeTo(isBlocked.NewValue ? 0 : 1, duration, Easing.OutQuint);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override Drawable CreateContent() => new CircularContainer
|
|
||||||
{
|
|
||||||
Masking = true,
|
|
||||||
Height = 25,
|
|
||||||
AutoSizeAxes = Axes.X,
|
|
||||||
Children = new Drawable[]
|
|
||||||
{
|
|
||||||
blockedBackground = new Box
|
|
||||||
{
|
|
||||||
RelativeSizeAxes = Axes.Both
|
|
||||||
},
|
|
||||||
background = new Box
|
|
||||||
{
|
|
||||||
RelativeSizeAxes = Axes.Both,
|
|
||||||
Alpha = 0
|
|
||||||
},
|
|
||||||
drawableText = new OsuSpriteText
|
|
||||||
{
|
|
||||||
AlwaysPresent = true,
|
|
||||||
Anchor = Anchor.Centre,
|
|
||||||
Origin = Anchor.Centre,
|
|
||||||
Font = OsuFont.GetFont(size: 12, weight: FontWeight.Bold),
|
|
||||||
Margin = new MarginPadding { Horizontal = 20 },
|
|
||||||
Text = text,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
protected override void OnLoadStarted() => drawableText.FadeOut(duration, Easing.OutQuint);
|
|
||||||
|
|
||||||
protected override void OnLoadFinished() => drawableText.FadeIn(duration, Easing.OutQuint);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,10 +7,10 @@ using osu.Framework.Allocation;
|
|||||||
using osu.Framework.Extensions.Color4Extensions;
|
using osu.Framework.Extensions.Color4Extensions;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Effects;
|
using osu.Framework.Graphics.Effects;
|
||||||
using osu.Framework.Graphics.Sprites;
|
|
||||||
using osu.Framework.Graphics.UserInterface;
|
using osu.Framework.Graphics.UserInterface;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Graphics.UserInterface;
|
using osu.Game.Graphics.UserInterface;
|
||||||
|
using osu.Game.Users.Drawables;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
using osuTK.Graphics;
|
using osuTK.Graphics;
|
||||||
|
|
||||||
@ -78,7 +78,7 @@ namespace osu.Game.Overlays.Login
|
|||||||
{
|
{
|
||||||
public const float LABEL_LEFT_MARGIN = 20;
|
public const float LABEL_LEFT_MARGIN = 20;
|
||||||
|
|
||||||
private readonly SpriteIcon statusIcon;
|
private readonly StatusIcon statusIcon;
|
||||||
|
|
||||||
public Color4 StatusColour
|
public Color4 StatusColour
|
||||||
{
|
{
|
||||||
@ -101,11 +101,10 @@ namespace osu.Game.Overlays.Login
|
|||||||
Icon.Size = new Vector2(14);
|
Icon.Size = new Vector2(14);
|
||||||
Icon.Margin = new MarginPadding(0);
|
Icon.Margin = new MarginPadding(0);
|
||||||
|
|
||||||
Foreground.Add(statusIcon = new SpriteIcon
|
Foreground.Add(statusIcon = new StatusIcon
|
||||||
{
|
{
|
||||||
Anchor = Anchor.CentreLeft,
|
Anchor = Anchor.CentreLeft,
|
||||||
Origin = Anchor.CentreLeft,
|
Origin = Anchor.CentreLeft,
|
||||||
Icon = FontAwesome.Regular.Circle,
|
|
||||||
Size = new Vector2(14),
|
Size = new Vector2(14),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -92,8 +92,8 @@ namespace osu.Game.Overlays
|
|||||||
RelativeSizeAxes = Axes.X,
|
RelativeSizeAxes = Axes.X,
|
||||||
Children = new[]
|
Children = new[]
|
||||||
{
|
{
|
||||||
new NotificationSection(AccountsStrings.NotificationsTitle, new[] { typeof(SimpleNotification) }, "Clear All"),
|
new NotificationSection(AccountsStrings.NotificationsTitle, new[] { typeof(SimpleNotification) }, NotificationsStrings.ClearAll),
|
||||||
new NotificationSection(@"Running Tasks", new[] { typeof(ProgressNotification) }, @"Cancel All"),
|
new NotificationSection(NotificationsStrings.RunningTasks, new[] { typeof(ProgressNotification) }, NotificationsStrings.CancelAll),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -33,15 +33,15 @@ namespace osu.Game.Overlays.Notifications
|
|||||||
|
|
||||||
public IEnumerable<Type> AcceptedNotificationTypes { get; }
|
public IEnumerable<Type> AcceptedNotificationTypes { get; }
|
||||||
|
|
||||||
private readonly string clearButtonText;
|
private readonly LocalisableString clearButtonText;
|
||||||
|
|
||||||
private readonly LocalisableString titleText;
|
private readonly LocalisableString titleText;
|
||||||
|
|
||||||
public NotificationSection(LocalisableString title, IEnumerable<Type> acceptedNotificationTypes, string clearButtonText)
|
public NotificationSection(LocalisableString title, IEnumerable<Type> acceptedNotificationTypes, LocalisableString clearButtonText)
|
||||||
{
|
{
|
||||||
AcceptedNotificationTypes = acceptedNotificationTypes.ToArray();
|
AcceptedNotificationTypes = acceptedNotificationTypes.ToArray();
|
||||||
|
|
||||||
this.clearButtonText = clearButtonText.ToUpperInvariant();
|
this.clearButtonText = clearButtonText.ToUpper();
|
||||||
titleText = title;
|
titleText = title;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -75,19 +75,11 @@ namespace osu.Game.Overlays
|
|||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.X,
|
RelativeSizeAxes = Axes.X,
|
||||||
AutoSizeAxes = Axes.Y,
|
AutoSizeAxes = Axes.Y,
|
||||||
Children = new[]
|
Child = Title = CreateTitle().With(title =>
|
||||||
{
|
{
|
||||||
Title = CreateTitle().With(title =>
|
title.Anchor = Anchor.CentreLeft;
|
||||||
{
|
title.Origin = Anchor.CentreLeft;
|
||||||
title.Anchor = Anchor.CentreLeft;
|
}),
|
||||||
title.Origin = Anchor.CentreLeft;
|
|
||||||
}),
|
|
||||||
CreateTitleContent().With(content =>
|
|
||||||
{
|
|
||||||
content.Anchor = Anchor.CentreRight;
|
|
||||||
content.Origin = Anchor.CentreRight;
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -112,12 +104,6 @@ namespace osu.Game.Overlays
|
|||||||
[NotNull]
|
[NotNull]
|
||||||
protected virtual Drawable CreateBackground() => Empty();
|
protected virtual Drawable CreateBackground() => Empty();
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Creates a <see cref="Drawable"/> on the opposite side of the <see cref="OverlayTitle"/>. Used mostly to create <see cref="OverlayRulesetSelector"/>.
|
|
||||||
/// </summary>
|
|
||||||
[NotNull]
|
|
||||||
protected virtual Drawable CreateTitleContent() => Empty();
|
|
||||||
|
|
||||||
protected abstract OverlayTitle CreateTitle();
|
protected abstract OverlayTitle CreateTitle();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,6 +13,9 @@ namespace osu.Game.Overlays
|
|||||||
{
|
{
|
||||||
public partial class OverlayRulesetSelector : RulesetSelector
|
public partial class OverlayRulesetSelector : RulesetSelector
|
||||||
{
|
{
|
||||||
|
// Since this component is used in online overlays and currently web-side doesn't support non-legacy rulesets, let's disable them for now.
|
||||||
|
protected override bool LegacyOnly => true;
|
||||||
|
|
||||||
public OverlayRulesetSelector()
|
public OverlayRulesetSelector()
|
||||||
{
|
{
|
||||||
AutoSizeAxes = Axes.Both;
|
AutoSizeAxes = Axes.Both;
|
||||||
|
@ -3,26 +3,18 @@
|
|||||||
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Extensions.LocalisationExtensions;
|
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
using osu.Framework.Localisation;
|
|
||||||
using osu.Game.Online.API.Requests.Responses;
|
|
||||||
using osu.Game.Overlays.Profile.Header.Components;
|
using osu.Game.Overlays.Profile.Header.Components;
|
||||||
using osu.Game.Resources.Localisation.Web;
|
|
||||||
using osuTK;
|
using osuTK;
|
||||||
|
|
||||||
namespace osu.Game.Overlays.Profile.Header
|
namespace osu.Game.Overlays.Profile.Header
|
||||||
{
|
{
|
||||||
public partial class CentreHeaderContainer : CompositeDrawable
|
public partial class CentreHeaderContainer : CompositeDrawable
|
||||||
{
|
{
|
||||||
public readonly BindableBool DetailsVisible = new BindableBool(true);
|
|
||||||
public readonly Bindable<UserProfileData?> User = new Bindable<UserProfileData?>();
|
public readonly Bindable<UserProfileData?> User = new Bindable<UserProfileData?>();
|
||||||
|
|
||||||
private OverlinedInfoContainer hiddenDetailGlobal = null!;
|
|
||||||
private OverlinedInfoContainer hiddenDetailCountry = null!;
|
|
||||||
|
|
||||||
public CentreHeaderContainer()
|
public CentreHeaderContainer()
|
||||||
{
|
{
|
||||||
Height = 60;
|
Height = 60;
|
||||||
@ -31,15 +23,12 @@ namespace osu.Game.Overlays.Profile.Header
|
|||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OverlayColourProvider colourProvider)
|
private void load(OverlayColourProvider colourProvider)
|
||||||
{
|
{
|
||||||
Container<Drawable> hiddenDetailContainer;
|
|
||||||
Container<Drawable> expandedDetailContainer;
|
|
||||||
|
|
||||||
InternalChildren = new Drawable[]
|
InternalChildren = new Drawable[]
|
||||||
{
|
{
|
||||||
new Box
|
new Box
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Colour = colourProvider.Background4
|
Colour = colourProvider.Background3
|
||||||
},
|
},
|
||||||
new FillFlowContainer
|
new FillFlowContainer
|
||||||
{
|
{
|
||||||
@ -66,20 +55,6 @@ namespace osu.Game.Overlays.Profile.Header
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
new Container
|
new Container
|
||||||
{
|
|
||||||
Anchor = Anchor.CentreRight,
|
|
||||||
Origin = Anchor.CentreRight,
|
|
||||||
RelativeSizeAxes = Axes.Y,
|
|
||||||
Padding = new MarginPadding { Vertical = 10 },
|
|
||||||
Width = UserProfileOverlay.CONTENT_X_MARGIN,
|
|
||||||
Child = new ExpandDetailsButton
|
|
||||||
{
|
|
||||||
Anchor = Anchor.Centre,
|
|
||||||
Origin = Anchor.Centre,
|
|
||||||
DetailsVisible = { BindTarget = DetailsVisible }
|
|
||||||
},
|
|
||||||
},
|
|
||||||
new Container
|
|
||||||
{
|
{
|
||||||
Anchor = Anchor.CentreRight,
|
Anchor = Anchor.CentreRight,
|
||||||
Origin = Anchor.CentreRight,
|
Origin = Anchor.CentreRight,
|
||||||
@ -94,7 +69,7 @@ namespace osu.Game.Overlays.Profile.Header
|
|||||||
Size = new Vector2(40),
|
Size = new Vector2(40),
|
||||||
User = { BindTarget = User }
|
User = { BindTarget = User }
|
||||||
},
|
},
|
||||||
expandedDetailContainer = new Container
|
new Container
|
||||||
{
|
{
|
||||||
Anchor = Anchor.CentreRight,
|
Anchor = Anchor.CentreRight,
|
||||||
Origin = Anchor.CentreRight,
|
Origin = Anchor.CentreRight,
|
||||||
@ -107,47 +82,9 @@ namespace osu.Game.Overlays.Profile.Header
|
|||||||
User = { BindTarget = User }
|
User = { BindTarget = User }
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
hiddenDetailContainer = new FillFlowContainer
|
|
||||||
{
|
|
||||||
Direction = FillDirection.Horizontal,
|
|
||||||
Anchor = Anchor.CentreRight,
|
|
||||||
Origin = Anchor.CentreRight,
|
|
||||||
Width = 200,
|
|
||||||
AutoSizeAxes = Axes.Y,
|
|
||||||
Alpha = 0,
|
|
||||||
Spacing = new Vector2(10, 0),
|
|
||||||
Margin = new MarginPadding { Right = 50 },
|
|
||||||
Children = new[]
|
|
||||||
{
|
|
||||||
hiddenDetailGlobal = new OverlinedInfoContainer
|
|
||||||
{
|
|
||||||
Title = UsersStrings.ShowRankGlobalSimple,
|
|
||||||
LineColour = colourProvider.Highlight1
|
|
||||||
},
|
|
||||||
hiddenDetailCountry = new OverlinedInfoContainer
|
|
||||||
{
|
|
||||||
Title = UsersStrings.ShowRankCountrySimple,
|
|
||||||
LineColour = colourProvider.Highlight1
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
DetailsVisible.BindValueChanged(visible =>
|
|
||||||
{
|
|
||||||
hiddenDetailContainer.FadeTo(visible.NewValue ? 0 : 1, 200, Easing.OutQuint);
|
|
||||||
expandedDetailContainer.FadeTo(visible.NewValue ? 1 : 0, 200, Easing.OutQuint);
|
|
||||||
});
|
|
||||||
|
|
||||||
User.BindValueChanged(user => updateDisplay(user.NewValue?.User));
|
|
||||||
}
|
|
||||||
|
|
||||||
private void updateDisplay(APIUser? user)
|
|
||||||
{
|
|
||||||
hiddenDetailGlobal.Content = user?.Statistics?.GlobalRank?.ToLocalisableString("\\##,##0") ?? (LocalisableString)"-";
|
|
||||||
hiddenDetailCountry.Content = user?.Statistics?.CountryRank?.ToLocalisableString("\\##,##0") ?? (LocalisableString)"-";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -62,7 +62,7 @@ namespace osu.Game.Overlays.Profile.Header.Components
|
|||||||
new OsuSpriteText
|
new OsuSpriteText
|
||||||
{
|
{
|
||||||
Text = group.ShortName,
|
Text = group.ShortName,
|
||||||
Colour = Color4Extensions.FromHex(group.Colour),
|
Colour = Color4Extensions.FromHex(group.Colour ?? Colour4.White.ToHex()),
|
||||||
Shadow = false,
|
Shadow = false,
|
||||||
Font = OsuFont.GetFont(size: TextSize, weight: FontWeight.Bold, italics: true)
|
Font = OsuFont.GetFont(size: TextSize, weight: FontWeight.Bold, italics: true)
|
||||||
}
|
}
|
||||||
|
@ -1,19 +1,17 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Shapes;
|
|
||||||
using osu.Framework.Localisation;
|
using osu.Framework.Localisation;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Graphics.Sprites;
|
using osu.Game.Graphics.Sprites;
|
||||||
using osuTK.Graphics;
|
|
||||||
|
|
||||||
namespace osu.Game.Overlays.Profile.Header.Components
|
namespace osu.Game.Overlays.Profile.Header.Components
|
||||||
{
|
{
|
||||||
public partial class OverlinedInfoContainer : CompositeDrawable
|
public partial class ProfileValueDisplay : CompositeDrawable
|
||||||
{
|
{
|
||||||
private readonly Circle line;
|
|
||||||
private readonly OsuSpriteText title;
|
private readonly OsuSpriteText title;
|
||||||
private readonly OsuSpriteText content;
|
private readonly OsuSpriteText content;
|
||||||
|
|
||||||
@ -27,12 +25,7 @@ namespace osu.Game.Overlays.Profile.Header.Components
|
|||||||
set => content.Text = value;
|
set => content.Text = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Color4 LineColour
|
public ProfileValueDisplay(bool big = false, int minimumWidth = 60)
|
||||||
{
|
|
||||||
set => line.Colour = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
public OverlinedInfoContainer(bool big = false, int minimumWidth = 60)
|
|
||||||
{
|
{
|
||||||
AutoSizeAxes = Axes.Both;
|
AutoSizeAxes = Axes.Both;
|
||||||
InternalChild = new FillFlowContainer
|
InternalChild = new FillFlowContainer
|
||||||
@ -41,19 +34,13 @@ namespace osu.Game.Overlays.Profile.Header.Components
|
|||||||
AutoSizeAxes = Axes.Both,
|
AutoSizeAxes = Axes.Both,
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
line = new Circle
|
|
||||||
{
|
|
||||||
RelativeSizeAxes = Axes.X,
|
|
||||||
Height = 2,
|
|
||||||
Margin = new MarginPadding { Bottom = 2 }
|
|
||||||
},
|
|
||||||
title = new OsuSpriteText
|
title = new OsuSpriteText
|
||||||
{
|
{
|
||||||
Font = OsuFont.GetFont(size: big ? 14 : 12, weight: FontWeight.Bold)
|
Font = OsuFont.GetFont(size: 12)
|
||||||
},
|
},
|
||||||
content = new OsuSpriteText
|
content = new OsuSpriteText
|
||||||
{
|
{
|
||||||
Font = OsuFont.GetFont(size: big ? 40 : 18, weight: FontWeight.Light)
|
Font = OsuFont.GetFont(size: big ? 30 : 20, weight: FontWeight.Light)
|
||||||
},
|
},
|
||||||
new Container // Add a minimum size to the FillFlowContainer
|
new Container // Add a minimum size to the FillFlowContainer
|
||||||
{
|
{
|
||||||
@ -62,5 +49,12 @@ namespace osu.Game.Overlays.Profile.Header.Components
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[BackgroundDependencyLoader]
|
||||||
|
private void load(OverlayColourProvider colourProvider)
|
||||||
|
{
|
||||||
|
title.Colour = colourProvider.Content1;
|
||||||
|
content.Colour = colourProvider.Content2;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -11,15 +11,15 @@ using osu.Game.Resources.Localisation.Web;
|
|||||||
|
|
||||||
namespace osu.Game.Overlays.Profile.Header.Components
|
namespace osu.Game.Overlays.Profile.Header.Components
|
||||||
{
|
{
|
||||||
public partial class OverlinedTotalPlayTime : CompositeDrawable, IHasTooltip
|
public partial class TotalPlayTime : CompositeDrawable, IHasTooltip
|
||||||
{
|
{
|
||||||
public readonly Bindable<UserProfileData?> User = new Bindable<UserProfileData?>();
|
public readonly Bindable<UserProfileData?> User = new Bindable<UserProfileData?>();
|
||||||
|
|
||||||
public LocalisableString TooltipText { get; set; }
|
public LocalisableString TooltipText { get; set; }
|
||||||
|
|
||||||
private OverlinedInfoContainer info = null!;
|
private ProfileValueDisplay info = null!;
|
||||||
|
|
||||||
public OverlinedTotalPlayTime()
|
public TotalPlayTime()
|
||||||
{
|
{
|
||||||
AutoSizeAxes = Axes.Both;
|
AutoSizeAxes = Axes.Both;
|
||||||
|
|
||||||
@ -27,12 +27,11 @@ namespace osu.Game.Overlays.Profile.Header.Components
|
|||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OverlayColourProvider colourProvider)
|
private void load()
|
||||||
{
|
{
|
||||||
InternalChild = info = new OverlinedInfoContainer
|
InternalChild = info = new ProfileValueDisplay(minimumWidth: 140)
|
||||||
{
|
{
|
||||||
Title = UsersStrings.ShowStatsPlayTime,
|
Title = UsersStrings.ShowStatsPlayTime,
|
||||||
LineColour = colourProvider.Highlight1,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
User.BindValueChanged(updateTime, true);
|
User.BindValueChanged(updateTime, true);
|
@ -22,41 +22,16 @@ namespace osu.Game.Overlays.Profile.Header
|
|||||||
public partial class DetailHeaderContainer : CompositeDrawable
|
public partial class DetailHeaderContainer : CompositeDrawable
|
||||||
{
|
{
|
||||||
private readonly Dictionary<ScoreRank, ScoreRankInfo> scoreRankInfos = new Dictionary<ScoreRank, ScoreRankInfo>();
|
private readonly Dictionary<ScoreRank, ScoreRankInfo> scoreRankInfos = new Dictionary<ScoreRank, ScoreRankInfo>();
|
||||||
private OverlinedInfoContainer medalInfo = null!;
|
private ProfileValueDisplay medalInfo = null!;
|
||||||
private OverlinedInfoContainer ppInfo = null!;
|
private ProfileValueDisplay ppInfo = null!;
|
||||||
private OverlinedInfoContainer detailGlobalRank = null!;
|
private ProfileValueDisplay detailGlobalRank = null!;
|
||||||
private OverlinedInfoContainer detailCountryRank = null!;
|
private ProfileValueDisplay detailCountryRank = null!;
|
||||||
private FillFlowContainer? fillFlow;
|
|
||||||
private RankGraph rankGraph = null!;
|
private RankGraph rankGraph = null!;
|
||||||
|
|
||||||
public readonly Bindable<UserProfileData?> User = new Bindable<UserProfileData?>();
|
public readonly Bindable<UserProfileData?> User = new Bindable<UserProfileData?>();
|
||||||
|
|
||||||
private bool expanded = true;
|
|
||||||
|
|
||||||
public bool Expanded
|
|
||||||
{
|
|
||||||
set
|
|
||||||
{
|
|
||||||
if (expanded == value) return;
|
|
||||||
|
|
||||||
expanded = value;
|
|
||||||
|
|
||||||
if (fillFlow == null) return;
|
|
||||||
|
|
||||||
fillFlow.ClearTransforms();
|
|
||||||
|
|
||||||
if (expanded)
|
|
||||||
fillFlow.AutoSizeAxes = Axes.Y;
|
|
||||||
else
|
|
||||||
{
|
|
||||||
fillFlow.AutoSizeAxes = Axes.None;
|
|
||||||
fillFlow.ResizeHeightTo(0, 200, Easing.OutQuint);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OverlayColourProvider colourProvider, OsuColour colours)
|
private void load(OverlayColourProvider colourProvider)
|
||||||
{
|
{
|
||||||
AutoSizeAxes = Axes.Y;
|
AutoSizeAxes = Axes.Y;
|
||||||
|
|
||||||
@ -69,18 +44,48 @@ namespace osu.Game.Overlays.Profile.Header
|
|||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Colour = colourProvider.Background5,
|
Colour = colourProvider.Background5,
|
||||||
},
|
},
|
||||||
fillFlow = new FillFlowContainer
|
new FillFlowContainer
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.X,
|
RelativeSizeAxes = Axes.X,
|
||||||
AutoSizeAxes = expanded ? Axes.Y : Axes.None,
|
AutoSizeAxes = Axes.Y,
|
||||||
AutoSizeDuration = 200,
|
AutoSizeDuration = 200,
|
||||||
AutoSizeEasing = Easing.OutQuint,
|
AutoSizeEasing = Easing.OutQuint,
|
||||||
Masking = true,
|
Masking = true,
|
||||||
Padding = new MarginPadding { Horizontal = UserProfileOverlay.CONTENT_X_MARGIN, Vertical = 10 },
|
Padding = new MarginPadding { Horizontal = UserProfileOverlay.CONTENT_X_MARGIN, Vertical = 10 },
|
||||||
Direction = FillDirection.Vertical,
|
Direction = FillDirection.Vertical,
|
||||||
Spacing = new Vector2(0, 20),
|
Spacing = new Vector2(0, 15),
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
|
new FillFlowContainer
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.X,
|
||||||
|
AutoSizeAxes = Axes.Y,
|
||||||
|
Direction = FillDirection.Horizontal,
|
||||||
|
Spacing = new Vector2(20),
|
||||||
|
Children = new Drawable[]
|
||||||
|
{
|
||||||
|
detailGlobalRank = new ProfileValueDisplay(true)
|
||||||
|
{
|
||||||
|
Title = UsersStrings.ShowRankGlobalSimple,
|
||||||
|
},
|
||||||
|
detailCountryRank = new ProfileValueDisplay(true)
|
||||||
|
{
|
||||||
|
Title = UsersStrings.ShowRankCountrySimple,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
new Container
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.X,
|
||||||
|
Height = 60,
|
||||||
|
Children = new Drawable[]
|
||||||
|
{
|
||||||
|
rankGraph = new RankGraph
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
new Container
|
new Container
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.X,
|
RelativeSizeAxes = Axes.X,
|
||||||
@ -96,19 +101,17 @@ namespace osu.Game.Overlays.Profile.Header
|
|||||||
Spacing = new Vector2(10, 0),
|
Spacing = new Vector2(10, 0),
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
new OverlinedTotalPlayTime
|
medalInfo = new ProfileValueDisplay
|
||||||
{
|
|
||||||
User = { BindTarget = User }
|
|
||||||
},
|
|
||||||
medalInfo = new OverlinedInfoContainer
|
|
||||||
{
|
{
|
||||||
Title = UsersStrings.ShowStatsMedals,
|
Title = UsersStrings.ShowStatsMedals,
|
||||||
LineColour = colours.GreenLight,
|
|
||||||
},
|
},
|
||||||
ppInfo = new OverlinedInfoContainer
|
ppInfo = new ProfileValueDisplay
|
||||||
{
|
{
|
||||||
Title = "pp",
|
Title = "pp",
|
||||||
LineColour = colours.Red,
|
},
|
||||||
|
new TotalPlayTime
|
||||||
|
{
|
||||||
|
User = { BindTarget = User }
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -130,41 +133,6 @@ namespace osu.Game.Overlays.Profile.Header
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
new Container
|
|
||||||
{
|
|
||||||
RelativeSizeAxes = Axes.X,
|
|
||||||
AutoSizeAxes = Axes.Y,
|
|
||||||
Padding = new MarginPadding { Right = 130 },
|
|
||||||
Children = new Drawable[]
|
|
||||||
{
|
|
||||||
rankGraph = new RankGraph
|
|
||||||
{
|
|
||||||
RelativeSizeAxes = Axes.Both,
|
|
||||||
},
|
|
||||||
new FillFlowContainer
|
|
||||||
{
|
|
||||||
AutoSizeAxes = Axes.Y,
|
|
||||||
Width = 130,
|
|
||||||
Anchor = Anchor.TopRight,
|
|
||||||
Direction = FillDirection.Vertical,
|
|
||||||
Padding = new MarginPadding { Horizontal = 10 },
|
|
||||||
Spacing = new Vector2(0, 20),
|
|
||||||
Children = new Drawable[]
|
|
||||||
{
|
|
||||||
detailGlobalRank = new OverlinedInfoContainer(true, 110)
|
|
||||||
{
|
|
||||||
Title = UsersStrings.ShowRankGlobalSimple,
|
|
||||||
LineColour = colourProvider.Highlight1,
|
|
||||||
},
|
|
||||||
detailCountryRank = new OverlinedInfoContainer(false, 110)
|
|
||||||
{
|
|
||||||
Title = UsersStrings.ShowRankCountrySimple,
|
|
||||||
LineColour = colourProvider.Highlight1,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@ -201,14 +169,14 @@ namespace osu.Game.Overlays.Profile.Header
|
|||||||
InternalChild = new FillFlowContainer
|
InternalChild = new FillFlowContainer
|
||||||
{
|
{
|
||||||
AutoSizeAxes = Axes.Y,
|
AutoSizeAxes = Axes.Y,
|
||||||
Width = 56,
|
Width = 44,
|
||||||
Direction = FillDirection.Vertical,
|
Direction = FillDirection.Vertical,
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
new DrawableRank(rank)
|
new DrawableRank(rank)
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.X,
|
RelativeSizeAxes = Axes.X,
|
||||||
Height = 30,
|
Height = 22,
|
||||||
},
|
},
|
||||||
rankCount = new OsuSpriteText
|
rankCount = new OsuSpriteText
|
||||||
{
|
{
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
using System.Threading;
|
using System.Threading;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Extensions.Color4Extensions;
|
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Colour;
|
using osu.Framework.Graphics.Colour;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
@ -12,7 +11,6 @@ using osu.Framework.Graphics.Shapes;
|
|||||||
using osu.Game.Online.API.Requests.Responses;
|
using osu.Game.Online.API.Requests.Responses;
|
||||||
using osu.Game.Overlays.Profile.Header.Components;
|
using osu.Game.Overlays.Profile.Header.Components;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
using osuTK.Graphics;
|
|
||||||
|
|
||||||
namespace osu.Game.Overlays.Profile.Header
|
namespace osu.Game.Overlays.Profile.Header
|
||||||
{
|
{
|
||||||
@ -43,23 +41,16 @@ namespace osu.Game.Overlays.Profile.Header
|
|||||||
Child = new Box
|
Child = new Box
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Colour = new ColourInfo
|
Colour = ColourInfo.GradientVertical(Colour4.Black.Opacity(0.2f), Colour4.Black.Opacity(0))
|
||||||
{
|
}
|
||||||
TopLeft = Color4.Black.Opacity(0.2f),
|
|
||||||
TopRight = Color4.Black.Opacity(0.2f),
|
|
||||||
BottomLeft = Color4.Black.Opacity(0),
|
|
||||||
BottomRight = Color4.Black.Opacity(0)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
badgeFlowContainer = new FillFlowContainer
|
badgeFlowContainer = new FillFlowContainer
|
||||||
{
|
{
|
||||||
Direction = FillDirection.Full,
|
Direction = FillDirection.Full,
|
||||||
RelativeSizeAxes = Axes.X,
|
RelativeSizeAxes = Axes.X,
|
||||||
AutoSizeAxes = Axes.Y,
|
AutoSizeAxes = Axes.Y,
|
||||||
Margin = new MarginPadding { Top = 5 },
|
|
||||||
Spacing = new Vector2(10, 10),
|
Spacing = new Vector2(10, 10),
|
||||||
Padding = new MarginPadding { Horizontal = UserProfileOverlay.CONTENT_X_MARGIN, Vertical = 10 },
|
Padding = new MarginPadding { Horizontal = UserProfileOverlay.CONTENT_X_MARGIN, Top = 10 },
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -51,7 +51,7 @@ namespace osu.Game.Overlays.Profile.Header
|
|||||||
new Box
|
new Box
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Colour = colourProvider.Background5,
|
Colour = colourProvider.Background4,
|
||||||
},
|
},
|
||||||
new FillFlowContainer
|
new FillFlowContainer
|
||||||
{
|
{
|
||||||
|
@ -36,18 +36,9 @@ namespace osu.Game.Overlays.Profile
|
|||||||
// todo: pending implementation.
|
// todo: pending implementation.
|
||||||
// TabControl.AddItem(LayoutStrings.HeaderUsersModding);
|
// TabControl.AddItem(LayoutStrings.HeaderUsersModding);
|
||||||
|
|
||||||
TabControlContainer.Add(new ProfileRulesetSelector
|
|
||||||
{
|
|
||||||
Anchor = Anchor.CentreRight,
|
|
||||||
Origin = Anchor.CentreRight,
|
|
||||||
User = { BindTarget = User }
|
|
||||||
});
|
|
||||||
|
|
||||||
// Haphazardly guaranteed by OverlayHeader constructor (see CreateBackground / CreateContent).
|
// Haphazardly guaranteed by OverlayHeader constructor (see CreateBackground / CreateContent).
|
||||||
Debug.Assert(centreHeaderContainer != null);
|
Debug.Assert(centreHeaderContainer != null);
|
||||||
Debug.Assert(detailHeaderContainer != null);
|
Debug.Assert(detailHeaderContainer != null);
|
||||||
|
|
||||||
centreHeaderContainer.DetailsVisible.BindValueChanged(visible => detailHeaderContainer.Expanded = visible.NewValue, true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override Drawable CreateBackground() =>
|
protected override Drawable CreateBackground() =>
|
||||||
@ -82,7 +73,7 @@ namespace osu.Game.Overlays.Profile
|
|||||||
RelativeSizeAxes = Axes.X,
|
RelativeSizeAxes = Axes.X,
|
||||||
User = { BindTarget = User },
|
User = { BindTarget = User },
|
||||||
},
|
},
|
||||||
centreHeaderContainer = new CentreHeaderContainer
|
new MedalHeaderContainer
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.X,
|
RelativeSizeAxes = Axes.X,
|
||||||
User = { BindTarget = User },
|
User = { BindTarget = User },
|
||||||
@ -92,7 +83,7 @@ namespace osu.Game.Overlays.Profile
|
|||||||
RelativeSizeAxes = Axes.X,
|
RelativeSizeAxes = Axes.X,
|
||||||
User = { BindTarget = User },
|
User = { BindTarget = User },
|
||||||
},
|
},
|
||||||
new MedalHeaderContainer
|
centreHeaderContainer = new CentreHeaderContainer
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.X,
|
RelativeSizeAxes = Axes.X,
|
||||||
User = { BindTarget = User },
|
User = { BindTarget = User },
|
||||||
@ -107,6 +98,11 @@ namespace osu.Game.Overlays.Profile
|
|||||||
|
|
||||||
protected override OverlayTitle CreateTitle() => new ProfileHeaderTitle();
|
protected override OverlayTitle CreateTitle() => new ProfileHeaderTitle();
|
||||||
|
|
||||||
|
protected override Drawable CreateTabControlContent() => new ProfileRulesetSelector
|
||||||
|
{
|
||||||
|
User = { BindTarget = User }
|
||||||
|
};
|
||||||
|
|
||||||
private void updateDisplay(UserProfileData? user) => coverContainer.User = user?.User;
|
private void updateDisplay(UserProfileData? user) => coverContainer.User = user?.User;
|
||||||
|
|
||||||
private partial class ProfileHeaderTitle : OverlayTitle
|
private partial class ProfileHeaderTitle : OverlayTitle
|
||||||
|
@ -3,16 +3,15 @@
|
|||||||
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Extensions.Color4Extensions;
|
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Colour;
|
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
|
using osu.Framework.Graphics.Effects;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
using osu.Framework.Localisation;
|
using osu.Framework.Localisation;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Graphics.Backgrounds;
|
|
||||||
using osu.Game.Graphics.Containers;
|
using osu.Game.Graphics.Containers;
|
||||||
using osu.Game.Graphics.Sprites;
|
using osu.Game.Graphics.Sprites;
|
||||||
|
using osuTK;
|
||||||
|
|
||||||
namespace osu.Game.Overlays.Profile
|
namespace osu.Game.Overlays.Profile
|
||||||
{
|
{
|
||||||
@ -30,22 +29,29 @@ namespace osu.Game.Overlays.Profile
|
|||||||
|
|
||||||
public readonly Bindable<UserProfileData?> User = new Bindable<UserProfileData?>();
|
public readonly Bindable<UserProfileData?> User = new Bindable<UserProfileData?>();
|
||||||
|
|
||||||
|
private const float outer_gutter_width = 10;
|
||||||
|
|
||||||
protected ProfileSection()
|
protected ProfileSection()
|
||||||
{
|
{
|
||||||
AutoSizeAxes = Axes.Y;
|
AutoSizeAxes = Axes.Y;
|
||||||
RelativeSizeAxes = Axes.X;
|
RelativeSizeAxes = Axes.X;
|
||||||
|
|
||||||
|
Masking = true;
|
||||||
|
CornerRadius = 10;
|
||||||
|
EdgeEffect = new EdgeEffectParameters
|
||||||
|
{
|
||||||
|
Type = EdgeEffectType.Shadow,
|
||||||
|
Offset = new Vector2(0, 1),
|
||||||
|
Radius = 3,
|
||||||
|
Colour = Colour4.Black.Opacity(0.25f)
|
||||||
|
};
|
||||||
|
|
||||||
InternalChildren = new Drawable[]
|
InternalChildren = new Drawable[]
|
||||||
{
|
{
|
||||||
background = new Box
|
background = new Box
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
},
|
},
|
||||||
new SectionTriangles
|
|
||||||
{
|
|
||||||
Anchor = Anchor.BottomCentre,
|
|
||||||
Origin = Anchor.BottomCentre,
|
|
||||||
},
|
|
||||||
new FillFlowContainer
|
new FillFlowContainer
|
||||||
{
|
{
|
||||||
Direction = FillDirection.Vertical,
|
Direction = FillDirection.Vertical,
|
||||||
@ -58,8 +64,8 @@ namespace osu.Game.Overlays.Profile
|
|||||||
AutoSizeAxes = Axes.Both,
|
AutoSizeAxes = Axes.Both,
|
||||||
Margin = new MarginPadding
|
Margin = new MarginPadding
|
||||||
{
|
{
|
||||||
Horizontal = UserProfileOverlay.CONTENT_X_MARGIN,
|
Horizontal = UserProfileOverlay.CONTENT_X_MARGIN - outer_gutter_width,
|
||||||
Top = 15,
|
Top = 20,
|
||||||
Bottom = 20,
|
Bottom = 20,
|
||||||
},
|
},
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
@ -67,7 +73,7 @@ namespace osu.Game.Overlays.Profile
|
|||||||
new OsuSpriteText
|
new OsuSpriteText
|
||||||
{
|
{
|
||||||
Text = Title,
|
Text = Title,
|
||||||
Font = OsuFont.GetFont(size: 20, weight: FontWeight.Bold),
|
Font = OsuFont.GetFont(size: 16, weight: FontWeight.Bold),
|
||||||
},
|
},
|
||||||
underscore = new Box
|
underscore = new Box
|
||||||
{
|
{
|
||||||
@ -88,7 +94,7 @@ namespace osu.Game.Overlays.Profile
|
|||||||
RelativeSizeAxes = Axes.X,
|
RelativeSizeAxes = Axes.X,
|
||||||
Padding = new MarginPadding
|
Padding = new MarginPadding
|
||||||
{
|
{
|
||||||
Horizontal = UserProfileOverlay.CONTENT_X_MARGIN,
|
Horizontal = UserProfileOverlay.CONTENT_X_MARGIN - outer_gutter_width,
|
||||||
Bottom = 20
|
Bottom = 20
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -100,43 +106,8 @@ namespace osu.Game.Overlays.Profile
|
|||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OverlayColourProvider colourProvider)
|
private void load(OverlayColourProvider colourProvider)
|
||||||
{
|
{
|
||||||
background.Colour = colourProvider.Background5;
|
background.Colour = colourProvider.Background4;
|
||||||
underscore.Colour = colourProvider.Highlight1;
|
underscore.Colour = colourProvider.Highlight1;
|
||||||
}
|
}
|
||||||
|
|
||||||
private partial class SectionTriangles : Container
|
|
||||||
{
|
|
||||||
private readonly Triangles triangles;
|
|
||||||
private readonly Box foreground;
|
|
||||||
|
|
||||||
public SectionTriangles()
|
|
||||||
{
|
|
||||||
RelativeSizeAxes = Axes.X;
|
|
||||||
Height = 100;
|
|
||||||
Masking = true;
|
|
||||||
Children = new Drawable[]
|
|
||||||
{
|
|
||||||
triangles = new Triangles
|
|
||||||
{
|
|
||||||
Anchor = Anchor.BottomCentre,
|
|
||||||
Origin = Anchor.BottomCentre,
|
|
||||||
RelativeSizeAxes = Axes.Both,
|
|
||||||
TriangleScale = 3,
|
|
||||||
},
|
|
||||||
foreground = new Box
|
|
||||||
{
|
|
||||||
RelativeSizeAxes = Axes.Both,
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
|
||||||
private void load(OverlayColourProvider colourProvider)
|
|
||||||
{
|
|
||||||
triangles.ColourLight = colourProvider.Background4;
|
|
||||||
triangles.ColourDark = colourProvider.Background5.Darken(0.2f);
|
|
||||||
foreground.Colour = ColourInfo.GradientVertical(colourProvider.Background5, colourProvider.Background5.Opacity(0));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -112,8 +112,8 @@ namespace osu.Game.Overlays.Profile.Sections.Historical
|
|||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OverlayColourProvider colourProvider)
|
private void load(OverlayColourProvider colourProvider)
|
||||||
{
|
{
|
||||||
IdleColour = colourProvider.Background4;
|
IdleColour = colourProvider.Background3;
|
||||||
HoverColour = colourProvider.Background3;
|
HoverColour = colourProvider.Background2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,9 +17,6 @@ namespace osu.Game.Overlays.Profile.Sections.Kudosu
|
|||||||
{
|
{
|
||||||
private const int height = 25;
|
private const int height = 25;
|
||||||
|
|
||||||
[Resolved]
|
|
||||||
private OsuColour colours { get; set; } = null!;
|
|
||||||
|
|
||||||
private readonly APIKudosuHistory historyItem;
|
private readonly APIKudosuHistory historyItem;
|
||||||
private readonly LinkFlowContainer linkFlowContainer;
|
private readonly LinkFlowContainer linkFlowContainer;
|
||||||
private readonly DrawableDate date;
|
private readonly DrawableDate date;
|
||||||
@ -48,9 +45,9 @@ namespace osu.Game.Overlays.Profile.Sections.Kudosu
|
|||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load()
|
private void load(OverlayColourProvider colourProvider)
|
||||||
{
|
{
|
||||||
date.Colour = colours.GreySeaFoamLighter;
|
date.Colour = colourProvider.Foreground1;
|
||||||
var formattedSource = MessageFormatter.FormatText(getString(historyItem));
|
var formattedSource = MessageFormatter.FormatText(getString(historyItem));
|
||||||
linkFlowContainer.AddLinks(formattedSource.Text, formattedSource.Links);
|
linkFlowContainer.AddLinks(formattedSource.Text, formattedSource.Links);
|
||||||
}
|
}
|
||||||
|
@ -14,6 +14,7 @@ using osu.Framework.Allocation;
|
|||||||
using osu.Framework.Extensions.LocalisationExtensions;
|
using osu.Framework.Extensions.LocalisationExtensions;
|
||||||
using osu.Game.Resources.Localisation.Web;
|
using osu.Game.Resources.Localisation.Web;
|
||||||
using osu.Framework.Localisation;
|
using osu.Framework.Localisation;
|
||||||
|
using osu.Game.Online.Chat;
|
||||||
|
|
||||||
namespace osu.Game.Overlays.Profile.Sections.Kudosu
|
namespace osu.Game.Overlays.Profile.Sections.Kudosu
|
||||||
{
|
{
|
||||||
@ -42,7 +43,7 @@ namespace osu.Game.Overlays.Profile.Sections.Kudosu
|
|||||||
: base(UsersStrings.ShowExtraKudosuTotal)
|
: base(UsersStrings.ShowExtraKudosuTotal)
|
||||||
{
|
{
|
||||||
DescriptionText.AddText("Based on how much of a contribution the user has made to beatmap moderation. See ");
|
DescriptionText.AddText("Based on how much of a contribution the user has made to beatmap moderation. See ");
|
||||||
DescriptionText.AddLink("this page", "https://osu.ppy.sh/wiki/Kudosu");
|
DescriptionText.AddLink("this page", LinkAction.OpenWiki, @"Modding/Kudosu");
|
||||||
DescriptionText.AddText(" for more information.");
|
DescriptionText.AddText(" for more information.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -65,8 +65,8 @@ namespace osu.Game.Overlays.Profile.Sections
|
|||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OverlayColourProvider colourProvider)
|
private void load(OverlayColourProvider colourProvider)
|
||||||
{
|
{
|
||||||
IdleColour = colourProvider.Background3;
|
IdleColour = colourProvider.Background2;
|
||||||
HoverColour = colourProvider.Background2;
|
HoverColour = colourProvider.Background1;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override bool OnHover(HoverEvent e)
|
protected override bool OnHover(HoverEvent e)
|
||||||
|
@ -160,7 +160,7 @@ namespace osu.Game.Overlays.Profile.Sections.Ranks
|
|||||||
Origin = Anchor.TopRight,
|
Origin = Anchor.TopRight,
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Height = 0.5f,
|
Height = 0.5f,
|
||||||
Colour = colourProvider.Background4,
|
Colour = colourProvider.Background3,
|
||||||
Shear = new Vector2(-performance_background_shear, 0),
|
Shear = new Vector2(-performance_background_shear, 0),
|
||||||
EdgeSmoothness = new Vector2(2, 0),
|
EdgeSmoothness = new Vector2(2, 0),
|
||||||
},
|
},
|
||||||
@ -172,7 +172,7 @@ namespace osu.Game.Overlays.Profile.Sections.Ranks
|
|||||||
RelativePositionAxes = Axes.Y,
|
RelativePositionAxes = Axes.Y,
|
||||||
Height = -0.5f,
|
Height = -0.5f,
|
||||||
Position = new Vector2(0, 1),
|
Position = new Vector2(0, 1),
|
||||||
Colour = colourProvider.Background4,
|
Colour = colourProvider.Background3,
|
||||||
Shear = new Vector2(performance_background_shear, 0),
|
Shear = new Vector2(performance_background_shear, 0),
|
||||||
EdgeSmoothness = new Vector2(2, 0),
|
EdgeSmoothness = new Vector2(2, 0),
|
||||||
},
|
},
|
||||||
|
@ -23,7 +23,7 @@ namespace osu.Game.Overlays.Rankings
|
|||||||
|
|
||||||
protected override OverlayTitle CreateTitle() => new RankingsTitle();
|
protected override OverlayTitle CreateTitle() => new RankingsTitle();
|
||||||
|
|
||||||
protected override Drawable CreateTitleContent() => rulesetSelector = new OverlayRulesetSelector();
|
protected override Drawable CreateTabControlContent() => rulesetSelector = new OverlayRulesetSelector();
|
||||||
|
|
||||||
protected override Drawable CreateContent() => countryFilter = new CountryFilter();
|
protected override Drawable CreateContent() => countryFilter = new CountryFilter();
|
||||||
|
|
||||||
|
@ -27,7 +27,8 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics
|
|||||||
new SettingsEnumDropdown<FrameSync>
|
new SettingsEnumDropdown<FrameSync>
|
||||||
{
|
{
|
||||||
LabelText = GraphicsSettingsStrings.FrameLimiter,
|
LabelText = GraphicsSettingsStrings.FrameLimiter,
|
||||||
Current = config.GetBindable<FrameSync>(FrameworkSetting.FrameSync)
|
Current = config.GetBindable<FrameSync>(FrameworkSetting.FrameSync),
|
||||||
|
Keywords = new[] { @"fps" },
|
||||||
},
|
},
|
||||||
new SettingsEnumDropdown<ExecutionMode>
|
new SettingsEnumDropdown<ExecutionMode>
|
||||||
{
|
{
|
||||||
|
@ -62,10 +62,18 @@ namespace osu.Game.Overlays
|
|||||||
RelativeSizeAxes = Axes.X,
|
RelativeSizeAxes = Axes.X,
|
||||||
AutoSizeAxes = Axes.Y,
|
AutoSizeAxes = Axes.Y,
|
||||||
Padding = new MarginPadding { Horizontal = ContentSidePadding },
|
Padding = new MarginPadding { Horizontal = ContentSidePadding },
|
||||||
Child = TabControl = CreateTabControl().With(control =>
|
Children = new[]
|
||||||
{
|
{
|
||||||
control.Current = Current;
|
TabControl = CreateTabControl().With(control =>
|
||||||
})
|
{
|
||||||
|
control.Current = Current;
|
||||||
|
}),
|
||||||
|
CreateTabControlContent().With(content =>
|
||||||
|
{
|
||||||
|
content.Anchor = Anchor.CentreRight;
|
||||||
|
content.Origin = Anchor.CentreRight;
|
||||||
|
}),
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -80,6 +88,12 @@ namespace osu.Game.Overlays
|
|||||||
[NotNull]
|
[NotNull]
|
||||||
protected virtual OsuTabControl<T> CreateTabControl() => new OverlayHeaderTabControl();
|
protected virtual OsuTabControl<T> CreateTabControl() => new OverlayHeaderTabControl();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Creates a <see cref="Drawable"/> on the opposite side of the <see cref="OsuTabControl{T}"/>. Used mostly to create <see cref="OverlayRulesetSelector"/>.
|
||||||
|
/// </summary>
|
||||||
|
[NotNull]
|
||||||
|
protected virtual Drawable CreateTabControlContent() => Empty();
|
||||||
|
|
||||||
public partial class OverlayHeaderTabControl : OverlayTabControl<T>
|
public partial class OverlayHeaderTabControl : OverlayTabControl<T>
|
||||||
{
|
{
|
||||||
private const float bar_height = 1;
|
private const float bar_height = 1;
|
||||||
|
@ -12,7 +12,9 @@ using osu.Framework.Graphics.Shapes;
|
|||||||
using osu.Framework.Graphics.UserInterface;
|
using osu.Framework.Graphics.UserInterface;
|
||||||
using osu.Framework.Input.Events;
|
using osu.Framework.Input.Events;
|
||||||
using osu.Game.Extensions;
|
using osu.Game.Extensions;
|
||||||
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Graphics.Containers;
|
using osu.Game.Graphics.Containers;
|
||||||
|
using osu.Game.Graphics.Sprites;
|
||||||
using osu.Game.Graphics.UserInterface;
|
using osu.Game.Graphics.UserInterface;
|
||||||
using osu.Game.Online;
|
using osu.Game.Online;
|
||||||
using osu.Game.Online.API.Requests;
|
using osu.Game.Online.API.Requests;
|
||||||
@ -42,7 +44,7 @@ namespace osu.Game.Overlays
|
|||||||
[Resolved]
|
[Resolved]
|
||||||
private RulesetStore rulesets { get; set; } = null!;
|
private RulesetStore rulesets { get; set; } = null!;
|
||||||
|
|
||||||
public const float CONTENT_X_MARGIN = 70;
|
public const float CONTENT_X_MARGIN = 50;
|
||||||
|
|
||||||
public UserProfileOverlay()
|
public UserProfileOverlay()
|
||||||
: base(OverlayColourScheme.Pink)
|
: base(OverlayColourScheme.Pink)
|
||||||
@ -59,7 +61,7 @@ namespace osu.Game.Overlays
|
|||||||
|
|
||||||
protected override ProfileHeader CreateHeader() => new ProfileHeader();
|
protected override ProfileHeader CreateHeader() => new ProfileHeader();
|
||||||
|
|
||||||
protected override Color4 BackgroundColour => ColourProvider.Background6;
|
protected override Color4 BackgroundColour => ColourProvider.Background5;
|
||||||
|
|
||||||
public void ShowUser(IUser user, IRulesetInfo? ruleset = null)
|
public void ShowUser(IUser user, IRulesetInfo? ruleset = null)
|
||||||
{
|
{
|
||||||
@ -171,46 +173,72 @@ namespace osu.Game.Overlays
|
|||||||
loadingLayer.Hide();
|
loadingLayer.Hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
private partial class ProfileSectionTabControl : OverlayTabControl<ProfileSection>
|
private partial class ProfileSectionTabControl : OsuTabControl<ProfileSection>
|
||||||
{
|
{
|
||||||
private const float bar_height = 2;
|
|
||||||
|
|
||||||
public ProfileSectionTabControl()
|
public ProfileSectionTabControl()
|
||||||
{
|
{
|
||||||
TabContainer.RelativeSizeAxes &= ~Axes.X;
|
Height = 40;
|
||||||
TabContainer.AutoSizeAxes |= Axes.X;
|
Padding = new MarginPadding { Horizontal = CONTENT_X_MARGIN };
|
||||||
TabContainer.Anchor |= Anchor.x1;
|
TabContainer.Spacing = new Vector2(20);
|
||||||
TabContainer.Origin |= Anchor.x1;
|
|
||||||
|
|
||||||
Height = 36 + bar_height;
|
|
||||||
BarHeight = bar_height;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override TabItem<ProfileSection> CreateTabItem(ProfileSection value) => new ProfileSectionTabItem(value)
|
protected override TabItem<ProfileSection> CreateTabItem(ProfileSection value) => new ProfileSectionTabItem(value);
|
||||||
{
|
|
||||||
AccentColour = AccentColour,
|
|
||||||
};
|
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
|
||||||
private void load(OverlayColourProvider colourProvider)
|
|
||||||
{
|
|
||||||
AccentColour = colourProvider.Highlight1;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override bool OnClick(ClickEvent e) => true;
|
protected override bool OnClick(ClickEvent e) => true;
|
||||||
|
|
||||||
protected override bool OnHover(HoverEvent e) => true;
|
protected override bool OnHover(HoverEvent e) => true;
|
||||||
|
|
||||||
private partial class ProfileSectionTabItem : OverlayTabItem
|
private partial class ProfileSectionTabItem : TabItem<ProfileSection>
|
||||||
{
|
{
|
||||||
|
private OsuSpriteText text = null!;
|
||||||
|
|
||||||
|
[Resolved]
|
||||||
|
private OverlayColourProvider colourProvider { get; set; } = null!;
|
||||||
|
|
||||||
public ProfileSectionTabItem(ProfileSection value)
|
public ProfileSectionTabItem(ProfileSection value)
|
||||||
: base(value)
|
: base(value)
|
||||||
{
|
{
|
||||||
Text.Text = value.Title;
|
}
|
||||||
Text.Font = Text.Font.With(size: 16);
|
|
||||||
Text.Margin = new MarginPadding { Bottom = 10 + bar_height };
|
[BackgroundDependencyLoader]
|
||||||
Bar.ExpandedSize = 10;
|
private void load()
|
||||||
Bar.Margin = new MarginPadding { Bottom = bar_height };
|
{
|
||||||
|
AutoSizeAxes = Axes.Both;
|
||||||
|
Anchor = Anchor.CentreLeft;
|
||||||
|
Origin = Anchor.CentreLeft;
|
||||||
|
|
||||||
|
InternalChild = text = new OsuSpriteText
|
||||||
|
{
|
||||||
|
Text = Value.Title
|
||||||
|
};
|
||||||
|
|
||||||
|
updateState();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnActivated() => updateState();
|
||||||
|
|
||||||
|
protected override void OnDeactivated() => updateState();
|
||||||
|
|
||||||
|
protected override bool OnHover(HoverEvent e)
|
||||||
|
{
|
||||||
|
updateState();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnHoverLost(HoverLostEvent e) => updateState();
|
||||||
|
|
||||||
|
private void updateState()
|
||||||
|
{
|
||||||
|
text.Font = OsuFont.Default.With(size: 14, weight: Active.Value ? FontWeight.SemiBold : FontWeight.Regular);
|
||||||
|
|
||||||
|
Colour4 textColour;
|
||||||
|
|
||||||
|
if (IsHovered)
|
||||||
|
textColour = colourProvider.Light1;
|
||||||
|
else
|
||||||
|
textColour = Active.Value ? colourProvider.Content1 : colourProvider.Light2;
|
||||||
|
|
||||||
|
text.FadeColour(textColour, 300, Easing.OutQuint);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -231,7 +259,9 @@ namespace osu.Game.Overlays
|
|||||||
Direction = FillDirection.Vertical,
|
Direction = FillDirection.Vertical,
|
||||||
AutoSizeAxes = Axes.Y,
|
AutoSizeAxes = Axes.Y,
|
||||||
RelativeSizeAxes = Axes.X,
|
RelativeSizeAxes = Axes.X,
|
||||||
Spacing = new Vector2(0, 20),
|
Spacing = new Vector2(0, 10),
|
||||||
|
Padding = new MarginPadding { Horizontal = 10 },
|
||||||
|
Margin = new MarginPadding { Bottom = 10 },
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -88,5 +88,13 @@ namespace osu.Game.Overlays.Volume
|
|||||||
{
|
{
|
||||||
Content.TransformTo<Container<Drawable>, ColourInfo>("BorderColour", unhoveredColour, 500, Easing.OutQuint);
|
Content.TransformTo<Container<Drawable>, ColourInfo>("BorderColour", unhoveredColour, 500, Easing.OutQuint);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override bool OnMouseDown(MouseDownEvent e)
|
||||||
|
{
|
||||||
|
base.OnMouseDown(e);
|
||||||
|
|
||||||
|
// Block mouse down to avoid dismissing overlays sitting behind the mute button
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
using osu.Framework.Graphics.UserInterface;
|
using osu.Framework.Graphics.UserInterface;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Logging;
|
using osu.Framework.Logging;
|
||||||
|
using osu.Game.Extensions;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets
|
namespace osu.Game.Rulesets
|
||||||
{
|
{
|
||||||
@ -16,11 +17,16 @@ namespace osu.Game.Rulesets
|
|||||||
|
|
||||||
protected override Dropdown<RulesetInfo> CreateDropdown() => null;
|
protected override Dropdown<RulesetInfo> CreateDropdown() => null;
|
||||||
|
|
||||||
|
protected virtual bool LegacyOnly => false;
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load()
|
private void load()
|
||||||
{
|
{
|
||||||
foreach (var ruleset in Rulesets.AvailableRulesets)
|
foreach (var ruleset in Rulesets.AvailableRulesets)
|
||||||
{
|
{
|
||||||
|
if (!ruleset.IsLegacyRuleset() && LegacyOnly)
|
||||||
|
continue;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
AddItem(ruleset);
|
AddItem(ruleset);
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Audio.Track;
|
using osu.Framework.Audio.Track;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
@ -38,7 +36,7 @@ namespace osu.Game.Screens.Edit.Components.Menus
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override Dropdown<EditorScreenMode> CreateDropdown() => null;
|
protected override Dropdown<EditorScreenMode> CreateDropdown() => null!;
|
||||||
|
|
||||||
protected override TabItem<EditorScreenMode> CreateTabItem(EditorScreenMode value) => new TabItem(value);
|
protected override TabItem<EditorScreenMode> CreateTabItem(EditorScreenMode value) => new TabItem(value);
|
||||||
|
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
using osuTK.Graphics;
|
using osuTK.Graphics;
|
||||||
@ -25,10 +23,10 @@ namespace osu.Game.Screens.Edit.Components
|
|||||||
{
|
{
|
||||||
public partial class PlaybackControl : BottomBarContainer
|
public partial class PlaybackControl : BottomBarContainer
|
||||||
{
|
{
|
||||||
private IconButton playButton;
|
private IconButton playButton = null!;
|
||||||
|
|
||||||
[Resolved]
|
[Resolved]
|
||||||
private EditorClock editorClock { get; set; }
|
private EditorClock editorClock { get; set; } = null!;
|
||||||
|
|
||||||
private readonly BindableNumber<double> freqAdjust = new BindableDouble(1);
|
private readonly BindableNumber<double> freqAdjust = new BindableDouble(1);
|
||||||
|
|
||||||
@ -108,7 +106,7 @@ namespace osu.Game.Screens.Edit.Components
|
|||||||
|
|
||||||
protected override TabItem<double> CreateTabItem(double value) => new PlaybackTabItem(value);
|
protected override TabItem<double> CreateTabItem(double value) => new PlaybackTabItem(value);
|
||||||
|
|
||||||
protected override Dropdown<double> CreateDropdown() => null;
|
protected override Dropdown<double> CreateDropdown() => null!;
|
||||||
|
|
||||||
public PlaybackTabControl()
|
public PlaybackTabControl()
|
||||||
{
|
{
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Extensions.Color4Extensions;
|
using osu.Framework.Extensions.Color4Extensions;
|
||||||
@ -24,7 +22,7 @@ namespace osu.Game.Screens.Edit.Components.RadioButtons
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Invoked when this <see cref="EditorRadioButton"/> has been selected.
|
/// Invoked when this <see cref="EditorRadioButton"/> has been selected.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Action<RadioButton> Selected;
|
public Action<RadioButton>? Selected;
|
||||||
|
|
||||||
public readonly RadioButton Button;
|
public readonly RadioButton Button;
|
||||||
|
|
||||||
@ -33,10 +31,10 @@ namespace osu.Game.Screens.Edit.Components.RadioButtons
|
|||||||
private Color4 selectedBackgroundColour;
|
private Color4 selectedBackgroundColour;
|
||||||
private Color4 selectedIconColour;
|
private Color4 selectedIconColour;
|
||||||
|
|
||||||
private Drawable icon;
|
private Drawable icon = null!;
|
||||||
|
|
||||||
[Resolved(canBeNull: true)]
|
[Resolved]
|
||||||
private EditorBeatmap editorBeatmap { get; set; }
|
private EditorBeatmap? editorBeatmap { get; set; }
|
||||||
|
|
||||||
public EditorRadioButton(RadioButton button)
|
public EditorRadioButton(RadioButton button)
|
||||||
{
|
{
|
||||||
|
@ -1,8 +1,7 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
#nullable disable
|
using System;
|
||||||
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using osu.Framework.Extensions.IEnumerableExtensions;
|
using osu.Framework.Extensions.IEnumerableExtensions;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
@ -13,7 +12,7 @@ namespace osu.Game.Screens.Edit.Components.RadioButtons
|
|||||||
{
|
{
|
||||||
public partial class EditorRadioButtonCollection : CompositeDrawable
|
public partial class EditorRadioButtonCollection : CompositeDrawable
|
||||||
{
|
{
|
||||||
private IReadOnlyList<RadioButton> items;
|
private IReadOnlyList<RadioButton> items = Array.Empty<RadioButton>();
|
||||||
|
|
||||||
public IReadOnlyList<RadioButton> Items
|
public IReadOnlyList<RadioButton> Items
|
||||||
{
|
{
|
||||||
@ -45,7 +44,7 @@ namespace osu.Game.Screens.Edit.Components.RadioButtons
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
private RadioButton currentlySelected;
|
private RadioButton? currentlySelected;
|
||||||
|
|
||||||
private void addButton(RadioButton button)
|
private void addButton(RadioButton button)
|
||||||
{
|
{
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
@ -24,11 +22,11 @@ namespace osu.Game.Screens.Edit.Components.RadioButtons
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A function which creates a drawable icon to represent this item. If null, a sane default should be used.
|
/// A function which creates a drawable icon to represent this item. If null, a sane default should be used.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public readonly Func<Drawable> CreateIcon;
|
public readonly Func<Drawable>? CreateIcon;
|
||||||
|
|
||||||
private readonly Action action;
|
private readonly Action? action;
|
||||||
|
|
||||||
public RadioButton(string label, Action action, Func<Drawable> createIcon = null)
|
public RadioButton(string label, Action? action, Func<Drawable>? createIcon = null)
|
||||||
{
|
{
|
||||||
Label = label;
|
Label = label;
|
||||||
CreateIcon = createIcon;
|
CreateIcon = createIcon;
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Extensions.Color4Extensions;
|
using osu.Framework.Extensions.Color4Extensions;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
@ -23,7 +21,7 @@ namespace osu.Game.Screens.Edit.Components.TernaryButtons
|
|||||||
private Color4 selectedBackgroundColour;
|
private Color4 selectedBackgroundColour;
|
||||||
private Color4 selectedIconColour;
|
private Color4 selectedIconColour;
|
||||||
|
|
||||||
private Drawable icon;
|
private Drawable icon = null!;
|
||||||
|
|
||||||
public readonly TernaryButton Button;
|
public readonly TernaryButton Button;
|
||||||
|
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
@ -19,9 +17,9 @@ namespace osu.Game.Screens.Edit.Components.TernaryButtons
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A function which creates a drawable icon to represent this item. If null, a sane default should be used.
|
/// A function which creates a drawable icon to represent this item. If null, a sane default should be used.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public readonly Func<Drawable> CreateIcon;
|
public readonly Func<Drawable>? CreateIcon;
|
||||||
|
|
||||||
public TernaryButton(Bindable<TernaryState> bindable, string description, Func<Drawable> createIcon = null)
|
public TernaryButton(Bindable<TernaryState> bindable, string description, Func<Drawable>? createIcon = null)
|
||||||
{
|
{
|
||||||
Bindable = bindable;
|
Bindable = bindable;
|
||||||
Description = description;
|
Description = description;
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Game.Graphics.Sprites;
|
using osu.Game.Graphics.Sprites;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
@ -15,14 +13,14 @@ namespace osu.Game.Screens.Edit.Components
|
|||||||
{
|
{
|
||||||
public partial class TimeInfoContainer : BottomBarContainer
|
public partial class TimeInfoContainer : BottomBarContainer
|
||||||
{
|
{
|
||||||
private OsuSpriteText trackTimer;
|
private OsuSpriteText trackTimer = null!;
|
||||||
private OsuSpriteText bpm;
|
private OsuSpriteText bpm = null!;
|
||||||
|
|
||||||
[Resolved]
|
[Resolved]
|
||||||
private EditorBeatmap editorBeatmap { get; set; }
|
private EditorBeatmap editorBeatmap { get; set; } = null!;
|
||||||
|
|
||||||
[Resolved]
|
[Resolved]
|
||||||
private EditorClock editorClock { get; set; }
|
private EditorClock editorClock { get; set; } = null!;
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OsuColour colours, OverlayColourProvider colourProvider)
|
private void load(OsuColour colours, OverlayColourProvider colourProvider)
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Screens.Edit.Components.Timelines.Summary.Visualisations;
|
using osu.Game.Screens.Edit.Components.Timelines.Summary.Visualisations;
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Game.Beatmaps.Timing;
|
using osu.Game.Beatmaps.Timing;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Specialized;
|
using System.Collections.Specialized;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Game.Beatmaps.ControlPoints;
|
using osu.Game.Beatmaps.ControlPoints;
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
using osu.Game.Beatmaps.ControlPoints;
|
using osu.Game.Beatmaps.ControlPoints;
|
||||||
|
|
||||||
namespace osu.Game.Screens.Edit.Components.Timelines.Summary.Parts
|
namespace osu.Game.Screens.Edit.Components.Timelines.Summary.Parts
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
@ -20,10 +18,10 @@ namespace osu.Game.Screens.Edit.Components.Timelines.Summary.Parts
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class MarkerPart : TimelinePart
|
public partial class MarkerPart : TimelinePart
|
||||||
{
|
{
|
||||||
private Drawable marker;
|
private Drawable marker = null!;
|
||||||
|
|
||||||
[Resolved]
|
[Resolved]
|
||||||
private EditorClock editorClock { get; set; }
|
private EditorClock editorClock { get; set; } = null!;
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load()
|
private void load()
|
||||||
@ -44,7 +42,7 @@ namespace osu.Game.Screens.Edit.Components.Timelines.Summary.Parts
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private ScheduledDelegate scheduledSeek;
|
private ScheduledDelegate? scheduledSeek;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Seeks the <see cref="SummaryTimeline"/> to the time closest to a position on the screen relative to the <see cref="SummaryTimeline"/>.
|
/// Seeks the <see cref="SummaryTimeline"/> to the time closest to a position on the screen relative to the <see cref="SummaryTimeline"/>.
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Audio.Track;
|
using osu.Framework.Audio.Track;
|
||||||
@ -26,7 +24,7 @@ namespace osu.Game.Screens.Edit.Components.Timelines.Summary.Parts
|
|||||||
private readonly IBindable<WorkingBeatmap> beatmap = new Bindable<WorkingBeatmap>();
|
private readonly IBindable<WorkingBeatmap> beatmap = new Bindable<WorkingBeatmap>();
|
||||||
|
|
||||||
[Resolved]
|
[Resolved]
|
||||||
protected EditorBeatmap EditorBeatmap { get; private set; }
|
protected EditorBeatmap EditorBeatmap { get; private set; } = null!;
|
||||||
|
|
||||||
protected readonly IBindable<Track> Track = new Bindable<Track>();
|
protected readonly IBindable<Track> Track = new Bindable<Track>();
|
||||||
|
|
||||||
@ -34,7 +32,7 @@ namespace osu.Game.Screens.Edit.Components.Timelines.Summary.Parts
|
|||||||
|
|
||||||
protected override Container<T> Content => content;
|
protected override Container<T> Content => content;
|
||||||
|
|
||||||
public TimelinePart(Container<T> content = null)
|
public TimelinePart(Container<T>? content = null)
|
||||||
{
|
{
|
||||||
AddInternal(this.content = content ?? new Container<T> { RelativeSizeAxes = Axes.Both });
|
AddInternal(this.content = content ?? new Container<T> { RelativeSizeAxes = Axes.Both });
|
||||||
|
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
|
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
|||||||
|
|
||||||
protected new EditorSelectionHandler SelectionHandler => (EditorSelectionHandler)base.SelectionHandler;
|
protected new EditorSelectionHandler SelectionHandler => (EditorSelectionHandler)base.SelectionHandler;
|
||||||
|
|
||||||
private PlacementBlueprint currentPlacement;
|
public PlacementBlueprint CurrentPlacement { get; private set; }
|
||||||
|
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// Positional input must be received outside the container's bounds,
|
/// Positional input must be received outside the container's bounds,
|
||||||
@ -137,13 +137,13 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
|||||||
|
|
||||||
private void updatePlacementNewCombo()
|
private void updatePlacementNewCombo()
|
||||||
{
|
{
|
||||||
if (currentPlacement?.HitObject is IHasComboInformation c)
|
if (CurrentPlacement?.HitObject is IHasComboInformation c)
|
||||||
c.NewCombo = NewCombo.Value == TernaryState.True;
|
c.NewCombo = NewCombo.Value == TernaryState.True;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updatePlacementSamples()
|
private void updatePlacementSamples()
|
||||||
{
|
{
|
||||||
if (currentPlacement == null) return;
|
if (CurrentPlacement == null) return;
|
||||||
|
|
||||||
foreach (var kvp in SelectionHandler.SelectionSampleStates)
|
foreach (var kvp in SelectionHandler.SelectionSampleStates)
|
||||||
sampleChanged(kvp.Key, kvp.Value.Value);
|
sampleChanged(kvp.Key, kvp.Value.Value);
|
||||||
@ -151,9 +151,9 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
|||||||
|
|
||||||
private void sampleChanged(string sampleName, TernaryState state)
|
private void sampleChanged(string sampleName, TernaryState state)
|
||||||
{
|
{
|
||||||
if (currentPlacement == null) return;
|
if (CurrentPlacement == null) return;
|
||||||
|
|
||||||
var samples = currentPlacement.HitObject.Samples;
|
var samples = CurrentPlacement.HitObject.Samples;
|
||||||
|
|
||||||
var existingSample = samples.FirstOrDefault(s => s.Name == sampleName);
|
var existingSample = samples.FirstOrDefault(s => s.Name == sampleName);
|
||||||
|
|
||||||
@ -225,7 +225,7 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
|||||||
// if no time was found from positional snapping, we should still quantize to the beat.
|
// if no time was found from positional snapping, we should still quantize to the beat.
|
||||||
snapResult.Time ??= Beatmap.SnapTime(EditorClock.CurrentTime, null);
|
snapResult.Time ??= Beatmap.SnapTime(EditorClock.CurrentTime, null);
|
||||||
|
|
||||||
currentPlacement.UpdateTimeAndPosition(snapResult);
|
CurrentPlacement.UpdateTimeAndPosition(snapResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
@ -234,9 +234,9 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
|||||||
{
|
{
|
||||||
base.Update();
|
base.Update();
|
||||||
|
|
||||||
if (currentPlacement != null)
|
if (CurrentPlacement != null)
|
||||||
{
|
{
|
||||||
switch (currentPlacement.PlacementActive)
|
switch (CurrentPlacement.PlacementActive)
|
||||||
{
|
{
|
||||||
case PlacementBlueprint.PlacementState.Waiting:
|
case PlacementBlueprint.PlacementState.Waiting:
|
||||||
if (!Composer.CursorInPlacementArea)
|
if (!Composer.CursorInPlacementArea)
|
||||||
@ -252,7 +252,7 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
|||||||
if (Composer.CursorInPlacementArea)
|
if (Composer.CursorInPlacementArea)
|
||||||
ensurePlacementCreated();
|
ensurePlacementCreated();
|
||||||
|
|
||||||
if (currentPlacement != null)
|
if (CurrentPlacement != null)
|
||||||
updatePlacementPosition();
|
updatePlacementPosition();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -281,13 +281,13 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
|||||||
|
|
||||||
private void ensurePlacementCreated()
|
private void ensurePlacementCreated()
|
||||||
{
|
{
|
||||||
if (currentPlacement != null) return;
|
if (CurrentPlacement != null) return;
|
||||||
|
|
||||||
var blueprint = CurrentTool?.CreatePlacementBlueprint();
|
var blueprint = CurrentTool?.CreatePlacementBlueprint();
|
||||||
|
|
||||||
if (blueprint != null)
|
if (blueprint != null)
|
||||||
{
|
{
|
||||||
placementBlueprintContainer.Child = currentPlacement = blueprint;
|
placementBlueprintContainer.Child = CurrentPlacement = blueprint;
|
||||||
|
|
||||||
// Fixes a 1-frame position discrepancy due to the first mouse move event happening in the next frame
|
// Fixes a 1-frame position discrepancy due to the first mouse move event happening in the next frame
|
||||||
updatePlacementPosition();
|
updatePlacementPosition();
|
||||||
@ -300,11 +300,11 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
|||||||
|
|
||||||
private void removePlacement()
|
private void removePlacement()
|
||||||
{
|
{
|
||||||
if (currentPlacement == null) return;
|
if (CurrentPlacement == null) return;
|
||||||
|
|
||||||
currentPlacement.EndPlacement(false);
|
CurrentPlacement.EndPlacement(false);
|
||||||
currentPlacement.Expire();
|
CurrentPlacement.Expire();
|
||||||
currentPlacement = null;
|
CurrentPlacement = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private HitObjectCompositionTool currentTool;
|
private HitObjectCompositionTool currentTool;
|
||||||
|
@ -291,7 +291,7 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
|||||||
[Resolved]
|
[Resolved]
|
||||||
private Timeline timeline { get; set; } = null!;
|
private Timeline timeline { get; set; } = null!;
|
||||||
|
|
||||||
[Resolved(CanBeNull = true)]
|
[Resolved]
|
||||||
private IEditorChangeHandler? changeHandler { get; set; }
|
private IEditorChangeHandler? changeHandler { get; set; }
|
||||||
|
|
||||||
private ScheduledDelegate? dragOperation;
|
private ScheduledDelegate? dragOperation;
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace osu.Game.Screens.Edit.Design
|
namespace osu.Game.Screens.Edit.Design
|
||||||
{
|
{
|
||||||
public partial class DesignScreen : EditorScreen
|
public partial class DesignScreen : EditorScreen
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Localisation;
|
using osu.Framework.Localisation;
|
||||||
@ -15,7 +13,7 @@ namespace osu.Game.Screens.Edit.Setup
|
|||||||
{
|
{
|
||||||
public override LocalisableString Title => EditorSetupStrings.ColoursHeader;
|
public override LocalisableString Title => EditorSetupStrings.ColoursHeader;
|
||||||
|
|
||||||
private LabelledColourPalette comboColours;
|
private LabelledColourPalette comboColours = null!;
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load()
|
private void load()
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
@ -19,16 +17,16 @@ namespace osu.Game.Screens.Edit.Setup
|
|||||||
{
|
{
|
||||||
internal partial class DesignSection : SetupSection
|
internal partial class DesignSection : SetupSection
|
||||||
{
|
{
|
||||||
protected LabelledSwitchButton EnableCountdown;
|
protected LabelledSwitchButton EnableCountdown = null!;
|
||||||
|
|
||||||
protected FillFlowContainer CountdownSettings;
|
protected FillFlowContainer CountdownSettings = null!;
|
||||||
protected LabelledEnumDropdown<CountdownType> CountdownSpeed;
|
protected LabelledEnumDropdown<CountdownType> CountdownSpeed = null!;
|
||||||
protected LabelledNumberBox CountdownOffset;
|
protected LabelledNumberBox CountdownOffset = null!;
|
||||||
|
|
||||||
private LabelledSwitchButton widescreenSupport;
|
private LabelledSwitchButton widescreenSupport = null!;
|
||||||
private LabelledSwitchButton epilepsyWarning;
|
private LabelledSwitchButton epilepsyWarning = null!;
|
||||||
private LabelledSwitchButton letterboxDuringBreaks;
|
private LabelledSwitchButton letterboxDuringBreaks = null!;
|
||||||
private LabelledSwitchButton samplesMatchPlaybackRate;
|
private LabelledSwitchButton samplesMatchPlaybackRate = null!;
|
||||||
|
|
||||||
public override LocalisableString Title => EditorSetupStrings.DesignHeader;
|
public override LocalisableString Title => EditorSetupStrings.DesignHeader;
|
||||||
|
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
@ -17,10 +15,10 @@ namespace osu.Game.Screens.Edit.Setup
|
|||||||
{
|
{
|
||||||
internal partial class DifficultySection : SetupSection
|
internal partial class DifficultySection : SetupSection
|
||||||
{
|
{
|
||||||
private LabelledSliderBar<float> circleSizeSlider;
|
private LabelledSliderBar<float> circleSizeSlider = null!;
|
||||||
private LabelledSliderBar<float> healthDrainSlider;
|
private LabelledSliderBar<float> healthDrainSlider = null!;
|
||||||
private LabelledSliderBar<float> approachRateSlider;
|
private LabelledSliderBar<float> approachRateSlider = null!;
|
||||||
private LabelledSliderBar<float> overallDifficultySlider;
|
private LabelledSliderBar<float> overallDifficultySlider = null!;
|
||||||
|
|
||||||
public override LocalisableString Title => EditorSetupStrings.DifficultyHeader;
|
public override LocalisableString Title => EditorSetupStrings.DifficultyHeader;
|
||||||
|
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Graphics.UserInterface;
|
using osu.Game.Graphics.UserInterface;
|
||||||
using osu.Game.Graphics.UserInterfaceV2;
|
using osu.Game.Graphics.UserInterfaceV2;
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using osu.Framework.Extensions;
|
using osu.Framework.Extensions;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
@ -30,7 +28,7 @@ namespace osu.Game.Screens.Edit.Setup
|
|||||||
|
|
||||||
internal partial class PopoverTextBox : OsuTextBox
|
internal partial class PopoverTextBox : OsuTextBox
|
||||||
{
|
{
|
||||||
public Action OnFocused;
|
public Action? OnFocused;
|
||||||
|
|
||||||
protected override bool OnDragStart(DragStartEvent e)
|
protected override bool OnDragStart(DragStartEvent e)
|
||||||
{
|
{
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics.UserInterface;
|
using osu.Framework.Graphics.UserInterface;
|
||||||
@ -16,16 +14,16 @@ namespace osu.Game.Screens.Edit.Setup
|
|||||||
{
|
{
|
||||||
public partial class MetadataSection : SetupSection
|
public partial class MetadataSection : SetupSection
|
||||||
{
|
{
|
||||||
protected LabelledTextBox ArtistTextBox;
|
protected LabelledTextBox ArtistTextBox = null!;
|
||||||
protected LabelledTextBox RomanisedArtistTextBox;
|
protected LabelledTextBox RomanisedArtistTextBox = null!;
|
||||||
|
|
||||||
protected LabelledTextBox TitleTextBox;
|
protected LabelledTextBox TitleTextBox = null!;
|
||||||
protected LabelledTextBox RomanisedTitleTextBox;
|
protected LabelledTextBox RomanisedTitleTextBox = null!;
|
||||||
|
|
||||||
private LabelledTextBox creatorTextBox;
|
private LabelledTextBox creatorTextBox = null!;
|
||||||
private LabelledTextBox difficultyTextBox;
|
private LabelledTextBox difficultyTextBox = null!;
|
||||||
private LabelledTextBox sourceTextBox;
|
private LabelledTextBox sourceTextBox = null!;
|
||||||
private LabelledTextBox tagsTextBox;
|
private LabelledTextBox tagsTextBox = null!;
|
||||||
|
|
||||||
public override LocalisableString Title => EditorSetupStrings.MetadataHeader;
|
public override LocalisableString Title => EditorSetupStrings.MetadataHeader;
|
||||||
|
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
using osu.Framework.Localisation;
|
using osu.Framework.Localisation;
|
||||||
using osu.Game.Rulesets;
|
using osu.Game.Rulesets;
|
||||||
using osu.Game.Localisation;
|
using osu.Game.Localisation;
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Extensions.LocalisationExtensions;
|
using osu.Framework.Extensions.LocalisationExtensions;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
@ -18,12 +16,12 @@ namespace osu.Game.Screens.Edit.Setup
|
|||||||
{
|
{
|
||||||
internal partial class SetupScreenHeader : OverlayHeader
|
internal partial class SetupScreenHeader : OverlayHeader
|
||||||
{
|
{
|
||||||
public SetupScreenHeaderBackground Background { get; private set; }
|
public SetupScreenHeaderBackground Background { get; private set; } = null!;
|
||||||
|
|
||||||
[Resolved]
|
[Resolved]
|
||||||
private SectionsContainer<SetupSection> sections { get; set; }
|
private SectionsContainer<SetupSection> sections { get; set; } = null!;
|
||||||
|
|
||||||
private SetupScreenTabControl tabControl;
|
private SetupScreenTabControl tabControl = null!;
|
||||||
|
|
||||||
protected override OverlayTitle CreateTitle() => new SetupScreenTitle();
|
protected override OverlayTitle CreateTitle() => new SetupScreenTitle();
|
||||||
|
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
@ -18,10 +16,10 @@ namespace osu.Game.Screens.Edit.Setup
|
|||||||
public partial class SetupScreenHeaderBackground : CompositeDrawable
|
public partial class SetupScreenHeaderBackground : CompositeDrawable
|
||||||
{
|
{
|
||||||
[Resolved]
|
[Resolved]
|
||||||
private OsuColour colours { get; set; }
|
private OsuColour colours { get; set; } = null!;
|
||||||
|
|
||||||
[Resolved]
|
[Resolved]
|
||||||
private IBindable<WorkingBeatmap> working { get; set; }
|
private IBindable<WorkingBeatmap> working { get; set; } = null!;
|
||||||
|
|
||||||
private readonly Container content;
|
private readonly Container content;
|
||||||
|
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
@ -16,7 +14,7 @@ namespace osu.Game.Screens.Edit.Setup
|
|||||||
{
|
{
|
||||||
public abstract partial class SetupSection : Container
|
public abstract partial class SetupSection : Container
|
||||||
{
|
{
|
||||||
private FillFlowContainer flow;
|
private FillFlowContainer flow = null!;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Used to align some of the child <see cref="LabelledDrawable{T}"/>s together to achieve a grid-like look.
|
/// Used to align some of the child <see cref="LabelledDrawable{T}"/>s together to achieve a grid-like look.
|
||||||
@ -24,10 +22,10 @@ namespace osu.Game.Screens.Edit.Setup
|
|||||||
protected const float LABEL_WIDTH = 160;
|
protected const float LABEL_WIDTH = 160;
|
||||||
|
|
||||||
[Resolved]
|
[Resolved]
|
||||||
protected OsuColour Colours { get; private set; }
|
protected OsuColour Colours { get; private set; } = null!;
|
||||||
|
|
||||||
[Resolved]
|
[Resolved]
|
||||||
protected EditorBeatmap Beatmap { get; private set; }
|
protected EditorBeatmap Beatmap { get; private set; } = null!;
|
||||||
|
|
||||||
protected override Container<Drawable> Content => flow;
|
protected override Container<Drawable> Content => flow;
|
||||||
|
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
|
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
@ -15,10 +13,10 @@ namespace osu.Game.Screens.Edit.Timing
|
|||||||
{
|
{
|
||||||
internal partial class EffectSection : Section<EffectControlPoint>
|
internal partial class EffectSection : Section<EffectControlPoint>
|
||||||
{
|
{
|
||||||
private LabelledSwitchButton kiai;
|
private LabelledSwitchButton kiai = null!;
|
||||||
private LabelledSwitchButton omitBarLine;
|
private LabelledSwitchButton omitBarLine = null!;
|
||||||
|
|
||||||
private SliderWithTextBoxInput<double> scrollSpeedSlider;
|
private SliderWithTextBoxInput<double> scrollSpeedSlider = null!;
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load()
|
private void load()
|
||||||
@ -55,7 +53,7 @@ namespace osu.Game.Screens.Edit.Timing
|
|||||||
|
|
||||||
private bool isRebinding;
|
private bool isRebinding;
|
||||||
|
|
||||||
protected override void OnControlPointChanged(ValueChangedEvent<EffectControlPoint> point)
|
protected override void OnControlPointChanged(ValueChangedEvent<EffectControlPoint?> point)
|
||||||
{
|
{
|
||||||
if (point.NewValue != null)
|
if (point.NewValue != null)
|
||||||
{
|
{
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
@ -17,21 +15,21 @@ namespace osu.Game.Screens.Edit.Timing
|
|||||||
{
|
{
|
||||||
internal partial class GroupSection : CompositeDrawable
|
internal partial class GroupSection : CompositeDrawable
|
||||||
{
|
{
|
||||||
private LabelledTextBox textBox;
|
private LabelledTextBox textBox = null!;
|
||||||
|
|
||||||
private OsuButton button;
|
private OsuButton button = null!;
|
||||||
|
|
||||||
[Resolved]
|
[Resolved]
|
||||||
protected Bindable<ControlPointGroup> SelectedGroup { get; private set; }
|
protected Bindable<ControlPointGroup> SelectedGroup { get; private set; } = null!;
|
||||||
|
|
||||||
[Resolved]
|
[Resolved]
|
||||||
protected EditorBeatmap Beatmap { get; private set; }
|
protected EditorBeatmap Beatmap { get; private set; } = null!;
|
||||||
|
|
||||||
[Resolved]
|
[Resolved]
|
||||||
private EditorClock clock { get; set; }
|
private EditorClock clock { get; set; } = null!;
|
||||||
|
|
||||||
[Resolved(canBeNull: true)]
|
[Resolved]
|
||||||
private IEditorChangeHandler changeHandler { get; set; }
|
private IEditorChangeHandler? changeHandler { get; set; }
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load()
|
private void load()
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
@ -35,7 +33,7 @@ namespace osu.Game.Screens.Edit.Timing
|
|||||||
set => current.Current = value;
|
set => current.Current = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
private OsuNumberBox numeratorBox;
|
private OsuNumberBox numeratorBox = null!;
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load()
|
private void load()
|
||||||
|
@ -1,10 +1,7 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using JetBrains.Annotations;
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Audio;
|
using osu.Framework.Audio;
|
||||||
using osu.Framework.Audio.Sample;
|
using osu.Framework.Audio.Sample;
|
||||||
@ -28,24 +25,23 @@ namespace osu.Game.Screens.Edit.Timing
|
|||||||
{
|
{
|
||||||
public partial class MetronomeDisplay : BeatSyncedContainer
|
public partial class MetronomeDisplay : BeatSyncedContainer
|
||||||
{
|
{
|
||||||
private Container swing;
|
private Container swing = null!;
|
||||||
|
|
||||||
private OsuSpriteText bpmText;
|
private OsuSpriteText bpmText = null!;
|
||||||
|
|
||||||
private Drawable weight;
|
private Drawable weight = null!;
|
||||||
private Drawable stick;
|
private Drawable stick = null!;
|
||||||
|
|
||||||
private IAdjustableClock metronomeClock;
|
private IAdjustableClock metronomeClock = null!;
|
||||||
|
|
||||||
private Sample sampleTick;
|
private Sample? sampleTick;
|
||||||
private Sample sampleTickDownbeat;
|
private Sample? sampleTickDownbeat;
|
||||||
private Sample sampleLatch;
|
private Sample? sampleLatch;
|
||||||
|
|
||||||
[CanBeNull]
|
private ScheduledDelegate? tickPlaybackDelegate;
|
||||||
private ScheduledDelegate tickPlaybackDelegate;
|
|
||||||
|
|
||||||
[Resolved]
|
[Resolved]
|
||||||
private OverlayColourProvider overlayColourProvider { get; set; }
|
private OverlayColourProvider overlayColourProvider { get; set; } = null!;
|
||||||
|
|
||||||
public bool EnableClicking { get; set; } = true;
|
public bool EnableClicking { get; set; } = true;
|
||||||
|
|
||||||
@ -225,13 +221,13 @@ namespace osu.Game.Screens.Edit.Timing
|
|||||||
|
|
||||||
private double beatLength;
|
private double beatLength;
|
||||||
|
|
||||||
private TimingControlPoint timingPoint;
|
private TimingControlPoint timingPoint = null!;
|
||||||
|
|
||||||
private bool isSwinging;
|
private bool isSwinging;
|
||||||
|
|
||||||
private readonly BindableInt interpolatedBpm = new BindableInt();
|
private readonly BindableInt interpolatedBpm = new BindableInt();
|
||||||
|
|
||||||
private ScheduledDelegate latchDelegate;
|
private ScheduledDelegate? latchDelegate;
|
||||||
|
|
||||||
protected override void LoadComplete()
|
protected override void LoadComplete()
|
||||||
{
|
{
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Audio;
|
using osu.Framework.Audio;
|
||||||
@ -23,10 +21,10 @@ namespace osu.Game.Screens.Edit.Timing
|
|||||||
|
|
||||||
private readonly Drawable button;
|
private readonly Drawable button;
|
||||||
|
|
||||||
private Sample sample;
|
private Sample? sample;
|
||||||
|
|
||||||
public Action RepeatBegan;
|
public Action? RepeatBegan;
|
||||||
public Action RepeatEnded;
|
public Action? RepeatEnded;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// An additive modifier for the frequency of the sample played on next actuation.
|
/// An additive modifier for the frequency of the sample played on next actuation.
|
||||||
@ -61,7 +59,7 @@ namespace osu.Game.Screens.Edit.Timing
|
|||||||
base.OnMouseUp(e);
|
base.OnMouseUp(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
private ScheduledDelegate adjustDelegate;
|
private ScheduledDelegate? adjustDelegate;
|
||||||
private double adjustDelay = initial_delay;
|
private double adjustDelay = initial_delay;
|
||||||
|
|
||||||
private void beginRepeat()
|
private void beginRepeat()
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
@ -21,9 +19,9 @@ namespace osu.Game.Screens.Edit.Timing
|
|||||||
|
|
||||||
private readonly string label;
|
private readonly string label;
|
||||||
|
|
||||||
protected Drawable Background { get; private set; }
|
protected Drawable Background { get; private set; } = null!;
|
||||||
|
|
||||||
protected FillFlowContainer Content { get; private set; }
|
protected FillFlowContainer Content { get; private set; } = null!;
|
||||||
|
|
||||||
public RowAttribute(ControlPoint point, string label)
|
public RowAttribute(ControlPoint point, string label)
|
||||||
{
|
{
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Game.Beatmaps.ControlPoints;
|
using osu.Game.Beatmaps.ControlPoints;
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Game.Beatmaps.ControlPoints;
|
using osu.Game.Beatmaps.ControlPoints;
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
@ -15,7 +13,7 @@ namespace osu.Game.Screens.Edit.Timing.RowAttributes
|
|||||||
{
|
{
|
||||||
private readonly BindableNumber<double> speedMultiplier;
|
private readonly BindableNumber<double> speedMultiplier;
|
||||||
|
|
||||||
private OsuSpriteText text;
|
private OsuSpriteText text = null!;
|
||||||
|
|
||||||
public DifficultyRowAttribute(DifficultyControlPoint difficulty)
|
public DifficultyRowAttribute(DifficultyControlPoint difficulty)
|
||||||
: base(difficulty, "difficulty")
|
: base(difficulty, "difficulty")
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
@ -16,9 +14,9 @@ namespace osu.Game.Screens.Edit.Timing.RowAttributes
|
|||||||
private readonly Bindable<bool> omitBarLine;
|
private readonly Bindable<bool> omitBarLine;
|
||||||
private readonly BindableNumber<double> scrollSpeed;
|
private readonly BindableNumber<double> scrollSpeed;
|
||||||
|
|
||||||
private AttributeText kiaiModeBubble;
|
private AttributeText kiaiModeBubble = null!;
|
||||||
private AttributeText omitBarLineBubble;
|
private AttributeText omitBarLineBubble = null!;
|
||||||
private AttributeText text;
|
private AttributeText text = null!;
|
||||||
|
|
||||||
public EffectRowAttribute(EffectControlPoint effect)
|
public EffectRowAttribute(EffectControlPoint effect)
|
||||||
: base(effect, "effect")
|
: base(effect, "effect")
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
@ -13,8 +11,8 @@ namespace osu.Game.Screens.Edit.Timing.RowAttributes
|
|||||||
{
|
{
|
||||||
public partial class SampleRowAttribute : RowAttribute
|
public partial class SampleRowAttribute : RowAttribute
|
||||||
{
|
{
|
||||||
private AttributeText sampleText;
|
private AttributeText sampleText = null!;
|
||||||
private OsuSpriteText volumeText;
|
private OsuSpriteText volumeText = null!;
|
||||||
|
|
||||||
private readonly Bindable<string> sampleBank;
|
private readonly Bindable<string> sampleBank;
|
||||||
private readonly BindableNumber<int> volume;
|
private readonly BindableNumber<int> volume;
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Extensions;
|
using osu.Framework.Extensions;
|
||||||
@ -17,7 +15,7 @@ namespace osu.Game.Screens.Edit.Timing.RowAttributes
|
|||||||
{
|
{
|
||||||
private readonly BindableNumber<double> beatLength;
|
private readonly BindableNumber<double> beatLength;
|
||||||
private readonly Bindable<TimeSignature> timeSignature;
|
private readonly Bindable<TimeSignature> timeSignature;
|
||||||
private OsuSpriteText text;
|
private OsuSpriteText text = null!;
|
||||||
|
|
||||||
public TimingRowAttribute(TimingControlPoint timing)
|
public TimingRowAttribute(TimingControlPoint timing)
|
||||||
: base(timing, "timing")
|
: base(timing, "timing")
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
@ -19,23 +17,23 @@ namespace osu.Game.Screens.Edit.Timing
|
|||||||
internal abstract partial class Section<T> : CompositeDrawable
|
internal abstract partial class Section<T> : CompositeDrawable
|
||||||
where T : ControlPoint
|
where T : ControlPoint
|
||||||
{
|
{
|
||||||
private OsuCheckbox checkbox;
|
private OsuCheckbox checkbox = null!;
|
||||||
private Container content;
|
private Container content = null!;
|
||||||
|
|
||||||
protected FillFlowContainer Flow { get; private set; }
|
protected FillFlowContainer Flow { get; private set; } = null!;
|
||||||
|
|
||||||
protected Bindable<T> ControlPoint { get; } = new Bindable<T>();
|
protected Bindable<T?> ControlPoint { get; } = new Bindable<T?>();
|
||||||
|
|
||||||
private const float header_height = 50;
|
private const float header_height = 50;
|
||||||
|
|
||||||
[Resolved]
|
[Resolved]
|
||||||
protected EditorBeatmap Beatmap { get; private set; }
|
protected EditorBeatmap Beatmap { get; private set; } = null!;
|
||||||
|
|
||||||
[Resolved]
|
[Resolved]
|
||||||
protected Bindable<ControlPointGroup> SelectedGroup { get; private set; }
|
protected Bindable<ControlPointGroup> SelectedGroup { get; private set; } = null!;
|
||||||
|
|
||||||
[Resolved(canBeNull: true)]
|
[Resolved]
|
||||||
protected IEditorChangeHandler ChangeHandler { get; private set; }
|
protected IEditorChangeHandler? ChangeHandler { get; private set; }
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OverlayColourProvider colours)
|
private void load(OverlayColourProvider colours)
|
||||||
@ -128,7 +126,7 @@ namespace osu.Game.Screens.Edit.Timing
|
|||||||
ControlPoint.BindValueChanged(OnControlPointChanged, true);
|
ControlPoint.BindValueChanged(OnControlPointChanged, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected abstract void OnControlPointChanged(ValueChangedEvent<T> point);
|
protected abstract void OnControlPointChanged(ValueChangedEvent<T?> point);
|
||||||
|
|
||||||
protected abstract T CreatePoint();
|
protected abstract T CreatePoint();
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
|
@ -37,10 +37,10 @@ namespace osu.Game.Screens.Edit.Timing
|
|||||||
[Resolved]
|
[Resolved]
|
||||||
private OverlayColourProvider colourProvider { get; set; } = null!;
|
private OverlayColourProvider colourProvider { get; set; } = null!;
|
||||||
|
|
||||||
[Resolved(canBeNull: true)]
|
[Resolved]
|
||||||
private Bindable<ControlPointGroup>? selectedGroup { get; set; }
|
private Bindable<ControlPointGroup>? selectedGroup { get; set; }
|
||||||
|
|
||||||
[Resolved(canBeNull: true)]
|
[Resolved]
|
||||||
private IBeatSyncProvider? beatSyncSource { get; set; }
|
private IBeatSyncProvider? beatSyncSource { get; set; }
|
||||||
|
|
||||||
private Circle hoverLayer = null!;
|
private Circle hoverLayer = null!;
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
@ -22,7 +20,7 @@ namespace osu.Game.Screens.Edit.Timing
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class TimingAdjustButton : CompositeDrawable
|
public partial class TimingAdjustButton : CompositeDrawable
|
||||||
{
|
{
|
||||||
public Action<double> Action;
|
public Action<double>? Action;
|
||||||
|
|
||||||
private readonly double adjustAmount;
|
private readonly double adjustAmount;
|
||||||
|
|
||||||
@ -44,10 +42,10 @@ namespace osu.Game.Screens.Edit.Timing
|
|||||||
private readonly RepeatingButtonBehaviour repeatBehaviour;
|
private readonly RepeatingButtonBehaviour repeatBehaviour;
|
||||||
|
|
||||||
[Resolved]
|
[Resolved]
|
||||||
private OverlayColourProvider colourProvider { get; set; }
|
private OverlayColourProvider colourProvider { get; set; } = null!;
|
||||||
|
|
||||||
[Resolved]
|
[Resolved]
|
||||||
private EditorBeatmap editorBeatmap { get; set; }
|
private EditorBeatmap editorBeatmap { get; set; } = null!;
|
||||||
|
|
||||||
public TimingAdjustButton(double adjustAmount)
|
public TimingAdjustButton(double adjustAmount)
|
||||||
{
|
{
|
||||||
@ -104,7 +102,7 @@ namespace osu.Game.Screens.Edit.Timing
|
|||||||
if (hoveredBox == null)
|
if (hoveredBox == null)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
Action(adjustAmount * hoveredBox.Multiplier);
|
Action?.Invoke(adjustAmount * hoveredBox.Multiplier);
|
||||||
|
|
||||||
hoveredBox.Flash();
|
hoveredBox.Flash();
|
||||||
|
|
||||||
@ -119,6 +117,9 @@ namespace osu.Game.Screens.Edit.Timing
|
|||||||
private readonly Box box;
|
private readonly Box box;
|
||||||
private readonly OsuSpriteText text;
|
private readonly OsuSpriteText text;
|
||||||
|
|
||||||
|
[Resolved]
|
||||||
|
private OverlayColourProvider colourProvider { get; set; } = null!;
|
||||||
|
|
||||||
public IncrementBox(int index, double amount)
|
public IncrementBox(int index, double amount)
|
||||||
{
|
{
|
||||||
Multiplier = Math.Sign(index) * convertMultiplier(index);
|
Multiplier = Math.Sign(index) * convertMultiplier(index);
|
||||||
@ -156,9 +157,6 @@ namespace osu.Game.Screens.Edit.Timing
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
[Resolved]
|
|
||||||
private OverlayColourProvider colourProvider { get; set; }
|
|
||||||
|
|
||||||
protected override void LoadComplete()
|
protected override void LoadComplete()
|
||||||
{
|
{
|
||||||
base.LoadComplete();
|
base.LoadComplete();
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user