public bool DoToggleAction(ToggleItemActionEventArgs args)
 {
     if (!args.Item.TryGetComponent <HandheldLightComponent>(out var lightComponent))
     {
         return(false);
     }
     if (lightComponent.Activated == args.ToggledOn)
     {
         return(false);
     }
     return(lightComponent.ToggleStatus(args.Performer));
 }
Exemple #2
0
 public bool DoToggleAction(ToggleItemActionEventArgs args)
 {
     if (!IoCManager.Resolve <IEntityManager>().TryGetComponent <HandheldLightComponent?>(args.Item, out var lightComponent))
     {
         return(false);
     }
     if (lightComponent.Activated == args.ToggledOn)
     {
         return(false);
     }
     return(EntitySystem.Get <HandheldLightSystem>().ToggleStatus(args.Performer, lightComponent));
 }
        public bool DoToggleAction(ToggleItemActionEventArgs args)
        {
            if (args.ToggledOn)
            {
                args.Performer.PopupMessageEveryone(args.Item.Name + ": " + MessageOn);
            }
            else
            {
                args.Performer.PopupMessageEveryone(args.Item.Name + ": " + MessageOff);
            }

            return(true);
        }
Exemple #4
0
 public bool DoToggleAction(ToggleItemActionEventArgs args)
 {
     if (!IoCManager.Resolve <IEntityManager>().TryGetComponent <GasTankComponent?>(args.Item, out var gasTankComponent))
     {
         return(false);
     }
     // no change
     if (gasTankComponent.IsConnected == args.ToggledOn)
     {
         return(false);
     }
     gasTankComponent.ToggleInternals();
     // did we successfully toggle to the desired status?
     return(gasTankComponent.IsConnected == args.ToggledOn);
 }
        public bool DoToggleAction(ToggleItemActionEventArgs args)
        {
            var entMan = IoCManager.Resolve <IEntityManager>();

            if (args.ToggledOn)
            {
                args.Performer.PopupMessageEveryone(entMan.GetComponent <MetaDataComponent>(args.Item).EntityName + ": " + MessageOn);
            }
            else
            {
                args.Performer.PopupMessageEveryone(entMan.GetComponent <MetaDataComponent>(args.Item).EntityName + ": " + MessageOff);
            }

            return(true);
        }
 public bool DoToggleAction(ToggleItemActionEventArgs args)
 {
     if (!args.Item.TryGetComponent <GasTankComponent>(out var gasTankComponent))
     {
         return(false);
     }
     // no change
     if (gasTankComponent.IsConnected == args.ToggledOn)
     {
         return(false);
     }
     gasTankComponent.ToggleInternals();
     // did we successfully toggle to the desired status?
     return(gasTankComponent.IsConnected == args.ToggledOn);
 }