コード例 #1
0
        public override void FrameUpdate(FrameEventArgs e)
        {
            placementManager.FrameUpdate(e);
            _entityManager.FrameUpdate(e.DeltaSeconds);

            var mousePosWorld = eyeManager.ScreenToWorld(new ScreenCoordinates(inputManager.MouseScreenPosition));
            var entityToClick = GetEntityUnderPosition(mousePosWorld);

            if (entityToClick == lastHoveredEntity)
            {
                return;
            }

            if (lastHoveredEntity != null && !lastHoveredEntity.Deleted)
            {
                lastHoveredEntity.GetComponent <IClientClickableComponent>().OnMouseLeave();
            }

            lastHoveredEntity = entityToClick;

            if (lastHoveredEntity != null)
            {
                lastHoveredEntity.GetComponent <IClientClickableComponent>().OnMouseEnter();
            }
        }
コード例 #2
0
        public override void FrameUpdate(RenderFrameEventArgs e)
        {
            placementManager.FrameUpdate(e);
            _entityManager.FrameUpdate(e.Elapsed);

            var     map           = playerManager.LocalPlayer.ControlledEntity.GetComponent <ITransformComponent>().MapID;
            var     mousePosWorld = eyeManager.ScreenToWorld(new ScreenCoordinates(inputManager.MouseScreenPosition, map));
            IEntity entityToClick = GetEntityUnderPosition(mousePosWorld);

            if (entityToClick == lastHoveredEntity)
            {
                return;
            }

            if (lastHoveredEntity != null)
            {
                lastHoveredEntity.GetComponent <IClientClickableComponent>().OnMouseLeave();
            }

            lastHoveredEntity = entityToClick;

            if (lastHoveredEntity != null)
            {
                lastHoveredEntity.GetComponent <IClientClickableComponent>().OnMouseEnter();
            }
        }
コード例 #3
0
        private void Update(FrameEventArgs frameEventArgs)
        {
            _clyde.FrameProcess(frameEventArgs);
            _modLoader.BroadcastUpdate(ModUpdateLevel.FramePreEngine, frameEventArgs);
            _stateManager.FrameUpdate(frameEventArgs);

            if (_client.RunLevel >= ClientRunLevel.Connected)
            {
                _placementManager.FrameUpdate(frameEventArgs);
                _entityManager.FrameUpdate(frameEventArgs.DeltaSeconds);
            }

            _overlayManager.FrameUpdate(frameEventArgs);
            _userInterfaceManager.FrameUpdate(frameEventArgs);
            _modLoader.BroadcastUpdate(ModUpdateLevel.FramePostEngine, frameEventArgs);
        }
コード例 #4
0
        public override void FrameUpdate(FrameEventArgs e)
        {
            placementManager.FrameUpdate(e);
            _entityManager.FrameUpdate(e.DeltaSeconds);

            var mousePosWorld = eyeManager.ScreenToWorld(new ScreenCoordinates(inputManager.MouseScreenPosition));
            var entityToClick = GetEntityUnderPosition(mousePosWorld);

            var inRange = false;

            if (playerManager.LocalPlayer.ControlledEntity != null && entityToClick != null)
            {
                var playerPos = playerManager.LocalPlayer.ControlledEntity.Transform.GridPosition;
                var entityPos = entityToClick.Transform.GridPosition;
                var distance  = playerPos.Distance(_mapManager, entityPos);
                inRange = distance <= VerbUtility.InteractionRange;
            }

            InteractionOutlineComponent outline;

            if (entityToClick == lastHoveredEntity)
            {
                if (entityToClick != null && entityToClick.TryGetComponent(out outline))
                {
                    outline.UpdateInRange(inRange);
                }
                return;
            }

            if (lastHoveredEntity != null && !lastHoveredEntity.Deleted &&
                lastHoveredEntity.TryGetComponent(out outline))
            {
                outline.OnMouseLeave();
            }

            lastHoveredEntity = entityToClick;

            if (lastHoveredEntity != null && lastHoveredEntity.TryGetComponent(out outline))
            {
                outline.OnMouseEnter(inRange);
            }
        }
コード例 #5
0
 public override void FrameUpdate(RenderFrameEventArgs e)
 {
     placementManager.FrameUpdate(e);
     _entityManager.FrameUpdate(e.Elapsed);
 }
コード例 #6
0
ファイル: StateBase.cs プロジェクト: zamp/space-station-14
 public override void FrameUpdate(FrameEventArgs e)
 {
     _placementManager.FrameUpdate(e);
     _entityManager.FrameUpdate(e.DeltaSeconds);
 }