-
Notifications
You must be signed in to change notification settings - Fork 0
/
Module.hpp
64 lines (51 loc) · 1.06 KB
/
Module.hpp
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
#pragma once
#include "util/Obf.hpp"
#include "util/StringH.hpp"
#include "util/Vec2H.hpp"
#include <string>
class Module {
private:
std::string name, description;
bool toggled;
int key;
public:
Module(std::string name, std::string description, int key = 0) {
this->name = name;
this->description = description;
this->key = key;
this->toggled = false;
}
virtual void onEnable() = 0;
virtual void onDisable() = 0;
std::string& getName() {
return name;
}
std::string& getDescription() {
return description;
}
int& getKey() {
return key;
}
void setKey(int key, bool log = false) {
this->key = key;
if (!log) return;
std::string out = obf("Set Key: [").c_str() + StringH::vkToString(key) + obf("] for Module: [").c_str() + this->name.c_str() + "]";
}
bool& isToggled() {
return toggled;
}
void setToggled(bool toggled, bool log = false) {
this->toggled = toggled;
if (!log) return;
}
void toggle(bool log = false) {
toggled = !toggled;
if (isToggled()) {
onEnable();
}
else {
onDisable();
}
if (!log) return;
}
};