1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-28 07:23:14 +08:00

Merge remote-tracking branch 'upstream/master' into archive-reader

This commit is contained in:
Alex Amadori 2017-03-09 17:07:00 +01:00
commit 7374839923
70 changed files with 346 additions and 418 deletions

@ -1 +1 @@
Subproject commit fc9441b420878dd817ffc8ae41ac76abc328330c
Subproject commit 1c80609e7aa686f4abdc82bcd6a8f03439463ce7

View File

@ -5,7 +5,7 @@ using Newtonsoft.Json;
namespace osu.Desktop.Deploy
{
internal class GitHubObject
public class GitHubObject
{
[JsonProperty(@"id")]
public int Id;

View File

@ -5,7 +5,7 @@ using Newtonsoft.Json;
namespace osu.Desktop.Deploy
{
internal class GitHubRelease
public class GitHubRelease
{
[JsonProperty(@"id")]
public int Id;

View File

@ -19,14 +19,13 @@ namespace osu.Desktop.VisualTests.Tests
{
internal class TestCaseHitObjects : TestCase
{
private StopwatchClock rateAdjustClock;
private FramedClock framedClock;
private bool auto;
public TestCaseHitObjects()
{
rateAdjustClock = new StopwatchClock(true);
var rateAdjustClock = new StopwatchClock(true);
framedClock = new FramedClock(rateAdjustClock);
playbackSpeed.ValueChanged += delegate { rateAdjustClock.Rate = playbackSpeed.Value; };
}

View File

@ -2,6 +2,7 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System.Collections.Generic;
using System.Linq;
using osu.Framework.Allocation;
using osu.Framework.Screens.Testing;
using osu.Game.Beatmaps;
@ -38,7 +39,7 @@ namespace osu.Desktop.VisualTests.Tests
WorkingBeatmap beatmap = null;
var beatmapInfo = db.Query<BeatmapInfo>().Where(b => b.Mode == PlayMode.Osu).FirstOrDefault();
var beatmapInfo = db.Query<BeatmapInfo>().FirstOrDefault(b => b.Mode == PlayMode.Osu);
if (beatmapInfo != null)
beatmap = db.GetWorkingBeatmap(beatmapInfo);

View File

@ -3,33 +3,23 @@
using System;
using System.IO;
using osu.Framework.Allocation;
using osu.Framework.Input.Handlers;
using osu.Framework.Platform;
using osu.Game.Beatmaps;
using osu.Game.Database;
using osu.Game.Modes;
using osu.Game.Screens.Play;
namespace osu.Desktop.VisualTests.Tests
{
class TestCaseReplay : TestCasePlayer
internal class TestCaseReplay : TestCasePlayer
{
private WorkingBeatmap beatmap;
private InputHandler replay;
private Func<Stream> getReplayStream;
private ScoreDatabase scoreDatabase;
public override string Description => @"Testing replay playback.";
[BackgroundDependencyLoader]
private void load(Storage storage)
{
scoreDatabase = new ScoreDatabase(storage);
}
protected override Player CreatePlayer(WorkingBeatmap beatmap)
{
var player = base.CreatePlayer(beatmap);

View File

@ -67,7 +67,7 @@ namespace osu.Desktop
});
}
static readonly string[] allowed_extensions = { @".osz", @".osr" };
private static readonly string[] allowed_extensions = { @".osz", @".osr" };
private void dragEnter(DragEventArgs e)
{
@ -76,10 +76,7 @@ namespace osu.Desktop
if (isFile)
{
var paths = ((object[])e.Data.GetData(DataFormats.FileDrop)).Select(f => f.ToString()).ToArray();
if (allowed_extensions.Any(ext => paths.All(p => p.EndsWith(ext))))
e.Effect = DragDropEffects.Copy;
else
e.Effect = DragDropEffects.None;
e.Effect = allowed_extensions.Any(ext => paths.All(p => p.EndsWith(ext))) ? DragDropEffects.Copy : DragDropEffects.None;
}
}
}

View File

@ -189,7 +189,7 @@ namespace osu.Desktop.Overlays
private class UpdateProgressNotification : ProgressNotification
{
protected override Notification CreateCompletionNotification() => new ProgressCompletionNotification(this)
protected override Notification CreateCompletionNotification() => new ProgressCompletionNotification()
{
Text = @"Update ready to install. Click to restart!",
Activated = () =>

View File

@ -60,6 +60,8 @@ namespace osu.Game.Modes.Catch
return new Mod[]
{
new CatchModRelax(),
null,
null,
new MultiMod
{
Mods = new Mod[]

View File

@ -52,7 +52,14 @@ namespace osu.Game.Modes.Mania
new ManiaModNightcore(),
},
},
new ManiaModHidden(),
new MultiMod
{
Mods = new Mod[]
{
new ManiaModFadeIn(),
new ManiaModHidden(),
}
},
new ManiaModFlashlight(),
};
@ -74,8 +81,8 @@ namespace osu.Game.Modes.Mania
new ManiaModKey3(),
},
},
new ManiaModKeyCoop(),
new ManiaModRandom(),
new ManiaModKeyCoop(),
new MultiMod
{
Mods = new Mod[]

View File

@ -31,7 +31,7 @@ namespace osu.Game.Modes.Mania.UI
PopOutCount.Anchor = Anchor.BottomCentre;
PopOutCount.Origin = Anchor.Centre;
PopOutCount.FadeColour(PopOutColor, 0);
PopOutCount.FadeColour(PopOutColor);
OriginalColour = DisplayedCountSpriteText.Colour;
}

View File

@ -79,12 +79,9 @@ namespace osu.Game.Modes.Osu.Objects
// We select the amount of points for the approximation by requiring the discrete curvature
// to be smaller than the provided tolerance. The exact angle required to meet the tolerance
// is: 2 * Math.Acos(1 - TOLERANCE / r)
if (2 * r <= tolerance)
// This special case is required for extremely short sliders where the radius is smaller than
// the tolerance. This is a pathological rather than a realistic case.
amountPoints = 2;
else
amountPoints = Math.Max(2, (int)Math.Ceiling(thetaRange / (2 * Math.Acos(1 - tolerance / r))));
// The special case is required for extremely short sliders where the radius is smaller than
// the tolerance. This is a pathological rather than a realistic case.
amountPoints = 2 * r <= tolerance ? 2 : Math.Max(2, (int)Math.Ceiling(thetaRange / (2 * Math.Acos(1 - tolerance / r))));
List<Vector2> output = new List<Vector2>(amountPoints);

View File

@ -1,12 +1,11 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using OpenTK;
using osu.Game.Modes.Osu.Objects.Drawables.Connections;
using System;
using System.Collections.Generic;
using OpenTK;
namespace osu.Game.Modes.Osu.Objects.Drawables
namespace osu.Game.Modes.Osu.Objects.Drawables.Connections
{
public class FollowPointRenderer : ConnectionRenderer<OsuHitObject>
{

View File

@ -24,10 +24,11 @@ namespace osu.Game.Modes.Osu.Objects.Drawables
private SliderBody body;
private SliderBall ball;
private SliderBouncer bouncer1, bouncer2;
private SliderBouncer bouncer2;
public DrawableSlider(Slider s) : base(s)
{
SliderBouncer bouncer1;
slider = s;
Children = new Drawable[]
@ -124,8 +125,8 @@ namespace osu.Game.Modes.Osu.Objects.Drawables
protected override void CheckJudgement(bool userTriggered)
{
var j = Judgement as OsuJudgementInfo;
var sc = initialCircle.Judgement as OsuJudgementInfo;
var j = (OsuJudgementInfo)Judgement;
var sc = (OsuJudgementInfo)initialCircle.Judgement;
if (!userTriggered && Time.Current >= HitObject.EndTime)
{

View File

@ -59,7 +59,7 @@ namespace osu.Game.Modes.Osu.Objects
break;
if (Vector2.Distance(stackBaseObject.Position, objectN.Position) < stackDistance ||
(stackBaseObject is Slider && Vector2.Distance(stackBaseObject.EndPosition, objectN.Position) < stackDistance))
stackBaseObject is Slider && Vector2.Distance(stackBaseObject.EndPosition, objectN.Position) < stackDistance)
{
stackBaseIndex = n;

View File

@ -34,11 +34,11 @@ namespace osu.Game.Modes.Osu.Objects
List<Vector2> points = new List<Vector2> { new Vector2(int.Parse(split[0]), int.Parse(split[1])) };
string[] pointsplit = split[5].Split('|');
for (int i = 0; i < pointsplit.Length; i++)
foreach (string t in pointsplit)
{
if (pointsplit[i].Length == 1)
if (t.Length == 1)
{
switch (pointsplit[i])
switch (t)
{
case @"C":
curveType = CurveTypes.Catmull;
@ -56,7 +56,7 @@ namespace osu.Game.Modes.Osu.Objects
continue;
}
string[] temp = pointsplit[i].Split(':');
string[] temp = t.Split(':');
Vector2 v = new Vector2(
(int)Convert.ToDouble(temp[0], CultureInfo.InvariantCulture),
(int)Convert.ToDouble(temp[1], CultureInfo.InvariantCulture)

View File

@ -15,9 +15,9 @@ namespace osu.Game.Modes.Osu
{
public class OsuAutoReplay : LegacyReplay
{
static readonly Vector2 spinner_centre = new Vector2(256, 192);
private static readonly Vector2 spinner_centre = new Vector2(256, 192);
const float spin_radius = 50;
private const float spin_radius = 50;
private Beatmap beatmap;
@ -65,12 +65,13 @@ namespace osu.Game.Modes.Osu
private double applyModsToTime(double v) => v;
private double applyModsToRate(double v) => v;
public bool DelayedMovements; // ModManager.CheckActive(Mods.Relax2);
private void createAutoReplay()
{
int buttonIndex = 0;
bool delayedMovements = false;// ModManager.CheckActive(Mods.Relax2);
EasingTypes preferredEasing = delayedMovements ? EasingTypes.InOutCubic : EasingTypes.Out;
EasingTypes preferredEasing = DelayedMovements ? EasingTypes.InOutCubic : EasingTypes.Out;
addFrameToReplay(new LegacyReplayFrame(-100000, 256, 500, LegacyButtonState.None));
addFrameToReplay(new LegacyReplayFrame(beatmap.HitObjects[0].StartTime - 1500, 256, 500, LegacyButtonState.None));
@ -85,7 +86,7 @@ namespace osu.Game.Modes.Osu
for (int i = 0; i < beatmap.HitObjects.Count; i++)
{
OsuHitObject h = beatmap.HitObjects[i] as OsuHitObject;
OsuHitObject h = (OsuHitObject)beatmap.HitObjects[i];
//if (h.EndTime < InputManager.ReplayStartTime)
//{
@ -95,9 +96,9 @@ namespace osu.Game.Modes.Osu
int endDelay = h is Spinner ? 1 : 0;
if (delayedMovements && i > 0)
if (DelayedMovements && i > 0)
{
OsuHitObject last = beatmap.HitObjects[i - 1] as OsuHitObject;
OsuHitObject last = (OsuHitObject)beatmap.HitObjects[i - 1];
//Make the cursor stay at a hitObject as long as possible (mainly for autopilot).
if (h.StartTime - h.HitWindowFor(OsuScoreResult.Miss) > last.EndTime + h.HitWindowFor(OsuScoreResult.Hit50) + 50)

View File

@ -72,7 +72,7 @@ namespace osu.Game.Modes.Osu
public override string Description => @"Spinners will be automatically completed";
public override double ScoreMultiplier => 0.9;
public override bool Ranked => true;
public override Type[] IncompatibleMods => new[] { typeof(ModAutoplay), typeof(ModCinema), typeof(OsuModAutopilot) };
public override Type[] IncompatibleMods => new[] { typeof(ModAutoplay), typeof(OsuModAutopilot) };
}
public class OsuModAutopilot : Mod
@ -82,7 +82,7 @@ namespace osu.Game.Modes.Osu
public override string Description => @"Automatic cursor movement - just follow the rhythm.";
public override double ScoreMultiplier => 0;
public override bool Ranked => false;
public override Type[] IncompatibleMods => new[] { typeof(OsuModSpunOut), typeof(ModRelax), typeof(ModSuddenDeath), typeof(ModPerfect), typeof(ModNoFail), typeof(ModAutoplay), typeof(ModCinema) };
public override Type[] IncompatibleMods => new[] { typeof(OsuModSpunOut), typeof(ModRelax), typeof(ModSuddenDeath), typeof(ModNoFail), typeof(ModAutoplay) };
}
public class OsuModAutoplay : ModAutoplay

View File

@ -78,7 +78,6 @@ namespace osu.Game.Modes.Osu
{
new OsuModRelax(),
new OsuModAutopilot(),
new OsuModTarget(),
new OsuModSpunOut(),
new MultiMod
{
@ -88,6 +87,7 @@ namespace osu.Game.Modes.Osu
new ModCinema(),
},
},
new OsuModTarget(),
};
default:

View File

@ -60,6 +60,8 @@ namespace osu.Game.Modes.Taiko
return new Mod[]
{
new TaikoModRelax(),
null,
null,
new MultiMod
{
Mods = new Mod[]

View File

@ -38,10 +38,6 @@
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="nunit.framework">
<HintPath>$(SolutionDir)\packages\NUnit.3.5.0\lib\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="SQLite.Net">
<HintPath>$(SolutionDir)\packages\SQLite.Net.Core-PCL.3.1.1\lib\portable-win8+net45+wp8+wpa81+MonoAndroid1+MonoTouch1\SQLite.Net.dll</HintPath>
</Reference>

View File

@ -3,6 +3,7 @@
using System;
using System.IO;
using System.Linq;
using osu.Framework.Platform;
using osu.Game.IO.Legacy;
using osu.Game.IPC;
@ -18,6 +19,7 @@ namespace osu.Game.Database
private const string replay_folder = @"replays";
// ReSharper disable once NotAccessedField.Local (we should keep a reference to this so it is not finalised)
private ScoreIPCChannel ipc;
public ScoreDatabase(Storage storage, IIpcHost importHost = null, BeatmapDatabase beatmaps = null)
@ -45,7 +47,7 @@ namespace osu.Game.Database
var version = sr.ReadInt32();
/* score.FileChecksum = */
var beatmapHash = sr.ReadString();
score.Beatmap = beatmaps.Query<BeatmapInfo>().Where(b => b.Hash == beatmapHash).FirstOrDefault();
score.Beatmap = beatmaps.Query<BeatmapInfo>().FirstOrDefault(b => b.Hash == beatmapHash);
/* score.PlayerName = */
sr.ReadString();
/* var localScoreChecksum = */
@ -86,14 +88,14 @@ namespace osu.Game.Database
{
byte[] properties = new byte[5];
if (replayInStream.Read(properties, 0, 5) != 5)
throw (new Exception("input .lzma is too short"));
throw new Exception("input .lzma is too short");
long outSize = 0;
for (int i = 0; i < 8; i++)
{
int v = replayInStream.ReadByte();
if (v < 0)
throw (new Exception("Can't Read 1"));
outSize |= ((long)(byte)v) << (8 * i);
throw new Exception("Can't Read 1");
outSize |= (long)(byte)v << (8 * i);
}
long compressedSize = replayInStream.Length - replayInStream.Position;

View File

@ -3,6 +3,7 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.Serialization;
@ -17,7 +18,7 @@ namespace osu.Game.IO.Legacy
/// handle null strings and simplify use with ISerializable. </summary>
public class SerializationReader : BinaryReader
{
Stream stream;
private Stream stream;
public SerializationReader(Stream s)
: base(s, Encoding.UTF8)
@ -173,15 +174,20 @@ namespace osu.Game.IO.Legacy
private static void initialize()
{
versionBinder = new VersionConfigToNamespaceAssemblyObjectBinder();
formatter = new BinaryFormatter();
formatter.AssemblyFormat = FormatterAssemblyStyle.Simple;
formatter.Binder = versionBinder;
formatter = new BinaryFormatter
{
AssemblyFormat = FormatterAssemblyStyle.Simple,
Binder = versionBinder
};
}
public static object Deserialize(Stream stream)
{
if (formatter == null)
initialize();
Debug.Assert(formatter != null, "formatter != null");
return formatter.Deserialize(stream);
}
@ -201,46 +207,39 @@ namespace osu.Game.IO.Legacy
List<Type> tmpTypes = new List<Type>();
Type genType = null;
try
if (typeName.Contains("System.Collections.Generic") && typeName.Contains("[["))
{
if (typeName.Contains("System.Collections.Generic") && typeName.Contains("[["))
{
string[] splitTyps = typeName.Split('[');
string[] splitTyps = typeName.Split('[');
foreach (string typ in splitTyps)
foreach (string typ in splitTyps)
{
if (typ.Contains("Version"))
{
if (typ.Contains("Version"))
{
string asmTmp = typ.Substring(typ.IndexOf(',') + 1);
string asmName = asmTmp.Remove(asmTmp.IndexOf(']')).Trim();
string typName = typ.Remove(typ.IndexOf(','));
tmpTypes.Add(BindToType(asmName, typName));
}
else if (typ.Contains("Generic"))
{
genType = BindToType(assemblyName, typ);
}
string asmTmp = typ.Substring(typ.IndexOf(',') + 1);
string asmName = asmTmp.Remove(asmTmp.IndexOf(']')).Trim();
string typName = typ.Remove(typ.IndexOf(','));
tmpTypes.Add(BindToType(asmName, typName));
}
if (genType != null && tmpTypes.Count > 0)
else if (typ.Contains("Generic"))
{
return genType.MakeGenericType(tmpTypes.ToArray());
genType = BindToType(assemblyName, typ);
}
}
string toAssemblyName = assemblyName.Split(',')[0];
Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies();
foreach (Assembly a in assemblies)
if (genType != null && tmpTypes.Count > 0)
{
if (a.FullName.Split(',')[0] == toAssemblyName)
{
typeToDeserialize = a.GetType(typeName);
break;
}
return genType.MakeGenericType(tmpTypes.ToArray());
}
}
catch (Exception exception)
string toAssemblyName = assemblyName.Split(',')[0];
Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies();
foreach (Assembly a in assemblies)
{
throw exception;
if (a.FullName.Split(',')[0] == toAssemblyName)
{
typeToDeserialize = a.GetType(typeName);
break;
}
}
cache.Add(assemblyName + typeName, typeToDeserialize);

View File

@ -8,6 +8,8 @@ using System.Runtime.Serialization;
using System.Runtime.Serialization.Formatters;
using System.Runtime.Serialization.Formatters.Binary;
using System.Text;
// ReSharper disable ConditionIsAlwaysTrueOrFalse (we're allowing nulls to be passed to the writer where the underlying class doesn't).
// ReSharper disable HeuristicUnreachableCode
namespace osu.Game.IO.Legacy
{
@ -73,13 +75,16 @@ namespace osu.Game.IO.Legacy
}
}
/// <summary> Writes a DateTime to the buffer. <summary>
/// <summary>
/// Writes DateTime to the buffer.
/// </summary>
/// <param name="dt"></param>
public void Write(DateTime dt)
{
Write(dt.ToUniversalTime().Ticks);
}
/// <summary> Writes a generic ICollection (such as an IList<T>) to the buffer. </summary>
/// <summary> Writes a generic ICollection (such as an IList(T)) to the buffer.</summary>
public void Write<T>(List<T> c) where T : ILegacySerializable
{
if (c == null)
@ -212,9 +217,11 @@ namespace osu.Game.IO.Legacy
default:
Write((byte)ObjType.otherType);
BinaryFormatter b = new BinaryFormatter();
b.AssemblyFormat = FormatterAssemblyStyle.Simple;
b.TypeFormat = FormatterTypeStyle.TypesWhenNeeded;
BinaryFormatter b = new BinaryFormatter
{
AssemblyFormat = FormatterAssemblyStyle.Simple,
TypeFormat = FormatterTypeStyle.TypesWhenNeeded
};
b.Serialize(BaseStream, obj);
break;
} // switch

View File

@ -16,10 +16,13 @@ namespace osu.Game.IPC
: base(host)
{
this.beatmaps = beatmaps;
MessageReceived += (msg) =>
MessageReceived += msg =>
{
Debug.Assert(beatmaps != null);
ImportAsync(msg.Path);
ImportAsync(msg.Path).ContinueWith(t =>
{
if (t.Exception != null) throw t.Exception;
}, TaskContinuationOptions.OnlyOnFaulted);
};
}

View File

@ -16,10 +16,13 @@ namespace osu.Game.IPC
: base(host)
{
this.scores = scores;
MessageReceived += (msg) =>
MessageReceived += msg =>
{
Debug.Assert(scores != null);
ImportAsync(msg.Path);
ImportAsync(msg.Path).ContinueWith(t =>
{
if (t.Exception != null) throw t.Exception;
}, TaskContinuationOptions.OnlyOnFaulted);
};
}

View File

@ -58,7 +58,7 @@ namespace osu.Game.Modes
public LegacyReplayFrame CurrentFrame => !hasFrames ? null : replayContent[currentFrameIndex];
public LegacyReplayFrame NextFrame => !hasFrames ? null : replayContent[nextFrameIndex];
int currentFrameIndex;
private int currentFrameIndex;
private int nextFrameIndex => MathHelper.Clamp(currentFrameIndex + (currentDirection > 0 ? 1 : -1), 0, replayContent.Count - 1);
@ -125,8 +125,8 @@ namespace osu.Game.Modes
private const double sixty_frame_time = 1000.0 / 60;
double currentTime;
int currentDirection;
private double currentTime;
private int currentDirection;
/// <summary>
/// When set, we will ensure frames executed by nested drawables are frame-accurate to replay data.
@ -136,7 +136,7 @@ namespace osu.Game.Modes
private bool hasFrames => replayContent.Count > 0;
bool inImportantSection =>
private bool inImportantSection =>
FrameAccuratePlayback &&
//a button is in a pressed state
(currentDirection > 0 ? CurrentFrame : NextFrame)?.ButtonState > LegacyButtonState.None &&
@ -253,7 +253,7 @@ namespace osu.Game.Modes
public void ReadFromStream(SerializationReader sr)
{
throw new System.NotImplementedException();
throw new NotImplementedException();
}
public void WriteToStream(SerializationWriter sw)

View File

@ -65,7 +65,7 @@ namespace osu.Game.Modes
public override string Description => "You can't fail, no matter what.";
public override double ScoreMultiplier => 0.5;
public override bool Ranked => true;
public override Type[] IncompatibleMods => new[] { typeof(ModRelax), typeof(ModSuddenDeath), typeof(ModPerfect) };
public override Type[] IncompatibleMods => new[] { typeof(ModRelax), typeof(ModSuddenDeath), typeof(ModAutoplay) };
}
public abstract class ModEasy : Mod
@ -100,7 +100,7 @@ namespace osu.Game.Modes
public override string Description => "Miss a note and fail.";
public override double ScoreMultiplier => 1;
public override bool Ranked => true;
public override Type[] IncompatibleMods => new[] { typeof(ModNoFail), typeof(ModRelax), typeof(ModAutoplay), typeof(ModCinema) };
public override Type[] IncompatibleMods => new[] { typeof(ModNoFail), typeof(ModRelax), typeof(ModAutoplay) };
}
public abstract class ModDoubleTime : Mod
@ -117,7 +117,7 @@ namespace osu.Game.Modes
public override string Name => "Relax";
public override FontAwesome Icon => FontAwesome.fa_osu_mod_relax;
public override double ScoreMultiplier => 0;
public override Type[] IncompatibleMods => new[] { typeof(ModAutoplay), typeof(ModCinema), typeof(ModNoFail), typeof(ModSuddenDeath), typeof(ModPerfect) };
public override Type[] IncompatibleMods => new[] { typeof(ModAutoplay), typeof(ModNoFail), typeof(ModSuddenDeath) };
}
public abstract class ModHalfTime : Mod
@ -126,7 +126,7 @@ namespace osu.Game.Modes
public override FontAwesome Icon => FontAwesome.fa_osu_mod_halftime;
public override string Description => "Less zoom";
public override bool Ranked => true;
public override Type[] IncompatibleMods => new[] { typeof(ModDoubleTime), typeof(ModNightcore) };
public override Type[] IncompatibleMods => new[] { typeof(ModDoubleTime) };
}
public abstract class ModNightcore : ModDoubleTime
@ -150,7 +150,7 @@ namespace osu.Game.Modes
public override FontAwesome Icon => FontAwesome.fa_osu_mod_auto;
public override string Description => "Watch a perfect automated play through the song";
public override double ScoreMultiplier => 0;
public override Type[] IncompatibleMods => new[] { typeof(ModRelax), typeof(ModSuddenDeath), typeof(ModPerfect) };
public override Type[] IncompatibleMods => new[] { typeof(ModRelax), typeof(ModSuddenDeath), typeof(ModNoFail) };
public override void PlayerLoading(Player player)
{

View File

@ -74,7 +74,7 @@ namespace osu.Game.Modes.Objects.Drawables
public HitObjectType HitObject;
public DrawableHitObject(HitObjectType hitObject)
protected DrawableHitObject(HitObjectType hitObject)
{
HitObject = hitObject;
}
@ -129,10 +129,13 @@ namespace osu.Game.Modes.Objects.Drawables
[BackgroundDependencyLoader]
private void load(AudioManager audio)
{
string hitType = ((HitObject.Sample?.Type ?? SampleType.None) == SampleType.None ? SampleType.Normal : HitObject.Sample.Type).ToString().ToLower();
string sampleSet = (HitObject.Sample?.Set ?? SampleSet.Normal).ToString().ToLower();
SampleType type = HitObject.Sample?.Type ?? SampleType.None;
if (type == SampleType.None)
type = SampleType.Normal;
Sample = audio.Sample.Get($@"Gameplay/{sampleSet}-hit{hitType}");
SampleSet sampleSet = HitObject.Sample?.Set ?? SampleSet.Normal;
Sample = audio.Sample.Get($@"Gameplay/{sampleSet.ToString().ToLower()}-hit{type.ToString().ToLower()}");
}
private List<DrawableHitObject<HitObjectType>> nestedHitObjects;

View File

@ -134,19 +134,11 @@ namespace osu.Game.Modes.UI
updateCount(Count);
}
/// <summary>
/// Animates roll-back to 0.
/// </summary>
public void Roll()
{
Roll(0);
}
/// <summary>
/// Animates roll-up/roll-back to an specific value.
/// </summary>
/// <param name="newValue">Target value.</param>
public virtual void Roll(ulong newValue)
public virtual void Roll(ulong newValue = 0)
{
updateCount(newValue, true);
}

View File

@ -25,31 +25,27 @@ namespace osu.Game.Modes.UI
reapplySize();
}
}
private Color4 backgroundColour;
public new Color4 Colour
{
get
{
return backgroundColour;
return background.Colour;
}
set
{
backgroundColour = value;
background.Colour = value;
}
}
private FontAwesome icon;
public FontAwesome Icon
{
get
{
return icon;
return modIcon.Icon;
}
set
{
icon = value;
modIcon.Icon = value;
}
}

View File

@ -20,7 +20,9 @@ namespace osu.Game.Modes.UI
public override bool Contains(Vector2 screenSpacePos) => true;
protected override Container<Drawable> Content { get; }
protected override Container<Drawable> Content => content;
private Container<Drawable> content;
/// <summary>
/// A container for keeping track of DrawableHitObjects.
@ -34,7 +36,7 @@ namespace osu.Game.Modes.UI
RelativeSizeAxes = Axes.Both,
Children = new[]
{
Content = new Container
content = new Container
{
RelativeSizeAxes = Axes.Both,
}

View File

@ -41,7 +41,7 @@ namespace osu.Game.Online.API
set { authentication.Token = string.IsNullOrEmpty(value) ? null : OAuthToken.Parse(value); }
}
protected bool HasLogin => Token != null || (!string.IsNullOrEmpty(Username) && !string.IsNullOrEmpty(Password));
protected bool HasLogin => Token != null || !string.IsNullOrEmpty(Username) && !string.IsNullOrEmpty(Password);
// ReSharper disable once PrivateFieldCanBeConvertedToLocalVariable (should dispose of this or at very least keep a reference).
private Thread thread;

View File

@ -89,5 +89,5 @@ namespace osu.Game.Online.API
public delegate void APIFailureHandler(Exception e);
public delegate void APISuccessHandler();
public delegate void APISuccessHandler<T>(T content);
public delegate void APISuccessHandler<in T>(T content);
}

View File

@ -50,6 +50,7 @@ namespace osu.Game
{
get
{
// ReSharper disable once RedundantAssignment
bool isDebug = false;
// Debug.Assert conditions are only evaluated in debug mode
Debug.Assert(isDebug = true);

View File

@ -4,17 +4,19 @@
using OpenTK.Input;
using osu.Framework.Allocation;
using osu.Game.Graphics;
using osu.Game.Modes;
namespace osu.Game.Overlays.Mods
{
public class AssistedSection : ModSection
{
protected override Key[] ToggleKeys => new[] { Key.Z, Key.X, Key.C, Key.V, Key.B, Key.N, Key.M };
public override ModType ModType => ModType.Special;
[BackgroundDependencyLoader]
private void load(OsuColour colours)
{
Colour = colours.Blue;
ButtonColour = colours.Blue;
SelectedColour = colours.BlueLight;
}

View File

@ -4,17 +4,19 @@
using OpenTK.Input;
using osu.Framework.Allocation;
using osu.Game.Graphics;
using osu.Game.Modes;
namespace osu.Game.Overlays.Mods
{
public class DifficultyIncreaseSection : ModSection
{
protected override Key[] ToggleKeys => new[] { Key.A, Key.S, Key.D, Key.F, Key.G, Key.H, Key.J, Key.K, Key.L };
public override ModType ModType => ModType.DifficultyIncrease;
[BackgroundDependencyLoader]
private void load(OsuColour colours)
{
Colour = colours.Yellow;
ButtonColour = colours.Yellow;
SelectedColour = colours.YellowLight;
}

View File

@ -4,17 +4,19 @@
using OpenTK.Input;
using osu.Framework.Allocation;
using osu.Game.Graphics;
using osu.Game.Modes;
namespace osu.Game.Overlays.Mods
{
public class DifficultyReductionSection : ModSection
{
protected override Key[] ToggleKeys => new[] { Key.Q, Key.W, Key.E, Key.R, Key.T, Key.Y, Key.U, Key.I, Key.O, Key.P };
public override ModType ModType => ModType.DifficultyReduction;
[BackgroundDependencyLoader]
private void load(OsuColour colours)
{
Colour = colours.Green;
ButtonColour = colours.Green;
SelectedColour = colours.GreenLight;
}

View File

@ -22,61 +22,57 @@ namespace osu.Game.Overlays.Mods
{
public class ModButton : FillFlowContainer
{
private ModIcon[] icons;
private ModIcon displayIcon => icons[icons.Length - 1];
private ModIcon foregroundIcon { get; set; }
private SpriteText text;
private Container iconsContainer;
private Container<ModIcon> iconsContainer;
private SampleChannel sampleOn, sampleOff;
public Action<Mod> Action; // Passed the selected mod or null if none
private int _selectedMod = -1;
private int selectedMod
private int _selectedIndex = -1;
private int selectedIndex
{
get
{
return _selectedMod;
return _selectedIndex;
}
set
{
if (value == _selectedMod) return;
_selectedMod = value;
if (value == _selectedIndex) return;
_selectedIndex = value;
if (value >= Mods.Length)
{
_selectedMod = -1;
_selectedIndex = -1;
}
else if (value <= -2)
{
_selectedMod = Mods.Length - 1;
_selectedIndex = Mods.Length - 1;
}
iconsContainer.RotateTo(Selected ? 5f : 0f, 300, EasingTypes.OutElastic);
iconsContainer.ScaleTo(Selected ? 1.1f : 1f, 300, EasingTypes.OutElastic);
for (int i = 0; i < icons.Length; i++)
{
if (Selected && i == icons.Length - 1) icons[i].Colour = SelectedColour;
else icons[i].Colour = Colour;
}
foregroundIcon.Colour = Selected ? SelectedColour : ButtonColour;
displaySelectedMod();
if (mod != null)
displayMod(SelectedMod ?? Mods[0]);
}
}
public bool Selected => selectedMod != -1;
public bool Selected => selectedIndex != -1;
private Color4 backgroundColour;
public new Color4 Colour
private Color4 buttonColour;
public Color4 ButtonColour
{
get
{
return backgroundColour;
return buttonColour;
}
set
{
if (value == backgroundColour) return;
backgroundColour = value;
foreach (ModIcon icon in icons)
if (value == buttonColour) return;
buttonColour = value;
foreach (ModIcon icon in iconsContainer.Children)
{
icon.Colour = value;
}
@ -94,7 +90,7 @@ namespace osu.Game.Overlays.Mods
{
if (value == selectedColour) return;
selectedColour = value;
if (Selected) icons[0].Colour = value;
if (Selected) foregroundIcon.Colour = value;
}
}
@ -107,10 +103,18 @@ namespace osu.Game.Overlays.Mods
}
set
{
if (mod == value) return;
mod = value;
Mods = (mod as MultiMod)?.Mods ?? new[] { mod };
if (mod == null)
{
Mods = new Mod[0];
Alpha = 0;
}
else
{
Mods = (mod as MultiMod)?.Mods ?? new[] { mod };
Alpha = 1;
}
createIcons();
if (Mods.Length > 0)
@ -124,7 +128,7 @@ namespace osu.Game.Overlays.Mods
// the mods from Mod, only multiple if Mod is a MultiMod
public Mod SelectedMod => Mods.ElementAtOrDefault(selectedMod);
public Mod SelectedMod => Mods.ElementAtOrDefault(selectedIndex);
[BackgroundDependencyLoader]
private void load(AudioManager audio)
@ -135,67 +139,47 @@ namespace osu.Game.Overlays.Mods
protected override bool OnMouseDown(InputState state, MouseDownEventArgs args)
{
(args.Button == MouseButton.Right ? (Action)SelectPrevious : SelectNext)();
switch (args.Button)
{
case MouseButton.Left:
SelectNext();
break;
case MouseButton.Right:
SelectPrevious();
break;
}
return true;
}
public void SelectNext()
{
selectedMod++;
if (selectedMod == -1)
{
sampleOff.Play();
}
else
{
sampleOn.Play();
}
(++selectedIndex == -1 ? sampleOff : sampleOn).Play();
Action?.Invoke(SelectedMod);
}
public void SelectPrevious()
{
selectedMod--;
if (selectedMod == -1)
{
sampleOff.Play();
}
else
{
sampleOn.Play();
}
(--selectedIndex == -1 ? sampleOff : sampleOn).Play();
Action?.Invoke(SelectedMod);
}
public void Deselect()
{
selectedMod = -1;
selectedIndex = -1;
}
private void displayMod(Mod mod)
{
displayIcon.Icon = mod.Icon;
foregroundIcon.Icon = mod.Icon;
text.Text = mod.Name;
}
private void displaySelectedMod()
{
var modIndex = selectedMod;
if (modIndex <= -1)
{
modIndex = 0;
}
displayMod(Mods[modIndex]);
}
private void createIcons()
{
iconsContainer.Clear();
if (Mods.Length > 1)
{
iconsContainer.Add(icons = new[]
iconsContainer.Add(new[]
{
new ModIcon
{
@ -203,35 +187,43 @@ namespace osu.Game.Overlays.Mods
Anchor = Anchor.Centre,
AutoSizeAxes = Axes.Both,
Position = new Vector2(1.5f),
Colour = ButtonColour
},
new ModIcon
foregroundIcon = new ModIcon
{
Origin = Anchor.Centre,
Anchor = Anchor.Centre,
AutoSizeAxes = Axes.Both,
AutoSizeAxes = Axes.Both,
Position = new Vector2(-1.5f),
Colour = ButtonColour
},
});
}
else
{
iconsContainer.Add(icons = new[]
iconsContainer.Add(foregroundIcon = new ModIcon
{
new ModIcon
{
Origin = Anchor.Centre,
Anchor = Anchor.Centre,
AutoSizeAxes = Axes.Both,
},
Origin = Anchor.Centre,
Anchor = Anchor.Centre,
AutoSizeAxes = Axes.Both,
Colour = ButtonColour
});
}
}
protected override void LoadComplete()
{
base.LoadComplete();
foreach (ModIcon icon in iconsContainer.Children)
icon.Colour = ButtonColour;
}
public ModButton(Mod m)
{
Direction = FillDirection.Vertical;
Spacing = new Vector2(0f, -5f);
Size = new Vector2(100f);
AlwaysPresent = true;
Children = new Drawable[]
{
@ -242,7 +234,7 @@ namespace osu.Game.Overlays.Mods
Anchor = Anchor.TopCentre,
Children = new Drawable[]
{
iconsContainer = new Container
iconsContainer = new Container<ModIcon>
{
RelativeSizeAxes = Axes.Both,
Origin = Anchor.Centre,

View File

@ -2,7 +2,6 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
using System.Collections.Generic;
using OpenTK;
using OpenTK.Graphics;
using OpenTK.Input;
@ -15,53 +14,29 @@ using osu.Game.Modes;
namespace osu.Game.Overlays.Mods
{
internal class AlwaysPresentFlowContainer : FillFlowContainer
{
public override bool IsPresent => true;
}
public class ModSection : Container
public abstract class ModSection : Container
{
private OsuSpriteText headerLabel;
private AlwaysPresentFlowContainer buttonsContainer;
public FillFlowContainer ButtonsContainer => buttonsContainer;
public FillFlowContainer<ModButton> ButtonsContainer { get; }
public Action<Mod> Action;
protected virtual Key[] ToggleKeys => new Key[] { };
protected abstract Key[] ToggleKeys { get; }
public abstract ModType ModType { get; }
public Mod[] SelectedMods
{
get
{
List<Mod> selectedMods = new List<Mod>();
foreach (ModButton button in Buttons)
{
Mod selectedMod = button.SelectedMod;
if (selectedMod != null)
selectedMods.Add(selectedMod);
}
return selectedMods.ToArray();
}
}
private string header;
public string Header
{
get
{
return header;
return headerLabel.Text;
}
set
{
header = value;
headerLabel.Text = value;
}
}
private ModButton[] buttons = {};
private ModButton[] buttons = { };
public ModButton[] Buttons
{
get
@ -75,30 +50,30 @@ namespace osu.Game.Overlays.Mods
foreach (ModButton button in value)
{
button.Colour = Colour;
button.ButtonColour = ButtonColour;
button.SelectedColour = selectedColour;
button.Action = buttonPressed;
button.Action = Action;
}
buttonsContainer.Add(value);
ButtonsContainer.Children = value;
}
}
private Color4 colour = Color4.White;
public new Color4 Colour
private Color4 buttonsBolour = Color4.White;
public Color4 ButtonColour
{
get
{
return colour;
return buttonsBolour;
}
set
{
if (value == colour) return;
colour = value;
if (value == buttonsBolour) return;
buttonsBolour = value;
foreach (ModButton button in buttons)
{
button.Colour = value;
button.ButtonColour = value;
}
}
}
@ -139,12 +114,7 @@ namespace osu.Game.Overlays.Mods
}
}
private void buttonPressed(Mod mod)
{
Action?.Invoke(mod);
}
public ModSection()
protected ModSection()
{
AutoSizeAxes = Axes.Y;
@ -155,10 +125,9 @@ namespace osu.Game.Overlays.Mods
Origin = Anchor.TopLeft,
Anchor = Anchor.TopLeft,
Position = new Vector2(0f, 0f),
Font = @"Exo2.0-Bold",
Text = Header,
Font = @"Exo2.0-Bold"
},
buttonsContainer = new AlwaysPresentFlowContainer
ButtonsContainer = new FillFlowContainer<ModButton>
{
AutoSizeAxes = Axes.Both,
Origin = Anchor.BottomLeft,
@ -168,6 +137,7 @@ namespace osu.Game.Overlays.Mods
{
Top = 6,
},
AlwaysPresent = true
},
};
}

View File

@ -2,8 +2,8 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
using System.Linq;
using System.Collections.Generic;
using System.Linq;
using OpenTK;
using OpenTK.Graphics;
using osu.Framework.Configuration;
@ -41,37 +41,12 @@ namespace osu.Game.Overlays.Mods
private void modeChanged(object sender, EventArgs eventArgs)
{
var ruleset = Ruleset.GetRuleset(PlayMode);
modSectionsContainer.Children = new ModSection[]
{
new DifficultyReductionSection
{
RelativeSizeAxes = Axes.X,
Origin = Anchor.TopCentre,
Anchor = Anchor.TopCentre,
Action = modButtonPressed,
Buttons = ruleset.GetModsFor(ModType.DifficultyReduction).Select(m => new ModButton(m)).ToArray(),
},
new DifficultyIncreaseSection
{
RelativeSizeAxes = Axes.X,
Origin = Anchor.TopCentre,
Anchor = Anchor.TopCentre,
Action = modButtonPressed,
Buttons = ruleset.GetModsFor(ModType.DifficultyIncrease).Select(m => new ModButton(m)).ToArray(),
},
new AssistedSection
{
RelativeSizeAxes = Axes.X,
Origin = Anchor.TopCentre,
Anchor = Anchor.TopCentre,
Action = modButtonPressed,
Buttons = ruleset.GetModsFor(ModType.Special).Select(m => new ModButton(m)).ToArray(),
},
};
foreach (ModSection section in modSectionsContainer.Children)
section.Buttons = ruleset.GetModsFor(section.ModType).Select(m => new ModButton(m)).ToArray();
refreshSelectedMods();
}
[BackgroundDependencyLoader(permitNulls:true)]
[BackgroundDependencyLoader(permitNulls: true)]
private void load(OsuColour colours, OsuGame osu)
{
lowMultiplierColour = colours.Red;
@ -80,7 +55,7 @@ namespace osu.Game.Overlays.Mods
if (osu != null)
PlayMode.BindTo(osu.PlayMode);
PlayMode.ValueChanged += modeChanged;
PlayMode.TriggerChange();
modeChanged(null, null);
}
protected override void PopOut()
@ -116,41 +91,33 @@ namespace osu.Game.Overlays.Mods
public void DeselectAll()
{
foreach (ModSection section in modSectionsContainer.Children)
{
foreach (ModButton button in section.Buttons)
{
button.Deselect();
}
}
section.DeselectAll();
}
public void DeselectType(Type modType)
public void DeselectTypes(Type[] modTypes)
{
if (modTypes.Length == 0) return;
foreach (ModSection section in modSectionsContainer.Children)
{
foreach (ModButton button in section.Buttons)
{
foreach (Mod mod in button.Mods)
{
if (modType.IsInstanceOfType(mod))
{
Mod selected = button.SelectedMod;
if (selected == null) continue;
foreach (Type type in modTypes)
if (type.IsInstanceOfType(selected))
button.Deselect();
return;
}
}
}
}
}
private void modButtonPressed(Mod selectedMod)
{
if (selectedMod != null)
{
foreach (Type t in selectedMod.IncompatibleMods)
DeselectType(t);
}
DeselectTypes(selectedMod.IncompatibleMods);
refreshSelectedMods();
}
private void refreshSelectedMods()
{
SelectedMods.Value = modSectionsContainer.Children.SelectMany(s => s.Buttons.Select(x => x.SelectedMod).Where(x => x != null)).ToArray();
double multiplier = 1.0;
bool ranked = true;
@ -158,46 +125,23 @@ namespace osu.Game.Overlays.Mods
foreach (Mod mod in SelectedMods.Value)
{
multiplier *= mod.ScoreMultiplier;
if (ranked)
ranked = mod.Ranked;
ranked &= mod.Ranked;
}
// 1.00x
// 1.05x
// 1.20x
multiplierLabel.Text = string.Format("{0:N2}x", multiplier);
multiplierLabel.Text = $"{multiplier:N2}x";
string rankedString = ranked ? "Ranked" : "Unranked";
rankedLabel.Text = $@"{rankedString}, Score Multiplier: ";
if (multiplier > 1.0)
{
multiplierLabel.FadeColour(highMultiplierColour, 200);
}
else if (multiplier < 1.0)
{
multiplierLabel.FadeColour(lowMultiplierColour, 200);
}
else
{
multiplierLabel.FadeColour(Color4.White, 200);
}
}
private void refreshSelectedMods()
{
List<Mod> selectedMods = new List<Mod>();
foreach (ModSection section in modSectionsContainer.Children)
{
foreach (Mod mod in section.SelectedMods)
{
selectedMods.Add(mod);
}
}
SelectedMods.Value = selectedMods.ToArray();
}
public ModSelectOverlay()
@ -308,6 +252,30 @@ namespace osu.Game.Overlays.Mods
AutoSizeAxes = Axes.Y,
Spacing = new Vector2(0f, 10f),
Width = content_width,
Children = new ModSection[]
{
new DifficultyReductionSection
{
RelativeSizeAxes = Axes.X,
Origin = Anchor.TopCentre,
Anchor = Anchor.TopCentre,
Action = modButtonPressed,
},
new DifficultyIncreaseSection
{
RelativeSizeAxes = Axes.X,
Origin = Anchor.TopCentre,
Anchor = Anchor.TopCentre,
Action = modButtonPressed,
},
new AssistedSection
{
RelativeSizeAxes = Axes.X,
Origin = Anchor.TopCentre,
Anchor = Anchor.TopCentre,
Action = modButtonPressed,
},
}
},
// Footer
new Container

View File

@ -3,6 +3,7 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Threading.Tasks;
using OpenTK;
using OpenTK.Graphics;
@ -30,7 +31,7 @@ namespace osu.Game.Overlays
{
private MusicControllerBackground backgroundSprite;
private DragBar progress;
private TextAwesome playButton, listButton;
private TextAwesome playButton;
private SpriteText title, artist;
private List<BeatmapSetInfo> playList;
@ -59,6 +60,8 @@ namespace osu.Game.Overlays
protected override bool OnDrag(InputState state)
{
Trace.Assert(state.Mouse.PositionMouseDown != null, "state.Mouse.PositionMouseDown != null");
Vector2 change = state.Mouse.Position - state.Mouse.PositionMouseDown.Value;
// Diminish the drag distance as we go further to simulate "rubber band" feeling.
@ -187,7 +190,7 @@ namespace osu.Game.Overlays
Position = new Vector2(20, -30),
Children = new Drawable[]
{
listButton = new TextAwesome
new TextAwesome
{
TextSize = 15,
Icon = FontAwesome.fa_bars,

View File

@ -45,7 +45,7 @@ namespace osu.Game.Overlays.Notifications
public virtual bool Read { get; set; }
public Notification()
protected Notification()
{
RelativeSizeAxes = Axes.X;
AutoSizeAxes = Axes.Y;

View File

@ -10,11 +10,8 @@ namespace osu.Game.Overlays.Notifications
{
public class ProgressCompletionNotification : SimpleNotification
{
private ProgressNotification progressNotification;
public ProgressCompletionNotification(ProgressNotification progressNotification)
public ProgressCompletionNotification()
{
this.progressNotification = progressNotification;
Icon = FontAwesome.fa_check;
}

View File

@ -90,7 +90,7 @@ namespace osu.Game.Overlays.Notifications
private ProgressNotificationState state;
protected virtual Notification CreateCompletionNotification() => new ProgressCompletionNotification(this)
protected virtual Notification CreateCompletionNotification() => new ProgressCompletionNotification()
{
Activated = CompletionClickAction,
Text = $"Task \"{Text}\" has completed!"

View File

@ -81,10 +81,8 @@ namespace osu.Game.Overlays.Notifications
set
{
if (base.Read = value)
Light.FadeOut(100);
else
Light.FadeIn(100);
base.Read = value;
Light.FadeTo(value ? 1 : 0, 100);
}
}
}

View File

@ -39,7 +39,7 @@ namespace osu.Game.Overlays.Options
bindable.ValueChanged += bindable_ValueChanged;
bindable_ValueChanged(null, null);
if (bindable?.Disabled ?? true)
if (bindable.Disabled)
Alpha = 0.3f;
}
}

View File

@ -23,7 +23,7 @@ namespace osu.Game.Overlays.Options
private SpriteText headerLabel;
public OptionsSection()
protected OptionsSection()
{
Margin = new MarginPadding { Top = 20 };
AutoSizeAxes = Axes.Y;

View File

@ -11,11 +11,13 @@ namespace osu.Game.Overlays.Options
{
public abstract class OptionsSubsection : FillFlowContainer
{
protected override Container<Drawable> Content { get; }
protected override Container<Drawable> Content => content;
private Container<Drawable> content;
protected abstract string Header { get; }
public OptionsSubsection()
protected OptionsSubsection()
{
RelativeSizeAxes = Axes.X;
AutoSizeAxes = Axes.Y;
@ -28,7 +30,7 @@ namespace osu.Game.Overlays.Options
Margin = new MarginPadding { Bottom = 10 },
Font = @"Exo2.0-Black",
},
Content = new FillFlowContainer
content = new FillFlowContainer
{
Direction = FillDirection.Vertical,
Spacing = new Vector2(0, 5),

View File

@ -118,7 +118,7 @@ namespace osu.Game.Overlays.Options.Sections.General
PlaceholderText = "Password",
RelativeSizeAxes = Axes.X,
TabbableContentContainer = this,
OnCommit = (TextBox sender, bool newText) => performLogin()
OnCommit = (sender, newText) => performLogin()
},
new OsuCheckbox
{

View File

@ -147,11 +147,8 @@ namespace osu.Game.Overlays
var previous = sidebarButtons.SingleOrDefault(sb => sb.Selected);
var next = sidebarButtons.SingleOrDefault(sb => sb.Section == bestCandidate);
if (next != null)
{
previous.Selected = false;
next.Selected = true;
}
if (next != null) next.Selected = true;
if (previous != null) previous.Selected = false;
}
}

View File

@ -30,7 +30,7 @@ namespace osu.Game.Overlays.Toolbar
protected override bool BlockPassThroughInput => false;
private const int transition_time = 500;
private const double transition_time = 500;
private const float alpha_hovering = 0.8f;
private const float alpha_normal = 0.6f;
@ -56,7 +56,7 @@ namespace osu.Game.Overlays.Toolbar
},
modeSelector = new ToolbarModeSelector
{
OnPlayModeChange = (PlayMode mode) =>
OnPlayModeChange = mode =>
{
OnPlayModeChange?.Invoke(mode);
}

View File

@ -64,11 +64,8 @@ namespace osu.Game.Overlays.Toolbar
}
};
int amountButtons = 0;
foreach (PlayMode m in Enum.GetValues(typeof(PlayMode)))
{
++amountButtons;
var localMode = m;
modeButtons.Add(new ToolbarModeButton
{

View File

@ -94,11 +94,7 @@ namespace osu.Game.Overlays.Toolbar
userId = value;
Sprite newSprite;
if (userId > 1)
newSprite = new OnlineSprite($@"https://a.ppy.sh/{userId}");
else
newSprite = new Sprite { Texture = guestTexture };
var newSprite = userId > 1 ? new OnlineSprite($@"https://a.ppy.sh/{userId}") : new Sprite { Texture = guestTexture };
newSprite.FillMode = FillMode.Fit;

View File

@ -30,11 +30,7 @@ namespace osu.Game.Screens.Backgrounds
Schedule(() =>
{
Background newBackground;
if (beatmap == null)
newBackground = new Background(@"Backgrounds/bg1");
else
newBackground = new BeatmapBackground(beatmap);
var newBackground = beatmap == null ? new Background(@"Backgrounds/bg1") : new BeatmapBackground(beatmap);
newBackground.LoadAsync(Game, delegate
{

View File

@ -21,11 +21,10 @@ namespace osu.Game.Screens
{
private BackButton popButton;
private const int transition_time = 1000;
private const double transition_time = 1000;
protected virtual IEnumerable<Type> PossibleChildren => null;
private FillFlowContainer childModeButtons;
private Container textContainer;
private Box box;
@ -80,6 +79,8 @@ namespace osu.Game.Screens
public ScreenWhiteBox()
{
FillFlowContainer childModeButtons;
Children = new Drawable[]
{
box = new Box

View File

@ -28,16 +28,11 @@ namespace osu.Game.Screens.Menu
{
private Container iconText;
private Container box;
private Box boxColourLayer;
private Box boxHoverLayer;
private Color4 colour;
private TextAwesome icon;
private string internalName;
private readonly FontAwesome symbol;
private Action clickAction;
private readonly float extraWidth;
private Key triggerKey;
private string text;
private SampleChannel sampleClick;
public override bool Contains(Vector2 screenSpacePos)
@ -48,12 +43,8 @@ namespace osu.Game.Screens.Menu
public Button(string text, string internalName, FontAwesome symbol, Color4 colour, Action clickAction = null, float extraWidth = 0, Key triggerKey = Key.Unknown)
{
this.internalName = internalName;
this.symbol = symbol;
this.colour = colour;
this.clickAction = clickAction;
this.extraWidth = extraWidth;
this.triggerKey = triggerKey;
this.text = text;
AutoSizeAxes = Axes.Both;
Alpha = 0;
@ -80,7 +71,7 @@ namespace osu.Game.Screens.Menu
Shear = new Vector2(ButtonSystem.WEDGE_WIDTH / boxSize.Y, 0),
Children = new []
{
boxColourLayer = new Box
new Box
{
EdgeSmoothness = new Vector2(1.5f, 0),
RelativeSizeAxes = Axes.Both,
@ -234,9 +225,7 @@ namespace osu.Game.Screens.Menu
[BackgroundDependencyLoader]
private void load(AudioManager audio)
{
sampleClick = audio.Sample.Get($@"Menu/menu-{internalName}-click");
if (sampleClick == null)
sampleClick = audio.Sample.Get(internalName.Contains(@"back") ? @"Menu/menuback" : @"Menu/menuhit");
sampleClick = audio.Sample.Get($@"Menu/menu-{internalName}-click") ?? audio.Sample.Get(internalName.Contains(@"back") ? @"Menu/menuback" : @"Menu/menuhit");
}
protected override bool OnMouseDown(InputState state, MouseDownEventArgs args)
@ -323,12 +312,12 @@ namespace osu.Game.Screens.Menu
case ButtonState.Expanded:
const int expand_duration = 500;
box.ScaleTo(new Vector2(1, 1), expand_duration, EasingTypes.OutExpo);
FadeIn(expand_duration / 6);
FadeIn(expand_duration / 6f);
break;
case ButtonState.Exploded:
const int explode_duration = 200;
box.ScaleTo(new Vector2(2, 1), explode_duration, EasingTypes.OutExpo);
FadeOut(explode_duration / 4 * 3);
FadeOut(explode_duration / 4f * 3);
break;
}
}

View File

@ -19,7 +19,7 @@ using OpenTK.Input;
namespace osu.Game.Screens.Menu
{
public partial class ButtonSystem : Container, IStateful<MenuState>
public class ButtonSystem : Container, IStateful<MenuState>
{
public Action OnEdit;
public Action OnExit;

View File

@ -53,7 +53,7 @@ namespace osu.Game.Screens.Play
//further: change default values here and in KeyCounterCollection if needed, instead of passing them in every constructor
public Color4 KeyDownTextColor { get; set; } = Color4.DarkGray;
public Color4 KeyUpTextColor { get; set; } = Color4.White;
public int FadeTime { get; set; } = 0;
public int FadeTime { get; set; }
protected KeyCounter(string name)
{

View File

@ -50,7 +50,7 @@ namespace osu.Game.Screens.Play
},
new OsuSpriteText
{
Text = String.Format("{0:n0}", value),
Text = $"{value:n0}",
Font = @"Exo2.0-Bold",
Shadow = true,
ShadowColour = new Color4(0, 0, 0, 0.25f),

View File

@ -58,7 +58,7 @@ namespace osu.Game.Screens.Play
private PauseOverlay pauseOverlay;
[BackgroundDependencyLoader]
private void load(AudioManager audio, BeatmapDatabase beatmaps, OsuGameBase game, OsuConfigManager config)
private void load(AudioManager audio, BeatmapDatabase beatmaps, OsuConfigManager config)
{
var beatmap = Beatmap.Beatmap;
@ -81,6 +81,9 @@ namespace osu.Game.Screens.Play
if ((Beatmap?.Beatmap?.HitObjects.Count ?? 0) == 0)
throw new Exception("No valid objects were found!");
if (Beatmap == null)
throw new Exception("Beatmap was not loaded");
}
catch (Exception e)
{

View File

@ -167,7 +167,7 @@ namespace osu.Game.Screens.Play
{
new Sprite
{
Texture = beatmap.Background,
Texture = beatmap?.Background,
Origin = Anchor.Centre,
Anchor = Anchor.Centre,
FillMode = FillMode.Fill,
@ -176,7 +176,7 @@ namespace osu.Game.Screens.Play
},
new OsuSpriteText
{
Text = beatmap.BeatmapInfo?.Version,
Text = beatmap?.BeatmapInfo?.Version,
TextSize = 26,
Font = @"Exo2.0-MediumItalic",
Origin = Anchor.TopCentre,

View File

@ -162,13 +162,13 @@ namespace osu.Game.Screens.Select
switch (mode)
{
case FilterControl.SortMode.Artist:
sortedGroups.Sort((x, y) => string.Compare(x.BeatmapSet.Metadata.Artist, y.BeatmapSet.Metadata.Artist));
sortedGroups.Sort((x, y) => string.Compare(x.BeatmapSet.Metadata.Artist, y.BeatmapSet.Metadata.Artist, StringComparison.InvariantCultureIgnoreCase));
break;
case FilterControl.SortMode.Title:
sortedGroups.Sort((x, y) => string.Compare(x.BeatmapSet.Metadata.Title, y.BeatmapSet.Metadata.Title));
sortedGroups.Sort((x, y) => string.Compare(x.BeatmapSet.Metadata.Title, y.BeatmapSet.Metadata.Title, StringComparison.InvariantCultureIgnoreCase));
break;
case FilterControl.SortMode.Author:
sortedGroups.Sort((x, y) => string.Compare(x.BeatmapSet.Metadata.Author, y.BeatmapSet.Metadata.Author));
sortedGroups.Sort((x, y) => string.Compare(x.BeatmapSet.Metadata.Author, y.BeatmapSet.Metadata.Author, StringComparison.InvariantCultureIgnoreCase));
break;
case FilterControl.SortMode.Difficulty:
sortedGroups.Sort((x, y) =>

View File

@ -9,7 +9,6 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Primitives;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.UserInterface;
using osu.Framework.Input;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
@ -60,7 +59,7 @@ namespace osu.Game.Screens.Select
{
searchTextBox = new SearchTextBox {
RelativeSizeAxes = Axes.X,
OnChange = (TextBox sender, bool newText) =>
OnChange = (sender, newText) =>
{
if (newText)
FilterChanged?.Invoke();

View File

@ -95,7 +95,7 @@ namespace osu.Game.Screens.Select
{
Anchor = Anchor.BottomLeft,
Origin = Anchor.BottomLeft,
Position = new Vector2(BackButton.SIZE_EXTENDED.X + padding, 0),
Position = new Vector2(TwoLayerButton.SIZE_EXTENDED.X + padding, 0),
RelativeSizeAxes = Axes.Y,
AutoSizeAxes = Axes.X,
Direction = FillDirection.Horizontal,

View File

@ -341,7 +341,7 @@ namespace osu.Game.Screens.Select
//todo: change background in selectionChanged instead; support per-difficulty backgrounds.
changeBackground(beatmap);
carousel.SelectBeatmap(beatmap?.BeatmapInfo);
carousel.SelectBeatmap(beatmap.BeatmapInfo);
}
/// <summary>

View File

@ -8,7 +8,7 @@ namespace osu.Game.Screens.Tournament.Components
{
public class DrawingsConfigManager : ConfigManager<DrawingsConfig>
{
public override string Filename => @"drawings.ini";
protected override string Filename => @"drawings.ini";
protected override void InitialiseDefaults()
{

View File

@ -267,10 +267,7 @@ namespace osu.Game.Screens.Tournament
}
};
if (writeOp == null)
writeOp = Task.Run(writeAction);
else
writeOp = writeOp.ContinueWith(t => { writeAction(); });
writeOp = writeOp?.ContinueWith(t => { writeAction(); }) ?? Task.Run(writeAction);
}
private void reloadTeams()

View File

@ -3,6 +3,7 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
@ -109,7 +110,11 @@ namespace osu.Game.Screens.Tournament
break;
case ScrollState.Stopped:
// Find closest to center
if (!Children.Any())
break;
Drawable closest = null;
foreach (var c in Children)
{
if (!(c is ScrollingTeam))
@ -128,6 +133,8 @@ namespace osu.Game.Screens.Tournament
closest = c;
}
Trace.Assert(closest != null, "closest != null");
offset += DrawWidth / 2f - (closest.Position.X + closest.DrawWidth / 2f);
ScrollingTeam st = closest as ScrollingTeam;
@ -263,9 +270,9 @@ namespace osu.Game.Screens.Tournament
private void addFlags()
{
for (int i = 0; i < availableTeams.Count; i++)
foreach (Team t in availableTeams)
{
Add(new ScrollingTeam(availableTeams[i])
Add(new ScrollingTeam(t)
{
X = leftPos + DrawWidth
});
@ -310,7 +317,7 @@ namespace osu.Game.Screens.Tournament
public override void Apply(Drawable d)
{
base.Apply(d);
(d as ScrollingTeamContainer).speed = CurrentValue;
((ScrollingTeamContainer)d).speed = CurrentValue;
}
}

View File

@ -4,13 +4,16 @@
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ArrangeRedundantParentheses/@EntryIndexedValue">WARNING</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ArrangeTypeMemberModifiers/@EntryIndexedValue">WARNING</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ArrangeTypeModifiers/@EntryIndexedValue">WARNING</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=AssignedValueIsNeverUsed/@EntryIndexedValue">HINT</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=AssignNullToNotNullAttribute/@EntryIndexedValue">HINT</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=AutoPropertyCanBeMadeGetOnly_002EGlobal/@EntryIndexedValue">WARNING</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=AutoPropertyCanBeMadeGetOnly_002ELocal/@EntryIndexedValue">WARNING</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=AutoPropertyCanBeMadeGetOnly_002EGlobal/@EntryIndexedValue">HINT</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=AutoPropertyCanBeMadeGetOnly_002ELocal/@EntryIndexedValue">HINT</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=CanBeReplacedWithTryCastAndCheckForNull/@EntryIndexedValue">WARNING</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=CheckForReferenceEqualityInstead_002E1/@EntryIndexedValue">WARNING</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=CheckForReferenceEqualityInstead_002E2/@EntryIndexedValue">WARNING</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ClassNeverInstantiated_002EGlobal/@EntryIndexedValue">HINT</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ClassNeverInstantiated_002ELocal/@EntryIndexedValue">WARNING</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ClassWithVirtualMembersNeverInherited_002EGlobal/@EntryIndexedValue">HINT</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=CompareOfFloatsByEqualityOperator/@EntryIndexedValue">HINT</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ConvertClosureToMethodGroup/@EntryIndexedValue">WARNING</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ConvertIfDoToWhile/@EntryIndexedValue">WARNING</s:String>
@ -19,11 +22,12 @@
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ConvertIfToOrExpression/@EntryIndexedValue">WARNING</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ConvertNullableToShortForm/@EntryIndexedValue">WARNING</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ConvertPropertyToExpressionBody/@EntryIndexedValue">WARNING</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ConvertToAutoProperty/@EntryIndexedValue">WARNING</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ConvertToAutoProperty/@EntryIndexedValue">HINT</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ConvertToLambdaExpression/@EntryIndexedValue">WARNING</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ConvertToStaticClass/@EntryIndexedValue">WARNING</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=DoubleNegationOperator/@EntryIndexedValue">WARNING</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=EmptyGeneralCatchClause/@EntryIndexedValue">DO_NOT_SHOW</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=EventNeverSubscribedTo_002EGlobal/@EntryIndexedValue">HINT</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=EventNeverSubscribedTo_002ELocal/@EntryIndexedValue">WARNING</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=FieldCanBeMadeReadOnly_002EGlobal/@EntryIndexedValue">DO_NOT_SHOW</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=FieldCanBeMadeReadOnly_002ELocal/@EntryIndexedValue">DO_NOT_SHOW</s:String>
@ -35,11 +39,13 @@
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=MemberCanBeMadeStatic_002ELocal/@EntryIndexedValue">DO_NOT_SHOW</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=MemberCanBePrivate_002EGlobal/@EntryIndexedValue">HINT</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=MemberCanBePrivate_002ELocal/@EntryIndexedValue">HINT</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=MemberCanBeProtected_002EGlobal/@EntryIndexedValue">HINT</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=MergeConditionalExpression/@EntryIndexedValue">WARNING</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=MergeSequentialChecks/@EntryIndexedValue">WARNING</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=MethodSupportsCancellation/@EntryIndexedValue">WARNING</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=MoreSpecificForeachVariableTypeAvailable/@EntryIndexedValue">WARNING</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=NestedStringInterpolation/@EntryIndexedValue">WARNING</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=NotAccessedField_002EGlobal/@EntryIndexedValue">HINT</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ParameterHidesMember/@EntryIndexedValue">HINT</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=PossibleMultipleEnumeration/@EntryIndexedValue">HINT</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=PublicConstructorInAbstractClass/@EntryIndexedValue">WARNING</s:String>
@ -113,7 +119,10 @@
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=SwitchStatementMissingSomeCases/@EntryIndexedValue">DO_NOT_SHOW</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=TooWideLocalVariableScope/@EntryIndexedValue">WARNING</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=TryCastAlwaysSucceeds/@EntryIndexedValue">WARNING</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=UnassignedField_002EGlobal/@EntryIndexedValue">HINT</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=UnusedAutoPropertyAccessor_002EGlobal/@EntryIndexedValue">HINT</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=UnusedMemberHierarchy_002EGlobal/@EntryIndexedValue">HINT</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=UnusedMemberInSuper_002EGlobal/@EntryIndexedValue">HINT</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=UnusedMember_002EGlobal/@EntryIndexedValue">HINT</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=UnusedMember_002ELocal/@EntryIndexedValue">HINT</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=UnusedMethodReturnValue_002EGlobal/@EntryIndexedValue">HINT</s:String>
@ -128,6 +137,7 @@
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=UseObjectOrCollectionInitializer/@EntryIndexedValue">WARNING</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=UseStringInterpolation/@EntryIndexedValue">WARNING</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=VirtualMemberCallInConstructor/@EntryIndexedValue">HINT</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=VirtualMemberNeverOverridden_002EGlobal/@EntryIndexedValue">HINT</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=VirtualMemberNeverOverridden_002ELocal/@EntryIndexedValue">WARNING</s:String>
<s:String x:Key="/Default/CodeStyle/CodeCleanup/Profiles/=Code_0020Cleanup_0020_0028peppy_0029/@EntryIndexedValue">&lt;?xml version="1.0" encoding="utf-16"?&gt;&lt;Profile name="Code Cleanup (peppy)"&gt;&lt;CSArrangeThisQualifier&gt;True&lt;/CSArrangeThisQualifier&gt;&lt;CSUseVar&gt;&lt;BehavourStyle&gt;CAN_CHANGE_TO_EXPLICIT&lt;/BehavourStyle&gt;&lt;LocalVariableStyle&gt;ALWAYS_EXPLICIT&lt;/LocalVariableStyle&gt;&lt;ForeachVariableStyle&gt;ALWAYS_EXPLICIT&lt;/ForeachVariableStyle&gt;&lt;/CSUseVar&gt;&lt;CSOptimizeUsings&gt;&lt;OptimizeUsings&gt;True&lt;/OptimizeUsings&gt;&lt;EmbraceInRegion&gt;False&lt;/EmbraceInRegion&gt;&lt;RegionName&gt;&lt;/RegionName&gt;&lt;/CSOptimizeUsings&gt;&lt;CSShortenReferences&gt;True&lt;/CSShortenReferences&gt;&lt;CSReformatCode&gt;True&lt;/CSReformatCode&gt;&lt;CSUpdateFileHeader&gt;True&lt;/CSUpdateFileHeader&gt;&lt;CSCodeStyleAttributes ArrangeTypeAccessModifier="False" ArrangeTypeMemberAccessModifier="False" SortModifiers="True" RemoveRedundantParentheses="True" AddMissingParentheses="False" ArrangeBraces="False" ArrangeAttributes="False" ArrangeArgumentsStyle="False" /&gt;&lt;XAMLCollapseEmptyTags&gt;False&lt;/XAMLCollapseEmptyTags&gt;&lt;CSFixBuiltinTypeReferences&gt;True&lt;/CSFixBuiltinTypeReferences&gt;&lt;CSArrangeQualifiers&gt;True&lt;/CSArrangeQualifiers&gt;&lt;/Profile&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/CodeCleanup/RecentlyUsedProfile/@EntryValue">Code Cleanup (peppy)</s:String>