Unstable 1.1.14.0
This commit is contained in:
@@ -41,6 +41,8 @@ namespace Barotrauma.Items.Components
|
||||
}
|
||||
|
||||
private bool isStuck;
|
||||
|
||||
[Serialize(false, IsPropertySaveable.Yes, alwaysUseInstanceValues: true)]
|
||||
public bool IsStuck
|
||||
{
|
||||
get { return isStuck; }
|
||||
@@ -49,7 +51,10 @@ namespace Barotrauma.Items.Components
|
||||
if (isStuck == value) { return; }
|
||||
isStuck = value;
|
||||
#if SERVER
|
||||
item.CreateServerEvent(this);
|
||||
if (item.FullyInitialized)
|
||||
{
|
||||
item.CreateServerEvent(this);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -105,7 +110,7 @@ namespace Barotrauma.Items.Components
|
||||
public bool CanBeWelded = true;
|
||||
|
||||
private float stuck;
|
||||
[Serialize(0.0f, IsPropertySaveable.No, description: "How badly stuck the door is (in percentages). If the percentage reaches 100, the door needs to be cut open to make it usable again.")]
|
||||
[Serialize(0.0f, IsPropertySaveable.Yes, description: "How badly stuck the door is (in percentages). If the percentage reaches 100, the door needs to be cut open to make it usable again.")]
|
||||
public float Stuck
|
||||
{
|
||||
get { return stuck; }
|
||||
@@ -181,7 +186,11 @@ namespace Barotrauma.Items.Components
|
||||
|
||||
[Serialize(false, IsPropertySaveable.No, description: "If the door has integrated buttons, it can be opened by interacting with it directly (instead of using buttons wired to it).")]
|
||||
public bool HasIntegratedButtons { get; private set; }
|
||||
|
||||
|
||||
[ConditionallyEditable(ConditionallyEditable.ConditionType.HasIntegratedButtons),
|
||||
Serialize(true, IsPropertySaveable.No, description: "If the door has integrated buttons, should clicking on it perform the default action of opening the door? Can be used in conjunction with the \"activate_out\" output to pass a signal to a circuit without toggling the door when someone tries to open/close the door.")]
|
||||
public bool ToggleWhenClicked { get; private set; }
|
||||
|
||||
public float OpenState
|
||||
{
|
||||
get { return openState; }
|
||||
@@ -342,8 +351,12 @@ namespace Barotrauma.Items.Components
|
||||
OnFailedToOpen();
|
||||
return;
|
||||
}
|
||||
item.SendSignal("1", "activate_out");
|
||||
lastUser = user;
|
||||
SetState(PredictedState == null ? !isOpen : !PredictedState.Value, false, true, forcedOpen: actionType == ActionType.OnPicked);
|
||||
if (ToggleWhenClicked)
|
||||
{
|
||||
SetState(PredictedState == null ? !isOpen : !PredictedState.Value, false, true, forcedOpen: actionType == ActionType.OnPicked);
|
||||
}
|
||||
}
|
||||
|
||||
public override bool Select(Character character)
|
||||
@@ -389,8 +402,6 @@ namespace Barotrauma.Items.Components
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool isClosing = false;
|
||||
if ((!IsStuck && !IsJammed) || !isOpen)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user