Add base cursor class to retrieve true visibility state

This commit is contained in:
Dean Herbert
2019-03-26 13:39:19 +09:00
parent b4d785c76c
commit fbc97edc55
7 changed files with 39 additions and 18 deletions

View File

@ -0,0 +1,25 @@
// 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.Framework.Graphics.Containers;
using osu.Framework.Graphics.Cursor;
namespace osu.Game.Rulesets.UI
{
public class GameplayCursorContainer : CursorContainer
{
/// <summary>
/// Because Show/Hide are executed by a parent, <see cref="State"/> is updated immediately even if the cursor
/// is in a non-updating state (via <see cref="FrameStabilityContainer"/> limitations).
///
/// This holds the true visibility value.
/// </summary>
public Visibility LastFrameState;
protected override void Update()
{
base.Update();
LastFrameState = State;
}
}
}