add lock uplink button (#15994)
Co-authored-by: deltanedas <@deltanedas:kde.org>
This commit is contained in:
@@ -137,6 +137,15 @@ namespace Content.Server.PDA
|
||||
_store.ToggleUi(msg.Session.AttachedEntity!.Value, uid, store);
|
||||
break;
|
||||
}
|
||||
case PDALockUplinkMessage _:
|
||||
{
|
||||
if (TryComp<RingerUplinkComponent>(uid, out var uplink))
|
||||
{
|
||||
_ringer.LockUplink(uid, uplink);
|
||||
UpdatePdaUi(uid, pda);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -79,6 +79,21 @@ namespace Content.Server.PDA.Ringer
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Locks the uplink and closes the window, if its open
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Will not update the PDA ui so you must do that yourself if needed
|
||||
/// </remarks>
|
||||
public void LockUplink(EntityUid uid, RingerUplinkComponent? uplink)
|
||||
{
|
||||
if (!Resolve(uid, ref uplink, true))
|
||||
return;
|
||||
|
||||
uplink.Unlocked = false;
|
||||
_ui.TryCloseAll(uid, StoreUiKey.Key);
|
||||
}
|
||||
|
||||
public void RandomizeRingtone(EntityUid uid, RingerComponent ringer, MapInitEvent args)
|
||||
{
|
||||
UpdateRingerRingtone(ringer, GenerateRingtone());
|
||||
|
||||
Reference in New Issue
Block a user