Hotfix 1.1.18.1

This commit is contained in:
Markus Isberg
2023-10-20 18:05:28 +03:00
parent df7e8f1625
commit 6cc82976a1
19 changed files with 164 additions and 58 deletions
@@ -1,22 +1,19 @@
#nullable enable
using Microsoft.Xna.Framework;
using System.Collections.Generic;
using System.Linq;
namespace Barotrauma;
partial class TutorialHighlightAction : EventAction
partial class HighlightAction : EventAction
{
private static readonly Color highlightColor = Color.Orange;
partial void UpdateProjSpecific()
partial void SetHighlightProjSpecific(Entity entity, IEnumerable<Character>? targetCharacters)
{
if (GameMain.GameSession?.GameMode is not TutorialMode) { return; }
foreach (var target in ParentEvent.GetTargets(TargetTag))
if (targetCharacters != null && !targetCharacters.Contains(Character.Controlled))
{
SetHighlight(target);
return;
}
}
private void SetHighlight(Entity entity)
{
if (entity is Item i)
{
SetItemHighlight(i);
@@ -1540,6 +1540,23 @@ namespace Barotrauma
RemoveFromDroppedStack(allowClientExecute: true);
}
break;
case EventType.SetHighlight:
bool isTargetedForThisClient = msg.ReadBoolean();
if (isTargetedForThisClient)
{
bool highlight = msg.ReadBoolean();
ExternalHighlight = highlight;
if (highlight)
{
Color highlightColor = msg.ReadColorR8G8B8A8();
HighlightColor = highlightColor;
}
else
{
HighlightColor = null;
}
}
break;
default:
throw new Exception($"Malformed incoming item event: unsupported event type {eventType}");
}
@@ -583,7 +583,9 @@ namespace Barotrauma
if (saveFiles == null)
{
saveFiles = SaveUtil.GetSaveFiles(SaveUtil.SaveType.Singleplayer);
//we don't need to log errors at this point,
//if any file fails to load the error will get logged when we try to extract the root from the game session doc later in the method
saveFiles = SaveUtil.GetSaveFiles(SaveUtil.SaveType.Singleplayer, logLoadErrors: false);
}
var leftColumn = new GUILayoutGroup(new RectTransform(new Vector2(0.5f, 1.0f), loadGameContainer.RectTransform), childAnchor: Anchor.TopCenter)