Biome rework (#37735)
* DungeonData rework Back to fields, serializes better, just make new layers dumby. * wawawewa * Fix this * Fixes * Port the work over * wawawewa * zoom * Kinda workin * Adjust wawa * Unloading work * Ore + entitytable fixes Iterate every dungeon not just last. * Big shot * wawawewa * Fixes * true * Fixes # Conflicts: # Content.Server/Procedural/DungeonJob/DungeonJob.cs * wawawewa * Fixes * Fix * Lot of work * wawawewa * Fixing * eh? * a * Fix a heap of stuff * Better ignored check * Reserve tile changes * biome * changes * wawawewa * Fixes & snow * Shadow fixes * wawawewa * smol * Add layer API * More work * wawawewa * Preloads and running again * wawawewa * Modified * Replacements and command * Runtime support * werk * Fix expeds + dungeon alltiles * reh --------- Co-authored-by: Nemanja <98561806+EmoGarbage404@users.noreply.github.com>
This commit is contained in:
@@ -1,87 +0,0 @@
|
||||
using System.Numerics;
|
||||
using System.Text;
|
||||
using Content.Shared.Parallax.Biomes;
|
||||
using Robust.Client.Graphics;
|
||||
using Robust.Client.Input;
|
||||
using Robust.Client.ResourceManagement;
|
||||
using Robust.Shared.Enums;
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Map.Components;
|
||||
|
||||
namespace Content.Client.Parallax;
|
||||
|
||||
public sealed class BiomeDebugOverlay : Overlay
|
||||
{
|
||||
public override OverlaySpace Space => OverlaySpace.ScreenSpace;
|
||||
|
||||
[Dependency] private readonly IEntityManager _entManager = default!;
|
||||
[Dependency] private readonly IEyeManager _eyeManager = default!;
|
||||
[Dependency] private readonly IInputManager _inputManager = default!;
|
||||
[Dependency] private readonly IResourceCache _cache = default!;
|
||||
[Dependency] private readonly ITileDefinitionManager _tileDefManager = default!;
|
||||
|
||||
private BiomeSystem _biomes;
|
||||
private SharedMapSystem _maps;
|
||||
|
||||
private Font _font;
|
||||
|
||||
public BiomeDebugOverlay()
|
||||
{
|
||||
IoCManager.InjectDependencies(this);
|
||||
|
||||
_biomes = _entManager.System<BiomeSystem>();
|
||||
_maps = _entManager.System<SharedMapSystem>();
|
||||
|
||||
_font = new VectorFont(_cache.GetResource<FontResource>("/EngineFonts/NotoSans/NotoSans-Regular.ttf"), 12);
|
||||
}
|
||||
|
||||
protected override bool BeforeDraw(in OverlayDrawArgs args)
|
||||
{
|
||||
var mapUid = _maps.GetMapOrInvalid(args.MapId);
|
||||
|
||||
return _entManager.HasComponent<BiomeComponent>(mapUid);
|
||||
}
|
||||
|
||||
protected override void Draw(in OverlayDrawArgs args)
|
||||
{
|
||||
var mouseScreenPos = _inputManager.MouseScreenPosition;
|
||||
var mousePos = _eyeManager.ScreenToMap(mouseScreenPos);
|
||||
|
||||
if (mousePos.MapId == MapId.Nullspace || mousePos.MapId != args.MapId)
|
||||
return;
|
||||
|
||||
var mapUid = _maps.GetMapOrInvalid(args.MapId);
|
||||
|
||||
if (!_entManager.TryGetComponent(mapUid, out BiomeComponent? biomeComp) || !_entManager.TryGetComponent(mapUid, out MapGridComponent? grid))
|
||||
return;
|
||||
|
||||
var sb = new StringBuilder();
|
||||
var nodePos = _maps.WorldToTile(mapUid, grid, mousePos.Position);
|
||||
|
||||
if (_biomes.TryGetEntity(nodePos, biomeComp, (mapUid, grid), out var ent))
|
||||
{
|
||||
var text = $"Entity: {ent}";
|
||||
sb.AppendLine(text);
|
||||
}
|
||||
|
||||
if (_biomes.TryGetDecals(nodePos, biomeComp.Layers, biomeComp.Seed, (mapUid, grid), out var decals))
|
||||
{
|
||||
var text = $"Decals: {decals.Count}";
|
||||
sb.AppendLine(text);
|
||||
|
||||
foreach (var decal in decals)
|
||||
{
|
||||
var decalText = $"- {decal.ID}";
|
||||
sb.AppendLine(decalText);
|
||||
}
|
||||
}
|
||||
|
||||
if (_biomes.TryGetBiomeTile(nodePos, biomeComp.Layers, biomeComp.Seed, (mapUid, grid), out var tile))
|
||||
{
|
||||
var tileText = $"Tile: {_tileDefManager[tile.Value.TypeId].ID}";
|
||||
sb.AppendLine(tileText);
|
||||
}
|
||||
|
||||
args.ScreenHandle.DrawString(_font, mouseScreenPos.Position + new Vector2(0f, 32f), sb.ToString());
|
||||
}
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
using Content.Shared.Parallax.Biomes;
|
||||
|
||||
namespace Content.Client.Parallax;
|
||||
|
||||
public sealed class BiomeSystem : SharedBiomeSystem
|
||||
{
|
||||
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
using Robust.Client.Graphics;
|
||||
using Robust.Shared.Console;
|
||||
|
||||
namespace Content.Client.Parallax.Commands;
|
||||
|
||||
public sealed class ShowBiomeCommand : LocalizedCommands
|
||||
{
|
||||
[Dependency] private readonly IOverlayManager _overlayMgr = default!;
|
||||
|
||||
public override string Command => "showbiome";
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
if (_overlayMgr.HasOverlay<BiomeDebugOverlay>())
|
||||
{
|
||||
_overlayMgr.RemoveOverlay<BiomeDebugOverlay>();
|
||||
}
|
||||
else
|
||||
{
|
||||
_overlayMgr.AddOverlay(new BiomeDebugOverlay());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,6 @@
|
||||
using System.Numerics;
|
||||
using Content.Client.Parallax.Managers;
|
||||
using Content.Shared.CCVar;
|
||||
using Content.Shared.Parallax.Biomes;
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Client.Graphics;
|
||||
using Robust.Shared.Configuration;
|
||||
using Robust.Shared.Enums;
|
||||
@@ -19,7 +17,6 @@ public sealed class ParallaxOverlay : Overlay
|
||||
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
||||
[Dependency] private readonly IConfigurationManager _configurationManager = default!;
|
||||
[Dependency] private readonly IParallaxManager _manager = default!;
|
||||
private readonly SharedMapSystem _mapSystem;
|
||||
private readonly ParallaxSystem _parallax;
|
||||
|
||||
public override OverlaySpace Space => OverlaySpace.WorldSpaceBelowWorld;
|
||||
@@ -28,13 +25,12 @@ public sealed class ParallaxOverlay : Overlay
|
||||
{
|
||||
ZIndex = ParallaxSystem.ParallaxZIndex;
|
||||
IoCManager.InjectDependencies(this);
|
||||
_mapSystem = _entManager.System<SharedMapSystem>();
|
||||
_parallax = _entManager.System<ParallaxSystem>();
|
||||
}
|
||||
|
||||
protected override bool BeforeDraw(in OverlayDrawArgs args)
|
||||
{
|
||||
if (args.MapId == MapId.Nullspace || _entManager.HasComponent<BiomeComponent>(_mapSystem.GetMapOrInvalid(args.MapId)))
|
||||
if (args.MapId == MapId.Nullspace)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
|
||||
@@ -1,23 +1,9 @@
|
||||
using System.Linq;
|
||||
using Content.Client.Computer;
|
||||
using Content.Client.Stylesheets;
|
||||
using Content.Client.UserInterface.Controls;
|
||||
using Content.Shared.CCVar;
|
||||
using Content.Shared.Parallax.Biomes;
|
||||
using Content.Shared.Procedural;
|
||||
using Content.Shared.Salvage;
|
||||
using Content.Shared.Salvage.Expeditions;
|
||||
using Content.Shared.Salvage.Expeditions.Modifiers;
|
||||
using Content.Shared.Shuttles.BUIStates;
|
||||
using Robust.Client.AutoGenerated;
|
||||
using Robust.Client.Graphics;
|
||||
using Robust.Client.UserInterface;
|
||||
using Robust.Client.UserInterface.Controls;
|
||||
using Robust.Client.UserInterface.XAML;
|
||||
using Robust.Shared.Configuration;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Timing;
|
||||
using Robust.Shared.Utility;
|
||||
|
||||
namespace Content.Client.Salvage.UI;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user