Unstable 0.1300.0.5
This commit is contained in:
@@ -403,7 +403,7 @@ namespace Barotrauma
|
|||||||
|
|
||||||
if (GameMain.Client != null) { chatMessage += " " + TextManager.Get("DeathChatNotification"); }
|
if (GameMain.Client != null) { chatMessage += " " + TextManager.Get("DeathChatNotification"); }
|
||||||
|
|
||||||
if (GameMain.GameSession?.GameMode is CampaignMode && GameMain.NetworkMember.RespawnManager != null && Level.Loaded?.Type != LevelData.LevelType.Outpost)
|
if (GameMain.NetworkMember.RespawnManager?.UseRespawnPrompt ?? false)
|
||||||
{
|
{
|
||||||
CoroutineManager.InvokeAfter(() =>
|
CoroutineManager.InvokeAfter(() =>
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -11,8 +11,9 @@ using System.Linq;
|
|||||||
namespace Barotrauma
|
namespace Barotrauma
|
||||||
{
|
{
|
||||||
class CharacterHUD
|
class CharacterHUD
|
||||||
{
|
{
|
||||||
const float BossHealthBarDuration = 30.0f;
|
const float BossHealthBarDuration = 1200.0f;
|
||||||
|
|
||||||
class BossHealthBar
|
class BossHealthBar
|
||||||
{
|
{
|
||||||
public readonly Character Character;
|
public readonly Character Character;
|
||||||
@@ -35,14 +36,25 @@ namespace Barotrauma
|
|||||||
RelativeOffset = new Vector2(0.0f, 0.01f)
|
RelativeOffset = new Vector2(0.0f, 0.01f)
|
||||||
}, isHorizontal: false, childAnchor: Anchor.TopCenter);
|
}, isHorizontal: false, childAnchor: Anchor.TopCenter);
|
||||||
new GUITextBlock(new RectTransform(new Vector2(1.0f, 0.4f), TopContainer.RectTransform), character.DisplayName, textAlignment: Alignment.Center, textColor: GUI.Style.Red);
|
new GUITextBlock(new RectTransform(new Vector2(1.0f, 0.4f), TopContainer.RectTransform), character.DisplayName, textAlignment: Alignment.Center, textColor: GUI.Style.Red);
|
||||||
TopHealthBar = new GUIProgressBar(new RectTransform(new Vector2(1.0f, 0.6f), TopContainer.RectTransform), barSize: 0.0f, style: "CharacterHealthBarCentered");
|
TopHealthBar = new GUIProgressBar(new RectTransform(new Vector2(1.0f, 0.6f), TopContainer.RectTransform)
|
||||||
|
{
|
||||||
|
MinSize = new Point(100, HUDLayoutSettings.HealthBarArea.Size.Y)
|
||||||
|
}, barSize: 0.0f, style: "CharacterHealthBarCentered")
|
||||||
|
{
|
||||||
|
Color = GUI.Style.Red
|
||||||
|
};
|
||||||
|
|
||||||
SideContainer = new GUILayoutGroup(new RectTransform(new Vector2(1.0f, 0.05f), bossHealthContainer.RectTransform)
|
SideContainer = new GUILayoutGroup(new RectTransform(new Vector2(1.0f, 0.05f), bossHealthContainer.RectTransform)
|
||||||
{
|
{
|
||||||
MinSize = new Point(80, 60)
|
MinSize = new Point(80, 60)
|
||||||
}, isHorizontal: false, childAnchor: Anchor.TopRight);
|
}, isHorizontal: false, childAnchor: Anchor.TopRight);
|
||||||
new GUITextBlock(new RectTransform(new Vector2(1.0f, 0.3f), SideContainer.RectTransform), character.DisplayName, textAlignment: Alignment.CenterRight, textColor: GUI.Style.Red);
|
new GUITextBlock(new RectTransform(new Vector2(1.0f, 0.3f), SideContainer.RectTransform), character.DisplayName, textAlignment: Alignment.CenterRight, textColor: GUI.Style.Red);
|
||||||
SideHealthBar = new GUIProgressBar(new RectTransform(new Vector2(1.0f, 0.7f), SideContainer.RectTransform), barSize: 0.0f, style: "CharacterHealthBar");
|
SideHealthBar = new GUIProgressBar(new RectTransform(new Vector2(1.0f, 0.7f), SideContainer.RectTransform), barSize: 0.0f, style: "CharacterHealthBar")
|
||||||
|
{
|
||||||
|
Color = GUI.Style.Red
|
||||||
|
};
|
||||||
|
|
||||||
|
TopContainer.Visible = SideContainer.Visible = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -537,6 +549,8 @@ namespace Barotrauma
|
|||||||
|
|
||||||
public static void ShowBossHealthBar(Character character)
|
public static void ShowBossHealthBar(Character character)
|
||||||
{
|
{
|
||||||
|
if (character == null || character.IsDead || character.Removed) { return; }
|
||||||
|
|
||||||
var existingBar = bossHealthBars.Find(b => b.Character == character);
|
var existingBar = bossHealthBars.Find(b => b.Character == character);
|
||||||
if (existingBar != null)
|
if (existingBar != null)
|
||||||
{
|
{
|
||||||
@@ -578,33 +592,29 @@ namespace Barotrauma
|
|||||||
float health = bossHealthBar.Character.Vitality / bossHealthBar.Character.MaxVitality;
|
float health = bossHealthBar.Character.Vitality / bossHealthBar.Character.MaxVitality;
|
||||||
|
|
||||||
float alpha = Math.Min(bossHealthBar.FadeTimer, 1.0f);
|
float alpha = Math.Min(bossHealthBar.FadeTimer, 1.0f);
|
||||||
foreach (var c in bossHealthBar.TopContainer.GetAllChildren())
|
foreach (var c in bossHealthBar.SideContainer.GetAllChildren().Concat(bossHealthBar.TopContainer.GetAllChildren()))
|
||||||
{
|
{
|
||||||
c.Color = new Color(c.Color, (byte)(alpha * 255));
|
c.Color = new Color(c.Color, (byte)(alpha * 255));
|
||||||
if (c is GUITextBlock textBlock)
|
if (c is GUITextBlock textBlock)
|
||||||
{
|
{
|
||||||
textBlock.TextColor = new Color(textBlock.TextColor, (byte)(alpha * 255));
|
textBlock.TextColor = new Color(bossHealthBar.Character.IsDead ? Color.Gray : textBlock.TextColor, (byte)(alpha * 255));
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach (var c in bossHealthBar.SideContainer.GetAllChildren())
|
|
||||||
{
|
|
||||||
c.Color = new Color(c.Color, (byte)(alpha * 255));
|
|
||||||
if (c is GUITextBlock textBlock)
|
|
||||||
{
|
|
||||||
textBlock.TextColor = new Color(textBlock.TextColor, (byte)(alpha * 255));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bossHealthBar.TopHealthBar.BarSize = bossHealthBar.SideHealthBar.BarSize = health;
|
bossHealthBar.TopHealthBar.BarSize = bossHealthBar.SideHealthBar.BarSize = health;
|
||||||
|
|
||||||
bossHealthBar.TopHealthBar.Color = bossHealthBar.SideHealthBar.Color =
|
if (bossHealthBar.Character.Removed || !bossHealthBar.Character.Enabled)
|
||||||
ToolBox.GradientLerp(health, GUI.Style.HealthBarColorLow, GUI.Style.HealthBarColorMedium, GUI.Style.HealthBarColorHigh) * alpha;
|
|
||||||
|
|
||||||
if (bossHealthBar.Character.IsDead || bossHealthBar.Character.Removed)
|
|
||||||
{
|
{
|
||||||
bossHealthBar.FadeTimer = Math.Min(bossHealthBar.FadeTimer, 1.0f);
|
bossHealthBar.FadeTimer = Math.Min(bossHealthBar.FadeTimer, 1.0f);
|
||||||
}
|
}
|
||||||
|
else if (bossHealthBar.Character.IsDead)
|
||||||
|
{
|
||||||
|
bossHealthBar.FadeTimer = Math.Min(bossHealthBar.FadeTimer, 5.0f);
|
||||||
|
}
|
||||||
|
else if (bossHealthBar.Character.AIController is EnemyAIController enemyAI && !enemyAI.IsTargetingPlayerTeam)
|
||||||
|
{
|
||||||
|
bossHealthBar.FadeTimer = Math.Min(bossHealthBar.FadeTimer, 10.0f);
|
||||||
|
}
|
||||||
bossHealthBar.FadeTimer -= deltaTime;
|
bossHealthBar.FadeTimer -= deltaTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1721,6 +1721,15 @@ namespace Barotrauma
|
|||||||
{
|
{
|
||||||
GameMain.Client?.ForceTimeOut();
|
GameMain.Client?.ForceTimeOut();
|
||||||
}, isCheat: false));
|
}, isCheat: false));
|
||||||
|
commands.Add(new Command("bumpitem", "", (string[] args) =>
|
||||||
|
{
|
||||||
|
float vel = 10.0f;
|
||||||
|
if (args.Length > 0)
|
||||||
|
{
|
||||||
|
float.TryParse(args[0], NumberStyles.Number, CultureInfo.InvariantCulture, out vel);
|
||||||
|
}
|
||||||
|
Character.Controlled?.FocusedItem?.body?.ApplyLinearImpulse(Rand.Vector(vel));
|
||||||
|
}, isCheat: false));
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -2275,12 +2284,15 @@ namespace Barotrauma
|
|||||||
"revokeperm",
|
"revokeperm",
|
||||||
(string[] args) =>
|
(string[] args) =>
|
||||||
{
|
{
|
||||||
if (args.Length < 1) return;
|
if (args.Length < 1) { return; }
|
||||||
|
|
||||||
NewMessage("Valid permissions are:", Color.White);
|
if (args.Length < 2)
|
||||||
foreach (ClientPermissions permission in Enum.GetValues(typeof(ClientPermissions)))
|
|
||||||
{
|
{
|
||||||
NewMessage(" - " + permission.ToString(), Color.White);
|
NewMessage("Valid permissions are:", Color.White);
|
||||||
|
foreach (ClientPermissions permission in Enum.GetValues(typeof(ClientPermissions)))
|
||||||
|
{
|
||||||
|
NewMessage(" - " + permission.ToString(), Color.White);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ShowQuestionPrompt("Permission to revoke from client " + args[0] + "?", (perm) =>
|
ShowQuestionPrompt("Permission to revoke from client " + args[0] + "?", (perm) =>
|
||||||
|
|||||||
@@ -390,11 +390,15 @@ namespace Barotrauma
|
|||||||
{
|
{
|
||||||
foreach (var data in msgText.RichTextData)
|
foreach (var data in msgText.RichTextData)
|
||||||
{
|
{
|
||||||
msgText.ClickableAreas.Add(new GUITextBlock.ClickableArea()
|
var clickableArea = new GUITextBlock.ClickableArea()
|
||||||
{
|
{
|
||||||
Data = data,
|
Data = data
|
||||||
OnClick = GameMain.NetLobbyScreen.SelectPlayer
|
};
|
||||||
});
|
if (GameMain.NetLobbyScreen != null && GameMain.NetworkMember != null)
|
||||||
|
{
|
||||||
|
clickableArea.OnClick = GameMain.NetLobbyScreen.SelectPlayer;
|
||||||
|
}
|
||||||
|
msgText.ClickableAreas.Add(clickableArea);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -218,6 +218,21 @@ namespace Barotrauma
|
|||||||
|
|
||||||
public static bool DisableHUD, DisableUpperHUD, DisableItemHighlights, DisableCharacterNames;
|
public static bool DisableHUD, DisableUpperHUD, DisableItemHighlights, DisableCharacterNames;
|
||||||
|
|
||||||
|
private static bool isSavingIndicatorEnabled;
|
||||||
|
private static Color savingIndicatorColor = Color.Transparent;
|
||||||
|
private static bool IsSavingIndicatorVisible => savingIndicatorColor.A > 0;
|
||||||
|
private static float savingIndicatorSpriteIndex;
|
||||||
|
private static float savingIndicatorColorLerpAmount;
|
||||||
|
private static SavingIndicatorState savingIndicatorState = SavingIndicatorState.None;
|
||||||
|
private static float? timeUntilSavingIndicatorDisabled;
|
||||||
|
|
||||||
|
private enum SavingIndicatorState
|
||||||
|
{
|
||||||
|
None,
|
||||||
|
FadingIn,
|
||||||
|
FadingOut
|
||||||
|
}
|
||||||
|
|
||||||
public static void Init(GameWindow window, IEnumerable<ContentPackage> selectedContentPackages, GraphicsDevice graphicsDevice)
|
public static void Init(GameWindow window, IEnumerable<ContentPackage> selectedContentPackages, GraphicsDevice graphicsDevice)
|
||||||
{
|
{
|
||||||
GraphicsDevice = graphicsDevice;
|
GraphicsDevice = graphicsDevice;
|
||||||
@@ -345,7 +360,11 @@ namespace Barotrauma
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (DisableHUD) { return; }
|
if (DisableHUD)
|
||||||
|
{
|
||||||
|
DrawSavingIndicator(spriteBatch);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (GameMain.ShowFPS || GameMain.DebugDraw)
|
if (GameMain.ShowFPS || GameMain.DebugDraw)
|
||||||
{
|
{
|
||||||
@@ -627,6 +646,8 @@ namespace Barotrauma
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DrawSavingIndicator(spriteBatch);
|
||||||
|
|
||||||
if (GameMain.WindowActive && !HideCursor)
|
if (GameMain.WindowActive && !HideCursor)
|
||||||
{
|
{
|
||||||
spriteBatch.End();
|
spriteBatch.End();
|
||||||
@@ -1206,6 +1227,7 @@ namespace Barotrauma
|
|||||||
Debug.Assert(updateList.Count == updateListSet.Count);
|
Debug.Assert(updateList.Count == updateListSet.Count);
|
||||||
updateList.ForEach(c => c.UpdateAuto(deltaTime));
|
updateList.ForEach(c => c.UpdateAuto(deltaTime));
|
||||||
UpdateMessages(deltaTime);
|
UpdateMessages(deltaTime);
|
||||||
|
UpdateSavingIndicator(deltaTime);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1250,6 +1272,58 @@ namespace Barotrauma
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void UpdateSavingIndicator(float deltaTime)
|
||||||
|
{
|
||||||
|
lock (mutex)
|
||||||
|
{
|
||||||
|
if (timeUntilSavingIndicatorDisabled.HasValue)
|
||||||
|
{
|
||||||
|
timeUntilSavingIndicatorDisabled -= deltaTime;
|
||||||
|
if (timeUntilSavingIndicatorDisabled <= 0.0f)
|
||||||
|
{
|
||||||
|
isSavingIndicatorEnabled = false;
|
||||||
|
timeUntilSavingIndicatorDisabled = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (isSavingIndicatorEnabled)
|
||||||
|
{
|
||||||
|
if (savingIndicatorColor == Color.Transparent)
|
||||||
|
{
|
||||||
|
savingIndicatorState = SavingIndicatorState.FadingIn;
|
||||||
|
savingIndicatorColorLerpAmount = 0.0f;
|
||||||
|
}
|
||||||
|
else if (savingIndicatorColor == Color.White)
|
||||||
|
{
|
||||||
|
savingIndicatorState = SavingIndicatorState.None;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (savingIndicatorColor == Color.White)
|
||||||
|
{
|
||||||
|
savingIndicatorState = SavingIndicatorState.FadingOut;
|
||||||
|
savingIndicatorColorLerpAmount = 0.0f;
|
||||||
|
}
|
||||||
|
else if (savingIndicatorColor == Color.Transparent)
|
||||||
|
{
|
||||||
|
savingIndicatorState = SavingIndicatorState.None;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (savingIndicatorState != SavingIndicatorState.None)
|
||||||
|
{
|
||||||
|
bool isFadingIn = savingIndicatorState == SavingIndicatorState.FadingIn;
|
||||||
|
Color lerpStartColor = isFadingIn ? Color.Transparent : Color.White;
|
||||||
|
Color lerpTargetColor = isFadingIn ? Color.White : Color.Transparent;
|
||||||
|
savingIndicatorColorLerpAmount += (isFadingIn ? 2.0f : 0.5f) * deltaTime;
|
||||||
|
savingIndicatorColor = Color.Lerp(lerpStartColor, lerpTargetColor, savingIndicatorColorLerpAmount);
|
||||||
|
}
|
||||||
|
if (IsSavingIndicatorVisible)
|
||||||
|
{
|
||||||
|
savingIndicatorSpriteIndex = (savingIndicatorSpriteIndex + 15.0f * deltaTime) % (Style.SavingIndicator.FrameCount + 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#region Element drawing
|
#region Element drawing
|
||||||
|
|
||||||
private static List<float> usedIndicatorAngles = new List<float>();
|
private static List<float> usedIndicatorAngles = new List<float>();
|
||||||
@@ -1574,6 +1648,14 @@ namespace Barotrauma
|
|||||||
ShapeExtensions.DrawPoint(spriteBatch, pos, color, dotSize);
|
ShapeExtensions.DrawPoint(spriteBatch, pos, color, dotSize);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void DrawSavingIndicator(SpriteBatch spriteBatch)
|
||||||
|
{
|
||||||
|
if (!IsSavingIndicatorVisible) { return; }
|
||||||
|
var sheet = Style.SavingIndicator;
|
||||||
|
Vector2 pos = new Vector2(GameMain.GraphicsWidth, GameMain.GraphicsHeight) - new Vector2(HUDLayoutSettings.Padding) - 2 * Scale * sheet.FrameSize.ToVector2();
|
||||||
|
sheet.Draw(spriteBatch, (int)Math.Floor(savingIndicatorSpriteIndex), pos, savingIndicatorColor, origin: Vector2.Zero, rotate: 0.0f, scale: new Vector2(Scale));
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Element creation
|
#region Element creation
|
||||||
@@ -2327,6 +2409,21 @@ namespace Barotrauma
|
|||||||
float aspectRatio = HorizontalAspectRatio;
|
float aspectRatio = HorizontalAspectRatio;
|
||||||
return aspectRatio > 1.3f && aspectRatio < 1.4f;
|
return aspectRatio > 1.3f && aspectRatio < 1.4f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void SetSavingIndicatorState(bool enabled)
|
||||||
|
{
|
||||||
|
if (enabled)
|
||||||
|
{
|
||||||
|
timeUntilSavingIndicatorDisabled = null;
|
||||||
|
}
|
||||||
|
isSavingIndicatorEnabled = enabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void DisableSavingIndicatorDelayed(float delay = 3.0f)
|
||||||
|
{
|
||||||
|
if (!isSavingIndicatorEnabled) { return; }
|
||||||
|
timeUntilSavingIndicatorDisabled = delay;
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -427,6 +427,9 @@ namespace Barotrauma
|
|||||||
|
|
||||||
foreach (var type in messageBoxTypes)
|
foreach (var type in messageBoxTypes)
|
||||||
{
|
{
|
||||||
|
// Don't display hints when HUD is disabled
|
||||||
|
if (type == Type.Hint && GUI.DisableHUD) { continue; }
|
||||||
|
|
||||||
for (int i = 0; i < MessageBoxes.Count; i++)
|
for (int i = 0; i < MessageBoxes.Count; i++)
|
||||||
{
|
{
|
||||||
if (MessageBoxes[i] == null) { continue; }
|
if (MessageBoxes[i] == null) { continue; }
|
||||||
@@ -506,7 +509,7 @@ namespace Barotrauma
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
initialPos = new Vector2(GUI.IntScale(64), -InnerFrame.Rect.Height);
|
initialPos = new Vector2(GUI.IntScale(64), -InnerFrame.Rect.Height);
|
||||||
defaultPos = new Vector2(initialPos.X, HUDLayoutSettings.MessageAreaTop.Height + GUI.IntScale(64));
|
defaultPos = new Vector2(initialPos.X, HUDLayoutSettings.ButtonAreaTop.Height + GUI.IntScale(64));
|
||||||
endPos = new Vector2(-InnerFrame.Rect.Width, defaultPos.Y);
|
endPos = new Vector2(-InnerFrame.Rect.Width, defaultPos.Y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -37,6 +37,8 @@ namespace Barotrauma
|
|||||||
public UISprite RadiationSprite { get; private set; }
|
public UISprite RadiationSprite { get; private set; }
|
||||||
public SpriteSheet RadiationAnimSpriteSheet { get; private set; }
|
public SpriteSheet RadiationAnimSpriteSheet { get; private set; }
|
||||||
|
|
||||||
|
public SpriteSheet SavingIndicator { get; private set; }
|
||||||
|
|
||||||
public UISprite UIGlow { get; private set; }
|
public UISprite UIGlow { get; private set; }
|
||||||
public UISprite UIGlowCircular { get; private set; }
|
public UISprite UIGlowCircular { get; private set; }
|
||||||
|
|
||||||
@@ -248,6 +250,9 @@ namespace Barotrauma
|
|||||||
case "focusindicator":
|
case "focusindicator":
|
||||||
FocusIndicator = new SpriteSheet(subElement);
|
FocusIndicator = new SpriteSheet(subElement);
|
||||||
break;
|
break;
|
||||||
|
case "savingindicator":
|
||||||
|
SavingIndicator = new SpriteSheet(subElement);
|
||||||
|
break;
|
||||||
case "font":
|
case "font":
|
||||||
Font = LoadFont(subElement, graphicsDevice);
|
Font = LoadFont(subElement, graphicsDevice);
|
||||||
ForceFontUpperCase[Font] = subElement.GetAttributeBool("forceuppercase", false);
|
ForceFontUpperCase[Font] = subElement.GetAttributeBool("forceuppercase", false);
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ namespace Barotrauma
|
|||||||
|
|
||||||
|
|
||||||
int messageAreaWidth = GameMain.GraphicsWidth / 3;
|
int messageAreaWidth = GameMain.GraphicsWidth / 3;
|
||||||
MessageAreaTop = new Rectangle((GameMain.GraphicsWidth - messageAreaWidth) / 2, ButtonAreaTop.Bottom, messageAreaWidth, ButtonAreaTop.Height);
|
MessageAreaTop = new Rectangle((GameMain.GraphicsWidth - messageAreaWidth) / 2, ButtonAreaTop.Bottom + ButtonAreaTop.Height, messageAreaWidth, ButtonAreaTop.Height);
|
||||||
|
|
||||||
bool isFourByThree = GUI.IsFourByThree();
|
bool isFourByThree = GUI.IsFourByThree();
|
||||||
int chatBoxWidth = !isFourByThree ? (int)(475 * GUI.Scale) : (int)(375 * GUI.Scale);
|
int chatBoxWidth = !isFourByThree ? (int)(475 * GUI.Scale) : (int)(375 * GUI.Scale);
|
||||||
|
|||||||
@@ -1066,6 +1066,8 @@ namespace Barotrauma
|
|||||||
{
|
{
|
||||||
if (save)
|
if (save)
|
||||||
{
|
{
|
||||||
|
GUI.SetSavingIndicatorState(true);
|
||||||
|
|
||||||
if (GameSession.Submarine != null && !GameSession.Submarine.Removed)
|
if (GameSession.Submarine != null && !GameSession.Submarine.Removed)
|
||||||
{
|
{
|
||||||
GameSession.SubmarineInfo = new SubmarineInfo(GameSession.Submarine);
|
GameSession.SubmarineInfo = new SubmarineInfo(GameSession.Submarine);
|
||||||
|
|||||||
@@ -233,15 +233,20 @@ namespace Barotrauma
|
|||||||
{
|
{
|
||||||
endRoundButton.RectTransform.ScreenSpaceOffset = new Point(0, Character.Controlled.CharacterHealth.SuicideButton.Rect.Height);
|
endRoundButton.RectTransform.ScreenSpaceOffset = new Point(0, Character.Controlled.CharacterHealth.SuicideButton.Rect.Height);
|
||||||
}
|
}
|
||||||
|
else if (GameMain.Client != null && GameMain.Client.IsFollowSubTickBoxVisible)
|
||||||
|
{
|
||||||
|
endRoundButton.RectTransform.ScreenSpaceOffset = new Point(0, HUDLayoutSettings.Padding + GameMain.Client.FollowSubTickBox.Rect.Height);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
endRoundButton.RectTransform.ScreenSpaceOffset = Point.Zero;
|
endRoundButton.RectTransform.ScreenSpaceOffset = Point.Zero;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
endRoundButton.DrawManually(spriteBatch);
|
endRoundButton.DrawManually(spriteBatch);
|
||||||
if (this is MultiPlayerCampaign)
|
if (this is MultiPlayerCampaign && ReadyCheckButton != null)
|
||||||
{
|
{
|
||||||
ReadyCheckButton?.DrawManually(spriteBatch);
|
ReadyCheckButton.RectTransform.ScreenSpaceOffset = endRoundButton.RectTransform.ScreenSpaceOffset;
|
||||||
|
ReadyCheckButton.DrawManually(spriteBatch);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -227,6 +227,11 @@ namespace Barotrauma
|
|||||||
float timer = 0.0f;
|
float timer = 0.0f;
|
||||||
while (timer < textDuration)
|
while (timer < textDuration)
|
||||||
{
|
{
|
||||||
|
if (GameMain.GameSession == null || Screen.Selected != GameMain.GameScreen)
|
||||||
|
{
|
||||||
|
GUI.DisableHUD = false;
|
||||||
|
yield return CoroutineStatus.Success;
|
||||||
|
}
|
||||||
// Try to grab the controlled here to prevent inputs, assigned late on multiplayer
|
// Try to grab the controlled here to prevent inputs, assigned late on multiplayer
|
||||||
if (Character.Controlled != null)
|
if (Character.Controlled != null)
|
||||||
{
|
{
|
||||||
@@ -321,6 +326,7 @@ namespace Barotrauma
|
|||||||
Level prevLevel = Level.Loaded;
|
Level prevLevel = Level.Loaded;
|
||||||
|
|
||||||
bool success = CrewManager.GetCharacters().Any(c => !c.IsDead);
|
bool success = CrewManager.GetCharacters().Any(c => !c.IsDead);
|
||||||
|
GUI.SetSavingIndicatorState(success);
|
||||||
crewDead = false;
|
crewDead = false;
|
||||||
|
|
||||||
var continueButton = GameMain.GameSession.RoundSummary?.ContinueButton;
|
var continueButton = GameMain.GameSession.RoundSummary?.ContinueButton;
|
||||||
@@ -378,6 +384,7 @@ namespace Barotrauma
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GUI.SetSavingIndicatorState(false);
|
||||||
yield return CoroutineStatus.Success;
|
yield return CoroutineStatus.Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+10
@@ -217,6 +217,7 @@ namespace Barotrauma
|
|||||||
|
|
||||||
if (!savedOnStart)
|
if (!savedOnStart)
|
||||||
{
|
{
|
||||||
|
GUI.SetSavingIndicatorState(true);
|
||||||
SaveUtil.SaveGame(GameMain.GameSession.SavePath);
|
SaveUtil.SaveGame(GameMain.GameSession.SavePath);
|
||||||
savedOnStart = true;
|
savedOnStart = true;
|
||||||
}
|
}
|
||||||
@@ -228,6 +229,8 @@ namespace Barotrauma
|
|||||||
{
|
{
|
||||||
PetBehavior.LoadPets(petsElement);
|
PetBehavior.LoadPets(petsElement);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GUI.DisableSavingIndicatorDelayed();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void LoadInitialLevel()
|
protected override void LoadInitialLevel()
|
||||||
@@ -294,6 +297,11 @@ namespace Barotrauma
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (GameMain.GameSession == null)
|
||||||
|
{
|
||||||
|
GUI.DisableHUD = false;
|
||||||
|
yield return CoroutineStatus.Success;
|
||||||
|
}
|
||||||
overlayTextColor = Color.Lerp(Color.Transparent, Color.White, (timer - 1.0f) / fadeInDuration);
|
overlayTextColor = Color.Lerp(Color.Transparent, Color.White, (timer - 1.0f) / fadeInDuration);
|
||||||
timer = Math.Min(timer + CoroutineManager.DeltaTime, textDuration);
|
timer = Math.Min(timer + CoroutineManager.DeltaTime, textDuration);
|
||||||
yield return CoroutineStatus.Running;
|
yield return CoroutineStatus.Running;
|
||||||
@@ -377,6 +385,7 @@ namespace Barotrauma
|
|||||||
bool success = CrewManager.GetCharacters().Any(c => !c.IsDead);
|
bool success = CrewManager.GetCharacters().Any(c => !c.IsDead);
|
||||||
SoundPlayer.OverrideMusicType = success ? "endround" : "crewdead";
|
SoundPlayer.OverrideMusicType = success ? "endround" : "crewdead";
|
||||||
SoundPlayer.OverrideMusicDuration = 18.0f;
|
SoundPlayer.OverrideMusicDuration = 18.0f;
|
||||||
|
GUI.SetSavingIndicatorState(success);
|
||||||
crewDead = false;
|
crewDead = false;
|
||||||
|
|
||||||
GameMain.GameSession.EndRound("", traitorResults, transitionType);
|
GameMain.GameSession.EndRound("", traitorResults, transitionType);
|
||||||
@@ -486,6 +495,7 @@ namespace Barotrauma
|
|||||||
overlayColor = Color.Transparent;
|
overlayColor = Color.Transparent;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
GUI.SetSavingIndicatorState(false);
|
||||||
yield return CoroutineStatus.Success;
|
yield return CoroutineStatus.Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -106,6 +106,11 @@ namespace Barotrauma.Items.Components
|
|||||||
|
|
||||||
DeattachFromWall();
|
DeattachFromWall();
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
item.SetTransform(simPosition, 0.0f);
|
||||||
|
item.Submarine = sub;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -705,7 +705,7 @@ namespace Barotrauma.Items.Components
|
|||||||
if (c.Params.HideInSonar) { continue; }
|
if (c.Params.HideInSonar) { continue; }
|
||||||
|
|
||||||
if (!c.IsUnconscious && c.Params.DistantSonarRange > 0.0f &&
|
if (!c.IsUnconscious && c.Params.DistantSonarRange > 0.0f &&
|
||||||
c.AIController is EnemyAIController enemyAI && enemyAI.IsTargetingPlayer &&
|
c.AIController is EnemyAIController enemyAI && enemyAI.IsTargetingPlayerTeam &&
|
||||||
((c.WorldPosition - transducerCenter) * displayScale).LengthSquared() > DisplayRadius * DisplayRadius)
|
((c.WorldPosition - transducerCenter) * displayScale).LengthSquared() > DisplayRadius * DisplayRadius)
|
||||||
{
|
{
|
||||||
float dist = Vector2.Distance(c.WorldPosition, transducerCenter);
|
float dist = Vector2.Distance(c.WorldPosition, transducerCenter);
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ using Microsoft.Xna.Framework;
|
|||||||
using Microsoft.Xna.Framework.Graphics;
|
using Microsoft.Xna.Framework.Graphics;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Globalization;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
@@ -268,7 +269,7 @@ namespace Barotrauma
|
|||||||
{
|
{
|
||||||
foreach (string idStr in itemIdStrings[i].Split(';'))
|
foreach (string idStr in itemIdStrings[i].Split(';'))
|
||||||
{
|
{
|
||||||
if (!int.TryParse(idStr, out int id)) { continue; }
|
if (!int.TryParse(idStr, NumberStyles.Any, CultureInfo.InvariantCulture, out int id)) { continue; }
|
||||||
if (id != 0 && !ids.Contains(id)) { ids.Add(id); }
|
if (id != 0 && !ids.Contains(id)) { ids.Add(id); }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -304,7 +305,9 @@ namespace Barotrauma
|
|||||||
|
|
||||||
float rotation = element.GetAttributeFloat("rotation", 0f);
|
float rotation = element.GetAttributeFloat("rotation", 0f);
|
||||||
|
|
||||||
MapEntityPrefab prefab = MapEntityPrefab.List.First(p => p.Identifier.Equals(identifier, StringComparison.OrdinalIgnoreCase));
|
MapEntityPrefab prefab = MapEntityPrefab.List.FirstOrDefault(p => p.Identifier.Equals(identifier, StringComparison.OrdinalIgnoreCase));
|
||||||
|
if (prefab == null) { return; }
|
||||||
|
|
||||||
var texture = prefab.sprite.Texture;
|
var texture = prefab.sprite.Texture;
|
||||||
var srcRect = prefab.sprite.SourceRect;
|
var srcRect = prefab.sprite.SourceRect;
|
||||||
|
|
||||||
@@ -366,6 +369,12 @@ namespace Barotrauma
|
|||||||
}
|
}
|
||||||
else if (itemPrefab != null)
|
else if (itemPrefab != null)
|
||||||
{
|
{
|
||||||
|
bool usePrefabValues = element.GetAttributeBool("isoverride", false) != itemPrefab.IsOverride;
|
||||||
|
if (usePrefabValues)
|
||||||
|
{
|
||||||
|
scale = itemPrefab.ConfigElement.GetAttributeFloat(scale, "scale", "Scale");
|
||||||
|
}
|
||||||
|
|
||||||
ParseUpgrades(itemPrefab.ConfigElement, ref scale);
|
ParseUpgrades(itemPrefab.ConfigElement, ref scale);
|
||||||
|
|
||||||
if (prefab.ResizeVertical || prefab.ResizeHorizontal)
|
if (prefab.ResizeVertical || prefab.ResizeHorizontal)
|
||||||
@@ -494,7 +503,7 @@ namespace Barotrauma
|
|||||||
var doorSpriteElem = subElement.Elements().FirstOrDefault(e => e.Name.LocalName.Equals("sprite", StringComparison.OrdinalIgnoreCase));
|
var doorSpriteElem = subElement.Elements().FirstOrDefault(e => e.Name.LocalName.Equals("sprite", StringComparison.OrdinalIgnoreCase));
|
||||||
if (doorSpriteElem != null)
|
if (doorSpriteElem != null)
|
||||||
{
|
{
|
||||||
string texturePath = subElement.GetAttributeString("texture", "");
|
string texturePath = doorSpriteElem.GetAttributeString("texture", "");
|
||||||
Vector2 pos = rect.Location.ToVector2() * new Vector2(1f, -1f);
|
Vector2 pos = rect.Location.ToVector2() * new Vector2(1f, -1f);
|
||||||
if (subElement.GetAttributeBool("horizontal", false))
|
if (subElement.GetAttributeBool("horizontal", false))
|
||||||
{
|
{
|
||||||
@@ -539,11 +548,17 @@ namespace Barotrauma
|
|||||||
|
|
||||||
if (scaleModifier.StartsWith("*"))
|
if (scaleModifier.StartsWith("*"))
|
||||||
{
|
{
|
||||||
scale *= float.Parse(scaleModifier.Substring(1));
|
if (float.TryParse(scaleModifier.Substring(1), NumberStyles.Any, CultureInfo.InvariantCulture, out float parsedScale))
|
||||||
|
{
|
||||||
|
scale *= parsedScale;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
scale = float.Parse(scaleModifier);
|
if (float.TryParse(scaleModifier, NumberStyles.Any, CultureInfo.InvariantCulture, out float parsedScale))
|
||||||
|
{
|
||||||
|
scale = parsedScale;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -557,14 +572,19 @@ namespace Barotrauma
|
|||||||
|
|
||||||
if (!spriteRecorder.ReadyToRender)
|
if (!spriteRecorder.ReadyToRender)
|
||||||
{
|
{
|
||||||
string waitText = "Generating preview...";
|
string waitText = !loadTask.IsCompleted ?
|
||||||
|
"Generating preview..." :
|
||||||
|
(loadTask.Exception?.ToString() ?? "Task completed without marking as ready to render");
|
||||||
|
Vector2 origin = (GUI.Font.MeasureString(waitText) * 0.5f);
|
||||||
|
origin.X = MathF.Round(origin.X);
|
||||||
|
origin.Y = MathF.Round(origin.Y);
|
||||||
GUI.Font.DrawString(
|
GUI.Font.DrawString(
|
||||||
spriteBatch,
|
spriteBatch,
|
||||||
waitText,
|
waitText,
|
||||||
scissorRectangle.Center.ToVector2(),
|
scissorRectangle.Center.ToVector2(),
|
||||||
Color.White,
|
Color.White,
|
||||||
0f,
|
0f,
|
||||||
GUI.Font.MeasureString(waitText) * 0.5f,
|
origin,
|
||||||
1f,
|
1f,
|
||||||
SpriteEffects.None,
|
SpriteEffects.None,
|
||||||
0f);
|
0f);
|
||||||
|
|||||||
@@ -56,6 +56,11 @@ namespace Barotrauma.Networking
|
|||||||
public readonly NetStats NetStats;
|
public readonly NetStats NetStats;
|
||||||
|
|
||||||
protected GUITickBox cameraFollowsSub;
|
protected GUITickBox cameraFollowsSub;
|
||||||
|
public GUITickBox FollowSubTickBox => cameraFollowsSub;
|
||||||
|
|
||||||
|
public bool IsFollowSubTickBoxVisible =>
|
||||||
|
gameStarted && Screen.Selected == GameMain.GameScreen &&
|
||||||
|
cameraFollowsSub != null && cameraFollowsSub.Visible;
|
||||||
|
|
||||||
public CameraTransition EndCinematic;
|
public CameraTransition EndCinematic;
|
||||||
|
|
||||||
@@ -2095,7 +2100,7 @@ namespace Barotrauma.Networking
|
|||||||
serverSettings.ClientRead(settingsBuf);
|
serverSettings.ClientRead(settingsBuf);
|
||||||
if (!IsServerOwner)
|
if (!IsServerOwner)
|
||||||
{
|
{
|
||||||
ServerInfo info = GameMain.ServerListScreen.UpdateServerInfoWithServerSettings(serverEndpoint, serverSettings);
|
ServerInfo info = serverSettings.GetServerListInfo();
|
||||||
GameMain.ServerListScreen.AddToRecentServers(info);
|
GameMain.ServerListScreen.AddToRecentServers(info);
|
||||||
GameMain.NetLobbyScreen.Favorite.Visible = true;
|
GameMain.NetLobbyScreen.Favorite.Visible = true;
|
||||||
GameMain.NetLobbyScreen.Favorite.Selected = GameMain.ServerListScreen.IsFavorite(info);
|
GameMain.NetLobbyScreen.Favorite.Selected = GameMain.ServerListScreen.IsFavorite(info);
|
||||||
|
|||||||
@@ -567,5 +567,10 @@ namespace Barotrauma.Networking
|
|||||||
(other.LobbyID == LobbyID || other.LobbyID == 0 || LobbyID == 0) &&
|
(other.LobbyID == LobbyID || other.LobbyID == 0 || LobbyID == 0) &&
|
||||||
((OwnerID == 0) ? (other.IP == IP && other.Port == Port) : true);
|
((OwnerID == 0) ? (other.IP == IP && other.Port == Port) : true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool MatchesByEndpoint(ServerInfo other)
|
||||||
|
{
|
||||||
|
return OwnerID == other.OwnerID && (OwnerID != 0 ? true : (IP == other.IP && Port == other.Port));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -126,6 +126,8 @@ namespace Barotrauma.Networking
|
|||||||
|
|
||||||
public void ClientRead(IReadMessage incMsg)
|
public void ClientRead(IReadMessage incMsg)
|
||||||
{
|
{
|
||||||
|
cachedServerListInfo = null;
|
||||||
|
|
||||||
ServerName = incMsg.ReadString();
|
ServerName = incMsg.ReadString();
|
||||||
ServerMessageText = incMsg.ReadString();
|
ServerMessageText = incMsg.ReadString();
|
||||||
MaxPlayers = incMsg.ReadByte();
|
MaxPlayers = incMsg.ReadByte();
|
||||||
@@ -928,6 +930,7 @@ namespace Barotrauma.Networking
|
|||||||
|
|
||||||
public bool ToggleSettingsFrame(GUIButton button, object obj)
|
public bool ToggleSettingsFrame(GUIButton button, object obj)
|
||||||
{
|
{
|
||||||
|
if (GameMain.NetworkMember == null) { return false; }
|
||||||
if (settingsFrame == null)
|
if (settingsFrame == null)
|
||||||
{
|
{
|
||||||
CreateSettingsFrame();
|
CreateSettingsFrame();
|
||||||
@@ -949,5 +952,12 @@ namespace Barotrauma.Networking
|
|||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private ServerInfo cachedServerListInfo = null;
|
||||||
|
public ServerInfo GetServerListInfo()
|
||||||
|
{
|
||||||
|
cachedServerListInfo ??= GameMain.ServerListScreen.UpdateServerInfoWithServerSettings(GameMain.Client.ClientPeer.ServerConnection, this);
|
||||||
|
return cachedServerListInfo;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -683,7 +683,7 @@ namespace Barotrauma
|
|||||||
ToolTip = TextManager.Get("addtofavorites"),
|
ToolTip = TextManager.Get("addtofavorites"),
|
||||||
OnSelected = (tickbox) =>
|
OnSelected = (tickbox) =>
|
||||||
{
|
{
|
||||||
ServerInfo info = GameMain.ServerListScreen.UpdateServerInfoWithServerSettings(GameMain.Client.ClientPeer.ServerConnection.EndPointString, GameMain.Client.ServerSettings);
|
ServerInfo info = GameMain.Client.ServerSettings.GetServerListInfo();
|
||||||
if (tickbox.Selected)
|
if (tickbox.Selected)
|
||||||
{
|
{
|
||||||
GameMain.ServerListScreen.AddToFavoriteServers(info);
|
GameMain.ServerListScreen.AddToFavoriteServers(info);
|
||||||
|
|||||||
@@ -138,7 +138,7 @@ namespace Barotrauma
|
|||||||
|
|
||||||
private bool masterServerResponded;
|
private bool masterServerResponded;
|
||||||
private IRestResponse masterServerResponse;
|
private IRestResponse masterServerResponse;
|
||||||
|
|
||||||
private readonly float[] columnRelativeWidth = new float[] { 0.1f, 0.1f, 0.7f, 0.12f, 0.08f, 0.08f };
|
private readonly float[] columnRelativeWidth = new float[] { 0.1f, 0.1f, 0.7f, 0.12f, 0.08f, 0.08f };
|
||||||
private readonly string[] columnLabel = new string[] { "ServerListCompatible", "ServerListHasPassword", "ServerListName", "ServerListRoundStarted", "ServerListPlayers", "ServerListPing" };
|
private readonly string[] columnLabel = new string[] { "ServerListCompatible", "ServerListHasPassword", "ServerListName", "ServerListRoundStarted", "ServerListPlayers", "ServerListPing" };
|
||||||
|
|
||||||
@@ -779,28 +779,19 @@ namespace Barotrauma
|
|||||||
doc.SaveSafe(file);
|
doc.SaveSafe(file);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ServerInfo UpdateServerInfoWithServerSettings(object endpoint, ServerSettings serverSettings)
|
public ServerInfo UpdateServerInfoWithServerSettings(NetworkConnection endpoint, ServerSettings serverSettings)
|
||||||
{
|
{
|
||||||
UInt64 steamId = 0;
|
UInt64 steamId = 0;
|
||||||
string ip = ""; string port = "";
|
string ip = ""; string port = "";
|
||||||
if (endpoint is UInt64 id) { steamId = id; }
|
if (endpoint is SteamP2PConnection steamP2PConnection) { steamId = steamP2PConnection.SteamID; }
|
||||||
else if (endpoint is string strEndpoint)
|
else if (endpoint is LidgrenConnection lidgrenConnection)
|
||||||
{
|
{
|
||||||
string[] address = strEndpoint.Split(':');
|
ip = lidgrenConnection.IPString;
|
||||||
if (address.Length == 1)
|
port = lidgrenConnection.Port.ToString();
|
||||||
{
|
|
||||||
ip = strEndpoint;
|
|
||||||
port = NetConfig.DefaultPort.ToString();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
ip = string.Join(":", address.Take(address.Length - 1));
|
|
||||||
port = address[address.Length - 1];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isInfoNew = false;
|
bool isInfoNew = false;
|
||||||
ServerInfo info = serverList.Content.FindChild(d => (d.UserData is ServerInfo serverInfo) && serverInfo != null &&
|
ServerInfo info = serverList.Content.FindChild(d => (d.UserData is ServerInfo serverInfo) &&
|
||||||
(steamId != 0 ? steamId == serverInfo.OwnerID : (ip == serverInfo.IP && port == serverInfo.Port)))?.UserData as ServerInfo;
|
(steamId != 0 ? steamId == serverInfo.OwnerID : (ip == serverInfo.IP && port == serverInfo.Port)))?.UserData as ServerInfo;
|
||||||
if (info == null)
|
if (info == null)
|
||||||
{
|
{
|
||||||
@@ -849,7 +840,7 @@ namespace Barotrauma
|
|||||||
}
|
}
|
||||||
|
|
||||||
info.Recent = true;
|
info.Recent = true;
|
||||||
ServerInfo existingInfo = recentServers.Find(serverInfo => info.OwnerID == serverInfo.OwnerID && (info.OwnerID != 0 ? true : (info.IP == serverInfo.IP && info.Port == serverInfo.Port)));
|
ServerInfo existingInfo = recentServers.Find(info.MatchesByEndpoint);
|
||||||
if (existingInfo == null)
|
if (existingInfo == null)
|
||||||
{
|
{
|
||||||
recentServers.Add(info);
|
recentServers.Add(info);
|
||||||
@@ -865,13 +856,13 @@ namespace Barotrauma
|
|||||||
|
|
||||||
public bool IsFavorite(ServerInfo info)
|
public bool IsFavorite(ServerInfo info)
|
||||||
{
|
{
|
||||||
return favoriteServers.Any(serverInfo => info.OwnerID == serverInfo.OwnerID && (info.OwnerID != 0 ? true : (info.IP == serverInfo.IP && info.Port == serverInfo.Port)));
|
return favoriteServers.Any(info.MatchesByEndpoint);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AddToFavoriteServers(ServerInfo info)
|
public void AddToFavoriteServers(ServerInfo info)
|
||||||
{
|
{
|
||||||
info.Favorite = true;
|
info.Favorite = true;
|
||||||
ServerInfo existingInfo = favoriteServers.Find(serverInfo => info.OwnerID == serverInfo.OwnerID && (info.OwnerID != 0 ? true : (info.IP == serverInfo.IP && info.Port == serverInfo.Port)));
|
ServerInfo existingInfo = favoriteServers.Find(info.MatchesByEndpoint);
|
||||||
if (existingInfo == null)
|
if (existingInfo == null)
|
||||||
{
|
{
|
||||||
favoriteServers.Add(info);
|
favoriteServers.Add(info);
|
||||||
@@ -888,7 +879,7 @@ namespace Barotrauma
|
|||||||
public void RemoveFromFavoriteServers(ServerInfo info)
|
public void RemoveFromFavoriteServers(ServerInfo info)
|
||||||
{
|
{
|
||||||
info.Favorite = false;
|
info.Favorite = false;
|
||||||
ServerInfo existingInfo = favoriteServers.Find(serverInfo => info.OwnerID == serverInfo.OwnerID && (info.OwnerID != 0 ? true : (info.IP == serverInfo.IP && info.Port == serverInfo.Port)));
|
ServerInfo existingInfo = favoriteServers.Find(info.MatchesByEndpoint);
|
||||||
if (existingInfo != null)
|
if (existingInfo != null)
|
||||||
{
|
{
|
||||||
favoriteServers.Remove(existingInfo);
|
favoriteServers.Remove(existingInfo);
|
||||||
@@ -1263,8 +1254,7 @@ namespace Barotrauma
|
|||||||
};
|
};
|
||||||
|
|
||||||
var serverFrame = serverList.Content.FindChild(d => (d.UserData is ServerInfo info) &&
|
var serverFrame = serverList.Content.FindChild(d => (d.UserData is ServerInfo info) &&
|
||||||
info.OwnerID == serverInfo.OwnerID &&
|
info.MatchesByEndpoint(serverInfo));
|
||||||
(serverInfo.OwnerID != 0 ? true : (info.IP == serverInfo.IP && info.Port == serverInfo.Port)));
|
|
||||||
|
|
||||||
if (serverFrame != null)
|
if (serverFrame != null)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -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.1300.0.4</Version>
|
<Version>0.1300.0.5</Version>
|
||||||
<Copyright>Copyright © FakeFish 2018-2020</Copyright>
|
<Copyright>Copyright © FakeFish 2018-2020</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.1300.0.4</Version>
|
<Version>0.1300.0.5</Version>
|
||||||
<Copyright>Copyright © FakeFish 2018-2020</Copyright>
|
<Copyright>Copyright © FakeFish 2018-2020</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.1300.0.4</Version>
|
<Version>0.1300.0.5</Version>
|
||||||
<Copyright>Copyright © FakeFish 2018-2020</Copyright>
|
<Copyright>Copyright © FakeFish 2018-2020</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.1300.0.4</Version>
|
<Version>0.1300.0.5</Version>
|
||||||
<Copyright>Copyright © FakeFish 2018-2020</Copyright>
|
<Copyright>Copyright © FakeFish 2018-2020</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.1300.0.4</Version>
|
<Version>0.1300.0.5</Version>
|
||||||
<Copyright>Copyright © FakeFish 2018-2020</Copyright>
|
<Copyright>Copyright © FakeFish 2018-2020</Copyright>
|
||||||
<Platforms>AnyCPU;x64</Platforms>
|
<Platforms>AnyCPU;x64</Platforms>
|
||||||
<AssemblyName>DedicatedServer</AssemblyName>
|
<AssemblyName>DedicatedServer</AssemblyName>
|
||||||
|
|||||||
@@ -105,6 +105,14 @@ namespace Barotrauma
|
|||||||
focusedItem = item;
|
focusedItem = item;
|
||||||
FocusedCharacter = null;
|
FocusedCharacter = null;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//failed to interact with the item
|
||||||
|
// -> correct the position and the state of the Holdable component (in case the item was deattached client-side)
|
||||||
|
item.PositionUpdateInterval = 0.0f;
|
||||||
|
var holdable = item.GetComponent<Items.Components.Holdable>();
|
||||||
|
holdable.Item?.CreateServerEvent(holdable);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (closestEntity is Character character)
|
else if (closestEntity is Character character)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -567,10 +567,13 @@ namespace Barotrauma
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
NewMessage("Valid permissions are:", Color.White);
|
if (args.Length < 2)
|
||||||
foreach (ClientPermissions permission in Enum.GetValues(typeof(ClientPermissions)))
|
|
||||||
{
|
{
|
||||||
NewMessage(" - " + permission.ToString(), Color.White);
|
NewMessage("Valid permissions are:", Color.White);
|
||||||
|
foreach (ClientPermissions permission in Enum.GetValues(typeof(ClientPermissions)))
|
||||||
|
{
|
||||||
|
NewMessage(" - " + permission.ToString(), Color.White);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
ShowQuestionPrompt("Permission to revoke from \"" + client.Name + "\"?", (perm) =>
|
ShowQuestionPrompt("Permission to revoke from \"" + client.Name + "\"?", (perm) =>
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -257,9 +257,10 @@ namespace Barotrauma.Networking
|
|||||||
|
|
||||||
msg.Write(SenderName);
|
msg.Write(SenderName);
|
||||||
msg.Write(SenderClient != null);
|
msg.Write(SenderClient != null);
|
||||||
msg.Write(SenderClient != null ?
|
if (SenderClient != null)
|
||||||
((SenderClient.SteamID != 0) ? SenderClient.SteamID : SenderClient.ID) :
|
{
|
||||||
0);
|
msg.Write((SenderClient.SteamID != 0) ? SenderClient.SteamID : SenderClient.ID);
|
||||||
|
}
|
||||||
msg.Write(Sender != null && c.InGame);
|
msg.Write(Sender != null && c.InGame);
|
||||||
if (Sender != null && c.InGame)
|
if (Sender != null && c.InGame)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -9,9 +9,10 @@
|
|||||||
msg.Write((byte)ChatMessageType.Order);
|
msg.Write((byte)ChatMessageType.Order);
|
||||||
msg.Write(SenderName);
|
msg.Write(SenderName);
|
||||||
msg.Write(SenderClient != null);
|
msg.Write(SenderClient != null);
|
||||||
msg.Write(SenderClient != null ?
|
if (SenderClient != null)
|
||||||
((SenderClient.SteamID != 0) ? SenderClient.SteamID : SenderClient.ID) :
|
{
|
||||||
0);
|
msg.Write((SenderClient.SteamID != 0) ? SenderClient.SteamID : SenderClient.ID);
|
||||||
|
}
|
||||||
msg.Write(Sender != null && c.InGame);
|
msg.Write(Sender != null && c.InGame);
|
||||||
if (Sender != null && c.InGame)
|
if (Sender != null && c.InGame)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -19,11 +19,13 @@ namespace Barotrauma.Networking
|
|||||||
if (c.SpectateOnly && (GameMain.Server.ServerSettings.AllowSpectating || GameMain.Server.OwnerConnection == c.Connection)) { continue; }
|
if (c.SpectateOnly && (GameMain.Server.ServerSettings.AllowSpectating || GameMain.Server.OwnerConnection == c.Connection)) { continue; }
|
||||||
if (c.Character != null && !c.Character.IsDead) { continue; }
|
if (c.Character != null && !c.Character.IsDead) { continue; }
|
||||||
|
|
||||||
//don't allow respawning if the client has previously disconnected and their corpse is still present on the server
|
if (UseRespawnPrompt)
|
||||||
var matchingData = campaign?.GetClientCharacterData(c);
|
|
||||||
if (matchingData != null && matchingData.HasSpawned)
|
|
||||||
{
|
{
|
||||||
if (!c.WaitForNextRoundRespawn.HasValue || c.WaitForNextRoundRespawn.Value) { continue; }
|
var matchingData = campaign?.GetClientCharacterData(c);
|
||||||
|
if (matchingData != null && matchingData.HasSpawned)
|
||||||
|
{
|
||||||
|
if (!c.WaitForNextRoundRespawn.HasValue || c.WaitForNextRoundRespawn.Value) { continue; }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
yield return c;
|
yield return c;
|
||||||
|
|||||||
@@ -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.1300.0.4</Version>
|
<Version>0.1300.0.5</Version>
|
||||||
<Copyright>Copyright © FakeFish 2018-2020</Copyright>
|
<Copyright>Copyright © FakeFish 2018-2020</Copyright>
|
||||||
<Platforms>AnyCPU;x64</Platforms>
|
<Platforms>AnyCPU;x64</Platforms>
|
||||||
<AssemblyName>DedicatedServer</AssemblyName>
|
<AssemblyName>DedicatedServer</AssemblyName>
|
||||||
|
|||||||
@@ -181,10 +181,12 @@ namespace Barotrauma
|
|||||||
private set;
|
private set;
|
||||||
} = new HashSet<Submarine>();
|
} = new HashSet<Submarine>();
|
||||||
|
|
||||||
public bool IsTargetingPlayer => SelectedAiTarget?.Entity?.Submarine != null && SelectedAiTarget.Entity.Submarine.Info.IsPlayer || SelectedAiTarget?.Entity is Character targetCharacter && targetCharacter.IsPlayer;
|
public bool IsTargetingPlayerTeam => IsTargetInPlayerTeam(SelectedAiTarget);
|
||||||
public bool IsBeingChasedBy(Character c) => c.AIController is EnemyAIController enemyAI && enemyAI.SelectedAiTarget?.Entity is Character && (enemyAI.State == AIState.Aggressive || enemyAI.State == AIState.Attack);
|
public bool IsBeingChasedBy(Character c) => c.AIController is EnemyAIController enemyAI && enemyAI.SelectedAiTarget?.Entity is Character && (enemyAI.State == AIState.Aggressive || enemyAI.State == AIState.Attack);
|
||||||
private bool IsBeingChased => SelectedAiTarget?.Entity is Character targetCharacter && IsBeingChasedBy(targetCharacter);
|
private bool IsBeingChased => SelectedAiTarget?.Entity is Character targetCharacter && IsBeingChasedBy(targetCharacter);
|
||||||
|
|
||||||
|
private bool IsTargetInPlayerTeam(AITarget target) => target?.Entity?.Submarine != null && target.Entity.Submarine.Info.IsPlayer || target?.Entity is Character targetCharacter && targetCharacter.IsOnPlayerTeam;
|
||||||
|
|
||||||
private bool reverse;
|
private bool reverse;
|
||||||
public bool Reverse
|
public bool Reverse
|
||||||
{
|
{
|
||||||
@@ -2465,11 +2467,17 @@ namespace Barotrauma
|
|||||||
default:
|
default:
|
||||||
if (targetParams.State == AIState.Attack)
|
if (targetParams.State == AIState.Attack)
|
||||||
{
|
{
|
||||||
|
// In the attack state allow going into non-allowed zone only when chasing a target.
|
||||||
if (State == targetParams.State && SelectedAiTarget == aiTarget) { break; }
|
if (State == targetParams.State && SelectedAiTarget == aiTarget) { break; }
|
||||||
}
|
}
|
||||||
if (!IsPositionInsideAllowedZone(aiTarget.WorldPosition, out _))
|
if (!IsPositionInsideAllowedZone(aiTarget.WorldPosition, out _))
|
||||||
{
|
{
|
||||||
continue;
|
// If we have recently been damaged by the target (or another player/bot in the same team) allow targeting it even when we are in the idle state.
|
||||||
|
bool isTargetInPlayerTeam = IsTargetInPlayerTeam(aiTarget);
|
||||||
|
if (Character.LastAttackers.None(a => a.Damage > 0 && a.Character != null && (a.Character == aiTarget.Entity || a.Character.IsOnPlayerTeam && isTargetInPlayerTeam)))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
+11
-2
@@ -61,13 +61,22 @@ namespace Barotrauma
|
|||||||
|
|
||||||
protected override void Act(float deltaTime)
|
protected override void Act(float deltaTime)
|
||||||
{
|
{
|
||||||
// Only continue when the get item sub objectives have been completed.
|
|
||||||
if (subObjectives.Any()) { return; }
|
|
||||||
if (item.IgnoreByAI)
|
if (item.IgnoreByAI)
|
||||||
{
|
{
|
||||||
Abandon = true;
|
Abandon = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (item.ParentInventory != null)
|
||||||
|
{
|
||||||
|
if (item.Container != null && !AIObjectiveCleanupItems.IsValidContainer(item.Container, character, allowUnloading: objectiveManager.HasOrders()))
|
||||||
|
{
|
||||||
|
// Target was picked up or moved by someone.
|
||||||
|
Abandon = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Only continue when the get item sub objectives have been completed.
|
||||||
|
if (subObjectives.Any()) { return; }
|
||||||
if (HumanAIController.FindSuitableContainer(character, item, ignoredContainers, ref itemIndex, out Item suitableContainer))
|
if (HumanAIController.FindSuitableContainer(character, item, ignoredContainers, ref itemIndex, out Item suitableContainer))
|
||||||
{
|
{
|
||||||
itemIndex = 0;
|
itemIndex = 0;
|
||||||
|
|||||||
@@ -477,7 +477,7 @@ namespace Barotrauma
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public const float KnockbackCooldown = 30.0f;
|
public const float KnockbackCooldown = 5.0f;
|
||||||
public float KnockbackCooldownTimer;
|
public float KnockbackCooldownTimer;
|
||||||
|
|
||||||
private float ragdollingLockTimer;
|
private float ragdollingLockTimer;
|
||||||
@@ -3310,7 +3310,7 @@ namespace Barotrauma
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if CLIENT
|
#if CLIENT
|
||||||
if (attacker == Controlled && Controlled != null && Params.UseBossHealthBar)
|
if (Params.UseBossHealthBar && Controlled != null && Controlled.teamID == attacker?.teamID)
|
||||||
{
|
{
|
||||||
CharacterHUD.ShowBossHealthBar(this);
|
CharacterHUD.ShowBossHealthBar(this);
|
||||||
}
|
}
|
||||||
@@ -3990,7 +3990,7 @@ namespace Barotrauma
|
|||||||
|
|
||||||
public bool IsProtectedFromPressure()
|
public bool IsProtectedFromPressure()
|
||||||
{
|
{
|
||||||
return PressureProtection >= (Level.Loaded?.GetRealWorldDepth(WorldPosition.Y) ?? 0.0f);
|
return PressureProtection >= (Level.Loaded?.GetRealWorldDepth(WorldPosition.Y) ?? 1.0f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -344,7 +344,7 @@ namespace Barotrauma
|
|||||||
return new string[][]
|
return new string[][]
|
||||||
{
|
{
|
||||||
GameMain.NetworkMember.ConnectedClients.Select(c => c.Name).ToArray(),
|
GameMain.NetworkMember.ConnectedClients.Select(c => c.Name).ToArray(),
|
||||||
commands.Select(c => c.names[0]).ToArray()
|
commands.Select(c => c.names[0]).Union(new string[]{ "All" }).ToArray()
|
||||||
};
|
};
|
||||||
}));
|
}));
|
||||||
|
|
||||||
@@ -356,7 +356,7 @@ namespace Barotrauma
|
|||||||
return new string[][]
|
return new string[][]
|
||||||
{
|
{
|
||||||
GameMain.NetworkMember.ConnectedClients.Select(c => c.Name).ToArray(),
|
GameMain.NetworkMember.ConnectedClients.Select(c => c.Name).ToArray(),
|
||||||
new string[0]
|
commands.Select(c => c.names[0]).Union(new string[]{ "All" }).ToArray()
|
||||||
};
|
};
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|||||||
@@ -215,7 +215,7 @@ namespace Barotrauma
|
|||||||
float dist = Vector2.DistanceSquared(pos, refSub.WorldPosition);
|
float dist = Vector2.DistanceSquared(pos, refSub.WorldPosition);
|
||||||
foreach (Submarine sub in Submarine.Loaded)
|
foreach (Submarine sub in Submarine.Loaded)
|
||||||
{
|
{
|
||||||
if (sub.Info.Type != SubmarineType.Player) { continue; }
|
if (sub.Info.Type != SubmarineType.Player && sub != GameMain.NetworkMember?.RespawnManager?.RespawnShuttle) { continue; }
|
||||||
|
|
||||||
float minDistToSub = GetMinDistanceToSub(sub);
|
float minDistToSub = GetMinDistanceToSub(sub);
|
||||||
if (dist < minDistToSub * minDistToSub) { continue; }
|
if (dist < minDistToSub * minDistToSub) { continue; }
|
||||||
|
|||||||
@@ -443,6 +443,7 @@ namespace Barotrauma.Items.Components
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
//not attached -> pick the item instantly, ignoring picking time
|
//not attached -> pick the item instantly, ignoring picking time
|
||||||
return OnPicked(picker);
|
return OnPicked(picker);
|
||||||
}
|
}
|
||||||
@@ -450,6 +451,10 @@ namespace Barotrauma.Items.Components
|
|||||||
|
|
||||||
public override bool OnPicked(Character picker)
|
public override bool OnPicked(Character picker)
|
||||||
{
|
{
|
||||||
|
if (GameMain.NetworkMember != null && GameMain.NetworkMember.IsClient)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if (base.OnPicked(picker))
|
if (base.OnPicked(picker))
|
||||||
{
|
{
|
||||||
DeattachFromWall();
|
DeattachFromWall();
|
||||||
|
|||||||
@@ -347,10 +347,10 @@ namespace Barotrauma.Items.Components
|
|||||||
|
|
||||||
for (int i = item.LastSentSignalRecipients.Count - 1; i >= 0; i--)
|
for (int i = item.LastSentSignalRecipients.Count - 1; i >= 0; i--)
|
||||||
{
|
{
|
||||||
if (item.LastSentSignalRecipients[i].Condition <= 0.0f) continue;
|
if (item.LastSentSignalRecipients[i].Item.Condition <= 0.0f) { continue; }
|
||||||
if (item.LastSentSignalRecipients[i].Prefab.FocusOnSelected)
|
if (item.LastSentSignalRecipients[i].Item.Prefab.FocusOnSelected)
|
||||||
{
|
{
|
||||||
return item.LastSentSignalRecipients[i];
|
return item.LastSentSignalRecipients[i].Item;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -353,7 +353,7 @@ namespace Barotrauma.Items.Components
|
|||||||
{
|
{
|
||||||
if (recipient.Item == item || recipient.Item == signal.source) { continue; }
|
if (recipient.Item == item || recipient.Item == signal.source) { continue; }
|
||||||
|
|
||||||
signal.source?.LastSentSignalRecipients.Add(recipient.Item);
|
signal.source?.LastSentSignalRecipients.Add(recipient);
|
||||||
|
|
||||||
foreach (ItemComponent ic in recipient.Item.Components)
|
foreach (ItemComponent ic in recipient.Item.Components)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -83,6 +83,8 @@ namespace Barotrauma.Items.Components
|
|||||||
item = connectionPanel.Item;
|
item = connectionPanel.Item;
|
||||||
|
|
||||||
MaxWires = element.GetAttributeInt("maxwires", DefaultMaxWires);
|
MaxWires = element.GetAttributeInt("maxwires", DefaultMaxWires);
|
||||||
|
MaxWires = Math.Max(element.Elements().Count(e => e.Name.ToString().Equals("link", StringComparison.OrdinalIgnoreCase)), MaxWires);
|
||||||
|
|
||||||
MaxPlayerConnectableWires = element.GetAttributeInt("maxplayerconnectablewires", MaxWires);
|
MaxPlayerConnectableWires = element.GetAttributeInt("maxplayerconnectablewires", MaxWires);
|
||||||
wires = new Wire[MaxWires];
|
wires = new Wire[MaxWires];
|
||||||
|
|
||||||
@@ -152,19 +154,15 @@ namespace Barotrauma.Items.Components
|
|||||||
int index = -1;
|
int index = -1;
|
||||||
for (int i = 0; i < MaxWires; i++)
|
for (int i = 0; i < MaxWires; i++)
|
||||||
{
|
{
|
||||||
if (wireId[i] < 1) index = i;
|
if (wireId[i] < 1) { index = i; }
|
||||||
}
|
}
|
||||||
if (index == -1) break;
|
if (index == -1) { break; }
|
||||||
|
|
||||||
int id = subElement.GetAttributeInt("w", 0);
|
int id = subElement.GetAttributeInt("w", 0);
|
||||||
if (id < 0)
|
if (id < 0) { id = 0; }
|
||||||
{
|
|
||||||
id = 0;
|
|
||||||
}
|
|
||||||
wireId[index] = idRemap.GetOffsetId(id);
|
wireId[index] = idRemap.GetOffsetId(id);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "statuseffect":
|
case "statuseffect":
|
||||||
Effects.Add(StatusEffect.Load(subElement, item.Name + ", connection " + Name));
|
Effects.Add(StatusEffect.Load(subElement, item.Name + ", connection " + Name));
|
||||||
break;
|
break;
|
||||||
@@ -263,9 +261,9 @@ namespace Barotrauma.Items.Components
|
|||||||
|
|
||||||
Connection recipient = wires[i].OtherConnection(this);
|
Connection recipient = wires[i].OtherConnection(this);
|
||||||
if (recipient == null) { continue; }
|
if (recipient == null) { continue; }
|
||||||
if (recipient.item == this.item || signal.source?.LastSentSignalRecipients.LastOrDefault() == recipient.item) { continue; }
|
if (recipient.item == this.item || signal.source?.LastSentSignalRecipients.LastOrDefault() == recipient) { continue; }
|
||||||
|
|
||||||
signal.source?.LastSentSignalRecipients.Add(recipient.item);
|
signal.source?.LastSentSignalRecipients.Add(recipient);
|
||||||
|
|
||||||
Connection connection = recipient;
|
Connection connection = recipient;
|
||||||
|
|
||||||
|
|||||||
@@ -150,7 +150,7 @@ namespace Barotrauma.Items.Components
|
|||||||
{
|
{
|
||||||
string signalOut = MotionDetected ? Output : FalseOutput;
|
string signalOut = MotionDetected ? Output : FalseOutput;
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(signalOut)) item.SendSignal( new Signal(signalOut, 1), "state_out");
|
if (!string.IsNullOrEmpty(signalOut)) { item.SendSignal(new Signal(signalOut, 1), "state_out"); }
|
||||||
|
|
||||||
updateTimer -= deltaTime;
|
updateTimer -= deltaTime;
|
||||||
if (updateTimer > 0.0f) return;
|
if (updateTimer > 0.0f) return;
|
||||||
|
|||||||
@@ -173,11 +173,11 @@ namespace Barotrauma.Items.Components
|
|||||||
|
|
||||||
if (signal.source != null)
|
if (signal.source != null)
|
||||||
{
|
{
|
||||||
foreach (Item receiverItem in wifiComp.item.LastSentSignalRecipients)
|
foreach (Connection receiver in wifiComp.item.LastSentSignalRecipients)
|
||||||
{
|
{
|
||||||
if (!signal.source.LastSentSignalRecipients.Contains(receiverItem))
|
if (!signal.source.LastSentSignalRecipients.Contains(receiver))
|
||||||
{
|
{
|
||||||
signal.source.LastSentSignalRecipients.Add(receiverItem);
|
signal.source.LastSentSignalRecipients.Add(receiver);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -439,8 +439,8 @@ namespace Barotrauma.Items.Components
|
|||||||
var projectiles = GetLoadedProjectiles(true);
|
var projectiles = GetLoadedProjectiles(true);
|
||||||
if (projectiles.Any())
|
if (projectiles.Any())
|
||||||
{
|
{
|
||||||
ItemContainer projectileContainer = projectiles.First().Item.Container?.GetComponent<ItemContainer>();
|
ItemContainer projectileContainer = projectiles.First().Item.Container?.GetComponent<ItemContainer>();
|
||||||
projectileContainer?.Item.Use(deltaTime, null);
|
if (projectileContainer?.Item != item) { projectileContainer?.Item.Use(deltaTime, null); }
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -593,13 +593,13 @@ namespace Barotrauma
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A list of items the last signal sent by this item went through
|
/// A list of connections the last signal sent by this item went through
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public List<Item> LastSentSignalRecipients
|
public List<Connection> LastSentSignalRecipients
|
||||||
{
|
{
|
||||||
get;
|
get;
|
||||||
private set;
|
private set;
|
||||||
} = new List<Item>(20);
|
} = new List<Connection>(20);
|
||||||
|
|
||||||
public string ConfigFile
|
public string ConfigFile
|
||||||
{
|
{
|
||||||
@@ -1921,7 +1921,7 @@ namespace Barotrauma
|
|||||||
//if the signal has been passed through this item multiple times already, interrupt it to prevent infinite loops
|
//if the signal has been passed through this item multiple times already, interrupt it to prevent infinite loops
|
||||||
if (signal.source != null)
|
if (signal.source != null)
|
||||||
{
|
{
|
||||||
if (signal.source.LastSentSignalRecipients.Count(recipient => recipient == this) > 2)
|
if (signal.source.LastSentSignalRecipients.Count(recipient => recipient == connection) > 2)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1887,7 +1887,9 @@ namespace Barotrauma
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
shortestDistSqr = Math.Min(shortestDistSqr, MathUtils.DistanceSquared((double)point.X, (double)point.Y, (double)startPosition.X, (double)startPosition.Y));
|
shortestDistSqr = Math.Min(shortestDistSqr, MathUtils.DistanceSquared((double)point.X, (double)point.Y, (double)startPosition.X, (double)startPosition.Y));
|
||||||
|
shortestDistSqr = Math.Min(shortestDistSqr, MathUtils.DistanceSquared((double)point.X, (double)point.Y, (double)startExitPosition.X, (double)borders.Bottom));
|
||||||
shortestDistSqr = Math.Min(shortestDistSqr, MathUtils.DistanceSquared((double)point.X, (double)point.Y, (double)endPosition.X, (double)endPosition.Y));
|
shortestDistSqr = Math.Min(shortestDistSqr, MathUtils.DistanceSquared((double)point.X, (double)point.Y, (double)endPosition.X, (double)endPosition.Y));
|
||||||
|
shortestDistSqr = Math.Min(shortestDistSqr, MathUtils.DistanceSquared((double)point.X, (double)point.Y, (double)endExitPosition.X, (double)borders.Bottom));
|
||||||
distanceField.Add((point, Math.Sqrt(shortestDistSqr)));
|
distanceField.Add((point, Math.Sqrt(shortestDistSqr)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -101,6 +101,7 @@ namespace Barotrauma
|
|||||||
sl.filePath = filePath;
|
sl.filePath = filePath;
|
||||||
sl.saveElement = doc.Root;
|
sl.saveElement = doc.Root;
|
||||||
sl.saveElement.Name = "LinkedSubmarine";
|
sl.saveElement.Name = "LinkedSubmarine";
|
||||||
|
sl.saveElement.SetAttributeValue("filepath", filePath);
|
||||||
|
|
||||||
return sl;
|
return sl;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,7 +48,14 @@ namespace Barotrauma
|
|||||||
if (!Enabled) { return; }
|
if (!Enabled) { return; }
|
||||||
if (steps <= 0) { return; }
|
if (steps <= 0) { return; }
|
||||||
|
|
||||||
IncreaseRadiation(Params.RadiationStep * steps);
|
float increaseAmount = Params.RadiationStep * steps;
|
||||||
|
|
||||||
|
if (Params.MaxRadiation > 0 && Params.MaxRadiation < Amount + increaseAmount)
|
||||||
|
{
|
||||||
|
increaseAmount = Params.MaxRadiation - Amount;
|
||||||
|
}
|
||||||
|
|
||||||
|
IncreaseRadiation(increaseAmount);
|
||||||
|
|
||||||
int amountOfOutposts = Map.Locations.Count(location => location.Type.HasOutpost && !location.IsCriticallyRadiated());
|
int amountOfOutposts = Map.Locations.Count(location => location.Type.HasOutpost && !location.IsCriticallyRadiated());
|
||||||
|
|
||||||
|
|||||||
@@ -30,6 +30,9 @@ namespace Barotrauma
|
|||||||
[Serialize(defaultValue: 1f, isSaveable: false, "How much is the radiation affliction increased by while in a radiated zone.")]
|
[Serialize(defaultValue: 1f, isSaveable: false, "How much is the radiation affliction increased by while in a radiated zone.")]
|
||||||
public float RadiationDamageAmount { get; set; }
|
public float RadiationDamageAmount { get; set; }
|
||||||
|
|
||||||
|
[Serialize(defaultValue: -1.0f, isSaveable: false, "Maximum amount of radiation.")]
|
||||||
|
public float MaxRadiation { get; set; }
|
||||||
|
|
||||||
[Serialize(defaultValue: "139,0,0,85", isSaveable: false, "The color of the radiated area.")]
|
[Serialize(defaultValue: "139,0,0,85", isSaveable: false, "The color of the radiated area.")]
|
||||||
public Color RadiationAreaColor { get; set; }
|
public Color RadiationAreaColor { get; set; }
|
||||||
|
|
||||||
|
|||||||
@@ -870,10 +870,10 @@ namespace Barotrauma
|
|||||||
|
|
||||||
foreach (Item item in Item.ItemList)
|
foreach (Item item in Item.ItemList)
|
||||||
{
|
{
|
||||||
if (item.Submarine != submarine || item.CurrentHull == null ||
|
if (item.Submarine != submarine || item.CurrentHull == null || item.body == null || !item.body.Enabled) { continue; }
|
||||||
item.body == null || !item.body.Enabled) continue;
|
|
||||||
|
|
||||||
item.body.ApplyLinearImpulse(item.body.Mass * impulse, 10.0f);
|
item.body.ApplyLinearImpulse(item.body.Mass * impulse, 10.0f);
|
||||||
|
item.PositionUpdateInterval = 0.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
float dmg = applyDamage ? impact * ImpactDamageMultiplier : 0.0f;
|
float dmg = applyDamage ? impact * ImpactDamageMultiplier : 0.0f;
|
||||||
|
|||||||
@@ -8,7 +8,18 @@ namespace Barotrauma.Networking
|
|||||||
{
|
{
|
||||||
public enum ChatMessageType
|
public enum ChatMessageType
|
||||||
{
|
{
|
||||||
Default, Error, Dead, Server, Radio, Private, Console, MessageBox, Order, ServerLog, ServerMessageBox, ServerMessageBoxInGame
|
Default = 0,
|
||||||
|
Error = 1,
|
||||||
|
Dead = 2,
|
||||||
|
Server = 3,
|
||||||
|
Radio = 4,
|
||||||
|
Private = 5,
|
||||||
|
Console = 6,
|
||||||
|
MessageBox = 7,
|
||||||
|
Order = 8,
|
||||||
|
ServerLog = 9,
|
||||||
|
ServerMessageBox = 10,
|
||||||
|
ServerMessageBoxInGame = 11
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum PlayerConnectionChangeType { None = 0, Joined = 1, Kicked = 2, Disconnected = 3, Banned = 4 }
|
public enum PlayerConnectionChangeType { None = 0, Joined = 1, Kicked = 2, Disconnected = 3, Banned = 4 }
|
||||||
|
|||||||
@@ -173,7 +173,7 @@ namespace Barotrauma.Networking
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
protected ServerSettings serverSettings;
|
protected ServerSettings serverSettings;
|
||||||
|
|
||||||
protected TimeSpan updateInterval;
|
protected TimeSpan updateInterval;
|
||||||
protected DateTime updateTimer;
|
protected DateTime updateTimer;
|
||||||
|
|
||||||
|
|||||||
@@ -55,6 +55,14 @@ namespace Barotrauma.Networking
|
|||||||
|
|
||||||
public State CurrentState { get; private set; }
|
public State CurrentState { get; private set; }
|
||||||
|
|
||||||
|
public bool UseRespawnPrompt
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return GameMain.GameSession?.GameMode is CampaignMode && Level.Loaded != null && Level.Loaded?.Type != LevelData.LevelType.Outpost;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private float maxTransportTime;
|
private float maxTransportTime;
|
||||||
|
|
||||||
private float updateReturnTimer;
|
private float updateReturnTimer;
|
||||||
|
|||||||
@@ -33,6 +33,12 @@
|
|||||||
GUI.ScreenChanged = true;
|
GUI.ScreenChanged = true;
|
||||||
}
|
}
|
||||||
SubmarinePreview.Close();
|
SubmarinePreview.Close();
|
||||||
|
|
||||||
|
// Make sure the saving indicator is disabled when returning to main menu or lobby
|
||||||
|
if (this == GameMain.MainMenuScreen || this == GameMain.NetLobbyScreen)
|
||||||
|
{
|
||||||
|
GUI.DisableSavingIndicatorDelayed();
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
selected = this;
|
selected = this;
|
||||||
|
|||||||
@@ -1,3 +1,47 @@
|
|||||||
|
---------------------------------------------------------------------------------------------------------
|
||||||
|
v0.1300.0.6 (unstable)
|
||||||
|
---------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
Fixes:
|
||||||
|
- Fixed bots trying to clean up items that have changed place and shouldn't be allowed to clean up anymore. Fixes #5400
|
||||||
|
|
||||||
|
|
||||||
|
---------------------------------------------------------------------------------------------------------
|
||||||
|
v0.1300.0.5 (unstable)
|
||||||
|
---------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
Changes:
|
||||||
|
- Moloch: adjust the sounds a bit.
|
||||||
|
- Added and adjusted sounds for Endworm and Charybdis.
|
||||||
|
- Increased the audio ranges for Watcher and Hammerhead Matriarch.
|
||||||
|
- More polished versions of the textures for Endworm and Charybdis.
|
||||||
|
- Visual tweaks to the boss health bars.
|
||||||
|
- Hide the boss health bar when the creature is not targeting the player.
|
||||||
|
- Allow a monster to attack the player even when it's in the restricted area (abyss for non-abyss creatures or non-abyss for abyss creatures) if the player has lately made some damage to the monster.
|
||||||
|
- Reduced knockback cooldown for submarine impacts (previously there was a 30 second cooldown before an impact could throw characters around again, now it's reduced to 5 seconds).
|
||||||
|
- Show an indicator when the campaign is saved.
|
||||||
|
|
||||||
|
Fixes:
|
||||||
|
- Fixed frequent "unknown object header, previous header: CHAT_MESSAGE" networking errors.
|
||||||
|
- Fixed crash when a location changes it's type in the single player campaign.
|
||||||
|
- Fixes/improvements to item position syncing. When trying to pick up an item whose position has gotten desynced, the server should correct the item's position immediately.
|
||||||
|
- Fixed respawns not working in outpost levels.
|
||||||
|
- Fixed missing sonar icon for minerals for the sonar monitor.
|
||||||
|
- Fixed overlap for "Follow Submarine" tickbox and end round button in campaign mode.
|
||||||
|
- Fixed hints staying visible when the HUD is disabled.
|
||||||
|
- Fixed boss health bar showing up briefly when you damage a dead boss monster.
|
||||||
|
- Fixed crashing when a turret that spawns it's own projectiles (e.g. alien turret) is fired.
|
||||||
|
- Fixed crashing when you exit a multiplayer campaign round during the text that pops up at the beginning of a new campaign.
|
||||||
|
- Fixed monsters sometimes spawning very close (or even inside) the respawn shuttle.
|
||||||
|
- Fixed linked sub's file path not being saved in the sub editor.
|
||||||
|
- Fixed ruins sometimes getting placed too close to the start/end outpost.
|
||||||
|
- Fixed characters not getting crushed by pressure in sub test mode.
|
||||||
|
- Fixed crashing when accessing server settings of a server you've lost connection to.
|
||||||
|
|
||||||
|
Modding:
|
||||||
|
- Fixed inability to load more than 5 wires per connection even if the connection is set to allow more.
|
||||||
|
- Added "MaxRadiation" parameter to radiation params.
|
||||||
|
|
||||||
---------------------------------------------------------------------------------------------------------
|
---------------------------------------------------------------------------------------------------------
|
||||||
v0.1300.0.4 (unstable)
|
v0.1300.0.4 (unstable)
|
||||||
---------------------------------------------------------------------------------------------------------
|
---------------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user