public void LoadContent() { tilesets = WorldBuilderUtils.GetTileSets(SimulationGame.ContentManager.RootDirectory + "\\Tiles"); Bounds = new Rect(SimulationGame.Resolution.Width * 2 / 3, 0, SimulationGame.Resolution.Width / 3, SimulationGame.Resolution.Height); tilesetSelectionArea = new Rect(Bounds.X, Bounds.Y + 120, Bounds.Width - 10, Bounds.Height); backgroundOverlay = new Texture2D(SimulationGame.Graphics.GraphicsDevice, 1, 1); backgroundOverlay.SetData(new Color[] { Color.White }); placeView = new BaseUI() { Bounds = new Rect(0, 0, SimulationGame.Resolution.Width * 2 / 3, SimulationGame.Resolution.Height) }; placeView.OnKeyPress(Keys.Escape, () => { if (placementMode == PlacementMode.CreateFromTileset) { tileSetSelectionView.Deselect(); } }); placeView.OnClick(placeObjectAtPosition); selectedObjectDetailTextView = new TextView(tilesetSelectionArea, ""); worldPartDetailsTextView = new TextView(tilesetSelectionArea, ""); inspectView = new InspectView(new Rect(0, 0, SimulationGame.Resolution.Width * 2 / 3, SimulationGame.Resolution.Height)); inspectView.OnSelect(handleInspectGameObjectSelection, handleInspectBlockSelection, handleInspectWorldLinkSelection); tileSetSelectionView = new TileSetSelectionView(tilesetSelectionArea); tilesetSelectionList = new ScrollableList(tilesetSelectionArea); tilesetSelectionList.OnSelect((UIElement selectedElement) => { placementMode = PlacementMode.CreateFromTileset; tileSetSelectionView.SetTileSet(((Button)selectedElement).Text); }); manageObjectList = new ScrollableList(tilesetSelectionArea); foreach (var tileset in tilesets) { var button = new Button(tileset, Point.Zero); button.ShowBorder = false; tilesetSelectionList.AddElement(button); } // Block Type Button blockTypeBtn = new Button("Blocks", new Point(Bounds.X, Bounds.Y + 10)); blockTypeBtn.OnClick(() => { placementType = PlacementType.BlockPlacement; handleManageBtnClick(); }); // Ambient Object Type Button ambientObjectTypeBtn = new Button("Ambient Objects", new Point(blockTypeBtn.Bounds.Right + 10, Bounds.Y + 10)); ambientObjectTypeBtn.OnClick(() => { placementType = PlacementType.AmbientObjectPlacement; handleManageBtnClick(); }); // Ambient Hitable Object Type Button ambientHitableObjectTypeBtn = new Button("Hitable Objects", new Point(ambientObjectTypeBtn.Bounds.Right + 10, Bounds.Y + 10)); ambientHitableObjectTypeBtn.OnClick(() => { placementType = PlacementType.AmbientHitableObjectPlacement; handleManageBtnClick(); }); // Ambient Hitable Object Type Button livingEntityTypeBtn = new Button("Living Entities", new Point(ambientHitableObjectTypeBtn.Bounds.Right + 10, Bounds.Y + 10)); livingEntityTypeBtn.OnClick(() => { placementType = PlacementType.LivingEntityPlacement; handleManageBtnClick(); }); // World Part Details Button worldPartBtn = new Button("World Details", new Point(livingEntityTypeBtn.Bounds.Right + 10, Bounds.Y + 10)); worldPartBtn.OnClick(() => { placementType = PlacementType.WorldPartDetails; placementMode = PlacementMode.NoPlacement; }); // Manage Button manageBtn = new Button("Manage", new Point(Bounds.X, blockTypeBtn.Bounds.Bottom + 10)); manageBtn.OnClick(handleManageBtnClick); // Create From Json createFromJsonBtn = new Button("Create From Json", new Point(manageBtn.Bounds.Right + 10, blockTypeBtn.Bounds.Bottom + 10)); createFromJsonBtn.OnClick(createNewObjectFromJson); // Create From Tileset createFromTilesetBtn = new Button("Create From Tileset", new Point(createFromJsonBtn.Bounds.Right + 10, blockTypeBtn.Bounds.Bottom + 10)); createFromTilesetBtn.OnClick(() => placementMode = PlacementMode.ChooseTileset); // Edit Btn editBtn = new Button("Edit", new Point(Bounds.X, manageBtn.Bounds.Bottom + 10)); editBtn.OnClick(editObject); // Create New From Btn createNewFromBtn = new Button("Create New From", new Point(editBtn.Bounds.Right + 10, manageBtn.Bounds.Bottom + 10)); createNewFromBtn.OnClick(createNewFrom); // Remove Btn removeBtn = new Button("Remove", new Point(createNewFromBtn.Bounds.Right + 10, manageBtn.Bounds.Bottom + 10)); removeBtn.OnClick(removeObject); // Create If not exist Btn createIfNotExistBtn = new Button("Create If Not Exist", new Point(Bounds.X, manageBtn.Bounds.Bottom + 10)); createIfNotExistBtn.OnClick(createNewObjectIfNotExists); // Create Btn createBtn = new Button("Create New", new Point(createIfNotExistBtn.Bounds.Right + 10, manageBtn.Bounds.Bottom + 10)); createBtn.OnClick(createNewObject); // Edit Instance Btn editInstanceBtn = new Button("Edit", new Point(Bounds.X, manageBtn.Bounds.Bottom + 10)); editInstanceBtn.OnClick(handleEditInstanceBtnClick); // Remove Instance Btn removeInstanceBtn = new Button("Remove", new Point(editInstanceBtn.Bounds.Right + 10, manageBtn.Bounds.Bottom + 10)); removeInstanceBtn.OnClick(handleRemoveInstanceBtnClick); // Show Instance Type Btn showInstanceTypeBtn = new Button("Show Type", new Point(removeInstanceBtn.Bounds.Right + 10, manageBtn.Bounds.Bottom + 10)); showInstanceTypeBtn.OnClick(handleShowInstanceTypeBtnClick); // Change Persistency Btn changePersistencyBtn = new Button("Change Persistency", new Point(Bounds.X, worldPartBtn.Bounds.Bottom + 10)); changePersistencyBtn.OnClick(handleChangePersistencyBtn); // Create WorldLink Btn createWorldLinkBtn = new Button("Create Worldlink", new Point(changePersistencyBtn.Bounds.Right + 10, worldPartBtn.Bounds.Bottom + 10)); createWorldLinkBtn.OnClick(handleCreateWorldLinkBtn); // Create Interior Btn createInteriorBtn = new Button("Create Interior", new Point(createWorldLinkBtn.Bounds.Right + 10, worldPartBtn.Bounds.Bottom + 10)); createInteriorBtn.OnClick(handleCreateInteriorBtn); // Change Interior Dimensions Btn changeInteriorDimensionsBtn = new Button("Change Dimensions", new Point(Bounds.X, manageBtn.Bounds.Bottom + 10)); changeInteriorDimensionsBtn.OnClick(hanleChangeInteriorDimensionsBtn); // Delete Interior Btn removeInteriorBtn = new Button("Remove Interior", new Point(changeInteriorDimensionsBtn.Bounds.Right + 10, manageBtn.Bounds.Bottom + 10)); removeInteriorBtn.OnClick(handleRemoveInteriorBtn); OnKeyPress(Keys.Delete, handleRemoveInstanceBtnClick); OnRightClick(() => { if (placementMode == PlacementMode.CreateFromTileset) { placementMode = PlacementMode.ChooseTileset; } }); OnKeyPress(Keys.Back, () => { if (placementMode == PlacementMode.CreateFromTileset) { placementMode = PlacementMode.ChooseTileset; } }); AddElement(blockTypeBtn); AddElement(ambientObjectTypeBtn); AddElement(ambientHitableObjectTypeBtn); AddElement(livingEntityTypeBtn); AddElement(worldPartBtn); }