This commit is contained in:
Oscar
2025-05-28 17:15:12 +03:00
parent 37173c8b39
commit 77c1704cd6
35 changed files with 80065 additions and 851 deletions

View File

@@ -1,13 +1,15 @@
using Sandbox;
using Sandbox.UI;
public sealed class MusicPlayerInteractions : SimpleInteractions.SimpleInteraction
public sealed class MusicPlayerInteractions : InteractionButton
{
[Property] public MyMusicPlayer MusicPlayer { get; set; }
[Rpc.Broadcast]
protected override void OnInteract()
[Property] public MyMusicPlayer MusicPlayer { get; set; }
public override bool Press(IPressable.Event e)
{
// Log.Info($"{Rpc.Caller.DisplayName} interacted with {this.GameObject.Name}!");
base.Press(e);
Log.Info("PRESSED");
MusicPlayer.Next();
return true;
}
}

View File

@@ -1,45 +0,0 @@
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;
}
}