mirror of
https://github.com/ppy/osu.git
synced 2024-12-13 05:22:54 +08:00
Apply brace style.
This commit is contained in:
parent
3d1c31f2ae
commit
ccc8aa6fa4
@ -40,8 +40,10 @@ namespace osu.Game.Rulesets.Catch.Tests
|
||||
beatmap.HitObjects.Add(new Fruit { StartTime = 1008, X = 56 / 512f, });
|
||||
|
||||
for (int i = 0; i < 512; i++)
|
||||
{
|
||||
if (i % 5 < 3)
|
||||
beatmap.HitObjects.Add(new Fruit { X = i % 10 < 5 ? 0.02f : 0.98f, StartTime = 2000 + i * 100, NewCombo = i % 8 == 0 });
|
||||
}
|
||||
|
||||
return beatmap;
|
||||
}
|
||||
|
@ -196,9 +196,13 @@ namespace osu.Game.Rulesets.Catch.Beatmaps
|
||||
if (currentObject is Fruit)
|
||||
objectWithDroplets.Add(currentObject);
|
||||
if (currentObject is JuiceStream)
|
||||
{
|
||||
foreach (var currentJuiceElement in currentObject.NestedHitObjects)
|
||||
{
|
||||
if (!(currentJuiceElement is TinyDroplet))
|
||||
objectWithDroplets.Add((CatchHitObject)currentJuiceElement);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
objectWithDroplets.Sort((h1, h2) => h1.StartTime.CompareTo(h2.StartTime));
|
||||
|
@ -27,11 +27,13 @@ namespace osu.Game.Rulesets.Catch.Objects
|
||||
return;
|
||||
|
||||
for (double i = StartTime; i <= EndTime; i += spacing)
|
||||
{
|
||||
AddNested(new Banana
|
||||
{
|
||||
Samples = Samples,
|
||||
StartTime = i
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public double EndTime => StartTime + Duration;
|
||||
|
@ -109,8 +109,10 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy
|
||||
{
|
||||
// Generate a new pattern by copying the last hit objects in reverse-column order
|
||||
for (int i = RandomStart; i < TotalColumns; i++)
|
||||
{
|
||||
if (PreviousPattern.ColumnHasObject(i))
|
||||
addToPattern(pattern, RandomStart + TotalColumns - i - 1);
|
||||
}
|
||||
|
||||
return pattern;
|
||||
}
|
||||
@ -132,8 +134,10 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy
|
||||
{
|
||||
// Generate a new pattern by placing on the already filled columns
|
||||
for (int i = RandomStart; i < TotalColumns; i++)
|
||||
{
|
||||
if (PreviousPattern.ColumnHasObject(i))
|
||||
addToPattern(pattern, i);
|
||||
}
|
||||
|
||||
return pattern;
|
||||
}
|
||||
|
@ -24,12 +24,14 @@ namespace osu.Game.Rulesets.Osu.Tests
|
||||
public TestSceneDrawableJudgement()
|
||||
{
|
||||
foreach (HitResult result in Enum.GetValues(typeof(HitResult)).OfType<HitResult>().Skip(1))
|
||||
{
|
||||
AddStep("Show " + result.GetDescription(), () => SetContents(() =>
|
||||
new DrawableOsuJudgement(new JudgementResult(new HitObject(), new Judgement()) { Type = result }, null)
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
}));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -29,8 +29,10 @@ namespace osu.Game.Rulesets.Osu.Tests
|
||||
};
|
||||
|
||||
for (int i = 0; i < 512; i++)
|
||||
{
|
||||
if (i % 32 < 20)
|
||||
beatmap.HitObjects.Add(new HitCircle { Position = new Vector2(256, 192), StartTime = i * 100 });
|
||||
}
|
||||
|
||||
return beatmap;
|
||||
}
|
||||
|
@ -55,8 +55,10 @@ namespace osu.Game.Rulesets.Osu.Mods
|
||||
}
|
||||
|
||||
for (int i = 0; i < amountWiggles; i++)
|
||||
{
|
||||
using (drawable.BeginAbsoluteSequence(osuObject.StartTime - osuObject.TimePreempt + i * wiggle_duration, true))
|
||||
wiggle();
|
||||
}
|
||||
|
||||
// Keep wiggling sliders and spinners for their duration
|
||||
if (!(osuObject is IHasEndTime endTime))
|
||||
@ -65,8 +67,10 @@ namespace osu.Game.Rulesets.Osu.Mods
|
||||
amountWiggles = (int)(endTime.Duration / wiggle_duration);
|
||||
|
||||
for (int i = 0; i < amountWiggles; i++)
|
||||
{
|
||||
using (drawable.BeginAbsoluteSequence(osuObject.StartTime + i * wiggle_duration, true))
|
||||
wiggle();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -133,12 +133,14 @@ namespace osu.Game.Rulesets.Osu.Objects
|
||||
var sampleList = new List<HitSampleInfo>();
|
||||
|
||||
if (firstSample != null)
|
||||
{
|
||||
sampleList.Add(new HitSampleInfo
|
||||
{
|
||||
Bank = firstSample.Bank,
|
||||
Volume = firstSample.Volume,
|
||||
Name = @"slidertick",
|
||||
});
|
||||
}
|
||||
|
||||
switch (e.Type)
|
||||
{
|
||||
|
@ -225,8 +225,10 @@ namespace osu.Game.Tests.NonVisual
|
||||
private void fastForwardToPoint(double destination)
|
||||
{
|
||||
for (int i = 0; i < 1000; i++)
|
||||
{
|
||||
if (handler.SetFrameFromTime(destination) == null)
|
||||
return;
|
||||
}
|
||||
|
||||
throw new TimeoutException("Seek was never fulfilled");
|
||||
}
|
||||
|
@ -26,6 +26,7 @@ namespace osu.Game.Tests.Skins
|
||||
|
||||
List<Color4> expectedColors;
|
||||
if (hasColours)
|
||||
{
|
||||
expectedColors = new List<Color4>
|
||||
{
|
||||
new Color4(142, 199, 255, 255),
|
||||
@ -33,6 +34,7 @@ namespace osu.Game.Tests.Skins
|
||||
new Color4(128, 255, 255, 255),
|
||||
new Color4(100, 100, 100, 100),
|
||||
};
|
||||
}
|
||||
else
|
||||
expectedColors = new DefaultSkin().Configuration.ComboColours;
|
||||
|
||||
|
@ -130,12 +130,14 @@ namespace osu.Game.Tests.Visual.Online
|
||||
AddRepeatStep("add many messages", () =>
|
||||
{
|
||||
for (int i = 0; i < messages_per_call; i++)
|
||||
{
|
||||
testChannel.AddNewMessages(new Message(sequence++)
|
||||
{
|
||||
Sender = longUsernameUser,
|
||||
Content = "Many messages! " + Guid.NewGuid(),
|
||||
Timestamp = DateTimeOffset.Now
|
||||
});
|
||||
}
|
||||
}, Channel.MAX_HISTORY / messages_per_call + 5);
|
||||
|
||||
AddAssert("Ensure no adjacent day separators", () =>
|
||||
@ -143,8 +145,10 @@ namespace osu.Game.Tests.Visual.Online
|
||||
var indices = chatDisplay.FillFlow.OfType<DrawableChannel.DaySeparator>().Select(ds => chatDisplay.FillFlow.IndexOf(ds));
|
||||
|
||||
foreach (var i in indices)
|
||||
{
|
||||
if (i < chatDisplay.FillFlow.Count && chatDisplay.FillFlow[i + 1] is DrawableChannel.DaySeparator)
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
});
|
||||
|
@ -467,8 +467,10 @@ namespace osu.Game.Tests.Visual.SongSelect
|
||||
private void advanceSelection(bool diff, int direction = 1, int count = 1)
|
||||
{
|
||||
if (count == 1)
|
||||
{
|
||||
AddStep($"select {(direction > 0 ? "next" : "prev")} {(diff ? "diff" : "set")}", () =>
|
||||
carousel.SelectNext(direction, !diff));
|
||||
}
|
||||
else
|
||||
{
|
||||
AddRepeatStep($"select {(direction > 0 ? "next" : "prev")} {(diff ? "diff" : "set")}", () =>
|
||||
|
@ -132,11 +132,13 @@ namespace osu.Game.Tests.Visual.SongSelect
|
||||
changeRuleset(1);
|
||||
|
||||
if (rulesetsInSameBeatmap)
|
||||
{
|
||||
AddStep("import multi-ruleset map", () =>
|
||||
{
|
||||
var usableRulesets = rulesets.AvailableRulesets.Where(r => r.ID != 2).ToArray();
|
||||
manager.Import(createTestBeatmapSet(0, usableRulesets)).Wait();
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
addRulesetImportStep(1);
|
||||
|
@ -109,16 +109,20 @@ namespace osu.Game.Tests.Visual
|
||||
AddAssert("check OsuGame DI members", () =>
|
||||
{
|
||||
foreach (var type in requiredGameDependencies)
|
||||
{
|
||||
if (game.Dependencies.Get(type) == null)
|
||||
throw new Exception($"{type} has not been cached");
|
||||
}
|
||||
|
||||
return true;
|
||||
});
|
||||
AddAssert("check OsuGameBase DI members", () =>
|
||||
{
|
||||
foreach (var type in requiredGameBaseDependencies)
|
||||
{
|
||||
if (gameBase.Dependencies.Get(type) == null)
|
||||
throw new Exception($"{type} has not been cached");
|
||||
}
|
||||
|
||||
return true;
|
||||
});
|
||||
|
@ -103,20 +103,20 @@ namespace osu.Game.Tournament.Tests.Components
|
||||
}));
|
||||
|
||||
AddStep("multiple messages", () => testChannel.AddNewMessages(new Message(nextMessageId())
|
||||
{
|
||||
Sender = admin,
|
||||
Content = "I spam you!"
|
||||
},
|
||||
new Message(nextMessageId())
|
||||
{
|
||||
Sender = admin,
|
||||
Content = "I spam you!!!1"
|
||||
},
|
||||
new Message(nextMessageId())
|
||||
{
|
||||
Sender = admin,
|
||||
Content = "I spam you!1!1"
|
||||
}));
|
||||
{
|
||||
Sender = admin,
|
||||
Content = "I spam you!"
|
||||
},
|
||||
new Message(nextMessageId())
|
||||
{
|
||||
Sender = admin,
|
||||
Content = "I spam you!!!1"
|
||||
},
|
||||
new Message(nextMessageId())
|
||||
{
|
||||
Sender = admin,
|
||||
Content = "I spam you!1!1"
|
||||
}));
|
||||
|
||||
AddStep("change channel to 2", () => chatDisplay.Channel.Value = testChannel2);
|
||||
|
||||
|
@ -131,6 +131,7 @@ namespace osu.Game.Tournament.Components
|
||||
});
|
||||
|
||||
if (!string.IsNullOrEmpty(mods))
|
||||
{
|
||||
AddInternal(new Sprite
|
||||
{
|
||||
Texture = textures.Get($"mods/{mods}"),
|
||||
@ -139,6 +140,7 @@ namespace osu.Game.Tournament.Components
|
||||
Margin = new MarginPadding(20),
|
||||
Scale = new Vector2(0.5f)
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private void matchChanged(ValueChangedEvent<TournamentMatch> match)
|
||||
|
@ -29,12 +29,14 @@ namespace osu.Game.Tournament.Components
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
InternalChild = video = new VideoSprite(stream)
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
FillMode = FillMode.Fit,
|
||||
Clock = new FramedClock(manualClock = new ManualClock())
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public bool Loop
|
||||
|
@ -60,6 +60,7 @@ namespace osu.Game.Tournament.IPC
|
||||
const string file_ipc_channel_filename = "ipc-channel.txt";
|
||||
|
||||
if (Storage.Exists(file_ipc_filename))
|
||||
{
|
||||
scheduled = Scheduler.AddDelayed(delegate
|
||||
{
|
||||
try
|
||||
@ -134,6 +135,7 @@ namespace osu.Game.Tournament.IPC
|
||||
// file might be in use.
|
||||
}
|
||||
}, 250, true);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
@ -266,12 +266,14 @@ namespace osu.Game.Tournament.Screens.Editors
|
||||
drawableContainer.Clear();
|
||||
|
||||
if (Model.BeatmapInfo != null)
|
||||
{
|
||||
drawableContainer.Child = new TournamentBeatmapPanel(Model.BeatmapInfo, Model.Mods)
|
||||
{
|
||||
Anchor = Anchor.CentreLeft,
|
||||
Origin = Anchor.CentreLeft,
|
||||
Width = 300
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -81,8 +81,10 @@ namespace osu.Game.Tournament.Screens.Ladder
|
||||
LadderInfo.Matches.ItemsRemoved += matches =>
|
||||
{
|
||||
foreach (var p in matches)
|
||||
foreach (var d in MatchesContainer.Where(d => d.Match == p))
|
||||
d.Expire();
|
||||
{
|
||||
foreach (var d in MatchesContainer.Where(d => d.Match == p))
|
||||
d.Expire();
|
||||
}
|
||||
|
||||
layout.Invalidate();
|
||||
};
|
||||
|
@ -164,6 +164,7 @@ namespace osu.Game.Tournament.Screens.TeamIntro
|
||||
if (team != null)
|
||||
{
|
||||
foreach (var p in team.Players)
|
||||
{
|
||||
players.Add(new OsuSpriteText
|
||||
{
|
||||
Text = p.Username,
|
||||
@ -172,6 +173,7 @@ namespace osu.Game.Tournament.Screens.TeamIntro
|
||||
Anchor = left ? Anchor.CentreRight : Anchor.CentreLeft,
|
||||
Origin = left ? Anchor.CentreRight : Anchor.CentreLeft,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -164,15 +164,17 @@ namespace osu.Game.Tournament
|
||||
|
||||
// link matches to rounds
|
||||
foreach (var round in ladder.Rounds)
|
||||
foreach (var id in round.Matches)
|
||||
{
|
||||
var found = ladder.Matches.FirstOrDefault(p => p.ID == id);
|
||||
|
||||
if (found != null)
|
||||
foreach (var id in round.Matches)
|
||||
{
|
||||
found.Round.Value = round;
|
||||
if (round.StartDate.Value > found.Date.Value)
|
||||
found.Date.Value = round.StartDate.Value;
|
||||
var found = ladder.Matches.FirstOrDefault(p => p.ID == id);
|
||||
|
||||
if (found != null)
|
||||
{
|
||||
found.Round.Value = round;
|
||||
if (round.StartDate.Value > found.Date.Value)
|
||||
found.Date.Value = round.StartDate.Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -192,15 +194,19 @@ namespace osu.Game.Tournament
|
||||
bool addedInfo = false;
|
||||
|
||||
foreach (var t in ladder.Teams)
|
||||
foreach (var p in t.Players)
|
||||
if (string.IsNullOrEmpty(p.Username))
|
||||
{
|
||||
foreach (var p in t.Players)
|
||||
{
|
||||
var req = new GetUserRequest(p.Id);
|
||||
req.Perform(API);
|
||||
p.Username = req.Result.Username;
|
||||
if (string.IsNullOrEmpty(p.Username))
|
||||
{
|
||||
var req = new GetUserRequest(p.Id);
|
||||
req.Perform(API);
|
||||
p.Username = req.Result.Username;
|
||||
|
||||
addedInfo = true;
|
||||
addedInfo = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return addedInfo;
|
||||
}
|
||||
@ -213,15 +219,19 @@ namespace osu.Game.Tournament
|
||||
bool addedInfo = false;
|
||||
|
||||
foreach (var r in ladder.Rounds)
|
||||
foreach (var b in r.Beatmaps)
|
||||
if (b.BeatmapInfo == null && b.ID > 0)
|
||||
{
|
||||
foreach (var b in r.Beatmaps)
|
||||
{
|
||||
var req = new GetBeatmapRequest(new BeatmapInfo { OnlineBeatmapID = b.ID });
|
||||
req.Perform(API);
|
||||
b.BeatmapInfo = req.Result?.ToBeatmap(RulesetStore);
|
||||
if (b.BeatmapInfo == null && b.ID > 0)
|
||||
{
|
||||
var req = new GetBeatmapRequest(new BeatmapInfo { OnlineBeatmapID = b.ID });
|
||||
req.Perform(API);
|
||||
b.BeatmapInfo = req.Result?.ToBeatmap(RulesetStore);
|
||||
|
||||
addedInfo = true;
|
||||
addedInfo = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return addedInfo;
|
||||
}
|
||||
|
@ -144,16 +144,16 @@ namespace osu.Game.Beatmaps.Formats
|
||||
var endTime = split.Length > 3 ? double.Parse(split[3], CultureInfo.InvariantCulture) : double.MaxValue;
|
||||
var groupNumber = split.Length > 4 ? int.Parse(split[4]) : 0;
|
||||
timelineGroup = storyboardSprite?.AddTrigger(triggerName, startTime, endTime, groupNumber);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case "L":
|
||||
{
|
||||
var startTime = double.Parse(split[1], CultureInfo.InvariantCulture);
|
||||
var loopCount = int.Parse(split[2]);
|
||||
timelineGroup = storyboardSprite?.AddLoop(startTime, loopCount);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
{
|
||||
@ -172,7 +172,7 @@ namespace osu.Game.Beatmaps.Formats
|
||||
var endValue = split.Length > 5 ? float.Parse(split[5], CultureInfo.InvariantCulture) : startValue;
|
||||
timelineGroup?.Alpha.Add(easing, startTime, endTime, startValue, endValue);
|
||||
}
|
||||
break;
|
||||
break;
|
||||
|
||||
case "S":
|
||||
{
|
||||
@ -180,7 +180,7 @@ namespace osu.Game.Beatmaps.Formats
|
||||
var endValue = split.Length > 5 ? float.Parse(split[5], CultureInfo.InvariantCulture) : startValue;
|
||||
timelineGroup?.Scale.Add(easing, startTime, endTime, new Vector2(startValue), new Vector2(endValue));
|
||||
}
|
||||
break;
|
||||
break;
|
||||
|
||||
case "V":
|
||||
{
|
||||
@ -190,7 +190,7 @@ namespace osu.Game.Beatmaps.Formats
|
||||
var endY = split.Length > 7 ? float.Parse(split[7], CultureInfo.InvariantCulture) : startY;
|
||||
timelineGroup?.Scale.Add(easing, startTime, endTime, new Vector2(startX, startY), new Vector2(endX, endY));
|
||||
}
|
||||
break;
|
||||
break;
|
||||
|
||||
case "R":
|
||||
{
|
||||
@ -198,7 +198,7 @@ namespace osu.Game.Beatmaps.Formats
|
||||
var endValue = split.Length > 5 ? float.Parse(split[5], CultureInfo.InvariantCulture) : startValue;
|
||||
timelineGroup?.Rotation.Add(easing, startTime, endTime, MathHelper.RadiansToDegrees(startValue), MathHelper.RadiansToDegrees(endValue));
|
||||
}
|
||||
break;
|
||||
break;
|
||||
|
||||
case "M":
|
||||
{
|
||||
@ -209,7 +209,7 @@ namespace osu.Game.Beatmaps.Formats
|
||||
timelineGroup?.X.Add(easing, startTime, endTime, startX, endX);
|
||||
timelineGroup?.Y.Add(easing, startTime, endTime, startY, endY);
|
||||
}
|
||||
break;
|
||||
break;
|
||||
|
||||
case "MX":
|
||||
{
|
||||
@ -217,7 +217,7 @@ namespace osu.Game.Beatmaps.Formats
|
||||
var endValue = split.Length > 5 ? float.Parse(split[5], CultureInfo.InvariantCulture) : startValue;
|
||||
timelineGroup?.X.Add(easing, startTime, endTime, startValue, endValue);
|
||||
}
|
||||
break;
|
||||
break;
|
||||
|
||||
case "MY":
|
||||
{
|
||||
@ -225,7 +225,7 @@ namespace osu.Game.Beatmaps.Formats
|
||||
var endValue = split.Length > 5 ? float.Parse(split[5], CultureInfo.InvariantCulture) : startValue;
|
||||
timelineGroup?.Y.Add(easing, startTime, endTime, startValue, endValue);
|
||||
}
|
||||
break;
|
||||
break;
|
||||
|
||||
case "C":
|
||||
{
|
||||
@ -239,7 +239,7 @@ namespace osu.Game.Beatmaps.Formats
|
||||
new Color4(startRed / 255f, startGreen / 255f, startBlue / 255f, 1),
|
||||
new Color4(endRed / 255f, endGreen / 255f, endBlue / 255f, 1));
|
||||
}
|
||||
break;
|
||||
break;
|
||||
|
||||
case "P":
|
||||
{
|
||||
@ -260,13 +260,13 @@ namespace osu.Game.Beatmaps.Formats
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
break;
|
||||
|
||||
default:
|
||||
throw new InvalidDataException($@"Unknown command type: {commandType}");
|
||||
}
|
||||
}
|
||||
break;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -133,8 +133,10 @@ namespace osu.Game.Beatmaps
|
||||
obj.ApplyDefaults(converted.ControlPointInfo, converted.BeatmapInfo.BaseDifficulty);
|
||||
|
||||
foreach (var mod in mods.OfType<IApplicableToHitObject>())
|
||||
foreach (var obj in converted.HitObjects)
|
||||
mod.ApplyToHitObject(obj);
|
||||
{
|
||||
foreach (var obj in converted.HitObjects)
|
||||
mod.ApplyToHitObject(obj);
|
||||
}
|
||||
|
||||
processor?.PostProcess();
|
||||
|
||||
|
@ -265,8 +265,10 @@ namespace osu.Game.Database
|
||||
// for now, concatenate all .osu files in the set to create a unique hash.
|
||||
MemoryStream hashable = new MemoryStream();
|
||||
foreach (string file in reader.Filenames.Where(f => HashableFileTypes.Any(f.EndsWith)))
|
||||
{
|
||||
using (Stream s = reader.GetStream(file))
|
||||
s.CopyTo(hashable);
|
||||
}
|
||||
|
||||
return hashable.Length > 0 ? hashable.ComputeSHA2Hash() : null;
|
||||
}
|
||||
@ -485,12 +487,16 @@ namespace osu.Game.Database
|
||||
|
||||
// import files to manager
|
||||
foreach (string file in reader.Filenames)
|
||||
{
|
||||
using (Stream s = reader.GetStream(file))
|
||||
{
|
||||
fileInfos.Add(new TFileModel
|
||||
{
|
||||
Filename = FileSafety.PathStandardise(file.Substring(prefix.Length)),
|
||||
FileInfo = files.Add(s)
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return fileInfos;
|
||||
}
|
||||
@ -651,8 +657,10 @@ namespace osu.Game.Database
|
||||
private void handleEvent(Action a)
|
||||
{
|
||||
if (delayingEvents)
|
||||
{
|
||||
lock (queuedEvents)
|
||||
queuedEvents.Add(a);
|
||||
}
|
||||
else
|
||||
a.Invoke();
|
||||
}
|
||||
|
@ -43,9 +43,11 @@ namespace osu.Game.Graphics.Containers
|
||||
|
||||
// if we don't have enough time for the second shake, skip it.
|
||||
if (!maximumLength.HasValue || maximumLength >= ShakeDuration * 4)
|
||||
{
|
||||
sequence = sequence
|
||||
.MoveToX(shake_amount, ShakeDuration, Easing.InOutSine).Then()
|
||||
.MoveToX(-shake_amount, ShakeDuration, Easing.InOutSine).Then();
|
||||
}
|
||||
|
||||
sequence.MoveToX(0, ShakeDuration / 2, Easing.InSine);
|
||||
}
|
||||
|
@ -51,8 +51,10 @@ namespace osu.Game.Graphics.UserInterface
|
||||
});
|
||||
|
||||
if (isEnumType && AddEnumEntriesAutomatically)
|
||||
{
|
||||
foreach (var val in (T[])Enum.GetValues(typeof(T)))
|
||||
AddItem(val);
|
||||
}
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
|
@ -44,8 +44,10 @@ namespace osu.Game.Graphics.UserInterface
|
||||
{
|
||||
string format = new string('0', (int)LeadingZeroes);
|
||||
if (UseCommaSeparator)
|
||||
{
|
||||
for (int i = format.Length - 3; i > 0; i -= 3)
|
||||
format = format.Insert(i, @",");
|
||||
}
|
||||
|
||||
return ((long)count).ToString(format);
|
||||
}
|
||||
|
@ -47,6 +47,7 @@ namespace osu.Game.Input
|
||||
|
||||
foreach (var insertable in group.Skip(count).Take(aimCount - count))
|
||||
// insert any defaults which are missing.
|
||||
{
|
||||
usage.Context.DatabasedKeyBinding.Add(new DatabasedKeyBinding
|
||||
{
|
||||
KeyCombination = insertable.KeyCombination,
|
||||
@ -54,6 +55,7 @@ namespace osu.Game.Input
|
||||
RulesetID = rulesetId,
|
||||
Variant = variant
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -75,8 +75,10 @@ namespace osu.Game.Online.Leaderboards
|
||||
int i = 0;
|
||||
|
||||
foreach (var s in scrollFlow.Children)
|
||||
{
|
||||
using (s.BeginDelayedSequence(i++ * 50, true))
|
||||
s.Show();
|
||||
}
|
||||
|
||||
scrollContainer.ScrollTo(0f, false);
|
||||
}, (showScoresCancellationSource = new CancellationTokenSource()).Token));
|
||||
@ -342,13 +344,17 @@ namespace osu.Game.Online.Leaderboards
|
||||
else
|
||||
{
|
||||
if (bottomY - fadeBottom > 0 && FadeBottom)
|
||||
{
|
||||
c.Colour = ColourInfo.GradientVertical(
|
||||
Color4.White.Opacity(Math.Min(1 - (topY - fadeBottom) / LeaderboardScore.HEIGHT, 1)),
|
||||
Color4.White.Opacity(Math.Min(1 - (bottomY - fadeBottom) / LeaderboardScore.HEIGHT, 1)));
|
||||
}
|
||||
else if (FadeTop)
|
||||
{
|
||||
c.Colour = ColourInfo.GradientVertical(
|
||||
Color4.White.Opacity(Math.Min(1 - (fadeTop - topY) / LeaderboardScore.HEIGHT, 1)),
|
||||
Color4.White.Opacity(Math.Min(1 - (fadeTop - bottomY) / LeaderboardScore.HEIGHT, 1)));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -402,8 +402,10 @@ namespace osu.Game
|
||||
nextBeatmap.Track.Completed += currentTrackCompleted;
|
||||
|
||||
using (var oldBeatmap = beatmap.OldValue)
|
||||
{
|
||||
if (oldBeatmap?.Track != null)
|
||||
oldBeatmap.Track.Completed -= currentTrackCompleted;
|
||||
}
|
||||
|
||||
nextBeatmap?.LoadBeatmapAsync();
|
||||
}
|
||||
|
@ -292,8 +292,10 @@ namespace osu.Game
|
||||
var extension = Path.GetExtension(paths.First())?.ToLowerInvariant();
|
||||
|
||||
foreach (var importer in fileImporters)
|
||||
{
|
||||
if (importer.HandledExtensions.Contains(extension))
|
||||
await importer.Import(paths);
|
||||
}
|
||||
}
|
||||
|
||||
public string[] HandledExtensions => fileImporters.SelectMany(i => i.HandledExtensions).ToArray();
|
||||
|
@ -130,6 +130,7 @@ namespace osu.Game.Overlays.Changelog
|
||||
});
|
||||
|
||||
if (entry.GithubUser.UserId != null)
|
||||
{
|
||||
title.AddUserLink(new User
|
||||
{
|
||||
Username = entry.GithubUser.OsuUsername,
|
||||
@ -139,18 +140,23 @@ namespace osu.Game.Overlays.Changelog
|
||||
t.Font = fontMedium;
|
||||
t.Colour = entryColour;
|
||||
});
|
||||
}
|
||||
else if (entry.GithubUser.GithubUrl != null)
|
||||
{
|
||||
title.AddLink(entry.GithubUser.DisplayName, entry.GithubUser.GithubUrl, t =>
|
||||
{
|
||||
t.Font = fontMedium;
|
||||
t.Colour = entryColour;
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
title.AddText(entry.GithubUser.DisplayName, t =>
|
||||
{
|
||||
t.Font = fontSmall;
|
||||
t.Colour = entryColour;
|
||||
});
|
||||
}
|
||||
|
||||
ChangelogEntries.Add(titleContainer);
|
||||
|
||||
|
@ -68,11 +68,13 @@ namespace osu.Game.Overlays.Changelog
|
||||
}
|
||||
|
||||
if (build != null)
|
||||
{
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new ChangelogBuildWithNavigation(build) { SelectBuild = SelectBuild },
|
||||
new Comments(build)
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public class ChangelogBuildWithNavigation : ChangelogBuild
|
||||
|
@ -162,10 +162,12 @@ namespace osu.Game.Overlays.Comments
|
||||
foreach (var c in response.Comments)
|
||||
{
|
||||
if (c.IsTopLevel)
|
||||
{
|
||||
page.Add(new DrawableComment(c)
|
||||
{
|
||||
ShowDeleted = { BindTarget = ShowDeleted }
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
LoadComponentAsync(page, loaded =>
|
||||
|
@ -149,8 +149,10 @@ namespace osu.Game.Overlays.Direct
|
||||
icons.Add(new GroupedDifficultyIcon(SetInfo.Beatmaps.FindAll(b => b.Ruleset.Equals(ruleset)), ruleset, this is DirectListPanel ? Color4.White : colours.Gray5));
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (var b in SetInfo.Beatmaps.OrderBy(beatmap => beatmap.StarDifficulty))
|
||||
icons.Add(new DifficultyIcon(b));
|
||||
}
|
||||
|
||||
return icons;
|
||||
}
|
||||
|
@ -194,8 +194,10 @@ namespace osu.Game.Overlays.Mods
|
||||
start = Mods.Length - 1;
|
||||
|
||||
for (int i = start; i < Mods.Length && i >= 0; i += direction)
|
||||
{
|
||||
if (SelectAt(i))
|
||||
return;
|
||||
}
|
||||
|
||||
Deselect();
|
||||
}
|
||||
|
@ -112,6 +112,7 @@ namespace osu.Game.Overlays.Mods
|
||||
if (selected == null) continue;
|
||||
|
||||
foreach (var type in modTypes)
|
||||
{
|
||||
if (type.IsInstanceOfType(selected))
|
||||
{
|
||||
if (immediate)
|
||||
@ -119,6 +120,7 @@ namespace osu.Game.Overlays.Mods
|
||||
else
|
||||
Scheduler.AddDelayed(button.Deselect, delay += 50);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -81,8 +81,10 @@ namespace osu.Game.Rulesets.Difficulty.Utils
|
||||
yield return array[i];
|
||||
|
||||
if (Count == capacity)
|
||||
{
|
||||
for (int i = 0; i < marker; ++i)
|
||||
yield return array[i];
|
||||
}
|
||||
}
|
||||
|
||||
IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
|
||||
|
@ -113,8 +113,10 @@ namespace osu.Game.Rulesets.Objects.Drawables
|
||||
if (samples.Length > 0)
|
||||
{
|
||||
if (HitObject.SampleControlPoint == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(HitObject.SampleControlPoint), $"{nameof(HitObject)}s must always have an attached {nameof(HitObject.SampleControlPoint)}."
|
||||
+ $" This is an indication that {nameof(HitObject.ApplyDefaults)} has not been invoked on {this}.");
|
||||
}
|
||||
|
||||
samples = samples.Select(s => HitObject.SampleControlPoint.ApplyTo(s)).ToArray();
|
||||
foreach (var s in samples)
|
||||
|
@ -75,8 +75,10 @@ namespace osu.Game.Rulesets.Objects.Legacy
|
||||
|
||||
int pointCount = 1;
|
||||
foreach (var t in pointSplit)
|
||||
{
|
||||
if (t.Length > 1)
|
||||
pointCount++;
|
||||
}
|
||||
|
||||
var points = new Vector2[pointCount];
|
||||
|
||||
|
@ -185,8 +185,10 @@ namespace osu.Game.Rulesets.Objects
|
||||
ReadOnlySpan<Vector2> cpSpan = ControlPoints.Slice(start, end - start);
|
||||
|
||||
foreach (Vector2 t in calculateSubpath(cpSpan))
|
||||
{
|
||||
if (calculatedPath.Count == 0 || calculatedPath.Last() != t)
|
||||
calculatedPath.Add(t);
|
||||
}
|
||||
|
||||
start = end;
|
||||
}
|
||||
|
@ -69,8 +69,10 @@ namespace osu.Game.Rulesets
|
||||
|
||||
//add any other modes
|
||||
foreach (var r in instances.Where(r => r.LegacyID == null))
|
||||
{
|
||||
if (context.RulesetInfo.FirstOrDefault(ri => ri.InstantiationInfo == r.RulesetInfo.InstantiationInfo) == null)
|
||||
context.RulesetInfo.Add(r.RulesetInfo);
|
||||
}
|
||||
|
||||
context.SaveChanges();
|
||||
|
||||
|
@ -436,8 +436,10 @@ namespace osu.Game.Rulesets.UI
|
||||
return h.HitWindows;
|
||||
|
||||
foreach (var n in h.NestedHitObjects)
|
||||
{
|
||||
if (h.HitWindows.WindowFor(HitResult.Miss) > 0)
|
||||
return n.HitWindows;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
|
@ -130,9 +130,13 @@ namespace osu.Game.Rulesets.UI
|
||||
base.Update();
|
||||
|
||||
if (beatmap != null)
|
||||
{
|
||||
foreach (var mod in mods)
|
||||
{
|
||||
if (mod is IUpdatableByPlayfield updatable)
|
||||
updatable.Update(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -57,11 +57,13 @@ namespace osu.Game.Screens.Multi.Components
|
||||
var beatmap = CurrentItem.Value?.Beatmap;
|
||||
|
||||
if (beatmap == null)
|
||||
{
|
||||
textFlow.AddText("No beatmap selected", s =>
|
||||
{
|
||||
s.Font = s.Font.With(size: TextSize);
|
||||
s.Colour = colours.PinkLight;
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
textFlow.AddLink(new[]
|
||||
|
@ -100,9 +100,11 @@ namespace osu.Game.Screens.Play.HUD
|
||||
if (text.Alpha > 0 || button.Progress.Value > 0 || button.IsHovered)
|
||||
Alpha = 1;
|
||||
else
|
||||
{
|
||||
Alpha = Interpolation.ValueAt(
|
||||
MathHelper.Clamp(Clock.ElapsedFrameTime, 0, 200),
|
||||
Alpha, MathHelper.Clamp(1 - positionalAdjust, 0.04f, 1), 0, 200, Easing.OutQuint);
|
||||
}
|
||||
}
|
||||
|
||||
private class Button : HoldToConfirmContainer, IKeyBindingHandler<GlobalAction>
|
||||
|
@ -181,8 +181,11 @@ namespace osu.Game.Screens.Play
|
||||
this.FadeIn(500, Easing.OutExpo);
|
||||
|
||||
if (!IsHovered && !IsDragged)
|
||||
{
|
||||
using (BeginDelayedSequence(1000))
|
||||
scheduledHide = Schedule(Hide);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case Visibility.Hidden:
|
||||
|
@ -44,10 +44,14 @@ namespace osu.Game.Screens.Select.Carousel
|
||||
criteria.Artist.Matches(Beatmap.Metadata.ArtistUnicode);
|
||||
|
||||
if (match)
|
||||
{
|
||||
foreach (var criteriaTerm in criteria.SearchTerms)
|
||||
{
|
||||
match &=
|
||||
Beatmap.Metadata.SearchableTerms.Any(term => term.IndexOf(criteriaTerm, StringComparison.InvariantCultureIgnoreCase) >= 0) ||
|
||||
Beatmap.Version.IndexOf(criteriaTerm, StringComparison.InvariantCultureIgnoreCase) >= 0;
|
||||
}
|
||||
}
|
||||
|
||||
Filtered.Value = !match;
|
||||
}
|
||||
|
@ -251,11 +251,13 @@ namespace osu.Game.Screens.Select
|
||||
{
|
||||
// if we have no beatmaps but osu-stable is found, let's prompt the user to import.
|
||||
if (!beatmaps.GetAllUsableBeatmapSetsEnumerable().Any() && beatmaps.StableInstallationAvailable)
|
||||
{
|
||||
dialogOverlay.Push(new ImportFromStablePopup(() =>
|
||||
{
|
||||
Task.Run(beatmaps.ImportFromStableAsync).ContinueWith(_ => scores.ImportFromStableAsync(), TaskContinuationOptions.OnlyOnRanToCompletion);
|
||||
Task.Run(skins.ImportFromStableAsync);
|
||||
}));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -333,11 +335,13 @@ namespace osu.Game.Screens.Select
|
||||
|
||||
if (this.IsCurrentScreen() && !Carousel.SelectBeatmap(e.NewValue?.BeatmapInfo, false))
|
||||
// If selecting new beatmap without bypassing filters failed, there's possibly a ruleset mismatch
|
||||
{
|
||||
if (e.NewValue?.BeatmapInfo?.Ruleset != null && !e.NewValue.BeatmapInfo.Ruleset.Equals(decoupledRuleset.Value))
|
||||
{
|
||||
Ruleset.Value = e.NewValue.BeatmapInfo.Ruleset;
|
||||
Carousel.SelectBeatmap(e.NewValue.BeatmapInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// We need to keep track of the last selected beatmap ignoring debounce to play the correct selection sounds.
|
||||
|
@ -36,8 +36,10 @@ namespace osu.Game.Skinning
|
||||
{
|
||||
Stream stream = storage?.GetStream(filename);
|
||||
if (stream != null)
|
||||
{
|
||||
using (LineBufferedReader reader = new LineBufferedReader(stream))
|
||||
Configuration = new LegacySkinDecoder().Decode(reader);
|
||||
}
|
||||
else
|
||||
Configuration = new DefaultSkinConfiguration();
|
||||
|
||||
|
@ -22,17 +22,19 @@ namespace osu.Game.Skinning
|
||||
|
||||
if (animatable)
|
||||
{
|
||||
for (int i = 0;; i++)
|
||||
for (int i = 0; true; i++)
|
||||
{
|
||||
if ((texture = getFrameTexture(i)) == null)
|
||||
break;
|
||||
|
||||
if (animation == null)
|
||||
{
|
||||
animation = new TextureAnimation
|
||||
{
|
||||
DefaultFrameLength = default_frame_time,
|
||||
Repeat = looping
|
||||
};
|
||||
}
|
||||
|
||||
animation.AddFrame(texture);
|
||||
}
|
||||
@ -42,10 +44,12 @@ namespace osu.Game.Skinning
|
||||
return animation;
|
||||
|
||||
if ((texture = source.GetTexture(componentName)) != null)
|
||||
{
|
||||
return new Sprite
|
||||
{
|
||||
Texture = texture
|
||||
};
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
@ -81,9 +81,13 @@ namespace osu.Game.Skinning
|
||||
var ch = skin.GetSample(s);
|
||||
|
||||
if (ch == null && allowFallback)
|
||||
{
|
||||
foreach (var lookup in s.LookupNames)
|
||||
{
|
||||
if ((ch = samples.Get($"Gameplay/{lookup}")) != null)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (ch != null)
|
||||
{
|
||||
@ -91,8 +95,10 @@ namespace osu.Game.Skinning
|
||||
ch.Volume.Value = s.Volume / 100.0;
|
||||
|
||||
if (adjustments != null)
|
||||
{
|
||||
foreach (var adjustment in adjustments)
|
||||
ch.AddAdjustment(adjustment.property, adjustment.bindable);
|
||||
}
|
||||
}
|
||||
|
||||
return ch;
|
||||
@ -104,8 +110,10 @@ namespace osu.Game.Skinning
|
||||
base.Dispose(isDisposing);
|
||||
|
||||
if (channels != null)
|
||||
{
|
||||
foreach (var c in channels)
|
||||
c.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -65,6 +65,7 @@ namespace osu.Game.Storyboards
|
||||
public virtual IEnumerable<CommandTimeline<T>.TypedCommand> GetCommands<T>(CommandTimelineSelector<T> timelineSelector, double offset = 0)
|
||||
{
|
||||
if (offset != 0)
|
||||
{
|
||||
return timelineSelector(this).Commands.Select(command =>
|
||||
new CommandTimeline<T>.TypedCommand
|
||||
{
|
||||
@ -74,6 +75,7 @@ namespace osu.Game.Storyboards
|
||||
StartValue = command.StartValue,
|
||||
EndValue = command.EndValue,
|
||||
});
|
||||
}
|
||||
|
||||
return timelineSelector(this).Commands;
|
||||
}
|
||||
|
@ -106,8 +106,11 @@ namespace osu.Game.Storyboards
|
||||
foreach (var loop in loops)
|
||||
commands = commands.Concat(loop.GetCommands(timelineSelector));
|
||||
if (triggeredGroups != null)
|
||||
{
|
||||
foreach (var pair in triggeredGroups)
|
||||
commands = commands.Concat(pair.Item1.GetCommands(timelineSelector, pair.Item2));
|
||||
}
|
||||
|
||||
return commands;
|
||||
}
|
||||
|
||||
|
@ -72,11 +72,15 @@ namespace osu.Game.Tests.Beatmaps
|
||||
break;
|
||||
|
||||
if (objectCounter >= ourMapping.Objects.Count)
|
||||
{
|
||||
Assert.Fail($"The conversion did not generate a hitobject, but should have, for hitobject at time: {expectedMapping.StartTime}:\n"
|
||||
+ $"Expected: {JsonConvert.SerializeObject(expectedMapping.Objects[objectCounter])}\n");
|
||||
}
|
||||
else if (objectCounter >= expectedMapping.Objects.Count)
|
||||
{
|
||||
Assert.Fail($"The conversion generated a hitobject, but should not have, for hitobject at time: {ourMapping.StartTime}:\n"
|
||||
+ $"Received: {JsonConvert.SerializeObject(ourMapping.Objects[objectCounter])}\n");
|
||||
}
|
||||
else if (!expectedMapping.Objects[objectCounter].Equals(ourMapping.Objects[objectCounter]))
|
||||
{
|
||||
Assert.Fail($"The conversion generated differing hitobjects for object at time: {expectedMapping.StartTime}:\n"
|
||||
|
@ -38,8 +38,10 @@ namespace osu.Game.Tests.Visual
|
||||
|
||||
cells = new Drawable[rows, cols];
|
||||
for (int r = 0; r < rows; r++)
|
||||
for (int c = 0; c < cols; c++)
|
||||
cells[r, c] = new Container { RelativeSizeAxes = Axes.Both };
|
||||
{
|
||||
for (int c = 0; c < cols; c++)
|
||||
cells[r, c] = new Container { RelativeSizeAxes = Axes.Both };
|
||||
}
|
||||
|
||||
testContainer.Content = cells.ToJagged();
|
||||
}
|
||||
|
@ -46,6 +46,7 @@ namespace osu.Game.Users
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
InternalChild = new Sprite
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
@ -54,6 +55,7 @@ namespace osu.Game.Users
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
protected override void LoadComplete()
|
||||
|
Loading…
Reference in New Issue
Block a user