Ejemplo n.º 1
0
        private void AddInsertVerb(EntityUid uid, ReagentDispenserComponent component, GetInteractionVerbsEvent args)
        {
            if (args.Using == null ||
                !args.CanAccess ||
                !args.CanInteract ||
                component.HasBeaker ||
                !args.Using.HasComponent <FitsInDispenserComponent>() ||
                !_actionBlockerSystem.CanDrop(args.User))
            {
                return;
            }

            if (!args.Using.HasComponent <FitsInDispenserComponent>() ||
                !_solutionContainerSystem.TryGetSolution(args.Using.Uid, "beaker", out _))
            {
                return;
            }

            Verb verb = new();

            verb.Act = () =>
            {
                component.BeakerContainer.Insert(args.Using);
                component.UpdateUserInterface();
            };
            verb.Category = VerbCategory.Insert;
            verb.Text     = args.Using.Name;
            args.Verbs.Add(verb);
        }
Ejemplo n.º 2
0
        // TODO VERBS EJECTABLES Standardize eject/insert verbs into a single system? Maybe using something like the
        // system mentioned in #4538? The code here is basically identical to the stuff in ChemDispenserSystem.
        private void AddEjectVerb(EntityUid uid, ReagentDispenserComponent component, GetAlternativeVerbsEvent args)
        {
            if (args.Hands == null ||
                !args.CanAccess ||
                !args.CanInteract ||
                !component.HasBeaker ||
                !_actionBlockerSystem.CanPickup(args.User))
            {
                return;
            }

            Verb verb = new();

            verb.Act = () =>
            {
                component.TryEject(args.User);
                component.UpdateUserInterface();
            };
            verb.Category = VerbCategory.Eject;
            verb.Text     = component.BeakerContainer.ContainedEntity !.Name;

            args.Verbs.Add(verb);
        }
Ejemplo n.º 3
0
 private void OnSolutionChange(EntityUid uid, ReagentDispenserComponent component, SolutionChangedEvent args)
 {
     component.UpdateUserInterface();
 }