-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathConfig.cs
43 lines (36 loc) · 1.03 KB
/
Config.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
using Microsoft.Xna.Framework;
using Newtonsoft.Json;
using System.ComponentModel;
using System.Runtime.Serialization;
using Terraria;
using Terraria.ModLoader;
using Terraria.ModLoader.Config;
namespace SummonersAssociation
{
public class Config : ModConfig
{
public override ConfigScope Mode => ConfigScope.ClientSide;
public static Config Instance => ModContent.GetInstance<Config>();
[DefaultValue(true)]
public bool InventoryIcon;
[DefaultValue(true)]
public bool InfoIcon;
//0 - 1 : 0 - Main.screenWidth
//0 - 1 : 0 - Main.screenHeight
public const float DefaultX = 0.89f;
public const float DefaultY = 0.87f;
[Header("Blank")]
[DefaultValue(typeof(Vector2), "0.89, 0.87")]
public Vector2 Offset;
[Header("HintToServerConfig")]
[JsonIgnore]
[ShowDespiteJsonIgnore]
public bool Hint => true;
[OnDeserialized]
internal void OnDeserializedMethod(StreamingContext context) {
//Correct invalid values
Offset.X = Utils.Clamp(Offset.X, 0f, 1f);
Offset.Y = Utils.Clamp(Offset.Y, 0f, 1f);
}
}
}