Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 18 additions & 15 deletions Content.Client/Chemistry/UI/ChemMasterWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
using System.Linq;
using System.Numerics;
using Content.Client.Stylesheets;
using Content.Client.UserInterface.Controls;
using Content.Shared.Chemistry;
using Content.Shared.Chemistry.Reagent;
using Content.Shared.FixedPoint;
using Robust.Client.AutoGenerated;
using Robust.Client.Graphics;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.XAML;
using Robust.Client.Utility;
using Robust.Shared.Prototypes;
using Robust.Shared.Utility;
using System.Linq;
using System.Numerics;
using Content.Shared.FixedPoint;
using Robust.Client.Graphics;
using static Robust.Client.UserInterface.Controls.BoxContainer;

namespace Content.Client.Chemistry.UI
Expand Down Expand Up @@ -47,14 +47,15 @@ public ChemMasterWindow()
{
// For every button decide which stylebase to have
// Every row has 10 buttons
String styleBase = StyleBase.ButtonOpenBoth;
uint modulo = i % 10;
if (i > 0 && modulo == 0)
styleBase = StyleBase.ButtonOpenRight;
else if (i > 0 && modulo == 9)
styleBase = StyleBase.ButtonOpenLeft;
else if (i == 0)
styleBase = StyleBase.ButtonOpenRight;
var styleBase = StyleBase.ButtonOpenBoth;
var modulo = i % 10;
styleBase = i switch
{
> 0 when modulo == 0 => StyleBase.ButtonOpenRight,
> 0 when modulo == 9 => StyleBase.ButtonOpenLeft,
0 => StyleBase.ButtonOpenRight,
_ => styleBase,
};

// Generate buttons
PillTypeButtons[i] = new Button
Expand All @@ -67,7 +68,7 @@ public ChemMasterWindow()

// Generate buttons textures
var specifier = new SpriteSpecifier.Rsi(resourcePath, "pill" + (i + 1));
TextureRect pillTypeTexture = new TextureRect
var pillTypeTexture = new TextureRect
{
Texture = specifier.Frame0(),
TextureScale = new Vector2(1.75f, 1.75f),
Expand Down Expand Up @@ -103,14 +104,16 @@ private ReagentButton MakeReagentButton(string text, ChemMasterReagentAmount amo
private List<ReagentButton> CreateReagentTransferButtons(ReagentId reagent, bool isBuffer, bool addReagentButtons)
{
if (!addReagentButtons)
return new List<ReagentButton>(); // Return an empty list if reagentTransferButton creation is disabled.
return []; // Return an empty list if reagentTransferButton creation is disabled.

var buttonConfigs = new (string text, ChemMasterReagentAmount amount, string styleClass)[]
{
("1", ChemMasterReagentAmount.U1, StyleBase.ButtonOpenBoth),
("5", ChemMasterReagentAmount.U5, StyleBase.ButtonOpenBoth),
("10", ChemMasterReagentAmount.U10, StyleBase.ButtonOpenBoth),
("15", ChemMasterReagentAmount.U15, StyleBase.ButtonOpenBoth),
("25", ChemMasterReagentAmount.U25, StyleBase.ButtonOpenBoth),
("30", ChemMasterReagentAmount.U30, StyleBase.ButtonOpenBoth),
("50", ChemMasterReagentAmount.U50, StyleBase.ButtonOpenBoth),
("100", ChemMasterReagentAmount.U100, StyleBase.ButtonOpenBoth),
(Loc.GetString("chem-master-window-buffer-all-amount"), ChemMasterReagentAmount.All, StyleBase.ButtonOpenLeft),
Expand Down Expand Up @@ -392,7 +395,7 @@ private Control BuildReagentRow(Color reagentColor, int rowCount, string name, R
{
rowContainer.AddChild(reagentTransferButton);
}
//Apply panencontainer to allow for striped rows
//Apply PanelContainer to allow for striped rows
return new PanelContainer
{
PanelOverride = new StyleBoxFlat(currentRowColor),
Expand Down
16 changes: 10 additions & 6 deletions Content.Client/Chemistry/UI/ReagentDispenserWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ public void UpdateReagentsList(List<ReagentInventoryItem> inventory)

ReagentList.Children.Clear();
//Sort inventory by reagentLabel
inventory.Sort((x, y) => x.ReagentLabel.CompareTo(y.ReagentLabel));
inventory.Sort((x, y)
=> string.Compare(x.ReagentLabel, y.ReagentLabel, StringComparison.Ordinal));

foreach (var item in inventory)
{
Expand All @@ -59,7 +60,7 @@ public void UpdateReagentsList(List<ReagentInventoryItem> inventory)
/// <param name="state">State data sent by the server.</param>
public void UpdateState(BoundUserInterfaceState state)
{
var castState = (ReagentDispenserBoundUserInterfaceState) state;
var castState = (ReagentDispenserBoundUserInterfaceState)state;
UpdateContainerInfo(castState);
UpdateReagentsList(castState.Inventory);

Expand All @@ -77,8 +78,10 @@ public void UpdateState(BoundUserInterfaceState state)
/// Update the fill state and list of reagents held by the current reagent container, if applicable.
/// <para>Also highlights a reagent if it's dispense button is being mouse hovered.</para>
/// </summary>
/// <param name="state">State data for the dispenser.</param>
/// or null if no button is being hovered.</param>
/// <param name="state">
/// State data for the dispenser,
/// or null if no button is being hovered.
/// </param>
public void UpdateContainerInfo(ReagentDispenserBoundUserInterfaceState state)
{
ContainerInfo.Children.Clear();
Expand All @@ -87,7 +90,8 @@ public void UpdateContainerInfo(ReagentDispenserBoundUserInterfaceState state)
{
ContainerInfoName.Text = "";
ContainerInfoFill.Text = "";
ContainerInfo.Children.Add(new Label { Text = Loc.GetString("reagent-dispenser-window-no-container-loaded-text") });
ContainerInfo.Children.Add(new Label
{ Text = Loc.GetString("reagent-dispenser-window-no-container-loaded-text") });
return;
}

Expand Down Expand Up @@ -116,7 +120,7 @@ public void UpdateContainerInfo(ReagentDispenserBoundUserInterfaceState state)
{
nameLabel,
quantityLabel,
}
},
});
}
}
Expand Down
2 changes: 2 additions & 0 deletions Content.Shared/Chemistry/SharedChemMaster.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,9 @@ public enum ChemMasterReagentAmount
U1 = 1,
U5 = 5,
U10 = 10,
U15 = 15,
U25 = 25,
U30 = 30,
U50 = 50,
U100 = 100,
All,
Expand Down
4 changes: 3 additions & 1 deletion Resources/Locale/en-US/_Null/guidebook/guides_shipyard.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ guide-entry-shipyard-framework = The Humble Framework (Civil/Scrap)

# Expedition
guide-entry-shipyard-archon = Archon (Expedition)
guide-entry-shipyard-crapbucket = Crapbucket (Expedition)
guide-entry-shipyard-bossman = Bossman (Expedition)
guide-entry-shipyard-clam = Clam (Piracy)
guide-entry-shipyard-crapbucket = Crapbucket (Piracy)
guide-entry-shipyard-foxhunt = Foxhunt (Expedition)
guide-entry-shipyard-littora = Littora (Expedition)
guide-entry-shipyard-pisces = Pisces (Expedition)
Expand Down
6 changes: 5 additions & 1 deletion Resources/Locale/en-US/_Null/tiles.ftl
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
tiles-wood-parquet = wood parquet
tiles-wood-parquet = wood parquet
tiles-plasma-glass-floor = plasma glass floor
tiles-reinforced-plasma-glass-floor = reinforced plasma glass floor
tiles-uranium-glass-floor = uranium floor
tiles-reinforced-uranium-glass-floor = reinforced uranium floor
20 changes: 20 additions & 0 deletions Resources/Prototypes/Entities/Objects/Materials/Sheets/glass.yml
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,11 @@
- type: Construction
graph: Glass
node: SheetPGlass
# Frontier : Placable Plasma glass floor tile
- type: FloorTile
outputs:
- FloorPGlass
# End Frontier
- type: Destructible
thresholds:
- trigger:
Expand Down Expand Up @@ -298,6 +303,11 @@
map: ["base"]
- type: Item
heldPrefix: rpglass
# Frontier : Placable reinforced plasma glass floor tile
- type: FloorTile
outputs:
- FloorRPGlass
# End Frontier
- type: Construction
graph: Glass
node: SheetRPGlass
Expand Down Expand Up @@ -353,6 +363,11 @@
map: ["base"]
- type: Item
heldPrefix: uglass
# Frontier : Placable Uranium glass
- type: FloorTile
outputs:
- FloorUGlass
# End Frontier
- type: Construction
graph: Glass
node: SheetUGlass
Expand Down Expand Up @@ -427,6 +442,11 @@
map: ["base"]
- type: Item
heldPrefix: ruglass
# Frontier : Placable Reinforced Uranium Glass
- type: FloorTile
outputs:
- FloorRUGlass
# End Frontier
- type: Construction
graph: Glass
node: SheetRUGlass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,11 @@
fireRate: 2.5
- type: Item
sprite: Objects/Weapons/Guns/Battery/svalinn.rsi
size: Small
shape:
- 0,0,1,0
- 0,1,0,1
storedOffset: 0,-8
- type: MagazineVisuals
magState: mag
steps: 5
Expand Down
5 changes: 5 additions & 0 deletions Resources/Prototypes/_Null/Guidebook/shipyard_entries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,22 @@
- ShipyardArachnid
- ShipyardArchon
- ShipyardBison
- ShipyardBossman
- ShipyardBucket
- ShipyardCamper
- ShipyardClam
- ShipyardCrapbucket
- ShipyardClemency
- ShipyardColdcap
- ShipyardDuran
- ShipyardHelio
- ShipyardIapetus
- ShipyardInsight
- ShipyardJudiciary
- ShipyardLittora
- ShipyardMoonlight
- ShipyardNourishment
- ShipyardNugget
- ShipyardPulse
- ShipyardSabine
- ShipyardTorque
42 changes: 41 additions & 1 deletion Resources/Prototypes/_Null/Guidebook/shuttle_maps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,14 @@
- type: Sprite
state: bison

- type: entity
parent: ShuttleMapBase
id: ShuttleMapBossman
categories: [ HideSpawnMenu ]
components:
- type: Sprite
state: bossman

- type: entity
parent: ShuttleMapBase
id: ShuttleMapBucket
Expand All @@ -72,6 +80,22 @@
- type: Sprite
state: camper

- type: entity
parent: ShuttleMapBase
id: ShuttleMapClam
categories: [ HideSpawnMenu ]
components:
- type: Sprite
state: clam

- type: entity
parent: ShuttleMapBase
id: ShuttleMapCrapbucket
categories: [ HideSpawnMenu ]
components:
- type: Sprite
state: crapbucket

- type: entity
parent: ShuttleMapBase
id: ShuttleMapClemency
Expand All @@ -96,6 +120,14 @@
- type: Sprite
state: duran

- type: entity
parent: ShuttleMapBase
id: ShuttleMapLittora
categories: [ HideSpawnMenu ]
components:
- type: Sprite
state: littora

- type: entity
parent: ShuttleMapBase
id: ShuttleMapMoonlight
Expand All @@ -118,4 +150,12 @@
categories: [ HideSpawnMenu ]
components:
- type: Sprite
state: nugget
state: nugget

- type: entity
parent: ShuttleMapBase
id: ShuttleMapTorque
categories: [ HideSpawnMenu ]
components:
- type: Sprite
state: torque
7 changes: 6 additions & 1 deletion Resources/Prototypes/_Null/Shipyard/Expedition/Bossman.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,17 @@
category: small
group: Expedition
shuttlePath: /Maps/_Null/Shuttles/Expedition/bossman.yml
guidebookPage: null
guidebookPage: ShipyardBossman
class:
- Expedition
engine:
- Uranium

- type: guideEntry
id: ShipyardBossman
name: guide-entry-shipyard-bossman
text: "/ServerInfo/_Null/Guidebook/Shipyard/Bossman.xml"

- type: gameMap
id: Bossman
mapName: 'Bossman'
Expand Down
7 changes: 6 additions & 1 deletion Resources/Prototypes/_Null/Shipyard/Expedition/clam.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,17 @@
category: Small
group: Expedition
shuttlePath: /Maps/_Null/Shuttles/Expedition/clam.yml
guidebookPage: null
guidebookPage: ShipyardClam
class:
- Pirate
engine:
- Uranium

- type: guideEntry
id: ShipyardClam
name: guide-entry-shipyard-clam
text: "/ServerInfo/_Null/Guidebook/Shipyard/Clam.xml"

- type: gameMap
id: Clam
mapName: 'Clam'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,17 @@
category: Small
group: Expedition
shuttlePath: /Maps/_Null/Shuttles/Expedition/crapbucket.yml
guidebookPage: null
guidebookPage: ShipyardCrapbucket
class:
- Pirate
engine:
- Uranium

- type: guideEntry
id: ShipyardCrapbucket
name: guide-entry-shipyard-crapbucket
text: "/ServerInfo/_Null/Guidebook/Shipyard/Crapbucket.xml"

- type: gameMap
id: Crapbucket
mapName: 'Crapbucket'
Expand Down
7 changes: 6 additions & 1 deletion Resources/Prototypes/_Null/Shipyard/Expedition/littora.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,17 @@
category: Large
group: Expedition
shuttlePath: /Maps/_Null/Shuttles/Expedition/littora.yml
guidebookPage: null
guidebookPage: ShipyardLittora
class:
- Expedition
engine:
- AME

- type: guideEntry
id: ShipyardLittora
name: guide-entry-shipyard-littora
text: "/ServerInfo/_Null/Guidebook/Shipyard/Littora.xml"

- type: gameMap
id: Littora
mapName: 'Littora'
Expand Down
Loading
Loading