Progress on tutorial, gap tweaking (water flows faster from room to room), UPnP error messages, input keys in array, underwater aiming tweaking, tons of misc stuff commit more often ffs
This commit is contained in:
@@ -32,9 +32,9 @@ namespace Subsurface.Particles
|
||||
|
||||
private float checkCollisionTimer;
|
||||
|
||||
public bool InWater
|
||||
public ParticlePrefab.DrawTargetType DrawTarget
|
||||
{
|
||||
get { return prefab.inWater; }
|
||||
get { return prefab.DrawTarget; }
|
||||
}
|
||||
|
||||
public Vector2 yLimits
|
||||
|
||||
@@ -95,14 +95,15 @@ namespace Subsurface.Particles
|
||||
|
||||
public void Draw(SpriteBatch spriteBatch, bool inWater)
|
||||
{
|
||||
ParticlePrefab.DrawTargetType drawTarget = inWater ? ParticlePrefab.DrawTargetType.Water : ParticlePrefab.DrawTargetType.Air;
|
||||
|
||||
for (int i = 0; i < particleCount; i++)
|
||||
{
|
||||
if (particles[i].InWater != inWater) continue;
|
||||
if (!particles[i].DrawTarget.HasFlag(drawTarget)) continue;
|
||||
|
||||
particles[i].Draw(spriteBatch);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,8 @@ namespace Subsurface.Particles
|
||||
{
|
||||
class ParticlePrefab
|
||||
{
|
||||
public enum DrawTargetType { Air = 1, Water = 2, Both = 3 }
|
||||
|
||||
public readonly string name;
|
||||
|
||||
public readonly Sprite sprite;
|
||||
@@ -27,7 +29,7 @@ namespace Subsurface.Particles
|
||||
|
||||
public readonly Vector2 velocityChange;
|
||||
|
||||
public readonly bool inWater;
|
||||
public readonly DrawTargetType DrawTarget;
|
||||
|
||||
public readonly bool rotateToDirection;
|
||||
|
||||
@@ -67,8 +69,20 @@ namespace Subsurface.Particles
|
||||
|
||||
rotateToDirection = ToolBox.GetAttributeBool(element, "rotatetodirection", false);
|
||||
|
||||
inWater = ToolBox.GetAttributeBool(element, "inwater", false);
|
||||
|
||||
switch (ToolBox.GetAttributeString(element, "drawtarget", "air").ToLower())
|
||||
{
|
||||
case "air":
|
||||
default:
|
||||
DrawTarget = DrawTargetType.Air;
|
||||
break;
|
||||
case "water":
|
||||
DrawTarget = DrawTargetType.Water;
|
||||
break;
|
||||
case "both":
|
||||
DrawTarget = DrawTargetType.Both;
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user