Merge pull request #798 from PrPleGoo/DecimalReagents

Decimal reagents
This commit is contained in:
Pieter-Jan Briers
2020-04-12 23:04:24 +02:00
committed by GitHub
26 changed files with 685 additions and 238 deletions

View File

@@ -8,6 +8,7 @@ using Robust.Client.UserInterface.Controls;
using Robust.Shared.GameObjects;
using Robust.Shared.Localization;
using Robust.Shared.ViewVariables;
using Content.Shared.Chemistry;
namespace Content.Client.GameObjects.Components.Chemistry
{
@@ -17,8 +18,8 @@ namespace Content.Client.GameObjects.Components.Chemistry
[RegisterComponent]
public class InjectorComponent : SharedInjectorComponent, IItemStatus
{
[ViewVariables] private int CurrentVolume { get; set; }
[ViewVariables] private int TotalVolume { get; set; }
[ViewVariables] private ReagentUnit CurrentVolume { get; set; }
[ViewVariables] private ReagentUnit TotalVolume { get; set; }
[ViewVariables] private InjectorToggleMode CurrentMode { get; set; }
[ViewVariables(VVAccess.ReadWrite)] private bool _uiUpdateNeeded;
@@ -29,7 +30,7 @@ namespace Content.Client.GameObjects.Components.Chemistry
//Handle net updates
public override void HandleComponentState(ComponentState curState, ComponentState nextState)
{
var cast = (InjectorComponentState)curState;
var cast = (InjectorComponentState) curState;
if (cast != null)
{
CurrentVolume = cast.CurrentVolume;

View File

@@ -171,7 +171,7 @@ namespace Content.Client.GameObjects.Components.Chemistry
Title = castState.DispenserName;
UpdateContainerInfo(castState);
switch (castState.SelectedDispenseAmount)
switch (castState.SelectedDispenseAmount.Int())
{
case 1:
DispenseButton1.Pressed = true;