Add PDA Ringtones (#5842)
Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
This commit is contained in:
@@ -4,6 +4,7 @@ using Content.Server.Light.Events;
|
||||
using Content.Server.Traitor.Uplink;
|
||||
using Content.Server.Traitor.Uplink.Account;
|
||||
using Content.Server.Traitor.Uplink.Components;
|
||||
using Content.Server.PDA.Ringer;
|
||||
using Content.Server.UserInterface;
|
||||
using Content.Shared.Containers.ItemSlots;
|
||||
using Content.Shared.Interaction;
|
||||
@@ -20,6 +21,7 @@ namespace Content.Server.PDA
|
||||
[Dependency] private readonly UplinkSystem _uplinkSystem = default!;
|
||||
[Dependency] private readonly UplinkAccountsSystem _uplinkAccounts = default!;
|
||||
[Dependency] private readonly UnpoweredFlashlightSystem _unpoweredFlashlight = default!;
|
||||
[Dependency] private readonly RingerSystem _ringerSystem = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -38,6 +40,13 @@ namespace Content.Server.PDA
|
||||
ui.OnReceiveMessage += (msg) => OnUIMessage(pda, msg);
|
||||
}
|
||||
|
||||
private void OnUse(EntityUid uid, PDAComponent pda, UseInHandEvent args)
|
||||
{
|
||||
if (args.Handled)
|
||||
return;
|
||||
args.Handled = OpenUI(pda, args.User);
|
||||
}
|
||||
|
||||
private void OnActivateInWorld(EntityUid uid, PDAComponent pda, ActivateInWorldEvent args)
|
||||
{
|
||||
if (args.Handled)
|
||||
@@ -175,6 +184,12 @@ namespace Content.Server.PDA
|
||||
_uplinkSystem.ToggleUplinkUI(uplink, msg.Session);
|
||||
break;
|
||||
}
|
||||
case PDAShowRingtoneMessage _:
|
||||
{
|
||||
if (EntityManager.TryGetComponent(pda.Owner, out RingerComponent? ringer))
|
||||
_ringerSystem.ToggleRingerUI(ringer, msg.Session);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user