35 lines
874 B
C++
35 lines
874 B
C++
#include "FpsUnlocker.h"
|
|
|
|
#include "helpers.h"
|
|
|
|
FpsUnlockerModule::FpsUnlockerModule()
|
|
: BaseModule("FpsUnlocker", "Fps Unlocker", ModuleCategory::Visual) {}
|
|
|
|
void FpsUnlockerModule::RegisterTab() {
|
|
fps_target_ = 300;
|
|
}
|
|
|
|
void FpsUnlockerModule::Render() {
|
|
if (!ImGui::CollapsingHeader(Tr("Fps Unlocker"), ImGuiTreeNodeFlags_DefaultOpen)) {
|
|
return;
|
|
}
|
|
|
|
bool enabled = Enabled();
|
|
if (ImGui::Checkbox(Tr("ON / OFF"), &enabled)) {
|
|
SetEnabled(enabled);
|
|
}
|
|
|
|
if (Enabled()) {
|
|
ImGui::DragInt(Tr("Fps Value"), &fps_target_, 1.0f, 30, 500, "%d");
|
|
}
|
|
|
|
using FnSetTargetFrameRate = void (*)(int);
|
|
auto set_target_fps = GetIl2cppFn<FnSetTargetFrameRate>(IL2CPP::Application_set_targetFrameRate);
|
|
if (set_target_fps) {
|
|
set_target_fps(Enabled() ? fps_target_ : 60);
|
|
}
|
|
}
|
|
|
|
void FpsUnlockerModule::Update() {
|
|
}
|