Skip to content

Commit

Permalink
glacier real (#1169)
Browse files Browse the repository at this point in the history
* 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

---------

Co-authored-by: deltanedas <@deltanedas:kde.org>
Co-authored-by: Velcroboy <[email protected]>
  • Loading branch information
2 people authored and VMSolidus committed Aug 13, 2024
1 parent e14bea6 commit bf98b3e
Show file tree
Hide file tree
Showing 6 changed files with 113,360 additions and 0 deletions.
1 change: 1 addition & 0 deletions Content.IntegrationTests/Tests/PostMapInitTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public sealed class PostMapInitTest
"Tortuga", //DeltaV
"Arena", //DeltaV
"Asterisk", //DeltaV
"Glacier", //DeltaV
"TheHive", //DeltaV
"Hammurabi", //DeltaV
"Lighthouse", //DeltaV
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using Content.Server.Station.Systems;
using Robust.Shared.Utility;

namespace Content.Server.Station.Components;

/// <summary>
/// Loads a surface map on mapinit.
/// </summary>
[RegisterComponent, Access(typeof(StationSurfaceSystem))]
public sealed partial class StationSurfaceComponent : Component
{
/// <summary>
/// Path to the map to load.
/// </summary>
[DataField(required: true)]
public ResPath? MapPath;

/// <summary>
/// The map that was loaded.
/// </summary>
[DataField]
public EntityUid? Map;
}
40 changes: 40 additions & 0 deletions Content.Server/DeltaV/Station/Systems/StationSurfaceSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
using Content.Server.Parallax;
using Content.Server.Station.Components;
using Robust.Server.GameObjects;

namespace Content.Server.Station.Systems;

public sealed class StationSurfaceSystem : EntitySystem
{
[Dependency] private readonly BiomeSystem _biome = default!;
[Dependency] private readonly MapSystem _map = default!;
[Dependency] private readonly MapLoaderSystem _mapLoader = default!;

public override void Initialize()
{
base.Initialize();

SubscribeLocalEvent<StationSurfaceComponent, MapInitEvent>(OnMapInit);
}

private void OnMapInit(Entity<StationSurfaceComponent> ent, ref MapInitEvent args)
{
if (ent.Comp.MapPath is not {} path)
return;

var map = _map.CreateMap(out var mapId);
if (!_mapLoader.TryLoad(mapId, path.ToString(), out _))
{
Log.Error($"Failed to load surface map {ent.Comp.MapPath}!");
Del(map);
return;
}

// loading replaced the map entity with a new one so get the latest id
map = _map.GetMap(mapId);
_map.SetPaused(map, false);

_biome.SetEnabled(map); // generate the terrain after the grids loaded to prevent it getting hidden under it

Check failure on line 37 in Content.Server/DeltaV/Station/Systems/StationSurfaceSystem.cs

View workflow job for this annotation

GitHub Actions / Test Packaging

'BiomeSystem' does not contain a definition for 'SetEnabled' and no accessible extension method 'SetEnabled' accepting a first argument of type 'BiomeSystem' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 37 in Content.Server/DeltaV/Station/Systems/StationSurfaceSystem.cs

View workflow job for this annotation

GitHub Actions / Test Packaging

'BiomeSystem' does not contain a definition for 'SetEnabled' and no accessible extension method 'SetEnabled' accepting a first argument of type 'BiomeSystem' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 37 in Content.Server/DeltaV/Station/Systems/StationSurfaceSystem.cs

View workflow job for this annotation

GitHub Actions / YAML Linter

'BiomeSystem' does not contain a definition for 'SetEnabled' and no accessible extension method 'SetEnabled' accepting a first argument of type 'BiomeSystem' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 37 in Content.Server/DeltaV/Station/Systems/StationSurfaceSystem.cs

View workflow job for this annotation

GitHub Actions / YAML Linter

'BiomeSystem' does not contain a definition for 'SetEnabled' and no accessible extension method 'SetEnabled' accepting a first argument of type 'BiomeSystem' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 37 in Content.Server/DeltaV/Station/Systems/StationSurfaceSystem.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

'BiomeSystem' does not contain a definition for 'SetEnabled' and no accessible extension method 'SetEnabled' accepting a first argument of type 'BiomeSystem' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 37 in Content.Server/DeltaV/Station/Systems/StationSurfaceSystem.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

'BiomeSystem' does not contain a definition for 'SetEnabled' and no accessible extension method 'SetEnabled' accepting a first argument of type 'BiomeSystem' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 37 in Content.Server/DeltaV/Station/Systems/StationSurfaceSystem.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

'BiomeSystem' does not contain a definition for 'SetEnabled' and no accessible extension method 'SetEnabled' accepting a first argument of type 'BiomeSystem' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 37 in Content.Server/DeltaV/Station/Systems/StationSurfaceSystem.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

'BiomeSystem' does not contain a definition for 'SetEnabled' and no accessible extension method 'SetEnabled' accepting a first argument of type 'BiomeSystem' could be found (are you missing a using directive or an assembly reference?)
ent.Comp.Map = map;
}
}
Loading

0 comments on commit bf98b3e

Please sign in to comment.