mirror of
https://github.com/osukey/osukey.git
synced 2025-06-17 01:08:00 +09:00
Rename IsGameplay
This commit is contained in:
parent
c8c5998af4
commit
7fff762dfc
@ -12,24 +12,24 @@ namespace osu.Game.Input
|
|||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Connects <see cref="OsuSetting.ConfineMouseMode"/> with <see cref="FrameworkSetting.ConfineMouseMode"/>.
|
/// Connects <see cref="OsuSetting.ConfineMouseMode"/> with <see cref="FrameworkSetting.ConfineMouseMode"/>.
|
||||||
/// If <see cref="OsuGame.IsGameplay"/> is true, we should also confine the mouse cursor if it has been
|
/// If <see cref="OsuGame.LocalUserPlaying"/> is true, we should also confine the mouse cursor if it has been
|
||||||
/// requested with <see cref="OsuConfineMouseMode.DuringGameplay"/>.
|
/// requested with <see cref="OsuConfineMouseMode.DuringGameplay"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class ConfineMouseTracker : Component
|
public class ConfineMouseTracker : Component
|
||||||
{
|
{
|
||||||
private Bindable<ConfineMouseMode> frameworkConfineMode;
|
private Bindable<ConfineMouseMode> frameworkConfineMode;
|
||||||
private Bindable<OsuConfineMouseMode> osuConfineMode;
|
private Bindable<OsuConfineMouseMode> osuConfineMode;
|
||||||
private IBindable<bool> isGameplay;
|
private IBindable<bool> localUserPlaying;
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OsuGame game, FrameworkConfigManager frameworkConfigManager, OsuConfigManager osuConfigManager)
|
private void load(OsuGame game, FrameworkConfigManager frameworkConfigManager, OsuConfigManager osuConfigManager)
|
||||||
{
|
{
|
||||||
frameworkConfineMode = frameworkConfigManager.GetBindable<ConfineMouseMode>(FrameworkSetting.ConfineMouseMode);
|
frameworkConfineMode = frameworkConfigManager.GetBindable<ConfineMouseMode>(FrameworkSetting.ConfineMouseMode);
|
||||||
osuConfineMode = osuConfigManager.GetBindable<OsuConfineMouseMode>(OsuSetting.ConfineMouseMode);
|
osuConfineMode = osuConfigManager.GetBindable<OsuConfineMouseMode>(OsuSetting.ConfineMouseMode);
|
||||||
isGameplay = game.IsGameplay.GetBoundCopy();
|
localUserPlaying = game.LocalUserPlaying.GetBoundCopy();
|
||||||
|
|
||||||
osuConfineMode.ValueChanged += _ => updateConfineMode();
|
osuConfineMode.ValueChanged += _ => updateConfineMode();
|
||||||
isGameplay.BindValueChanged(_ => updateConfineMode(), true);
|
localUserPlaying.BindValueChanged(_ => updateConfineMode(), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateConfineMode()
|
private void updateConfineMode()
|
||||||
@ -49,7 +49,7 @@ namespace osu.Game.Input
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case OsuConfineMouseMode.DuringGameplay:
|
case OsuConfineMouseMode.DuringGameplay:
|
||||||
frameworkConfineMode.Value = isGameplay.Value ? ConfineMouseMode.Always : ConfineMouseMode.Never;
|
frameworkConfineMode.Value = localUserPlaying.Value ? ConfineMouseMode.Always : ConfineMouseMode.Never;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case OsuConfineMouseMode.Always:
|
case OsuConfineMouseMode.Always:
|
||||||
|
@ -98,9 +98,9 @@ namespace osu.Game
|
|||||||
public readonly IBindable<OverlayActivation> OverlayActivationMode = new Bindable<OverlayActivation>();
|
public readonly IBindable<OverlayActivation> OverlayActivationMode = new Bindable<OverlayActivation>();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Whether gameplay is currently active.
|
/// Whether the local user is currently interacting with the game in a way that should not be interrupted.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public readonly Bindable<bool> IsGameplay = new BindableBool();
|
public readonly Bindable<bool> LocalUserPlaying = new BindableBool();
|
||||||
|
|
||||||
protected OsuScreenStack ScreenStack;
|
protected OsuScreenStack ScreenStack;
|
||||||
|
|
||||||
|
@ -68,7 +68,7 @@ namespace osu.Game.Screens.Play
|
|||||||
|
|
||||||
private readonly Bindable<bool> storyboardReplacesBackground = new Bindable<bool>();
|
private readonly Bindable<bool> storyboardReplacesBackground = new Bindable<bool>();
|
||||||
|
|
||||||
private readonly Bindable<bool> isGameplay = new Bindable<bool>();
|
private readonly Bindable<bool> localUserPlaying = new Bindable<bool>();
|
||||||
|
|
||||||
public int RestartCount;
|
public int RestartCount;
|
||||||
|
|
||||||
@ -175,7 +175,7 @@ namespace osu.Game.Screens.Play
|
|||||||
mouseWheelDisabled = config.GetBindable<bool>(OsuSetting.MouseDisableWheel);
|
mouseWheelDisabled = config.GetBindable<bool>(OsuSetting.MouseDisableWheel);
|
||||||
|
|
||||||
if (game is OsuGame osuGame)
|
if (game is OsuGame osuGame)
|
||||||
isGameplay.BindTo(osuGame.IsGameplay);
|
localUserPlaying.BindTo(osuGame.LocalUserPlaying);
|
||||||
|
|
||||||
DrawableRuleset = ruleset.CreateDrawableRulesetWith(playableBeatmap, Mods.Value);
|
DrawableRuleset = ruleset.CreateDrawableRulesetWith(playableBeatmap, Mods.Value);
|
||||||
|
|
||||||
@ -362,7 +362,7 @@ namespace osu.Game.Screens.Play
|
|||||||
{
|
{
|
||||||
bool inGameplay = !DrawableRuleset.HasReplayLoaded.Value && !DrawableRuleset.IsPaused.Value && !breakTracker.IsBreakTime.Value;
|
bool inGameplay = !DrawableRuleset.HasReplayLoaded.Value && !DrawableRuleset.IsPaused.Value && !breakTracker.IsBreakTime.Value;
|
||||||
OverlayActivationMode.Value = inGameplay ? OverlayActivation.Disabled : OverlayActivation.UserTriggered;
|
OverlayActivationMode.Value = inGameplay ? OverlayActivation.Disabled : OverlayActivation.UserTriggered;
|
||||||
isGameplay.Value = inGameplay;
|
localUserPlaying.Value = inGameplay;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updatePauseOnFocusLostState() =>
|
private void updatePauseOnFocusLostState() =>
|
||||||
@ -695,8 +695,8 @@ namespace osu.Game.Screens.Play
|
|||||||
|
|
||||||
musicController.ResetTrackAdjustments();
|
musicController.ResetTrackAdjustments();
|
||||||
|
|
||||||
// Ensure we reset the IsGameplay state
|
// Ensure we reset the LocalUserPlaying state
|
||||||
isGameplay.Value = false;
|
localUserPlaying.Value = false;
|
||||||
|
|
||||||
fadeOut();
|
fadeOut();
|
||||||
return base.OnExiting(next);
|
return base.OnExiting(next);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user