Skip to content

Commit eda3d7d

Browse files
Merge branch 'starlight-dev' into nitriumening
2 parents 3ee8e4e + ad9f3c9 commit eda3d7d

535 files changed

Lines changed: 31788 additions & 34161 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Content.Client/Chemistry/Containers/EntitySystems/SolutionContainerSystem.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,4 @@
22

33
namespace Content.Client.Chemistry.Containers.EntitySystems;
44

5-
public sealed partial class SolutionContainerSystem : SharedSolutionContainerSystem
6-
{
7-
}
5+
public sealed partial class SolutionContainerSystem : SharedSolutionContainerSystem;

Content.Client/Chemistry/EntitySystems/ChemistryGuideDataSystem.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,8 @@ private void OnPrototypesReloaded(PrototypesReloadedEventArgs? ev)
116116
}
117117

118118

119-
if (extractableComponent.GrindableSolution is { } grindableSolutionId &&
120-
entProto.TryGetComponent<SolutionContainerManagerComponent>(out var manager, EntityManager.ComponentFactory) &&
121-
_solutionContainer.TryGetSolution(manager, grindableSolutionId, out var grindableSolution))
119+
if (extractableComponent.GrindableSolutionName is { } grindableSolutionId &&
120+
_solutionContainer.TryGetSolution(entProto, grindableSolutionId, out var grindableSolution))
122121
{
123122
var data = new ReagentEntitySourceData(
124123
new() { DefaultGrindCategory },

Content.Client/Chemistry/UI/ChemMasterWindow.xaml.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,10 @@ private List<ReagentButton> CreateReagentTransferButtons(ReagentId reagent, bool
138138
("10", ChemMasterReagentAmount.U10, StyleClass.ButtonOpenBoth),
139139
("15", ChemMasterReagentAmount.U15, StyleClass.ButtonOpenBoth),
140140
("20", ChemMasterReagentAmount.U20, StyleClass.ButtonOpenBoth),
141-
("25", ChemMasterReagentAmount.U25, StyleClass.ButtonOpenBoth),
142141
("30", ChemMasterReagentAmount.U30, StyleClass.ButtonOpenBoth),
143-
("50", ChemMasterReagentAmount.U50, StyleClass.ButtonOpenBoth),
144-
("100", ChemMasterReagentAmount.U100, StyleClass.ButtonOpenBoth),
142+
("40", ChemMasterReagentAmount.U40, StyleClass.ButtonOpenBoth),
143+
("60", ChemMasterReagentAmount.U60, StyleClass.ButtonOpenBoth),
144+
("120", ChemMasterReagentAmount.U120, StyleClass.ButtonOpenBoth),
145145
(Loc.GetString("chem-master-window-buffer-all-amount"), ChemMasterReagentAmount.All, StyleClass.ButtonOpenLeft),
146146
};
147147

Content.Client/Chemistry/UI/ReagentDispenserWindow.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
Columns="3"
1616
HorizontalAlignment="Center"
1717
Margin="5"
18-
ButtonList="1,5,10,15,20,25,30,50,100"
18+
ButtonList="1,5,10,15,20,30,40,60,120"
1919
RadioGroup="True">
2020
</ui:ButtonGrid>
2121
<!-- Starlight-start -->

Content.Client/Players/PlayTimeTracking/JobRequirementsManager.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public void Initialize()
6060

6161
// NullLink start
6262
_net.RegisterNetMessage<MsgUpdatePlayerPlayTime>(Update);
63-
_achievements.AchievementsUpdated += OnAchievementsUpdated;
63+
_achievements.AchievementUnlocked += OnAchievementsUnlocked;
6464
_cfg.OnValueChanged(NullLinkCCVars.Project, OnProjectChanged, true);
6565
_cfg.OnValueChanged(NullLinkCCVars.Server, OnServerChanged, true);
6666
// NullLink end
@@ -121,7 +121,7 @@ private void MergePlayTime()
121121
Updated?.Invoke();
122122
}
123123

124-
private void OnAchievementsUpdated()
124+
private void OnAchievementsUnlocked(string achievement)
125125
=> Updated?.Invoke();
126126
// Nulllink end
127127

Content.Client/_Starlight/Kitchen/EntitySystems/SharpSystem.cs

Lines changed: 0 additions & 10 deletions
This file was deleted.

Content.Client/_Starlight/Plumbing/UI/PlumbingSmartDispenserWindow.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
Columns="3"
1515
HorizontalAlignment="Center"
1616
Margin="5 4"
17-
ButtonList="1,5,10,15,20,25,30,50,100"
17+
ButtonList="1,5,10,15,20,30,40,60,120"
1818
RadioGroup="True" />
1919

2020
<Control VerticalExpand="True" />

Content.IntegrationTests/Tests/CargoTest.cs

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
using Content.IntegrationTests.Fixtures;
55
using Content.Server.Cargo.Components;
66
using Content.Server.Cargo.Systems;
7-
using Content.Server.Nutrition.Components;
8-
using Content.Server.Nutrition.EntitySystems;
97
using Content.Shared.Cargo.Components;
108
using Content.Shared.Cargo.Prototypes;
119
using Content.Shared.Mobs.Components;
@@ -15,6 +13,8 @@
1513
using Robust.Shared.GameObjects;
1614
using Robust.Shared.Map;
1715
using Robust.Shared.Prototypes;
16+
using Content.Shared.Storage;
17+
using Content.Shared.Tools.Components;
1818

1919
namespace Content.IntegrationTests.Tests;
2020

@@ -153,7 +153,6 @@ public async Task NoSliceableBountyArbitrageTest()
153153
var componentFactory = server.ResolveDependency<IComponentFactory>();
154154
var whitelist = entManager.System<EntityWhitelistSystem>();
155155
var cargo = entManager.System<CargoSystem>();
156-
var sliceableSys = entManager.System<SliceableFoodSystem>();
157156

158157
var bounties = protoManager.EnumeratePrototypes<CargoBountyPrototype>().ToList();
159158

@@ -166,14 +165,14 @@ await server.WaitAssertion(() =>
166165
var sliceableEntityProtos = protoManager.EnumeratePrototypes<EntityPrototype>()
167166
.Where(p => !p.Abstract)
168167
.Where(p => !pair.IsTestPrototype(p))
169-
.Where(p => p.TryGetComponent<SliceableFoodComponent>(out _, componentFactory))
168+
.Where(p => p.TryGetComponent<ToolRefinableComponent>(out _, componentFactory))
170169
.Select(p => p.ID)
171170
.ToList();
172171

173172
foreach (var proto in sliceableEntityProtos)
174173
{
175174
var ent = entManager.SpawnEntity(proto, coord);
176-
var sliceable = entManager.GetComponent<SliceableFoodComponent>(ent);
175+
var sliceable = entManager.GetComponent<ToolRefinableComponent>(ent);
177176

178177
// Check each bounty
179178
foreach (var bounty in bounties)
@@ -186,19 +185,32 @@ await server.WaitAssertion(() =>
186185
continue;
187186

188187
// Spawn a slice
189-
var slice = entManager.SpawnEntity(sliceable.Slice, coord);
190188

191-
// See if the slice also counts for this bounty entry
192-
if (!cargo.IsValidBountyEntry(slice, entry))
189+
var sliceCountByProtoId = EntitySpawnCollection.GetSpawns(sliceable.RefineResult)
190+
.GroupBy(x => x)
191+
.ToDictionary(x => x.Key, x => x.Count());
192+
193+
foreach (var (sliceProtoId, sliceCount) in sliceCountByProtoId)
193194
{
194-
entManager.DeleteEntity(slice);
195-
continue;
196-
}
195+
var slice = entManager.SpawnEntity(sliceProtoId, coord);
197196

198-
entManager.DeleteEntity(slice);
197+
// See if the slice also counts for this bounty entry
198+
if (!cargo.IsValidBountyEntry(slice, entry))
199+
{
200+
entManager.DeleteEntity(slice);
201+
continue;
202+
}
199203

200-
// If for some reason it can only make one slice, that's okay, I guess
201-
Assert.That(sliceable.TotalCount, Is.EqualTo(1), $"{proto} counts as part of cargo bounty {bounty.ID} and slices into {sliceable.TotalCount} slices which count for the same bounty!");
204+
entManager.DeleteEntity(slice);
205+
206+
// If for some reason it can only make one slice, that's okay, I guess
207+
Assert.That(
208+
sliceCount,
209+
Is.EqualTo(1),
210+
$"{proto} counts as part of cargo bounty {bounty.ID} "
211+
+ $"and slices into {sliceCount} slices which count for the same bounty!"
212+
);
213+
}
202214
}
203215
}
204216

Content.IntegrationTests/Tests/Chemistry/DrainTest.cs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,19 @@ public sealed class DrainTest : InteractionTest
2020

2121
[TestPrototypes]
2222
private static readonly string Prototypes = @$"
23-
- type: entity
24-
parent: Puddle
25-
id: PuddleBloodTest
26-
suffix: Blood (30u)
27-
components:
28-
- type: SolutionContainerManager
29-
solutions:
30-
puddle:
31-
maxVol: 1000
32-
reagents:
33-
- ReagentId: {BloodReagent}
34-
Quantity: {PuddleVolume}
35-
";
23+
- type: entity
24+
parent: Puddle
25+
id: PuddleBloodTest
26+
suffix: Blood
27+
components:
28+
- type: Solution
29+
id: puddle
30+
solution:
31+
maxVol: 1000
32+
reagents:
33+
- ReagentId: {BloodReagent}
34+
Quantity: {PuddleVolume}
35+
";
3636

3737

3838
/// <summary>
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
using Content.IntegrationTests.Fixtures;
2+
using Content.IntegrationTests.Fixtures.Attributes;
3+
using Content.Shared.Chemistry.Components;
4+
using Content.Shared.Chemistry.EntitySystems;
5+
using Content.Shared.Chemistry.Reagent;
6+
using Content.Shared.FixedPoint;
7+
using Robust.Shared.GameObjects;
8+
using Robust.Shared.Prototypes;
9+
10+
namespace Content.IntegrationTests.Tests.Chemistry;
11+
12+
[TestFixture]
13+
[TestOf(typeof(SolutionRegenerationSystem))]
14+
[TestOf(typeof(SolutionPurgeSystem))]
15+
public sealed class SolutionPurgeRegenerationTests : GameTest
16+
{
17+
private static readonly EntProtoId AdvancedMop = "AdvMopItem";
18+
private static readonly ProtoId<ReagentPrototype> Water = "Water";
19+
private static readonly ProtoId<ReagentPrototype> NotWater = "DexalinPlus";
20+
21+
[SidedDependency(Side.Server)] private readonly SharedSolutionContainerSystem _solutionContainer = default!;
22+
23+
[Test]
24+
public async Task TestMop()
25+
{
26+
var testMap = await Pair.CreateTestMap();
27+
28+
EntityUid mop = default!;
29+
Entity<SolutionComponent> solution = default!;
30+
await Server.WaitPost(() =>
31+
{
32+
mop = SSpawnAtPosition(AdvancedMop, testMap.GridCoords);
33+
34+
var generated = SComp<SolutionRegenerationComponent>(mop).Generated;
35+
var purge = SComp<SolutionPurgeComponent>(mop);
36+
Assume.That(generated.ContainsPrototype(Water));
37+
Assume.That(purge.Preserve, Does.Not.Contain(NotWater));
38+
39+
40+
Assert.That(_solutionContainer.TryGetSolution(mop, "absorbed", out var mopSolution, out _));
41+
solution = mopSolution!.Value;
42+
Assert.That(_solutionContainer.AddSolution(solution, new Solution(NotWater, 50)), Is.EqualTo(FixedPoint2.New(50)));
43+
});
44+
45+
await PoolManager.WaitUntil(Server, () => !solution.Comp.Solution.ContainsPrototype(NotWater));
46+
await PoolManager.WaitUntil(Server, () => solution.Comp.Solution.Volume == solution.Comp.Solution.MaxVolume);
47+
}
48+
}

0 commit comments

Comments
 (0)