Esempio n. 1
0
        private void handleInspectBlockSelection(BlockType blockType)
        {
            placementType = PlacementType.BlockPlacement;
            placementMode = PlacementMode.Manage;
            manageObjectList.Clear();

            UIElement selectedItem = null;

            foreach (var item in BlockType.lookup)
            {
                var newItem = new BlockListItem(item.Value);

                if (item.Value == blockType)
                {
                    selectedItem = newItem;
                }

                manageObjectList.AddElement(newItem);
            }

            if (SimulationGame.KeyboardState.IsKeyDown(Keys.LeftControl) || SimulationGame.KeyboardState.IsKeyDown(Keys.RightControl))
            {
                manageObjectList.SelectElement(selectedItem);

                placeView.OnClick(placeObjectAtPosition);
            }
            else
            {
                manageObjectList.ScrollToElement(selectedItem);
            }
        }