Unstable v0.10.601.0
This commit is contained in:
@@ -321,6 +321,17 @@ namespace Barotrauma
|
||||
{
|
||||
character.SelectedConstruction.DrawHUD(spriteBatch, cam, Character.Controlled);
|
||||
}
|
||||
if (Character.Controlled.Inventory != null)
|
||||
{
|
||||
foreach (Item item in Character.Controlled.Inventory.Items)
|
||||
{
|
||||
if (item == null) { continue; }
|
||||
if (Character.Controlled.HasEquippedItem(item))
|
||||
{
|
||||
item.DrawHUD(spriteBatch, cam, Character.Controlled);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (IsCampaignInterfaceOpen) { return; }
|
||||
|
||||
@@ -431,6 +442,14 @@ namespace Barotrauma
|
||||
GUI.DrawString(spriteBatch, textPos, focusName, nameColor, Color.Black * 0.7f, 2, GUI.SubHeadingFont);
|
||||
textPos.X += 10.0f * GUI.Scale;
|
||||
textPos.Y += GUI.SubHeadingFont.MeasureString(focusName).Y;
|
||||
|
||||
if (!character.FocusedCharacter.IsIncapacitated && character.FocusedCharacter.IsPet)
|
||||
{
|
||||
GUI.DrawString(spriteBatch, textPos, GetCachedHudText("PlayHint", GameMain.Config.KeyBindText(InputType.Use)),
|
||||
GUI.Style.Green, Color.Black, 2, GUI.SmallFont);
|
||||
textPos.Y += largeTextSize.Y;
|
||||
}
|
||||
|
||||
if (character.FocusedCharacter.CanBeDragged)
|
||||
{
|
||||
GUI.DrawString(spriteBatch, textPos, GetCachedHudText("GrabHint", GameMain.Config.KeyBindText(InputType.Grab)),
|
||||
|
||||
@@ -278,17 +278,7 @@ namespace Barotrauma
|
||||
DamagedSprite = new Sprite(subElement, file: GetSpritePath(subElement, Params.damagedSpriteParams));
|
||||
break;
|
||||
case "conditionalsprite":
|
||||
ISerializableEntity targetEntity;
|
||||
string target = subElement.GetAttributeString("target", null);
|
||||
if (string.Equals(target, "character", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
targetEntity = character;
|
||||
}
|
||||
else
|
||||
{
|
||||
targetEntity = this;
|
||||
}
|
||||
var conditionalSprite = new ConditionalSprite(subElement, targetEntity, file: GetSpritePath(subElement, null));
|
||||
var conditionalSprite = new ConditionalSprite(subElement, GetConditionalTarget(), file: GetSpritePath(subElement, null));
|
||||
ConditionalSprites.Add(conditionalSprite);
|
||||
if (conditionalSprite.DeformableSprite != null)
|
||||
{
|
||||
@@ -300,7 +290,7 @@ namespace Barotrauma
|
||||
CreateDeformations(subElement);
|
||||
break;
|
||||
case "lightsource":
|
||||
LightSource = new LightSource(subElement)
|
||||
LightSource = new LightSource(subElement, GetConditionalTarget())
|
||||
{
|
||||
ParentBody = body,
|
||||
SpriteScale = Vector2.One * Scale * TextureScale
|
||||
@@ -310,6 +300,21 @@ namespace Barotrauma
|
||||
break;
|
||||
}
|
||||
|
||||
ISerializableEntity GetConditionalTarget()
|
||||
{
|
||||
ISerializableEntity targetEntity;
|
||||
string target = subElement.GetAttributeString("target", null);
|
||||
if (string.Equals(target, "character", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
targetEntity = character;
|
||||
}
|
||||
else
|
||||
{
|
||||
targetEntity = this;
|
||||
}
|
||||
return targetEntity;
|
||||
}
|
||||
|
||||
void CreateDeformations(XElement e)
|
||||
{
|
||||
foreach (XElement animationElement in e.GetChildElements("spritedeformation"))
|
||||
@@ -341,6 +346,7 @@ namespace Barotrauma
|
||||
}
|
||||
}
|
||||
}
|
||||
LightSource?.CheckConditionals();
|
||||
}
|
||||
|
||||
public void RecreateSprites()
|
||||
@@ -561,6 +567,11 @@ namespace Barotrauma
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var conditionalSprite in ConditionalSprites)
|
||||
{
|
||||
conditionalSprite.CheckConditionals();
|
||||
}
|
||||
|
||||
if (LightSource != null)
|
||||
{
|
||||
LightSource.ParentSub = body.Submarine;
|
||||
@@ -573,6 +584,7 @@ namespace Barotrauma
|
||||
{
|
||||
LightSource.DeformableLightSprite.Sprite.Depth = ActiveSprite.Depth;
|
||||
}
|
||||
LightSource.CheckConditionals();
|
||||
}
|
||||
|
||||
UpdateSpriteStates(deltaTime);
|
||||
|
||||
Reference in New Issue
Block a user