(98ad00fa2) v0.9.1.0
This commit is contained in:
@@ -34,6 +34,8 @@ namespace Barotrauma.Items.Components
|
||||
|
||||
private GUIComponent inSufficientPowerWarning;
|
||||
|
||||
private FabricationRecipe pendingFabricatedItem;
|
||||
|
||||
private Pair<Rectangle, string> tooltip;
|
||||
|
||||
partial void InitProjSpecific()
|
||||
@@ -403,7 +405,7 @@ namespace Barotrauma.Items.Components
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private bool StartButtonClicked(GUIButton button, object obj)
|
||||
{
|
||||
if (selectedItem == null) { return false; }
|
||||
@@ -412,19 +414,22 @@ namespace Barotrauma.Items.Components
|
||||
outputInventoryHolder.Flash(Color.Red);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (fabricatedItem == null)
|
||||
|
||||
if (GameMain.Client != null)
|
||||
{
|
||||
StartFabricating(selectedItem, Character.Controlled);
|
||||
pendingFabricatedItem = fabricatedItem != null ? null : selectedItem;
|
||||
item.CreateClientEvent(this);
|
||||
}
|
||||
else
|
||||
{
|
||||
CancelFabricating(Character.Controlled);
|
||||
}
|
||||
|
||||
if (GameMain.Client != null)
|
||||
{
|
||||
item.CreateClientEvent(this);
|
||||
if (fabricatedItem == null)
|
||||
{
|
||||
StartFabricating(selectedItem, Character.Controlled);
|
||||
}
|
||||
else
|
||||
{
|
||||
CancelFabricating(Character.Controlled);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -433,7 +438,7 @@ namespace Barotrauma.Items.Components
|
||||
public override void UpdateHUD(Character character, float deltaTime, Camera cam)
|
||||
{
|
||||
activateButton.Enabled = false;
|
||||
inSufficientPowerWarning.Visible = powerConsumption > 0 && voltage < minVoltage;
|
||||
inSufficientPowerWarning.Visible = currPowerConsumption > 0 && !hasPower;
|
||||
|
||||
var availableIngredients = GetAvailableIngredients();
|
||||
if (character != null)
|
||||
@@ -457,7 +462,7 @@ namespace Barotrauma.Items.Components
|
||||
|
||||
public void ClientWrite(NetBuffer msg, object[] extraData = null)
|
||||
{
|
||||
int itemIndex = fabricatedItem == null ? -1 : fabricationRecipes.IndexOf(fabricatedItem);
|
||||
int itemIndex = pendingFabricatedItem == null ? -1 : fabricationRecipes.IndexOf(pendingFabricatedItem);
|
||||
msg.WriteRangedInteger(-1, fabricationRecipes.Count - 1, itemIndex);
|
||||
}
|
||||
|
||||
@@ -474,8 +479,8 @@ namespace Barotrauma.Items.Components
|
||||
else
|
||||
{
|
||||
//if already fabricating the selected item, return
|
||||
if (fabricatedItem != null && fabricationRecipes.IndexOf(fabricatedItem) == itemIndex) return;
|
||||
if (itemIndex < 0 || itemIndex >= fabricationRecipes.Count) return;
|
||||
if (fabricatedItem != null && fabricationRecipes.IndexOf(fabricatedItem) == itemIndex) { return; }
|
||||
if (itemIndex < 0 || itemIndex >= fabricationRecipes.Count) { return; }
|
||||
|
||||
SelectItem(user, fabricationRecipes[itemIndex]);
|
||||
StartFabricating(fabricationRecipes[itemIndex], user);
|
||||
|
||||
Reference in New Issue
Block a user