mirror of
https://github.com/ppy/osu
synced 2025-01-18 20:10:49 +00:00
Merge branch 'master' into song-select-filtering
This commit is contained in:
commit
52fb345e79
@ -3,6 +3,7 @@
|
||||
|
||||
using OpenTK;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Configuration;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Cursor;
|
||||
@ -10,6 +11,8 @@ using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Graphics.Textures;
|
||||
using osu.Framework.Graphics.Transformations;
|
||||
using osu.Framework.Input;
|
||||
using osu.Game.Configuration;
|
||||
using System;
|
||||
|
||||
namespace osu.Game.Graphics.Cursor
|
||||
{
|
||||
@ -38,6 +41,8 @@ namespace osu.Game.Graphics.Cursor
|
||||
|
||||
class OsuCursor : Container
|
||||
{
|
||||
private BindableDouble cursorScale;
|
||||
private Sprite sprite;
|
||||
public OsuCursor()
|
||||
{
|
||||
Origin = Anchor.Centre;
|
||||
@ -45,15 +50,24 @@ namespace osu.Game.Graphics.Cursor
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(TextureStore textures)
|
||||
private void load(TextureStore textures, OsuConfigManager config)
|
||||
{
|
||||
cursorScale = (BindableDouble)config.GetBindable<double>(OsuConfig.CursorSize);
|
||||
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new Sprite
|
||||
sprite = new Sprite
|
||||
{
|
||||
Scale = new Vector2((float)cursorScale),
|
||||
Texture = textures.Get(@"Cursor/cursor")
|
||||
}
|
||||
};
|
||||
cursorScale.ValueChanged += scaleChanged;
|
||||
}
|
||||
|
||||
private void scaleChanged(object sender, EventArgs e)
|
||||
{
|
||||
sprite.Scale = new Vector2((float)cursorScale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -161,8 +161,8 @@ namespace osu.Game.Overlays.Pause
|
||||
Height = button_height,
|
||||
Action = delegate
|
||||
{
|
||||
Hide();
|
||||
OnRetry?.Invoke();
|
||||
Hide();
|
||||
}
|
||||
},
|
||||
new QuitButton
|
||||
@ -173,8 +173,8 @@ namespace osu.Game.Overlays.Pause
|
||||
Height = button_height,
|
||||
Action = delegate
|
||||
{
|
||||
Hide();
|
||||
OnQuit?.Invoke();
|
||||
Hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -200,8 +200,8 @@ namespace osu.Game.Overlays.Pause
|
||||
|
||||
private void resume()
|
||||
{
|
||||
Hide();
|
||||
OnResume?.Invoke();
|
||||
Hide();
|
||||
}
|
||||
|
||||
public PauseOverlay()
|
||||
|
@ -26,6 +26,7 @@ using osu.Game.Overlays.Pause;
|
||||
using osu.Framework.Configuration;
|
||||
using System;
|
||||
using OpenTK.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
|
||||
namespace osu.Game.Screens.Play
|
||||
{
|
||||
@ -261,7 +262,7 @@ namespace osu.Game.Screens.Play
|
||||
|
||||
protected override bool OnExiting(GameMode next)
|
||||
{
|
||||
if (!canPause) return true;
|
||||
if (pauseOverlay.State != Visibility.Visible && !canPause) return true;
|
||||
|
||||
if (!IsPaused && sourceClock.IsRunning) // For if the user presses escape quickly when entering the map
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user