-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathClickerConfig.cs
More file actions
60 lines (46 loc) · 1.5 KB
/
ClickerConfig.cs
File metadata and controls
60 lines (46 loc) · 1.5 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
51
52
53
54
55
56
57
58
59
60
using System;
using System.ComponentModel;
using System.Runtime.Serialization;
using Terraria.ModLoader.Config;
namespace ClickerClass
{
public class ClickerConfigClient : ModConfig
{
public override ConfigScope Mode => ConfigScope.ClientSide;
// Automatically set by tModLoader
public static ClickerConfigClient Instance;
[Header("DisplayOptions")]
[DefaultValue(true)]
public bool ShowClassTags;
[DefaultValue(false)]
public bool ShowEffectToggle;
[DefaultValue(true)]
public bool ShowCustomCursors;
[DefaultValue(false)]
public bool ShowClickIndicator;
[DefaultValue(true)]
public bool ShowOthersClickIndicator;
[Header("GameplayOptions")]
[BackgroundColor(255, 175, 100)]
[DefaultValue(true)]
public bool ToggleAutoreuseLimiter;
public const int ToggleAutoreuseLimiterValue_Min = 1;
public const int ToggleAutoreuseLimiterValue_Max = 30;
[BackgroundColor(255, 175, 100)]
[Range(ToggleAutoreuseLimiterValue_Min, ToggleAutoreuseLimiterValue_Max), Increment(1), DefaultValue(15)]
[Slider]
public int ToggleAutoreuseLimiterValue;
[BackgroundColor(255, 175, 100)]
[DefaultValue(false)]
public bool ToggleAutoreuseLimiterAccessibility;
[OnDeserialized]
internal void OnDeserializedMethod(StreamingContext context)
{
Clamp(ref ToggleAutoreuseLimiterValue, ToggleAutoreuseLimiterValue_Min, ToggleAutoreuseLimiterValue_Max);
}
public static void Clamp(ref int value, int min, int max)
{
value = value < min ? min : (value > max ? max : value);
}
}
}