public void SetAsCurrent(MyCameraBlock newCamera)
        {
            MyDebug.AssertDebug(newCamera != null);

            if (m_currentCamera == newCamera)
            {
                return;
            }

            if (newCamera.BlockDefinition.OverlayTexture != null)
            {
                MyHudCameraOverlay.TextureName = newCamera.BlockDefinition.OverlayTexture;
                MyHudCameraOverlay.Enabled     = true;
            }
            else
            {
                MyHudCameraOverlay.Enabled = false;
            }

            string shipName   = MyAntennaSystem.GetLogicalGroupRepresentative(m_grid).DisplayName ?? "";
            string cameraName = newCamera.DisplayNameText;

            MyHud.CameraInfo.Enable(shipName, cameraName);
            m_currentCamera   = newCamera;
            m_ignoreNextInput = true;

            MySessionComponentVoxelHand.Static.Enabled = false;
            MyCubeBuilder.Static.Deactivate();
        }
示例#2
0
        private static bool CheckConnection(MyEntity interactedEntityRepresentative, MyCubeGrid grid, MyPlayer player)
        {
            var connectedGrids     = MyAntennaSystem.GetMutuallyConnectedGrids(interactedEntityRepresentative, player);
            var gridRepresentative = MyAntennaSystem.GetLogicalGroupRepresentative(grid);

            foreach (var connectedGrid in connectedGrids)
            {
                if (connectedGrid.EntityId == gridRepresentative.EntityId)
                {
                    return(true);
                }
            }

            return(false);
        }
示例#3
0
 public static bool CheckConnection(MyCubeGrid interactedGrid, MyCubeGrid grid, MyPlayer player)
 {
     return(CheckConnection((MyEntity)MyAntennaSystem.GetLogicalGroupRepresentative(interactedGrid), grid, player));
 }