- head sprites can be given "tags", and body is chosen from sprites with the same tag
- black character sprites
This commit is contained in:
@@ -374,6 +374,21 @@
|
|||||||
<Content Include="Content\Characters\Fractalguardian\fractalguardian.png">
|
<Content Include="Content\Characters\Fractalguardian\fractalguardian.png">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
|
<Content Include="Content\Characters\Human\fhead7[black].png">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Include="Content\Characters\Human\ftorso[black].png">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Include="Content\Characters\Human\head7[black].png">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Include="Content\Characters\Human\head8[black].png">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Include="Content\Characters\Human\torso[black].png">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
<Content Include="Content\Characters\Husk\DivingSuit.png">
|
<Content Include="Content\Characters\Husk\DivingSuit.png">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 2.1 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 6.4 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 2.0 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.9 KiB |
@@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" ?>
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
<Character name ="human" humanoid="true" needsair="true" genders="true" maleheadid="1,6" femaleheadid="1,6" drowningtime="30">
|
<Character name ="human" humanoid="true" needsair="true" genders="true" maleheadid="1,8" femaleheadid="1,7" drowningtime="30">
|
||||||
|
|
||||||
<name firstname="Content/Characters/Human/[GENDER]firstnames.txt" lastname="Content/Characters/Human/lastnames.txt" />
|
<name firstname="Content/Characters/Human/[GENDER]firstnames.txt" lastname="Content/Characters/Human/lastnames.txt" />
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 6.7 KiB |
@@ -179,7 +179,7 @@ namespace Barotrauma
|
|||||||
new Vector2(GameMain.GraphicsWidth / damageOverlay.size.X, GameMain.GraphicsHeight / damageOverlay.size.Y));
|
new Vector2(GameMain.GraphicsWidth / damageOverlay.size.X, GameMain.GraphicsHeight / damageOverlay.size.Y));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (character.IsUnconscious)
|
if (character.IsUnconscious && !character.IsDead)
|
||||||
{
|
{
|
||||||
if (suicideButton == null)
|
if (suicideButton == null)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,6 +2,8 @@
|
|||||||
using Microsoft.Xna.Framework.Graphics;
|
using Microsoft.Xna.Framework.Graphics;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
using System.Xml.Linq;
|
using System.Xml.Linq;
|
||||||
|
|
||||||
namespace Barotrauma
|
namespace Barotrauma
|
||||||
@@ -45,6 +47,12 @@ namespace Barotrauma
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<string> SpriteTags
|
||||||
|
{
|
||||||
|
get;
|
||||||
|
private set;
|
||||||
|
}
|
||||||
|
|
||||||
public int HeadSpriteId
|
public int HeadSpriteId
|
||||||
{
|
{
|
||||||
get { return headSpriteId; }
|
get { return headSpriteId; }
|
||||||
@@ -92,6 +100,8 @@ namespace Barotrauma
|
|||||||
|
|
||||||
pickedItems = new List<ushort>();
|
pickedItems = new List<ushort>();
|
||||||
|
|
||||||
|
SpriteTags = new List<string>();
|
||||||
|
|
||||||
//ID = -1;
|
//ID = -1;
|
||||||
|
|
||||||
XDocument doc = ToolBox.TryLoadXml(file);
|
XDocument doc = ToolBox.TryLoadXml(file);
|
||||||
@@ -172,7 +182,29 @@ namespace Barotrauma
|
|||||||
spritePath = spritePath.Replace("[GENDER]", (this.gender == Gender.Female) ? "f" : "");
|
spritePath = spritePath.Replace("[GENDER]", (this.gender == Gender.Female) ? "f" : "");
|
||||||
spritePath = spritePath.Replace("[HEADID]", HeadSpriteId.ToString());
|
spritePath = spritePath.Replace("[HEADID]", HeadSpriteId.ToString());
|
||||||
|
|
||||||
headSprite = new Sprite(spriteElement, "", spritePath);
|
string fileName = Path.GetFileNameWithoutExtension(spritePath);
|
||||||
|
|
||||||
|
//go through the files in the directory to find a matching sprite
|
||||||
|
var files = Directory.GetFiles(Path.GetDirectoryName(spritePath)).ToList();
|
||||||
|
foreach (string file in files)
|
||||||
|
{
|
||||||
|
string fileWithoutTags = Path.GetFileNameWithoutExtension(file);
|
||||||
|
fileWithoutTags = fileWithoutTags.Split('[', ']').First();
|
||||||
|
|
||||||
|
if (fileWithoutTags != fileName) continue;
|
||||||
|
|
||||||
|
headSprite = new Sprite(spriteElement, "", file);
|
||||||
|
|
||||||
|
//extract the tags out of the filename
|
||||||
|
SpriteTags = file.Split('[', ']').Skip(1).ToList();
|
||||||
|
if (SpriteTags.Any())
|
||||||
|
{
|
||||||
|
SpriteTags.RemoveAt(SpriteTags.Count-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ using Microsoft.Xna.Framework.Graphics;
|
|||||||
using Barotrauma.Items.Components;
|
using Barotrauma.Items.Components;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Barotrauma.Lights;
|
using Barotrauma.Lights;
|
||||||
|
using System.Linq;
|
||||||
|
using System.IO;
|
||||||
|
|
||||||
namespace Barotrauma
|
namespace Barotrauma
|
||||||
{
|
{
|
||||||
@@ -273,14 +275,34 @@ namespace Barotrauma
|
|||||||
case "sprite":
|
case "sprite":
|
||||||
string spritePath = subElement.Attribute("texture").Value;
|
string spritePath = subElement.Attribute("texture").Value;
|
||||||
|
|
||||||
if (character.Info!=null)
|
string spritePathWithTags = spritePath;
|
||||||
|
|
||||||
|
if (character.Info != null)
|
||||||
{
|
{
|
||||||
spritePath = spritePath.Replace("[GENDER]", (character.Info.Gender == Gender.Female) ? "f" : "");
|
spritePath = spritePath.Replace("[GENDER]", (character.Info.Gender == Gender.Female) ? "f" : "");
|
||||||
spritePath = spritePath.Replace("[HEADID]", character.Info.HeadSpriteId.ToString());
|
spritePath = spritePath.Replace("[HEADID]", character.Info.HeadSpriteId.ToString());
|
||||||
|
|
||||||
|
if (character.Info.HeadSprite != null && character.Info.SpriteTags.Any())
|
||||||
|
{
|
||||||
|
string tags = "";
|
||||||
|
character.Info.SpriteTags.ForEach(tag => tags += "[" + tag + "]");
|
||||||
|
|
||||||
|
spritePathWithTags = Path.Combine(
|
||||||
|
Path.GetDirectoryName(spritePath),
|
||||||
|
Path.GetFileNameWithoutExtension(spritePath) + tags + Path.GetExtension(spritePath));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (File.Exists(spritePathWithTags))
|
||||||
|
{
|
||||||
|
sprite = new Sprite(subElement, "", spritePathWithTags);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
|
||||||
|
sprite = new Sprite(subElement, "", spritePath);
|
||||||
|
}
|
||||||
|
|
||||||
sprite = new Sprite(subElement, "", spritePath);
|
|
||||||
break;
|
break;
|
||||||
case "damagedsprite":
|
case "damagedsprite":
|
||||||
string damagedSpritePath = subElement.Attribute("texture").Value;
|
string damagedSpritePath = subElement.Attribute("texture").Value;
|
||||||
|
|||||||
Reference in New Issue
Block a user