mirror of
https://github.com/osukey/osukey.git
synced 2025-08-05 07:33:55 +09:00
change name of interface and expose method instead of seperate values
This commit is contained in:
15
osu.Game/Rulesets/Mods/IApplicableToPlayer.cs
Normal file
15
osu.Game/Rulesets/Mods/IApplicableToPlayer.cs
Normal file
@ -0,0 +1,15 @@
|
||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using osu.Game.Screens.Play;
|
||||
|
||||
namespace osu.Game.Rulesets.Mods
|
||||
{
|
||||
/// <summary>
|
||||
/// An interface for a mod which can temporarily override the <see cref="Player"/> settings.
|
||||
/// </summary>
|
||||
public interface IApplicableToPlayer : IApplicableMod
|
||||
{
|
||||
void ApplyToPlayer(Player player);
|
||||
}
|
||||
}
|
@ -1,26 +0,0 @@
|
||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
namespace osu.Game.Rulesets.Mods
|
||||
{
|
||||
/// <summary>
|
||||
/// An interface for a mod which can temporarily override screen settings.
|
||||
/// </summary>
|
||||
public interface IApplicableToScreen : IApplicableMod
|
||||
{
|
||||
/// <summary>
|
||||
/// Whether to enable image, video and storyboard dimming
|
||||
/// </summary>
|
||||
bool EnableDim { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Weather to force the video (if present)
|
||||
/// </summary>
|
||||
bool ForceVideo { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Weather to force the storyboard (if present)
|
||||
/// </summary>
|
||||
bool ForceStoryboard { get; }
|
||||
}
|
||||
}
|
@ -21,7 +21,7 @@ namespace osu.Game.Rulesets.Mods
|
||||
}
|
||||
}
|
||||
|
||||
public class ModCinema : ModAutoplay, IApplicableToHUD, IApplicableToScreen
|
||||
public class ModCinema : ModAutoplay, IApplicableToHUD, IApplicableToPlayer
|
||||
{
|
||||
public override string Name => "Cinema";
|
||||
public override string Acronym => "CN";
|
||||
@ -34,8 +34,14 @@ namespace osu.Game.Rulesets.Mods
|
||||
overlay.Hide();
|
||||
}
|
||||
|
||||
public bool EnableDim => false;
|
||||
public bool ForceVideo => true;
|
||||
public bool ForceStoryboard => true;
|
||||
public void ApplyToPlayer(Player player)
|
||||
{
|
||||
player.Background.EnableUserDim.Value = false;
|
||||
player.DimmableVideo.EnableUserDim.Value = false;
|
||||
player.DimmableStoryboard.EnableUserDim.Value = false;
|
||||
|
||||
player.DimmableVideo.IgnoreUserSettings.Value = true;
|
||||
player.DimmableStoryboard.IgnoreUserSettings.Value = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user