private static void CtorHK(On.Menu.MainMenu.orig_ctor orig, MainMenu self, ProcessManager manager, bool showRegionSpecificBkg) { orig(self, manager, showRegionSpecificBkg); // Move these SimpleButton sb = null; for (int i = 0; i < self.pages[0].subObjects.Count; i++) { if (self.pages[0].subObjects[i] is SimpleButton b) { if (b.signalText == "SINGLE PLAYER") { sb = b; } else { b.pos.y -= 40f; } } } if (sb != null) { self.pages[0].subObjects.Add(new SimpleButton(self, self.pages[0], "MULTIPLAYER", "COOP", new Vector2(sb.pos.x, sb.pos.y - 40f), sb.size)); } }
private static void MainMenu_ctor(On.Menu.MainMenu.orig_ctor orig, Menu.MainMenu self, ProcessManager manager, bool showRegionSpecificBkg) { orig(self, manager, showRegionSpecificBkg); startServer = new SimpleButton(self, self.pages[0], "START SERVER", "START_SERVER", new Vector2(200f, 400f), new Vector2(110f, 30f)); //startClient = new SimpleButton(self, self.pages[0], "START CLIENT", "START_CLIENT", new Vector2(startServer.pos.x + 120, startServer.pos.y), new Vector2(110f, 30f)); self.pages[0].subObjects.Add(startServer); //self.pages[0].subObjects.Add(startClient); }
static void MainMenuHook(On.Menu.MainMenu.orig_ctor orig, Menu.MainMenu self, ProcessManager manager, bool showRegionSpecificBkg) { orig(self, manager, showRegionSpecificBkg); RegionCastPlugin.Instance.Transmitter.SendUDP("Menu"); }