sys: Added FPS limit, some power saving

#189
This commit is contained in:
WerWolv
2021-03-06 13:09:20 +01:00
parent 4f98149fa7
commit 6cba868e20
6 changed files with 38 additions and 1 deletions

View File

@@ -61,6 +61,17 @@ namespace hex::plugin::builtin {
return false;
});
ContentRegistry::Settings::add("hex.builtin.setting.interface", "hex.builtin.setting.interface.fps", 60, [](auto name, nlohmann::json &setting) {
static int fps = setting.is_number() ? static_cast<int>(setting) : 60;
if (ImGui::SliderInt(name.data(), &fps, 15, 60)) {
setting = fps;
return true;
}
return false;
});
}
}