Remove server-side RefreshInHands, refresh them on component state update

This commit is contained in:
zumorica
2020-05-21 19:44:49 +02:00
parent 7cbd2fd8ce
commit d3102dbf96
5 changed files with 2 additions and 26 deletions

View File

@@ -101,6 +101,7 @@ namespace Content.Client.GameObjects
ActiveIndex = cast.ActiveIndex;
_gui?.UpdateHandIcons();
RefreshInHands();
}
private void _setHand(string hand, IEntity entity)
@@ -190,9 +191,6 @@ namespace Content.Client.GameObjects
case PlayerDetachedMsg _:
_gui.Parent?.RemoveChild(_gui);
break;
case RefreshInHandsMsg _:
RefreshInHands();
break;
}
}

View File

@@ -406,11 +406,6 @@ namespace Content.Server.GameObjects
return hands.ContainsKey(index);
}
public void RefreshInHands()
{
SendNetworkMessage(new RefreshInHandsMsg());
}
/// <summary>
/// Get the name of the slot passed to the inventory component.
/// </summary>

View File

@@ -191,11 +191,6 @@ namespace Content.Server.Interfaces.GameObjects
/// <returns>True if the hand exists, false otherwise.</returns>
bool HasHand(string index);
/// <summary>
/// Refresh all in-hands sprites.
/// </summary>
void RefreshInHands();
void HandleSlotModifiedMaybe(ContainerModifiedMessage message);
}
}

View File

@@ -75,16 +75,4 @@ namespace Content.Shared.GameObjects
Index = index;
}
}
/// <summary>
/// A message that tells the client to refresh in-hands.
/// </summary>
[Serializable, NetSerializable]
public class RefreshInHandsMsg : ComponentMessage
{
public RefreshInHandsMsg()
{
Directed = true;
}
}
}

View File

@@ -12,7 +12,7 @@
state: stunbaton_off
- type: Stunbaton
damage: 0.25
damage: 1
range: 0.75
arcwidth: 0
arc: default