Update UI when the AME node group is changed, fix AME connection issues (#4750)
* Update UI when the AME node group is changed (fixes core count indicator being wrong) * Fix connection issues between AME controller and cores * Fix #4365 by properly propagating and clearing AME core injection state * Fixes #4364
This commit is contained in:
@@ -27,7 +27,8 @@ namespace Content.Server.AME.Components
|
||||
public class AMEControllerComponent : SharedAMEControllerComponent, IActivate, IInteractUsing
|
||||
{
|
||||
[ViewVariables] private BoundUserInterface? UserInterface => Owner.GetUIOrNull(AMEControllerUiKey.Key);
|
||||
[ViewVariables] private bool _injecting;
|
||||
private bool _injecting;
|
||||
[ViewVariables] public bool Injecting => _injecting;
|
||||
[ViewVariables] public int InjectionAmount;
|
||||
|
||||
private AppearanceComponent? _appearance;
|
||||
@@ -137,6 +138,12 @@ namespace Content.Server.AME.Components
|
||||
UpdateUserInterface();
|
||||
}
|
||||
|
||||
// Used to update core count
|
||||
public void OnAMENodeGroupUpdate()
|
||||
{
|
||||
UpdateUserInterface();
|
||||
}
|
||||
|
||||
private AMEControllerBoundUserInterfaceState GetUserInterfaceState()
|
||||
{
|
||||
var jar = _jarSlot.ContainedEntity;
|
||||
@@ -216,7 +223,7 @@ namespace Content.Server.AME.Components
|
||||
break;
|
||||
}
|
||||
|
||||
GetAMENodeGroup()?.UpdateCoreVisuals(InjectionAmount, _injecting);
|
||||
GetAMENodeGroup()?.UpdateCoreVisuals();
|
||||
|
||||
UpdateUserInterface();
|
||||
ClickSound();
|
||||
|
||||
Reference in New Issue
Block a user