Merge branch 'dev' of https://github.com/Regalis11/Barotrauma.git into unstable-tests

This commit is contained in:
Evil Factory
2022-04-08 12:52:28 -03:00
990 changed files with 44338 additions and 38589 deletions
@@ -58,10 +58,13 @@ namespace Barotrauma
cam.Position = Submarine.MainSub.WorldPosition;
cam.UpdateTransform(true);
}
GameMain.GameSession?.CrewManager?.AutoShowCrewList();
#endif
foreach (MapEntity entity in MapEntity.mapEntityList)
{
entity.IsHighlighted = false;
}
#if RUN_PHYSICS_IN_SEPARATE_THREAD
var physicsThread = new Thread(ExecutePhysics)
@@ -78,7 +81,11 @@ namespace Barotrauma
base.Deselect();
#if CLIENT
GameMain.Config.SaveNewPlayerConfig();
var config = GameSettings.CurrentConfig;
config.CrewMenuOpen = CrewManager.PreferCrewMenuOpen;
config.ChatOpen = ChatBox.PreferChatBoxOpen;
GameSettings.SetCurrentConfig(config);
GameSettings.SaveCurrentConfig();
GameMain.SoundManager.SetCategoryMuffle("default", false);
GUI.ClearMessages();
#endif
@@ -115,37 +122,6 @@ namespace Barotrauma
}
}
}
#if LINUX
// disgusting
if (PlayerInput.KeyDown(Keys.RightShift) && Character.Controlled is { CharacterHealth: { } health } && PlayerInput.MouseSpeed != Vector2.Zero)
{
AfflictionPrefab radiationPrefab = AfflictionPrefab.RadiationSickness;
float afflictionAmount = (PlayerInput.MousePosition.X / GameMain.GraphicsWidth) * radiationPrefab.MaxStrength;
Affliction affliction = health.GetAffliction(radiationPrefab.Identifier, true);
if (affliction == null)
{
health.ApplyAffliction(null, new Affliction(radiationPrefab, Math.Abs(afflictionAmount)));
}
else
{
float diff = affliction.Strength - afflictionAmount;
if (!MathUtils.NearlyEqual(diff, 0))
{
if (diff > 0)
{
health.ReduceAffliction(null, radiationPrefab.Identifier, Math.Abs(diff));
}
else if (diff < 0)
{
health.ApplyAffliction(null, new Affliction(radiationPrefab, Math.Abs(diff)));
}
}
}
}
#endif
#endif
#if CLIENT
@@ -163,10 +139,17 @@ namespace Barotrauma
e.IsHighlighted = false;
}
if (GameMain.GameSession != null) GameMain.GameSession.Update((float)deltaTime);
#if CLIENT
var sw = new System.Diagnostics.Stopwatch();
sw.Start();
#endif
GameMain.GameSession?.Update((float)deltaTime);
#if CLIENT
sw.Stop();
GameMain.PerformanceCounter.AddElapsedTicks("GameSessionUpdate", sw.ElapsedTicks);
sw.Restart();
GameMain.ParticleManager.Update((float)deltaTime);