(ec990ac7c) Save chatbox & crew menu toggle state between rounds
This commit is contained in:
@@ -207,10 +207,10 @@ namespace Barotrauma
|
||||
break;
|
||||
}
|
||||
|
||||
if (IsAttached && attachTargetBody != null && deattachTimer < 0.0f)
|
||||
if (attachTargetBody != null && deattachTimer < 0.0f)
|
||||
{
|
||||
Entity entity = attachTargetBody.UserData as Entity;
|
||||
Submarine attachedSub = entity is Submarine sub ? sub : entity?.Submarine;
|
||||
Submarine attachedSub = entity is Submarine ? (Submarine)entity : entity?.Submarine;
|
||||
if (attachedSub != null)
|
||||
{
|
||||
float velocity = attachedSub.Velocity == Vector2.Zero ? 0.0f : attachedSub.Velocity.Length();
|
||||
|
||||
@@ -209,7 +209,6 @@ namespace Barotrauma
|
||||
|
||||
//isActive = false;
|
||||
|
||||
bool spawnReady = false;
|
||||
if (spawnPending)
|
||||
{
|
||||
//wait until there are no submarines at the spawnpos
|
||||
@@ -220,30 +219,24 @@ namespace Barotrauma
|
||||
if (Vector2.DistanceSquared(submarine.WorldPosition, spawnPos) < minDist * minDist) return;
|
||||
}
|
||||
|
||||
spawnPending = false;
|
||||
|
||||
//+1 because Range returns an integer less than the max value
|
||||
int amount = Rand.Range(minAmount, maxAmount + 1, Rand.RandSync.Server);
|
||||
monsters = new List<Character>();
|
||||
float offsetAmount = spawnPosType == Level.PositionType.MainPath ? 1000 : 100;
|
||||
for (int i = 0; i < amount; i++)
|
||||
{
|
||||
CoroutineManager.InvokeAfter(() =>
|
||||
{
|
||||
bool isClient = false;
|
||||
#if CLIENT
|
||||
isClient = GameMain.Client != null;
|
||||
#endif
|
||||
monsters.Add(Character.Create(characterFile, spawnPos + Rand.Vector(offsetAmount, Rand.RandSync.Server), i.ToString(), null, isClient, true, true));
|
||||
if (monsters.Count == amount)
|
||||
{
|
||||
spawnReady = true;
|
||||
}
|
||||
}, Rand.Range(0f, amount / 2, Rand.RandSync.Server));
|
||||
}
|
||||
}
|
||||
monsters = new Character[amount];
|
||||
|
||||
if (!spawnReady) { return; }
|
||||
for (int i = 0; i < amount; i++)
|
||||
{
|
||||
bool isClient = false;
|
||||
#if CLIENT
|
||||
isClient = GameMain.Client != null;
|
||||
#endif
|
||||
|
||||
monsters[i] = Character.Create(
|
||||
characterFile, spawnPos + Rand.Vector(100.0f, Rand.RandSync.Server),
|
||||
i.ToString(), null, isClient, true, true);
|
||||
}
|
||||
|
||||
spawnPending = false;
|
||||
}
|
||||
|
||||
Entity targetEntity = Submarine.FindClosest(GameMain.GameScreen.Cam.WorldViewCenter);
|
||||
#if CLIENT
|
||||
|
||||
@@ -150,6 +150,9 @@ namespace Barotrauma
|
||||
|
||||
public bool EnableMouseLook { get; set; } = true;
|
||||
|
||||
public bool CrewMenuOpen { get; set; } = true;
|
||||
public bool ChatOpen { get; set; } = true;
|
||||
|
||||
private bool unsavedSettings;
|
||||
public bool UnsavedSettings
|
||||
{
|
||||
@@ -847,6 +850,9 @@ namespace Barotrauma
|
||||
AimAssistAmount = doc.Root.GetAttributeFloat("aimassistamount", AimAssistAmount);
|
||||
EnableMouseLook = doc.Root.GetAttributeBool("enablemouselook", EnableMouseLook);
|
||||
|
||||
CrewMenuOpen = doc.Root.GetAttributeBool("crewmenuopen", CrewMenuOpen);
|
||||
ChatOpen = doc.Root.GetAttributeBool("chatopen", ChatOpen);
|
||||
|
||||
foreach (XElement subElement in doc.Root.Elements())
|
||||
{
|
||||
switch (subElement.Name.ToString().ToLowerInvariant())
|
||||
@@ -1022,7 +1028,9 @@ namespace Barotrauma
|
||||
new XAttribute("requiresteamauthentication", requireSteamAuthentication),
|
||||
new XAttribute("autoupdateworkshopitems", AutoUpdateWorkshopItems),
|
||||
new XAttribute("aimassistamount", aimAssistAmount),
|
||||
new XAttribute("enablemouselook", EnableMouseLook));
|
||||
new XAttribute("enablemouselook", EnableMouseLook),
|
||||
new XAttribute("chatopen", ChatOpen),
|
||||
new XAttribute("crewmenuopen", CrewMenuOpen));
|
||||
|
||||
if (!ShowUserStatisticsPrompt)
|
||||
{
|
||||
|
||||
@@ -44,6 +44,7 @@ namespace Barotrauma
|
||||
base.Deselect();
|
||||
|
||||
#if CLIENT
|
||||
GameMain.Config.SaveNewPlayerConfig();
|
||||
GameMain.SoundManager.SetCategoryMuffle("default", false);
|
||||
GUI.ClearMessages();
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user