Some more cleanup + event desync debug messages

This commit is contained in:
juanjp600
2017-06-25 22:09:41 -03:00
parent b7a0bff294
commit 330b24bcf6
17 changed files with 477 additions and 358 deletions
+30 -1
View File
@@ -15,7 +15,11 @@ namespace Barotrauma
{
partial class Limb
{
public readonly LightSource LightSource;
public LightSource LightSource
{
get;
private set;
}
Sound hitSound;
@@ -24,6 +28,31 @@ namespace Barotrauma
get { return hitSound; }
}
partial void InitProjSpecific(XElement element)
{
foreach (XElement subElement in element.Elements())
{
switch (subElement.Name.ToString().ToLowerInvariant())
{
case "lightsource":
LightSource = new LightSource(subElement);
break;
case "sound":
hitSound = Sound.Load(ToolBox.GetAttributeString(subElement, "file", ""));
break;
}
}
}
partial void UpdateProjSpecific()
{
if (LightSource != null)
{
LightSource.Rotation = dir == Direction.Right ? body.DrawRotation : body.DrawRotation - MathHelper.Pi;
LightSource.ParentSub = body.Submarine;
}
}
public void Draw(SpriteBatch spriteBatch)
{
float brightness = 1.0f - (burnt / 100.0f) * 0.5f;