public static bool Prefix(
            SituationToken __instance,
            Image ___ongoingSlotImage,
            Image ___ongoingSlotArtImage,
            GameObject ___ongoingSlotGreedyIcon,
            ParticleSystem ___ongoingSlotAppearFX
            )
        {
            return(Patcher.Run(() =>
            {
                if (!(Input.GetKey(KeyCode.LeftControl) || Input.GetKey(KeyCode.RightControl)))
                {
                    return true;
                }

                bool success = SituationAutomator.ToggleSituationAutomation(
                    __instance.SituationController,
                    ___ongoingSlotImage,
                    ___ongoingSlotArtImage,
                    ___ongoingSlotGreedyIcon,
                    ___ongoingSlotAppearFX
                    );

                if (!success)
                {
                    Registry.Retrieve <INotifier>().ShowNotificationWindow("I can't automate that -", "Only everyday tasks can be automated.");
                }

                return false;
            }));
        }
 public static bool Prefix(SituationToken __instance)
 {
     return(Patcher.Run(() =>
     {
         return !SituationAutomator.IsAutomated(__instance.SituationController);
     }));
 }
Ejemplo n.º 3
0
        // This runs right after a situation (verb) token is placed onto the table from elsewhere
        static void Postfix(ref SituationToken token, Context context)
        {
            float x = token.RectTransform.position.x;
            float y = token.RectTransform.position.y;

            Utility.Snap(ref x, ref y);
            token.RectTransform.position = new Vector3(x, y, token.RectTransform.position.z);
        }
Ejemplo n.º 4
0
 public static bool Available(SituationToken token)
 {
     return(!(
                token == null ||
                token.Equals(null) ||
                token.Defunct ||
                token.IsBeingAnimated
                ));
 }
Ejemplo n.º 5
0
        bool IsSituationOngoing(SituationToken situationToken)
        {
            var state = situationToken.SituationController.SituationClock.State;

            if (state == SituationState.Ongoing || state == SituationState.FreshlyStarted)
            {
                return(true);
            }
            return(false);
        }