summaryrefslogtreecommitdiff
path: root/src/KingSystem/System/AutoDim.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/KingSystem/System/AutoDim.cpp')
-rw-r--r--src/KingSystem/System/AutoDim.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/KingSystem/System/AutoDim.cpp b/src/KingSystem/System/AutoDim.cpp
new file mode 100644
index 00000000..c222f790
--- /dev/null
+++ b/src/KingSystem/System/AutoDim.cpp
@@ -0,0 +1,22 @@
+#include "KingSystem/System/AutoDim.h"
+#include <nn/oe.h>
+#include <prim/seadScopedLock.h>
+
+namespace ksys {
+
+SEAD_SINGLETON_DISPOSER_IMPL(AutoDim)
+
+void AutoDim::setEnabled(bool enable) {
+ const auto lock = sead::makeScopedLock(mCS);
+ mEnabled = enable;
+ if (enable)
+ nn::oe::SetUserInactivityDetectionTimeExtended(false);
+ else
+ nn::oe::SetUserInactivityDetectionTimeExtended(true);
+}
+
+bool AutoDim::isEnabled() const {
+ return mEnabled;
+}
+
+} // namespace ksys