diff --git a/Content.Client/Chemistry/UI/ChemMasterBoundUserInterface.cs b/Content.Client/Chemistry/UI/ChemMasterBoundUserInterface.cs index 8c3f96bb47..a499063ca7 100644 --- a/Content.Client/Chemistry/UI/ChemMasterBoundUserInterface.cs +++ b/Content.Client/Chemistry/UI/ChemMasterBoundUserInterface.cs @@ -38,13 +38,19 @@ namespace Content.Client.Chemistry.UI _window.OnClose += Close; //Setup static button actions. - _window.EjectButton.OnPressed += _ => PrepareData(UiAction.Eject, null, null, null); - _window.BufferTransferButton.OnPressed += _ => PrepareData(UiAction.Transfer, null, null, null); - _window.BufferDiscardButton.OnPressed += _ => PrepareData(UiAction.Discard, null, null, null); - _window.CreatePillButton.OnPressed += _ => PrepareData(UiAction.CreatePills, null, _window.PillAmount.Value, null); - _window.CreateBottleButton.OnPressed += _ => PrepareData(UiAction.CreateBottles, null, null, _window.BottleAmount.Value); + _window.EjectButton.OnPressed += _ => PrepareData(UiAction.Eject, null, null, null, null); + _window.BufferTransferButton.OnPressed += _ => PrepareData(UiAction.Transfer, null, null, null, null); + _window.BufferDiscardButton.OnPressed += _ => PrepareData(UiAction.Discard, null, null, null, null); + _window.CreatePillButton.OnPressed += _ => PrepareData(UiAction.CreatePills, null, null, _window.PillAmount.Value, null); + _window.CreateBottleButton.OnPressed += _ => PrepareData(UiAction.CreateBottles, null, null, null, _window.BottleAmount.Value); - _window.OnChemButtonPressed += (args, button) => PrepareData(UiAction.ChemButton, button, null, null); + for(uint i = 0; i < _window.PillTypeButtons.Length; i++) + { + uint type = i; + _window.PillTypeButtons[i].OnPressed += _ => PrepareData(UiAction.SetPillType, null, type + 1, null, null); + } + + _window.OnChemButtonPressed += (args, button) => PrepareData(UiAction.ChemButton, button, null, null, null); } /// @@ -63,15 +69,15 @@ namespace Content.Client.Chemistry.UI _window?.UpdateState(castState); //Update window state } - private void PrepareData(UiAction action, ChemButton? button, int? pillAmount, int? bottleAmount) + private void PrepareData(UiAction action, ChemButton? button, uint? pillType, int? pillAmount, int? bottleAmount) { if (button != null) { - SendMessage(new UiActionMessage(action, button.Amount, button.Id, button.isBuffer, null, null)); + SendMessage(new UiActionMessage(action, button.Amount, button.Id, button.IsBuffer, null, null, null)); } else { - SendMessage(new UiActionMessage(action, null, null, null, pillAmount, bottleAmount)); + SendMessage(new UiActionMessage(action, null, null, null, pillType, pillAmount, bottleAmount)); } } diff --git a/Content.Client/Chemistry/UI/ChemMasterWindow.xaml b/Content.Client/Chemistry/UI/ChemMasterWindow.xaml index 799cf16a98..3dac1a1d88 100644 --- a/Content.Client/Chemistry/UI/ChemMasterWindow.xaml +++ b/Content.Client/Chemistry/UI/ChemMasterWindow.xaml @@ -1,4 +1,4 @@ - + + +