public virtual TileAtmosphere?GetTile(EntityCoordinates coordinates, bool createSpace = true) { return(GetTile(coordinates.ToVector2i(_serverEntityManager, _mapManager), createSpace)); }
protected override void FrameUpdate(FrameEventArgs args) { if (!VisibleInTree) { return; } var stringBuilder = new StringBuilder(); var mouseScreenPos = _inputManager.MouseScreenPosition; var screenSize = _displayManager.ScreenSize; MapCoordinates mouseWorldMap; EntityCoordinates mouseGridPos; TileRef tile; mouseWorldMap = _eyeManager.ScreenToMap(mouseScreenPos); if (_mapManager.TryFindGridAt(mouseWorldMap, out var mouseGrid)) { mouseGridPos = mouseGrid.MapToGrid(mouseWorldMap); tile = mouseGrid.GetTileRef(mouseGridPos); } else { mouseGridPos = new EntityCoordinates(_mapManager.GetMapEntityId(mouseWorldMap.MapId), mouseWorldMap.Position); tile = new TileRef(mouseWorldMap.MapId, GridId.Invalid, mouseGridPos.ToVector2i(_entityManager, _mapManager), Tile.Empty); } var controlHovered = UserInterfaceManager.CurrentlyHovered; stringBuilder.AppendFormat(@"Positioning Debug: Screen Size: {0} Mouse Pos: Screen: {1} {2} {3} {4} GUI: {5}", screenSize, mouseScreenPos, mouseWorldMap, mouseGridPos, tile, controlHovered); stringBuilder.AppendLine("\nAttached Entity:"); if (_playerManager.LocalPlayer?.ControlledEntity == null) { stringBuilder.AppendLine("No attached entity."); } else { var entityTransform = _playerManager.LocalPlayer.ControlledEntity.Transform; var playerWorldOffset = entityTransform.MapPosition; var playerScreen = _eyeManager.WorldToScreen(playerWorldOffset.Position); var playerCoordinates = _playerManager.LocalPlayer.ControlledEntity.Transform.Coordinates; stringBuilder.AppendFormat(@" Screen: {0} {1} {2} EntId: {3} GridID: {4}", playerScreen, playerWorldOffset, playerCoordinates, entityTransform.Owner.Uid, entityTransform.GridID); } if (controlHovered != null) { _uiBox = UIBox2i.FromDimensions(controlHovered.GlobalPixelPosition, controlHovered.PixelSize); } _contents.Text = stringBuilder.ToString(); MinimumSizeChanged(); }