Replace IClickAlert with events (#30728)
* Replace IAlertClick with events * whoop * eek!
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using Content.Server.Popups;
|
||||
using Content.Shared.Abilities.Mime;
|
||||
using Content.Shared.Actions;
|
||||
using Content.Shared.Actions.Events;
|
||||
using Content.Shared.Alert;
|
||||
@@ -29,6 +30,9 @@ namespace Content.Server.Abilities.Mime
|
||||
base.Initialize();
|
||||
SubscribeLocalEvent<MimePowersComponent, ComponentInit>(OnComponentInit);
|
||||
SubscribeLocalEvent<MimePowersComponent, InvisibleWallActionEvent>(OnInvisibleWall);
|
||||
|
||||
SubscribeLocalEvent<MimePowersComponent, BreakVowAlertEvent>(OnBreakVowAlert);
|
||||
SubscribeLocalEvent<MimePowersComponent, RetakeVowAlertEvent>(OnRetakeVowAlert);
|
||||
}
|
||||
|
||||
public override void Update(float frameTime)
|
||||
@@ -99,6 +103,22 @@ namespace Content.Server.Abilities.Mime
|
||||
args.Handled = true;
|
||||
}
|
||||
|
||||
private void OnBreakVowAlert(Entity<MimePowersComponent> ent, ref BreakVowAlertEvent args)
|
||||
{
|
||||
if (args.Handled)
|
||||
return;
|
||||
BreakVow(ent, ent);
|
||||
args.Handled = true;
|
||||
}
|
||||
|
||||
private void OnRetakeVowAlert(Entity<MimePowersComponent> ent, ref RetakeVowAlertEvent args)
|
||||
{
|
||||
if (args.Handled)
|
||||
return;
|
||||
RetakeVow(ent, ent);
|
||||
args.Handled = true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Break this mime's vow to not speak.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user