// Open replay editor on start to prevent null references to replay editor instance public void Start() { MultiplayerController.Instance = this; if (ReplayEditorController.Instance == null) { GameManagement.GameStateMachine.Instance.ReplayObject.SetActive(true); StartCoroutine(TurnOffReplay()); } uiBox = ModMenu.Instance.RegisterModMaker("Silentbaws", "Silentbaws", 5); uiBox.AddCustom("Player List", PlayerListOnGUI, () => isConnected); uiBox.AddCustom("Network Stats", NetworkStatsOnGUI, () => isConnected); }
public void Start() { customObjectName = ""; spawnableObjectNames = new string[] { "MiniRamp", "RoundRail", "Level", "Big Stairs", "CokeMachine", "Sign", "Plane", "Hubba" }; ModMenu.Instance.RegisterTempHideMenu(Main.modId, () => (showSpawnMenu || showPlacementMenu) ? 1 : 0); ModUIBox uiBoxSalty = ModMenu.Instance.RegisterModMaker("salty", "Salty", -1); uiBoxSalty.AddCustom(() => { if (GUILayout.Button("Open Map Object Spawner", GUILayout.Height(30f))) { this.showSpawnMenu = true; } }, () => Main.enabled); ModMenu.Instance.RegisterShowCursor(Main.modId, () => (showSpawnMenu || showPlacementMenu) ? 1 : 0); }
public void Start() { modMenuBox = ModMenu.Instance.RegisterModMaker("randomer679", "randomer679"); modMenuBox.AddToggle("noflip.disableafterpop", "Disable after pop: ", Side.left, () => Main.enabled, Main.settings.disableAfterPop && Main.enabled, (b) => Main.settings.disableAfterPop = b); modMenuBox.AddToggle("noflip.timeoutenable", "Activate timeout: ", Side.left, () => Main.enabled, Main.settings.timeoutEnable && Main.enabled, (b) => Main.settings.timeoutEnable = b); modMenuBox.AddToggle("noflip.disableafterrespawn", "Disable after respawn: ", Side.right, () => Main.enabled, Main.settings.disableAfterRespawn && Main.enabled, (b) => Main.settings.disableAfterRespawn = b); modMenuBox.AddCustom("noflip.timeoutdelay", () => { DrawInput(); }, () => Main.enabled); }
public void Start() { uiBox = ModMenu.Instance.RegisterModMaker("Macks_Babbo", "MacksHeadroom, Babbo Elu"); customSlider = uiBox.AddCustom(sliderID, () => { drawgui(); }, () => Main.enabled); sliderTextValues = new Dictionary <string, string>(); }
public void Start() { uiBox = ModMenu.Instance.RegisterModMaker("salty", "Salty", -1); uiBox.AddCustom("open-object-spawner", () => { if (GUILayout.Button("Open Map Object Spawner", GUILayout.Height(30f))) { ShowSpawnMenu(); } }, () => Main.enabled); LoadPlaceableObjects(); }
public void Start() { ModMenu.Instance.RegisterTempHideMenu(Main.modId, () => (showSpawnMenu || showPlacementMenu) ? 1 : 0); ModUIBox uiBoxSalty = ModMenu.Instance.RegisterModMaker("salty", "Salty", -1); uiBoxSalty.AddCustom(() => { if (GUILayout.Button("Open Map Object Spawner", GUILayout.Height(30f))) { this.showSpawnMenu = true; } }, () => Main.enabled); ModMenu.Instance.RegisterShowCursor(Main.modId, () => (showSpawnMenu || showPlacementMenu) ? 1 : 0); LoadPlaceableObjects(); }
static bool OnToggle(UnityModManager.ModEntry modEntry, bool value) { if (value == enabled) { return(true); } enabled = value; if (enabled) { //Patch the replay editor harmonyInstance = HarmonyInstance.Create(modEntry.Info.Id); harmonyInstance.PatchAll(Assembly.GetExecutingAssembly()); menu = ModMenu.Instance.gameObject.AddComponent <MultiplayerMenu>(); utilityMenu = ModMenu.Instance.gameObject.AddComponent <MultiplayerUtilityMenu>(); uiBox = ModMenu.Instance.RegisterModMaker("Silentbaws", "Silentbaws", 0); uiBox.AddCustom("Patreon", DisplayPatreon, () => enabled); MultiplayerUtils.StartMapLoading(); } else { //Unpatch the replay editor harmonyInstance.UnpatchAll(harmonyInstance.Id); MultiplayerUtils.StopMapLoading(); if (multiplayerController != null) { multiplayerController.DisconnectFromServer(); } menu.CloseMultiplayerMenu(); UnityEngine.Object.Destroy(menu); UnityEngine.Object.Destroy(utilityMenu); } return(true); }
private static bool Load(UnityModManager.ModEntry modEntry) { Main.modId = modEntry.Info.Id; HarmonyInstance harmonyInstance = HarmonyInstance.Create(modEntry.Info.Id); harmonyInstance.PatchAll(Assembly.GetExecutingAssembly()); modEntry.OnToggle = OnToggle; ModUIBox uiBoxOmniscient = ModMenu.Instance.RegisterModMaker("com.Omniscient", "Omniscient"); uiBoxOmniscient.AddCustom(() => { if (GUILayout.Button("Skin Editor", GUILayout.Height(30f))) { SkinEditor.show = true; } }, () => enabled); ModMenu.Instance.RegisterShowCursor(Main.modId, () => SkinEditor.show ? 1 : 0); ModMenu.Instance.gameObject.AddComponent <SkinEditor>(); return(true); }