-
Notifications
You must be signed in to change notification settings - Fork 1
/
PartyInfoLayer.cs
50 lines (43 loc) · 1.36 KB
/
PartyInfoLayer.cs
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
using TaleWorlds.Engine.GauntletUI;
using TaleWorlds.Engine.Screens;
using TaleWorlds.GauntletUI.Data;
using TaleWorlds.Library;
namespace Accompany
{
internal class PartyInfoLayer : GlobalLayer
{
public static PartyInfoLayer Instance { get; private set; }
public PartyInfoLayerViewModel DataSource { get; } = new PartyInfoLayerViewModel();
public static bool Added { get; private set; }
public readonly GauntletMovie Movie;
private PartyInfoLayer()
{
var gauntletLayer = new GauntletLayer(1);
gauntletLayer.InputRestrictions.SetInputRestrictions();
Movie = (GauntletMovie) gauntletLayer.LoadMovie("PartyInfoLayer", DataSource);
Layer = gauntletLayer;
}
public static void OnInitialize()
{
if (Instance == null)
{
Instance = new PartyInfoLayer();
}
}
public static void AddToGlobalLayer()
{
Added = true;
ScreenManager.AddGlobalLayer(Instance, true);
}
public static void RemoveFromGlobalLayer()
{
Added = false;
ScreenManager.RemoveGlobalLayer(Instance);
}
protected override void OnTick(float dt)
{
base.OnTick(dt);
DataSource.Tick();
}
}
}