(dbaa7326b) Use the SpriteColor of the item when drawing the moving parts of turrets and doors, made InventoryIconColor and ContainerColor saveable. Closes #1326
This commit is contained in:
@@ -93,7 +93,7 @@ namespace Barotrauma.Items.Components
|
|||||||
|
|
||||||
public void Draw(SpriteBatch spriteBatch, bool editing)
|
public void Draw(SpriteBatch spriteBatch, bool editing)
|
||||||
{
|
{
|
||||||
Color color = Color.White;
|
Color color = item.SpriteColor;
|
||||||
if (brokenSprite == null)
|
if (brokenSprite == null)
|
||||||
{
|
{
|
||||||
//broken doors turn black if no broken sprite has been configured
|
//broken doors turn black if no broken sprite has been configured
|
||||||
@@ -108,7 +108,7 @@ namespace Barotrauma.Items.Components
|
|||||||
weldSpritePos.Y = -weldSpritePos.Y;
|
weldSpritePos.Y = -weldSpritePos.Y;
|
||||||
|
|
||||||
weldedSprite.Draw(spriteBatch,
|
weldedSprite.Draw(spriteBatch,
|
||||||
weldSpritePos, Color.White * (stuck / 100.0f), scale: item.Scale);
|
weldSpritePos, item.SpriteColor * (stuck / 100.0f), scale: item.Scale);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (openState == 1.0f)
|
if (openState == 1.0f)
|
||||||
|
|||||||
@@ -237,13 +237,13 @@ namespace Barotrauma.Items.Components
|
|||||||
|
|
||||||
railSprite?.Draw(spriteBatch,
|
railSprite?.Draw(spriteBatch,
|
||||||
drawPos,
|
drawPos,
|
||||||
Color.White,
|
item.SpriteColor,
|
||||||
rotation + MathHelper.PiOver2, item.Scale,
|
rotation + MathHelper.PiOver2, item.Scale,
|
||||||
SpriteEffects.None, item.SpriteDepth + (railSprite.Depth - item.Sprite.Depth));
|
SpriteEffects.None, item.SpriteDepth + (railSprite.Depth - item.Sprite.Depth));
|
||||||
|
|
||||||
barrelSprite?.Draw(spriteBatch,
|
barrelSprite?.Draw(spriteBatch,
|
||||||
drawPos - new Vector2((float)Math.Cos(rotation), (float)Math.Sin(rotation)) * recoilOffset * item.Scale,
|
drawPos - new Vector2((float)Math.Cos(rotation), (float)Math.Sin(rotation)) * recoilOffset * item.Scale,
|
||||||
Color.White,
|
item.SpriteColor,
|
||||||
rotation + MathHelper.PiOver2, item.Scale,
|
rotation + MathHelper.PiOver2, item.Scale,
|
||||||
SpriteEffects.None, item.SpriteDepth + (barrelSprite.Depth - item.Sprite.Depth));
|
SpriteEffects.None, item.SpriteDepth + (barrelSprite.Depth - item.Sprite.Depth));
|
||||||
|
|
||||||
|
|||||||
@@ -211,14 +211,14 @@ namespace Barotrauma
|
|||||||
set { spriteColor = value; }
|
set { spriteColor = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
[Serialize("1.0,1.0,1.0,1.0", false), Editable]
|
[Serialize("1.0,1.0,1.0,1.0", true), Editable]
|
||||||
public Color InventoryIconColor
|
public Color InventoryIconColor
|
||||||
{
|
{
|
||||||
get;
|
get;
|
||||||
protected set;
|
protected set;
|
||||||
}
|
}
|
||||||
|
|
||||||
[Serialize("1.0,1.0,1.0,1.0", false), Editable(ToolTip = "Changes the color of the item this item is contained inside. Only has an effect if either of the UseContainedSpriteColor or UseContainedInventoryIconColor property of the container is set to true.")]
|
[Serialize("1.0,1.0,1.0,1.0", true), Editable(ToolTip = "Changes the color of the item this item is contained inside. Only has an effect if either of the UseContainedSpriteColor or UseContainedInventoryIconColor property of the container is set to true.")]
|
||||||
public Color ContainerColor
|
public Color ContainerColor
|
||||||
{
|
{
|
||||||
get;
|
get;
|
||||||
|
|||||||
Reference in New Issue
Block a user