private void OnInteractUsing(EntityUid uid, AMEControllerComponent component, InteractUsingEvent args) { if (!TryComp(args.User, out HandsComponent? hands)) { _popupSystem.PopupEntity(Loc.GetString("ame-controller-component-interact-using-no-hands-text"), uid, Filter.Entities(args.User)); return; } if (HasComp <AMEFuelContainerComponent?>(args.Used)) { if (component.HasJar) { _popupSystem.PopupEntity(Loc.GetString("ame-controller-component-interact-using-already-has-jar"), uid, Filter.Entities(args.User)); } else { component.JarSlot.Insert(args.Used); _popupSystem.PopupEntity(Loc.GetString("ame-controller-component-interact-using-success"), uid, Filter.Entities(args.User)); component.UpdateUserInterface(); } } else { _popupSystem.PopupEntity(Loc.GetString("ame-controller-component-interact-using-fail"), uid, Filter.Entities(args.User)); } }
private static void OnAMEPowerChange(EntityUid uid, AMEControllerComponent component, PowerChangedEvent args) { component.UpdateUserInterface(); }