v0.14.6.0
This commit is contained in:
@@ -9,7 +9,7 @@ namespace Barotrauma
|
||||
{
|
||||
public override void DebugDraw(SpriteBatch spriteBatch)
|
||||
{
|
||||
if (Character.IsDead) return;
|
||||
if (Character.IsUnconscious || !Character.Enabled || !Enabled) { return; }
|
||||
|
||||
Vector2 pos = Character.WorldPosition;
|
||||
pos.Y = -pos.Y;
|
||||
@@ -38,7 +38,7 @@ namespace Barotrauma
|
||||
}
|
||||
targetPos.Y = -targetPos.Y;
|
||||
GUI.DrawLine(spriteBatch, pos, targetPos, GUI.Style.Red * 0.5f, 0, 4);
|
||||
if (wallTarget != null && (State == AIState.Attack || State == AIState.Aggressive || State == AIState.PassiveAggressive))
|
||||
if (wallTarget != null)
|
||||
{
|
||||
Vector2 wallTargetPos = wallTarget.Position;
|
||||
if (wallTarget.Structure.Submarine != null) { wallTargetPos += wallTarget.Structure.Submarine.Position; }
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
namespace Barotrauma
|
||||
{
|
||||
abstract partial class AIObjective
|
||||
{
|
||||
public static Sprite GetSprite(string identifier, string option, Entity targetEntity)
|
||||
{
|
||||
if (string.IsNullOrEmpty(identifier))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
identifier = identifier.RemoveWhitespace();
|
||||
if (Order.Prefabs.TryGetValue(identifier, out Order orderPrefab))
|
||||
{
|
||||
if (!string.IsNullOrEmpty(option) && orderPrefab.OptionSprites.TryGetValue(option, out var optionSprite))
|
||||
{
|
||||
return optionSprite;
|
||||
}
|
||||
if (targetEntity is Item targetItem && targetItem.Prefab.MinimapIcon != null)
|
||||
{
|
||||
return targetItem.Prefab.MinimapIcon;
|
||||
}
|
||||
return orderPrefab.SymbolSprite;
|
||||
}
|
||||
return GUI.Style.GetComponentStyle($"{identifier}objectiveicon")?.GetDefaultSprite();
|
||||
}
|
||||
|
||||
public Sprite GetSprite()
|
||||
{
|
||||
return GetSprite(Identifier, Option, (this as AIObjectiveOperateItem)?.OperateTarget);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user