private void OnGameLaunched(object sender, EventArgs e) { TileActionHandler.Initialize(Helper); ImageMenu.Setup(Helper); MapMenu.Setup(Helper); TrashCans.Setup(Helper); RSVWorldMap.Setup(Helper); ExternalAPIs.Initialize(Helper); Config = Helper.ReadConfig <ModConfig>(); if (!Helper.ModRegistry.IsLoaded("spacechase0.JsonAssets")) { Log.Error("JSON Assets is not loaded! This mod *requires* JSON Assets!"); return; } // Custom CP Token Set-up CustomCPTokens.RegisterTokens(); Helper.ConsoleCommands.Add("RSV_reset_pedestals", "", ResetPedestals); Helper.ConsoleCommands.Add("RSV_open_portal", "", OpenPortal); // RSV_rivera_secret in Patches/WalletItem // Generic Mod Config Menu setup ConfigMenu.RegisterMenu(); }
internal static bool MapPage_receiveLeftClick_Prefix(int x, int y, bool playSound) { if (ButtonArea.Contains(x, y)) { RSVWorldMap.Open(Game1.activeClickableMenu); return(false); } return(true); }
internal static void Open(IClickableMenu gameMenu) { if (gameMenu is GameMenu menu) { Texture2D image = Helper.Content.Load <Texture2D>(MapPath, ContentSource.GameContent); Vector2 topLeft = Utility.getTopLeftPositionForCenteringOnScreen((int)(image.Width), (int)(image.Height)); var mapMenu = new RSVWorldMap((int)topLeft.X, (int)topLeft.Y, image); menu.SetChildMenu(mapMenu); } }
internal static void GameMenu_ChangeTab_PostFix(ref GameMenu __instance, int whichTab, bool playSound = true) { try { if (whichTab == GameMenu.mapTab && Game1.currentLocation.Name.StartsWith("Custom_Ridgeside")) { RSVWorldMap.Open(Game1.activeClickableMenu); } } catch (Exception e) { Log.Error($"Harmony patch \"{nameof(GameMenu_ChangeTab_PostFix)}\" has encountered an error. \n{e.ToString()}"); } }