Hotfix 1.1.18.1 (real this time)

This commit is contained in:
Markus Isberg
2023-10-20 18:17:33 +03:00
parent 6cc82976a1
commit 2ea58c58a7
10 changed files with 49 additions and 140 deletions
@@ -0,0 +1,51 @@
using Microsoft.Xna.Framework;
namespace Barotrauma;
partial class TutorialHighlightAction : EventAction
{
private static readonly Color highlightColor = Color.Orange;
partial void UpdateProjSpecific()
{
if (GameMain.GameSession?.GameMode is not TutorialMode) { return; }
foreach (var target in ParentEvent.GetTargets(TargetTag))
{
SetHighlight(target);
}
}
private void SetHighlight(Entity entity)
{
if (entity is Item i)
{
SetItemHighlight(i);
}
else if (entity is Structure s)
{
SetStructureHighlight(s);
}
else if (entity is Character c)
{
SetCharacterHighlight(c);
}
}
private void SetItemHighlight(Item item)
{
if (item.ExternalHighlight == State) { return; }
item.HighlightColor = State ? highlightColor : null;
item.ExternalHighlight = State;
}
private void SetStructureHighlight(Structure structure)
{
structure.SpriteColor = State ? highlightColor : Color.White;
structure.ExternalHighlight = State;
}
private void SetCharacterHighlight(Character character)
{
character.ExternalHighlight = State;
}
}