1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-21 00:12:59 +08:00

Merge branch 'master' into replay

# Conflicts:
#	osu.Desktop.VisualTests/Tests/TestCasePlayer.cs
This commit is contained in:
Dean Herbert 2017-03-05 17:45:03 +09:00
commit 4e4408cd20
96 changed files with 217 additions and 265 deletions

@ -1 +1 @@
Subproject commit 7193ee4f91e8cec88e872fc4950748138b0c87a6
Subproject commit 169f0a758c6b565ee42832f99bf4b5303f4413a6

View File

@ -1,17 +1,13 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Graphics;
using osu.Framework.Screens.Testing;
using osu.Game.Graphics;
using osu.Game.Overlays;
using osu.Game.Screens.Select.Options;
namespace osu.Desktop.VisualTests
{
class TestCaseBeatmapOptionsOverlay : TestCase
{
public override string Name => @"Beatmap Options";
public override string Description => @"Beatmap options in song select";
public override void Reset()

View File

@ -12,7 +12,6 @@ namespace osu.Desktop.VisualTests.Tests
{
private ScheduledDelegate messageRequest;
public override string Name => @"Chat";
public override string Description => @"Testing chat api and overlay";
public override void Reset()

View File

@ -1,7 +1,6 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Graphics;
using osu.Framework.Screens.Testing;
using osu.Game.Graphics;
using osu.Game.Overlays;
@ -11,7 +10,6 @@ namespace osu.Desktop.VisualTests.Tests
{
class TestCaseDialogOverlay : TestCase
{
public override string Name => @"Dialog Overlay";
public override string Description => @"Display dialogs";
DialogOverlay overlay;

View File

@ -12,7 +12,6 @@ namespace osu.Desktop.VisualTests.Tests
{
class TestCaseDrawings : TestCase
{
public override string Name => @"Drawings";
public override string Description => "Tournament drawings";
[BackgroundDependencyLoader]

View File

@ -20,8 +20,6 @@ namespace osu.Desktop.VisualTests.Tests
{
class TestCaseGamefield : TestCase
{
public override string Name => @"Gamefield";
public override string Description => @"Showing hitobjects and what not.";
public override void Reset()

View File

@ -19,8 +19,6 @@ namespace osu.Desktop.VisualTests.Tests
{
class TestCaseHitObjects : TestCase
{
public override string Name => @"Hit Objects";
private StopwatchClock rateAdjustClock;
private FramedClock framedClock;

View File

@ -17,8 +17,6 @@ namespace osu.Desktop.VisualTests.Tests
{
class TestCaseKeyCounter : TestCase
{
public override string Name => @"KeyCounter";
public override string Description => @"Tests key counter";
public override void Reset()
@ -32,10 +30,10 @@ namespace osu.Desktop.VisualTests.Tests
IsCounting = true,
Children = new KeyCounter[]
{
new KeyCounterKeyboard(@"Z", Key.Z),
new KeyCounterKeyboard(@"X", Key.X),
new KeyCounterMouse(@"M1", MouseButton.Left),
new KeyCounterMouse(@"M2", MouseButton.Right),
new KeyCounterKeyboard(Key.Z),
new KeyCounterKeyboard(Key.X),
new KeyCounterMouse(MouseButton.Left),
new KeyCounterMouse(MouseButton.Right),
},
};
BindableInt bindable = new BindableInt { MinValue = 0, MaxValue = 200, Default = 50 };
@ -43,7 +41,7 @@ namespace osu.Desktop.VisualTests.Tests
AddButton("Add Random", () =>
{
Key key = (Key)((int)Key.A + RNG.Next(26));
kc.Add(new KeyCounterKeyboard(key.ToString(), key));
kc.Add(new KeyCounterKeyboard(key));
});
ButtonsContainer.Add(new SpriteText { Text = "FadeTime" });
ButtonsContainer.Add(new TestSliderBar<int>

View File

@ -11,7 +11,6 @@ namespace osu.Desktop.VisualTests.Tests
{
class TestCaseMenuButtonSystem : TestCase
{
public override string Name => @"ButtonSystem";
public override string Description => @"Main menu button system";
public override void Reset()

View File

@ -5,16 +5,11 @@ using osu.Framework.Graphics;
using osu.Game.Overlays.Mods;
using osu.Framework.Screens.Testing;
using osu.Game.Modes;
using osu.Game.Graphics;
using osu.Framework.Allocation;
using osu.Game.Overlays;
namespace osu.Desktop.VisualTests.Tests
{
class TestCaseModSelectOverlay : TestCase
{
public override string Name => @"Mod Select";
public override string Description => @"Tests the mod select overlay";
private ModSelectOverlay modSelect;

View File

@ -11,7 +11,6 @@ namespace osu.Desktop.VisualTests.Tests
{
class TestCaseMusicController : TestCase
{
public override string Name => @"Music Controller";
public override string Description => @"Tests music controller ui.";
private MusicController mc;

View File

@ -14,7 +14,6 @@ namespace osu.Desktop.VisualTests.Tests
{
class TestCaseNotificationManager : TestCase
{
public override string Name => @"Notification Manager";
public override string Description => @"I handle notifications";
NotificationManager manager;

View File

@ -8,8 +8,6 @@ namespace osu.Desktop.VisualTests.Tests
{
class TestCaseOptions : TestCase
{
public override string Name => @"Options";
public override string Description => @"Tests the options overlay";
private OptionsOverlay options;

View File

@ -9,8 +9,6 @@ namespace osu.Desktop.VisualTests.Tests
{
class TestCasePauseOverlay : TestCase
{
public override string Name => @"PauseOverlay";
public override string Description => @"Tests the pause overlay";
private PauseOverlay pauseOverlay;

View File

@ -1,7 +1,6 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
using System.Collections.Generic;
using osu.Desktop.VisualTests.Platform;
using osu.Framework.Screens.Testing;
@ -18,7 +17,6 @@ namespace osu.Desktop.VisualTests.Tests
private TestStorage storage;
private PlaySongSelect songSelect;
public override string Name => @"Song Select";
public override string Description => @"with fake data";
public override void Reset()

View File

@ -23,7 +23,6 @@ namespace osu.Desktop.VisualTests.Tests
protected Player Player;
private BeatmapDatabase db;
public override string Name => @"Player";
public override string Description => @"Showing everything to play the game.";

View File

@ -42,8 +42,6 @@ namespace osu.Desktop.VisualTests.Tests
private Func<Stream> getReplayStream;
private ScoreDatabase scoreDatabase;
public override string Name => @"Replay";
public override string Description => @"Testing replay playback.";
[BackgroundDependencyLoader]

View File

@ -20,8 +20,6 @@ namespace osu.Desktop.VisualTests.Tests
{
class TestCaseScoreCounter : TestCase
{
public override string Name => @"ScoreCounter";
public override string Description => @"Tests multiple counters";
public override void Reset()

View File

@ -14,8 +14,6 @@ namespace osu.Desktop.VisualTests.Tests
{
class TestCaseTextAwesome : TestCase
{
public override string Name => @"TextAwesome";
public override string Description => @"Tests display of icons";
public override void Reset()

View File

@ -9,7 +9,6 @@ namespace osu.Desktop.VisualTests.Tests
{
class TestCaseTwoLayerButton : TestCase
{
public override string Name => @"TwoLayerButton";
public override string Description => @"Back and skip and what not";
public override void Reset()

View File

@ -61,13 +61,13 @@ namespace osu.Desktop.Overlays
new FillFlowContainer
{
AutoSizeAxes = Axes.Both,
Direction = FillDirection.Down,
Direction = FillDirection.Vertical,
Children = new Drawable[]
{
new FillFlowContainer
{
AutoSizeAxes = Axes.Both,
Direction = FillDirection.Right,
Direction = FillDirection.Horizontal,
Spacing = new Vector2(5),
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,

View File

@ -17,7 +17,8 @@
</metadata>
<files>
<file src="*.exe" target="lib\net45\" exclude="**vshost**"/>
<file src="*.dll" target="lib\net45\"/>
<file src="*.dll" target="lib\net45\"/>
<file src="*.config" target="lib\net45\"/>
<file src="x86\*.dll" target="lib\net45\x86\"/>
<file src="x64\*.dll" target="lib\net45\x64\"/>
</files>

View File

@ -3,11 +3,11 @@
using OpenTK;
using OpenTK.Graphics;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Transforms;
using osu.Game.Graphics;
namespace osu.Game.Modes.Osu.Objects.Drawables.Connections
{

View File

@ -25,7 +25,7 @@ namespace osu.Game.Modes.Osu.Objects.Drawables
AutoSizeAxes = Axes.Both;
Origin = Anchor.Centre;
Direction = FillDirection.Down;
Direction = FillDirection.Vertical;
Spacing = new Vector2(0, 2);
Position = (h?.StackedEndPosition ?? Vector2.Zero) + judgement.PositionOffset;

View File

@ -1,10 +1,10 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using OpenTK.Graphics;

View File

@ -4,6 +4,7 @@
using System;
using System.Linq;
using osu.Framework.Allocation;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Colour;
using osu.Framework.Graphics.Containers;

View File

@ -12,6 +12,7 @@ namespace osu.Game.Modes.Osu
: base(hitObjectCount)
{
Health.Value = 1;
Accuracy.Value = 1;
}
protected override void UpdateCalculations(JudgementInfo judgement)

View File

@ -46,10 +46,10 @@ namespace osu.Game.Modes.Osu.UI
Margin = new MarginPadding(10),
Children = new KeyCounter[]
{
new KeyCounterKeyboard(@"Z", Key.Z),
new KeyCounterKeyboard(@"X", Key.X),
new KeyCounterMouse(@"M1", MouseButton.Left),
new KeyCounterMouse(@"M2", MouseButton.Right),
new KeyCounterKeyboard(Key.Z),
new KeyCounterKeyboard(Key.X),
new KeyCounterMouse(MouseButton.Left),
new KeyCounterMouse(MouseButton.Right),
}
};
}

View File

@ -86,7 +86,7 @@ namespace osu.Game.Beatmaps.Drawables
new FillFlowContainer
{
Padding = new MarginPadding(5),
Direction = FillDirection.Right,
Direction = FillDirection.Horizontal,
AutoSizeAxes = Axes.Both,
Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft,
@ -95,19 +95,17 @@ namespace osu.Game.Beatmaps.Drawables
new DifficultyIcon(beatmap)
{
Scale = new Vector2(1.8f),
Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft,
},
new FillFlowContainer
{
Padding = new MarginPadding { Left = 5 },
Direction = FillDirection.Down,
Direction = FillDirection.Vertical,
AutoSizeAxes = Axes.Both,
Children = new Drawable[]
{
new FillFlowContainer
{
Direction = FillDirection.Right,
Direction = FillDirection.Horizontal,
Spacing = new Vector2(4, 0),
AutoSizeAxes = Axes.Both,
Children = new[]

View File

@ -38,7 +38,7 @@ namespace osu.Game.Beatmaps.Drawables
},
new FillFlowContainer
{
Direction = FillDirection.Down,
Direction = FillDirection.Vertical,
Padding = new MarginPadding { Top = 5, Left = 18, Right = 10, Bottom = 10 },
AutoSizeAxes = Axes.Both,
Children = new[]
@ -111,7 +111,7 @@ namespace osu.Game.Beatmaps.Drawables
new FillFlowContainer
{
Depth = -1,
Direction = FillDirection.Right,
Direction = FillDirection.Horizontal,
RelativeSizeAxes = Axes.Both,
// This makes the gradient not be perfectly horizontal, but diagonal at a ~40° angle
Shear = new Vector2(0.8f, 0),

View File

@ -8,7 +8,7 @@ using osu.Framework.Graphics.Transforms;
using osu.Framework.Input;
using OpenTK;
using OpenTK.Graphics;
using osu.Game.Graphics;
using osu.Framework.Extensions.Color4Extensions;
namespace osu.Game.Beatmaps.Drawables
{
@ -18,10 +18,6 @@ namespace osu.Game.Beatmaps.Drawables
public override bool RemoveWhenNotAlive => false;
public bool IsOnScreen;
public override bool IsAlive => IsOnScreen && base.IsAlive;
private Container nestedContainer;
protected override Container<Drawable> Content => nestedContainer;

View File

@ -5,11 +5,11 @@ using OpenTK;
using OpenTK.Graphics;
using osu.Framework.Allocation;
using osu.Framework.Configuration;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Cursor;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Textures;
using osu.Framework.Graphics.Transforms;
using osu.Framework.Input;
using osu.Game.Configuration;

View File

@ -6,12 +6,6 @@ using OpenTK.Graphics;
namespace osu.Game.Graphics
{
public static class OsuColourExtensions
{
public static Color4 Opacity(this Color4 color, float a) => new Color4(color.R, color.G, color.B, a);
public static Color4 Opacity(this Color4 color, byte a) => new Color4(color.R, color.G, color.B, a / 255f);
}
public class OsuColour
{
public static Color4 Gray(float amt) => new Color4(amt, amt, amt, 1f);

View File

@ -9,9 +9,9 @@ using osu.Framework.Graphics.Colour;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Containers;
using osu.Framework.Audio.Sample;
using osu.Game.Graphics;
using osu.Game.Graphics.Backgrounds;
using osu.Game.Graphics.Sprites;
using osu.Framework.Extensions.Color4Extensions;
namespace osu.Game.Graphics.UserInterface
{

View File

@ -3,6 +3,7 @@
using OpenTK.Graphics;
using osu.Framework.Allocation;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Transforms;

View File

@ -8,6 +8,7 @@ using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.UserInterface;
using osu.Game.Graphics.Sprites;
using OpenTK.Graphics;
using osu.Framework.Extensions.Color4Extensions;
namespace osu.Game.Graphics.UserInterface
{

View File

@ -7,6 +7,7 @@ using osu.Framework.Graphics.Transforms;
using osu.Framework.Graphics.UserInterface;
using OpenTK;
using OpenTK.Graphics;
using osu.Framework.Extensions.Color4Extensions;
namespace osu.Game.Graphics.UserInterface
{

View File

@ -2,6 +2,7 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Allocation;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Primitives;
@ -21,7 +22,7 @@ namespace osu.Game.Graphics.UserInterface
{
new FillFlowContainer
{
Direction = FillDirection.Right,
Direction = FillDirection.Horizontal,
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Children = new Drawable[]

View File

@ -9,6 +9,7 @@ using osu.Framework.Graphics.UserInterface;
using osu.Framework.Input;
using osu.Game.Graphics.Sprites;
using OpenTK.Graphics;
using osu.Framework.Extensions.Color4Extensions;
namespace osu.Game.Graphics.UserInterface
{

View File

@ -26,7 +26,7 @@ namespace osu.Game.Graphics.UserInterface
public PercentageCounter()
{
DisplayedCountSpriteText.FixedWidth = true;
Count = 1.0f;
Count = DisplayedCount = 1.0f;
}
protected override string FormatCount(float count)

View File

@ -71,7 +71,7 @@ namespace osu.Game.Graphics.UserInterface
stars = new FillFlowContainer<Star>
{
AutoSizeAxes = Axes.Both,
Direction = FillDirection.Right,
Direction = FillDirection.Horizontal,
Spacing = new Vector2(star_spacing),
}
};

View File

@ -4,13 +4,13 @@
using osu.Framework.Audio.Sample;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Primitives;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Transforms;
using osu.Framework.Input;
using OpenTK;
using OpenTK.Graphics;
using osu.Game.Graphics.Sprites;
using osu.Framework.Extensions.Color4Extensions;
namespace osu.Game.Graphics.UserInterface
{

View File

@ -9,7 +9,6 @@ using System.Collections.Concurrent;
using osu.Framework.Input;
using osu.Game.Beatmaps;
using osu.Game.Graphics;
using osu.Game.Overlays.Mods;
namespace osu.Game.Modes
{

View File

@ -4,6 +4,7 @@
using System;
using osu.Framework.Allocation;
using osu.Framework.Configuration;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;

View File

@ -41,7 +41,7 @@ namespace osu.Game.Online.Chat.Drawables
{
flow = new FillFlowContainer
{
Direction = FillDirection.Down,
Direction = FillDirection.Vertical,
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Padding = new MarginPadding { Left = 20, Right = 20 }

View File

@ -3,6 +3,7 @@
using System.Collections.Generic;
using System.Linq;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Primitives;
@ -173,7 +174,7 @@ namespace osu.Game.Overlays.Dialog
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Position = new Vector2(0f, -50f),
Direction = FillDirection.Down,
Direction = FillDirection.Vertical,
Spacing = new Vector2(0f, 10f),
Children = new Drawable[]
{
@ -236,7 +237,7 @@ namespace osu.Game.Overlays.Dialog
Origin = Anchor.TopCentre,
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Direction = FillDirection.Down,
Direction = FillDirection.Vertical,
},
},
},

View File

@ -1,8 +1,6 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Allocation;
using osu.Framework.Audio;
using osu.Game.Graphics;
using osu.Game.Graphics.UserInterface;

View File

@ -1,11 +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 osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Transforms;
using osu.Game.Graphics;
using osu.Game.Overlays.Dialog;
using OpenTK.Graphics;

View File

@ -236,7 +236,7 @@ namespace osu.Game.Overlays.Mods
public ModButton(Mod m)
{
Direction = FillDirection.Down;
Direction = FillDirection.Vertical;
Spacing = new Vector2(0f, -5f);
Size = new Vector2(100f);

View File

@ -2,7 +2,6 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
using System.Linq;
using System.Collections.Generic;
using OpenTK;
using OpenTK.Graphics;

View File

@ -7,6 +7,7 @@ using System.Collections.Generic;
using OpenTK;
using OpenTK.Graphics;
using osu.Framework.Configuration;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Primitives;
@ -240,7 +241,7 @@ namespace osu.Game.Overlays.Mods
AutoSizeAxes = Axes.Y,
Anchor = Anchor.BottomCentre,
Origin = Anchor.BottomCentre,
Direction = FillDirection.Down,
Direction = FillDirection.Vertical,
Spacing = new Vector2(0f, 10f),
Children = new Drawable[]
{
@ -264,7 +265,7 @@ namespace osu.Game.Overlays.Mods
Anchor = Anchor.TopCentre,
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Direction = FillDirection.Down,
Direction = FillDirection.Vertical,
Width = content_width,
Padding = new MarginPadding
{
@ -332,7 +333,7 @@ namespace osu.Game.Overlays.Mods
AutoSizeAxes = Axes.Y,
RelativeSizeAxes = Axes.X,
Width = content_width,
Direction = FillDirection.Right,
Direction = FillDirection.Horizontal,
Padding = new MarginPadding
{
Top = 20,

View File

@ -7,7 +7,6 @@ using System.Threading.Tasks;
using OpenTK;
using OpenTK.Graphics;
using osu.Framework.Allocation;
using osu.Framework.Audio;
using osu.Framework.Audio.Track;
using osu.Framework.Configuration;
using osu.Framework.Graphics;
@ -23,6 +22,7 @@ using osu.Game.Database;
using osu.Game.Graphics;
using osu.Framework.Graphics.Primitives;
using osu.Game.Graphics.Sprites;
using osu.Framework.Extensions.Color4Extensions;
namespace osu.Game.Overlays
{

View File

@ -9,7 +9,6 @@ using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Primitives;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Transforms;
using osu.Game.Graphics;
using osu.Game.Overlays.Notifications;
using OpenTK.Graphics;
@ -46,7 +45,7 @@ namespace osu.Game.Overlays
{
sections = new FillFlowContainer<NotificationSection>
{
Direction = FillDirection.Down,
Direction = FillDirection.Vertical,
AutoSizeAxes = Axes.Y,
RelativeSizeAxes = Axes.X,
Children = new []

View File

@ -3,6 +3,7 @@
using System;
using osu.Framework.Allocation;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Colour;
using osu.Framework.Graphics.Containers;

View File

@ -60,7 +60,7 @@ namespace osu.Game.Overlays.Notifications
{
RelativeSizeAxes = Axes.X;
AutoSizeAxes = Axes.Y;
Direction = FillDirection.Down;
Direction = FillDirection.Vertical;
Padding = new MarginPadding
{

View File

@ -89,7 +89,7 @@ namespace osu.Game.Overlays.Options
{
Items = new KeyValuePair<string, T>[0];
Direction = FillDirection.Down;
Direction = FillDirection.Vertical;
RelativeSizeAxes = Axes.X;
AutoSizeAxes = Axes.Y;
Children = new Drawable[]

View File

@ -61,7 +61,7 @@ namespace osu.Game.Overlays.Options
FlowContent = new FillFlowContainer
{
Margin = new MarginPadding { Top = header_size + header_margin },
Direction = FillDirection.Down,
Direction = FillDirection.Vertical,
Spacing = new Vector2(0, 30),
AutoSizeAxes = Axes.Y,
RelativeSizeAxes = Axes.X,

View File

@ -20,7 +20,7 @@ namespace osu.Game.Overlays.Options
{
RelativeSizeAxes = Axes.X;
AutoSizeAxes = Axes.Y;
Direction = FillDirection.Down;
Direction = FillDirection.Vertical;
AddInternal(new Drawable[]
{
new OsuSpriteText
@ -31,7 +31,7 @@ namespace osu.Game.Overlays.Options
},
content = new FillFlowContainer
{
Direction = FillDirection.Down,
Direction = FillDirection.Vertical,
Spacing = new Vector2(0, 5),
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,

View File

@ -6,7 +6,6 @@ using System.Runtime;
using osu.Framework.Allocation;
using osu.Framework.Configuration;
using osu.Framework.Graphics;
using osu.Game.Configuration;
using osu.Game.Graphics.UserInterface;
namespace osu.Game.Overlays.Options.Sections.Debug

View File

@ -7,7 +7,6 @@ using osu.Game.Configuration;
using osu.Game.Graphics;
using osu.Game.Graphics.UserInterface;
using OpenTK;
using osu.Framework.Graphics.Containers;
namespace osu.Game.Overlays.Options.Sections
{

View File

@ -100,7 +100,7 @@ namespace osu.Game.Overlays.Options.Sections.General
private void load(APIAccess api, OsuConfigManager config)
{
this.api = api;
Direction = FillDirection.Down;
Direction = FillDirection.Vertical;
Spacing = new Vector2(0, 5);
AutoSizeAxes = Axes.Y;
RelativeSizeAxes = Axes.X;

View File

@ -39,12 +39,20 @@ namespace osu.Game.Overlays.Options.Sections
RelativeSizeAxes = Axes.X,
Text = "Run osu! updater",
},
new OptionLabel
new Container
{
Text = "TODO: osu version here",
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
},
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Children = new[]
{
new OptionLabel
{
Text = "osu!lazer",
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
},
}
}
};
}
}

View File

@ -8,7 +8,6 @@ using osu.Game.Configuration;
using osu.Game.Graphics;
using osu.Game.Graphics.UserInterface;
using OpenTK;
using osu.Framework.Graphics.Containers;
namespace osu.Game.Overlays.Options.Sections
{

View File

@ -40,7 +40,7 @@ namespace osu.Game.Overlays.Options
Anchor = Anchor.CentreLeft,
AutoSizeAxes = Axes.Y,
RelativeSizeAxes = Axes.X,
Direction = FillDirection.Down,
Direction = FillDirection.Vertical,
}
}
},

View File

@ -77,7 +77,7 @@ namespace osu.Game.Overlays
{
AutoSizeAxes = Axes.Y,
RelativeSizeAxes = Axes.X,
Direction = FillDirection.Down,
Direction = FillDirection.Vertical,
Children = new Drawable[]
{
@ -98,7 +98,7 @@ namespace osu.Game.Overlays
{
AutoSizeAxes = Axes.Y,
RelativeSizeAxes = Axes.X,
Direction = FillDirection.Down,
Direction = FillDirection.Vertical,
Children = sections,
}
}

View File

@ -2,6 +2,7 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Colour;
using osu.Framework.Graphics.Containers;
@ -43,7 +44,7 @@ namespace osu.Game.Overlays.Toolbar
new ToolbarBackground(),
new FillFlowContainer
{
Direction = FillDirection.Right,
Direction = FillDirection.Horizontal,
RelativeSizeAxes = Axes.Y,
AutoSizeAxes = Axes.X,
Children = new Drawable[]
@ -66,7 +67,7 @@ namespace osu.Game.Overlays.Toolbar
{
Anchor = Anchor.TopRight,
Origin = Anchor.TopRight,
Direction = FillDirection.Right,
Direction = FillDirection.Horizontal,
RelativeSizeAxes = Axes.Y,
AutoSizeAxes = Axes.X,
Children = new Drawable[]

View File

@ -5,6 +5,7 @@ using System;
using osu.Framework.Allocation;
using osu.Framework.Audio;
using osu.Framework.Audio.Sample;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Primitives;
@ -84,7 +85,7 @@ namespace osu.Game.Overlays.Toolbar
},
Flow = new FillFlowContainer
{
Direction = FillDirection.Right,
Direction = FillDirection.Horizontal,
Spacing = new Vector2(5),
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
@ -107,7 +108,7 @@ namespace osu.Game.Overlays.Toolbar
},
tooltipContainer = new FillFlowContainer
{
Direction = FillDirection.Down,
Direction = FillDirection.Vertical,
RelativeSizeAxes = Axes.Both, //stops us being considered in parent's autosize
Anchor = (TooltipAnchor & Anchor.x0) > 0 ? Anchor.BottomLeft : Anchor.BottomRight,
Origin = TooltipAnchor,

View File

@ -36,7 +36,7 @@ namespace osu.Game.Overlays.Toolbar
{
RelativeSizeAxes = Axes.Y,
AutoSizeAxes = Axes.X,
Direction = FillDirection.Right,
Direction = FillDirection.Horizontal,
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
Padding = new MarginPadding { Left = padding, Right = padding },

View File

@ -1,6 +1,7 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;

View File

@ -3,6 +3,7 @@
using System.Diagnostics;
using osu.Framework.Allocation;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;
@ -10,7 +11,6 @@ using osu.Framework.Graphics.Textures;
using osu.Game.Online.API;
using OpenTK;
using OpenTK.Graphics;
using osu.Game.Graphics;
namespace osu.Game.Overlays.Toolbar
{

View File

@ -3,12 +3,12 @@
using osu.Framework;
using OpenTK.Graphics;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics.Containers;
using osu.Game.Graphics;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Sprites;
using OpenTK;
using osu.Framework.Graphics.Transforms;
using System;
namespace osu.Game.Overlays
{
@ -86,9 +86,10 @@ namespace osu.Game.Overlays
AddInternal(wavesContainer = new Container<Wave>
{
RelativeSizeAxes = Axes.Both,
RelativeSizeAxes = Axes.X,
Origin = Anchor.TopCentre,
Anchor = Anchor.TopCentre,
Masking = true,
Children = new[]
{
firstWave = new Wave
@ -152,14 +153,23 @@ namespace osu.Game.Overlays
FadeOut(DISAPPEAR_DURATION, EasingTypes.InQuint);
}
protected override void UpdateAfterChildren()
{
base.UpdateAfterChildren();
// This is done as an optimization, such that invisible parts of the waves
// are masked away, and thus do not consume fill rate.
wavesContainer.Height = Math.Max(0, DrawHeight - (contentContainer.DrawHeight - contentContainer.Y));
}
private class Wave : Container, IStateful<Visibility>
{
public float FinalPosition;
public Wave()
{
RelativeSizeAxes = Axes.Both;
Size = new Vector2(1.5f);
RelativeSizeAxes = Axes.X;
Width = 1.5f;
Masking = true;
EdgeEffect = new EdgeEffect
{
@ -177,6 +187,15 @@ namespace osu.Game.Overlays
};
}
protected override void Update()
{
base.Update();
// We can not use RelativeSizeAxes for Height, because the height
// of our parent diminishes as the content moves up.
Height = Parent.Parent.DrawSize.Y * 1.5f;
}
private Visibility state;
public Visibility State
{
@ -188,7 +207,7 @@ namespace osu.Game.Overlays
switch (value)
{
case Visibility.Hidden:
MoveToY(DrawHeight / Height, DISAPPEAR_DURATION, easing_hide);
MoveToY(Parent.Parent.DrawSize.Y, DISAPPEAR_DURATION, easing_hide);
break;
case Visibility.Visible:
MoveToY(FinalPosition, APPEAR_DURATION, easing_show);

View File

@ -126,7 +126,7 @@ namespace osu.Game.Screens
},
childModeButtons = new FillFlowContainer
{
Direction = FillDirection.Down,
Direction = FillDirection.Vertical,
Anchor = Anchor.TopRight,
Origin = Anchor.TopRight,
RelativeSizeAxes = Axes.Both,

View File

@ -16,6 +16,7 @@ using osu.Game.Graphics.Sprites;
using OpenTK;
using OpenTK.Graphics;
using OpenTK.Input;
using osu.Framework.Extensions.Color4Extensions;
namespace osu.Game.Screens.Menu
{

View File

@ -6,7 +6,6 @@ using System.Collections.Generic;
using System.Linq;
using osu.Framework;
using osu.Framework.Allocation;
using osu.Framework.Audio;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;
@ -78,7 +77,7 @@ namespace osu.Game.Screens.Menu
},
buttonFlow = new FlowContainerWithOrigin
{
Direction = FillDirection.Right,
Direction = FillDirection.Horizontal,
Spacing = new Vector2(-WEDGE_WIDTH, 0),
Anchor = Anchor.Centre,
AutoSizeAxes = Axes.Both,

View File

@ -32,7 +32,7 @@ namespace osu.Game.Screens.Menu
AutoSizeAxes = Axes.Both,
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Direction = FillDirection.Down,
Direction = FillDirection.Vertical,
Spacing = new Vector2(0, 2),
Children = new Drawable[]
{

View File

@ -22,7 +22,6 @@ namespace osu.Game.Screens.Menu
public class MainMenu : OsuScreen
{
private ButtonSystem buttons;
public override string Name => @"Main Menu";
internal override bool ShowOverlays => buttons.State != MenuState.Initial;

View File

@ -19,7 +19,6 @@ namespace osu.Game.Screens.Play
private Container textLayer;
private SpriteText countSpriteText;
public override string Name { get; }
public bool IsCounting { get; set; }
private int count;
public int Count

View File

@ -12,7 +12,7 @@ namespace osu.Game.Screens.Play
{
public KeyCounterCollection()
{
Direction = FillDirection.Right;
Direction = FillDirection.Horizontal;
AutoSizeAxes = Axes.Both;
}

View File

@ -9,7 +9,7 @@ namespace osu.Game.Screens.Play
public class KeyCounterKeyboard : KeyCounter
{
public Key Key { get; }
public KeyCounterKeyboard(string name, Key key) : base(name)
public KeyCounterKeyboard(Key key) : base(key.ToString())
{
Key = key;
}

View File

@ -10,7 +10,7 @@ namespace osu.Game.Screens.Play
public class KeyCounterMouse : KeyCounter
{
public MouseButton Button { get; }
public KeyCounterMouse(string name, MouseButton button) : base(name)
public KeyCounterMouse(MouseButton button) : base(button.ToString())
{
Button = button;
}

View File

@ -3,6 +3,7 @@
using System;
using osu.Framework.Allocation;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;
@ -105,7 +106,7 @@ namespace osu.Game.Screens.Play
{
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Direction = FillDirection.Down,
Direction = FillDirection.Vertical,
Spacing = new Vector2(0, 50),
Origin = Anchor.Centre,
Anchor = Anchor.Centre,
@ -113,11 +114,12 @@ namespace osu.Game.Screens.Play
{
new FillFlowContainer
{
AutoSizeAxes = Axes.Both,
Direction = FillDirection.Down,
Spacing = new Vector2(0, 20),
Origin = Anchor.TopCentre,
Anchor = Anchor.TopCentre,
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Direction = FillDirection.Vertical,
Spacing = new Vector2(0, 20),
Children = new Drawable[]
{
new OsuSpriteText
@ -144,6 +146,8 @@ namespace osu.Game.Screens.Play
},
new FillFlowContainer
{
Origin = Anchor.TopCentre,
Anchor = Anchor.TopCentre,
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Masking = true,
@ -188,9 +192,9 @@ namespace osu.Game.Screens.Play
},
retryCounterContainer = new FillFlowContainer
{
AutoSizeAxes = Axes.Both,
Origin = Anchor.TopCentre,
Anchor = Anchor.TopCentre
Anchor = Anchor.TopCentre,
AutoSizeAxes = Axes.Both,
}
}
},

View File

@ -136,7 +136,7 @@ namespace osu.Game.Screens.Play
AutoSizeAxes = Axes.Both,
Origin = Anchor.TopCentre,
Anchor = Anchor.TopCentre,
Direction = FillDirection.Down,
Direction = FillDirection.Vertical,
Children = new Drawable[]
{
new OsuSpriteText

View File

@ -68,7 +68,7 @@ namespace osu.Game.Screens.Ranking
new FillFlowContainer
{
AutoSizeAxes = Axes.Both,
Direction = FillDirection.Down,
Direction = FillDirection.Vertical,
Children = new Drawable[]
{
new OsuSpriteText

View File

@ -1,7 +1,6 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
using osu.Framework.Allocation;
using osu.Game.Beatmaps;
using osu.Game.Database;

View File

@ -6,6 +6,7 @@ using System.Collections.Generic;
using osu.Framework.Allocation;
using OpenTK;
using OpenTK.Graphics;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Primitives;
@ -125,7 +126,7 @@ namespace osu.Game.Screens.Select
{
Anchor = Anchor.BottomLeft,
Origin = Anchor.BottomLeft,
Direction = FillDirection.Down,
Direction = FillDirection.Vertical,
Margin = new MarginPadding { Top = 10, Left = 25, Right = 10, Bottom = 20 },
AutoSizeAxes = Axes.Both,
Children = new Drawable[]
@ -147,7 +148,7 @@ namespace osu.Game.Screens.Select
new FillFlowContainer
{
Margin = new MarginPadding { Top = 10 },
Direction = FillDirection.Right,
Direction = FillDirection.Horizontal,
AutoSizeAxes = Axes.Both,
Children = new []
{

View File

@ -9,13 +9,12 @@ using osu.Game.Database;
using System;
using System.Collections.Generic;
using System.Linq;
using osu.Framework.Lists;
using osu.Game.Beatmaps.Drawables;
using osu.Framework.Timing;
using osu.Framework.Input;
using OpenTK.Input;
using System.Collections;
using osu.Framework.MathUtils;
using System.Diagnostics;
namespace osu.Game.Screens.Select
{
@ -23,73 +22,33 @@ namespace osu.Game.Screens.Select
{
private Container<Panel> scrollableContent;
private List<BeatmapGroup> groups = new List<BeatmapGroup>();
private List<Panel> panels = new List<Panel>();
public BeatmapGroup SelectedGroup { get; private set; }
public BeatmapPanel SelectedPanel { get; private set; }
private List<float> yPositions = new List<float>();
private CarouselLifetimeList<Panel> lifetime;
public CarouselContainer()
{
DistanceDecayJump = 0.01;
Add(scrollableContent = new Container<Panel>(lifetime = new CarouselLifetimeList<Panel>(DepthComparer))
Add(scrollableContent = new Container<Panel>
{
RelativeSizeAxes = Axes.X,
});
}
internal class CarouselLifetimeList<T> : LifetimeList<Panel>
{
public CarouselLifetimeList(IComparer<Panel> comparer)
: base(comparer)
{
}
public int StartIndex;
public int EndIndex;
public override bool Update(FrameTimeInfo time)
{
bool anyAliveChanged = false;
//check existing items to make sure they haven't died.
foreach (var item in AliveItems.ToArray())
{
item.UpdateTime(time);
if (!item.IsAlive)
{
//todo: make this more efficient
int i = IndexOf(item);
anyAliveChanged |= CheckItem(item, ref i);
}
}
//handle custom range
for (int i = StartIndex; i < EndIndex; i++)
{
var item = this[i];
item.UpdateTime(time);
anyAliveChanged |= CheckItem(item, ref i);
}
return anyAliveChanged;
}
}
public void AddGroup(BeatmapGroup group)
{
group.State = BeatmapGroupState.Collapsed;
groups.Add(group);
group.Header.Depth = -scrollableContent.Children.Count();
scrollableContent.Add(group.Header);
panels.Add(group.Header);
group.Header.UpdateClock(Clock);
foreach (BeatmapPanel panel in group.BeatmapPanels)
{
panel.Depth = -scrollableContent.Children.Count();
scrollableContent.Add(panel);
panels.Add(panel);
panel.UpdateClock(Clock);
}
computeYPositions();
@ -98,6 +57,9 @@ namespace osu.Game.Screens.Select
public void RemoveGroup(BeatmapGroup group)
{
groups.Remove(group);
foreach (var p in group.BeatmapPanels)
panels.Remove(p);
scrollableContent.Remove(group.Header);
scrollableContent.Remove(group.BeatmapPanels);
@ -107,7 +69,7 @@ namespace osu.Game.Screens.Select
private void movePanel(Panel panel, bool advance, bool animated, ref float currentY)
{
yPositions.Add(currentY);
panel.MoveToY(currentY, animated && (panel.IsOnScreen || panel.State != PanelSelectedState.Hidden) ? 750 : 0, EasingTypes.OutExpo);
panel.MoveToY(currentY, animated ? 750 : 0, EasingTypes.OutExpo);
if (advance)
currentY += panel.DrawHeight + 5;
@ -172,14 +134,16 @@ namespace osu.Game.Screens.Select
var panel = group.BeatmapPanels.FirstOrDefault(p => p.Beatmap.Equals(beatmap));
if (panel != null)
{
SelectGroup(group, panel, animated);
selectGroup(group, panel, animated);
return;
}
}
}
public void SelectGroup(BeatmapGroup group, BeatmapPanel panel, bool animated = true)
private void selectGroup(BeatmapGroup group, BeatmapPanel panel, bool animated = true)
{
Trace.Assert(group.BeatmapPanels.Contains(panel), @"Selected panel must be in provided group");
if (SelectedGroup != null && SelectedGroup != group && SelectedGroup.State != BeatmapGroupState.Hidden)
SelectedGroup.State = BeatmapGroupState.Collapsed;
@ -194,19 +158,20 @@ namespace osu.Game.Screens.Select
public void Sort(FilterControl.SortMode mode)
{
List<BeatmapGroup> sortedGroups = new List<BeatmapGroup>(groups);
switch (mode)
{
case FilterControl.SortMode.Artist:
groups.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));
break;
case FilterControl.SortMode.Title:
groups.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));
break;
case FilterControl.SortMode.Author:
groups.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));
break;
case FilterControl.SortMode.Difficulty:
groups.Sort((x, y) =>
sortedGroups.Sort((x, y) =>
{
float xAverage = 0, yAverage = 0;
int counter = 0;
@ -232,22 +197,23 @@ namespace osu.Game.Screens.Select
default:
throw new NotImplementedException();
}
scrollableContent.Clear(false);
lifetime.Clear();
foreach (BeatmapGroup group in groups)
{
group.Header.Depth = -scrollableContent.Children.Count();
scrollableContent.Add(group.Header);
foreach (BeatmapPanel panel in group.BeatmapPanels)
{
panel.Depth = -scrollableContent.Children.Count();
scrollableContent.Add(panel);
}
}
panels.Clear();
groups.Clear();
foreach (BeatmapGroup group in sortedGroups)
AddGroup(group);
}
/// <summary>
/// Computes the x-offset of currently visible panels. Makes the carousel appear round.
/// </summary>
/// <param name="dist">
/// Vertical distance from the center of the carousel container
/// ranging from -1 to 1.
/// </param>
/// <param name="halfHeight">Half the height of the carousel container.</param>
private static float offsetX(float dist, float halfHeight)
{
// The radius of the circle the carousel moves on.
@ -286,34 +252,46 @@ namespace osu.Game.Screens.Select
{
base.Update();
// Determine which items stopped being on screen for future removal from the lifetimelist.
float drawHeight = DrawHeight;
float halfHeight = drawHeight / 2;
foreach (Panel p in lifetime.AliveItems)
// Remove all panels that should no longer be on-screen
scrollableContent.RemoveAll(delegate (Panel p)
{
float panelPosY = p.Position.Y;
p.IsOnScreen = panelPosY >= Current - p.DrawHeight && panelPosY <= Current + drawHeight;
updatePanel(p, halfHeight);
}
bool remove = panelPosY < Current - p.DrawHeight || panelPosY > Current + drawHeight || !p.IsPresent;
return remove;
});
// Find index range of all panels that should be on-screen
Trace.Assert(panels.Count == yPositions.Count);
// Determine range of indices for items that are now definitely on screen to be added
// to the lifetimelist in the future.
int firstIndex = yPositions.BinarySearch(Current - Panel.MAX_HEIGHT);
if (firstIndex < 0) firstIndex = ~firstIndex;
int lastIndex = yPositions.BinarySearch(Current + drawHeight);
if (lastIndex < 0) lastIndex = ~lastIndex;
lifetime.StartIndex = firstIndex;
lifetime.EndIndex = lastIndex;
// Add those panels within the previously found index range that should be displayed.
for (int i = firstIndex; i < lastIndex; ++i)
{
Panel p = lifetime[i];
if (p.State != PanelSelectedState.Hidden)
p.IsOnScreen = true; //we don't want to update the on-screen state of hidden pannels as they have incorrect (stacked) y values.
updatePanel(p, halfHeight);
Panel panel = panels[i];
if (panel.State == PanelSelectedState.Hidden)
continue;
// Only add if we're not already part of the content.
if (!scrollableContent.Contains(panel))
{
// Makes sure headers are always _below_ panels,
// and depth flows downward.
panel.Depth = i + (panel is BeatmapSetHeader ? panels.Count : 0);
scrollableContent.Add(panel);
}
}
// Update externally controlled state of currently visible panels
// (e.g. x-offset and opacity).
float halfHeight = drawHeight / 2;
foreach (Panel p in scrollableContent.Children)
updatePanel(p, halfHeight);
}
protected override bool OnKeyDown(InputState state, KeyDownEventArgs args)
@ -355,7 +333,7 @@ namespace osu.Game.Screens.Select
if (i >= 0 && i < SelectedGroup.BeatmapPanels.Count)
{
//changing difficulty panel, not set.
SelectGroup(SelectedGroup, SelectedGroup.BeatmapPanels[i]);
selectGroup(SelectedGroup, SelectedGroup.BeatmapPanels[i]);
return;
}
}
@ -376,13 +354,16 @@ namespace osu.Game.Screens.Select
public void SelectRandom()
{
if (groups.Count < 1)
List<BeatmapGroup> visibleGroups = this.groups.Where((BeatmapGroup selectGroup) => selectGroup.State != BeatmapGroupState.Hidden).ToList();
if (visibleGroups.Count < 1)
return;
BeatmapGroup group = groups[RNG.Next(groups.Count)];
BeatmapGroup group = visibleGroups[RNG.Next(visibleGroups.Count)];
BeatmapPanel panel = group?.BeatmapPanels.First();
if (panel == null)
return;
SelectGroup(group, panel);
selectGroup(group, panel);
}
public IEnumerator<BeatmapGroup> GetEnumerator() => groups.GetEnumerator();

View File

@ -55,7 +55,7 @@ namespace osu.Game.Screens.Select
Anchor = Anchor.TopRight,
Origin = Anchor.TopRight,
Width = 0.4f, // TODO: InnerWidth property or something
Direction = FillDirection.Down,
Direction = FillDirection.Vertical,
Children = new Drawable[]
{
searchTextBox = new SearchTextBox {
@ -188,7 +188,7 @@ namespace osu.Game.Screens.Select
new FillFlowContainer
{
AutoSizeAxes = Axes.Both,
Direction = FillDirection.Right,
Direction = FillDirection.Horizontal,
Spacing = new Vector2(10, 0),
Children = new Drawable[]
{
@ -210,17 +210,16 @@ namespace osu.Game.Screens.Select
groupsEllipsis = new TextAwesome
{
Icon = FontAwesome.fa_ellipsis_h,
Origin = Anchor.TopLeft,
TextSize = 14,
Margin = new MarginPadding { Top = 5, Bottom = 5 },
Origin = Anchor.BottomLeft,
Anchor = Anchor.BottomLeft,
}
}
},
new FillFlowContainer
{
AutoSizeAxes = Axes.Both,
Direction = FillDirection.Right,
Direction = FillDirection.Horizontal,
Spacing = new Vector2(10, 0),
Origin = Anchor.TopRight,
Anchor = Anchor.TopRight,
@ -241,10 +240,9 @@ namespace osu.Game.Screens.Select
sortEllipsis = new TextAwesome
{
Icon = FontAwesome.fa_ellipsis_h,
Origin = Anchor.TopLeft,
TextSize = 14,
Margin = new MarginPadding { Top = 5, Bottom = 5 },
Origin = Anchor.BottomLeft,
Anchor = Anchor.BottomLeft,
}
}
},

View File

@ -4,11 +4,11 @@
using System;
using OpenTK;
using OpenTK.Graphics;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Transforms;
using osu.Game.Graphics;
using osu.Game.Graphics.UserInterface;
using osu.Game.Screens.Menu;
@ -98,13 +98,13 @@ namespace osu.Game.Screens.Select
Position = new Vector2(BackButton.SIZE_EXTENDED.X + padding, 0),
RelativeSizeAxes = Axes.Y,
AutoSizeAxes = Axes.X,
Direction = FillDirection.Right,
Direction = FillDirection.Horizontal,
Spacing = new Vector2(padding, 0),
Children = new Drawable[]
{
buttons = new FillFlowContainer
{
Direction = FillDirection.Right,
Direction = FillDirection.Horizontal,
Spacing = new Vector2(0.2f, 0),
AutoSizeAxes = Axes.Both,
}

View File

@ -3,6 +3,7 @@
using OpenTK;
using OpenTK.Graphics;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Primitives;
@ -115,7 +116,7 @@ namespace osu.Game.Screens.Select.Options
Origin = Anchor.Centre,
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Direction = FillDirection.Down,
Direction = FillDirection.Vertical,
Children = new Drawable[]
{
iconText = new TextAwesome

View File

@ -6,12 +6,11 @@ using System.Collections.Generic;
using System.Linq;
using OpenTK;
using OpenTK.Graphics;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Primitives;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Transforms;
using osu.Game.Graphics;
namespace osu.Game.Screens.Select.Options
{
@ -132,7 +131,7 @@ namespace osu.Game.Screens.Select.Options
public ButtonFlow()
{
Direction = FillDirection.Right;
Direction = FillDirection.Horizontal;
}
}
}

View File

@ -396,6 +396,7 @@ namespace osu.Game.Screens.Select
{
beatmapGroups.Add(group);
group.State = BeatmapGroupState.Collapsed;
carousel.AddGroup(group);
filterChanged(false, false);
@ -403,11 +404,7 @@ namespace osu.Game.Screens.Select
if (Beatmap == null || select)
carousel.SelectBeatmap(beatmapSet.Beatmaps.First());
else
{
var panel = group.BeatmapPanels.FirstOrDefault(p => p.Beatmap.Equals(Beatmap.BeatmapInfo));
if (panel != null)
carousel.SelectGroup(group, panel);
}
carousel.SelectBeatmap(Beatmap.BeatmapInfo);
}));
}

View File

@ -1,10 +1,10 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;
using osu.Game.Graphics;
using OpenTK;
using OpenTK.Graphics;

View File

@ -3,11 +3,6 @@
using osu.Framework.Configuration;
using osu.Framework.Platform;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace osu.Game.Screens.Tournament.Components
{

View File

@ -1,24 +1,14 @@
// 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.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Batches;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.OpenGL;
using osu.Framework.Graphics.Primitives;
using osu.Framework.Graphics.Shaders;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Textures;
using osu.Framework.Graphics.Transforms;
using osu.Framework.MathUtils;
using osu.Framework.Timing;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace osu.Game.Screens.Tournament.Components
{

View File

@ -77,7 +77,7 @@ namespace osu.Game.Screens.Tournament
new FillFlowContainer
{
RelativeSizeAxes = Axes.Both,
Direction = FillDirection.Right,
Direction = FillDirection.Horizontal,
Children = new Drawable[]
{
@ -173,7 +173,7 @@ namespace osu.Game.Screens.Tournament
Position = new Vector2(0, 35f),
Direction = FillDirection.Down,
Direction = FillDirection.Vertical,
Spacing = new Vector2(0, 5f),
Children = new Drawable[]
@ -212,7 +212,7 @@ namespace osu.Game.Screens.Tournament
Position = new Vector2(0, -5f),
Direction = FillDirection.Down,
Direction = FillDirection.Vertical,
Spacing = new Vector2(0, 5f),
Children = new Drawable[]
@ -294,6 +294,9 @@ namespace osu.Game.Screens.Tournament
reloadTeams();
if (!storage.Exists(results_filename))
return;
if (loadLastResults)
{
try

View File

@ -144,7 +144,7 @@ namespace osu.Game.Screens.Tournament
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Direction = FillDirection.Down,
Direction = FillDirection.Vertical,
Spacing = new Vector2(0, 5f),
Children = new Drawable[]