mirror of
https://github.com/osukey/osukey.git
synced 2025-04-29 10:47:22 +09:00
Add xmldoc for new method and reorder methods in SkinReloadableDrawable
This commit is contained in:
parent
159c8833c7
commit
8e6a4559e3
@ -27,6 +27,30 @@ namespace osu.Game.Skinning
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
protected ISkinSource CurrentSkin { get; private set; } = null!;
|
protected ISkinSource CurrentSkin { get; private set; } = null!;
|
||||||
|
|
||||||
|
[BackgroundDependencyLoader]
|
||||||
|
private void load(ISkinSource source)
|
||||||
|
{
|
||||||
|
CurrentSkin = source;
|
||||||
|
CurrentSkin.SourceChanged += onChange;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void LoadAsyncComplete()
|
||||||
|
{
|
||||||
|
base.LoadAsyncComplete();
|
||||||
|
skinChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Force any pending <see cref="SkinChanged"/> calls to be performed immediately.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// When a skin change occurs, the handling provided by this class is scheduled.
|
||||||
|
/// In some cases, such a sample playback, this can result in the sample being played
|
||||||
|
/// just before it is updated to a potentially different sample.
|
||||||
|
///
|
||||||
|
/// Calling this method will ensure any pending update operations are run immediately.
|
||||||
|
/// It is recommended to call this before consuming the result of skin changes for anything non-drawable.
|
||||||
|
/// </remarks>
|
||||||
protected void FlushPendingSkinChanges()
|
protected void FlushPendingSkinChanges()
|
||||||
{
|
{
|
||||||
if (pendingSkinChange == null)
|
if (pendingSkinChange == null)
|
||||||
@ -36,11 +60,12 @@ namespace osu.Game.Skinning
|
|||||||
pendingSkinChange = null;
|
pendingSkinChange = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
/// <summary>
|
||||||
private void load(ISkinSource source)
|
/// Called when a change is made to the skin.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="skin">The new skin.</param>
|
||||||
|
protected virtual void SkinChanged(ISkinSource skin)
|
||||||
{
|
{
|
||||||
CurrentSkin = source;
|
|
||||||
CurrentSkin.SourceChanged += onChange;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onChange()
|
private void onChange()
|
||||||
@ -51,12 +76,6 @@ namespace osu.Game.Skinning
|
|||||||
pendingSkinChange = Scheduler.Add(skinChanged);
|
pendingSkinChange = Scheduler.Add(skinChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void LoadAsyncComplete()
|
|
||||||
{
|
|
||||||
base.LoadAsyncComplete();
|
|
||||||
skinChanged();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void skinChanged()
|
private void skinChanged()
|
||||||
{
|
{
|
||||||
SkinChanged(CurrentSkin);
|
SkinChanged(CurrentSkin);
|
||||||
@ -65,14 +84,6 @@ namespace osu.Game.Skinning
|
|||||||
pendingSkinChange = null;
|
pendingSkinChange = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Called when a change is made to the skin.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="skin">The new skin.</param>
|
|
||||||
protected virtual void SkinChanged(ISkinSource skin)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void Dispose(bool isDisposing)
|
protected override void Dispose(bool isDisposing)
|
||||||
{
|
{
|
||||||
base.Dispose(isDisposing);
|
base.Dispose(isDisposing);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user