public override void UpdateAfterSimulation10()
        {
            base.UpdateAfterSimulation10();
            if (!MyFakes.ENABLE_REMOTE_CONTROL)
            {
                return;
            }
            if (m_previousControlledEntity != null)
            {
                if (!RemoteIsInRangeAndPlayerHasAccess())
                {
                    RequestRelease(false);
                    if (MyGuiScreenTerminal.IsOpen && MyGuiScreenTerminal.InteractedEntity == this)
                    {
                        MyGuiScreenTerminal.Hide();
                    }
                }

                var receiver = GetFirstRadioReceiver();
                if (receiver != null)
                {
                    receiver.UpdateHud(true);
                }
            }
        }
        private void RequestControl()
        {
            if (!MyFakes.ENABLE_REMOTE_CONTROL)
            {
                return;
            }

            //Do not take control if you are already the controller
            if (MySession.ControlledEntity == this)
            {
                return;
            }

            //Double check because it can be called from toolbar
            if (!CanControl())
            {
                return;
            }

            if (MyGuiScreenTerminal.IsOpen)
            {
                MyGuiScreenTerminal.Hide();
            }

            //Temporary fix to prevent crashes on DS
            //This happens when remote control is triggered by a sensor or a timer block
            //We need to prevent this from happening at all
            if (MySession.ControlledEntity != null)
            {
                SyncObject.RequestUse(UseActionEnum.Manipulate, MySession.ControlledEntity);
            }
        }
Exemple #3
0
        public void SelectBlueprint()
        {
            if (MyGuiScreenTerminal.IsOpen)
            {
                MyGuiScreenTerminal.Hide();
            }

            RemoveProjection(false);
            var blueprintScreen = new MyGuiBlueprintScreen(m_clipboard);

            blueprintScreen.Closed += OnBlueprintScreen_Closed;
            MyGuiSandbox.AddScreen(blueprintScreen);
        }
        public void RequestSetView()
        {
            if (IsWorking)
            {
                MyHud.Notifications.Remove(m_hudNotification);
                MyHud.Notifications.Add(m_hudNotification);

                CubeGrid.GridSystems.CameraSystem.SetAsCurrent(this);
                SetView();
                if (MyGuiScreenTerminal.IsOpen)
                {
                    MyGuiScreenTerminal.Hide();
                }
            }
        }
        public void SetView()
        {
            if (!MyFakes.ENABLE_CAMERA_BLOCK)
            {
                return;
            }
            if (MySession.Static.CameraController is MyCameraBlock)
            {
                var oldCamera = MySession.Static.CameraController as MyCameraBlock;
                oldCamera.IsActive = false;
            }

            MySession.SetCameraController(MyCameraControllerEnum.Entity, this);
            if (MyGuiScreenTerminal.IsOpen)
            {
                MyGuiScreenTerminal.Hide();
            }

            SetFov(m_fov);

            IsActive = true;
        }