private static void GameLoop_DayEnding(object sender, DayEndingEventArgs e)
        {
            Log.T("DayEnding");

            // Save local (and/or persistent) community centre data
            BundleManager.Save(Bundles.CC);
        }
 private static void GameLoop_ReturnedToTitle(object sender, ReturnedToTitleEventArgs e)
 {
     // Local co-op farmhands should not clear custom area-bundle data
     if (!Context.IsSplitScreen || Context.IsMainPlayer)
     {
         BundleManager.Clear();
     }
 }
 internal static void DayStartedBehaviours(CommunityCenter cc)
 {
     // Load in new community centre area-bundle data if ready
     if (Bundles.IsAbandonedJojaMartBundleAvailableOrComplete())
     {
         Log.D("Community centre and abandoned joja-mart complete, doing nothing.",
               ModEntry.Config.DebugMode);
     }
     else if (Bundles.IsCommunityCentreDefinitelyComplete(cc))
     {
         Log.D("Community centre complete, unloading any bundle data.",
               ModEntry.Config.DebugMode);
         BundleManager.Save(cc);
     }
     else
     {
         Log.D("Community centre incomplete, loading bundle data.",
               ModEntry.Config.DebugMode);
         BundleManager.Load(cc);
     }
 }
示例#4
0
        public static bool InitAreaBundleConversions_Prefix(
            CommunityCenter __instance)
        {
            try
            {
                Dictionary <int, List <int> > areaBundleDict = Reflection.GetField
                                                               <Dictionary <int, List <int> > >
                                                                   (__instance, "areaToBundleDictionary")
                                                               .GetValue();

                if (Bundles.DefaultMaxArea > 0 &&
                    (areaBundleDict == null || areaBundleDict.Count == Bundles.DefaultMaxArea + 1))
                {
                    BundleManager.ReplaceAreaBundleConversions(cc: __instance);
                    return(false);
                }
            }
            catch (Exception e)
            {
                HarmonyPatches.ErrorHandler(e);
            }
            return(true);
        }