예제 #1
0
    private void HandleObjPlacingInput()
    {
        bool add    = mouse.LeftButtonReleased;
        bool remove = mouse.RightButtonReleased;

        matchHeightLevelInput.Update();

        if (add || remove)
        {
            if (leftShiftInput.PressedDown)
            {
                if (add)
                {
                    objPlacer.PickObject(mouse.SelectedObject as HexObject);
                }
                else if (remove)
                {
                    objPlacer.MatchRotation(mouse.SelectedObject as HexObject);
                }
            }
            else if (leftCtrlInput.PressedDown)
            {
                grid.HideObjectsInCell(objPlacer.Coordinates, true, objPlacer.HeightLevelRoundedDown);
            }
            else if (leftAltInput.PressedDown)
            {
                if (add)
                {
                    objPlacer.AddOrRemoveObjectInSelectedCell(true, false);
                }
                else if (remove)
                {
                    objPlacer.AddOrRemoveObjectInSelectedCell(true, true);
                }
            }
            else
            {
                objPlacer.AddOrRemoveObjectInSelectedCell(false, remove);
            }
        }
        // Match height level
        else if (matchHeightLevelInput.JustPressedDown)
        {
            // TODO: Annoyingly preview movement and height change happen in different frames

            if (mouse.SelectedObject is HexObject)
            {
                objPlacer.HeightLevel = mouse.SelectedObject.HeightLevel;
                objPlacer.UpdatePreferredHeight();
            }
        }
    }
예제 #2
0
        public void AffectCellFullHeight()
        {
            switch (settings.EditMode)
            {
            case ObjectPlacer.EditMode.Add:
                objPlacer.HeightLevel = 1;
                objPlacer.AddOrRemoveObjectInSelectedCell(true, false);
                break;

            case ObjectPlacer.EditMode.Remove:
                objPlacer.AddOrRemoveObjectInSelectedCell(true, true);
                break;

            case ObjectPlacer.EditMode.Hide:
                grid.HideObjectsInCell(objPlacer.Coordinates, true, 0);
                break;
            }
        }