Adds missing gas canisters and improves the UI (#2794)

* Adds missing gas canisters and improves the UI

* Pad the label
This commit is contained in:
ike709
2020-12-21 04:52:50 -06:00
committed by GitHub
parent 5b60d24dcb
commit d9d168a324
3 changed files with 113 additions and 7 deletions

View File

@@ -111,5 +111,12 @@ namespace Content.Client.GameObjects.Components.Atmos
_window?.UpdateState(cast); _window?.UpdateState(cast);
} }
protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
if (!disposing) return;
_window?.Dispose();
}
} }
} }

View File

@@ -1,4 +1,4 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using Content.Shared.GameObjects.Components.Disposal; using Content.Shared.GameObjects.Components.Disposal;
@@ -54,7 +54,7 @@ namespace Content.Client.GameObjects.Components.Atmos
{ {
Children = Children =
{ {
new Label(){ Text = Loc.GetString("Label") }, new Label(){ Text = Loc.GetString("Label: ") },
(LabelInput = new LineEdit() { Text = Name, Editable = false, (LabelInput = new LineEdit() { Text = Name, Editable = false,
CustomMinimumSize = new Vector2(200, 30)}), CustomMinimumSize = new Vector2(200, 30)}),
(EditLabelBtn = new Button()), (EditLabelBtn = new Button()),
@@ -64,7 +64,7 @@ namespace Content.Client.GameObjects.Components.Atmos
{ {
Children = Children =
{ {
new Label {Text = Loc.GetString("Pressure:")}, new Label {Text = Loc.GetString("Pressure: ")},
(_pressure = new Label()) (_pressure = new Label())
} }
}, },
@@ -76,7 +76,7 @@ namespace Content.Client.GameObjects.Components.Atmos
{ {
Children = Children =
{ {
new Label() {Text = Loc.GetString("Release pressure:")}, new Label() {Text = Loc.GetString("Release pressure: ")},
(_releasePressure = new Label()) (_releasePressure = new Label())
} }
}, },
@@ -100,8 +100,8 @@ namespace Content.Client.GameObjects.Components.Atmos
{ {
Children = Children =
{ {
new Label { Text = Loc.GetString("Valve") }, new Label { Text = Loc.GetString("Valve: ") },
(ToggleValve = new CheckButton() { Text = Loc.GetString("Open") }) (ToggleValve = new CheckButton() { Text = Loc.GetString("Closed") })
} }
} }
}, },
@@ -121,7 +121,6 @@ namespace Content.Client.GameObjects.Components.Atmos
LabelInputEditable = false; LabelInputEditable = false;
} }
/// <summary> /// <summary>
/// Update the UI based on <see cref="GasCanisterBoundUserInterfaceState"/> /// Update the UI based on <see cref="GasCanisterBoundUserInterfaceState"/>
/// </summary> /// </summary>
@@ -140,6 +139,14 @@ namespace Content.Client.GameObjects.Components.Atmos
LabelInputEditable = false; LabelInputEditable = false;
ToggleValve.Pressed = state.ValveOpened; ToggleValve.Pressed = state.ValveOpened;
if (ToggleValve.Pressed)
{
ToggleValve.Text = Loc.GetString("Open");
}
else
{
ToggleValve.Text = Loc.GetString("Closed");
}
} }
} }

View File

@@ -60,6 +60,26 @@
- VaultImpassable - VaultImpassable
- SmallImpassable - SmallImpassable
- type: entity
parent: GasCanister
id: StorageCanister
name: Storage Canister
components:
- type: Sprite
sprite: Constructible/Atmos/canister.rsi
state: yellow # Classic toxins canister
- type: GasCanister
gasMixture:
volume: 1000
moles: # List of gasses for easy reference
- 0 # oxygen
- 0 # nitrogen
- 0 # CO2
- 0 # Phoron
- 0 # Tritium
- 0 # Water vapor
temperature: 293.15
# Filled canisters, contain 1871.71051 moles each # Filled canisters, contain 1871.71051 moles each
- type: entity - type: entity
@@ -93,6 +113,39 @@
- 1871.71051 # oxygen - 1871.71051 # oxygen
temperature: 293.15 temperature: 293.15
- type: entity
parent: GasCanister
id: NitrogenCanister
name: Nitrogen Canister
components:
- type: Sprite
sprite: Constructible/Atmos/canister.rsi
state: red
- type: GasCanister
gasMixture:
volume: 1000
moles:
- 0 # oxygen
- 1871.71051 # nitrogen
temperature: 293.15
- type: entity
parent: GasCanister
id: CarbonDioxideCanister
name: Carbon Dioxide Canister
components:
- type: Sprite
sprite: Constructible/Atmos/canister.rsi
state: black
- type: GasCanister
gasMixture:
volume: 1000
moles:
- 0 # oxygen
- 0 # nitrogen
- 1871.71051 # CO2
temperature: 293.15
- type: entity - type: entity
parent: GasCanister parent: GasCanister
id: PhoronCanister id: PhoronCanister
@@ -110,3 +163,42 @@
- 0 # carbon dioxide - 0 # carbon dioxide
- 1871.71051 # phoron - 1871.71051 # phoron
temperature: 293.15 temperature: 293.15
- type: entity
parent: GasCanister
id: TritiumCanister
name: Tritium Canister
components:
- type: Sprite
sprite: Constructible/Atmos/canister.rsi
state: green
- type: GasCanister
gasMixture:
volume: 1000
moles:
- 0 # oxygen
- 0 # nitrogen
- 0 # CO2
- 0 # Phoron
- 1871.71051 # Tritium
temperature: 293.15
- type: entity
parent: GasCanister
id: WaterVaporCanister
name: Water Vapor Canister
components:
- type: Sprite
sprite: Constructible/Atmos/canister.rsi
state: water_vapor
- type: GasCanister
gasMixture:
volume: 1000
moles:
- 0 # oxygen
- 0 # nitrogen
- 0 # CO2
- 0 # Phoron
- 0 # Tritium
- 1871.71051 # Water vapor
temperature: 293.15