-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathConfigUi.cs
193 lines (145 loc) · 5.73 KB
/
ConfigUi.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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
using UnityEngine;
namespace JudahsSpeedUtils;
public class ConfigUi : MonoBehaviour
{
public bool open = true;
private Rect winRect = new(20, 20, 275, 695);
public void OnGUI()
{
if (open)
{
winRect = GUI.Window(0, winRect, WinProc, $"{PluginInfo.PLUGIN_NAME} ({PluginInfo.PLUGIN_VERSION})");
}
}
private float highestSpeed = 0f;
private void WinProc(int id)
{
var ox = 15f;
var oy = 30f;
var mx = winRect.width - 30;
{
var spd = Tools.Instance.GetPlayerSpeed();
if (spd > highestSpeed) highestSpeed = spd;
GUI.Label(new(ox, oy, mx, 20), $"Speed: {spd:F}");
oy += 20 + 5;
GUI.Label(new(ox, oy, mx, 20), $"Highest: {highestSpeed:F}");
oy += 20 + 5;
}
oy += 10;
{
var fps = Tools.Instance.FpsLimit;
var limiting = Tools.Instance.LimitFramerate;
GUI.Label(new(ox, oy, mx, 20), $"FPS: {1 / Time.deltaTime:F0}");
oy += 20 + 5;
GUI.Label(new(ox, oy, mx, 20), $"FPS Limit: {(limiting ? "<color=green>On</color>" : "<color=red>Off</color>")} ({fps})");
oy += 20 + 5;
if (GUI.Button(new(ox, oy, (mx / 2) - 5, 30), $"Toggle Limit (L)"))
{
Tools.Instance.ToggleFpsLimiter();
}
if (GUI.Button(new(ox + 5 + (mx / 2), oy, (mx / 2) - 5, 30), "Set FPS (30-60)"))
{
if (fps == 30)
{
Tools.Instance.FpsLimit = 60;
}
else
{
Tools.Instance.FpsLimit = 30;
}
if (limiting)
{
Application.targetFrameRate = Tools.Instance.FpsLimit;
}
}
oy += 30 + 5;
}
oy += 10;
{
GUI.Label(new(ox, oy, mx, 20), $"Rep: {Tools.Instance.GetCurrentRep()}/{Tools.Instance.GetRequiredRep()}");
oy += 20 + 5;
GUI.Label(new(ox, oy, mx, 20), $"Current Stage: {Tools.Instance.GetCurrentStage()}");
oy += 20 + 5;
GUI.Label(new(ox, oy, mx, 20), $"Selected Stage: {Tools.Instance.SelectedStage}");
oy += 20 + 5;
if (GUI.Button(new(ox, oy, (mx / 2) - 5, 30), $"Go To Stage"))
{
Tools.Instance.SwitchToSelectedStage();
}
if (GUI.Button(new(ox + 5 + (mx / 2), oy, (mx / 2) - 5, 30), $"Select Next Stage"))
{
Tools.Instance.SelectNextStage();
}
oy += 30 + 5;
}
{
var wanted = Tools.Instance.PlayerIsWanted();
GUI.Label(new(ox, oy, mx, 20), $"Wanted: {(wanted ? "<color=green>Yes</color>" : "<color=red>No</color>")}");
oy += 20 + 5;
if (GUI.Button(new(ox, oy, mx, 30), "End Wanted Status (K)"))
{
Tools.Instance.StopWantedStatus();
}
oy += 30 + 5;
var inv = Tools.Instance.Invulnerable;
if (GUI.Button(new(ox, oy, mx, 30), $"Invulnerable (I): {(inv ? "<color=green>On</color>" : "<color=red>Off</color>")}"))
{
Tools.Instance.Invulnerable = !Tools.Instance.Invulnerable;
}
oy += 30 + 5;
}
{
var loc = Tools.Instance.SavedPlayerLocation;
GUI.Label(new(ox, oy, mx, 20), $"Saved: ({loc.position.x}, {loc.position.y}, {loc.position.z})");
oy += 20 + 5;
if (GUI.Button(new(ox, oy, mx, 30), "Save Player Position (H)"))
{
Tools.Instance.SavePlayerPosition();
}
oy += 30 + 5;
if (GUI.Button(new(ox, oy, mx, 30), "Teleport to Position (J)"))
{
Tools.Instance.ResetPlayerPosition();
}
oy += 30 + 5;
if (GUI.Button(new(ox, oy, mx, 30), "Refil Boost (R)"))
{
Tools.Instance.RefilPlayerBoost();
}
oy += 30 + 5;
}
oy += 10;
{
GUI.Label(new(ox, oy, mx, 20), $"Character: {Tools.Instance.CurrentChar} ({Tools.Instance.OutfitIndex})");
oy += 20 + 5;
GUI.Label(new(ox, oy, mx, 20), $"Move Style: {Tools.Instance.CurrentStyle}");
oy += 20 + 5;
if (GUI.Button(new(ox, oy, mx, 30), "Play As Next Character"))
{
Tools.Instance.PlayAsNextCharacter();
}
oy += 30 + 5;
if (GUI.Button(new(ox, oy, mx, 30), "Use Next Move Style"))
{
Tools.Instance.UseNextMoveStyle();
}
oy += 30 + 5;
if (GUI.Button(new (ox, oy, mx, 30), "Wear Next Outfit"))
{
Tools.Instance.WearNextOutfit();
}
oy += 30 + 5;
}
GUI.DragWindow();
}
public void Update()
{
if (Input.GetKeyDown(KeyCode.Quote)) open = !open;
if (Input.GetKeyDown(KeyCode.L)) Tools.Instance.ToggleFpsLimiter();
if (Input.GetKeyDown(KeyCode.K)) Tools.Instance.StopWantedStatus();
if (Input.GetKeyDown(KeyCode.I)) Tools.Instance.Invulnerable = !Tools.Instance.Invulnerable;
if (Input.GetKeyDown(KeyCode.H)) Tools.Instance.SavePlayerPosition();
if (Input.GetKeyDown(KeyCode.J)) Tools.Instance.ResetPlayerPosition();
if (Input.GetKeyDown(KeyCode.R)) Tools.Instance.RefilPlayerBoost();
}
}