-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMoveConnectionsConfigurator.cs
More file actions
36 lines (31 loc) · 1.14 KB
/
MoveConnectionsConfigurator.cs
File metadata and controls
36 lines (31 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
using Bindito.Core;
using Timberborn.EntityPanelSystem;
namespace Calloatti.MoveConnections
{
[Context("Game")]
internal class MoveConnectionsConfigurator : Configurator
{
private class EntityPanelModuleProvider : IProvider<EntityPanelModule>
{
private readonly MoveConnectionsFragment _moveConnectionsFragment;
public EntityPanelModuleProvider(MoveConnectionsFragment moveConnectionsFragment)
{
_moveConnectionsFragment = moveConnectionsFragment;
}
public EntityPanelModule Get()
{
EntityPanelModule.Builder builder = new EntityPanelModule.Builder();
// Inject the button into the Left Header container (alongside Delete and Copy Settings).
// Order '99' ensures it appears at the end of that specific icon row.
builder.AddLeftHeaderFragment(_moveConnectionsFragment, 99);
return builder.Build();
}
}
protected override void Configure()
{
Bind<MoveConnectionsTool>().AsSingleton();
Bind<MoveConnectionsFragment>().AsSingleton();
MultiBind<EntityPanelModule>().ToProvider<EntityPanelModuleProvider>().AsSingleton();
}
}
}