diff --git a/Content.Client/Chemistry/UI/TransferAmountBoundUserInterface.cs b/Content.Client/Chemistry/UI/TransferAmountBoundUserInterface.cs
new file mode 100644
index 0000000000..03eb454372
--- /dev/null
+++ b/Content.Client/Chemistry/UI/TransferAmountBoundUserInterface.cs
@@ -0,0 +1,35 @@
+using Content.Shared.Chemistry;
+using Content.Shared.Chemistry.Reagent;
+using JetBrains.Annotations;
+using Robust.Client.GameObjects;
+using Robust.Shared.GameObjects;
+
+namespace Content.Client.Chemistry.UI
+{
+ [UsedImplicitly]
+ public class TransferAmountBoundUserInterface : BoundUserInterface
+ {
+ private TransferAmountWindow? _window;
+
+ protected override void Open()
+ {
+ base.Open();
+ _window = new TransferAmountWindow();
+
+ _window.applyButton.OnPressed += _ =>
+ {
+ if (int.TryParse(_window.amountLineEdit.Text, out var i))
+ {
+ SendMessage(new TransferAmountSetValueMessage(ReagentUnit.New(i)));
+ _window.Close();
+ }
+ };
+
+ _window.OpenCentered();
+ }
+
+ public TransferAmountBoundUserInterface(ClientUserInterfaceComponent owner, object uiKey) : base(owner, uiKey)
+ {
+ }
+ }
+}
diff --git a/Content.Client/Chemistry/UI/TransferAmountWindow.xaml b/Content.Client/Chemistry/UI/TransferAmountWindow.xaml
new file mode 100644
index 0000000000..50716c563c
--- /dev/null
+++ b/Content.Client/Chemistry/UI/TransferAmountWindow.xaml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
diff --git a/Content.Client/Chemistry/UI/TransferAmountWindow.xaml.cs b/Content.Client/Chemistry/UI/TransferAmountWindow.xaml.cs
new file mode 100644
index 0000000000..1c94789444
--- /dev/null
+++ b/Content.Client/Chemistry/UI/TransferAmountWindow.xaml.cs
@@ -0,0 +1,19 @@
+using Robust.Client.AutoGenerated;
+using Robust.Client.UserInterface.Controls;
+using Robust.Client.UserInterface.CustomControls;
+using Robust.Client.UserInterface.XAML;
+
+namespace Content.Client.Chemistry.UI
+{
+ [GenerateTypedNameReferences]
+ public partial class TransferAmountWindow : SS14Window
+ {
+ public Button applyButton => ApplyButton;
+ public LineEdit amountLineEdit => AmountLineEdit;
+
+ public TransferAmountWindow()
+ {
+ RobustXamlLoader.Load(this);
+ }
+ }
+}
diff --git a/Content.Server/Chemistry/Components/SolutionTransferComponent.cs b/Content.Server/Chemistry/Components/SolutionTransferComponent.cs
index 316b2daf30..74fca84068 100644
--- a/Content.Server/Chemistry/Components/SolutionTransferComponent.cs
+++ b/Content.Server/Chemistry/Components/SolutionTransferComponent.cs
@@ -1,9 +1,15 @@
+using System;
using System.Threading.Tasks;
+using Content.Server.UserInterface;
+using Content.Shared.ActionBlocker;
+using Content.Shared.Chemistry;
using Content.Shared.Chemistry.Reagent;
using Content.Shared.Chemistry.Solution.Components;
using Content.Shared.Interaction;
using Content.Shared.Interaction.Helpers;
using Content.Shared.Notification.Managers;
+using Content.Shared.Verbs;
+using Robust.Server.GameObjects;
using Robust.Shared.GameObjects;
using Robust.Shared.Localization;
using Robust.Shared.Serialization.Manager.Attributes;
@@ -31,6 +37,35 @@ namespace Content.Server.Chemistry.Components
[ViewVariables(VVAccess.ReadWrite)]
public ReagentUnit TransferAmount { get; set; } = ReagentUnit.New(5);
+ ///
+ /// The minimum amount of solution that can be transferred at once from this solution.
+ ///
+ [DataField("minTransferAmount")]
+ [ViewVariables(VVAccess.ReadWrite)]
+ public ReagentUnit MinimumTransferAmount { get; set; } = ReagentUnit.New(5);
+
+ ///
+ /// The maximum amount of solution that can be transferred at once from this solution.
+ ///
+ [DataField("maxTransferAmount")]
+ [ViewVariables(VVAccess.ReadWrite)]
+ public ReagentUnit MaximumTransferAmount { get; set; } = ReagentUnit.New(50);
+
+ ///
+ /// Subjectively, which transfer amount would be best for most activities given the maximum
+ /// transfer amount.
+ ///
+ public ReagentUnit SubjectiveBestTransferAmount() =>
+ MaximumTransferAmount.Int() switch
+ {
+ <= 5 => ReagentUnit.New(1),
+ (> 5) and (<= 25) => ReagentUnit.New(5),
+ (> 25) and (<= 50) => ReagentUnit.New(10),
+ (> 50) and (<= 100) => ReagentUnit.New(20),
+ (> 100) and (<= 500) => ReagentUnit.New(50),
+ (> 500) => ReagentUnit.New(100)
+ };
+
///
/// Can this entity take reagent from reagent tanks?
///
@@ -45,6 +80,46 @@ namespace Content.Server.Chemistry.Components
[ViewVariables(VVAccess.ReadWrite)]
public bool CanSend { get; set; } = true;
+ ///
+ /// Whether you're allowed to change the transfer amount.
+ ///
+ [DataField("canChangeTransferAmount")]
+ [ViewVariables(VVAccess.ReadWrite)]
+ public bool CanChangeTransferAmount { get; set; } = false;
+
+ [ViewVariables] private BoundUserInterface? UserInterface => Owner.GetUIOrNull(TransferAmountUiKey.Key);
+
+ protected override void Initialize()
+ {
+ base.Initialize();
+
+ if (UserInterface != null)
+ {
+ UserInterface.OnReceiveMessage += UserInterfaceOnReceiveMessage;
+ }
+ }
+
+ public void UserInterfaceOnReceiveMessage(ServerBoundUserInterfaceMessage serverMsg)
+ {
+ switch (serverMsg.Message)
+ {
+ case TransferAmountSetValueMessage svm:
+ var sval = svm.Value.Float();
+ var amount = Math.Clamp(sval, MinimumTransferAmount.Float(),
+ MaximumTransferAmount.Float());
+
+ serverMsg.Session.AttachedEntity?.PopupMessage(Loc.GetString("comp-solution-transfer-set-amount", ("amount", amount)));
+ SetTransferAmount(ReagentUnit.New(amount));
+ break;
+ }
+ }
+
+ public void SetTransferAmount(ReagentUnit amount)
+ {
+ amount = ReagentUnit.New(Math.Clamp(amount.Int(), MinimumTransferAmount.Int(), MaximumTransferAmount.Int()));
+ TransferAmount = amount;
+ }
+
async Task IAfterInteract.AfterInteract(AfterInteractEventArgs eventArgs)
{
if (!eventArgs.InRangeUnobstructed() || eventArgs.Target == null)
@@ -67,8 +142,8 @@ namespace Content.Server.Chemistry.Components
{
var toTheBrim = ownerSolution.RefillSpaceAvailable == 0;
var msg = toTheBrim
- ? "solution-transfer-component-fill-to-brim-message"
- : "solution-transfer-component-fill--message";
+ ? "comp-solution-transfer-fill-fully"
+ : "comp-solution-transfer-fill-normal";
target.PopupMessage(eventArgs.User, Loc.GetString(msg,("owner", Owner),("amount", transferred),("target", target)));
return true;
@@ -82,7 +157,7 @@ namespace Content.Server.Chemistry.Components
if (transferred > 0)
{
Owner.PopupMessage(eventArgs.User,
- Loc.GetString("solution-transfer-component-transfer-success-message",
+ Loc.GetString("comp-solution-transfer-transfer-solution",
("amount",transferred),
("target",target)));
@@ -102,13 +177,13 @@ namespace Content.Server.Chemistry.Components
{
if (source.DrainAvailable == 0)
{
- source.Owner.PopupMessage(user, Loc.GetString("solution-transfer-component-do-transfer-component-is-empty", ("entity",source.Owner)));
+ source.Owner.PopupMessage(user, Loc.GetString("comp-solution-transfer-is-empty", ("target", source.Owner)));
return ReagentUnit.Zero;
}
if (target.RefillSpaceAvailable == 0)
{
- target.Owner.PopupMessage(user, Loc.GetString("solution-transfer-component-do-transfer-component-is-full", ("entity", target.Owner)));
+ target.Owner.PopupMessage(user, Loc.GetString("comp-solution-transfer-is-full", ("target", target.Owner)));
return ReagentUnit.Zero;
}
@@ -120,5 +195,114 @@ namespace Content.Server.Chemistry.Components
return actualAmount;
}
+
+ // TODO refactor when dynamic verbs are a thing
+
+ [Verb]
+ public sealed class MinimumTransferVerb : Verb
+ {
+ protected override void GetData(IEntity user, SolutionTransferComponent component, VerbData data)
+ {
+ if (!EntitySystem.Get().CanInteract(user) || !component.CanChangeTransferAmount)
+ {
+ data.Visibility = VerbVisibility.Invisible;
+ return;
+ }
+
+ data.Visibility = VerbVisibility.Visible;
+ data.Text = Loc.GetString("comp-solution-transfer-verb-transfer-amount-min",
+ ("amount", component.MinimumTransferAmount.Int()));
+ data.CategoryData = VerbCategories.SetTransferAmount;
+ }
+
+ protected override void Activate(IEntity user, SolutionTransferComponent component)
+ {
+ component.TransferAmount = component.MinimumTransferAmount;
+ user.PopupMessage(Loc.GetString("comp-solution-transfer-set-amount",
+ ("amount", component.TransferAmount.Int())));
+ }
+ }
+
+ [Verb]
+ public sealed class DefaultTransferVerb : Verb
+ {
+ protected override void GetData(IEntity user, SolutionTransferComponent component, VerbData data)
+ {
+ if (!EntitySystem.Get().CanInteract(user) || !component.CanChangeTransferAmount)
+ {
+ data.Visibility = VerbVisibility.Invisible;
+ return;
+ }
+
+ var amt = component.SubjectiveBestTransferAmount();
+ if (amt > component.MinimumTransferAmount && amt < component.MaximumTransferAmount)
+ {
+ data.Visibility = VerbVisibility.Visible;
+ data.Text = Loc.GetString("comp-solution-transfer-verb-transfer-amount-ideal",
+ ("amount", amt.Int()));
+ data.CategoryData = VerbCategories.SetTransferAmount;
+ }
+ else
+ {
+ data.Visibility = VerbVisibility.Invisible;
+ }
+ }
+
+ protected override void Activate(IEntity user, SolutionTransferComponent component)
+ {
+ component.TransferAmount = component.SubjectiveBestTransferAmount();
+ user.PopupMessage(Loc.GetString("comp-solution-transfer-set-amount", ("amount", component.TransferAmount.Int())));
+ }
+ }
+
+ [Verb]
+ public sealed class MaximumTransferVerb : Verb
+ {
+ protected override void GetData(IEntity user, SolutionTransferComponent component, VerbData data)
+ {
+ if (!EntitySystem.Get().CanInteract(user) || !component.CanChangeTransferAmount)
+ {
+ data.Visibility = VerbVisibility.Invisible;
+ return;
+ }
+
+ data.Visibility = VerbVisibility.Visible;
+ data.Text = Loc.GetString("comp-solution-transfer-verb-transfer-amount-max",
+ ("amount", component.MaximumTransferAmount));
+ data.CategoryData = VerbCategories.SetTransferAmount;
+ }
+
+ protected override void Activate(IEntity user, SolutionTransferComponent component)
+ {
+ component.TransferAmount = component.MaximumTransferAmount;
+ user.PopupMessage(Loc.GetString("comp-solution-transfer-set-amount", ("amount", component.TransferAmount.Int())));
+ }
+ }
+
+ [Verb]
+ public sealed class CustomTransferVerb : Verb
+ {
+ protected override void GetData(IEntity user, SolutionTransferComponent component, VerbData data)
+ {
+ if (!EntitySystem.Get().CanInteract(user) || !component.CanChangeTransferAmount)
+ {
+ data.Visibility = VerbVisibility.Invisible;
+ return;
+ }
+
+ data.Visibility = VerbVisibility.Visible;
+ data.Text = Loc.GetString("comp-solution-transfer-verb-transfer-amount-custom");
+ data.CategoryData = VerbCategories.SetTransferAmount;
+ }
+
+ protected override void Activate(IEntity user, SolutionTransferComponent component)
+ {
+ if (!user.TryGetComponent(out var actor))
+ {
+ return;
+ }
+ component.UserInterface?.Open(actor.PlayerSession);
+ }
+ }
}
}
diff --git a/Content.Shared/Chemistry/SharedTransferAmount.cs b/Content.Shared/Chemistry/SharedTransferAmount.cs
new file mode 100644
index 0000000000..b983d1ed5f
--- /dev/null
+++ b/Content.Shared/Chemistry/SharedTransferAmount.cs
@@ -0,0 +1,37 @@
+using System;
+using Content.Shared.Chemistry.Reagent;
+using Robust.Shared.GameObjects;
+using Robust.Shared.Serialization;
+
+namespace Content.Shared.Chemistry
+{
+ [Serializable, NetSerializable]
+ public class TransferAmountBoundInterfaceState : BoundUserInterfaceState
+ {
+ public ReagentUnit Max;
+ public ReagentUnit Min;
+
+ public TransferAmountBoundInterfaceState(ReagentUnit max, ReagentUnit min)
+ {
+ Max = max;
+ Min = min;
+ }
+ }
+
+ [Serializable, NetSerializable]
+ public class TransferAmountSetValueMessage : BoundUserInterfaceMessage
+ {
+ public ReagentUnit Value;
+
+ public TransferAmountSetValueMessage(ReagentUnit value)
+ {
+ Value = value;
+ }
+ }
+
+ [Serializable, NetSerializable]
+ public enum TransferAmountUiKey
+ {
+ Key,
+ }
+}
diff --git a/Content.Shared/Verbs/VerbCategories.cs b/Content.Shared/Verbs/VerbCategories.cs
index 287cf3d85b..89c268f793 100644
--- a/Content.Shared/Verbs/VerbCategories.cs
+++ b/Content.Shared/Verbs/VerbCategories.cs
@@ -11,5 +11,7 @@ namespace Content.Shared.Verbs
public static readonly VerbCategoryData Rotate = ("Rotate", null);
public static readonly VerbCategoryData Construction = ("Construction", null);
+ public static readonly VerbCategoryData SetTransferAmount =
+ ("Set Transfer Amount", "/Textures/Interface/VerbIcons/spill.svg.192dpi.png");
}
}
diff --git a/Resources/Locale/en-US/chemistry/components/solution-transfer-component.ftl b/Resources/Locale/en-US/chemistry/components/solution-transfer-component.ftl
index 414113c034..b40c8b3f37 100644
--- a/Resources/Locale/en-US/chemistry/components/solution-transfer-component.ftl
+++ b/Resources/Locale/en-US/chemistry/components/solution-transfer-component.ftl
@@ -1,5 +1,18 @@
-solution-transfer-component-fill-to-brim-message = You fill {$owner} to the brim with {$amount}u from {$target}
-solution-transfer-component-fill--message = You fill {$owner} with {$amount}u from {$target}
-solution-transfer-component-transfer-success-message = You transfer {$amount}u to {$target}.
-solution-transfer-component-do-transfer-component-is-empty = {$entity} is empty!
-solution-transfer-component-do-transfer-component-is-full = {$entity} is full!
\ No newline at end of file
+### Solution transfer component
+
+comp-solution-transfer-fill-normal = You fill {THE($target)} with {$amount}u from {THE($owner)}.
+comp-solution-transfer-fill-fully = You fill {THE($target)} to the brim with {$amount}u from {THE($owner)}.
+comp-solution-transfer-transfer-solution = You transfer {$amount}u to {THE($target)}.
+
+## Displayed when trying to transfer to a solution, but either the giver is empty or the taker is full
+comp-solution-transfer-is-empty = {THE($target)} is empty!
+comp-solution-transfer-is-full = {THE($target)} is full!
+
+## Displayed in change transfer amount verb's name
+comp-solution-transfer-verb-transfer-amount-min = {$amount}u
+comp-solution-transfer-verb-transfer-amount-max = {$amount}u
+comp-solution-transfer-verb-transfer-amount-ideal = {$amount}u
+comp-solution-transfer-verb-transfer-amount-custom = Custom
+
+## Displayed after you successfully change a solution's amount using the BUI
+comp-solution-transfer-set-amount = Transfer amount set to {$amount}u.
diff --git a/Resources/Locale/en-US/ui/transfer-amount.ftl b/Resources/Locale/en-US/ui/transfer-amount.ftl
new file mode 100644
index 0000000000..a1f549d934
--- /dev/null
+++ b/Resources/Locale/en-US/ui/transfer-amount.ftl
@@ -0,0 +1,13 @@
+### Loc for the transfer amount eui window
+
+## Title
+
+ui-transfer-amount-title = Change Transfer Amount
+
+## Text for the button to apply changes
+
+ui-transfer-amount-apply = Set Amount
+
+## Placeholder text for the amount line edit
+
+ui-transfer-amount-line-edit-placeholder = Amount
diff --git a/Resources/Prototypes/Entities/Objects/Consumable/Food/Containers/condiments.yml b/Resources/Prototypes/Entities/Objects/Consumable/Food/Containers/condiments.yml
index bf5e850d3e..51b70bb466 100644
--- a/Resources/Prototypes/Entities/Objects/Consumable/Food/Containers/condiments.yml
+++ b/Resources/Prototypes/Entities/Objects/Consumable/Food/Containers/condiments.yml
@@ -14,7 +14,7 @@
- type: SolutionContainer
maxVol: 10
- type: SolutionTransfer
- transferAmount: 5
+ maxTransferAmount: 10
- type: Sprite
netsync: false
sprite: Objects/Consumable/Food/condiments.rsi
@@ -313,7 +313,7 @@
- type: SolutionContainer
maxVol: 30
- type: SolutionTransfer
- transferAmount: 5
+ maxTransferAmount: 30
- type: Sprite
netsync: false
sprite: Objects/Consumable/Food/condiments.rsi
@@ -448,7 +448,7 @@
- type: SolutionContainer
maxVol: 15
- type: SolutionTransfer
- transferAmount: 5
+ maxTransferAmount: 15
- type: Sprite
netsync: false
sprite: Objects/Consumable/Food/condiments.rsi
diff --git a/Resources/Prototypes/Entities/Objects/Consumable/Food/ingredients.yml b/Resources/Prototypes/Entities/Objects/Consumable/Food/ingredients.yml
index e3964dc17f..59703f8286 100644
--- a/Resources/Prototypes/Entities/Objects/Consumable/Food/ingredients.yml
+++ b/Resources/Prototypes/Entities/Objects/Consumable/Food/ingredients.yml
@@ -27,7 +27,6 @@
- type: SolutionContainer
maxVol: 50
- type: SolutionTransfer
- transferAmount: 5
- type: Drink
openSounds: packetOpenSounds
useSound: /Audio/Items/eating_1.ogg
diff --git a/Resources/Prototypes/Entities/Objects/Consumable/drinks.yml b/Resources/Prototypes/Entities/Objects/Consumable/drinks.yml
index 40b85500dc..c11de84171 100644
--- a/Resources/Prototypes/Entities/Objects/Consumable/drinks.yml
+++ b/Resources/Prototypes/Entities/Objects/Consumable/drinks.yml
@@ -9,11 +9,15 @@
- type: SolutionContainer
maxVol: 50
- type: SolutionTransfer
- transferAmount: 5
+ canChangeTransferAmount: true
- type: Drink
- type: Sprite
state: icon
- type: Spillable
+ - type: UserInterface
+ interfaces:
+ - key: enum.TransferAmountUiKey.Key
+ type: TransferAmountBoundUserInterface
- type: entity
parent: DrinkBase
@@ -56,8 +60,12 @@
- type: SolutionContainer
maxVol: 50
- type: SolutionTransfer
- transferAmount: 5
+ canChangeTransferAmount: true
- type: TransformableContainer
+ - type: UserInterface
+ interfaces:
+ - key: enum.TransferAmountUiKey.Key
+ type: TransferAmountBoundUserInterface
- type: entity
parent: DrinkGlassBase
diff --git a/Resources/Prototypes/Entities/Objects/Consumable/drinks_bottles.yml b/Resources/Prototypes/Entities/Objects/Consumable/drinks_bottles.yml
index 6404d0b891..fb0c40b4f8 100644
--- a/Resources/Prototypes/Entities/Objects/Consumable/drinks_bottles.yml
+++ b/Resources/Prototypes/Entities/Objects/Consumable/drinks_bottles.yml
@@ -8,7 +8,11 @@
- type: SolutionContainer
maxVol: 100
- type: SolutionTransfer
- transferAmount: 5
+ canChangeTransferAmount: true
+ - type: UserInterface
+ interfaces:
+ - key: enum.TransferAmountUiKey.Key
+ type: TransferAmountBoundUserInterface
- type: Sprite
state: icon
- type: DamageOnLand
diff --git a/Resources/Prototypes/Entities/Objects/Consumable/drinks_cans.yml b/Resources/Prototypes/Entities/Objects/Consumable/drinks_cans.yml
index 74560880ac..0999937871 100644
--- a/Resources/Prototypes/Entities/Objects/Consumable/drinks_cans.yml
+++ b/Resources/Prototypes/Entities/Objects/Consumable/drinks_cans.yml
@@ -14,7 +14,12 @@
- ReagentId: Cola
Quantity: 20
- type: SolutionTransfer
- transferAmount: 5
+ canChangeTransferAmount: true
+ maxTransferAmount: 10
+ - type: UserInterface
+ interfaces:
+ - key: enum.TransferAmountUiKey.Key
+ type: TransferAmountBoundUserInterface
- type: Sprite
state: icon
diff --git a/Resources/Prototypes/Entities/Objects/Consumable/drinks_cups.yml b/Resources/Prototypes/Entities/Objects/Consumable/drinks_cups.yml
index 2122b384d9..1803334384 100644
--- a/Resources/Prototypes/Entities/Objects/Consumable/drinks_cups.yml
+++ b/Resources/Prototypes/Entities/Objects/Consumable/drinks_cups.yml
@@ -8,7 +8,12 @@
- type: SolutionContainer
maxVol: 20
- type: SolutionTransfer
- transferAmount: 5
+ canChangeTransferAmount: true
+ maxTransferAmount: 10
+ - type: UserInterface
+ interfaces:
+ - key: enum.TransferAmountUiKey.Key
+ type: TransferAmountBoundUserInterface
- type: Drink
isOpen: true
- type: Sprite
diff --git a/Resources/Prototypes/Entities/Objects/Consumable/trash_drinks.yml b/Resources/Prototypes/Entities/Objects/Consumable/trash_drinks.yml
index ab854aa184..25c6f54d7c 100644
--- a/Resources/Prototypes/Entities/Objects/Consumable/trash_drinks.yml
+++ b/Resources/Prototypes/Entities/Objects/Consumable/trash_drinks.yml
@@ -9,14 +9,19 @@
- type: LoopingSound
- type: Sprite
state: icon
-
- type: SolutionContainer
maxVol: 10
- type: SolutionTransfer
- transferAmount: 5
+ canChangeTransferAmount: true
+ maxTransferAmount: 5
- type: Drink
isOpen: true
- type: Spillable
+ - type: UserInterface
+ interfaces:
+ - key: enum.TransferAmountUiKey.Key
+ type: TransferAmountBoundUserInterface
+
# Containers
diff --git a/Resources/Prototypes/Entities/Objects/Specific/Janitorial/spray.yml b/Resources/Prototypes/Entities/Objects/Specific/Janitorial/spray.yml
index 6bec76ccb7..98e3f1d3eb 100644
--- a/Resources/Prototypes/Entities/Objects/Specific/Janitorial/spray.yml
+++ b/Resources/Prototypes/Entities/Objects/Specific/Janitorial/spray.yml
@@ -18,7 +18,6 @@
maxVol: 100
caps: Refillable, Drainable
- type: SolutionTransfer
- transferAmount: 5.0
- type: Spillable
- type: ItemCooldown
- type: Spray
diff --git a/Resources/Prototypes/Entities/Objects/Specific/chemistry-bottles.yml b/Resources/Prototypes/Entities/Objects/Specific/chemistry-bottles.yml
index a00d264ce3..c6ef1a8215 100644
--- a/Resources/Prototypes/Entities/Objects/Specific/chemistry-bottles.yml
+++ b/Resources/Prototypes/Entities/Objects/Specific/chemistry-bottles.yml
@@ -18,7 +18,12 @@
maxVol: 30
caps: OpenContainer
- type: SolutionTransfer
- transferAmount: 5
+ maxTransferAmount: 30
+ canChangeTransferAmount: true
+ - type: UserInterface
+ interfaces:
+ - key: enum.TransferAmountUiKey.Key
+ type: TransferAmountBoundUserInterface
- type: Item
sprite: Objects/Specific/Chemistry/beaker.rsi
- type: Spillable
diff --git a/Resources/Prototypes/Entities/Objects/Specific/chemistry.yml b/Resources/Prototypes/Entities/Objects/Specific/chemistry.yml
index 246b408fdb..ccde62dfbd 100644
--- a/Resources/Prototypes/Entities/Objects/Specific/chemistry.yml
+++ b/Resources/Prototypes/Entities/Objects/Specific/chemistry.yml
@@ -12,7 +12,7 @@
netsync: false
layers:
- state: beaker
- - state: beaker1
+ - state: beaker1
map: ["enum.SolutionContainerLayers.Fill"]
visible: false
- type: Item
@@ -21,7 +21,11 @@
maxVol: 50
caps: OpenContainer, FitsInDispenser # can add and remove solutions and fits in the chemmaster.
- type: SolutionTransfer
- transferAmount: 5.0
+ canChangeTransferAmount: true
+ - type: UserInterface
+ interfaces:
+ - key: enum.TransferAmountUiKey.Key
+ type: TransferAmountBoundUserInterface
- type: Spillable
- type: Drink
isOpen: true
@@ -62,7 +66,7 @@
sprite: Objects/Specific/Chemistry/beaker_large.rsi
layers:
- state: beakerlarge
- - state: beakerlarge1
+ - state: beakerlarge1
map: ["enum.SolutionContainerLayers.Fill"]
visible: false
- type: Item
@@ -120,7 +124,14 @@
caps: OpenContainer
maxVol: 5
- type: SolutionTransfer
- transferAmount: 5.0
+ minTransferAmount: 1
+ transferAmount: 1
+ maxTransferAmount: 5
+ canChangeTransferAmount: true
+ - type: UserInterface
+ interfaces:
+ - key: enum.TransferAmountUiKey.Key
+ type: TransferAmountBoundUserInterface
- type: Spillable
- type: Item
sprite: Objects/Specific/Chemistry/dropper.rsi
@@ -140,7 +151,7 @@
sprite: Objects/Specific/Chemistry/syringe.rsi
netsync: false
layers:
- - state: syringe1
+ - state: syringe1
map: ["enum.SolutionContainerLayers.Fill"]
visible: false
- state: syringe_base0
@@ -155,7 +166,7 @@
- type: Appearance
visuals:
# this visualizer used for reagent inside
- - type: SolutionContainerVisualizer
+ - type: SolutionContainerVisualizer
maxFillLevels: 4
fillBaseName: syringe
# this one for syrigine itself (plunger)
diff --git a/Resources/Prototypes/Entities/Objects/Tools/bucket.yml b/Resources/Prototypes/Entities/Objects/Tools/bucket.yml
index 893a9baaa2..9646bdce26 100644
--- a/Resources/Prototypes/Entities/Objects/Tools/bucket.yml
+++ b/Resources/Prototypes/Entities/Objects/Tools/bucket.yml
@@ -20,6 +20,13 @@
maxVol: 500
- type: SolutionTransfer
transferAmount: 50
+ maxTransferAmount: 100
+ minTransferAmount: 10
+ canChangeTransferAmount: true
+ - type: UserInterface
+ interfaces:
+ - key: enum.TransferAmountUiKey.Key
+ type: TransferAmountBoundUserInterface
- type: Physics
bodyType: Dynamic
fixtures:
diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Cartridges/shotgun.yml b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Cartridges/shotgun.yml
index 4252beb65c..d8be2765fa 100644
--- a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Cartridges/shotgun.yml
+++ b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Cartridges/shotgun.yml
@@ -101,3 +101,4 @@
maxVol: 15
caps: Refillable, Drainable
- type: SolutionTransfer
+ maxTransferAmount: 15
diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Melee/spear.yml b/Resources/Prototypes/Entities/Objects/Weapons/Melee/spear.yml
index f28dfe0ff6..343ae38299 100644
--- a/Resources/Prototypes/Entities/Objects/Weapons/Melee/spear.yml
+++ b/Resources/Prototypes/Entities/Objects/Weapons/Melee/spear.yml
@@ -27,6 +27,7 @@
caps: Refillable
maxVol: 5
- type: SolutionTransfer
+ maxTransferAmount: 5
- type: MeleeWeaponAnimation
id: spear