-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConfig.cs
More file actions
50 lines (40 loc) · 1.19 KB
/
Copy pathConfig.cs
File metadata and controls
50 lines (40 loc) · 1.19 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
using CursorHP.Configs;
using Microsoft.Xna.Framework;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Terraria.GameContent.ItemDropRules;
using Terraria.ModLoader.Config;
namespace CursorHP
{
class Config : ModConfig
{
// You MUST specify a ConfigScope.
public override ConfigScope Mode => ConfigScope.ClientSide;
[DrawTicks]
[OptionStrings(new string[] { "Off", "Images", "Legacy" })]
[DefaultValue("Images")]
public string ModeEnum;
[Range(0f, 1f)]
[DrawTicks]
[DefaultValue(0.8f)]
[Increment(0.1f)]
[Slider]
public float AlphaSlider { get; set; }
[Expand(false)]
public CommonConfig Common = new();
public ImagesConfig Images = new();
[Expand(false)]
public LegacyConfig Legacy = new();
public override void OnLoaded()
{
// Ensure the value stays within the defined range
AlphaSlider = MathHelper.Clamp(AlphaSlider, 0f, 1f);
Legacy.onLoad();
Images.onLoad();
}
}
}