diff --git a/Source/sys-clk/overlay/Makefile b/Source/sys-clk/overlay/Makefile index 87792aad..008c4b87 100644 --- a/Source/sys-clk/overlay/Makefile +++ b/Source/sys-clk/overlay/Makefile @@ -37,7 +37,7 @@ include ${TOPDIR}/lib/libultrahand/ultrahand.mk # version control constants #--------------------------------------------------------------------------------- #TARGET_VERSION := $(shell git describe --dirty --always --tags) -APP_VERSION := 1.0.0 +APP_VERSION := 0.22 TARGET_VERSION := $(APP_VERSION) #--------------------------------------------------------------------------------- diff --git a/Source/sys-clk/overlay/src/ui/gui/info_gui.cpp b/Source/sys-clk/overlay/src/ui/gui/info_gui.cpp new file mode 100644 index 00000000..1f51f322 --- /dev/null +++ b/Source/sys-clk/overlay/src/ui/gui/info_gui.cpp @@ -0,0 +1,75 @@ +/* + * Copyright (c) Souldbminer and Horizon OC Contributors + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "info_gui.h" +#include "../format.h" +#include +#include + +InfoGui::InfoGui() +{ + if (!this->Currentcontext) [[unlikely]] { + this->Currentcontext = new SysClkContext; + } + Result rc = sysclkIpcGetCurrentContext(this->Currentcontext); + if (R_FAILED(rc)) [[unlikely]] { + FatalGui::openWithResultCode("sysclkIpcGetCurrentContext", rc); + return; + } + +} + +InfoGui::~InfoGui() +{ + +} + + +void InfoGui::listUI() +{ + tsl::elm::ListItem* cpuSpeedoItem = + new tsl::elm::ListItem("CPU Speedo"); + cpuSpeedoItem->setValue(std::to_string(this->Currentcontext->speedos[HorizonOCSpeedo_CPU])); + this->listElement->addItem(cpuSpeedoItem); + + tsl::elm::ListItem* gpuSpeedoItem = + new tsl::elm::ListItem("GPU Speedo"); + gpuSpeedoItem->setValue(std::to_string(this->Currentcontext->speedos[HorizonOCSpeedo_GPU])); + this->listElement->addItem(gpuSpeedoItem); + + tsl::elm::ListItem* socSpeedoItem = + new tsl::elm::ListItem("GPU Speedo"); + socSpeedoItem->setValue(std::to_string(this->Currentcontext->speedos[HorizonOCSpeedo_SOC])); + this->listElement->addItem(socSpeedoItem); +} + +void InfoGui::update() +{ + BaseMenuGui::update(); + +} + +void InfoGui::refresh() +{ + BaseMenuGui::refresh(); + + static int frameCounter = 0; + + if (this->context && ++frameCounter >= 60) { + frameCounter = 0; + + } +} \ No newline at end of file diff --git a/Source/sys-clk/overlay/src/ui/gui/info_gui.h b/Source/sys-clk/overlay/src/ui/gui/info_gui.h new file mode 100644 index 00000000..0f223b07 --- /dev/null +++ b/Source/sys-clk/overlay/src/ui/gui/info_gui.h @@ -0,0 +1,38 @@ +/* + * Copyright (c) Souldbminer and Horizon OC Contributors + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once +#include "../../ipc.h" +#include "base_menu_gui.h" +#include "freq_choice_gui.h" +#include "value_choice_gui.h" +#include "fatal_gui.h" +#include +#include + +class InfoGui : public BaseMenuGui +{ +protected: + SysClkContext* Currentcontext; +public: + InfoGui(); + ~InfoGui(); + + void listUI() override; + void update() override; + void refresh() override; + +}; \ No newline at end of file diff --git a/Source/sys-clk/overlay/src/ui/gui/main_gui.cpp b/Source/sys-clk/overlay/src/ui/gui/main_gui.cpp index 3a10026d..81a5d788 100644 --- a/Source/sys-clk/overlay/src/ui/gui/main_gui.cpp +++ b/Source/sys-clk/overlay/src/ui/gui/main_gui.cpp @@ -31,7 +31,7 @@ #include "app_profile_gui.h" #include "global_override_gui.h" #include "misc_gui.h" - +#include "info_gui.h" void MainGui::listUI() { // this->enabledToggle = new tsl::elm::ToggleListItem("Enable", false); @@ -97,7 +97,19 @@ void MainGui::listUI() return false; }); this->listElement->addItem(miscItem); - } + + tsl::elm::ListItem* infoItem = new tsl::elm::ListItem("Information"); + infoItem->setClickListener([this](u64 keys) { + if((keys & HidNpadButton_A) == HidNpadButton_A) + { + tsl::changeTo(); + return true; + } + + return false; + }); + this->listElement->addItem(infoItem); +} void MainGui::refresh() { diff --git a/Source/sys-clk/overlay/src/ui/gui/main_gui.h b/Source/sys-clk/overlay/src/ui/gui/main_gui.h index 77b98a2e..ab2c2196 100644 --- a/Source/sys-clk/overlay/src/ui/gui/main_gui.h +++ b/Source/sys-clk/overlay/src/ui/gui/main_gui.h @@ -32,6 +32,7 @@ class MainGui : public BaseMenuGui { protected: + SysClkContext* context; tsl::elm::ToggleListItem* enabledToggle; public: