Merge remote-tracking branch 'refs/remotes/barotrauma/master'
Conflicts: Subsurface/Properties/AssemblyInfo.cs Subsurface/Source/Characters/Character.cs Subsurface/Source/GUI/GUI.cs Subsurface/Source/GameMain.cs Subsurface/Source/GameSettings.cs Subsurface/Source/Items/CharacterInventory.cs Subsurface/Source/Items/Components/ItemComponent.cs Subsurface/Source/Items/Components/Machines/Pump.cs Subsurface/Source/Items/Components/Machines/Radar.cs Subsurface/Source/Items/Components/Machines/Steering.cs Subsurface/Source/Items/Components/Power/PowerContainer.cs Subsurface/Source/Items/Inventory.cs Subsurface/Source/Items/Item.cs Subsurface/Source/Items/ItemSpawner.cs Subsurface/Source/Map/Levels/WaterRenderer.cs Subsurface/Source/Map/LinkedSubmarine.cs Subsurface/Source/Map/Map/Map.cs Subsurface/Source/Map/Structure.cs Subsurface/Source/Map/Submarine.cs Subsurface/Source/Map/WayPoint.cs Subsurface/Source/Networking/GameClient.cs Subsurface/Source/Networking/GameServer.cs Subsurface/Source/Physics/PhysicsBody.cs Subsurface/Source/Screens/GameScreen.cs
This commit is contained in:
@@ -122,7 +122,7 @@ namespace Barotrauma.Items.Components
|
||||
base.Update(deltaTime, cam);
|
||||
|
||||
light.ParentSub = item.Submarine;
|
||||
|
||||
|
||||
ApplyStatusEffects(ActionType.OnActive, deltaTime);
|
||||
|
||||
if (item.Container != null)
|
||||
|
||||
@@ -7,6 +7,8 @@ namespace Barotrauma.Items.Components
|
||||
{
|
||||
private float maxPower;
|
||||
|
||||
private float lastReceivedMessage;
|
||||
|
||||
[Editable, HasDefaultValue(1000.0f, true)]
|
||||
public float MaxPower
|
||||
{
|
||||
@@ -73,13 +75,43 @@ namespace Barotrauma.Items.Components
|
||||
}
|
||||
else if (connection.Name == "toggle")
|
||||
{
|
||||
IsOn = !IsOn;
|
||||
SetState(!IsOn,false,true);
|
||||
}
|
||||
else if (connection.Name == "set_state")
|
||||
{
|
||||
IsOn = signal != "0";
|
||||
SetState(signal != "0", false, true);
|
||||
}
|
||||
}
|
||||
|
||||
public void SetState(bool on, bool isNetworkMessage, bool sendNetworkMessage = false)
|
||||
{
|
||||
if (GameMain.Client != null && !isNetworkMessage) return;
|
||||
|
||||
IsOn = on;
|
||||
if (sendNetworkMessage)
|
||||
{
|
||||
item.NewComponentEvent(this, false, true);
|
||||
}
|
||||
}
|
||||
|
||||
public override bool FillNetworkData(Networking.NetworkEventType type, Lidgren.Network.NetBuffer message)
|
||||
{
|
||||
message.Write(IsOn);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void ReadNetworkData(Networking.NetworkEventType type, Lidgren.Network.NetIncomingMessage message, float sendingTime)
|
||||
{
|
||||
if (sendingTime < lastReceivedMessage) return;
|
||||
if (GameMain.Server != null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
lastReceivedMessage = sendingTime;
|
||||
|
||||
SetState(message.ReadBoolean(), true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -470,6 +470,14 @@ namespace Barotrauma.Items.Components
|
||||
wireSprite.Depth + ((item.ID % 100) * 0.00001f));
|
||||
}
|
||||
|
||||
public override void FlipX()
|
||||
{
|
||||
for (int i = 0; i < Nodes.Count; i++)
|
||||
{
|
||||
Nodes[i] = new Vector2(-Nodes[i].X, Nodes[i].Y);
|
||||
}
|
||||
}
|
||||
|
||||
public override XElement Save(XElement parentElement)
|
||||
{
|
||||
XElement componentElement = base.Save(parentElement);
|
||||
|
||||
Reference in New Issue
Block a user