internal static void Patch() { EntoFramework.Logger.Log("GamePatcher: Patching greenhouse...", StardewModdingAPI.LogLevel.Trace); EntoFramework.GetLocationHelper().SetTileProperty(Game1.getLocationFromName("Farm"), "Buildings", 28, 15, "Action", "NewGreenhouse"); if (EntoFramework.GetLocationHelper().GetTileProperty(Game1.getLocationFromName("Farm"), "Buildings", 28, 15, "Action") != "NewGreenhouse") { EntoFramework.Logger.Log("Setting the greenhouse tile action failed!", StardewModdingAPI.LogLevel.Error); } foreach (Warp warp in Game1.getLocationFromName("Greenhouse").warps) { if (warp.TargetName != "Farm") { continue; } Greenhouse = new Point(warp.X, warp.Y - 1); break; } if (Greenhouse == null) { EntoFramework.Logger.Log("Unable to find the greenhouse exit warp to use as a reference for entering the greenhouse!", StardewModdingAPI.LogLevel.Error); } else { EntoFramework.Logger.Log($"GamePatcher: Greenhouse exit warp found at [{Greenhouse.X},{Greenhouse.Y+1}], player will enter greenhouse at [{Greenhouse.X},{Greenhouse.Y}]", StardewModdingAPI.LogLevel.Trace); } }
internal static void DoChecks() { new Thread(() => { try { EntoFramework.Logger.Log("Checking for updates...", LogLevel.Info); foreach (VersionCheck check in cache) { VersionInfo info = Get(check.Url); if (info == null) { EntoFramework.Logger.Log("Could not check for updates to " + check.Mod + ", if you are not connected to the internet you can ignore this error.", LogLevel.Error); } else if (info.Minimum > check.Version) { if (EntoFramework.Config.IngameUpdateNotices) { EntoFramework.GetMessageBox().receiveMessage("Critical " + check.Mod + " update", "VersionChecker", new Microsoft.Xna.Framework.Color(255, 0, 0)); } EntoFramework.Logger.Log("A critical update for " + check.Mod + " is available, you should update immediately!", LogLevel.Warn); } else if (info.Recommended > check.Version) { if (EntoFramework.Config.IngameUpdateNotices) { EntoFramework.GetMessageBox().receiveMessage("Recommended " + check.Mod + " update", "VersionChecker", new Microsoft.Xna.Framework.Color(255, 128, 0)); } EntoFramework.Logger.Log("A recommended update for " + check.Mod + " is available, you should update as soon as possible.", LogLevel.Alert); } else if (info.Latest > check.Version) { if (EntoFramework.Config.IngameUpdateNotices) { EntoFramework.GetMessageBox().receiveMessage("Optional" + check.Mod + " update", "VersionChecker", new Microsoft.Xna.Framework.Color(0, 0, 255)); } EntoFramework.Logger.Log("A optional update for " + check.Mod + " is available.", LogLevel.Info); } else { EntoFramework.Logger.Log("You have the latest available version of " + check.Mod + " installed.", LogLevel.Trace); } } EntoFramework.Logger.Log("Update checks have been completed.", LogLevel.Info); } catch (Exception err) { EntoFramework.Logger.Log("Ran into a unknown issue while performing the version check:" + Environment.NewLine + err.Message + Environment.NewLine + err.StackTrace, LogLevel.Error); } }).Start(); }