- respawn, fabricator & deconstructor logging

- fixed listbox child hiding 4 real now
- dockingport logging fix (name of the sub instead of submarine.ToString)
This commit is contained in:
Regalis
2017-05-09 21:39:39 +03:00
parent 63b5ad1821
commit ad90cf804d
5 changed files with 41 additions and 22 deletions

View File

@@ -105,23 +105,23 @@ namespace Barotrauma.Items.Components
private bool ToggleActive(GUIButton button, object obj)
{
SetActive(!IsActive);
SetActive(!IsActive, Character.Controlled);
currPowerConsumption = IsActive ? powerConsumption : 0.0f;
if (GameMain.Server != null)
{
item.CreateServerEvent<Deconstructor>(this);
item.CreateServerEvent(this);
}
else if (GameMain.Client != null)
{
item.CreateClientEvent<Deconstructor>(this);
item.CreateClientEvent(this);
}
return true;
}
private void SetActive(bool active)
private void SetActive(bool active, Character user = null)
{
container = item.GetComponent<ItemContainer>();
if (container == null)
@@ -134,6 +134,11 @@ namespace Barotrauma.Items.Components
IsActive = active;
if (user != null)
{
GameServer.Log(user.Name + (IsActive ? " activated " : " deactivated ") + item.Name, ServerLog.MessageType.ItemInteraction);
}
if (!IsActive)
{
progressBar.BarSize = 0.0f;
@@ -160,11 +165,11 @@ namespace Barotrauma.Items.Components
{
bool active = msg.ReadBoolean();
item.CreateServerEvent<Deconstructor>(this);
item.CreateServerEvent(this);
if (item.CanClientAccess(c))
{
SetActive(active);
SetActive(active, c.Character);
}
}