diff --git a/Subsurface/Content/Items/Electricity/lights.xml b/Subsurface/Content/Items/Electricity/lights.xml
index 2bf2cc9eb..ecbcfe351 100644
--- a/Subsurface/Content/Items/Electricity/lights.xml
+++ b/Subsurface/Content/Items/Electricity/lights.xml
@@ -8,9 +8,9 @@
Tags="smallitem"
pickdistance="150">
-
+
-
+
diff --git a/Subsurface/Content/Items/Electricity/poweritems.xml b/Subsurface/Content/Items/Electricity/poweritems.xml
index 658ea4a5f..34cce621c 100644
--- a/Subsurface/Content/Items/Electricity/poweritems.xml
+++ b/Subsurface/Content/Items/Electricity/poweritems.xml
@@ -54,8 +54,8 @@
-
-
+
+
@@ -68,11 +68,11 @@
category="Electrical"
linkable="true"
pickdistance="150"
- description="Can accept and deliver charge much faster than batteries.">
+ description="Can take in and deliver power much faster than batteries.">
-
+
@@ -81,7 +81,8 @@
-
+
+
\ No newline at end of file
diff --git a/Subsurface/Content/Items/Weapons/railgun.xml b/Subsurface/Content/Items/Weapons/railgun.xml
index 0053db091..7adf39b6f 100644
--- a/Subsurface/Content/Items/Weapons/railgun.xml
+++ b/Subsurface/Content/Items/Weapons/railgun.xml
@@ -11,7 +11,7 @@
+ powerconsumption="20000.0">
diff --git a/Subsurface/Source/GUI/GUI.cs b/Subsurface/Source/GUI/GUI.cs
index a227e2f9f..0d4d8b8b4 100644
--- a/Subsurface/Source/GUI/GUI.cs
+++ b/Subsurface/Source/GUI/GUI.cs
@@ -300,7 +300,7 @@ namespace Barotrauma
if (rect.Contains(PlayerInput.MousePosition))
{
- clicked = PlayerInput.LeftButtonDown();
+ clicked = PlayerInput.LeftButtonHeld();
color = clicked ? new Color(100, 100, 100) : new Color(250, 250, 250);
diff --git a/Subsurface/Source/GUI/GUIButton.cs b/Subsurface/Source/GUI/GUIButton.cs
index 468aa6f91..971f299c9 100644
--- a/Subsurface/Source/GUI/GUIButton.cs
+++ b/Subsurface/Source/GUI/GUIButton.cs
@@ -152,7 +152,7 @@ namespace Barotrauma
if (rect.Contains(PlayerInput.MousePosition) && CanBeSelected && Enabled && (MouseOn == null || MouseOn == this || IsParentOf(MouseOn)))
{
state = ComponentState.Hover;
- if (PlayerInput.LeftButtonDown())
+ if (PlayerInput.LeftButtonHeld())
{
if (OnPressed != null)
{
diff --git a/Subsurface/Source/GUI/GUIScrollBar.cs b/Subsurface/Source/GUI/GUIScrollBar.cs
index 57255549c..df635b1ca 100644
--- a/Subsurface/Source/GUI/GUIScrollBar.cs
+++ b/Subsurface/Source/GUI/GUIScrollBar.cs
@@ -129,7 +129,7 @@ namespace Barotrauma
base.Update(deltaTime);
if (draggingBar != this) return;
- if (!PlayerInput.LeftButtonDown()) draggingBar = null;
+ if (!PlayerInput.LeftButtonHeld()) draggingBar = null;
MoveButton();
}
diff --git a/Subsurface/Source/GUI/GUITickBox.cs b/Subsurface/Source/GUI/GUITickBox.cs
index a4b0456b5..65117c9a6 100644
--- a/Subsurface/Source/GUI/GUITickBox.cs
+++ b/Subsurface/Source/GUI/GUITickBox.cs
@@ -70,7 +70,7 @@ namespace Barotrauma
box.State = ComponentState.Hover;
- if (PlayerInput.LeftButtonDown())
+ if (PlayerInput.LeftButtonHeld())
{
box.State = ComponentState.Selected;
}
diff --git a/Subsurface/Source/GameSession/GameModes/Tutorials/BasicTutorial.cs b/Subsurface/Source/GameSession/GameModes/Tutorials/BasicTutorial.cs
index b130274a4..3ef2a8432 100644
--- a/Subsurface/Source/GameSession/GameModes/Tutorials/BasicTutorial.cs
+++ b/Subsurface/Source/GameSession/GameModes/Tutorials/BasicTutorial.cs
@@ -63,6 +63,20 @@ namespace Barotrauma.Tutorials
yield return CoroutineStatus.Running;
}
+ infoBox = CreateInfoFrame("The reactor requires fuel rods to generate power. You can grab one from the steel cabinet by walking next to it and pressing E.");
+
+ while (Character.Controlled.SelectedConstruction == null || Character.Controlled.SelectedConstruction.Name != "Steel Cabinet")
+ {
+ yield return CoroutineStatus.Running;
+ }
+
+ infoBox = CreateInfoFrame("Pick up one of the fuel rods either by double-clicking or dragging and dropping it into your inventory.");
+
+ while (!HasItem("Fuel Rod"))
+ {
+ yield return CoroutineStatus.Running;
+ }
+
infoBox = CreateInfoFrame("Select the reactor by walking next to it and pressing E.");
while (Character.Controlled.SelectedConstruction != reactor.Item)
@@ -71,7 +85,14 @@ namespace Barotrauma.Tutorials
}
yield return new WaitForSeconds(0.5f);
- infoBox = CreateInfoFrame("This is the control panel of the reactor. Try turning it on by increasing the fission rate.");
+ infoBox = CreateInfoFrame("Load the fuel rod into the reactor by dropping it into any of the 5 slots.");
+
+ while (reactor.AvailableFuel <= 0.0f)
+ {
+ yield return CoroutineStatus.Running;
+ }
+
+ infoBox = CreateInfoFrame("The reactor is now fueled up. Try turning it on by increasing the fission rate.");
while (reactor.FissionRate <= 0.0f)
{
diff --git a/Subsurface/Source/Items/CharacterInventory.cs b/Subsurface/Source/Items/CharacterInventory.cs
index e248da4e5..f1a64b3cd 100644
--- a/Subsurface/Source/Items/CharacterInventory.cs
+++ b/Subsurface/Source/Items/CharacterInventory.cs
@@ -326,7 +326,7 @@ namespace Barotrauma
if (draggingItem != null && !draggingItemSlot.Contains(PlayerInput.MousePosition))
{
- if (PlayerInput.LeftButtonDown())
+ if (PlayerInput.LeftButtonHeld())
{
slotRect.X = (int)PlayerInput.MousePosition.X - slotRect.Width / 2;
slotRect.Y = (int)PlayerInput.MousePosition.Y - slotRect.Height / 2;
diff --git a/Subsurface/Source/Items/Components/Machines/Reactor.cs b/Subsurface/Source/Items/Components/Machines/Reactor.cs
index 638dd963a..811bfd925 100644
--- a/Subsurface/Source/Items/Components/Machines/Reactor.cs
+++ b/Subsurface/Source/Items/Components/Machines/Reactor.cs
@@ -442,9 +442,9 @@ namespace Barotrauma.Items.Components
//GUI.DrawRectangle(spriteBatch, new Rectangle(x, y, width, height), Color.Black, true);
- spriteBatch.DrawString(GUI.Font, "Temperature: " + (int)temperature + " C",
+ spriteBatch.DrawString(GUI.Font, "Output: " + (int)temperature + " kW",
new Vector2(x + 450, y + 30), Color.Red);
- spriteBatch.DrawString(GUI.Font, "Grid load: " + (int)load + " C",
+ spriteBatch.DrawString(GUI.Font, "Grid load: " + (int)load + " kW",
new Vector2(x + 620, y + 30), Color.Yellow);
DrawGraph(tempGraph, spriteBatch,
diff --git a/Subsurface/Source/Items/Components/Machines/Steering.cs b/Subsurface/Source/Items/Components/Machines/Steering.cs
index d989ab449..3f67f543d 100644
--- a/Subsurface/Source/Items/Components/Machines/Steering.cs
+++ b/Subsurface/Source/Items/Components/Machines/Steering.cs
@@ -183,7 +183,7 @@ namespace Barotrauma.Items.Components
{
GUI.DrawRectangle(spriteBatch, new Rectangle((int)targetVelPos.X -10, (int)targetVelPos.Y - 10, 20, 20), Color.Red);
- if (PlayerInput.LeftButtonDown())
+ if (PlayerInput.LeftButtonHeld())
{
TargetVelocity = PlayerInput.MousePosition - new Vector2(velRect.Center.X, velRect.Center.Y);
targetVelocity.Y = -targetVelocity.Y;
diff --git a/Subsurface/Source/Items/Components/Power/PowerContainer.cs b/Subsurface/Source/Items/Components/Power/PowerContainer.cs
index 7c9d3d0b0..f78ba08c2 100644
--- a/Subsurface/Source/Items/Components/Power/PowerContainer.cs
+++ b/Subsurface/Source/Items/Components/Power/PowerContainer.cs
@@ -42,7 +42,7 @@ namespace Barotrauma.Items.Components
get { return charge; }
set
{
- if (float.IsNaN(value)) return;
+ if (!MathUtils.IsValid(value)) return;
charge = MathHelper.Clamp(value, 0.0f, capacity);
}
}
@@ -60,7 +60,7 @@ namespace Barotrauma.Items.Components
get { return rechargeSpeed; }
set
{
- if (float.IsNaN(value)) return;
+ if (!MathUtils.IsValid(value)) return;
rechargeSpeed = MathHelper.Clamp(value, 0.0f, maxRechargeSpeed);
rechargeSpeed = MathUtils.Round(rechargeSpeed, Math.Max(maxRechargeSpeed * 0.1f, 1.0f));
}
@@ -120,7 +120,7 @@ namespace Barotrauma.Items.Components
foreach (Connection c in item.Connections)
{
- if (c.Name.Contains("recharge")) continue;
+ if (c.Name == "power_in") continue;
foreach (Connection c2 in c.Recipients)
{
PowerTransfer pt = c2.Item.GetComponent();
@@ -194,7 +194,7 @@ namespace Barotrauma.Items.Components
// 0.1f);
//powerConsumption = Math.Min(powerConsumption, 0.0f);
- charge -= CurrPowerOutput / 3600.0f;
+ Charge -= CurrPowerOutput / 3600.0f;
}
rechargeVoltage = 0.0f;
@@ -212,7 +212,7 @@ namespace Barotrauma.Items.Components
{
if (!connection.IsPower) return;
- if (connection.Name.Contains("recharge"))
+ if (connection.Name == "power_in")
{
rechargeVoltage = power;
}
@@ -247,11 +247,10 @@ namespace Barotrauma.Items.Components
//GUI.DrawRectangle(spriteBatch, new Rectangle(x, y, width, height), Color.Black, true);
spriteBatch.DrawString(GUI.Font,
- "Charge: " + (int)charge + "/" + (int)capacity + " (" + (int)((charge / capacity) * 100.0f) + " %)",
+ "Charge: " + (int)charge + "/" + (int)capacity + "kWm (" + (int)((charge / capacity) * 100.0f) + " %)",
new Vector2(x + 30, y + 30), Color.White);
- spriteBatch.DrawString(GUI.Font, "Recharge rate: " + (int)((rechargeSpeed / maxRechargeSpeed)*100.0f)+" %", new Vector2(x + 30, y + 95), Color.White);
-
+ spriteBatch.DrawString(GUI.Font, "Recharge rate: " + (int)((rechargeSpeed / maxRechargeSpeed) * 100.0f) + " %", new Vector2(x + 30, y + 95), Color.White);
}
public override bool FillNetworkData(Networking.NetworkEventType type, Lidgren.Network.NetBuffer message)
diff --git a/Subsurface/Source/Items/Components/Power/PowerTransfer.cs b/Subsurface/Source/Items/Components/Power/PowerTransfer.cs
index d10bc6fc9..b39f610a6 100644
--- a/Subsurface/Source/Items/Components/Power/PowerTransfer.cs
+++ b/Subsurface/Source/Items/Components/Power/PowerTransfer.cs
@@ -132,7 +132,7 @@ namespace Barotrauma.Items.Components
}
else if (powerContainer != null)
{
- if (recipient.Name.Contains("recharge"))
+ if (recipient.Name == "power_in")
{
fullLoad += powerContainer.CurrPowerConsumption;
}
@@ -167,8 +167,8 @@ namespace Barotrauma.Items.Components
GuiFrame.Draw(spriteBatch);
- spriteBatch.DrawString(GUI.Font, "Power: " + (int)(-currPowerConsumption), new Vector2(x + 30, y + 30), Color.White);
- spriteBatch.DrawString(GUI.Font, "Load: " + (int)powerLoad, new Vector2(x + 30, y + 100), Color.White);
+ spriteBatch.DrawString(GUI.Font, "Power: " + (int)(-currPowerConsumption) + " kW", new Vector2(x + 30, y + 30), Color.White);
+ spriteBatch.DrawString(GUI.Font, "Load: " + (int)powerLoad + " kW", new Vector2(x + 30, y + 100), Color.White);
}
public override void ReceiveSignal(string signal, Connection connection, Item sender, float power)
diff --git a/Subsurface/Source/Items/Components/Signal/Connection.cs b/Subsurface/Source/Items/Components/Signal/Connection.cs
index b147278bf..b021e0095 100644
--- a/Subsurface/Source/Items/Components/Signal/Connection.cs
+++ b/Subsurface/Source/Items/Components/Signal/Connection.cs
@@ -249,8 +249,8 @@ namespace Barotrauma.Items.Components
}
else
{
- c.Draw(spriteBatch, panel.Item, leftPos,
- new Vector2(leftPos.X - 100, leftPos.Y),
+ c.Draw(spriteBatch, panel.Item, leftPos,
+ new Vector2(leftPos.X - GUI.SmallFont.MeasureString(c.Name).X - 20, leftPos.Y),
new Vector2(leftWireX, y + height),
mouseInRect, equippedWire != null);
@@ -291,7 +291,7 @@ namespace Barotrauma.Items.Components
if (draggingConnected != null)
{
- if (!PlayerInput.LeftButtonDown())
+ if (!PlayerInput.LeftButtonHeld())
{
panel.Item.NewComponentEvent(panel, true, true);
//draggingConnected.Drop(Character);
@@ -306,7 +306,7 @@ namespace Barotrauma.Items.Components
private void Draw(SpriteBatch spriteBatch, Item item, Vector2 position, Vector2 labelPos, Vector2 wirePosition, bool mouseIn, bool wireEquipped)
{
- spriteBatch.DrawString(GUI.Font, Name, new Vector2(labelPos.X, labelPos.Y-10), Color.White);
+ spriteBatch.DrawString(GUI.SmallFont, Name, new Vector2(labelPos.X, labelPos.Y-10), Color.White);
GUI.DrawRectangle(spriteBatch, new Rectangle((int)position.X-10, (int)position.Y-10, 20, 20), Color.White);
spriteBatch.Draw(panelTexture, position - new Vector2(16.0f, 16.0f), new Rectangle(64, 256, 32, 32), Color.White);
@@ -323,7 +323,7 @@ namespace Barotrauma.Items.Components
//dragging a wire and released the mouse -> see if the wire can be connected to this connection
if (draggingConnected != null
- && !PlayerInput.LeftButtonDown())
+ && !PlayerInput.LeftButtonHeld())
{
//close enough to the connector -> make a new connection
if (Vector2.Distance(position, PlayerInput.MousePosition) < 10.0f)
@@ -404,7 +404,7 @@ namespace Barotrauma.Items.Components
float dir = (end.X > start.X) ? -1.0f : 1.0f;
wireCorner.Draw(spriteBatch,
- new Vector2(start.X, end.Y+24), wireItem.Color * alpha, 0.0f, 1.0f,
+ new Vector2(start.X, end.Y+25), wireItem.Color * alpha, 0.0f, 1.0f,
(end.X > start.X) ? SpriteEffects.None : SpriteEffects.FlipHorizontally);
float wireStartX = start.X - wireCorner.size.X / 2 * dir;
@@ -426,7 +426,7 @@ namespace Barotrauma.Items.Components
{
item.IsHighlighted = true;
//start dragging the wire
- if (PlayerInput.LeftButtonDown()) draggingConnected = wireItem;
+ if (PlayerInput.LeftButtonHeld()) draggingConnected = wireItem;
}
}
diff --git a/Subsurface/Source/Items/Components/Signal/Wire.cs b/Subsurface/Source/Items/Components/Signal/Wire.cs
index 289b008b3..0b3150248 100644
--- a/Subsurface/Source/Items/Components/Signal/Wire.cs
+++ b/Subsurface/Source/Items/Components/Signal/Wire.cs
@@ -351,7 +351,7 @@ namespace Barotrauma.Items.Components
if (selectedNodeIndex == null && draggingWire == null)// && !MapEntity.SelectedAny)
{
- if (PlayerInput.LeftButtonClicked())
+ if (PlayerInput.LeftButtonDown())
{
MapEntity.DisableSelect = true;
MapEntity.SelectEntity(item);
@@ -367,7 +367,7 @@ namespace Barotrauma.Items.Components
}
}
- if (PlayerInput.LeftButtonDown())
+ if (PlayerInput.LeftButtonHeld())
{
if (selectedNodeIndex != null && draggingWire == this)
{
diff --git a/Subsurface/Source/Items/Components/Turret.cs b/Subsurface/Source/Items/Components/Turret.cs
index c1bff1e81..d052165f2 100644
--- a/Subsurface/Source/Items/Components/Turret.cs
+++ b/Subsurface/Source/Items/Components/Turret.cs
@@ -159,10 +159,10 @@ namespace Barotrauma.Items.Components
float availablePower = 0.0f;
foreach (PowerContainer battery in batteries)
{
- float batteryPower = Math.Min(battery.Charge, battery.MaxOutPut);
- float takePower = Math.Min(currPowerConsumption - availablePower, batteryPower);
+ float batteryPower = Math.Min(battery.Charge*3600.0f, battery.MaxOutPut);
+ float takePower = Math.Min(powerConsumption - availablePower, batteryPower);
- battery.Charge -= takePower;
+ battery.Charge -= takePower/3600.0f;
}
reload = reloadTime;
@@ -284,7 +284,7 @@ namespace Barotrauma.Items.Components
float availablePower = 0.0f;
foreach (PowerContainer battery in batteries)
{
- float batteryPower = Math.Min(battery.Charge, battery.MaxOutPut);
+ float batteryPower = Math.Min(battery.Charge*3600.0f, battery.MaxOutPut);
availablePower += batteryPower;
}
diff --git a/Subsurface/Source/Items/Inventory.cs b/Subsurface/Source/Items/Inventory.cs
index 2393997e4..30b6dc69d 100644
--- a/Subsurface/Source/Items/Inventory.cs
+++ b/Subsurface/Source/Items/Inventory.cs
@@ -205,7 +205,7 @@ namespace Barotrauma
if (draggingItem != null && !draggingItemSlot.Contains(PlayerInput.MousePosition) && draggingItem.Container == this.Owner)
{
- if (PlayerInput.LeftButtonDown())
+ if (PlayerInput.LeftButtonHeld())
{
slotRect.X = (int)PlayerInput.MousePosition.X - slotRect.Width / 2;
slotRect.Y = (int)PlayerInput.MousePosition.Y - slotRect.Height / 2;
@@ -261,7 +261,7 @@ namespace Barotrauma
{
if (draggingItem == null)
{
- if (PlayerInput.LeftButtonDown())
+ if (PlayerInput.LeftButtonHeld())
{
draggingItem = item;
}
diff --git a/Subsurface/Source/Items/ItemPrefab.cs b/Subsurface/Source/Items/ItemPrefab.cs
index 32ec8048f..a10c81bbc 100644
--- a/Subsurface/Source/Items/ItemPrefab.cs
+++ b/Subsurface/Source/Items/ItemPrefab.cs
@@ -114,7 +114,7 @@ namespace Barotrauma
if (placePosition == Vector2.Zero)
{
- if (PlayerInput.LeftButtonDown()) placePosition = position;
+ if (PlayerInput.LeftButtonHeld()) placePosition = position;
}
else
{
diff --git a/Subsurface/Source/Map/Hull.cs b/Subsurface/Source/Map/Hull.cs
index 2ebdbca9e..15b34b0cd 100644
--- a/Subsurface/Source/Map/Hull.cs
+++ b/Subsurface/Source/Map/Hull.cs
@@ -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;
}
diff --git a/Subsurface/Source/Map/MapEntity.cs b/Subsurface/Source/Map/MapEntity.cs
index c29f15baf..ac310e5bb 100644
--- a/Subsurface/Source/Map/MapEntity.cs
+++ b/Subsurface/Source/Map/MapEntity.cs
@@ -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
diff --git a/Subsurface/Source/Map/MapEntityPrefab.cs b/Subsurface/Source/Map/MapEntityPrefab.cs
index 150942020..384cc5a11 100644
--- a/Subsurface/Source/Map/MapEntityPrefab.cs
+++ b/Subsurface/Source/Map/MapEntityPrefab.cs
@@ -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;
diff --git a/Subsurface/Source/Map/StructurePrefab.cs b/Subsurface/Source/Map/StructurePrefab.cs
index f19cc52ed..793e4e3bc 100644
--- a/Subsurface/Source/Map/StructurePrefab.cs
+++ b/Subsurface/Source/Map/StructurePrefab.cs
@@ -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;
}
}
}
diff --git a/Subsurface/Source/PlayerInput.cs b/Subsurface/Source/PlayerInput.cs
index 58069e2d2..3b488c34c 100644
--- a/Subsurface/Source/PlayerInput.cs
+++ b/Subsurface/Source/PlayerInput.cs
@@ -46,11 +46,11 @@ namespace Barotrauma
}
else if (mouseButton == 0)
{
- return PlayerInput.LeftButtonDown();
+ return PlayerInput.LeftButtonHeld();
}
else if (mouseButton == 1)
{
- return PlayerInput.RightButtonDown();
+ return PlayerInput.RightButtonHeld();
}
return false;
@@ -252,15 +252,23 @@ namespace Barotrauma
}
- public static bool LeftButtonDown()
+ public static bool LeftButtonHeld()
{
return GameMain.WindowActive && mouseState.LeftButton == ButtonState.Pressed;
}
+ public static bool LeftButtonDown()
+ {
+ return GameMain.WindowActive &&
+ oldMouseState.LeftButton == ButtonState.Released &&
+ mouseState.LeftButton == ButtonState.Pressed;
+ }
+
public static bool LeftButtonReleased()
{
return GameMain.WindowActive && mouseState.LeftButton == ButtonState.Released;
}
+
public static bool LeftButtonClicked()
{
@@ -269,7 +277,7 @@ namespace Barotrauma
&& mouseState.LeftButton == ButtonState.Released);
}
- public static bool RightButtonDown()
+ public static bool RightButtonHeld()
{
return GameMain.WindowActive && mouseState.RightButton == ButtonState.Pressed;
}
diff --git a/Subsurface/Source/Screens/EditCharacterScreen.cs b/Subsurface/Source/Screens/EditCharacterScreen.cs
index f2bc7b006..a5af06f7b 100644
--- a/Subsurface/Source/Screens/EditCharacterScreen.cs
+++ b/Subsurface/Source/Screens/EditCharacterScreen.cs
@@ -194,7 +194,7 @@ namespace Barotrauma
GUI.DrawLine(spriteBatch, limbBodyPos + Vector2.UnitY * 5.0f, limbBodyPos - Vector2.UnitY * 5.0f, Color.White);
GUI.DrawLine(spriteBatch, limbBodyPos + Vector2.UnitX * 5.0f, limbBodyPos - Vector2.UnitX * 5.0f, Color.White);
- if (Vector2.Distance(PlayerInput.MousePosition, limbBodyPos)<5.0f && PlayerInput.LeftButtonDown())
+ if (Vector2.Distance(PlayerInput.MousePosition, limbBodyPos)<5.0f && PlayerInput.LeftButtonHeld())
{
limb.sprite.Origin += PlayerInput.MouseSpeed;
}
@@ -284,7 +284,7 @@ namespace Barotrauma
if (Vector2.Distance(PlayerInput.MousePosition, jointPos) < 6.0f)
{
GUI.DrawRectangle(spriteBatch, jointPos - new Vector2(3.0f, 3.0f), new Vector2(11.0f, 11.0f), Color.Red, false);
- if (PlayerInput.LeftButtonDown())
+ if (PlayerInput.LeftButtonHeld())
{
Vector2 speed = ConvertUnits.ToSimUnits(PlayerInput.MouseSpeed);
speed.Y = -speed.Y;
diff --git a/Subsurface/Source/Screens/EditMapScreen.cs b/Subsurface/Source/Screens/EditMapScreen.cs
index 999f3ac4e..44f863ada 100644
--- a/Subsurface/Source/Screens/EditMapScreen.cs
+++ b/Subsurface/Source/Screens/EditMapScreen.cs
@@ -649,7 +649,7 @@ namespace Barotrauma
GUI.Draw((float)deltaTime, spriteBatch, cam);
- if (!PlayerInput.LeftButtonDown()) Inventory.draggingItem = null;
+ if (!PlayerInput.LeftButtonHeld()) Inventory.draggingItem = null;
spriteBatch.End();
}
diff --git a/Subsurface/Source/Screens/GameScreen.cs b/Subsurface/Source/Screens/GameScreen.cs
index e64f19178..d1f52dc0b 100644
--- a/Subsurface/Source/Screens/GameScreen.cs
+++ b/Subsurface/Source/Screens/GameScreen.cs
@@ -202,7 +202,7 @@ namespace Barotrauma
GUI.Draw((float)deltaTime, spriteBatch, cam);
- if (!PlayerInput.LeftButtonDown()) Inventory.draggingItem = null;
+ if (!PlayerInput.LeftButtonHeld()) Inventory.draggingItem = null;
spriteBatch.End();
}
diff --git a/Subsurface_Solution.v12.suo b/Subsurface_Solution.v12.suo
index 98cd18d40..e0b68e41f 100644
Binary files a/Subsurface_Solution.v12.suo and b/Subsurface_Solution.v12.suo differ