generated from MMike17/ArtOfRally_ModBase
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSettings.cs
91 lines (79 loc) · 3.62 KB
/
Settings.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
using UnityEngine;
using UnityModManagerNet;
using static UnityModManagerNet.UnityModManager;
namespace FASTER
{
public class Settings : ModSettings, IDrawable
{
[Header("General")]
[Draw("Min speed threshold", DrawType.Slider, Min = 0, Max = 150)]
public int minSpeedThreshold = 80;
[Draw("Max speed threshold", DrawType.Slider, Min = 50, Max = 200)]
public int maxSpeedThreshold = 180;
[Space]
[Draw("Effect up speed", DrawType.Slider, Min = 0.5f, Max = 7, Precision = 1)]
public float effectUpSpeed = 3;
[Draw("Effect down speed", DrawType.Slider, Min = 1, Max = 7, Precision = 1)]
public float effectDownSpeed = 4.5f;
[Space]
[Draw("Reset values", DrawType.Toggle)]
public bool resetValues = false;
[Header("Lens distortion")]
[Draw("Enable lens distortion", DrawType.Toggle)]
public bool enableLensDistortion = true;
[Draw("Distortion intensity", DrawType.Slider, VisibleOn = "enableLensDistortion|true", Min = 30, Max = 90)]
public int distortionIntensity = 40;
[Header("Chromatic aberration")]
[Draw("Enable chromatic aberration", DrawType.Toggle)]
public bool enableChromaticAberration = true;
[Draw("Aberration fast mode", DrawType.Toggle, VisibleOn = "enableChromaticAberration|true")]
public bool aberrationFastMode = false;
[Draw("Aberration intensity", DrawType.Slider, VisibleOn = "enableChromaticAberration|true", Min = 0.5f, Max = 3, Precision = 1)]
public float aberrationIntensity = 1;
[Header("Bloom")]
[Draw("Enable bloom", DrawType.Toggle)]
public bool enableBloom = true;
[Draw("Bloom threshold", DrawType.Slider, VisibleOn = "enableBloom|true", Min = 0.8f, Max = 0.2f, Precision = 1)]
public float bloomThreshold = 0.4f;
[Draw("Bloom Intensity", DrawType.Slider, VisibleOn = "enableBloom|true", Min = 0.5f, Max = 5, Precision = 1)]
public float bloomIntensity = 3f;
[Header("Vignette")]
[Draw("Enable vignette", DrawType.Toggle)]
public bool enableVignette = true;
[Draw("Vignette intensity", DrawType.Slider, VisibleOn = "enableVignette|true", Min = 0.15f, Max = 0.5f, Precision = 1)]
public float vignetteIntensity = 0.3f;
[Header("Debug")]
[Draw("Test max effect", DrawType.Toggle)]
public bool testMaxEffect = false;
[Draw("Disable info logs", DrawType.Toggle)]
public bool disableInfoLogs = true;
public override void Save(ModEntry modEntry) => Save(this, modEntry);
public void OnChange()
{
minSpeedThreshold = Mathf.Min(minSpeedThreshold, maxSpeedThreshold);
maxSpeedThreshold = Mathf.Max(minSpeedThreshold, maxSpeedThreshold);
if (resetValues)
{
if (!disableInfoLogs)
Main.Log("Reset settings.");
minSpeedThreshold = 80;
maxSpeedThreshold = 180;
effectUpSpeed = 3;
effectDownSpeed = 4.5f;
enableLensDistortion = true;
distortionIntensity = 40;
enableChromaticAberration = true;
aberrationFastMode = false;
aberrationIntensity = 1;
enableBloom = true;
bloomThreshold = 0.4f;
bloomIntensity = 3f;
enableVignette = true;
vignetteIntensity = 0.3f;
testMaxEffect = false;
disableInfoLogs = true;
resetValues = false;
}
}
}
}