Banning players, networkevent refactoring, wire syncing bugfixes, wrenches can be used as a melee weapon, proper error message for invalid IPs, drawing held items in correct position, fixed client crashing if sending a chatmessage while connection is lost

This commit is contained in:
Regalis
2015-10-22 01:04:42 +03:00
parent 313d16d886
commit 51e68f0949
28 changed files with 520 additions and 154 deletions
@@ -93,10 +93,18 @@ namespace Barotrauma.Items.Components
spriteBatch.DrawString(GUI.Font, "Force: " + (int)(targetForce) + " %", new Vector2(GuiFrame.Rect.X + 30, GuiFrame.Rect.Y + 30), Color.White);
if (GUI.DrawButton(spriteBatch, new Rectangle(GuiFrame.Rect.X + 280, GuiFrame.Rect.Y + 30, 40, 40), "+", true)) targetForce += 1.0f;
if (GUI.DrawButton(spriteBatch, new Rectangle(GuiFrame.Rect.X + 280, GuiFrame.Rect.Y + 80, 40, 40), "-", true)) targetForce -= 1.0f;
if (GUI.DrawButton(spriteBatch, new Rectangle(GuiFrame.Rect.X + 280, GuiFrame.Rect.Y + 30, 40, 40), "+", true))
{
targetForce += 1.0f;
item.NewComponentEvent(this, true, false);
}
if (GUI.DrawButton(spriteBatch, new Rectangle(GuiFrame.Rect.X + 280, GuiFrame.Rect.Y + 80, 40, 40), "-", true))
{
targetForce -= 1.0f;
item.NewComponentEvent(this, true, false);
}
item.NewComponentEvent(this, true);
}
public override void UpdateBroken(float deltaTime, Camera cam)
@@ -117,7 +117,7 @@ namespace Barotrauma.Items.Components
targetLevel = null;
IsActive = !IsActive;
if (!IsActive) currPowerConsumption = 0.0f;
item.NewComponentEvent(this, true);
item.NewComponentEvent(this, true, true);
}
spriteBatch.DrawString(GUI.Font, "Pumping speed: " + (int)flowPercentage + " %", new Vector2(x + 20, y + 80), Color.White);
@@ -125,12 +125,12 @@ namespace Barotrauma.Items.Components
if (GUI.DrawButton(spriteBatch, new Rectangle(x + 200, y + 70, 40, 40), "OUT", false))
{
FlowPercentage -= 10.0f;
item.NewComponentEvent(this, true);
item.NewComponentEvent(this, true, false);
}
if (GUI.DrawButton(spriteBatch, new Rectangle(x + 250, y + 70, 40, 40), "IN", false))
{
FlowPercentage += 10.0f;
item.NewComponentEvent(this, true);
item.NewComponentEvent(this, true, false);
}
}
@@ -80,7 +80,7 @@ namespace Barotrauma.Items.Components
if (GUI.DrawButton(spriteBatch, new Rectangle(x + 20, y + 20, 200, 30), "Activate Radar"))
{
IsActive = !IsActive;
item.NewComponentEvent(this, true);
item.NewComponentEvent(this, true, false);
}
int radius = GuiFrame.Rect.Height / 2 - 10;
@@ -371,7 +371,7 @@ namespace Barotrauma.Items.Components
if (valueChanged)
{
item.NewComponentEvent(this, true);
item.NewComponentEvent(this, true, false);
valueChanged = false;
}
}
@@ -97,7 +97,7 @@ namespace Barotrauma.Items.Components
networkUpdateTimer -= deltaTime;
if (networkUpdateTimer<=0.0f)
{
item.NewComponentEvent(this, true);
item.NewComponentEvent(this, true, false);
networkUpdateTimer = 1.0f;
valueChanged = false;
}
@@ -124,7 +124,7 @@ namespace Barotrauma.Items.Components
{
AutoPilot = !AutoPilot;
item.NewComponentEvent(this, true);
item.NewComponentEvent(this, true, true);
}
GUI.DrawLine(spriteBatch,