mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 23:12:56 +08:00
refactor: remove detachment logic
No real use case, cleaning up the diff
This commit is contained in:
parent
7e70598773
commit
b4cbcb210e
@ -330,9 +330,6 @@ namespace osu.Game.Rulesets.UI
|
|||||||
public void Attach(IAttachableSkinComponent skinComponent) =>
|
public void Attach(IAttachableSkinComponent skinComponent) =>
|
||||||
(KeyBindingInputManager as ICanAttachHUDPieces)?.Attach(skinComponent);
|
(KeyBindingInputManager as ICanAttachHUDPieces)?.Attach(skinComponent);
|
||||||
|
|
||||||
public void Detach(IAttachableSkinComponent skinComponent) =>
|
|
||||||
(KeyBindingInputManager as ICanAttachHUDPieces)?.Detach(skinComponent);
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates a key conversion input manager. An exception will be thrown if a valid <see cref="RulesetInputManager{T}"/> is not returned.
|
/// Creates a key conversion input manager. An exception will be thrown if a valid <see cref="RulesetInputManager{T}"/> is not returned.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -165,7 +165,8 @@ namespace osu.Game.Rulesets.UI
|
|||||||
switch (skinComponent)
|
switch (skinComponent)
|
||||||
{
|
{
|
||||||
case KeyCounterController keyCounterDisplay:
|
case KeyCounterController keyCounterDisplay:
|
||||||
attachKeyCounter(keyCounterDisplay); break;
|
attachKeyCounter(keyCounterDisplay);
|
||||||
|
break;
|
||||||
|
|
||||||
case ClicksPerSecondCalculator clicksPerSecondCalculator:
|
case ClicksPerSecondCalculator clicksPerSecondCalculator:
|
||||||
attachClicksPerSecond(clicksPerSecondCalculator);
|
attachClicksPerSecond(clicksPerSecondCalculator);
|
||||||
@ -173,20 +174,6 @@ namespace osu.Game.Rulesets.UI
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Detach(IAttachableSkinComponent skinComponent)
|
|
||||||
{
|
|
||||||
switch (skinComponent)
|
|
||||||
{
|
|
||||||
case KeyCounterController keyCounterDisplay:
|
|
||||||
detachKeyCounter(keyCounterDisplay);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case ClicksPerSecondCalculator clicksPerSecondCalculator:
|
|
||||||
detachClicksPerSecond(clicksPerSecondCalculator);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Key Counter Attachment
|
#region Key Counter Attachment
|
||||||
@ -205,11 +192,6 @@ namespace osu.Game.Rulesets.UI
|
|||||||
.Select(action => new KeyCounterActionTrigger<T>(action)));
|
.Select(action => new KeyCounterActionTrigger<T>(action)));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void detachKeyCounter(KeyCounterController keyCounter)
|
|
||||||
{
|
|
||||||
keyCounter.ClearReceptor();
|
|
||||||
}
|
|
||||||
|
|
||||||
private partial class ActionReceptor : KeyCounterController.Receptor, IKeyBindingHandler<T>
|
private partial class ActionReceptor : KeyCounterController.Receptor, IKeyBindingHandler<T>
|
||||||
{
|
{
|
||||||
public ActionReceptor(KeyCounterController target)
|
public ActionReceptor(KeyCounterController target)
|
||||||
@ -239,10 +221,6 @@ namespace osu.Game.Rulesets.UI
|
|||||||
KeyBindingContainer.Add(listener);
|
KeyBindingContainer.Add(listener);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void detachClicksPerSecond(ClicksPerSecondCalculator calculator)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
private partial class ActionListener : Component, IKeyBindingHandler<T>
|
private partial class ActionListener : Component, IKeyBindingHandler<T>
|
||||||
{
|
{
|
||||||
private readonly ClicksPerSecondCalculator calculator;
|
private readonly ClicksPerSecondCalculator calculator;
|
||||||
@ -306,7 +284,6 @@ namespace osu.Game.Rulesets.UI
|
|||||||
public interface ICanAttachHUDPieces
|
public interface ICanAttachHUDPieces
|
||||||
{
|
{
|
||||||
void Attach(IAttachableSkinComponent component);
|
void Attach(IAttachableSkinComponent component);
|
||||||
void Detach(IAttachableSkinComponent component);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface IAttachableSkinComponent
|
public interface IAttachableSkinComponent
|
||||||
|
Loading…
Reference in New Issue
Block a user