Unstable 0.17.8.0
This commit is contained in:
@@ -151,8 +151,9 @@ namespace Barotrauma
|
|||||||
Stretch = true
|
Stretch = true
|
||||||
};
|
};
|
||||||
|
|
||||||
LocalizedString deadDescription = TextManager.AddPunctuation(':', TextManager.Get("deceased") + "\n" + Character.CauseOfDeath.Affliction?.CauseOfDeathDescription ??
|
LocalizedString deadDescription =
|
||||||
TextManager.AddPunctuation(':', TextManager.Get("CauseOfDeath"), TextManager.Get("CauseOfDeath." + Character.CauseOfDeath.Type.ToString())));
|
TextManager.Get("deceased") + "\n" +
|
||||||
|
(Character.CauseOfDeath.Affliction?.CauseOfDeathDescription ?? TextManager.Get("CauseOfDeath." + Character.CauseOfDeath.Type.ToString()));
|
||||||
|
|
||||||
new GUITextBlock(new RectTransform(new Vector2(1.0f, 0.0f), deadArea.RectTransform), deadDescription, textColor: GUIStyle.Red, font: font, textAlignment: Alignment.TopLeft) { Padding = Vector4.Zero };
|
new GUITextBlock(new RectTransform(new Vector2(1.0f, 0.0f), deadArea.RectTransform), deadDescription, textColor: GUIStyle.Red, font: font, textAlignment: Alignment.TopLeft) { Padding = Vector4.Zero };
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
|
using Barotrauma.IO;
|
||||||
|
using Barotrauma.Media;
|
||||||
using Barotrauma.Networking;
|
using Barotrauma.Networking;
|
||||||
using Barotrauma.Particles;
|
using Barotrauma.Particles;
|
||||||
using Barotrauma.Steam;
|
using Barotrauma.Steam;
|
||||||
|
using Barotrauma.Transition;
|
||||||
using FarseerPhysics;
|
using FarseerPhysics;
|
||||||
using FarseerPhysics.Dynamics;
|
using FarseerPhysics.Dynamics;
|
||||||
using Microsoft.Xna.Framework;
|
using Microsoft.Xna.Framework;
|
||||||
@@ -11,13 +14,7 @@ using System.Collections.Generic;
|
|||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using Barotrauma.IO;
|
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using Barotrauma.Tutorials;
|
|
||||||
using Barotrauma.Media;
|
|
||||||
using Barotrauma.Extensions;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Barotrauma.Transition;
|
|
||||||
|
|
||||||
namespace Barotrauma
|
namespace Barotrauma
|
||||||
{
|
{
|
||||||
@@ -430,7 +427,7 @@ namespace Barotrauma
|
|||||||
if (TitleScreen.WaitForLanguageSelection)
|
if (TitleScreen.WaitForLanguageSelection)
|
||||||
{
|
{
|
||||||
ContentPackageManager.VanillaCorePackage.LoadFilesOfType<TextFile>();
|
ContentPackageManager.VanillaCorePackage.LoadFilesOfType<TextFile>();
|
||||||
TitleScreen.AvailableLanguages = TextManager.AvailableLanguages.ToArray();
|
TitleScreen.AvailableLanguages = TextManager.AvailableLanguages.OrderBy(l => l.Value != "english".ToIdentifier()).ThenBy(l => l.Value).ToArray();
|
||||||
while (TitleScreen.WaitForLanguageSelection)
|
while (TitleScreen.WaitForLanguageSelection)
|
||||||
{
|
{
|
||||||
yield return CoroutineStatus.Running;
|
yield return CoroutineStatus.Running;
|
||||||
|
|||||||
@@ -1308,17 +1308,8 @@ namespace Barotrauma
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case EventType.Status:
|
case EventType.Status:
|
||||||
float prevCondition = condition;
|
float newCondition = msg.ReadSingle();
|
||||||
condition = msg.ReadSingle();
|
SetCondition(newCondition, isNetworkEvent: true);
|
||||||
if (prevCondition > 0.0f && condition <= 0.0f)
|
|
||||||
{
|
|
||||||
ApplyStatusEffects(ActionType.OnBroken, 1.0f);
|
|
||||||
foreach (ItemComponent ic in components)
|
|
||||||
{
|
|
||||||
ic.PlaySound(ActionType.OnBroken);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
SetActiveSprite();
|
|
||||||
break;
|
break;
|
||||||
case EventType.AssignCampaignInteraction:
|
case EventType.AssignCampaignInteraction:
|
||||||
CampaignInteractionType = (CampaignMode.InteractionType)msg.ReadByte();
|
CampaignInteractionType = (CampaignMode.InteractionType)msg.ReadByte();
|
||||||
|
|||||||
@@ -719,6 +719,9 @@ namespace Barotrauma.Networking
|
|||||||
case ServerPacketHeader.CHEATS_ENABLED:
|
case ServerPacketHeader.CHEATS_ENABLED:
|
||||||
//allow interpreting this packet
|
//allow interpreting this packet
|
||||||
break;
|
break;
|
||||||
|
case ServerPacketHeader.STARTGAME:
|
||||||
|
GameMain.NetLobbyScreen.ShowSpectateButton();
|
||||||
|
return;
|
||||||
default:
|
default:
|
||||||
return; //ignore any other packets
|
return; //ignore any other packets
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -583,17 +583,17 @@ namespace Barotrauma
|
|||||||
c.ForceLayoutRecalculation();
|
c.ForceLayoutRecalculation();
|
||||||
});
|
});
|
||||||
bool serverExePickable = serverExecutableDropdown.ListBox.Content.CountChildren > 1;
|
bool serverExePickable = serverExecutableDropdown.ListBox.Content.CountChildren > 1;
|
||||||
serverExecutableDropdown.Parent.Visible
|
bool wasPickable = serverExecutableDropdown.Parent.Visible;
|
||||||
= serverExePickable;
|
if (wasPickable != serverExePickable)
|
||||||
serverExecutableDropdown.Parent.RectTransform.RelativeSize
|
|
||||||
= (1.0f, serverExePickable ? 0.1f : 0.0f);
|
|
||||||
serverExecutableDropdown.Parent.ForceLayoutRecalculation();
|
|
||||||
(serverExecutableDropdown.Parent.Parent as GUILayoutGroup)?.Recalculate();
|
|
||||||
if (serverExecutableDropdown.SelectedComponent is null)
|
|
||||||
{
|
{
|
||||||
serverExecutableDropdown.Select(0);
|
serverExecutableDropdown.Parent.Visible = serverExePickable;
|
||||||
|
serverExecutableDropdown.Parent.IgnoreLayoutGroups = !serverExePickable;
|
||||||
|
(serverExecutableDropdown.Parent.Parent as GUILayoutGroup)?.Recalculate();
|
||||||
|
if (serverExecutableDropdown.SelectedComponent is null)
|
||||||
|
{
|
||||||
|
serverExecutableDropdown.Select(0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case Tab.Tutorials:
|
case Tab.Tutorials:
|
||||||
if (!GameSettings.CurrentConfig.CampaignDisclaimerShown)
|
if (!GameSettings.CurrentConfig.CampaignDisclaimerShown)
|
||||||
@@ -1132,18 +1132,19 @@ namespace Barotrauma
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Vector2 textLabelSize = new Vector2(1.0f, 0.1f);
|
Vector2 textLabelSize = new Vector2(1.0f, 0.05f);
|
||||||
Alignment textAlignment = Alignment.CenterLeft;
|
Alignment textAlignment = Alignment.CenterLeft;
|
||||||
Vector2 textFieldSize = new Vector2(0.5f, 1.0f);
|
Vector2 textFieldSize = new Vector2(0.5f, 1.0f);
|
||||||
Vector2 tickBoxSize = new Vector2(0.4f, 0.07f);
|
Vector2 tickBoxSize = new Vector2(0.4f, 0.04f);
|
||||||
var content = new GUILayoutGroup(new RectTransform(new Vector2(0.7f, 0.9f), menuTabs[Tab.HostServer].RectTransform, Anchor.Center), childAnchor: Anchor.TopCenter)
|
var content = new GUILayoutGroup(new RectTransform(new Vector2(0.7f, 0.9f), menuTabs[Tab.HostServer].RectTransform, Anchor.Center), childAnchor: Anchor.TopCenter)
|
||||||
{
|
{
|
||||||
RelativeSpacing = 0.02f,
|
RelativeSpacing = 0.01f,
|
||||||
Stretch = true
|
Stretch = true
|
||||||
};
|
};
|
||||||
GUIComponent parent = content;
|
GUIComponent parent = content;
|
||||||
|
|
||||||
new GUITextBlock(new RectTransform(textLabelSize, parent.RectTransform), TextManager.Get("HostServerButton"), textAlignment: Alignment.Center, font: GUIStyle.LargeFont) { ForceUpperCase = ForceUpperCase.Yes };
|
var header = new GUITextBlock(new RectTransform(textLabelSize, parent.RectTransform), TextManager.Get("HostServerButton"), textAlignment: Alignment.Center, font: GUIStyle.LargeFont) { ForceUpperCase = ForceUpperCase.Yes };
|
||||||
|
header.RectTransform.IsFixedSize = true;
|
||||||
|
|
||||||
//play style -----------------------------------------------------
|
//play style -----------------------------------------------------
|
||||||
|
|
||||||
@@ -1221,7 +1222,7 @@ namespace Barotrauma
|
|||||||
MaxTextLength = NetConfig.ServerNameMaxLength,
|
MaxTextLength = NetConfig.ServerNameMaxLength,
|
||||||
OverflowClip = true
|
OverflowClip = true
|
||||||
};
|
};
|
||||||
label.RectTransform.MaxSize = serverNameBox.RectTransform.MaxSize;
|
label.RectTransform.IsFixedSize = true;
|
||||||
|
|
||||||
var maxPlayersLabel = new GUITextBlock(new RectTransform(textLabelSize, parent.RectTransform), TextManager.Get("MaxPlayers"), textAlignment: textAlignment);
|
var maxPlayersLabel = new GUITextBlock(new RectTransform(textLabelSize, parent.RectTransform), TextManager.Get("MaxPlayers"), textAlignment: textAlignment);
|
||||||
var buttonContainer = new GUILayoutGroup(new RectTransform(textFieldSize, maxPlayersLabel.RectTransform, Anchor.CenterRight), isHorizontal: true, childAnchor: Anchor.CenterLeft)
|
var buttonContainer = new GUILayoutGroup(new RectTransform(textFieldSize, maxPlayersLabel.RectTransform, Anchor.CenterRight), isHorizontal: true, childAnchor: Anchor.CenterLeft)
|
||||||
@@ -1254,14 +1255,14 @@ namespace Barotrauma
|
|||||||
UserData = 1,
|
UserData = 1,
|
||||||
OnClicked = ChangeMaxPlayers
|
OnClicked = ChangeMaxPlayers
|
||||||
};
|
};
|
||||||
maxPlayersLabel.RectTransform.MaxSize = maxPlayersBox.RectTransform.MaxSize;
|
maxPlayersLabel.RectTransform.IsFixedSize = true;
|
||||||
|
|
||||||
label = new GUITextBlock(new RectTransform(textLabelSize, parent.RectTransform), TextManager.Get("Password"), textAlignment: textAlignment);
|
label = new GUITextBlock(new RectTransform(textLabelSize, parent.RectTransform), TextManager.Get("Password"), textAlignment: textAlignment);
|
||||||
passwordBox = new GUITextBox(new RectTransform(textFieldSize, label.RectTransform, Anchor.CenterRight), text: password, textAlignment: textAlignment)
|
passwordBox = new GUITextBox(new RectTransform(textFieldSize, label.RectTransform, Anchor.CenterRight), text: password, textAlignment: textAlignment)
|
||||||
{
|
{
|
||||||
Censor = true
|
Censor = true
|
||||||
};
|
};
|
||||||
label.RectTransform.MaxSize = passwordBox.RectTransform.MaxSize;
|
label.RectTransform.IsFixedSize = true;
|
||||||
|
|
||||||
var serverExecutableLabel = new GUITextBlock(new RectTransform(textLabelSize, parent.RectTransform),
|
var serverExecutableLabel = new GUITextBlock(new RectTransform(textLabelSize, parent.RectTransform),
|
||||||
TextManager.Get("ServerExecutable"), textAlignment: textAlignment);
|
TextManager.Get("ServerExecutable"), textAlignment: textAlignment);
|
||||||
@@ -1297,7 +1298,8 @@ namespace Barotrauma
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
serverExecutableLabel.RectTransform.IsFixedSize = true;
|
||||||
|
|
||||||
// tickbox upper ---------------
|
// tickbox upper ---------------
|
||||||
|
|
||||||
var tickboxAreaUpper = new GUILayoutGroup(new RectTransform(new Vector2(1.0f, tickBoxSize.Y), parent.RectTransform), isHorizontal: true);
|
var tickboxAreaUpper = new GUILayoutGroup(new RectTransform(new Vector2(1.0f, tickBoxSize.Y), parent.RectTransform), isHorizontal: true);
|
||||||
@@ -1313,7 +1315,7 @@ namespace Barotrauma
|
|||||||
Selected = banAfterWrongPassword
|
Selected = banAfterWrongPassword
|
||||||
};
|
};
|
||||||
|
|
||||||
tickboxAreaUpper.RectTransform.MaxSize = isPublicBox.RectTransform.MaxSize;
|
tickboxAreaUpper.RectTransform.IsFixedSize = true;
|
||||||
|
|
||||||
// tickbox lower ---------------
|
// tickbox lower ---------------
|
||||||
|
|
||||||
@@ -1325,7 +1327,7 @@ namespace Barotrauma
|
|||||||
ToolTip = TextManager.Get("hostserverkarmasettingtooltip")
|
ToolTip = TextManager.Get("hostserverkarmasettingtooltip")
|
||||||
};
|
};
|
||||||
|
|
||||||
tickboxAreaLower.RectTransform.MaxSize = karmaBox.RectTransform.MaxSize;
|
tickboxAreaLower.RectTransform.IsFixedSize = true;
|
||||||
|
|
||||||
//spacing
|
//spacing
|
||||||
new GUIFrame(new RectTransform(new Vector2(1.0f, 0.05f), content.RectTransform), style: null);
|
new GUIFrame(new RectTransform(new Vector2(1.0f, 0.05f), content.RectTransform), style: null);
|
||||||
|
|||||||
@@ -280,6 +280,7 @@ namespace Barotrauma
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if (FlowSounds[i] == null) { continue; }
|
||||||
Vector2 soundPos = new Vector2(GameMain.SoundManager.ListenerPosition.X + (flowVolumeRight[i] - flowVolumeLeft[i]) * 100, GameMain.SoundManager.ListenerPosition.Y);
|
Vector2 soundPos = new Vector2(GameMain.SoundManager.ListenerPosition.X + (flowVolumeRight[i] - flowVolumeLeft[i]) * 100, GameMain.SoundManager.ListenerPosition.Y);
|
||||||
if (flowSoundChannels[i] == null || !flowSoundChannels[i].IsPlaying)
|
if (flowSoundChannels[i] == null || !flowSoundChannels[i].IsPlaying)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<RootNamespace>Barotrauma</RootNamespace>
|
<RootNamespace>Barotrauma</RootNamespace>
|
||||||
<Authors>FakeFish, Undertow Games</Authors>
|
<Authors>FakeFish, Undertow Games</Authors>
|
||||||
<Product>Barotrauma</Product>
|
<Product>Barotrauma</Product>
|
||||||
<Version>0.17.7.0</Version>
|
<Version>0.17.8.0</Version>
|
||||||
<Copyright>Copyright © FakeFish 2018-2022</Copyright>
|
<Copyright>Copyright © FakeFish 2018-2022</Copyright>
|
||||||
<Platforms>AnyCPU;x64</Platforms>
|
<Platforms>AnyCPU;x64</Platforms>
|
||||||
<AssemblyName>Barotrauma</AssemblyName>
|
<AssemblyName>Barotrauma</AssemblyName>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<RootNamespace>Barotrauma</RootNamespace>
|
<RootNamespace>Barotrauma</RootNamespace>
|
||||||
<Authors>FakeFish, Undertow Games</Authors>
|
<Authors>FakeFish, Undertow Games</Authors>
|
||||||
<Product>Barotrauma</Product>
|
<Product>Barotrauma</Product>
|
||||||
<Version>0.17.7.0</Version>
|
<Version>0.17.8.0</Version>
|
||||||
<Copyright>Copyright © FakeFish 2018-2022</Copyright>
|
<Copyright>Copyright © FakeFish 2018-2022</Copyright>
|
||||||
<Platforms>AnyCPU;x64</Platforms>
|
<Platforms>AnyCPU;x64</Platforms>
|
||||||
<AssemblyName>Barotrauma</AssemblyName>
|
<AssemblyName>Barotrauma</AssemblyName>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<RootNamespace>Barotrauma</RootNamespace>
|
<RootNamespace>Barotrauma</RootNamespace>
|
||||||
<Authors>FakeFish, Undertow Games</Authors>
|
<Authors>FakeFish, Undertow Games</Authors>
|
||||||
<Product>Barotrauma</Product>
|
<Product>Barotrauma</Product>
|
||||||
<Version>0.17.7.0</Version>
|
<Version>0.17.8.0</Version>
|
||||||
<Copyright>Copyright © FakeFish 2018-2022</Copyright>
|
<Copyright>Copyright © FakeFish 2018-2022</Copyright>
|
||||||
<Platforms>AnyCPU;x64</Platforms>
|
<Platforms>AnyCPU;x64</Platforms>
|
||||||
<AssemblyName>Barotrauma</AssemblyName>
|
<AssemblyName>Barotrauma</AssemblyName>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<RootNamespace>Barotrauma</RootNamespace>
|
<RootNamespace>Barotrauma</RootNamespace>
|
||||||
<Authors>FakeFish, Undertow Games</Authors>
|
<Authors>FakeFish, Undertow Games</Authors>
|
||||||
<Product>Barotrauma Dedicated Server</Product>
|
<Product>Barotrauma Dedicated Server</Product>
|
||||||
<Version>0.17.7.0</Version>
|
<Version>0.17.8.0</Version>
|
||||||
<Copyright>Copyright © FakeFish 2018-2022</Copyright>
|
<Copyright>Copyright © FakeFish 2018-2022</Copyright>
|
||||||
<Platforms>AnyCPU;x64</Platforms>
|
<Platforms>AnyCPU;x64</Platforms>
|
||||||
<AssemblyName>DedicatedServer</AssemblyName>
|
<AssemblyName>DedicatedServer</AssemblyName>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<RootNamespace>Barotrauma</RootNamespace>
|
<RootNamespace>Barotrauma</RootNamespace>
|
||||||
<Authors>FakeFish, Undertow Games</Authors>
|
<Authors>FakeFish, Undertow Games</Authors>
|
||||||
<Product>Barotrauma Dedicated Server</Product>
|
<Product>Barotrauma Dedicated Server</Product>
|
||||||
<Version>0.17.7.0</Version>
|
<Version>0.17.8.0</Version>
|
||||||
<Copyright>Copyright © FakeFish 2018-2022</Copyright>
|
<Copyright>Copyright © FakeFish 2018-2022</Copyright>
|
||||||
<Platforms>AnyCPU;x64</Platforms>
|
<Platforms>AnyCPU;x64</Platforms>
|
||||||
<AssemblyName>DedicatedServer</AssemblyName>
|
<AssemblyName>DedicatedServer</AssemblyName>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<RootNamespace>Barotrauma</RootNamespace>
|
<RootNamespace>Barotrauma</RootNamespace>
|
||||||
<Authors>FakeFish, Undertow Games</Authors>
|
<Authors>FakeFish, Undertow Games</Authors>
|
||||||
<Product>Barotrauma Dedicated Server</Product>
|
<Product>Barotrauma Dedicated Server</Product>
|
||||||
<Version>0.17.7.0</Version>
|
<Version>0.17.8.0</Version>
|
||||||
<Copyright>Copyright © FakeFish 2018-2022</Copyright>
|
<Copyright>Copyright © FakeFish 2018-2022</Copyright>
|
||||||
<Platforms>AnyCPU;x64</Platforms>
|
<Platforms>AnyCPU;x64</Platforms>
|
||||||
<AssemblyName>DedicatedServer</AssemblyName>
|
<AssemblyName>DedicatedServer</AssemblyName>
|
||||||
|
|||||||
@@ -1778,7 +1778,7 @@ namespace Barotrauma
|
|||||||
AnimController.Anim != AnimController.Animation.UsingConstruction &&
|
AnimController.Anim != AnimController.Animation.UsingConstruction &&
|
||||||
AnimController.Anim != AnimController.Animation.CPR &&
|
AnimController.Anim != AnimController.Animation.CPR &&
|
||||||
(GameMain.NetworkMember == null || !GameMain.NetworkMember.IsClient || Controlled == this) &&
|
(GameMain.NetworkMember == null || !GameMain.NetworkMember.IsClient || Controlled == this) &&
|
||||||
(AnimController.OnGround && !AnimController.InWater || IsKeyDown(InputType.Aim) && HeldItems.None(i => i.RequireAimToUse)))
|
AnimController.OnGround && !AnimController.InWater)
|
||||||
{
|
{
|
||||||
if (dontFollowCursor)
|
if (dontFollowCursor)
|
||||||
{
|
{
|
||||||
@@ -1788,30 +1788,13 @@ namespace Barotrauma
|
|||||||
{
|
{
|
||||||
// Values lower than this seem to cause constantious flipping when the mouse is near the player and the player is running, because the root collider moves after flipping.
|
// Values lower than this seem to cause constantious flipping when the mouse is near the player and the player is running, because the root collider moves after flipping.
|
||||||
float followMargin = 40;
|
float followMargin = 40;
|
||||||
Vector2 diff = CursorPosition - AnimController.Collider.Position;
|
if (CursorPosition.X < AnimController.Collider.Position.X - followMargin)
|
||||||
if (InWater)
|
|
||||||
{
|
{
|
||||||
followMargin = 80;
|
AnimController.TargetDir = Direction.Left;
|
||||||
diff = Vector2.Transform(diff, Matrix.CreateRotationZ(-AnimController.Collider.Rotation));
|
|
||||||
if (diff.X < followMargin)
|
|
||||||
{
|
|
||||||
AnimController.TargetDir = Direction.Left;
|
|
||||||
}
|
|
||||||
else if (diff.X > followMargin)
|
|
||||||
{
|
|
||||||
AnimController.TargetDir = Direction.Right;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else if (CursorPosition.X > AnimController.Collider.Position.X + followMargin)
|
||||||
{
|
{
|
||||||
if (CursorPosition.X < AnimController.Collider.Position.X - followMargin)
|
AnimController.TargetDir = Direction.Right;
|
||||||
{
|
|
||||||
AnimController.TargetDir = Direction.Left;
|
|
||||||
}
|
|
||||||
else if (CursorPosition.X > AnimController.Collider.Position.X + followMargin)
|
|
||||||
{
|
|
||||||
AnimController.TargetDir = Direction.Right;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -21,7 +21,7 @@ namespace Barotrauma
|
|||||||
|
|
||||||
public override void UnloadFile()
|
public override void UnloadFile()
|
||||||
{
|
{
|
||||||
SubmarineInfo.RefreshSavedSub(Path.Value);
|
SubmarineInfo.RemoveSavedSub(Path.Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Sort()
|
public override void Sort()
|
||||||
|
|||||||
+12
-5
@@ -469,15 +469,22 @@ namespace Barotrauma
|
|||||||
}
|
}
|
||||||
|
|
||||||
var corePackageElement = contentPackagesElement.GetChildElement(CorePackageElementName);
|
var corePackageElement = contentPackagesElement.GetChildElement(CorePackageElementName);
|
||||||
var configEnabledCorePackage = findPackage(CorePackages, corePackageElement);
|
if (corePackageElement == null)
|
||||||
if (configEnabledCorePackage == null)
|
|
||||||
{
|
{
|
||||||
string packageStr = corePackageElement.GetAttributeString("name", null) ?? corePackageElement.GetAttributeStringUnrestricted("path", "UNKNOWN");
|
DebugConsole.AddWarning($"No core package selected. Switching to the \"{enabledCorePackage.Name}\" package.");
|
||||||
DebugConsole.ThrowError($"Could not find the selected core package \"{packageStr}\". Switching to the \"{enabledCorePackage.Name}\" package.");
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
enabledCorePackage = configEnabledCorePackage;
|
var configEnabledCorePackage = findPackage(CorePackages, corePackageElement);
|
||||||
|
if (configEnabledCorePackage == null)
|
||||||
|
{
|
||||||
|
string packageStr = corePackageElement.GetAttributeString("name", null) ?? corePackageElement.GetAttributeStringUnrestricted("path", "UNKNOWN");
|
||||||
|
DebugConsole.ThrowError($"Could not find the selected core package \"{packageStr}\". Switching to the \"{enabledCorePackage.Name}\" package.");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
enabledCorePackage = configEnabledCorePackage;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var regularPackagesElement = contentPackagesElement.GetChildElement(RegularPackagesElementName);
|
var regularPackagesElement = contentPackagesElement.GetChildElement(RegularPackagesElementName);
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ namespace Barotrauma
|
|||||||
set { defaultRect = value; }
|
set { defaultRect = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
private Dictionary<string, Connection> connections;
|
private readonly Dictionary<string, Connection> connections;
|
||||||
|
|
||||||
private readonly List<Repairable> repairables;
|
private readonly List<Repairable> repairables;
|
||||||
|
|
||||||
@@ -516,74 +516,7 @@ namespace Barotrauma
|
|||||||
get { return condition; }
|
get { return condition; }
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
if (GameMain.NetworkMember != null && GameMain.NetworkMember.IsClient) { return; }
|
SetCondition(value, isNetworkEvent: false);
|
||||||
if (!MathUtils.IsValid(value)) { return; }
|
|
||||||
if (Indestructible) { return; }
|
|
||||||
if (InvulnerableToDamage && value <= condition) { return; }
|
|
||||||
|
|
||||||
float prev = condition;
|
|
||||||
bool wasInFullCondition = IsFullCondition;
|
|
||||||
|
|
||||||
condition = MathHelper.Clamp(value, 0.0f, MaxCondition);
|
|
||||||
if (condition == 0.0f && prev > 0.0f)
|
|
||||||
{
|
|
||||||
//Flag connections to be updated as device is broken
|
|
||||||
flagChangedConnections(connections);
|
|
||||||
#if CLIENT
|
|
||||||
foreach (ItemComponent ic in components)
|
|
||||||
{
|
|
||||||
ic.PlaySound(ActionType.OnBroken);
|
|
||||||
}
|
|
||||||
if (Screen.Selected == GameMain.SubEditorScreen) { return; }
|
|
||||||
#endif
|
|
||||||
ApplyStatusEffects(ActionType.OnBroken, 1.0f, null);
|
|
||||||
}
|
|
||||||
else if (condition > 0.0f && prev <= 0.0f)
|
|
||||||
{
|
|
||||||
//Flag connections to be updated as device is now working again
|
|
||||||
flagChangedConnections(connections);
|
|
||||||
}
|
|
||||||
|
|
||||||
SetActiveSprite();
|
|
||||||
|
|
||||||
if (GameMain.NetworkMember != null && GameMain.NetworkMember.IsServer)
|
|
||||||
{
|
|
||||||
if (Math.Abs(lastSentCondition - condition) > 1.0f)
|
|
||||||
{
|
|
||||||
conditionUpdatePending = true;
|
|
||||||
isActive = true;
|
|
||||||
}
|
|
||||||
else if (wasInFullCondition != IsFullCondition)
|
|
||||||
{
|
|
||||||
conditionUpdatePending = true;
|
|
||||||
isActive = true;
|
|
||||||
}
|
|
||||||
else if (!MathUtils.NearlyEqual(lastSentCondition, condition) && (condition <= 0.0f || condition >= MaxCondition))
|
|
||||||
{
|
|
||||||
sendConditionUpdateTimer = 0.0f;
|
|
||||||
conditionUpdatePending = true;
|
|
||||||
isActive = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
LastConditionChange = condition - prev;
|
|
||||||
ConditionLastUpdated = Timing.TotalTime;
|
|
||||||
|
|
||||||
static void flagChangedConnections(Dictionary<string, Connection> connections)
|
|
||||||
{
|
|
||||||
if (connections == null) { return; }
|
|
||||||
foreach (Connection c in connections.Values)
|
|
||||||
{
|
|
||||||
if (c.IsPower)
|
|
||||||
{
|
|
||||||
Powered.ChangedConnections.Add(c);
|
|
||||||
foreach (Connection conn in c.Recipients)
|
|
||||||
{
|
|
||||||
Powered.ChangedConnections.Add(conn);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1667,6 +1600,81 @@ namespace Barotrauma
|
|||||||
return new AttackResult(damageAmount, null);
|
return new AttackResult(damageAmount, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void SetCondition(float value, bool isNetworkEvent)
|
||||||
|
{
|
||||||
|
if (!isNetworkEvent)
|
||||||
|
{
|
||||||
|
if (GameMain.NetworkMember != null && GameMain.NetworkMember.IsClient) { return; }
|
||||||
|
}
|
||||||
|
if (!MathUtils.IsValid(value)) { return; }
|
||||||
|
if (Indestructible) { return; }
|
||||||
|
if (InvulnerableToDamage && value <= condition) { return; }
|
||||||
|
|
||||||
|
float prev = condition;
|
||||||
|
bool wasInFullCondition = IsFullCondition;
|
||||||
|
|
||||||
|
condition = MathHelper.Clamp(value, 0.0f, MaxCondition);
|
||||||
|
if (condition == 0.0f && prev > 0.0f)
|
||||||
|
{
|
||||||
|
//Flag connections to be updated as device is broken
|
||||||
|
flagChangedConnections(connections);
|
||||||
|
#if CLIENT
|
||||||
|
foreach (ItemComponent ic in components)
|
||||||
|
{
|
||||||
|
ic.PlaySound(ActionType.OnBroken);
|
||||||
|
}
|
||||||
|
if (Screen.Selected == GameMain.SubEditorScreen) { return; }
|
||||||
|
#endif
|
||||||
|
ApplyStatusEffects(ActionType.OnBroken, 1.0f, null);
|
||||||
|
}
|
||||||
|
else if (condition > 0.0f && prev <= 0.0f)
|
||||||
|
{
|
||||||
|
//Flag connections to be updated as device is now working again
|
||||||
|
flagChangedConnections(connections);
|
||||||
|
}
|
||||||
|
|
||||||
|
SetActiveSprite();
|
||||||
|
|
||||||
|
if (GameMain.NetworkMember != null && GameMain.NetworkMember.IsServer)
|
||||||
|
{
|
||||||
|
if (Math.Abs(lastSentCondition - condition) > 1.0f)
|
||||||
|
{
|
||||||
|
conditionUpdatePending = true;
|
||||||
|
isActive = true;
|
||||||
|
}
|
||||||
|
else if (wasInFullCondition != IsFullCondition)
|
||||||
|
{
|
||||||
|
conditionUpdatePending = true;
|
||||||
|
isActive = true;
|
||||||
|
}
|
||||||
|
else if (!MathUtils.NearlyEqual(lastSentCondition, condition) && (condition <= 0.0f || condition >= MaxCondition))
|
||||||
|
{
|
||||||
|
sendConditionUpdateTimer = 0.0f;
|
||||||
|
conditionUpdatePending = true;
|
||||||
|
isActive = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
LastConditionChange = condition - prev;
|
||||||
|
ConditionLastUpdated = Timing.TotalTime;
|
||||||
|
|
||||||
|
static void flagChangedConnections(Dictionary<string, Connection> connections)
|
||||||
|
{
|
||||||
|
if (connections == null) { return; }
|
||||||
|
foreach (Connection c in connections.Values)
|
||||||
|
{
|
||||||
|
if (c.IsPower)
|
||||||
|
{
|
||||||
|
Powered.ChangedConnections.Add(c);
|
||||||
|
foreach (Connection conn in c.Recipients)
|
||||||
|
{
|
||||||
|
Powered.ChangedConnections.Add(conn);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private bool IsInWater()
|
private bool IsInWater()
|
||||||
{
|
{
|
||||||
if (CurrentHull == null) { return true; }
|
if (CurrentHull == null) { return true; }
|
||||||
|
|||||||
@@ -545,7 +545,7 @@ namespace Barotrauma
|
|||||||
savedSubmarines.Add(subInfo);
|
savedSubmarines.Add(subInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void RefreshSavedSub(string filePath)
|
public static void RemoveSavedSub(string filePath)
|
||||||
{
|
{
|
||||||
string fullPath = Path.GetFullPath(filePath);
|
string fullPath = Path.GetFullPath(filePath);
|
||||||
for (int i = savedSubmarines.Count - 1; i >= 0; i--)
|
for (int i = savedSubmarines.Count - 1; i >= 0; i--)
|
||||||
@@ -555,7 +555,11 @@ namespace Barotrauma
|
|||||||
savedSubmarines[i].Dispose();
|
savedSubmarines[i].Dispose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void RefreshSavedSub(string filePath)
|
||||||
|
{
|
||||||
|
RemoveSavedSub(filePath);
|
||||||
if (File.Exists(filePath))
|
if (File.Exists(filePath))
|
||||||
{
|
{
|
||||||
var subInfo = new SubmarineInfo(filePath);
|
var subInfo = new SubmarineInfo(filePath);
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ namespace Barotrauma
|
|||||||
public override bool Loaded => left.Loaded || right.Loaded;
|
public override bool Loaded => left.Loaded || right.Loaded;
|
||||||
public override void RetrieveValue()
|
public override void RetrieveValue()
|
||||||
{
|
{
|
||||||
cachedValue = left.Value + right.Value;
|
cachedValue = (left.Value ?? string.Empty) + (right.Value ?? string.Empty);
|
||||||
UpdateLanguage();
|
UpdateLanguage();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ using Barotrauma.Extensions;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Collections.Immutable;
|
using System.Collections.Immutable;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reflection;
|
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Xml.Linq;
|
using System.Xml.Linq;
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,18 @@
|
|||||||
|
---------------------------------------------------------------------------------------------------------
|
||||||
|
v0.17.8.0
|
||||||
|
---------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
Changes (unstable only):
|
||||||
|
- Remove flipping in water while aiming (with the changes introduced to aiming in the previous versions, aiming works even better without it).
|
||||||
|
|
||||||
|
Fixes (unstable only):
|
||||||
|
- Fixed languages being in random order in the initial language selection screen.
|
||||||
|
- Fixed power grid going crazy client-side when junction boxes break.
|
||||||
|
- Fixed crashing when clicking on a dead player in the tab menu.
|
||||||
|
- Fixed spectate button not appearing if the round starts while waiting for mods to download.
|
||||||
|
- Fixed disabling a submarine mod not actually disabling the sub.
|
||||||
|
- Fixed host server menu layout changing every time you open it, and the server exe dropdown having a different size than the rest of the elements.
|
||||||
|
|
||||||
---------------------------------------------------------------------------------------------------------
|
---------------------------------------------------------------------------------------------------------
|
||||||
v0.17.7.0
|
v0.17.7.0
|
||||||
---------------------------------------------------------------------------------------------------------
|
---------------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user