Unstable 1.2.4.0

This commit is contained in:
Markus Isberg
2023-11-30 13:53:00 +02:00
parent 8a2e2ea0ae
commit fb5ea537bf
210 changed files with 4201 additions and 1283 deletions
@@ -60,12 +60,19 @@ namespace Barotrauma.Items.Components
set
{
if (parent == value) { return; }
if (parent != null) { parent.OnActiveStateChanged -= SetActiveState; }
if (value != null) { value.OnActiveStateChanged += SetActiveState; }
if (InheritParentIsActive)
{
if (parent != null) { parent.OnActiveStateChanged -= SetActiveState; }
if (value != null) { value.OnActiveStateChanged += SetActiveState; }
}
parent = value;
}
}
[Serialize(true, IsPropertySaveable.No, description: "If this is a child component of another component, should this component inherit the IsActive state of the parent?")]
public bool InheritParentIsActive { get; set; }
public readonly ContentXElement originalElement;
protected const float CorrectionDelay = 1.0f;
@@ -394,8 +401,11 @@ namespace Barotrauma.Items.Components
if (ic == null) { break; }
ic.Parent = this;
ic.IsActive = isActive;
OnActiveStateChanged += ic.SetActiveState;
if (ic.InheritParentIsActive)
{
ic.IsActive = isActive;
OnActiveStateChanged += ic.SetActiveState;
}
item.AddComponent(ic);
break;