mirror of
https://github.com/osukey/osukey.git
synced 2025-08-05 07:33:55 +09:00
Merge remote-tracking branch 'refs/remotes/ppy/master' into subcomments-alter-new
This commit is contained in:
@ -24,7 +24,7 @@ namespace osu.Game.Tests.Visual.Online
|
||||
typeof(CommentsHeader),
|
||||
typeof(DrawableComment),
|
||||
typeof(HeaderButton),
|
||||
typeof(SortTabControl),
|
||||
typeof(OverlaySortTabControl<>),
|
||||
typeof(ShowChildrenButton),
|
||||
typeof(DeletedCommentsCounter),
|
||||
typeof(VotePill),
|
||||
|
@ -18,7 +18,7 @@ namespace osu.Game.Tests.Visual.Online
|
||||
{
|
||||
typeof(CommentsHeader),
|
||||
typeof(HeaderButton),
|
||||
typeof(SortTabControl),
|
||||
typeof(OverlaySortTabControl<>),
|
||||
};
|
||||
|
||||
[Cached]
|
||||
|
@ -4,6 +4,8 @@
|
||||
using osu.Game.Overlays.BeatmapSet;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Specialized;
|
||||
using System.Linq;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Game.Rulesets.Osu;
|
||||
using osu.Game.Rulesets.Mania;
|
||||
@ -15,6 +17,7 @@ using osu.Framework.Extensions.IEnumerableExtensions;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using osu.Game.Rulesets;
|
||||
using osu.Game.Rulesets.Mods;
|
||||
|
||||
namespace osu.Game.Tests.Visual.Online
|
||||
{
|
||||
@ -44,27 +47,31 @@ namespace osu.Game.Tests.Visual.Online
|
||||
Ruleset = { BindTarget = ruleset }
|
||||
});
|
||||
|
||||
modSelector.SelectedMods.ItemsAdded += mods =>
|
||||
modSelector.SelectedMods.CollectionChanged += (_, args) =>
|
||||
{
|
||||
mods.ForEach(mod => selectedMods.Add(new OsuSpriteText
|
||||
switch (args.Action)
|
||||
{
|
||||
Text = mod.Acronym,
|
||||
}));
|
||||
};
|
||||
|
||||
modSelector.SelectedMods.ItemsRemoved += mods =>
|
||||
{
|
||||
mods.ForEach(mod =>
|
||||
{
|
||||
foreach (var selected in selectedMods)
|
||||
{
|
||||
if (selected.Text == mod.Acronym)
|
||||
case NotifyCollectionChangedAction.Add:
|
||||
args.NewItems.Cast<Mod>().ForEach(mod => selectedMods.Add(new OsuSpriteText
|
||||
{
|
||||
selectedMods.Remove(selected);
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
Text = mod.Acronym,
|
||||
}));
|
||||
break;
|
||||
|
||||
case NotifyCollectionChangedAction.Remove:
|
||||
args.OldItems.Cast<Mod>().ForEach(mod =>
|
||||
{
|
||||
foreach (var selected in selectedMods)
|
||||
{
|
||||
if (selected.Text == mod.Acronym)
|
||||
{
|
||||
selectedMods.Remove(selected);
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
AddStep("osu ruleset", () => ruleset.Value = new OsuRuleset().RulesetInfo);
|
||||
|
@ -4,8 +4,10 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using NUnit.Framework;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Game.Overlays;
|
||||
using osu.Game.Overlays.Profile.Sections;
|
||||
|
||||
namespace osu.Game.Tests.Visual.Online
|
||||
@ -17,6 +19,9 @@ namespace osu.Game.Tests.Visual.Online
|
||||
typeof(CounterPill)
|
||||
};
|
||||
|
||||
[Cached]
|
||||
private readonly OverlayColourProvider colourProvider = new OverlayColourProvider(OverlayColourScheme.Red);
|
||||
|
||||
private readonly CounterPill pill;
|
||||
private readonly BindableInt value = new BindableInt();
|
||||
|
||||
|
@ -128,17 +128,17 @@ namespace osu.Game.Tests.Visual.Online
|
||||
|
||||
const int messages_per_call = 10;
|
||||
AddRepeatStep("add many messages", () =>
|
||||
{
|
||||
for (int i = 0; i < messages_per_call; i++)
|
||||
{
|
||||
for (int i = 0; i < messages_per_call; i++)
|
||||
testChannel.AddNewMessages(new Message(sequence++)
|
||||
{
|
||||
testChannel.AddNewMessages(new Message(sequence++)
|
||||
{
|
||||
Sender = longUsernameUser,
|
||||
Content = "Many messages! " + Guid.NewGuid(),
|
||||
Timestamp = DateTimeOffset.Now
|
||||
});
|
||||
}
|
||||
}, Channel.MAX_HISTORY / messages_per_call + 5);
|
||||
Sender = longUsernameUser,
|
||||
Content = "Many messages! " + Guid.NewGuid(),
|
||||
Timestamp = DateTimeOffset.Now
|
||||
});
|
||||
}
|
||||
}, Channel.MAX_HISTORY / messages_per_call + 5);
|
||||
|
||||
AddAssert("Ensure no adjacent day separators", () =>
|
||||
{
|
||||
|
@ -28,7 +28,30 @@ namespace osu.Game.Tests.Visual.Online
|
||||
|
||||
public TestSceneUserProfileScores()
|
||||
{
|
||||
var score = new ScoreInfo
|
||||
var firstScore = new ScoreInfo
|
||||
{
|
||||
PP = 1047.21,
|
||||
Rank = ScoreRank.SH,
|
||||
Beatmap = new BeatmapInfo
|
||||
{
|
||||
Metadata = new BeatmapMetadata
|
||||
{
|
||||
Title = "JUSTadICE (TV Size)",
|
||||
Artist = "Oomori Seiko"
|
||||
},
|
||||
Version = "Extreme"
|
||||
},
|
||||
Date = DateTimeOffset.Now,
|
||||
Mods = new Mod[]
|
||||
{
|
||||
new OsuModHidden(),
|
||||
new OsuModHardRock(),
|
||||
new OsuModDoubleTime()
|
||||
},
|
||||
Accuracy = 0.9813
|
||||
};
|
||||
|
||||
var secondScore = new ScoreInfo
|
||||
{
|
||||
PP = 134.32,
|
||||
Rank = ScoreRank.A,
|
||||
@ -50,6 +73,23 @@ namespace osu.Game.Tests.Visual.Online
|
||||
Accuracy = 0.998546
|
||||
};
|
||||
|
||||
var thirdScore = new ScoreInfo
|
||||
{
|
||||
PP = 96.83,
|
||||
Rank = ScoreRank.S,
|
||||
Beatmap = new BeatmapInfo
|
||||
{
|
||||
Metadata = new BeatmapMetadata
|
||||
{
|
||||
Title = "Idolize",
|
||||
Artist = "Creo"
|
||||
},
|
||||
Version = "Insane"
|
||||
},
|
||||
Date = DateTimeOffset.Now,
|
||||
Accuracy = 0.9726
|
||||
};
|
||||
|
||||
var noPPScore = new ScoreInfo
|
||||
{
|
||||
Rank = ScoreRank.B,
|
||||
@ -76,9 +116,12 @@ namespace osu.Game.Tests.Visual.Online
|
||||
Spacing = new Vector2(0, 10),
|
||||
Children = new[]
|
||||
{
|
||||
new ColourProvidedContainer(OverlayColourScheme.Green, new DrawableProfileScore(score)),
|
||||
new ColourProvidedContainer(OverlayColourScheme.Green, new DrawableProfileScore(firstScore)),
|
||||
new ColourProvidedContainer(OverlayColourScheme.Green, new DrawableProfileScore(secondScore)),
|
||||
new ColourProvidedContainer(OverlayColourScheme.Pink, new DrawableProfileScore(noPPScore)),
|
||||
new ColourProvidedContainer(OverlayColourScheme.Pink, new DrawableProfileWeightedScore(score, 0.85))
|
||||
new ColourProvidedContainer(OverlayColourScheme.Pink, new DrawableProfileWeightedScore(firstScore, 0.97)),
|
||||
new ColourProvidedContainer(OverlayColourScheme.Pink, new DrawableProfileWeightedScore(secondScore, 0.85)),
|
||||
new ColourProvidedContainer(OverlayColourScheme.Pink, new DrawableProfileWeightedScore(thirdScore, 0.66)),
|
||||
}
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user