Endworm attacks working, itemlabel text saving bugfix, deconstructors & fabricators need power, engine sprite, disable wire node dragging in character mode, only hit with one meleeweapon at a time, fixrequirement text overflow fix, mapentities can hace multiple categories, Gap.FindHull fix, Waypoint ladder & gap saving, stuff

This commit is contained in:
Regalis
2016-01-18 20:09:38 +02:00
parent 5f1cb194ab
commit 1a5b3fa66a
39 changed files with 206 additions and 152 deletions
@@ -56,7 +56,7 @@ namespace Barotrauma.Items.Components
}
}
class Fabricator : ItemComponent
class Fabricator : Powered
{
private List<FabricableItem> fabricableItems;
@@ -64,8 +64,8 @@ namespace Barotrauma.Items.Components
private GUIFrame selectedItemFrame;
GUIProgressBar progressBar;
GUIButton activateButton;
private GUIProgressBar progressBar;
private GUIButton activateButton;
private FabricableItem fabricatedItem;
private float timeUntilReady;
@@ -208,6 +208,8 @@ namespace Barotrauma.Items.Components
var containers = item.GetComponents<ItemContainer>();
containers[0].Inventory.Locked = true;
containers[1].Inventory.Locked = true;
currPowerConsumption = powerConsumption;
}
private void CancelFabricating()
@@ -216,6 +218,8 @@ namespace Barotrauma.Items.Components
IsActive = false;
fabricatedItem = null;
currPowerConsumption = 0.0f;
if (activateButton != null)
{
activateButton.Text = "Create";
@@ -231,13 +235,19 @@ namespace Barotrauma.Items.Components
public override void Update(float deltaTime, Camera cam)
{
timeUntilReady -= deltaTime;
if (progressBar!=null)
{
progressBar.BarSize = fabricatedItem == null ? 0.0f : (fabricatedItem.RequiredTime - timeUntilReady) / fabricatedItem.RequiredTime;
}
if (voltage < minVoltage) return;
if (powerConsumption == 0) voltage = 1.0f;
timeUntilReady -= deltaTime*voltage;
voltage -= deltaTime * 10.0f;
if (timeUntilReady > 0.0f) return;
var containers = item.GetComponents<ItemContainer>();