mirror of
https://github.com/ppy/osu
synced 2025-01-09 23:59:44 +00:00
Rename HoldToQuit to QuitButton
This commit is contained in:
parent
f8630115d6
commit
39db1e8cbb
@ -16,8 +16,8 @@ namespace osu.Game.Tests.Visual
|
|||||||
|
|
||||||
public TestCaseHoldToQuit()
|
public TestCaseHoldToQuit()
|
||||||
{
|
{
|
||||||
HoldToQuit holdToQuit;
|
QuitButton holdToQuit;
|
||||||
Add(holdToQuit = new HoldToQuit
|
Add(holdToQuit = new QuitButton
|
||||||
{
|
{
|
||||||
Origin = Anchor.BottomRight,
|
Origin = Anchor.BottomRight,
|
||||||
Anchor = Anchor.BottomRight,
|
Anchor = Anchor.BottomRight,
|
||||||
|
@ -14,16 +14,16 @@ using OpenTK;
|
|||||||
|
|
||||||
namespace osu.Game.Screens.Play.HUD
|
namespace osu.Game.Screens.Play.HUD
|
||||||
{
|
{
|
||||||
public class HoldToQuit : FillFlowContainer
|
public class QuitButton : FillFlowContainer
|
||||||
{
|
{
|
||||||
private readonly HoldToQuitButton button;
|
private readonly Button button;
|
||||||
public Action ExitAction
|
public Action ExitAction
|
||||||
{
|
{
|
||||||
get => button.ExitAction;
|
get => button.ExitAction;
|
||||||
set => button.ExitAction = value;
|
set => button.ExitAction = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public HoldToQuit()
|
public QuitButton()
|
||||||
{
|
{
|
||||||
OsuSpriteText text;
|
OsuSpriteText text;
|
||||||
Direction = FillDirection.Horizontal;
|
Direction = FillDirection.Horizontal;
|
||||||
@ -37,12 +37,12 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
Anchor = Anchor.CentreLeft,
|
Anchor = Anchor.CentreLeft,
|
||||||
Origin = Anchor.CentreLeft
|
Origin = Anchor.CentreLeft
|
||||||
},
|
},
|
||||||
button = new HoldToQuitButton(text)
|
button = new Button(text)
|
||||||
};
|
};
|
||||||
AutoSizeAxes = Axes.Both;
|
AutoSizeAxes = Axes.Both;
|
||||||
}
|
}
|
||||||
|
|
||||||
public class HoldToQuitButton : CircularContainer
|
private class Button : CircularContainer
|
||||||
{
|
{
|
||||||
private readonly OsuSpriteText text;
|
private readonly OsuSpriteText text;
|
||||||
private SpriteIcon icon;
|
private SpriteIcon icon;
|
||||||
@ -54,7 +54,7 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
private const int progress_duration = 1000;
|
private const int progress_duration = 1000;
|
||||||
private const int text_display_time = 5000;
|
private const int text_display_time = 5000;
|
||||||
|
|
||||||
public HoldToQuitButton(OsuSpriteText text) => this.text = text;
|
public Button(OsuSpriteText text) => this.text = text;
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OsuColour colours)
|
private void load(OsuColour colours)
|
@ -34,7 +34,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 HoldToQuit HoldToQuit;
|
public readonly QuitButton HoldToQuit;
|
||||||
public readonly PlayerSettingsOverlay PlayerSettingsOverlay;
|
public readonly PlayerSettingsOverlay PlayerSettingsOverlay;
|
||||||
|
|
||||||
private Bindable<bool> showHud;
|
private Bindable<bool> showHud;
|
||||||
@ -58,7 +58,7 @@ namespace osu.Game.Screens.Play
|
|||||||
AccuracyCounter = CreateAccuracyCounter(),
|
AccuracyCounter = CreateAccuracyCounter(),
|
||||||
HealthDisplay = CreateHealthDisplay(),
|
HealthDisplay = CreateHealthDisplay(),
|
||||||
Progress = CreateProgress(),
|
Progress = CreateProgress(),
|
||||||
HoldToQuit = CreateHoldToQuit(),
|
HoldToQuit = CreateQuitButton(),
|
||||||
ModDisplay = CreateModsContainer(),
|
ModDisplay = CreateModsContainer(),
|
||||||
PlayerSettingsOverlay = CreatePlayerSettingsOverlay()
|
PlayerSettingsOverlay = CreatePlayerSettingsOverlay()
|
||||||
}
|
}
|
||||||
@ -207,11 +207,11 @@ namespace osu.Game.Screens.Play
|
|||||||
RelativeSizeAxes = Axes.X,
|
RelativeSizeAxes = Axes.X,
|
||||||
};
|
};
|
||||||
|
|
||||||
protected virtual HoldToQuit CreateHoldToQuit() => new HoldToQuit
|
protected virtual QuitButton CreateQuitButton() => new QuitButton
|
||||||
{
|
{
|
||||||
Anchor = Anchor.BottomRight,
|
Anchor = Anchor.BottomRight,
|
||||||
Origin = Anchor.BottomRight,
|
Origin = Anchor.BottomRight,
|
||||||
Margin = new MarginPadding { Bottom = Progress.Size.Y * 1.25f, Right = 5 }
|
Position = new Vector2(-5, -70)
|
||||||
};
|
};
|
||||||
|
|
||||||
protected virtual ModDisplay CreateModsContainer() => new ModDisplay
|
protected virtual ModDisplay CreateModsContainer() => new ModDisplay
|
||||||
|
Loading…
Reference in New Issue
Block a user