mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 18:12:56 +08:00
Naming fixes
This commit is contained in:
parent
a1b90ee70e
commit
f2af31aceb
@ -0,0 +1,26 @@
|
|||||||
|
// 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.Testing;
|
||||||
|
using osu.Game.Screens.Play.Settings;
|
||||||
|
|
||||||
|
namespace osu.Desktop.VisualTests.Tests
|
||||||
|
{
|
||||||
|
internal class TestCaseReplaySettingsOverlay : TestCase
|
||||||
|
{
|
||||||
|
public override string Description => @"Settings visible in replay/auto";
|
||||||
|
|
||||||
|
public override void Reset()
|
||||||
|
{
|
||||||
|
base.Reset();
|
||||||
|
|
||||||
|
Add(new ReplaySettingsOverlay()
|
||||||
|
{
|
||||||
|
Anchor = Anchor.TopCentre,
|
||||||
|
Origin = Anchor.TopCentre,
|
||||||
|
AutoSizeAxes = Axes.Both,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,26 +0,0 @@
|
|||||||
// 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.Testing;
|
|
||||||
using osu.Game.Screens.Play.Settings;
|
|
||||||
|
|
||||||
namespace osu.Desktop.VisualTests.Tests
|
|
||||||
{
|
|
||||||
internal class TestCaseSettingsDisplay : TestCase
|
|
||||||
{
|
|
||||||
public override string Description => @"Setting visible in replay/auto";
|
|
||||||
|
|
||||||
public override void Reset()
|
|
||||||
{
|
|
||||||
base.Reset();
|
|
||||||
|
|
||||||
Add(new SettingsDisplay()
|
|
||||||
{
|
|
||||||
Anchor = Anchor.TopCentre,
|
|
||||||
Origin = Anchor.TopCentre,
|
|
||||||
AutoSizeAxes = Axes.Both,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -196,7 +196,7 @@
|
|||||||
<Compile Include="Tests\TestCaseMusicController.cs" />
|
<Compile Include="Tests\TestCaseMusicController.cs" />
|
||||||
<Compile Include="Tests\TestCaseNotificationManager.cs" />
|
<Compile Include="Tests\TestCaseNotificationManager.cs" />
|
||||||
<Compile Include="Tests\TestCaseOnScreenDisplay.cs" />
|
<Compile Include="Tests\TestCaseOnScreenDisplay.cs" />
|
||||||
<Compile Include="Tests\TestCaseSettingsDisplay.cs" />
|
<Compile Include="Tests\TestCaseReplaySettingsOverlay.cs" />
|
||||||
<Compile Include="Tests\TestCasePlayer.cs" />
|
<Compile Include="Tests\TestCasePlayer.cs" />
|
||||||
<Compile Include="Tests\TestCaseHitObjects.cs" />
|
<Compile Include="Tests\TestCaseHitObjects.cs" />
|
||||||
<Compile Include="Tests\TestCaseKeyCounter.cs" />
|
<Compile Include="Tests\TestCaseKeyCounter.cs" />
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
using OpenTK;
|
using OpenTK;
|
||||||
using OpenTK.Graphics;
|
using OpenTK.Graphics;
|
||||||
using osu.Framework.Allocation;
|
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
@ -18,9 +17,11 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public abstract string Title { get; }
|
public abstract string Title { get; }
|
||||||
|
|
||||||
private readonly SettingsDropdown content;
|
private const float transition_duration = 600;
|
||||||
|
|
||||||
|
private readonly FillFlowContainer content;
|
||||||
private readonly SimpleButton button;
|
private readonly SimpleButton button;
|
||||||
private bool contentIsVisible;
|
private bool buttonIsPressed;
|
||||||
|
|
||||||
protected SettingsContainer()
|
protected SettingsContainer()
|
||||||
{
|
{
|
||||||
@ -76,19 +77,21 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
content = new SettingsDropdown
|
content = new FillFlowContainer
|
||||||
{
|
{
|
||||||
|
Direction = FillDirection.Vertical,
|
||||||
RelativeSizeAxes = Axes.X,
|
RelativeSizeAxes = Axes.X,
|
||||||
|
AutoSizeAxes = Axes.Y,
|
||||||
|
Origin = Anchor.TopCentre,
|
||||||
|
Anchor = Anchor.TopCentre,
|
||||||
|
Padding = new MarginPadding(15),
|
||||||
|
Spacing = new Vector2(0, 10),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
button.TriggerClick();
|
||||||
private void load(OsuColour colours)
|
|
||||||
{
|
|
||||||
content.StateChanged += (c, s) => button.FadeColour(s == Visibility.Visible ? colours.Yellow : Color4.White, 200, EasingTypes.OutQuint);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public new void Add(Drawable drawable)
|
public new void Add(Drawable drawable)
|
||||||
@ -98,53 +101,14 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
|
|
||||||
private void triggerContentVisibility()
|
private void triggerContentVisibility()
|
||||||
{
|
{
|
||||||
contentIsVisible = !contentIsVisible;
|
buttonIsPressed = !buttonIsPressed;
|
||||||
|
|
||||||
if (contentIsVisible)
|
button.FadeColour(buttonIsPressed ? OsuColour.FromHex(@"ffcc22") : Color4.White, 200, EasingTypes.OutQuint);
|
||||||
|
|
||||||
|
if (buttonIsPressed)
|
||||||
content.Show();
|
content.Show();
|
||||||
else
|
else
|
||||||
content.Hide();
|
content.Hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
private class SettingsDropdown : OverlayContainer
|
|
||||||
{
|
|
||||||
private const float transition_duration = 600;
|
|
||||||
|
|
||||||
private readonly FillFlowContainer content;
|
|
||||||
|
|
||||||
public SettingsDropdown()
|
|
||||||
{
|
|
||||||
Children = new Drawable[]
|
|
||||||
{
|
|
||||||
content = new FillFlowContainer
|
|
||||||
{
|
|
||||||
Direction = FillDirection.Vertical,
|
|
||||||
RelativeSizeAxes = Axes.X,
|
|
||||||
AutoSizeAxes = Axes.Y,
|
|
||||||
Origin = Anchor.TopCentre,
|
|
||||||
Anchor = Anchor.TopCentre,
|
|
||||||
Padding = new MarginPadding(15),
|
|
||||||
Spacing = new Vector2(0, 10),
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
public new void Add(Drawable drawable)
|
|
||||||
{
|
|
||||||
content.Add(drawable);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void PopIn()
|
|
||||||
{
|
|
||||||
ResizeTo(new Vector2(1, content.Height), transition_duration, EasingTypes.OutQuint);
|
|
||||||
FadeIn(transition_duration, EasingTypes.OutQuint);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void PopOut()
|
|
||||||
{
|
|
||||||
ResizeTo(new Vector2(1, 0), transition_duration, EasingTypes.OutQuint);
|
|
||||||
FadeOut(transition_duration);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,7 @@ namespace osu.Game.Screens.Play
|
|||||||
public readonly HealthDisplay HealthDisplay;
|
public readonly HealthDisplay HealthDisplay;
|
||||||
public readonly SongProgress Progress;
|
public readonly SongProgress Progress;
|
||||||
public readonly ModDisplay ModDisplay;
|
public readonly ModDisplay ModDisplay;
|
||||||
public readonly SettingsDisplay SettingsDisplay;
|
public readonly ReplaySettingsOverlay ReplaySettingsOverlay;
|
||||||
|
|
||||||
private Bindable<bool> showKeyCounter;
|
private Bindable<bool> showKeyCounter;
|
||||||
private Bindable<bool> showHud;
|
private Bindable<bool> showHud;
|
||||||
@ -44,7 +44,7 @@ namespace osu.Game.Screens.Play
|
|||||||
protected abstract HealthDisplay CreateHealthDisplay();
|
protected abstract HealthDisplay CreateHealthDisplay();
|
||||||
protected abstract SongProgress CreateProgress();
|
protected abstract SongProgress CreateProgress();
|
||||||
protected abstract ModDisplay CreateModsContainer();
|
protected abstract ModDisplay CreateModsContainer();
|
||||||
protected abstract SettingsDisplay CreateSettingsDisplay();
|
protected abstract ReplaySettingsOverlay CreateReplaySettingsOverlay();
|
||||||
|
|
||||||
protected HUDOverlay()
|
protected HUDOverlay()
|
||||||
{
|
{
|
||||||
@ -63,7 +63,7 @@ namespace osu.Game.Screens.Play
|
|||||||
HealthDisplay = CreateHealthDisplay(),
|
HealthDisplay = CreateHealthDisplay(),
|
||||||
Progress = CreateProgress(),
|
Progress = CreateProgress(),
|
||||||
ModDisplay = CreateModsContainer(),
|
ModDisplay = CreateModsContainer(),
|
||||||
SettingsDisplay = CreateSettingsDisplay(),
|
ReplaySettingsOverlay = CreateReplaySettingsOverlay(),
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -208,7 +208,7 @@ namespace osu.Game.Screens.Play
|
|||||||
hudOverlay.Progress.Objects = HitRenderer.Objects;
|
hudOverlay.Progress.Objects = HitRenderer.Objects;
|
||||||
hudOverlay.Progress.AudioClock = decoupledClock;
|
hudOverlay.Progress.AudioClock = decoupledClock;
|
||||||
hudOverlay.Progress.AllowSeeking = HitRenderer.HasReplayLoaded;
|
hudOverlay.Progress.AllowSeeking = HitRenderer.HasReplayLoaded;
|
||||||
hudOverlay.SettingsDisplay.IsVisible = HitRenderer.HasReplayLoaded;
|
hudOverlay.ReplaySettingsOverlay.IsVisible = HitRenderer.HasReplayLoaded;
|
||||||
hudOverlay.Progress.OnSeek = pos => decoupledClock.Seek(pos);
|
hudOverlay.Progress.OnSeek = pos => decoupledClock.Seek(pos);
|
||||||
|
|
||||||
hudOverlay.ModDisplay.Current.BindTo(Beatmap.Mods);
|
hudOverlay.ModDisplay.Current.BindTo(Beatmap.Mods);
|
||||||
|
@ -6,7 +6,7 @@ using osu.Framework.Graphics.Containers;
|
|||||||
|
|
||||||
namespace osu.Game.Screens.Play.Settings
|
namespace osu.Game.Screens.Play.Settings
|
||||||
{
|
{
|
||||||
public class SettingsDisplay : FillFlowContainer
|
public class ReplaySettingsOverlay : FillFlowContainer
|
||||||
{
|
{
|
||||||
private bool isVisible;
|
private bool isVisible;
|
||||||
public bool IsVisible
|
public bool IsVisible
|
||||||
@ -23,7 +23,7 @@ namespace osu.Game.Screens.Play.Settings
|
|||||||
get { return isVisible; }
|
get { return isVisible; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public SettingsDisplay()
|
public ReplaySettingsOverlay()
|
||||||
{
|
{
|
||||||
Direction = FillDirection.Vertical;
|
Direction = FillDirection.Vertical;
|
||||||
Spacing = new Vector2(0, 20);
|
Spacing = new Vector2(0, 20);
|
@ -72,7 +72,7 @@ namespace osu.Game.Screens.Play
|
|||||||
Margin = new MarginPadding { Top = 20, Right = 10 },
|
Margin = new MarginPadding { Top = 20, Right = 10 },
|
||||||
};
|
};
|
||||||
|
|
||||||
protected override SettingsDisplay CreateSettingsDisplay() => new SettingsDisplay
|
protected override ReplaySettingsOverlay CreateReplaySettingsOverlay() => new ReplaySettingsOverlay
|
||||||
{
|
{
|
||||||
Anchor = Anchor.TopRight,
|
Anchor = Anchor.TopRight,
|
||||||
Origin = Anchor.TopRight,
|
Origin = Anchor.TopRight,
|
||||||
|
@ -236,7 +236,7 @@
|
|||||||
<Compile Include="Screens\Play\Settings\CollectionSettings.cs" />
|
<Compile Include="Screens\Play\Settings\CollectionSettings.cs" />
|
||||||
<Compile Include="Screens\Play\Settings\DiscussionSettings.cs" />
|
<Compile Include="Screens\Play\Settings\DiscussionSettings.cs" />
|
||||||
<Compile Include="Graphics\UserInterface\SettingsContainer.cs" />
|
<Compile Include="Graphics\UserInterface\SettingsContainer.cs" />
|
||||||
<Compile Include="Screens\Play\Settings\SettingsDisplay.cs" />
|
<Compile Include="Screens\Play\Settings\ReplaySettingsOverlay.cs" />
|
||||||
<Compile Include="Screens\Play\Settings\PlaybackSettings.cs" />
|
<Compile Include="Screens\Play\Settings\PlaybackSettings.cs" />
|
||||||
<Compile Include="Screens\Play\PauseContainer.cs" />
|
<Compile Include="Screens\Play\PauseContainer.cs" />
|
||||||
<Compile Include="Screens\Play\SongProgressInfo.cs" />
|
<Compile Include="Screens\Play\SongProgressInfo.cs" />
|
||||||
|
Loading…
Reference in New Issue
Block a user