-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathTimeLimitUI.cs
More file actions
30 lines (24 loc) · 783 Bytes
/
TimeLimitUI.cs
File metadata and controls
30 lines (24 loc) · 783 Bytes
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
using System;
using System.Collections.Generic;
using System.IO;
using Terraria;
using Terraria.ModLoader;
using Terraria.UI;
using TimeLimit.Logic;
using TimeLimit.NetProtocol;
namespace TimeLimit;
partial class TimeLimitUI : ModSystem {
public override void ModifyInterfaceLayers( List<GameInterfaceLayer> layers ) {
int idx = layers.FindIndex( layer => layer.Name.Equals( "Vanilla: Mouse Text" ) );
if( idx != -1 ) {
GameInterfaceDrawMethod drawMethod = delegate {
var myworld = ModContent.GetInstance<TimeLimitSystem>();
myworld.Logic.DrawTimers( Main.spriteBatch );
return true;
};
var interfaceLayer = new LegacyGameInterfaceLayer( "TimeLimit: Timers", drawMethod,
InterfaceScaleType.UI );
layers.Insert( idx, interfaceLayer );
}
}
}