Faction Test 100.13.0.0
This commit is contained in:
@@ -293,11 +293,11 @@ namespace Barotrauma
|
||||
GUI.DrawRectangle(spriteBatch,
|
||||
new Vector2(drawRect.X, -drawRect.Y),
|
||||
new Vector2(rect.Width, rect.Height),
|
||||
Color.Blue * alpha, false, (ID % 255) * 0.000001f, (int)Math.Max(1.5f / Screen.Selected.Cam.Zoom, 1.0f));
|
||||
Color.Blue * alpha, false, (ID % 255) * 0.000001f, (int)Math.Max(MathF.Ceiling(1.5f / Screen.Selected.Cam.Zoom), 1.0f));
|
||||
|
||||
GUI.DrawRectangle(spriteBatch,
|
||||
new Rectangle(drawRect.X, -drawRect.Y, rect.Width, rect.Height),
|
||||
GUIStyle.Red * ((100.0f - OxygenPercentage) / 400.0f) * alpha, true, 0, (int)Math.Max(1.5f / Screen.Selected.Cam.Zoom, 1.0f));
|
||||
GUIStyle.Red * ((100.0f - OxygenPercentage) / 400.0f) * alpha, true, 0, (int)Math.Max(MathF.Ceiling(1.5f / Screen.Selected.Cam.Zoom), 1.0f));
|
||||
|
||||
if (GameMain.DebugDraw)
|
||||
{
|
||||
|
||||
@@ -544,9 +544,6 @@ namespace Barotrauma
|
||||
|
||||
Vector2 rectCenter = new Vector2(rect.Center.X, rect.Center.Y);
|
||||
Vector2 viewOffset = DrawOffset + drawOffsetNoise;
|
||||
|
||||
|
||||
bool cursorOnOverlay = false;
|
||||
if (HighlightedLocation != null)
|
||||
{
|
||||
Vector2 highlightedLocationDrawPos = rectCenter + (HighlightedLocation.MapPosition + viewOffset) * zoom;
|
||||
@@ -574,52 +571,41 @@ namespace Barotrauma
|
||||
{
|
||||
locationInfoRt.Pivot = locationInfoRt.Pivot == Pivot.TopLeft ? Pivot.TopRight : Pivot.BottomRight;
|
||||
}
|
||||
|
||||
Rectangle highlightedLocationRect = new Rectangle(highlightedLocationDrawPos.ToPoint(), new Point(GUI.IntScale(25)));
|
||||
Rectangle overlayRect = Rectangle.Union(highlightedLocationRect, locationInfoRt.Rect);
|
||||
if (overlayRect.Contains(PlayerInput.MousePosition))
|
||||
{
|
||||
cursorOnOverlay = true;
|
||||
}
|
||||
locationInfoOverlay?.AddToGUIUpdateList(order: 1);
|
||||
}
|
||||
|
||||
if (!cursorOnOverlay)
|
||||
float closestDist = 0.0f;
|
||||
HighlightedLocation = null;
|
||||
if ((GUI.MouseOn == null || GUI.MouseOn == mapContainer))
|
||||
{
|
||||
float closestDist = 0.0f;
|
||||
HighlightedLocation = null;
|
||||
if ((GUI.MouseOn == null || GUI.MouseOn == mapContainer))
|
||||
for (int i = 0; i < Locations.Count; i++)
|
||||
{
|
||||
for (int i = 0; i < Locations.Count; i++)
|
||||
Location location = Locations[i];
|
||||
if (IsInFogOfWar(location) && !(currentDisplayLocation?.Connections.Any(c => c.Locations.Contains(location)) ?? false) && !GameMain.DebugDraw) { continue; }
|
||||
|
||||
Vector2 pos = rectCenter + (location.MapPosition + viewOffset) * zoom;
|
||||
if (!rect.Contains(pos)) { continue; }
|
||||
|
||||
Sprite locationSprite = location.IsCriticallyRadiated() ? location.Type.RadiationSprite ?? location.Type.Sprite : location.Type.Sprite;
|
||||
float iconScale = generationParams.LocationIconSize / locationSprite.size.X;
|
||||
if (location == currentDisplayLocation) { iconScale *= 1.2f; }
|
||||
|
||||
Rectangle drawRect = locationSprite.SourceRect;
|
||||
drawRect.Width = (int)(drawRect.Width * iconScale * zoom * 1.4f);
|
||||
drawRect.Height = (int)(drawRect.Height * iconScale * zoom * 1.4f);
|
||||
drawRect.X = (int)pos.X - drawRect.Width / 2;
|
||||
drawRect.Y = (int)pos.Y - drawRect.Width / 2;
|
||||
|
||||
if (!drawRect.Contains(PlayerInput.MousePosition)) { continue; }
|
||||
|
||||
float dist = Vector2.Distance(PlayerInput.MousePosition, pos);
|
||||
if (HighlightedLocation == null || dist < closestDist)
|
||||
{
|
||||
Location location = Locations[i];
|
||||
if (IsInFogOfWar(location) && !(currentDisplayLocation?.Connections.Any(c => c.Locations.Contains(location)) ?? false) && !GameMain.DebugDraw) { continue; }
|
||||
|
||||
Vector2 pos = rectCenter + (location.MapPosition + viewOffset) * zoom;
|
||||
if (!rect.Contains(pos)) { continue; }
|
||||
|
||||
Sprite locationSprite = location.IsCriticallyRadiated() ? location.Type.RadiationSprite ?? location.Type.Sprite : location.Type.Sprite;
|
||||
float iconScale = generationParams.LocationIconSize / locationSprite.size.X;
|
||||
if (location == currentDisplayLocation) { iconScale *= 1.2f; }
|
||||
|
||||
Rectangle drawRect = locationSprite.SourceRect;
|
||||
drawRect.Width = (int)(drawRect.Width * iconScale * zoom * 1.4f);
|
||||
drawRect.Height = (int)(drawRect.Height * iconScale * zoom * 1.4f);
|
||||
drawRect.X = (int)pos.X - drawRect.Width / 2;
|
||||
drawRect.Y = (int)pos.Y - drawRect.Width / 2;
|
||||
|
||||
if (!drawRect.Contains(PlayerInput.MousePosition)) { continue; }
|
||||
|
||||
float dist = Vector2.Distance(PlayerInput.MousePosition, pos);
|
||||
if (HighlightedLocation == null || dist < closestDist)
|
||||
{
|
||||
closestDist = dist;
|
||||
HighlightedLocation = location;
|
||||
}
|
||||
closestDist = dist;
|
||||
HighlightedLocation = location;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (SelectedConnection != null)
|
||||
{
|
||||
|
||||
@@ -528,11 +528,11 @@ namespace Barotrauma
|
||||
Item targetContainer = null;
|
||||
bool isShiftDown = PlayerInput.IsShiftDown();
|
||||
|
||||
if (!isShiftDown) return null;
|
||||
if (!isShiftDown) { return null; }
|
||||
|
||||
foreach (MapEntity e in mapEntityList)
|
||||
{
|
||||
if (!e.SelectableInEditor ||!(e is Item potentialContainer)) { continue; }
|
||||
if (!e.SelectableInEditor || e is not Item potentialContainer) { continue; }
|
||||
|
||||
if (e.IsMouseOn(position))
|
||||
{
|
||||
|
||||
@@ -83,7 +83,10 @@ namespace Barotrauma
|
||||
{
|
||||
string errorMsg = "Failed to load sound file \"" + filename + "\" (file not found).";
|
||||
DebugConsole.ThrowError(errorMsg, e);
|
||||
GameAnalyticsManager.AddErrorEventOnce("RoundSound.LoadRoundSound:FileNotFound" + filename, GameAnalyticsManager.ErrorSeverity.Error, errorMsg + "\n" + Environment.StackTrace.CleanupStackTrace());
|
||||
if (!ContentPackageManager.ModsEnabled)
|
||||
{
|
||||
GameAnalyticsManager.AddErrorEventOnce("RoundSound.LoadRoundSound:FileNotFound" + filename, GameAnalyticsManager.ErrorSeverity.Error, errorMsg + "\n" + Environment.StackTrace.CleanupStackTrace());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
catch (System.IO.InvalidDataException e)
|
||||
|
||||
Reference in New Issue
Block a user