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(); } }
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(); } }
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); }
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); } }
public override void FrameUpdate(RenderFrameEventArgs e) { placementManager.FrameUpdate(e); _entityManager.FrameUpdate(e.Elapsed); }
public override void FrameUpdate(FrameEventArgs e) { _placementManager.FrameUpdate(e); _entityManager.FrameUpdate(e.DeltaSeconds); }