This repository was archived by the owner on Jul 18, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPowerToysGUI.cpp
More file actions
128 lines (87 loc) · 3.02 KB
/
Copy pathPowerToysGUI.cpp
File metadata and controls
128 lines (87 loc) · 3.02 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
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
#include "pch.h"
#include "PowerToys.h"
void PowerToys::SetImGuiContext(uintptr_t ctx)
{
ImGui::SetCurrentContext(reinterpret_cast<ImGuiContext*>(ctx));
}
std::string PowerToys::GetPluginName()
{
return "PowerToys!";
}
void PowerToys::RenderSettings() {
// Enable plugin
ImGui::TextUnformatted("A really cool plugin");
CVarWrapper pluginenableCvar = cvarManager->getCvar("plugin_enabled");
if (!pluginenableCvar) {
return;
}
bool pluginenabled = pluginenableCvar.getBoolValue();
if (ImGui::Checkbox("Enable plugin", &pluginenabled)) {
pluginenableCvar.setValue(pluginenabled);
if (pluginEnabled == true) {
this->log("PowerToys plugin enabled");
}
else if (pluginEnabled == false) {
this->log("PowerToys plugin disabled");
}
}
if (ImGui::IsItemHovered()) {
if (pluginEnabled == true) {
ImGui::SetTooltip("Disable this plugin (don't click this) :/");
}
else if (pluginEnabled == false) {
ImGui::SetTooltip("Enable this so cool plugin!");
}
}
// Settings
if (pluginEnabled == true) {
ImGui::NewLine();
ImGui::TextUnformatted("Settings");
CVarWrapper losefreeplayenableCvar = cvarManager->getCvar("loseallways_enabled");
if (!losefreeplayenableCvar) {
return;
}
bool losefreeplayenabled = losefreeplayenableCvar.getBoolValue();
if (ImGui::Checkbox("Enable load freeplay after lose", &losefreeplayenabled)) {
losefreeplayenableCvar.setValue(losefreeplayenabled);
this->log("Allways load Freeplay after lose Toogled");
}
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Toggle allways load Freeplay after lose");
}
//
CVarWrapper winfreeplayenableCvar = cvarManager->getCvar("winallways_enabled");
if (!winfreeplayenableCvar) {
return;
}
bool winfreeplayenabled = winfreeplayenableCvar.getBoolValue();
if (ImGui::Checkbox("Enable load freeplay after win", &winfreeplayenabled)) {
winfreeplayenableCvar.setValue(winfreeplayenabled);
this->log("Allways load Freeplay after win Toogled");
}
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Toggle allways load Freeplay after win");
}
//
CVarWrapper queueenableCvar = cvarManager->getCvar("queue_enabled");
if (!queueenableCvar) {
return;
}
bool queueenabled = queueenableCvar.getBoolValue();
if (ImGui::Checkbox("Enable instant queue after game", &queueenabled)) {
queueenableCvar.setValue(queueenabled);
this->log("Instant queue after game Toogled");
}
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Toggle instant queue after game");
}
// End settings
ImGui::NewLine();
ImGui::TextUnformatted("You can bind a button to the \"FAQ\" command (Freeplay_And_Queue).\nFor example, when you are in the main menu, you can click binded button, \nand it will take you to freeplay and turn on the queue for the last played game.");
ImGui::NewLine();
}
ImGui::Separator();
ImGui::NewLine();
ImGui::TextUnformatted("Plugin made by Skidam");
ImGui::TextUnformatted("Version " stringify(VERSION_MAJOR) "." stringify(VERSION_MINOR) "." stringify(VERSION_PATCH));
}