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); })); }
// 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); }
public static bool Available(SituationToken token) { return(!( token == null || token.Equals(null) || token.Defunct || token.IsBeingAnimated )); }
bool IsSituationOngoing(SituationToken situationToken) { var state = situationToken.SituationController.SituationClock.State; if (state == SituationState.Ongoing || state == SituationState.FreshlyStarted) { return(true); } return(false); }