Examine prediction (#23565)

* Initial prediction

* new group handling

* groups for all examines that use multiple rn

* compile

* why was it doing this??

* handle newlines with sorting properly
This commit is contained in:
Kara
2024-01-05 23:53:13 -07:00
committed by GitHub
parent 731cfc278a
commit 0ae3858b69
41 changed files with 693 additions and 431 deletions

View File

@@ -25,7 +25,7 @@ namespace Content.Server.Stunnable.Systems
{
base.Initialize();
SubscribeLocalEvent<BatteryComponent, ExaminedEvent>(OnExamined);
SubscribeLocalEvent<StunbatonComponent, ExaminedEvent>(OnExamined);
SubscribeLocalEvent<StunbatonComponent, SolutionContainerChangedEvent>(OnSolutionChange);
SubscribeLocalEvent<StunbatonComponent, StaminaDamageOnHitAttemptEvent>(OnStaminaHitAttempt);
SubscribeLocalEvent<StunbatonComponent, ItemToggleActivateAttemptEvent>(TryTurnOn);
@@ -47,16 +47,12 @@ namespace Content.Server.Stunnable.Systems
}
}
private void OnExamined(Entity<BatteryComponent> entity, ref ExaminedEvent args)
private void OnExamined(Entity<StunbatonComponent> entity, ref ExaminedEvent args)
{
var onMsg = _itemToggle.IsActivated(entity.Owner)
? Loc.GetString("comp-stunbaton-examined-on")
: Loc.GetString("comp-stunbaton-examined-off");
args.PushMarkup(onMsg);
var chargeMessage = Loc.GetString("stunbaton-component-on-examine-charge",
("charge", (int) (entity.Comp.CurrentCharge / entity.Comp.MaxCharge * 100)));
args.PushMarkup(chargeMessage);
}
private void ToggleDone(Entity<StunbatonComponent> entity, ref ItemToggledEvent args)