mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-14 19:29:36 +01:00
Give GameShared an IDependencyCollection.
Death to IoCManager.
This commit is contained in:
@@ -43,6 +43,7 @@ END TEMPLATE-->
|
||||
* New system for exposing links to e.g. a Discord in the launcher.
|
||||
* The engine does not have a built-in method for configuring these, but it does now have a `StatusHostHelpers.AddLink` method to correctly format these from content. The idea is that content wires the types of links (with icon names) up itself via `IStatusHost.OnInfoRequest`.
|
||||
* See also [the HTTP API documentation](https://docs.spacestation14.io/en/engine/http-api) for reference.
|
||||
* `GameShared` now has a `Dependencies` property to allow access to the game's `IDependencyCollection`. This makes it possible to avoid using static `IoCManager` in `EntryPoint`-type content code.
|
||||
|
||||
### Bugfixes
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ namespace Robust.Shared.ContentPack
|
||||
public abstract class BaseModLoader
|
||||
{
|
||||
[Dependency] protected readonly IReflectionManager ReflectionManager = default!;
|
||||
[Dependency] private readonly IDependencyCollection _dependencies = default!;
|
||||
|
||||
private readonly List<ModuleTestingCallbacks> _testingCallbacks = new();
|
||||
|
||||
@@ -38,6 +39,7 @@ namespace Robust.Shared.ContentPack
|
||||
foreach (var entryPoint in entryPoints)
|
||||
{
|
||||
var entryPointInstance = (GameShared) Activator.CreateInstance(entryPoint)!;
|
||||
entryPointInstance.Dependencies = _dependencies;
|
||||
if (_testingCallbacks != null)
|
||||
{
|
||||
entryPointInstance.SetTestingCallbacks(_testingCallbacks);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Timing;
|
||||
|
||||
namespace Robust.Shared.ContentPack
|
||||
@@ -9,6 +10,7 @@ namespace Robust.Shared.ContentPack
|
||||
/// </summary>
|
||||
public abstract class GameShared : IDisposable
|
||||
{
|
||||
protected internal IDependencyCollection Dependencies { get; internal set; } = default!;
|
||||
protected List<ModuleTestingCallbacks> TestingCallbacks { get; private set; } = new();
|
||||
|
||||
public void SetTestingCallbacks(List<ModuleTestingCallbacks> testingCallbacks)
|
||||
|
||||
Reference in New Issue
Block a user