Skip to content

Commit 71a54b7

Browse files
VMSolidusdeltanedasBurningRash
authored
* glacier real * troll * atmosia tweaks * 1 less can of plasma not too op * replace troll generator with solar crate * add StationSurface to glacier * add surface map * biome stuff upstream #28017 * unpause after loading * fix no terrain * comment out the surface spawning * shipyard * glacier justiceroid * updateprototype and cleanup * fix random shit * untroll * courier * add to test :trollface: * fix * futureproofing * hot loop inlet lmao * tweak some pumps in atmosia * carpy and make salv locker lighting better * Edit lights, move salv dock, add justice maints, edit entity names for casing consistency, other minor edits --------- <!-- This is a semi-strict format, you can add/remove sections as needed but the order/format should be kept the same Remove these comments before submitting --> # Description Ports Glacier from DeltaV. Justice department has been yeeted. # Changelog 🆑 - add: Glacier Returns. --------- Co-authored-by: deltanedas <[email protected]> Co-authored-by: Velcroboy <[email protected]>
1 parent 0feb56e commit 71a54b7

6 files changed

Lines changed: 113347 additions & 0 deletions

File tree

Content.IntegrationTests/Tests/PostMapInitTest.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ public sealed class PostMapInitTest
5555
"Tortuga", //DeltaV
5656
"Arena", //DeltaV
5757
"Asterisk", //DeltaV
58+
"Glacier", //DeltaV
5859
"TheHive", //DeltaV
5960
"Hammurabi", //DeltaV
6061
"Lighthouse", //DeltaV
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
using Content.Server.Station.Systems;
2+
using Robust.Shared.Utility;
3+
4+
namespace Content.Server.Station.Components;
5+
6+
/// <summary>
7+
/// Loads a surface map on mapinit.
8+
/// </summary>
9+
[RegisterComponent, Access(typeof(StationSurfaceSystem))]
10+
public sealed partial class StationSurfaceComponent : Component
11+
{
12+
/// <summary>
13+
/// Path to the map to load.
14+
/// </summary>
15+
[DataField(required: true)]
16+
public ResPath? MapPath;
17+
18+
/// <summary>
19+
/// The map that was loaded.
20+
/// </summary>
21+
[DataField]
22+
public EntityUid? Map;
23+
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
using Content.Server.Parallax;
2+
using Content.Server.Station.Components;
3+
using Robust.Server.GameObjects;
4+
5+
namespace Content.Server.Station.Systems;
6+
7+
public sealed class StationSurfaceSystem : EntitySystem
8+
{
9+
[Dependency] private readonly BiomeSystem _biome = default!;
10+
[Dependency] private readonly MapSystem _map = default!;
11+
[Dependency] private readonly MapLoaderSystem _mapLoader = default!;
12+
13+
public override void Initialize()
14+
{
15+
base.Initialize();
16+
17+
SubscribeLocalEvent<StationSurfaceComponent, MapInitEvent>(OnMapInit);
18+
}
19+
20+
private void OnMapInit(Entity<StationSurfaceComponent> ent, ref MapInitEvent args)
21+
{
22+
if (ent.Comp.MapPath is not {} path)
23+
return;
24+
25+
var map = _map.CreateMap(out var mapId);
26+
if (!_mapLoader.TryLoad(mapId, path.ToString(), out _))
27+
{
28+
Log.Error($"Failed to load surface map {ent.Comp.MapPath}!");
29+
Del(map);
30+
return;
31+
}
32+
33+
// loading replaced the map entity with a new one so get the latest id
34+
map = _map.GetMap(mapId);
35+
_map.SetPaused(map, false);
36+
37+
// Needs a cherrypick, but this system is unused entirely for now
38+
//_biome.SetEnabled(map); // generate the terrain after the grids loaded to prevent it getting hidden under it
39+
ent.Comp.Map = map;
40+
}
41+
}

0 commit comments

Comments
 (0)