Make use-in-hand default to activation interactions. (#5951)

This commit is contained in:
Leon Friedrich
2022-01-05 02:23:01 +13:00
committed by GitHub
parent c4512e3c1a
commit f13f743c51
18 changed files with 58 additions and 116 deletions

View File

@@ -16,7 +16,9 @@ namespace Content.Server.Paper
{
[RegisterComponent]
#pragma warning disable 618
public class PaperComponent : SharedPaperComponent, IExamine, IInteractUsing, IUse
[ComponentReference(typeof(SharedPaperComponent))]
[ComponentReference(typeof(IActivate))]
public sealed class PaperComponent : SharedPaperComponent, IExamine, IInteractUsing, IActivate
#pragma warning restore 618
{
[Dependency] private readonly IEntityManager _entMan = default!;
@@ -74,15 +76,15 @@ namespace Content.Server.Paper
);
}
bool IUse.UseEntity(UseEntityEventArgs eventArgs)
void IActivate.Activate(ActivateEventArgs eventArgs)
{
if (!_entMan.TryGetComponent(eventArgs.User, out ActorComponent? actor))
return false;
return;
_mode = PaperAction.Read;
UpdateUserInterface();
UserInterface?.Toggle(actor.PlayerSession);
return true;
return;
}
private void OnUiReceiveMessage(ServerBoundUserInterfaceMessage obj)