sas
This commit is contained in:
45
Code/Sounds/MusicPlayerNextButton.cs
Normal file
45
Code/Sounds/MusicPlayerNextButton.cs
Normal file
@@ -0,0 +1,45 @@
|
||||
namespace Sandbox;
|
||||
|
||||
[Icon( "skip_next" )]
|
||||
public sealed class MusicPlayerNextButton : Component, Component.IPressable
|
||||
{
|
||||
[Property] public string Label { get; set; } = "Next track";
|
||||
|
||||
public bool Press( Component.IPressable.Event e )
|
||||
{
|
||||
Log.Info( $"Press от {e.Source}" );
|
||||
return true;
|
||||
}
|
||||
|
||||
public void Hover( Component.IPressable.Event e )
|
||||
{
|
||||
Log.Info( $"Hover от {e.Source}" );
|
||||
}
|
||||
|
||||
public void Look( Component.IPressable.Event e )
|
||||
{
|
||||
Log.Info( "Look..." );
|
||||
}
|
||||
|
||||
public void Blur( Component.IPressable.Event e )
|
||||
{
|
||||
Log.Info( "Blur — игрок отвёл взгляд" );
|
||||
}
|
||||
|
||||
public void Release( Component.IPressable.Event e )
|
||||
{
|
||||
Log.Info( "Release — игрок отпустил кнопку" );
|
||||
}
|
||||
|
||||
public bool Pressing( Component.IPressable.Event e )
|
||||
{
|
||||
// возвращаем true, чтобы удержание продолжалось
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool CanPress( Component.IPressable.Event e )
|
||||
{
|
||||
// например, можно сделать: return !isCoolingDown
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user