-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPluginSettings.cpp
More file actions
38 lines (33 loc) · 1.65 KB
/
Copy pathPluginSettings.cpp
File metadata and controls
38 lines (33 loc) · 1.65 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
#include "pch.h"
#include "InstantFF.h"
void InstantFF::RenderSettings() {
auto renderCheckbox = [this](const std::string& cvarName, const char* label, const char* tooltip) {
CVarWrapper cvar = cvarManager->getCvar(cvarName);
if (!cvar) { return; }
bool enabled = cvar.getBoolValue();
if (ImGui::Checkbox(label, &enabled)) {
cvar.setValue(enabled);
}
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip(tooltip);
}
};
auto renderSlider = [this](const std::string& cvarName, const char* label, int& variable, const char* format, int min, int max) {
CVarWrapper cvar = cvarManager->getCvar(cvarName);
if (!cvar) { return; }
variable = cvar.getIntValue();
if (ImGui::SliderInt(label, &variable, min, max, format)) {
cvar.setValue(variable);
}
};
// Layout
ImGui::TextUnformatted("InstantFF Settings: Toggle Instant FF, change settings and more!");
renderCheckbox("InstantFF_enabled", "Enable plugin", "Toggle InstantFF");
ImGui::Separator();
ImGui::TextColored(ImVec4(1.0f, 1.0f, 0.0f, 1.0f), "Please note that the following settings are only available when the plugin is enabled:");
renderCheckbox("InstantFF_MateFF_enabled", "Enable MateFF", "Toggle InstantFF AutoFF on Mate's Vote");
renderCheckbox("InstantFF_TimedFF_enabled", "Enable TimedFF", "Toggle InstantFF AutoFF on Timer");
ImGui::TextUnformatted("Delays:");
renderSlider("InstantFF_MateFF_delay", "MateFF Delay", MateFFDelay, "%d seconds", 0, 10);
renderSlider("InstantFF_TimedFF_delay", "TimedFF Delay", TimedFFDelay, "%d seconds", 0, 150);
}