Supercapacitors have much higher max output but smaller capacity, fixed not being able to drag wire nodes in editor, batteries working properly now

This commit is contained in:
Regalis
2016-02-07 12:32:19 +02:00
parent ec7bd3523c
commit 201dc1b733
27 changed files with 93 additions and 60 deletions

View File

@@ -101,7 +101,11 @@ namespace Barotrauma
public float Oxygen
{
get { return oxygen; }
set { oxygen = MathHelper.Clamp(value, 0.0f, FullVolume); }
set
{
if (!MathUtils.IsValid(value)) return;
oxygen = MathHelper.Clamp(value, 0.0f, FullVolume);
}
}
public float OxygenPercentage
@@ -283,12 +287,12 @@ namespace Barotrauma
Vector2 position = cam.ScreenToWorld(PlayerInput.MousePosition);
if (Submarine.RectContains(WorldRect, position))
{
if (PlayerInput.LeftButtonDown())
if (PlayerInput.LeftButtonHeld())
{
//waveY[GetWaveIndex(position.X - rect.X - Submarine.Position.X) / WaveWidth] = 100.0f;
Volume = Volume + 1500.0f;
}
else if (PlayerInput.RightButtonDown())
else if (PlayerInput.RightButtonHeld())
{
Volume = Volume - 1500.0f;
}

View File

@@ -353,7 +353,7 @@ namespace Barotrauma
else
{
if (PlayerInput.LeftButtonDown() &&
if (PlayerInput.LeftButtonHeld() &&
PlayerInput.KeyUp(Keys.Space))
{
//if clicking a selected entity, start moving it

View File

@@ -134,7 +134,7 @@ namespace Barotrauma
GUI.DrawLine(spriteBatch, new Vector2(position.X, -(position.Y - GameMain.GraphicsHeight)), new Vector2(position.X, -(position.Y + GameMain.GraphicsHeight)), Color.White);
if (PlayerInput.LeftButtonDown()) placePosition = position;
if (PlayerInput.LeftButtonHeld()) placePosition = position;
}
else
{
@@ -164,7 +164,7 @@ namespace Barotrauma
GUI.DrawRectangle(spriteBatch, newRect, Color.DarkBlue);
}
if (PlayerInput.RightButtonDown())
if (PlayerInput.RightButtonHeld())
{
placePosition = Vector2.Zero;
selected = null;

View File

@@ -124,7 +124,7 @@ namespace Barotrauma
if (placePosition == Vector2.Zero)
{
if (PlayerInput.LeftButtonDown())
if (PlayerInput.LeftButtonHeld())
placePosition = Submarine.MouseToWorldGrid(cam);
newRect.X = (int)position.X;
@@ -161,7 +161,7 @@ namespace Barotrauma
GUI.DrawRectangle(spriteBatch, new Rectangle(newRect.X - GameMain.GraphicsWidth, -newRect.Y, newRect.Width + GameMain.GraphicsWidth*2, newRect.Height), Color.White);
GUI.DrawRectangle(spriteBatch, new Rectangle(newRect.X, -newRect.Y - GameMain.GraphicsHeight, newRect.Width, newRect.Height + GameMain.GraphicsHeight*2), Color.White);
if (PlayerInput.RightButtonDown()) selected = null;
if (PlayerInput.RightButtonHeld()) selected = null;
}
}
}