void MouseClick(GUIElement sender, MouseEventArgs e) { if (!BlockMode) { if ((ObjectType == "InterPortal") || (ObjectType == "IntraPortal")) { InputBoxFrame portalInputBox = new InputBoxFrame("New " + ObjectType, new string[] { "Portal ID", "ID of Portal To Link To" }); portalInputBox.SubmitInput += new FrameEventHandler( inputBox => EditorManager.PixelsToTile(new Vector2(currentMouseState.X, currentMouseState.Y)).addObjectContent(ObjectCreator.create(ObjectCreator.objectCodes.IndexOf(ObjectType), ((InputBoxFrame)inputBox).InputFields["Portal ID"].Text, ((InputBoxFrame)inputBox).InputFields["ID of Portal To Link To"].Text))); UIManager.AddAndLoad(portalInputBox); } else { EditorManager.PixelsToTile(new Vector2(currentMouseState.X, currentMouseState.Y)).addObjectContent(ObjectCreator.create(ObjectCreator.objectCodes.IndexOf(ObjectType))); } } }
void newGameButton_MouseClick(GUIElement sender, MouseEventArgs e) { // UNCOMMENT TO PICK MAP // GameEngine.Singleton.AddAndLoad(new PhysicsDemoState()); // GameEngine.Singleton.AddAndLoad(new ConsoleState ()); // GameEngine.Singleton.AddAndLoad(new BouncerDemoState()); // GameEngine.Singleton.AddAndLoad(new MapDemoState()); // GameEngine.Singleton.AddAndLoad(new GraphicsDemoState()); // GameEngine.Singleton.AddAndLoad(new GravityManipulationDemo()); // GameEngine.Singleton.AddAndLoad(new PuzzleDemoState()); // GameEngine.Singleton.AddAndLoad(new MapDemoState()); // GameEngine.Singleton.AddAndLoad(new EditorState()); // UIManager.AddAndLoad(new UserProfileFrame()); InputBoxFrame userProfileFrame = new InputBoxFrame("New Game", new string[] { "Enter Profile Name" }); userProfileFrame.SubmitInput += new FrameEventHandler( inputBox => GameEngine.Singleton.AddAndLoad( new TheGameState(((InputBoxFrame)inputBox).InputFields["Enter Profile Name"].Text, true))); UIManager.AddAndLoad(userProfileFrame); }