private void UpdateSetupInterface(EntityUid uid, SurveillanceCameraComponent?camera = null, DeviceNetworkComponent?deviceNet = null) { if (!Resolve(uid, ref camera, ref deviceNet)) { return; } if (camera.NameSet && camera.NetworkSet) { _userInterface.TryCloseAll(uid, SurveillanceCameraSetupUiKey.Camera); return; } if (camera.AvailableNetworks.Count == 0) { if (deviceNet.ReceiveFrequencyId != null) { camera.AvailableNetworks.Add(deviceNet.ReceiveFrequencyId); } else if (!camera.NetworkSet) { _userInterface.TryCloseAll(uid, SurveillanceCameraSetupUiKey.Camera); return; } } var state = new SurveillanceCameraSetupBoundUiState(camera.CameraId, deviceNet.ReceiveFrequency ?? 0, camera.AvailableNetworks, camera.NameSet, camera.NetworkSet); _userInterface.TrySetUiState(uid, SurveillanceCameraSetupUiKey.Camera, state); }
private void UpdateSetupInterface(EntityUid uid, SurveillanceCameraRouterComponent?router = null, DeviceNetworkComponent?deviceNet = null) { if (!Resolve(uid, ref router, ref deviceNet)) { return; } if (router.AvailableNetworks.Count == 0 || router.SubnetFrequencyId != null) { _userInterface.TryCloseAll(uid, SurveillanceCameraSetupUiKey.Router); return; } var state = new SurveillanceCameraSetupBoundUiState(router.SubnetName, deviceNet.ReceiveFrequency ?? 0, router.AvailableNetworks, true, router.SubnetFrequencyId != null); _userInterface.TrySetUiState(uid, SurveillanceCameraSetupUiKey.Router, state); }