Merge remote-tracking branch 'upstream/master' into develop
This commit is contained in:
@@ -125,9 +125,9 @@ namespace Barotrauma.Items.Components
|
||||
/// </summary>
|
||||
private Option<ContentXElement> delayedElementToLoad;
|
||||
|
||||
public override void Load(ContentXElement componentElement, bool usePrefabValues, IdRemap idRemap)
|
||||
public override void Load(ContentXElement componentElement, bool usePrefabValues, IdRemap idRemap, bool isItemSwap)
|
||||
{
|
||||
base.Load(componentElement, usePrefabValues, idRemap);
|
||||
base.Load(componentElement, usePrefabValues, idRemap, isItemSwap);
|
||||
if (delayedElementToLoad.IsSome()) { return; }
|
||||
delayedElementToLoad = Option.Some(componentElement);
|
||||
}
|
||||
@@ -380,6 +380,18 @@ namespace Barotrauma.Items.Components
|
||||
OnViewUpdateProjSpecific();
|
||||
}
|
||||
|
||||
private void RenameConnectionLabelsInternal(CircuitBoxInputOutputNode.Type type, Dictionary<string, string> overrides)
|
||||
{
|
||||
foreach (var node in InputOutputNodes)
|
||||
{
|
||||
if (node.NodeType != type) { continue; }
|
||||
|
||||
node.ReplaceAllConnectionLabelOverrides(overrides);
|
||||
break;
|
||||
}
|
||||
OnViewUpdateProjSpecific();
|
||||
}
|
||||
|
||||
private static bool IsExternalConnection(CircuitBoxConnection conn) => conn is (CircuitBoxInputConnection or CircuitBoxOutputConnection);
|
||||
|
||||
private void CreateWireWithoutItem(CircuitBoxConnection one, CircuitBoxConnection two, ushort id, ItemPrefab prefab)
|
||||
|
||||
@@ -282,9 +282,9 @@ namespace Barotrauma.Items.Components
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void Load(ContentXElement element, bool usePrefabValues, IdRemap idRemap)
|
||||
public override void Load(ContentXElement element, bool usePrefabValues, IdRemap idRemap, bool isItemSwap)
|
||||
{
|
||||
base.Load(element, usePrefabValues, idRemap);
|
||||
base.Load(element, usePrefabValues, idRemap, isItemSwap);
|
||||
|
||||
List<Connection> loadedConnections = new List<Connection>();
|
||||
|
||||
|
||||
@@ -284,7 +284,7 @@ namespace Barotrauma.Items.Components
|
||||
public override void OnMapLoaded()
|
||||
{
|
||||
#if CLIENT
|
||||
if (item.HiddenInGame)
|
||||
if (item.IsHidden)
|
||||
{
|
||||
Light.Enabled = false;
|
||||
}
|
||||
|
||||
@@ -165,9 +165,9 @@ namespace Barotrauma.Items.Components
|
||||
updateTimer = Rand.Range(0.0f, UpdateInterval);
|
||||
}
|
||||
|
||||
public override void Load(ContentXElement componentElement, bool usePrefabValues, IdRemap idRemap)
|
||||
public override void Load(ContentXElement componentElement, bool usePrefabValues, IdRemap idRemap, bool isItemSwap)
|
||||
{
|
||||
base.Load(componentElement, usePrefabValues, idRemap);
|
||||
base.Load(componentElement, usePrefabValues, idRemap, isItemSwap);
|
||||
//backwards compatibility
|
||||
if (componentElement.GetAttributeBool("onlyhumans", false))
|
||||
{
|
||||
|
||||
@@ -188,9 +188,9 @@ namespace Barotrauma.Items.Components
|
||||
return componentElement;
|
||||
}
|
||||
|
||||
public override void Load(ContentXElement componentElement, bool usePrefabValues, IdRemap idRemap)
|
||||
public override void Load(ContentXElement componentElement, bool usePrefabValues, IdRemap idRemap, bool isItemSwap)
|
||||
{
|
||||
base.Load(componentElement, usePrefabValues, idRemap);
|
||||
base.Load(componentElement, usePrefabValues, idRemap, isItemSwap);
|
||||
for (int i = 0; i < MaxMessages; i++)
|
||||
{
|
||||
string msg = componentElement.GetAttributeString("msg" + i, null);
|
||||
|
||||
@@ -116,9 +116,9 @@ namespace Barotrauma.Items.Components
|
||||
IsActive = true;
|
||||
}
|
||||
|
||||
public override void Load(ContentXElement componentElement, bool usePrefabValues, IdRemap idRemap)
|
||||
public override void Load(ContentXElement componentElement, bool usePrefabValues, IdRemap idRemap, bool isItemSwap)
|
||||
{
|
||||
base.Load(componentElement, usePrefabValues, idRemap);
|
||||
base.Load(componentElement, usePrefabValues, idRemap, isItemSwap);
|
||||
channelMemory = componentElement.GetAttributeIntArray("channelmemory", new int[ChannelMemorySize]);
|
||||
if (channelMemory.Length != ChannelMemorySize)
|
||||
{
|
||||
@@ -301,7 +301,7 @@ namespace Barotrauma.Items.Components
|
||||
{
|
||||
if (GameMain.Client == null)
|
||||
{
|
||||
GameMain.GameSession?.CrewManager?.AddSinglePlayerChatMessage(signal.source?.Name ?? "", signal.value, ChatMessageType.Radio, sender: null);
|
||||
GameMain.GameSession?.CrewManager?.AddSinglePlayerChatMessage(signal.source?.Name ?? "", signal.value, ChatMessageType.Radio, sender: item);
|
||||
}
|
||||
}
|
||||
#elif SERVER
|
||||
@@ -311,7 +311,7 @@ namespace Barotrauma.Items.Components
|
||||
if (recipientClient != null)
|
||||
{
|
||||
GameMain.Server.SendDirectChatMessage(
|
||||
ChatMessage.Create(signal.source?.Name ?? "", chatMsg, ChatMessageType.Radio, null), recipientClient);
|
||||
ChatMessage.Create(signal.source?.Name ?? "", chatMsg, ChatMessageType.Radio, item), recipientClient);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -268,8 +268,10 @@ namespace Barotrauma.Items.Components
|
||||
CreateNetworkEvent();
|
||||
}
|
||||
#endif
|
||||
//the wire is active if only one end has been connected
|
||||
IsActive = connections[0] == null ^ connections[1] == null;
|
||||
//the wire is active if it's currently being wired to something (in character inventory and connected from one end)
|
||||
IsActive =
|
||||
item.ParentInventory is CharacterInventory &&
|
||||
connections[0] == null ^ connections[1] == null;
|
||||
}
|
||||
|
||||
Drawable = IsActive || nodes.Any();
|
||||
@@ -839,9 +841,9 @@ namespace Barotrauma.Items.Components
|
||||
}
|
||||
}
|
||||
|
||||
public override void Load(ContentXElement componentElement, bool usePrefabValues, IdRemap idRemap)
|
||||
public override void Load(ContentXElement componentElement, bool usePrefabValues, IdRemap idRemap, bool isItemSwap)
|
||||
{
|
||||
base.Load(componentElement, usePrefabValues, idRemap);
|
||||
base.Load(componentElement, usePrefabValues, idRemap, isItemSwap);
|
||||
|
||||
nodes.AddRange(ExtractNodes(componentElement));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user