-
-
Notifications
You must be signed in to change notification settings - Fork 74
Expand file tree
/
Copy pathDynamicFPS.hpp
More file actions
31 lines (24 loc) · 832 Bytes
/
DynamicFPS.hpp
File metadata and controls
31 lines (24 loc) · 832 Bytes
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
// Updated 1:54 UTC+8 by Leqixn
#pragma once
#include "Modules/Module.hpp"
#include <optional>
class DynamicFPS : public Module {
public:
DynamicFPS() : Module("DynamicFPS", "Misc", "Reduces FPS while AFK or on other Tab") {
this->name = "DynamicFPS";
addSetting(&enabled);
addSetting(&unfocusedFPS);
addSetting(&afkFPS);
addSetting(&afkTimeout);
}
Setting enabled = Setting("Enabled", true);
Setting unfocusedFPS = Setting("Unfocused FPS", 20.0f, 1.0f, 60.0f);
Setting afkFPS = Setting("AFK FPS", 30.0f, 1.0f, 60.0f);
Setting afkTimeout = Setting("AFK Timeout", 60.0f, 5.0f, 300.0f);
void onTick() override;
void onDisable() override;
private:
bool isAFK() const;
std::optional<int> originalLimit;
bool isThrottled = false;
};