Build 0.20.4.0
This commit is contained in:
@@ -811,7 +811,7 @@ namespace Barotrauma.Items.Components
|
||||
if (distSqr > t.SoundRange * t.SoundRange * 2) { continue; }
|
||||
|
||||
float dist = (float)Math.Sqrt(distSqr);
|
||||
if (dist > prevPassivePingRadius * Range && dist <= passivePingRadius * Range && Rand.Int(sonarBlips.Count) < 500)
|
||||
if (dist > prevPassivePingRadius * Range && dist <= passivePingRadius * Range && Rand.Int(sonarBlips.Count) < 500 && t.IsWithinSector(transducerCenter))
|
||||
{
|
||||
Ping(t.WorldPosition, transducerCenter,
|
||||
Math.Min(t.SoundRange, range * 0.5f) * displayScale, 0, displayScale, Math.Min(t.SoundRange, range * 0.5f),
|
||||
@@ -1276,7 +1276,7 @@ namespace Barotrauma.Items.Components
|
||||
float indicatorSector = sector * 0.75f;
|
||||
float indicatorSectorLength = (float)(midLength / Math.Cos(indicatorSector));
|
||||
|
||||
bool withinSector =
|
||||
bool withinSector =
|
||||
(Math.Abs(diff.X) < steering.ActiveDockingSource.DistanceTolerance.X && Math.Abs(diff.Y) < steering.ActiveDockingSource.DistanceTolerance.Y) ||
|
||||
Vector2.Dot(normalizedDockingDir, MathUtils.RotatePoint(normalizedDockingDir, indicatorSector)) <
|
||||
Vector2.Dot(normalizedDockingDir, Vector2.Normalize(dockingDir));
|
||||
|
||||
@@ -54,7 +54,7 @@ namespace Barotrauma.Items.Components
|
||||
|
||||
private bool? swapDestinationOrder;
|
||||
|
||||
private GUIMessageBox enterOutpostPrompt;
|
||||
private GUIMessageBox enterOutpostPrompt, exitOutpostPrompt;
|
||||
|
||||
private bool levelStartSelected;
|
||||
public bool LevelStartSelected
|
||||
@@ -382,9 +382,20 @@ namespace Barotrauma.Items.Components
|
||||
DockingSources.Any(d => d.Docked && (d.DockingTarget?.Item.Submarine?.Info?.IsOutpost ?? false)))
|
||||
{
|
||||
// Undocking from an outpost
|
||||
campaign.ShowCampaignUI = true;
|
||||
campaign.CampaignUI.SelectTab(CampaignMode.InteractionType.Map);
|
||||
return false;
|
||||
if (!ObjectiveManager.AllActiveObjectivesCompleted())
|
||||
{
|
||||
exitOutpostPrompt = new GUIMessageBox("",
|
||||
TextManager.GetWithVariable("CampaignExitTutorialOutpostPrompt", "[locationname]", campaign.Map.CurrentLocation.Name),
|
||||
new LocalizedString[] { TextManager.Get("yes"), TextManager.Get("no") });
|
||||
exitOutpostPrompt.Buttons[0].OnClicked += (_, _) =>
|
||||
{
|
||||
exitOutpostPrompt.Close();
|
||||
return OpenMap(campaign);
|
||||
};
|
||||
exitOutpostPrompt.Buttons[1].OnClicked += exitOutpostPrompt.Close;
|
||||
return false;
|
||||
}
|
||||
return OpenMap(campaign);
|
||||
}
|
||||
else if (!Level.IsLoadedOutpost && DockingModeEnabled && ActiveDockingSource != null &&
|
||||
!ActiveDockingSource.Docked && DockingTarget?.Item?.Submarine == Level.Loaded.StartOutpost && (DockingTarget?.Item?.Submarine?.Info.IsOutpost ?? false))
|
||||
@@ -419,6 +430,14 @@ namespace Barotrauma.Items.Components
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
bool OpenMap(CampaignMode campaign)
|
||||
{
|
||||
campaign.ShowCampaignUI = true;
|
||||
campaign.CampaignUI.SelectTab(CampaignMode.InteractionType.Map);
|
||||
return false;
|
||||
}
|
||||
|
||||
void SendDockingSignal()
|
||||
{
|
||||
if (GameMain.Client == null)
|
||||
@@ -431,6 +450,7 @@ namespace Barotrauma.Items.Components
|
||||
item.CreateClientEvent(this);
|
||||
}
|
||||
}
|
||||
|
||||
dockingButton.Font = GUIStyle.SubHeadingFont;
|
||||
dockingButton.TextBlock.RectTransform.MaxSize = new Point((int)(dockingButton.Rect.Width * 0.7f), int.MaxValue);
|
||||
dockingButton.TextBlock.AutoScaleHorizontal = true;
|
||||
@@ -913,6 +933,7 @@ namespace Barotrauma.Items.Components
|
||||
maintainPosOriginIndicator?.Remove();
|
||||
steeringIndicator?.Remove();
|
||||
enterOutpostPrompt?.Close();
|
||||
exitOutpostPrompt?.Close();
|
||||
pathFinder = null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user