1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-15 15:53:21 +08:00

Merge pull request #917 from johnneijzen/master

More Clean Up
This commit is contained in:
Dean Herbert 2017-06-08 20:39:53 +09:00 committed by GitHub
commit 6047bfc3ec
43 changed files with 33 additions and 55 deletions

View File

@ -41,7 +41,7 @@ namespace osu.Desktop.VisualTests.Tests
StarDifficulty = 5.3f, StarDifficulty = 5.3f,
Metrics = new BeatmapMetrics Metrics = new BeatmapMetrics
{ {
Ratings = Enumerable.Range(0,10), Ratings = Enumerable.Range(0, 10),
Fails = Enumerable.Range(lastRange, 100).Select(i => i % 12 - 6), Fails = Enumerable.Range(lastRange, 100).Select(i => i % 12 - 6),
Retries = Enumerable.Range(lastRange - 3, 100).Select(i => i % 12 - 6), Retries = Enumerable.Range(lastRange - 3, 100).Select(i => i % 12 - 6),
}, },

View File

@ -36,12 +36,12 @@ namespace osu.Desktop.VisualTests.Tests
}); });
first.Room.Name.Value = @"Great Room Right Here"; first.Room.Name.Value = @"Great Room Right Here";
first.Room.Host.Value = new User { Username = @"Naeferith", Id = 9492835, Country = new Country { FlagName = @"FR" }}; first.Room.Host.Value = new User { Username = @"Naeferith", Id = 9492835, Country = new Country { FlagName = @"FR" } };
first.Room.Status.Value = new RoomStatusOpen(); first.Room.Status.Value = new RoomStatusOpen();
first.Room.Beatmap.Value = new BeatmapMetadata { Title = @"Seiryu", Artist = @"Critical Crystal" }; first.Room.Beatmap.Value = new BeatmapMetadata { Title = @"Seiryu", Artist = @"Critical Crystal" };
second.Room.Name.Value = @"Relax It's The Weekend"; second.Room.Name.Value = @"Relax It's The Weekend";
second.Room.Host.Value = new User { Username = @"peppy", Id = 2, Country = new Country { FlagName = @"AU" }}; second.Room.Host.Value = new User { Username = @"peppy", Id = 2, Country = new Country { FlagName = @"AU" } };
second.Room.Status.Value = new RoomStatusPlaying(); second.Room.Status.Value = new RoomStatusPlaying();
second.Room.Beatmap.Value = new BeatmapMetadata { Title = @"ZAQ", Artist = @"Serendipity" }; second.Room.Beatmap.Value = new BeatmapMetadata { Title = @"ZAQ", Artist = @"Serendipity" };

View File

@ -30,7 +30,7 @@ namespace osu.Desktop.VisualTests.Tests
}, },
}; };
AddStep("values from 1-10", () => graph.Values = Enumerable.Range(1,10).Select(i => (float)i)); AddStep("values from 1-10", () => graph.Values = Enumerable.Range(1, 10).Select(i => (float)i));
AddStep("values from 1-100", () => graph.Values = Enumerable.Range(1, 100).Select(i => (float)i)); AddStep("values from 1-100", () => graph.Values = Enumerable.Range(1, 100).Select(i => (float)i));
AddStep("reversed values from 1-10", () => graph.Values = Enumerable.Range(1, 10).Reverse().Select(i => (float)i)); AddStep("reversed values from 1-10", () => graph.Values = Enumerable.Range(1, 10).Reverse().Select(i => (float)i));
AddStep("Bottom to top", () => graph.Direction = BarDirection.BottomToTop); AddStep("Bottom to top", () => graph.Direction = BarDirection.BottomToTop);

View File

@ -54,7 +54,7 @@ namespace osu.Desktop.VisualTests.Tests
Children = new Drawable[] Children = new Drawable[]
{ {
new SpriteText { Text = "FadeTime" }, new SpriteText { Text = "FadeTime" },
sliderBar =new TestSliderBar<int> sliderBar = new TestSliderBar<int>
{ {
Width = 150, Width = 150,
Height = 10, Height = 10,

View File

@ -35,7 +35,7 @@ namespace osu.Desktop.VisualTests.Tests
}); });
AddStep(@"Pause", delegate { AddStep(@"Pause", delegate {
if(failOverlay.State == Visibility.Visible) if (failOverlay.State == Visibility.Visible)
{ {
failOverlay.Hide(); failOverlay.Hide();
} }

View File

@ -79,7 +79,8 @@ namespace osu.Desktop.VisualTests.Tests
{ {
score.Current.Value += 300 + (ulong)(300.0 * (comboCounter.Current > 0 ? comboCounter.Current - 1 : 0) / 25.0); score.Current.Value += 300 + (ulong)(300.0 * (comboCounter.Current > 0 ? comboCounter.Current - 1 : 0) / 25.0);
comboCounter.Increment(); comboCounter.Increment();
numerator++; denominator++; numerator++;
denominator++;
accuracyCounter.SetFraction(numerator, denominator); accuracyCounter.SetFraction(numerator, denominator);
}); });

View File

@ -87,6 +87,5 @@ namespace osu.Game.Rulesets.Mania.MathUtils
bitIndex++; bitIndex++;
return ((bitBuffer >>= 1) & 1) == 1; return ((bitBuffer >>= 1) & 1) == 1;
} }
} }
} }

View File

@ -61,7 +61,7 @@ namespace osu.Game.Rulesets.Mania.UI
{ {
Name = "Hit target + hit objects", Name = "Hit target + hit objects",
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Padding = new MarginPadding { Top = ManiaPlayfield.HIT_TARGET_POSITION}, Padding = new MarginPadding { Top = ManiaPlayfield.HIT_TARGET_POSITION },
Children = new Drawable[] Children = new Drawable[]
{ {
new Container new Container

View File

@ -68,7 +68,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
Size = new Vector2(TaikoHitObject.DEFAULT_CIRCLE_DIAMETER), Size = new Vector2(TaikoHitObject.DEFAULT_CIRCLE_DIAMETER),
BlendingMode = BlendingMode.Additive, BlendingMode = BlendingMode.Additive,
Masking = true, Masking = true,
Children = new [] Children = new[]
{ {
new Box new Box
{ {
@ -119,7 +119,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
{ {
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
Origin = Anchor.Centre, Origin = Anchor.Centre,
Children = new [] Children = new[]
{ {
symbol = new SwellSymbolPiece() symbol = new SwellSymbolPiece()
} }

View File

@ -229,7 +229,6 @@ namespace osu.Game.Rulesets.Taiko.UI
if (judgedObject.HitObject.Kiai) if (judgedObject.HitObject.Kiai)
kiaiExplosionContainer.Add(new KiaiHitExplosion(judgedObject.Judgement, isRim)); kiaiExplosionContainer.Add(new KiaiHitExplosion(judgedObject.Judgement, isRim));
} }
else else
hitExplosionContainer.Children.FirstOrDefault(e => e.Judgement == judgedObject.Judgement)?.VisualiseSecondHit(); hitExplosionContainer.Children.FirstOrDefault(e => e.Judgement == judgedObject.Judgement)?.VisualiseSecondHit();

View File

@ -166,4 +166,3 @@ namespace osu.Game.Tests.Beatmaps.IO
} }
} }
} }

View File

@ -86,4 +86,3 @@ namespace osu.Game.Tests.Beatmaps.IO
} }
} }
} }

View File

@ -10,7 +10,6 @@ using OpenTK.Graphics;
namespace osu.Game.Beatmaps.Drawables namespace osu.Game.Beatmaps.Drawables
{ {
public class DifficultyIcon : DifficultyColouredContainer public class DifficultyIcon : DifficultyColouredContainer
{ {
private readonly BeatmapInfo beatmap; private readonly BeatmapInfo beatmap;

View File

@ -39,4 +39,3 @@ namespace osu.Game.Database
} }
} }
} }

View File

@ -36,4 +36,3 @@ namespace osu.Game.Database
public string StoryboardFile { get; set; } public string StoryboardFile { get; set; }
} }
} }

View File

@ -81,7 +81,7 @@ namespace osu.Game.Graphics.UserInterface
background = new Box background = new Box
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Colour = new Color4(0,0,0,0) Colour = new Color4(0, 0, 0, 0)
}, },
bar = new Box bar = new Box
{ {

View File

@ -16,7 +16,7 @@ namespace osu.Game.Graphics.UserInterface
throw new InvalidOperationException("OsuEnumDropdown only supports enums as the generic type argument"); throw new InvalidOperationException("OsuEnumDropdown only supports enums as the generic type argument");
List<KeyValuePair<string, T>> items = new List<KeyValuePair<string, T>>(); List<KeyValuePair<string, T>> items = new List<KeyValuePair<string, T>>();
foreach(var val in (T[])Enum.GetValues(typeof(T))) foreach (var val in (T[])Enum.GetValues(typeof(T)))
{ {
var field = typeof(T).GetField(Enum.GetName(typeof(T), val)); var field = typeof(T).GetField(Enum.GetName(typeof(T), val));
items.Add( items.Add(

View File

@ -90,7 +90,7 @@ namespace osu.Game.Graphics.UserInterface
Offset = new Vector2(2, 0), Offset = new Vector2(2, 0),
Radius = 2, Radius = 2,
}, },
Children = new [] { Children = new[] {
IconLayer = new Box IconLayer = new Box
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
@ -124,7 +124,7 @@ namespace osu.Game.Graphics.UserInterface
Offset = new Vector2(2, 0), Offset = new Vector2(2, 0),
Radius = 2, Radius = 2,
}, },
Children = new [] { Children = new[] {
TextLayer = new Box TextLayer = new Box
{ {
Origin = Anchor.TopLeft, Origin = Anchor.TopLeft,

View File

@ -59,7 +59,6 @@ namespace osu.Game.Online.API
{ {
} }
return null; return null;
} }
} }

View File

@ -20,7 +20,6 @@ using osu.Framework.Graphics.Cursor;
namespace osu.Game.Overlays.Mods namespace osu.Game.Overlays.Mods
{ {
/// <summary> /// <summary>
/// Represents a clickable button which can cycle through one of more mods. /// Represents a clickable button which can cycle through one of more mods.
/// </summary> /// </summary>

View File

@ -137,6 +137,7 @@ namespace osu.Game.Overlays.Music
public bool MatchingFilter public bool MatchingFilter
{ {
get { return matching; }
set set
{ {
if (matching == value) return; if (matching == value) return;
@ -145,10 +146,6 @@ namespace osu.Game.Overlays.Music
FadeTo(matching ? 1 : 0, 200); FadeTo(matching ? 1 : 0, 200);
} }
get
{
return matching;
}
} }
} }
} }

View File

@ -46,19 +46,19 @@ namespace osu.Game.Overlays
Direction = FillDirection.Vertical, Direction = FillDirection.Vertical,
AutoSizeAxes = Axes.Y, AutoSizeAxes = Axes.Y,
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
Children = new [] Children = new[]
{ {
new NotificationSection new NotificationSection
{ {
Title = @"Notifications", Title = @"Notifications",
ClearText = @"Clear All", ClearText = @"Clear All",
AcceptTypes = new [] { typeof(SimpleNotification) }, AcceptTypes = new[] { typeof(SimpleNotification) },
}, },
new NotificationSection new NotificationSection
{ {
Title = @"Running Tasks", Title = @"Running Tasks",
ClearText = @"Cancel All", ClearText = @"Cancel All",
AcceptTypes = new [] { typeof(ProgressNotification) }, AcceptTypes = new[] { typeof(ProgressNotification) },
}, },
} }
} }

View File

@ -41,4 +41,3 @@ namespace osu.Game.Overlays.Settings.Sections.Gameplay
} }
} }
} }

View File

@ -33,4 +33,3 @@ namespace osu.Game.Overlays.Settings.Sections.General
} }
} }
} }

View File

@ -22,4 +22,3 @@ namespace osu.Game.Overlays.Settings.Sections
} }
} }
} }

View File

@ -65,7 +65,7 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics
letterboxSettings.ClearTransforms(); letterboxSettings.ClearTransforms();
letterboxSettings.AutoSizeAxes = isVisible ? Axes.Y : Axes.None; letterboxSettings.AutoSizeAxes = isVisible ? Axes.Y : Axes.None;
if(!isVisible) if (!isVisible)
letterboxSettings.ResizeHeightTo(0, transition_duration, EasingTypes.OutQuint); letterboxSettings.ResizeHeightTo(0, transition_duration, EasingTypes.OutQuint);
}; };
letterboxing.TriggerChange(); letterboxing.TriggerChange();

View File

@ -24,4 +24,3 @@ namespace osu.Game.Overlays.Settings.Sections
} }
} }
} }

View File

@ -22,4 +22,3 @@ namespace osu.Game.Overlays.Settings.Sections
} }
} }
} }

View File

@ -52,4 +52,3 @@ namespace osu.Game.Overlays.Settings
} }
} }
} }

View File

@ -31,7 +31,7 @@ namespace osu.Game.Overlays.Settings
}, },
new SidebarScrollContainer new SidebarScrollContainer
{ {
Children = new [] Children = new[]
{ {
content = new FillFlowContainer content = new FillFlowContainer
{ {

View File

@ -53,7 +53,7 @@ namespace osu.Game.Overlays.Toolbar
Radius = 15, Radius = 15,
Roundness = 15, Roundness = 15,
}, },
Children = new [] Children = new[]
{ {
new Box new Box
{ {

View File

@ -282,7 +282,7 @@ namespace osu.Game.Screens.Menu
public ButtonState State public ButtonState State
{ {
get{ return state; } get { return state; }
set set
{ {

View File

@ -192,10 +192,8 @@ namespace osu.Game.Screens.Menu
public MenuState State public MenuState State
{ {
get get { return state; }
{
return state;
}
set set
{ {
if (state == value) return; if (state == value) return;

View File

@ -68,7 +68,7 @@ namespace osu.Game.Screens.Multiplayer
}, },
avatar = new UpdateableAvatar avatar = new UpdateableAvatar
{ {
Size = new Vector2(Height - content_padding* 2), Size = new Vector2(Height - content_padding * 2),
Masking = true, Masking = true,
CornerRadius = 5f, CornerRadius = 5f,
Margin = new MarginPadding { Left = content_padding * 2, Top = content_padding }, Margin = new MarginPadding { Left = content_padding * 2, Top = content_padding },

View File

@ -54,7 +54,6 @@ namespace osu.Game.Screens.Play.HUD
{ {
AutoSizeAxes = Axes.Both, AutoSizeAxes = Axes.Both,
Scale = new Vector2(0.6f), Scale = new Vector2(0.6f),
}); });
} }

View File

@ -79,7 +79,7 @@ namespace osu.Game.Screens.Play.ReplaySettings
{ {
Origin = Anchor.Centre, Origin = Anchor.Centre,
Anchor = Anchor.CentreRight, Anchor = Anchor.CentreRight,
Position = new Vector2(-15,0), Position = new Vector2(-15, 0),
Icon = FontAwesome.fa_bars, Icon = FontAwesome.fa_bars,
Scale = new Vector2(0.75f), Scale = new Vector2(0.75f),
Action = toggleContentVisibility, Action = toggleContentVisibility,

View File

@ -232,7 +232,7 @@ namespace osu.Game.Screens.Play
AutoSizeAxes = Axes.Both, AutoSizeAxes = Axes.Both,
Origin = Anchor.Centre, Origin = Anchor.Centre,
Direction = FillDirection.Horizontal, Direction = FillDirection.Horizontal,
Children = new [] Children = new[]
{ {
new TextAwesome { Icon = FontAwesome.fa_chevron_right }, new TextAwesome { Icon = FontAwesome.fa_chevron_right },
new TextAwesome { Icon = FontAwesome.fa_chevron_right }, new TextAwesome { Icon = FontAwesome.fa_chevron_right },

View File

@ -146,7 +146,7 @@ namespace osu.Game.Screens.Play
double progress = ((audioClock?.CurrentTime ?? Time.Current) - firstHitTime) / (lastHitTime - firstHitTime); double progress = ((audioClock?.CurrentTime ?? Time.Current) - firstHitTime) / (lastHitTime - firstHitTime);
if(progress < 1) if (progress < 1)
{ {
bar.UpdatePosition((float)progress); bar.UpdatePosition((float)progress);
graph.Progress = (int)(graph.ColumnCount * progress); graph.Progress = (int)(graph.ColumnCount * progress);

View File

@ -34,7 +34,7 @@ namespace osu.Game.Screens.Play
{ {
IHasEndTime end = h as IHasEndTime; IHasEndTime end = h as IHasEndTime;
int startRange = (int)((h.StartTime - firstHit)/ interval); int startRange = (int)((h.StartTime - firstHit) / interval);
int endRange = (int)(((end?.EndTime > 0 ? end.EndTime : h.StartTime) - firstHit) / interval); int endRange = (int)(((end?.EndTime > 0 ? end.EndTime : h.StartTime) - firstHit) / interval);
for (int i = startRange; i <= endRange; i++) for (int i = startRange; i <= endRange; i++)
values[i]++; values[i]++;

View File

@ -71,7 +71,6 @@ namespace osu.Game.Screens.Ranking
using (BeginDelayedSequence(transition_time * 0.25f, true)) using (BeginDelayedSequence(transition_time * 0.25f, true))
{ {
circleOuter.ScaleTo(1, transition_time, EasingTypes.OutQuint); circleOuter.ScaleTo(1, transition_time, EasingTypes.OutQuint);
circleOuter.FadeTo(1, transition_time, EasingTypes.OutQuint); circleOuter.FadeTo(1, transition_time, EasingTypes.OutQuint);

View File

@ -64,7 +64,8 @@ namespace osu.Game.Screens.Ranking
Origin = Anchor.Centre, Origin = Anchor.Centre,
Children = new Drawable[] Children = new Drawable[]
{ {
new Box{ new Box
{
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Alpha = 0, Alpha = 0,
AlwaysPresent = true AlwaysPresent = true
@ -87,6 +88,5 @@ namespace osu.Game.Screens.Ranking
} }
}); });
} }
} }
} }

View File

@ -335,7 +335,6 @@ namespace osu.Game.Screens.Tournament
{ {
Logger.Error(ex, "Failed to read last drawings results."); Logger.Error(ex, "Failed to read last drawings results.");
} }
} }
else else
{ {

View File

@ -48,7 +48,7 @@ namespace osu.Game.Users
public override string Message => @"Solo Game"; public override string Message => @"Solo Game";
} }
public class UserStatusMultiplayerGame: UserStatusBusy public class UserStatusMultiplayerGame : UserStatusBusy
{ {
public override string Message => @"Multiplaying"; public override string Message => @"Multiplaying";
} }